@blackbelt-technology/pi-agent-dashboard 0.2.9 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +64 -8
- package/README.md +308 -101
- package/docs/architecture.md +515 -16
- package/package.json +14 -7
- package/packages/extension/package.json +11 -3
- package/packages/extension/src/__tests__/ask-user-tool.test.ts +300 -3
- package/packages/extension/src/__tests__/enrich-model-metadata.test.ts +201 -0
- package/packages/extension/src/__tests__/fork-entryid-timing.test.ts +100 -0
- package/packages/extension/src/__tests__/git-info.test.ts +67 -55
- package/packages/extension/src/__tests__/openspec-poller.test.ts +101 -96
- package/packages/extension/src/__tests__/process-scanner-kill.test.ts +61 -0
- package/packages/extension/src/__tests__/provider-register-reload.test.ts +394 -0
- package/packages/extension/src/__tests__/server-auto-start.test.ts +95 -4
- package/packages/extension/src/__tests__/server-launcher.test.ts +16 -0
- package/packages/extension/src/ask-user-tool.ts +289 -20
- package/packages/extension/src/bridge.ts +107 -6
- package/packages/extension/src/command-handler.ts +34 -39
- package/packages/extension/src/dev-build.ts +1 -1
- package/packages/extension/src/git-info.ts +9 -19
- package/packages/extension/src/pi-env.d.ts +1 -0
- package/packages/extension/src/process-scanner.ts +72 -38
- package/packages/extension/src/prompt-expander.ts +25 -4
- package/packages/extension/src/provider-register.ts +304 -16
- package/packages/extension/src/server-auto-start.ts +27 -1
- package/packages/extension/src/server-launcher.ts +71 -27
- package/packages/server/package.json +17 -2
- package/packages/server/src/__tests__/auto-attach.test.ts +10 -1
- package/packages/server/src/__tests__/auto-shutdown.test.ts +8 -2
- package/packages/server/src/__tests__/bootstrap-queue.test.ts +120 -0
- package/packages/server/src/__tests__/bootstrap-routes.test.ts +125 -0
- package/packages/server/src/__tests__/bootstrap-state.test.ts +119 -0
- package/packages/server/src/__tests__/browse-endpoint.test.ts +246 -10
- package/packages/server/src/__tests__/browser-gateway-handler-errors.test.ts +129 -0
- package/packages/server/src/__tests__/cli-parse.test.ts +11 -0
- package/packages/server/src/__tests__/concurrent-launch.test.ts +110 -0
- package/packages/server/src/__tests__/config-api.test.ts +68 -0
- package/packages/server/src/__tests__/cors.test.ts +34 -2
- package/packages/server/src/__tests__/crash-recovery.test.ts +88 -0
- package/packages/server/src/__tests__/directory-service.test.ts +234 -8
- package/packages/server/src/__tests__/editor-manager-pid-registry.test.ts +168 -0
- package/packages/server/src/__tests__/editor-manager.test.ts +33 -0
- package/packages/server/src/__tests__/editor-pid-registry.test.ts +191 -0
- package/packages/server/src/__tests__/editor-registry.test.ts +29 -15
- package/packages/server/src/__tests__/extension-register-appimage.test.ts +5 -1
- package/packages/server/src/__tests__/extension-register.test.ts +3 -1
- package/packages/server/src/__tests__/find-port-holders.test.ts +94 -0
- package/packages/server/src/__tests__/fix-pty-permissions.test.ts +59 -0
- package/packages/server/src/__tests__/force-kill-handler.test.ts +57 -8
- package/packages/server/src/__tests__/git-operations.test.ts +9 -7
- package/packages/server/src/__tests__/health-endpoint.test.ts +11 -13
- package/packages/server/src/__tests__/home-lock-escape-hatch.test.ts +60 -0
- package/packages/server/src/__tests__/home-lock-release.test.ts +85 -0
- package/packages/server/src/__tests__/home-lock.test.ts +308 -0
- package/packages/server/src/__tests__/is-pi-process.test.ts +36 -0
- package/packages/server/src/__tests__/node-guard.test.ts +85 -0
- package/packages/server/src/__tests__/openspec-tasks-parser.test.ts +178 -0
- package/packages/server/src/__tests__/openspec-tasks-routes.test.ts +180 -0
- package/packages/server/src/__tests__/package-manager-wrapper-resolve.test.ts +126 -0
- package/packages/server/src/__tests__/package-manager-wrapper.test.ts +45 -10
- package/packages/server/src/__tests__/pi-core-checker.test.ts +195 -0
- package/packages/server/src/__tests__/pi-core-routes.test.ts +184 -0
- package/packages/server/src/__tests__/pi-core-updater.test.ts +214 -0
- package/packages/server/src/__tests__/pi-version-skew.test.ts +165 -0
- package/packages/server/src/__tests__/preferences-store.test.ts +73 -4
- package/packages/server/src/__tests__/process-manager.test.ts +45 -18
- package/packages/server/src/__tests__/provider-auth-routes.test.ts +13 -3
- package/packages/server/src/__tests__/provider-probe.test.ts +287 -0
- package/packages/server/src/__tests__/provider-test-route.test.ts +149 -0
- package/packages/server/src/__tests__/recommended-routes.test.ts +389 -0
- package/packages/server/src/__tests__/restart-helper.test.ts +83 -0
- package/packages/server/src/__tests__/session-action-handler-headless-reload.test.ts +467 -0
- package/packages/server/src/__tests__/session-action-handler-reload-predicate.test.ts +73 -0
- package/packages/server/src/__tests__/session-action-handler-spawn-error.test.ts +74 -0
- package/packages/server/src/__tests__/session-file-dedup.test.ts +10 -10
- package/packages/server/src/__tests__/session-lifecycle-logging.test.ts +8 -2
- package/packages/server/src/__tests__/sleep-aware-heartbeat.test.ts +3 -1
- package/packages/server/src/__tests__/smoke-integration.test.ts +10 -10
- package/packages/server/src/__tests__/terminal-manager.test.ts +41 -1
- package/packages/server/src/__tests__/test-server-canary.test.ts +31 -0
- package/packages/server/src/__tests__/tool-routes.test.ts +277 -0
- package/packages/server/src/__tests__/trusted-networks-config.test.ts +19 -0
- package/packages/server/src/__tests__/trusted-networks-no-oauth-roundtrip.test.ts +126 -0
- package/packages/server/src/__tests__/tunnel-cleanup.test.ts +90 -0
- package/packages/server/src/__tests__/tunnel.test.ts +103 -6
- package/packages/server/src/__tests__/ws-ping-pong.test.ts +10 -2
- package/packages/server/src/__tests__/wsl-tmux-probe-cache.test.ts +44 -0
- package/packages/server/src/bootstrap-queue.ts +130 -0
- package/packages/server/src/bootstrap-state.ts +131 -0
- package/packages/server/src/browse.ts +108 -9
- package/packages/server/src/browser-gateway.ts +16 -3
- package/packages/server/src/browser-handlers/directory-handler.ts +23 -8
- package/packages/server/src/browser-handlers/session-action-handler.ts +213 -79
- package/packages/server/src/browser-handlers/session-action-helpers.ts +36 -0
- package/packages/server/src/cli.ts +256 -32
- package/packages/server/src/config-api.ts +16 -0
- package/packages/server/src/directory-service.ts +270 -39
- package/packages/server/src/editor-detection.ts +12 -9
- package/packages/server/src/editor-manager.ts +39 -5
- package/packages/server/src/editor-pid-registry.ts +199 -0
- package/packages/server/src/editor-registry.ts +22 -25
- package/packages/server/src/fix-pty-permissions.ts +44 -0
- package/packages/server/src/git-operations.ts +1 -1
- package/packages/server/src/headless-pid-registry.ts +16 -20
- package/packages/server/src/home-lock-release.ts +72 -0
- package/packages/server/src/home-lock.ts +389 -0
- package/packages/server/src/node-guard.ts +52 -0
- package/packages/server/src/npm-search-proxy.ts +71 -0
- package/packages/server/src/openspec-tasks.ts +158 -0
- package/packages/server/src/package-manager-wrapper.ts +225 -34
- package/packages/server/src/pi-core-checker.ts +290 -0
- package/packages/server/src/pi-core-updater.ts +172 -0
- package/packages/server/src/pi-gateway.ts +7 -0
- package/packages/server/src/pi-resource-scanner.ts +5 -8
- package/packages/server/src/pi-version-skew.ts +196 -0
- package/packages/server/src/preferences-store.ts +17 -3
- package/packages/server/src/process-manager.ts +403 -222
- package/packages/server/src/provider-probe.ts +234 -0
- package/packages/server/src/restart-helper.ts +130 -0
- package/packages/server/src/routes/bootstrap-routes.ts +88 -0
- package/packages/server/src/routes/file-routes.ts +30 -3
- package/packages/server/src/routes/openspec-routes.ts +107 -1
- package/packages/server/src/routes/pi-core-routes.ts +140 -0
- package/packages/server/src/routes/provider-auth-routes.ts +12 -10
- package/packages/server/src/routes/provider-routes.ts +55 -2
- package/packages/server/src/routes/recommended-routes.ts +225 -0
- package/packages/server/src/routes/system-routes.ts +30 -34
- package/packages/server/src/routes/tool-routes.ts +153 -0
- package/packages/server/src/server-pid.ts +5 -9
- package/packages/server/src/server.ts +363 -26
- package/packages/server/src/session-api.ts +77 -8
- package/packages/server/src/session-bootstrap.ts +17 -3
- package/packages/server/src/session-diff.ts +21 -21
- package/packages/server/src/terminal-manager.ts +65 -20
- package/packages/server/src/test-env-guard.ts +26 -0
- package/packages/server/src/test-support/test-server.ts +63 -0
- package/packages/server/src/tunnel.ts +172 -34
- package/packages/shared/package.json +10 -3
- package/packages/shared/src/__tests__/{tool-resolver.test.ts → binary-lookup.test.ts} +32 -12
- package/packages/shared/src/__tests__/bootstrap/README.md +133 -0
- package/packages/shared/src/__tests__/bootstrap/__snapshots__/cube.test.ts.snap +370 -0
- package/packages/shared/src/__tests__/bootstrap/assertions.ts +136 -0
- package/packages/shared/src/__tests__/bootstrap/cube.test.ts +47 -0
- package/packages/shared/src/__tests__/bootstrap/cube.ts +66 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/a-electron.test.ts.snap +83 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/b-npm-global.test.ts.snap +89 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/c-dev-monorepo.test.ts.snap +33 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/d-overrides.test.ts.snap +20 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/e-stale-partial.test.ts.snap +61 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/f-cwd-variants.test.ts.snap +33 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/g-windows-specifics.test.ts.snap +46 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/j-path-gui-minimal.test.ts.snap +12 -0
- package/packages/shared/src/__tests__/bootstrap/families/a-electron.test.ts +156 -0
- package/packages/shared/src/__tests__/bootstrap/families/b-npm-global.test.ts +157 -0
- package/packages/shared/src/__tests__/bootstrap/families/c-dev-monorepo.test.ts +102 -0
- package/packages/shared/src/__tests__/bootstrap/families/d-overrides.test.ts +76 -0
- package/packages/shared/src/__tests__/bootstrap/families/e-stale-partial.test.ts +94 -0
- package/packages/shared/src/__tests__/bootstrap/families/f-cwd-variants.test.ts +87 -0
- package/packages/shared/src/__tests__/bootstrap/families/g-windows-specifics.test.ts +143 -0
- package/packages/shared/src/__tests__/bootstrap/families/h-home-drift.test.ts +64 -0
- package/packages/shared/src/__tests__/bootstrap/families/i-malformed-settings.test.ts +77 -0
- package/packages/shared/src/__tests__/bootstrap/families/index.ts +19 -0
- package/packages/shared/src/__tests__/bootstrap/families/j-path-gui-minimal.test.ts +61 -0
- package/packages/shared/src/__tests__/bootstrap/families/k-dashboard-absent.test.ts +50 -0
- package/packages/shared/src/__tests__/bootstrap/families/l-instance-coordination.test.ts +272 -0
- package/packages/shared/src/__tests__/bootstrap/fixtures/dev-monorepo.ts +58 -0
- package/packages/shared/src/__tests__/bootstrap/fixtures/electron-layout.ts +84 -0
- package/packages/shared/src/__tests__/bootstrap/fixtures/index.ts +9 -0
- package/packages/shared/src/__tests__/bootstrap/fixtures/managed-install.ts +85 -0
- package/packages/shared/src/__tests__/bootstrap/fixtures/npm-global-layout.ts +122 -0
- package/packages/shared/src/__tests__/bootstrap/fixtures/pi-versions.ts +36 -0
- package/packages/shared/src/__tests__/bootstrap/fixtures/settings-json.ts +39 -0
- package/packages/shared/src/__tests__/bootstrap/harness.smoke.test.ts +220 -0
- package/packages/shared/src/__tests__/bootstrap/harness.ts +413 -0
- package/packages/shared/src/__tests__/bootstrap/scenarios-skipped.ts +125 -0
- package/packages/shared/src/__tests__/bootstrap/scenarios.ts +132 -0
- package/packages/shared/src/__tests__/bridge-register.test.ts +29 -6
- package/packages/shared/src/__tests__/config-openspec.test.ts +106 -0
- package/packages/shared/src/__tests__/config.test.ts +59 -3
- package/packages/shared/src/__tests__/detached-spawn.test.ts +243 -0
- package/packages/shared/src/__tests__/managed-paths.test.ts +60 -0
- package/packages/shared/src/__tests__/no-direct-child-process.test.ts +112 -0
- package/packages/shared/src/__tests__/no-direct-platform-branch.test.ts +174 -0
- package/packages/shared/src/__tests__/no-direct-process-kill.test.ts +105 -0
- package/packages/shared/src/__tests__/openspec-poller.test.ts +44 -0
- package/packages/shared/src/__tests__/platform-commands.test.ts +108 -0
- package/packages/shared/src/__tests__/platform-exec.test.ts +103 -0
- package/packages/shared/src/__tests__/platform-git.test.ts +194 -0
- package/packages/shared/src/__tests__/platform-npm.test.ts +137 -0
- package/packages/shared/src/__tests__/platform-openspec.test.ts +92 -0
- package/packages/shared/src/__tests__/platform-paths.test.ts +284 -0
- package/packages/shared/src/__tests__/platform-process-scan.test.ts +55 -0
- package/packages/shared/src/__tests__/platform-process.test.ts +160 -0
- package/packages/shared/src/__tests__/platform-runner.test.ts +173 -0
- package/packages/shared/src/__tests__/platform-shell.test.ts +74 -0
- package/packages/shared/src/__tests__/process-identify.test.ts +113 -0
- package/packages/shared/src/__tests__/recommended-extensions.test.ts +156 -0
- package/packages/shared/src/__tests__/resolve-jiti.test.ts +43 -7
- package/packages/shared/src/__tests__/semaphore.test.ts +119 -0
- package/packages/shared/src/__tests__/source-matching.test.ts +143 -0
- package/packages/shared/src/__tests__/spawn-mechanism.test.ts +131 -0
- package/packages/shared/src/__tests__/tool-registry-definitions.test.ts +239 -0
- package/packages/shared/src/__tests__/tool-registry-overrides.test.ts +137 -0
- package/packages/shared/src/__tests__/tool-registry-registry.test.ts +343 -0
- package/packages/shared/src/bootstrap-install.ts +212 -0
- package/packages/shared/src/bridge-register.ts +87 -20
- package/packages/shared/src/browser-protocol.ts +93 -1
- package/packages/shared/src/config.ts +87 -15
- package/packages/shared/src/managed-paths.ts +31 -4
- package/packages/shared/src/openspec-poller.ts +71 -49
- package/packages/shared/src/{tool-resolver.ts → platform/binary-lookup.ts} +125 -25
- package/packages/shared/src/platform/commands.ts +100 -0
- package/packages/shared/src/platform/detached-spawn.ts +305 -0
- package/packages/shared/src/platform/exec.ts +220 -0
- package/packages/shared/src/platform/git.ts +155 -0
- package/packages/shared/src/platform/index.ts +15 -0
- package/packages/shared/src/platform/npm.ts +162 -0
- package/packages/shared/src/platform/openspec.ts +91 -0
- package/packages/shared/src/platform/paths.ts +276 -0
- package/packages/shared/src/platform/process-identify.ts +126 -0
- package/packages/shared/src/platform/process-scan.ts +94 -0
- package/packages/shared/src/platform/process.ts +168 -0
- package/packages/shared/src/platform/runner.ts +369 -0
- package/packages/shared/src/platform/shell.ts +44 -0
- package/packages/shared/src/platform/spawn-mechanism.ts +124 -0
- package/packages/shared/src/platform/subprocess-adapter.ts +124 -0
- package/packages/shared/src/recommended-extensions.ts +196 -0
- package/packages/shared/src/resolve-jiti.ts +62 -3
- package/packages/shared/src/rest-api.ts +97 -0
- package/packages/shared/src/semaphore.ts +83 -0
- package/packages/shared/src/source-matching.ts +126 -0
- package/packages/shared/src/test-support/setup-home.ts +74 -0
- package/packages/shared/src/tool-registry/definitions.ts +342 -0
- package/packages/shared/src/tool-registry/index.ts +56 -0
- package/packages/shared/src/tool-registry/overrides.ts +118 -0
- package/packages/shared/src/tool-registry/registry.ts +262 -0
- package/packages/shared/src/tool-registry/strategies.ts +198 -0
- package/packages/shared/src/tool-registry/types.ts +180 -0
- package/packages/shared/src/types.ts +7 -0
package/README.md
CHANGED
|
@@ -1,29 +1,41 @@
|
|
|
1
1
|
# PI Dashboard
|
|
2
2
|
|
|
3
3
|
[](https://github.com/BlackBeltTechnology/pi-agent-dashboard/actions/workflows/ci.yml)
|
|
4
|
-
[](https://www.npmjs.com/package/@blackbelt-technology/pi-dashboard)
|
|
4
|
+
[](https://www.npmjs.com/package/@blackbelt-technology/pi-agent-dashboard)
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
6
|
|
|
7
7
|
A web-based dashboard for monitoring and interacting with [pi](https://github.com/badlogic/pi-mono) agent sessions from any browser, including mobile.
|
|
8
8
|
|
|
9
|
+
**Website:** [blackbelttechnology.github.io/pi-agent-dashboard](https://blackbelttechnology.github.io/pi-agent-dashboard) — animated tour, screenshots, and install guide.
|
|
10
|
+
|
|
11
|
+
**Changelog:** see [`CHANGELOG.md`](CHANGELOG.md) for release notes.
|
|
12
|
+
|
|
13
|
+
**Releasing:** see [`docs/release-process.md`](docs/release-process.md) for the cut-a-release workflow.
|
|
14
|
+
|
|
9
15
|
## Features
|
|
10
16
|
|
|
11
17
|
- **Real-time session mirroring** — See all active pi sessions with live streaming messages
|
|
12
18
|
- **Bidirectional interaction** — Send prompts and commands from the browser
|
|
13
|
-
- **Workspace management** — Organize sessions by project folder
|
|
19
|
+
- **Workspace management** — Organize sessions by project folder with pinned directories and drag-to-reorder
|
|
14
20
|
- **Command autocomplete** — `/` prefix triggers command dropdown with filtering
|
|
15
|
-
- **Session statistics** — Token counts, costs, model info, thinking level
|
|
21
|
+
- **Session statistics** — Token counts, costs, model info, thinking level, context usage bar
|
|
16
22
|
- **Elapsed time tracking** — Live ticking counters on running operations, final duration on completed tool calls and reasoning blocks
|
|
17
|
-
- **Mobile-friendly** — Responsive layout with swipe drawer and
|
|
23
|
+
- **Mobile-friendly** — Responsive layout with swipe drawer, touch targets, and mobile action menus
|
|
18
24
|
- **Session spawning** — Launch new pi sessions from the dashboard (headless by default, or via tmux)
|
|
19
|
-
- **
|
|
25
|
+
- **PromptBus architecture** — Unified prompt routing with adapters (TUI, dashboard, custom). Interactive dialogs (confirm/select/input/editor/multiselect) survive page refresh and server restart. First-response-wins semantics with cross-adapter dismissal.
|
|
20
26
|
- **On-demand session loading** — Browse historical sessions with lazy-loaded content from pi session files
|
|
21
27
|
- **Integrated terminal** — Full browser-based terminal emulator (xterm.js + node-pty) with ANSI color support, scrollback, and keep-alive
|
|
22
|
-
- **pi-flows integration** — Live flow execution dashboard with agent cards, detail views, summary, abort/auto controls. Launch flows and
|
|
28
|
+
- **pi-flows integration** — Live flow execution dashboard with agent cards, detail views, flow graph visualization, summary, abort/auto controls. Launch flows and design new ones with the Flow Architect — all from the browser. Fork decisions and subagent dialogs forwarded via PromptBus.
|
|
23
29
|
- **Force kill escalation** — Two-click Stop button (in command bar and on running tool cards): first click sends soft abort, second click force-kills the process (SIGTERM → SIGKILL). Session preserved as "ended" for resume/fork. Repeated tool calls (e.g. health check loops) are auto-collapsed with a count badge.
|
|
24
30
|
- **Searchable select dialogs** — Keyboard-navigable picker with real-time filtering for OpenSpec changes and flow commands
|
|
25
31
|
- **Browser-based provider auth** — Sign in to Anthropic, OpenAI Codex, GitHub Copilot, Gemini CLI, and Antigravity directly from Settings. Enter API keys for other providers. Credentials saved to `~/.pi/agent/auth.json` and live-synced to running sessions.
|
|
32
|
+
- **Custom LLM providers** — Add OpenAI-compatible, Anthropic-compatible, or Google Generative AI endpoints (Settings → Providers → LLM Providers). Each card has a **Test** button that pings the provider's `/models` endpoint to verify your base URL + API key combination before saving. Adding, editing, or removing a provider takes effect live in every running pi session — no restart required.
|
|
26
33
|
- **Package management** — Browse, install, update, and remove pi packages from the dashboard. Search the npm registry for pi-package extensions/skills/themes, install from npm or git URL, manage global packages in Settings and local packages per workspace. All active sessions auto-reload after changes.
|
|
34
|
+
- **OpenSpec integration** — Browse specs, view archive history, manage changes, and create new changes from the session sidebar
|
|
35
|
+
- **Diff viewer** — Side-by-side and unified diff views with file tree navigation for reviewing agent changes
|
|
36
|
+
- **Editor integration** — Open files in your preferred editor (VS Code, Cursor, etc.) directly from tool call cards
|
|
37
|
+
- **Markdown preview** — Rendered markdown views with search, mermaid diagrams, and syntax highlighting
|
|
38
|
+
- **Network discovery** — mDNS-based auto-discovery of other dashboard servers on the local network; connect to known remote servers
|
|
27
39
|
|
|
28
40
|
## Architecture
|
|
29
41
|
|
|
@@ -57,47 +69,47 @@ The system has three components:
|
|
|
57
69
|
|
|
58
70
|
| Component | Location | Role |
|
|
59
71
|
|-----------|----------|------|
|
|
60
|
-
| **Bridge Extension** | `
|
|
61
|
-
| **Dashboard Server** | `
|
|
62
|
-
| **Web Client** | `
|
|
72
|
+
| **Bridge Extension** | `packages/extension/` | Runs in every pi session. Forwards events, relays commands, auto-starts server, hosts PromptBus. |
|
|
73
|
+
| **Dashboard Server** | `packages/server/` | Aggregates events in-memory, persists metadata to JSON, serves the web client, manages terminals. |
|
|
74
|
+
| **Web Client** | `packages/client/` | React + Tailwind UI with real-time WebSocket updates. |
|
|
75
|
+
| **Shared** | `packages/shared/` | TypeScript types, protocols, and utilities shared across all packages. |
|
|
63
76
|
|
|
64
77
|
See [docs/architecture.md](docs/architecture.md) for detailed data flows, reconnection logic, and persistence model.
|
|
65
78
|
|
|
66
|
-
##
|
|
79
|
+
## Getting Started
|
|
67
80
|
|
|
68
|
-
|
|
69
|
-
|-------------|-----|---------|
|
|
70
|
-
| **[pi](https://github.com/badlogic/pi-mono)** or **[Oh My Pi](https://www.npmjs.com/package/@oh-my-pi/pi-coding-agent)** | The AI coding agent that the dashboard monitors | `npm i -g @mariozechner/pi-coding-agent` |
|
|
71
|
-
| **Node.js ≥ 20** | Runtime for the dashboard server | [nodejs.org](https://nodejs.org/) |
|
|
72
|
-
| **C++ build tools** | Required by `node-pty` native addon for terminal emulation | Xcode CLI Tools (macOS) / `build-essential` (Linux) |
|
|
81
|
+
There are three ways to use the dashboard, from simplest to most flexible:
|
|
73
82
|
|
|
74
|
-
###
|
|
83
|
+
### Option A: Electron Desktop App (standalone — no prerequisites)
|
|
75
84
|
|
|
76
|
-
|
|
77
|
-
|------|---------|-------------|
|
|
78
|
-
| **tmux** | Spawn new pi sessions from the browser in a tmux window | When `spawnStrategy` is `"tmux"` |
|
|
79
|
-
| **[zrok](https://zrok.io/)** | Expose dashboard over the internet via tunnel (auto-connects on server start). Install with `brew install zrok` (macOS) and run `zrok enable <token>` to enroll — the dashboard reads zrok's own config (`~/.zrok2/environment.json`), no keys are stored in the dashboard. Uses reserved shares for persistent URLs across restarts. | When `tunnel.enabled` is `true` (default) |
|
|
85
|
+
Download a pre-built installer from [GitHub Releases](https://github.com/BlackBeltTechnology/pi-agent-dashboard/releases) for your platform:
|
|
80
86
|
|
|
81
|
-
|
|
87
|
+
| Platform | Download |
|
|
88
|
+
|----------|----------|
|
|
89
|
+
| **macOS** (Apple Silicon) | `.dmg` (arm64) |
|
|
90
|
+
| **macOS** (Intel) | `.dmg` (x64) |
|
|
91
|
+
| **Linux** (x64) | `.deb` or `.AppImage` |
|
|
92
|
+
| **Linux** (ARM64) | `.deb` |
|
|
93
|
+
| **Windows** (x64) | `.exe` (NSIS installer), `.zip`, or portable `.exe` |
|
|
94
|
+
| **Windows** (ARM64) | `.zip` or portable `.exe` |
|
|
82
95
|
|
|
83
|
-
|
|
96
|
+
On first launch, a setup wizard guides you through:
|
|
84
97
|
|
|
85
|
-
**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
98
|
+
1. **Choose a mode:**
|
|
99
|
+
- **Standalone** — Bundles Node.js and auto-installs pi + dashboard + openspec into `~/.pi-dashboard/`. No Node.js, npm, or build tools needed.
|
|
100
|
+
- **Power User** — Uses your existing system-installed pi and dashboard.
|
|
101
|
+
2. **Configure an API key** — Enter your Anthropic/OpenAI key or sign in via browser-based OAuth.
|
|
102
|
+
3. **Recommended extensions** — Install the curated set of pi extensions the dashboard is built to work with (see [Recommended extensions](#recommended-extensions) below). You can skip and manage them later from the Packages tab.
|
|
103
|
+
4. **Done** — The app discovers or spawns a dashboard server automatically.
|
|
89
104
|
|
|
90
|
-
**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
cd pi-agent-dashboard
|
|
94
|
-
npm install
|
|
95
|
-
pi install /path/to/pi-agent-dashboard
|
|
96
|
-
```
|
|
105
|
+
> **No terminal, no npm, no Node.js required.** The Electron app is fully self-contained in standalone mode. It bundles a Node.js runtime, spawns the dashboard server internally, and manages all dependencies. System tray integration keeps it running in the background.
|
|
106
|
+
|
|
107
|
+
### Option B: pi Package (recommended for CLI users)
|
|
97
108
|
|
|
98
|
-
|
|
109
|
+
Requires [pi](https://github.com/badlogic/pi-mono) (or [Oh My Pi](https://www.npmjs.com/package/@oh-my-pi/pi-coding-agent)) and Node.js **≥ 22.18.0** (or ≥ 24.3.0). Older Node 22.x / 24.x builds are affected by [nodejs/node#58515](https://github.com/nodejs/node/issues/58515) which crashes Fastify at startup.
|
|
99
110
|
|
|
100
111
|
```bash
|
|
112
|
+
pi install npm:@blackbelt-technology/pi-agent-dashboard
|
|
101
113
|
pi
|
|
102
114
|
```
|
|
103
115
|
|
|
@@ -107,24 +119,79 @@ The bridge extension auto-starts the dashboard server on first launch. You'll se
|
|
|
107
119
|
🌐 Dashboard started at http://localhost:8000
|
|
108
120
|
```
|
|
109
121
|
|
|
110
|
-
### 3. Open the dashboard
|
|
111
|
-
|
|
112
122
|
Open **http://localhost:8000** in any browser. All active pi sessions appear automatically.
|
|
113
123
|
|
|
114
|
-
|
|
124
|
+
### Option C: Local development install
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
git clone https://github.com/BlackBeltTechnology/pi-agent-dashboard.git
|
|
128
|
+
cd pi-agent-dashboard
|
|
129
|
+
npm install
|
|
130
|
+
pi install /path/to/pi-agent-dashboard
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Recommended extensions
|
|
134
|
+
|
|
135
|
+
The dashboard integrates tightly with a small, curated set of pi extensions
|
|
136
|
+
— for custom tool rendering, the Flow dashboard, and anthropic-messages
|
|
137
|
+
protocol compatibility. The wizard's Recommended-extensions step installs
|
|
138
|
+
them in one go; the **Packages** tab and a top-of-page **banner** keep
|
|
139
|
+
them discoverable afterwards.
|
|
140
|
+
|
|
141
|
+
| Extension | Source | Status | Unlocks |
|
|
142
|
+
|---|---|---|---|
|
|
143
|
+
| `pi-anthropic-messages` | `git@github.com:BlackBeltTechnology/pi-anthropic-messages.git` | **required** | Tool calls on Claude-model Anthropic OAuth / 9Router `cc/*` / pi-model-proxy providers. Without it, tool calls fall back to Claude Code's built-in `bash_ide` sandbox and fail. |
|
|
144
|
+
| `@tintinweb/pi-subagents` | `npm:@tintinweb/pi-subagents` | strongly suggested | `Agent` tool card UI, subagent activity badge, `get_subagent_result` / `steer_subagent` renderers. |
|
|
145
|
+
| `pi-flows` | `git@github.com:BlackBeltTechnology/pi-flows.git` | strongly suggested | Flow dashboard, role aliases (`@planning`, `@coding`, …), subagent / flow_write / flow_results / agent_write / ask_user / skill_read / finish tools. |
|
|
146
|
+
| `pi-web-access` | `npm:pi-web-access` | strongly suggested | `web_search`, `code_search`, `fetch_content`, `get_search_content`. |
|
|
147
|
+
| `pi-agent-browser` | `npm:pi-agent-browser` | optional | `browser` tool (open, snapshot, click, screenshot). |
|
|
148
|
+
|
|
149
|
+
Authoritative source of truth: `packages/shared/src/recommended-extensions.ts`.
|
|
150
|
+
Descriptions, versions, and installed-state are enriched live at runtime via
|
|
151
|
+
`GET /api/packages/recommended` (falling back to offline descriptions on
|
|
152
|
+
network failure).
|
|
153
|
+
|
|
154
|
+
### GitHub SSH notes
|
|
155
|
+
|
|
156
|
+
The `pi-flows` and `pi-anthropic-messages` entries install via `pi install
|
|
157
|
+
git@github.com:…` (SSH). If your system doesn't have a GitHub SSH key
|
|
158
|
+
configured the clone will fail with a "Permission denied (publickey)"
|
|
159
|
+
error. Set up a key by following
|
|
160
|
+
[GitHub's SSH docs](https://docs.github.com/en/authentication/connecting-to-github-with-ssh),
|
|
161
|
+
or substitute the equivalent HTTPS URL in the manifest if your fork is
|
|
162
|
+
public.
|
|
115
163
|
|
|
116
164
|
### Quick test (without installing)
|
|
117
165
|
|
|
118
166
|
To try the extension in a single pi session without registering it:
|
|
119
167
|
|
|
120
168
|
```bash
|
|
121
|
-
pi -e /path/to/pi-agent-dashboard/
|
|
169
|
+
pi -e /path/to/pi-agent-dashboard/packages/extension/src/bridge.ts
|
|
122
170
|
```
|
|
123
171
|
|
|
172
|
+
## Prerequisites
|
|
173
|
+
|
|
174
|
+
Only needed for Option B/C (the Electron app handles everything automatically).
|
|
175
|
+
|
|
176
|
+
| Requirement | Why | Install |
|
|
177
|
+
|-------------|-----|---------|
|
|
178
|
+
| **[pi](https://github.com/badlogic/pi-mono)** or **[Oh My Pi](https://www.npmjs.com/package/@oh-my-pi/pi-coding-agent)** | The AI coding agent that the dashboard monitors | `npm i -g @mariozechner/pi-coding-agent` |
|
|
179
|
+
| **Node.js ≥ 22.18.0** | Runtime for the dashboard server (older 22.x / 24.x affected by [nodejs/node#58515](https://github.com/nodejs/node/issues/58515)) | [nodejs.org](https://nodejs.org/) |
|
|
180
|
+
| **C++ build tools** | Required by `node-pty` native addon for terminal emulation | Xcode CLI Tools (macOS) / `build-essential` (Linux) |
|
|
181
|
+
|
|
182
|
+
### Optional tools
|
|
183
|
+
|
|
184
|
+
| Tool | Purpose | When needed |
|
|
185
|
+
|------|---------|-------------|
|
|
186
|
+
| **tmux** | Spawn new pi sessions from the browser in a tmux window | When `spawnStrategy` is `"tmux"` |
|
|
187
|
+
| **[zrok](https://zrok.io/)** | Expose dashboard over the internet via tunnel (auto-connects on server start). Install with `brew install zrok` (macOS) and run `zrok enable <token>` to enroll — the dashboard reads zrok's own config (`~/.zrok2/environment.json`), no keys are stored in the dashboard. Uses reserved shares for persistent URLs across restarts. | When `tunnel.enabled` is `true` (default) |
|
|
188
|
+
|
|
124
189
|
## Configuration
|
|
125
190
|
|
|
126
191
|
Config file: **`~/.pi/dashboard/config.json`** (auto-created with defaults on first run)
|
|
127
192
|
|
|
193
|
+
Tool path overrides (optional, machine-local): **`~/.pi/dashboard/tool-overrides.json`** — see [Tool resolution & overrides](#tool-resolution--overrides) below.
|
|
194
|
+
|
|
128
195
|
```json
|
|
129
196
|
{
|
|
130
197
|
"port": 8000,
|
|
@@ -134,10 +201,61 @@ Config file: **`~/.pi/dashboard/config.json`** (auto-created with defaults on fi
|
|
|
134
201
|
"shutdownIdleSeconds": 300,
|
|
135
202
|
"spawnStrategy": "headless",
|
|
136
203
|
"tunnel": { "enabled": true, "reservedToken": "auto-created-on-first-run" },
|
|
137
|
-
"devBuildOnReload": false
|
|
204
|
+
"devBuildOnReload": false,
|
|
205
|
+
"openspec": {
|
|
206
|
+
"pollIntervalSeconds": 30,
|
|
207
|
+
"maxConcurrentSpawns": 3,
|
|
208
|
+
"changeDetection": "mtime",
|
|
209
|
+
"jitterSeconds": 5
|
|
210
|
+
}
|
|
138
211
|
}
|
|
139
212
|
```
|
|
140
213
|
|
|
214
|
+
**OpenSpec background polling** (`openspec` block):
|
|
215
|
+
|
|
216
|
+
| Key | Default | Range | Description |
|
|
217
|
+
|-----|---------|-------|-------------|
|
|
218
|
+
| `pollIntervalSeconds` | `30` | `5–3600` | How often each known directory is polled for OpenSpec updates |
|
|
219
|
+
| `maxConcurrentSpawns` | `3` | `1–16` | Cap on concurrent `openspec` CLI invocations across all directories |
|
|
220
|
+
| `changeDetection` | `"mtime"` | `"mtime" \| "always"` | `mtime` skips re-polling unchanged proposals (near-zero steady-state cost); `always` polls unconditionally |
|
|
221
|
+
| `jitterSeconds` | `5` | `0–60` | Per-directory phase offset so polls don't all align on the same tick |
|
|
222
|
+
|
|
223
|
+
Live-reconfigurable via Settings → Advanced → "Background polling (OpenSpec)" or `PUT /api/config` — no server restart needed. See [docs/architecture.md](docs/architecture.md) for the cost model.
|
|
224
|
+
|
|
225
|
+
### Tool resolution & overrides
|
|
226
|
+
|
|
227
|
+
The dashboard resolves every external tool it calls (`pi`, `pi-coding-agent`, `openspec`, `npm`, `node`, `tsx`, `git`, `zrok`, `pi-dashboard`) through a single `ToolRegistry`. Each tool has an ordered strategy chain (override → managed install → bare-import / npm-global → PATH search), and every resolution records a diagnostic trail of which strategies were tried and why each succeeded or failed.
|
|
228
|
+
|
|
229
|
+
**Inspecting and overriding** — Settings → General → **Tools** shows every resolved tool, its source, and the trail. You can set a per-tool override path, rescan a single tool or all of them, and export the full diagnostic report for bug reports.
|
|
230
|
+
|
|
231
|
+
**Overrides file** — `~/.pi/dashboard/tool-overrides.json`:
|
|
232
|
+
|
|
233
|
+
```json
|
|
234
|
+
{
|
|
235
|
+
"version": 1,
|
|
236
|
+
"overrides": {
|
|
237
|
+
"pi": { "path": "C:\\custom\\pi.cmd" },
|
|
238
|
+
"pi-coding-agent": { "path": "D:\\dev\\pi-coding-agent\\dist\\index.js" }
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
The file is deliberately separate from `config.json` so machine-specific paths don't follow a dotfiles sync to another host. Invalid overrides (path doesn't exist) are recorded in the diagnostic trail and the registry falls through to the next strategy automatically.
|
|
244
|
+
|
|
245
|
+
**Troubleshooting** — if the dashboard says it can't find `pi`, `openspec`, `npm`, or any other tool, open Settings → General → Tools, click the chevron next to the failing tool to see the full `tried[]` trail, then either (a) install the missing tool on PATH / in the managed location shown in the trail, or (b) set an explicit override via the row's path input. Hit **Rescan** to pick up the change without a server restart.
|
|
246
|
+
|
|
247
|
+
**Troubleshooting: sessions don't group under my pinned folder** — since v0.3+, session grouping uses OS-aware path equality (`platform/paths.ts`). Sessions group correctly under a pinned folder even when the path stored on pin and the path reported by the session differ in trailing separator, separator style, or case (on Windows and macOS). If you still see two entries for what should be one folder, the paths are likely on different Windows drives (`A:\Foo` and `B:\Foo` are different filesystems and never merge) — that's correct behavior, not a bug. If the paths really are the same filesystem, file an issue with both the pinned path (visible in Settings → Tools → Export diagnostics) and the session `cwd` as reported in `/api/sessions`.
|
|
248
|
+
|
|
249
|
+
### Windows session durability
|
|
250
|
+
|
|
251
|
+
**Behavior change**: Since the `consolidate-windows-spawn-and-platform-handlers` release, pi sessions on Windows now **survive dashboard server restart**, matching macOS/Linux behavior. Previously, killing or restarting the dashboard process (Task Manager, Ctrl+C, `/api/restart`, crash) would terminate every running pi session because the children were in the server's libuv kill-on-close Job Object. The fix uses `detached: true` so children are excluded from the parent's job — the Windows equivalent of Unix PGID detachment.
|
|
252
|
+
|
|
253
|
+
If you previously relied on "closing the dashboard cleans everything up," use the per-session **Force Kill** action instead (or `POST /api/session/:id/force-kill` via the REST API).
|
|
254
|
+
|
|
255
|
+
**Recommended: install Windows Terminal** (`wt.exe`) for tabbed interactive sessions on Windows 10/11. The dashboard prefers `wt` when available (new tab in an existing WT window, respects your default profile — cmd / PowerShell / WSL / whatever), and falls back to WSL tmux and then headless mode when absent. Windows Terminal is bundled with Windows 11; on Windows 10 install it from the Microsoft Store (search for "Windows Terminal").
|
|
256
|
+
|
|
257
|
+
**Troubleshooting: Windows Terminal tab doesn't appear** — if `wt.exe` is on PATH but launching does nothing, check Settings → Apps → Advanced app settings → App execution aliases. If the "wt" alias is disabled, `wt.exe` is found but can't be executed. Enable the alias or uninstall/reinstall Windows Terminal.
|
|
258
|
+
|
|
141
259
|
### Authentication (Optional)
|
|
142
260
|
|
|
143
261
|
Add an `auth` section to enable OAuth2 authentication for external (tunnel) access. Localhost is always unguarded.
|
|
@@ -202,14 +320,18 @@ PI_DASHBOARD_URL=ws://192.168.1.100:9999 pi
|
|
|
202
320
|
|
|
203
321
|
## Installation Methods
|
|
204
322
|
|
|
205
|
-
###
|
|
323
|
+
### Electron Desktop App (standalone)
|
|
324
|
+
|
|
325
|
+
See [Getting Started — Option A](#option-a-electron-desktop-app-standalone--no-prerequisites) above. Download from [GitHub Releases](https://github.com/BlackBeltTechnology/pi-agent-dashboard/releases).
|
|
326
|
+
|
|
327
|
+
### From npm (recommended for CLI users)
|
|
206
328
|
|
|
207
329
|
```bash
|
|
208
330
|
# pi
|
|
209
|
-
pi install npm:@blackbelt-technology/pi-dashboard
|
|
331
|
+
pi install npm:@blackbelt-technology/pi-agent-dashboard
|
|
210
332
|
|
|
211
333
|
# Oh My Pi
|
|
212
|
-
omp install npm:@blackbelt-technology/pi-dashboard
|
|
334
|
+
omp install npm:@blackbelt-technology/pi-agent-dashboard
|
|
213
335
|
```
|
|
214
336
|
|
|
215
337
|
> The package is compatible with both [pi](https://github.com/badlogic/pi-mono) and [Oh My Pi](https://www.npmjs.com/package/@oh-my-pi/pi-coding-agent) — no configuration needed.
|
|
@@ -264,9 +386,9 @@ To disable: set `"autoStart": false` in `~/.pi/dashboard/config.json`.
|
|
|
264
386
|
### Manual server start
|
|
265
387
|
|
|
266
388
|
```bash
|
|
267
|
-
npx tsx
|
|
268
|
-
npx tsx
|
|
269
|
-
npx tsx
|
|
389
|
+
npx tsx packages/server/src/cli.ts
|
|
390
|
+
npx tsx packages/server/src/cli.ts --port 8000 --pi-port 9999
|
|
391
|
+
npx tsx packages/server/src/cli.ts --dev # proxy to Vite dev server
|
|
270
392
|
```
|
|
271
393
|
|
|
272
394
|
### Daemon mode
|
|
@@ -282,6 +404,21 @@ pi-dashboard status # Show daemon status
|
|
|
282
404
|
|
|
283
405
|
Daemon stdout/stderr is logged to `~/.pi/dashboard/server.log` for crash diagnosis.
|
|
284
406
|
|
|
407
|
+
### Keyboard shortcuts in chat input
|
|
408
|
+
|
|
409
|
+
The chat input supports bash-style history recall and per-session draft persistence:
|
|
410
|
+
|
|
411
|
+
| Key | Action |
|
|
412
|
+
|-----|--------|
|
|
413
|
+
| `Enter` | Send the prompt. |
|
|
414
|
+
| `Shift+Enter` | Insert a newline. |
|
|
415
|
+
| `ArrowUp` | Recall the previous user prompt (only when the caret is on the first line and no autocomplete dropdown is open). Repeat to walk further back. |
|
|
416
|
+
| `ArrowDown` | Walk forward through history (only when the caret is on the last line). Past the newest entry, restores the in-progress draft. |
|
|
417
|
+
| `Escape` | While navigating history, restore the in-progress draft and exit history mode. Also cancels a pending prompt or dismisses the autocomplete dropdown. |
|
|
418
|
+
| `Tab` / `Enter` in dropdown | Accept the highlighted `/command` or `@file` suggestion. |
|
|
419
|
+
|
|
420
|
+
Drafts (typed-but-unsent text) are persisted per session in `localStorage` under `chat-draft:<sessionId>` and survive navigation (Settings, OpenSpec preview, file diffs, ...) as well as full page reloads. Drafts never leak between sessions.
|
|
421
|
+
|
|
285
422
|
### Graceful restart via API
|
|
286
423
|
|
|
287
424
|
Restart without CLI — useful from scripts, other sessions, or the dashboard skill:
|
|
@@ -385,13 +522,13 @@ npm run reload:check # Type-check + reload all pi sessions
|
|
|
385
522
|
|
|
386
523
|
```bash
|
|
387
524
|
# Terminal 1: Dashboard server in dev mode
|
|
388
|
-
npx tsx
|
|
525
|
+
npx tsx packages/server/src/cli.ts --dev
|
|
389
526
|
|
|
390
527
|
# Terminal 2: Vite dev server (HMR for the web client)
|
|
391
528
|
npm run dev
|
|
392
529
|
|
|
393
530
|
# Terminal 3: pi with the bridge extension
|
|
394
|
-
pi -e
|
|
531
|
+
pi -e packages/extension/src/bridge.ts # or just `pi` if installed
|
|
395
532
|
|
|
396
533
|
# Open http://localhost:8000 (server proxies to Vite for SPA routes + assets)
|
|
397
534
|
# Or http://localhost:3000 (Vite directly, proxies API/WS to :8000)
|
|
@@ -424,50 +561,92 @@ curl -X POST http://localhost:8000/api/restart -H 'Content-Type: application/jso
|
|
|
424
561
|
|
|
425
562
|
### Project Structure
|
|
426
563
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
│
|
|
433
|
-
│
|
|
434
|
-
│
|
|
564
|
+
The project is a monorepo with npm workspaces:
|
|
565
|
+
|
|
566
|
+
```
|
|
567
|
+
packages/
|
|
568
|
+
├── shared/ # Shared TypeScript types & utilities
|
|
569
|
+
│ └── src/
|
|
570
|
+
│ ├── protocol.ts # Extension ↔ Server messages
|
|
571
|
+
│ ├── browser-protocol.ts # Server ↔ Browser messages (incl. PromptBus types)
|
|
572
|
+
│ ├── types.ts # Data models
|
|
573
|
+
│ ├── config.ts # Shared config loader
|
|
574
|
+
│ ├── rest-api.ts # REST API types
|
|
575
|
+
│ ├── session-meta.ts # Session metadata sidecar (.meta.json) read/write
|
|
576
|
+
│ ├── state-replay.ts # Event synthesis on reconnect
|
|
577
|
+
│ ├── stats-extractor.ts # Token/cost stats extraction
|
|
578
|
+
│ ├── server-identity.ts # Server detection & identity
|
|
579
|
+
│ ├── mdns-discovery.ts # mDNS network auto-discovery
|
|
580
|
+
│ └── openspec-poller.ts # OpenSpec change data polling
|
|
435
581
|
├── extension/ # Bridge extension (runs in pi)
|
|
436
|
-
│
|
|
437
|
-
│
|
|
438
|
-
│
|
|
439
|
-
│
|
|
440
|
-
│
|
|
441
|
-
│
|
|
442
|
-
│
|
|
443
|
-
│
|
|
444
|
-
│
|
|
445
|
-
│
|
|
446
|
-
│
|
|
447
|
-
│
|
|
448
|
-
│
|
|
582
|
+
│ └── src/
|
|
583
|
+
│ ├── bridge.ts # Main extension entry
|
|
584
|
+
│ ├── connection.ts # WebSocket with reconnection
|
|
585
|
+
│ ├── event-forwarder.ts # Event mapping
|
|
586
|
+
│ ├── flow-event-wiring.ts # pi-flows event forwarding
|
|
587
|
+
│ ├── prompt-bus.ts # PromptBus — unified prompt routing with adapters
|
|
588
|
+
│ ├── dashboard-default-adapter.ts # Default PromptBus adapter for dashboard UI
|
|
589
|
+
│ ├── prompt-expander.ts # Prompt template expansion from disk
|
|
590
|
+
│ ├── provider-register.ts # Provider auth registration & sync
|
|
591
|
+
│ ├── model-tracker.ts # Model selection tracking
|
|
592
|
+
│ ├── source-detector.ts # Session source detection (via .meta.json sidecar)
|
|
593
|
+
│ ├── command-handler.ts # Command relay
|
|
594
|
+
│ ├── server-probe.ts # TCP probe for server detection
|
|
595
|
+
│ ├── server-auto-start.ts # Auto-start logic on session launch
|
|
596
|
+
│ ├── server-launcher.ts # Spawn server as detached process
|
|
597
|
+
│ ├── session-sync.ts # Session history sync
|
|
598
|
+
│ ├── process-metrics.ts # Agent process CPU/memory metrics
|
|
599
|
+
│ ├── process-scanner.ts # Running process detection
|
|
600
|
+
│ ├── git-info.ts # Git branch/remote/PR detection
|
|
601
|
+
│ ├── git-link-builder.ts # GitHub/GitLab permalink generation
|
|
602
|
+
│ └── dev-build.ts # Dev build-on-reload helper
|
|
449
603
|
├── server/ # Dashboard server
|
|
450
|
-
│
|
|
451
|
-
│
|
|
452
|
-
│
|
|
453
|
-
│
|
|
454
|
-
│
|
|
455
|
-
│
|
|
456
|
-
│
|
|
457
|
-
│
|
|
458
|
-
│
|
|
459
|
-
│
|
|
460
|
-
│
|
|
461
|
-
│
|
|
462
|
-
│
|
|
463
|
-
│
|
|
464
|
-
│
|
|
465
|
-
├──
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
604
|
+
│ └── src/
|
|
605
|
+
│ ├── cli.ts # CLI entry (start/stop/restart/status)
|
|
606
|
+
│ ├── server.ts # HTTP + WebSocket server
|
|
607
|
+
│ ├── pi-gateway.ts # Extension WebSocket gateway
|
|
608
|
+
│ ├── browser-gateway.ts # Browser WebSocket gateway
|
|
609
|
+
│ ├── memory-event-store.ts # In-memory event buffer (LRU, per-session cap, truncation)
|
|
610
|
+
│ ├── memory-session-manager.ts # In-memory session registry
|
|
611
|
+
│ ├── preferences-store.ts # User prefs: hidden sessions, pinned dirs
|
|
612
|
+
│ ├── meta-persistence.ts # Session metadata persistence
|
|
613
|
+
│ ├── session-order-manager.ts # Per-cwd session ordering
|
|
614
|
+
│ ├── session-discovery.ts # Session file scanning & loading
|
|
615
|
+
│ ├── process-manager.ts # tmux/headless session spawning
|
|
616
|
+
│ ├── headless-pid-registry.ts # Track headless process PIDs
|
|
617
|
+
│ ├── editor-registry.ts # Available editor detection
|
|
618
|
+
│ ├── editor-manager.ts # Editor launch & file opening
|
|
619
|
+
│ ├── provider-auth-storage.ts # Provider credential persistence
|
|
620
|
+
│ ├── provider-auth-handlers.ts # OAuth flow handlers
|
|
621
|
+
│ ├── npm-search-proxy.ts # npm registry search proxy
|
|
622
|
+
│ ├── package-manager-wrapper.ts # pi package install/remove
|
|
623
|
+
│ ├── pending-fork-registry.ts # Flow fork decision persistence
|
|
624
|
+
│ ├── tunnel.ts # Zrok tunnel with reserved shares
|
|
625
|
+
│ ├── terminal-manager.ts # Browser terminal sessions (xterm.js + node-pty)
|
|
626
|
+
│ ├── server-pid.ts # PID file for daemon management
|
|
627
|
+
│ ├── auth.ts # OAuth2 authentication
|
|
628
|
+
│ └── json-store.ts # Atomic JSON file helpers
|
|
629
|
+
├── client/ # React web client
|
|
630
|
+
│ └── src/
|
|
631
|
+
│ ├── App.tsx
|
|
632
|
+
│ ├── hooks/ # WebSocket hooks, mobile detection
|
|
633
|
+
│ ├── lib/ # Event reducer, command filter
|
|
634
|
+
│ └── components/ # UI components
|
|
635
|
+
│ ├── FlowDashboard.tsx # Live flow execution view
|
|
636
|
+
│ ├── FlowAgentCard.tsx # Per-agent status cards
|
|
637
|
+
│ ├── FlowGraph.tsx # DAG visualization
|
|
638
|
+
│ ├── FlowArchitect.tsx # Flow designer UI
|
|
639
|
+
│ ├── FlowSummary.tsx # Post-flow result summary
|
|
640
|
+
│ ├── DiffView.tsx # Side-by-side diff viewer
|
|
641
|
+
│ ├── TerminalView.tsx # Browser terminal emulator
|
|
642
|
+
│ ├── PackageBrowser.tsx # Package search & install
|
|
643
|
+
│ ├── ProviderAuthSection.tsx # Provider sign-in UI
|
|
644
|
+
│ ├── SettingsPanel.tsx # Config editor
|
|
645
|
+
│ └── ... # 80+ components
|
|
646
|
+
└── electron/ # Electron desktop app wrapper
|
|
647
|
+
├── src/main.ts
|
|
648
|
+
├── scripts/
|
|
649
|
+
└── resources/
|
|
471
650
|
```
|
|
472
651
|
|
|
473
652
|
## Monitoring
|
|
@@ -486,6 +665,23 @@ Returns:
|
|
|
486
665
|
|
|
487
666
|
Agent metrics are collected every 15s via heartbeats and include `eventLoopMaxMs` — useful for diagnosing connection drops during long-running operations.
|
|
488
667
|
|
|
668
|
+
### Troubleshooting: dashboard server doesn't start
|
|
669
|
+
|
|
670
|
+
If `pi` launches but the dashboard never becomes reachable (no `http://localhost:8000`, no `🌐 Dashboard started` notification), inspect the launch log:
|
|
671
|
+
|
|
672
|
+
```bash
|
|
673
|
+
cat ~/.pi/dashboard/server.log # Linux / macOS
|
|
674
|
+
type %USERPROFILE%\.pi\dashboard\server.log # Windows
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
The log is opened in append mode and prefixed with a timestamped header on every start attempt, so previous crashes are preserved. Common issues:
|
|
678
|
+
|
|
679
|
+
- **`ERR_UNSUPPORTED_ESM_URL_SCHEME` on Windows** — fixed in pi-agent-dashboard 0.2.10+; upgrade the package.
|
|
680
|
+
- **`Port 8000 is occupied by another service`** — another process is bound to the port. On Windows: `netstat -ano | findstr :8000` then `taskkill /F /PID <pid>`. On Unix: `lsof -t -i :8000 | xargs kill`. Or change `port` in `~/.pi/dashboard/config.json`.
|
|
681
|
+
- **`Cannot find pi's TypeScript loader`** — pi is not installed globally. Run `npm install -g @mariozechner/pi-coding-agent`.
|
|
682
|
+
|
|
683
|
+
The `POST /api/restart` endpoint and `pi-dashboard restart` command work identically on Windows, macOS, and Linux (no `sh`/`lsof`/`curl` dependency).
|
|
684
|
+
|
|
489
685
|
## Extension UI Events
|
|
490
686
|
|
|
491
687
|
Your own extensions can broadcast UI events to the dashboard:
|
|
@@ -502,12 +698,20 @@ Supported methods: `confirm`, `select`, `input`, `notify`.
|
|
|
502
698
|
|
|
503
699
|
## Electron Desktop App
|
|
504
700
|
|
|
505
|
-
The project includes an Electron wrapper at `packages/electron/` that bundles the dashboard as a native desktop app.
|
|
701
|
+
The project includes an Electron wrapper at `packages/electron/` that bundles the dashboard as a **fully standalone native desktop app**. Pre-built installers for all platforms are available on [GitHub Releases](https://github.com/BlackBeltTechnology/pi-agent-dashboard/releases) — see [Getting Started](#getting-started) above.
|
|
702
|
+
|
|
703
|
+
The Electron app supports two modes:
|
|
704
|
+
|
|
705
|
+
| Mode | Description |
|
|
706
|
+
|------|-------------|
|
|
707
|
+
| **Standalone** | Bundles Node.js, auto-installs pi + dashboard into `~/.pi-dashboard/`. Zero prerequisites. |
|
|
708
|
+
| **Power User** | Detects and uses your existing system pi + dashboard install. |
|
|
709
|
+
|
|
710
|
+
Features: first-run setup wizard, auto-update checker, system tray, splash screen, VM detection (disables GPU acceleration), mDNS server discovery, and version compatibility checks.
|
|
506
711
|
|
|
507
|
-
###
|
|
712
|
+
### Building from Source
|
|
508
713
|
|
|
509
|
-
|
|
510
|
-
- Platform-specific tools are handled by Electron Forge automatically
|
|
714
|
+
> **Prerequisites for building:** Node.js 22.12+, platform-specific tools handled by Electron Forge automatically.
|
|
511
715
|
|
|
512
716
|
### Building for Your Platform
|
|
513
717
|
|
|
@@ -573,22 +777,25 @@ cd packages/electron
|
|
|
573
777
|
npm run icons # Generates .icns (macOS), .ico (Windows), and resized PNGs
|
|
574
778
|
```
|
|
575
779
|
|
|
576
|
-
### CI Builds
|
|
780
|
+
### CI Builds & GitHub Releases
|
|
577
781
|
|
|
578
|
-
The
|
|
782
|
+
The release workflow (`.github/workflows/publish.yml`) builds Electron installers for **all platforms** on every version tag (`v*`):
|
|
579
783
|
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
-
|
|
784
|
+
| Runner | Platform | Outputs |
|
|
785
|
+
|--------|----------|---------|
|
|
786
|
+
| `macos-14` | macOS arm64 | `.dmg` |
|
|
787
|
+
| `ubuntu-latest` | Linux x64 | `.deb` + `.AppImage` |
|
|
788
|
+
| `ubuntu-24.04-arm` | Linux arm64 | `.deb` |
|
|
789
|
+
| `windows-latest` | Windows x64 | `.exe` (NSIS) + `.zip` + portable |
|
|
790
|
+
| `windows-latest` | Windows arm64 | `.zip` + portable (x64 Node.js via WoW64) |
|
|
584
791
|
|
|
585
|
-
|
|
792
|
+
All artifacts are uploaded to a **draft GitHub Release** for review and publishing. The same workflow also publishes the npm package. Release notes for the draft are extracted automatically from the matching `## [<version>]` section of [`CHANGELOG.md`](CHANGELOG.md) — see [`docs/release-process.md`](docs/release-process.md) for the full cut-a-release workflow.
|
|
586
793
|
|
|
587
794
|
## CI/CD
|
|
588
795
|
|
|
589
796
|
### Continuous Integration
|
|
590
797
|
|
|
591
|
-
Every push to `
|
|
798
|
+
Every push to `develop` and every pull request against `develop` triggers the CI workflow (`.github/workflows/ci.yml`):
|
|
592
799
|
|
|
593
800
|
1. `npm ci` — install dependencies
|
|
594
801
|
2. `npm run lint` — type check
|