@salahnecibi/pi-next-ncb

extension

๐Ÿš€ 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

by โ€” ยท v1.0.2 ยท published 1mo ago

$ pi install npm:@salahnecibi/pi-next-ncb
downloads/mo
0
stars
โ€”
last push
โ€”
open issues
โ€”

Signals

license: MITtestspi manifest: missinginstall size: โ€”deps: 0peer deps: 0

Download trend

529 downloads ยท last 12 weeks (weekly)

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-ncb

Restart pi โ†’ /pi-next-status โ†’ you're in the next generation.


What You Get

PriComponentWhat It DoesHow To Access
๐Ÿ”ด P0Orchestration DashboardReal-time TUI showing every subagent, its status, tool calls, and duration โ€” liveAuto-widget + /dashboard
๐Ÿ”ด P0Semantic Compaction 2.0Structured compaction that preserves decisions, file changes, errors, and action items instead of vague summariesAuto on compaction + /compact-status
๐ŸŸก P1Streaming Tool Protocolstream_bash โ€” runs commands with output streaming to both the LLM and TUI in real-timeTool: stream_bash
๐ŸŸก P1Inspector PaneContext token breakdown, tool call timeline with durations, cost estimates โ€” visible instantlyCtrl+I or /inspector
๐ŸŸข P2Live Diff ViewerSnapshots files before edits, computes unified diffs after โ€” see exactly what changedAuto + /diff
๐ŸŸข P2pi Package SearchSearch 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 component

Dashboard & Inspector

/dashboard                   โ€” Open agent orchestration dashboard
Ctrl+I  or  /inspector       โ€” Toggle context/tool/cost inspector pane

Compaction

/compact-status              โ€” Show compaction statistics & history
/compact-pin <entry-id>      โ€” Pin a message so compaction never loses it

Diffs

/diff [file]                 โ€” Show recent unified diff from tool execution

Package Discovery

/pi-search <query>           โ€” Search npm for pi packages
/pi-info <package>            โ€” Show detailed package info
/pi-install <source>         โ€” Quick install shorthand

Deep 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:

ExtractedFromExample
DecisionsPattern matching ("we decided X", "approved Y")โ€ข Use PostgreSQL for the new schema
Filesedit/write tool call trackingwrite: src/db/migrations/001_init.sql
ErrorsError/exception pattern detectionโš  TypeError: Cannot read property 'x' of undefined
Action ItemsTodo/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 info

Also works as a standalone terminal command:

pi-search web
pi-search info @salahnecibi/pi-next-ncb

Requirements

DependencyVersion
pi-coding-agent>= 0.80.0
Node.js>= 18
TerminalAny 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 features

Development

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 publish

License

MIT โ€” Use it, fork it, ship it.