@salahnecibi/pi-next
v1.0.0
Published
Next-generation enhancement suite for pi coding agent. Agent orchestration dashboard, semantic compaction, streaming tools, inspector pane, live diffs, and package search.
Maintainers
Readme
pi-next 🚀
Next-generation enhancements for pi coding agent.
Agent orchestration dashboard, semantic compaction, streaming tools, inspector pane, live diffs, and package search — all in one pi package.
pi install npm:@salahnecibi/pi-nextRestart pi, and you're ready. Run /pi-next-status to verify.
Components
| Priority | Component | Description | Access |
|----------|-----------|-------------|--------|
| 🔴 P0 | Orchestration Dashboard | Real-time TUI dashboard showing subagent status, tool calls, duration | Auto-widget + /dashboard |
| 🔴 P0 | Semantic Compaction 2.0 | Structured compaction preserving decisions, files, errors, action items | Auto (hooks) + /compact-status |
| 🟡 P1 | Streaming Tool Protocol | stream_bash tool with real-time output to LLM + TUI | Tool: stream_bash |
| 🟡 P1 | Inspector Pane | Context usage, tool timeline, cost breakdown | Ctrl+I or /inspector |
| 🟢 P2 | Live Diff Viewer | Unified diffs on write/edit tool calls | Auto + /diff |
| 🟢 P2 | pi Search | Discover pi packages from npm | /pi-search <query> + pi-search CLI |
Commands
/pi-next-status — Show all components and load state
/pi-next-toggle <name> — Enable/disable a component
/dashboard — Open agent orchestration dashboard
/inspector — Toggle inspector (or Ctrl+I)
/compact-status — Show compaction statistics
/compact-pin <entry-id> — Pin entry to survive compaction
/diff [file] — Show recent file diffs
/pi-search <query> — Search npm for pi packages
/pi-info <package> — Show package detailsKeyboard
| Key | Action |
|-----|--------|
| Ctrl+I | Toggle inspector pane |
How It Works
Orchestration Dashboard (P0)
When you launch subagents via pi-subagents, the dashboard widget appears above the editor showing:
╭─ pi-next Orchestration Dashboard ─────────────────────────╮
│ ● Active Agents: │
│ ▶ reviewer 12s 3 tools [tool: read] │
│ ▶ worker 45s 8 tools │
│ ────────────────────────────────────────────────── │
│ ✓ scout 2 tools, 1 turn │
╰────────────────────────────────────────────────────────────╯No setup needed — it hooks into tool_call and tool_execution_* events automatically.
Semantic Compaction 2.0 (P0)
When pi compacts context (auto or manual), this extension intercepts the session_before_compact event and produces a structured summary that preserves:
- Decisions made — extracted from text patterns ("we decided X", "approved Y")
- Files changed — tracked from edit/write tool calls
- Errors encountered — extracted error messages
- Action items — remaining todo items
Use /compact-pin <entry-id> to mark specific entries as permanent (survive compaction).
Streaming Tools (P1)
The stream_bash tool wraps bash execution with real-time streaming:
- Output pipes to both the LLM and the TUI simultaneously
- Progress updates every ~3 chunks so the LLM can react mid-execution
- Respects abort signals (cancel with Escape)
- 50KB auto-truncation with tail preservation
Use instead of bash for: test suites, builds, installs, long-running scripts.
Inspector Pane (P1)
Press Ctrl+I or run /inspector to see:
╭─ 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 │
╰────────────────────────────────────────────────────────────╯Diff Viewer (P2)
Every edit and write tool call snapshots the file before modification. After the tool completes, it computes a unified diff and shows key added/removed lines in notifications.
pi Search (P2)
Search npm for pi packages without leaving pi:
/pi-search web # Find web-related pi packages
/pi-search pdf --limit 5 # Top 5 PDF packages
/pi-info @dotdotgod/pi # Show package detailsAlso available as a standalone CLI: pi-search <query>
Architecture
pi-next/
├── 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: orchestrates all components
│ ├── orchestration-dashboard.ts # P0: Agent orchestration TUI widget
│ ├── 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 file edits
│ └── pi-search.ts # P2: Package search commands
└── skills/
└── pi-next/
└── SKILL.md # Skill: teaches LLM how to use pi-nextDevelopment
# Clone and install
git clone https://github.com/pi-packages/pi-next.git
cd pi-next
npm install
# Test locally with pi
pi -e ./src/index.ts
# Publish new version
npm version patch
npm publishRequirements
- pi >= 0.80.0
- Node.js >= 18 (for
fetch)
License
MIT
