@salahnecibi/pi-next-ncb
v1.0.2
Published
๐ pi-next โ The ultimate next-gen enhancement suite for pi coding agent. Agent orchestration dashboard with real-time TUI, semantic compaction 2.0 that preserves decisions & files, streaming bash protocol with live output, context/tool/cost inspector, li
Downloads
449
Maintainers
Keywords
Readme
pi-next-ncb ๐
The ultimate next-gen enhancement suite for pi coding agent.
Transform pi into a full-featured agent IDE with real-time agent orchestration visibility, intelligent compaction, streaming tool output, and deep session introspection.
pi install npm:@salahnecibi/pi-next-ncbRestart pi โ /pi-next-status โ you're in the next generation.
What You Get
| Pri | Component | What It Does | How To Access |
|-----|-----------|-------------|---------------|
| ๐ด P0 | Orchestration Dashboard | Real-time TUI showing every subagent, its status, tool calls, and duration โ live | Auto-widget + /dashboard |
| ๐ด P0 | Semantic Compaction 2.0 | Structured compaction that preserves decisions, file changes, errors, and action items instead of vague summaries | Auto on compaction + /compact-status |
| ๐ก P1 | Streaming Tool Protocol | stream_bash โ runs commands with output streaming to both the LLM and TUI in real-time | Tool: stream_bash |
| ๐ก P1 | Inspector Pane | Context token breakdown, tool call timeline with durations, cost estimates โ visible instantly | Ctrl+I or /inspector |
| ๐ข P2 | Live Diff Viewer | Snapshots files before edits, computes unified diffs after โ see exactly what changed | Auto + /diff |
| ๐ข P2 | pi Package Search | Search npm for pi packages without leaving your terminal | /pi-search <query> + CLI |
Commands Reference
General
/pi-next-status โ Show all components with load state โ / โ
/pi-next-toggle <name> โ Enable/disable any componentDashboard & Inspector
/dashboard โ Open agent orchestration dashboard
Ctrl+I or /inspector โ Toggle context/tool/cost inspector paneCompaction
/compact-status โ Show compaction statistics & history
/compact-pin <entry-id> โ Pin a message so compaction never loses itDiffs
/diff [file] โ Show recent unified diff from tool executionPackage Discovery
/pi-search <query> โ Search npm for pi packages
/pi-info <package> โ Show detailed package info
/pi-install <source> โ Quick install shorthandDeep Dive
๐๏ธ Orchestration Dashboard (P0)
When you launch subagents via pi-subagents, a live TUI widget appears above the editor:
โญโ pi-next Orchestration Dashboard โโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ Active Agents: โ
โ โถ reviewer 12s 3 tools [tool: read] โ
โ โถ worker 45s 8 tools โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ scout 2 tools, 1 turn โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏNo config needed. Hooks into tool_call, tool_execution_start/end, and turn_start events automatically. Shows:
- Status icons:
โqueued,โถrunning,โธpaused,โdone,โfailed - Elapsed time per agent
- Tool call count and current tool name
๐ง Semantic Compaction 2.0 (P0)
When pi auto-compacts or you run /compact, this intercepts session_before_compact and builds a structured summary:
| Extracted | From | Example |
|-----------|------|---------|
| Decisions | Pattern matching ("we decided X", "approved Y") | โข Use PostgreSQL for the new schema |
| Files | edit/write tool call tracking | write: src/db/migrations/001_init.sql |
| Errors | Error/exception pattern detection | โ TypeError: Cannot read property 'x' of undefined |
| Action Items | Todo/follow-up patterns | โ Update the API docs for the new endpoint |
Use /compact-pin <entry-id> to mark entries as permanent โ they survive all future compactions.
๐ Streaming Tool Protocol (P1)
A new stream_bash tool that wraps bash execution with:
- Real-time streaming โ output is piped to both the LLM and the TUI simultaneously
- LLM mid-execution awareness โ the model sees progress updates every ~3 chunks
- Abort signal support โ press Escape to cancel, and the partial output is preserved
- Smart truncation โ 50KB limit keeps tail output, drops middle
Use it instead of bash for: npm test, long builds, deployment scripts, multi-minute installations.
๐ Inspector Pane (P1)
Press Ctrl+I or run /inspector for an instant breakdown:
โญโ pi-next Inspector โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Model: deepseek/deepseek-v4-flash โ
โ Context: 45,231 tokens โ
โ system: 8,120 tok โ
โ tools: 2,340 tok โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ Recent tools (23 total): โ
โ โ read path: src/index.ts โ
โ โ bash npm test -- --watch โ 12s
โ โ write path: dist/output.json โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ๐ Live Diff Viewer (P2)
Every edit and write tool call snapshots the target file before modification. After execution, a unified diff is computed showing:
--- a/src/app.ts
+++ b/src/app.ts
@@ -10,5 +10,8 @@
const port = 3000;
+ const db = await connect();
app.listen(port);Key changed lines are shown in notifications โ /diff for the full view.
๐ pi Package Search (P2)
Search npm for pi packages without leaving your editor:
/pi-search web โ Finds web-related pi packages
/pi-search pdf --limit 5 โ Top 5 PDF-processing packages
/pi-search agent --sort downloads โ Most popular agent packages
/pi-info @dotdotgod/pi โ Detailed package infoAlso works as a standalone terminal command:
pi-search web
pi-search info @salahnecibi/pi-next-ncbRequirements
| Dependency | Version | |-----------|---------| | pi-coding-agent | >= 0.80.0 | | Node.js | >= 18 | | Terminal | Any ANSI-capable (most modern terminals) |
Architecture
pi-next-ncb/
โโโ package.json โ npm + pi package manifest
โโโ README.md โ This file
โโโ LICENSE โ MIT
โโโ bin/
โ โโโ pi-search.mjs โ Standalone CLI for package search
โโโ src/
โ โโโ index.ts โ Main entry: loads & coordinates all components
โ โโโ orchestration-dashboard.ts โ P0: TUI agent dashboard
โ โโโ semantic-compaction.ts โ P0: Structured compaction hooks
โ โโโ streaming-tools.ts โ P1: stream_bash tool
โ โโโ inspector-pane.ts โ P1: Context/tool/cost inspector
โ โโโ diff-viewer.ts โ P2: Live diff on tool execution
โ โโโ pi-search.ts โ P2: npm package discovery commands
โโโ skills/
โโโ pi-next/
โโโ SKILL.md โ Skill: teaches LLM how to use pi-next featuresDevelopment
git clone https://github.com/salahnecibi/pi-next-ncb.git
cd pi-next-ncb
npm install
# Test locally
pi -e ./src/index.ts
# Publish
npm version patch
npm publishLicense
MIT โ Use it, fork it, ship it.
