@blackbelt-technology/pi-agent-dashboard 0.2.9 → 0.3.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.
Files changed (76) hide show
  1. package/AGENTS.md +114 -9
  2. package/README.md +218 -97
  3. package/docs/architecture.md +107 -7
  4. package/package.json +9 -4
  5. package/packages/extension/package.json +1 -1
  6. package/packages/extension/src/__tests__/ask-user-tool.test.ts +300 -3
  7. package/packages/extension/src/__tests__/fork-entryid-timing.test.ts +100 -0
  8. package/packages/extension/src/ask-user-tool.ts +289 -20
  9. package/packages/extension/src/bridge.ts +38 -4
  10. package/packages/extension/src/command-handler.ts +34 -39
  11. package/packages/extension/src/prompt-expander.ts +25 -4
  12. package/packages/server/package.json +2 -1
  13. package/packages/server/src/__tests__/auto-attach.test.ts +10 -1
  14. package/packages/server/src/__tests__/auto-shutdown.test.ts +8 -2
  15. package/packages/server/src/__tests__/browse-endpoint.test.ts +229 -10
  16. package/packages/server/src/__tests__/browser-gateway-handler-errors.test.ts +129 -0
  17. package/packages/server/src/__tests__/cors.test.ts +34 -2
  18. package/packages/server/src/__tests__/editor-manager-pid-registry.test.ts +168 -0
  19. package/packages/server/src/__tests__/editor-manager.test.ts +33 -0
  20. package/packages/server/src/__tests__/editor-pid-registry.test.ts +191 -0
  21. package/packages/server/src/__tests__/editor-registry.test.ts +3 -2
  22. package/packages/server/src/__tests__/fix-pty-permissions.test.ts +59 -0
  23. package/packages/server/src/__tests__/git-operations.test.ts +9 -7
  24. package/packages/server/src/__tests__/health-endpoint.test.ts +11 -13
  25. package/packages/server/src/__tests__/openspec-tasks-parser.test.ts +178 -0
  26. package/packages/server/src/__tests__/openspec-tasks-routes.test.ts +180 -0
  27. package/packages/server/src/__tests__/package-manager-wrapper-resolve.test.ts +122 -0
  28. package/packages/server/src/__tests__/pi-core-checker.test.ts +195 -0
  29. package/packages/server/src/__tests__/pi-core-routes.test.ts +184 -0
  30. package/packages/server/src/__tests__/pi-core-updater.test.ts +214 -0
  31. package/packages/server/src/__tests__/provider-auth-routes.test.ts +13 -3
  32. package/packages/server/src/__tests__/recommended-routes.test.ts +389 -0
  33. package/packages/server/src/__tests__/session-file-dedup.test.ts +10 -10
  34. package/packages/server/src/__tests__/session-lifecycle-logging.test.ts +8 -2
  35. package/packages/server/src/__tests__/sleep-aware-heartbeat.test.ts +3 -1
  36. package/packages/server/src/__tests__/smoke-integration.test.ts +10 -10
  37. package/packages/server/src/__tests__/test-server-canary.test.ts +31 -0
  38. package/packages/server/src/__tests__/tunnel.test.ts +91 -0
  39. package/packages/server/src/__tests__/ws-ping-pong.test.ts +10 -2
  40. package/packages/server/src/browse.ts +100 -6
  41. package/packages/server/src/browser-gateway.ts +16 -3
  42. package/packages/server/src/editor-manager.ts +20 -1
  43. package/packages/server/src/editor-pid-registry.ts +198 -0
  44. package/packages/server/src/fix-pty-permissions.ts +44 -0
  45. package/packages/server/src/headless-pid-registry.ts +9 -0
  46. package/packages/server/src/npm-search-proxy.ts +71 -0
  47. package/packages/server/src/openspec-tasks.ts +158 -0
  48. package/packages/server/src/package-manager-wrapper.ts +31 -0
  49. package/packages/server/src/pi-core-checker.ts +290 -0
  50. package/packages/server/src/pi-core-updater.ts +166 -0
  51. package/packages/server/src/pi-gateway.ts +7 -0
  52. package/packages/server/src/process-manager.ts +1 -1
  53. package/packages/server/src/routes/file-routes.ts +30 -3
  54. package/packages/server/src/routes/openspec-routes.ts +83 -1
  55. package/packages/server/src/routes/pi-core-routes.ts +117 -0
  56. package/packages/server/src/routes/provider-auth-routes.ts +4 -2
  57. package/packages/server/src/routes/provider-routes.ts +12 -2
  58. package/packages/server/src/routes/recommended-routes.ts +227 -0
  59. package/packages/server/src/routes/system-routes.ts +10 -1
  60. package/packages/server/src/server.ts +151 -15
  61. package/packages/server/src/terminal-manager.ts +4 -0
  62. package/packages/server/src/test-env-guard.ts +26 -0
  63. package/packages/server/src/test-support/test-server.ts +63 -0
  64. package/packages/server/src/tunnel.ts +132 -8
  65. package/packages/shared/package.json +1 -1
  66. package/packages/shared/src/__tests__/config.test.ts +3 -3
  67. package/packages/shared/src/__tests__/openspec-poller.test.ts +44 -0
  68. package/packages/shared/src/__tests__/recommended-extensions.test.ts +123 -0
  69. package/packages/shared/src/__tests__/source-matching.test.ts +143 -0
  70. package/packages/shared/src/browser-protocol.ts +23 -1
  71. package/packages/shared/src/openspec-poller.ts +8 -3
  72. package/packages/shared/src/recommended-extensions.ts +180 -0
  73. package/packages/shared/src/rest-api.ts +71 -0
  74. package/packages/shared/src/source-matching.ts +126 -0
  75. package/packages/shared/src/test-support/setup-home.ts +74 -0
  76. package/packages/shared/src/types.ts +7 -0
package/README.md CHANGED
@@ -6,24 +6,35 @@
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 touch targets
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
- - **Extension UI forwarding** — Interactive dialogs (confirm/select/input) survive page refresh and server restart
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 create new ones from the dashboard. Fork decisions and subagent dialogs forwarded via existing UI proxy.
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.
26
32
  - **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.
33
+ - **OpenSpec integration** — Browse specs, view archive history, manage changes, and create new changes from the session sidebar
34
+ - **Diff viewer** — Side-by-side and unified diff views with file tree navigation for reviewing agent changes
35
+ - **Editor integration** — Open files in your preferred editor (VS Code, Cursor, etc.) directly from tool call cards
36
+ - **Markdown preview** — Rendered markdown views with search, mermaid diagrams, and syntax highlighting
37
+ - **Network discovery** — mDNS-based auto-discovery of other dashboard servers on the local network; connect to known remote servers
27
38
 
28
39
  ## Architecture
29
40
 
@@ -57,47 +68,47 @@ The system has three components:
57
68
 
58
69
  | Component | Location | Role |
59
70
  |-----------|----------|------|
60
- | **Bridge Extension** | `src/extension/` | Runs in every pi session. Forwards events, relays commands, auto-starts server. |
61
- | **Dashboard Server** | `src/server/` | Aggregates events in-memory, persists metadata to JSON, serves the web client. |
62
- | **Web Client** | `src/client/` | React + Tailwind UI with real-time WebSocket updates. |
71
+ | **Bridge Extension** | `packages/extension/` | Runs in every pi session. Forwards events, relays commands, auto-starts server, hosts PromptBus. |
72
+ | **Dashboard Server** | `packages/server/` | Aggregates events in-memory, persists metadata to JSON, serves the web client, manages terminals. |
73
+ | **Web Client** | `packages/client/` | React + Tailwind UI with real-time WebSocket updates. |
74
+ | **Shared** | `packages/shared/` | TypeScript types, protocols, and utilities shared across all packages. |
63
75
 
64
76
  See [docs/architecture.md](docs/architecture.md) for detailed data flows, reconnection logic, and persistence model.
65
77
 
66
- ## Prerequisites
78
+ ## Getting Started
67
79
 
68
- | Requirement | Why | Install |
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) |
80
+ There are three ways to use the dashboard, from simplest to most flexible:
73
81
 
74
- ### Optional tools
82
+ ### Option A: Electron Desktop App (standalone — no prerequisites)
75
83
 
76
- | Tool | Purpose | When needed |
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) |
84
+ Download a pre-built installer from [GitHub Releases](https://github.com/BlackBeltTechnology/pi-agent-dashboard/releases) for your platform:
80
85
 
81
- ## Getting Started
86
+ | Platform | Download |
87
+ |----------|----------|
88
+ | **macOS** (Apple Silicon) | `.dmg` (arm64) |
89
+ | **macOS** (Intel) | `.dmg` (x64) |
90
+ | **Linux** (x64) | `.deb` or `.AppImage` |
91
+ | **Linux** (ARM64) | `.deb` |
92
+ | **Windows** (x64) | `.exe` (NSIS installer), `.zip`, or portable `.exe` |
93
+ | **Windows** (ARM64) | `.zip` or portable `.exe` |
82
94
 
83
- ### 1. Install the dashboard package
95
+ On first launch, a setup wizard guides you through:
84
96
 
85
- **From npm:**
86
- ```bash
87
- pi install npm:@blackbelt-technology/pi-dashboard
88
- ```
97
+ 1. **Choose a mode:**
98
+ - **Standalone** — Bundles Node.js and auto-installs pi + dashboard + openspec into `~/.pi-dashboard/`. No Node.js, npm, or build tools needed.
99
+ - **Power User** — Uses your existing system-installed pi and dashboard.
100
+ 2. **Configure an API key** — Enter your Anthropic/OpenAI key or sign in via browser-based OAuth.
101
+ 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.
102
+ 4. **Done** — The app discovers or spawns a dashboard server automatically.
89
103
 
90
- **From a local clone:**
91
- ```bash
92
- git clone https://github.com/nicობ/pi-agent-dashboard.git
93
- cd pi-agent-dashboard
94
- npm install
95
- pi install /path/to/pi-agent-dashboard
96
- ```
104
+ > **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.
97
105
 
98
- ### 2. Start pi
106
+ ### Option B: pi Package (recommended for CLI users)
107
+
108
+ 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 ≥ 20.
99
109
 
100
110
  ```bash
111
+ pi install npm:@blackbelt-technology/pi-dashboard
101
112
  pi
102
113
  ```
103
114
 
@@ -107,20 +118,73 @@ The bridge extension auto-starts the dashboard server on first launch. You'll se
107
118
  🌐 Dashboard started at http://localhost:8000
108
119
  ```
109
120
 
110
- ### 3. Open the dashboard
111
-
112
121
  Open **http://localhost:8000** in any browser. All active pi sessions appear automatically.
113
122
 
114
- That's it no manual server start, no configuration needed for basic use.
123
+ ### Option C: Local development install
124
+
125
+ ```bash
126
+ git clone https://github.com/BlackBeltTechnology/pi-agent-dashboard.git
127
+ cd pi-agent-dashboard
128
+ npm install
129
+ pi install /path/to/pi-agent-dashboard
130
+ ```
131
+
132
+ ## Recommended extensions
133
+
134
+ The dashboard integrates tightly with a small, curated set of pi extensions
135
+ — for custom tool rendering, the Flow dashboard, and anthropic-messages
136
+ protocol compatibility. The wizard's Recommended-extensions step installs
137
+ them in one go; the **Packages** tab and a top-of-page **banner** keep
138
+ them discoverable afterwards.
139
+
140
+ | Extension | Source | Status | Unlocks |
141
+ |---|---|---|---|
142
+ | `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. |
143
+ | `@tintinweb/pi-subagents` | `npm:@tintinweb/pi-subagents` | strongly suggested | `Agent` tool card UI, subagent activity badge, `get_subagent_result` / `steer_subagent` renderers. |
144
+ | `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. |
145
+ | `pi-web-access` | `npm:pi-web-access` | strongly suggested | `web_search`, `code_search`, `fetch_content`, `get_search_content`. |
146
+ | `pi-agent-browser` | `npm:pi-agent-browser` | optional | `browser` tool (open, snapshot, click, screenshot). |
147
+
148
+ Authoritative source of truth: `packages/shared/src/recommended-extensions.ts`.
149
+ Descriptions, versions, and installed-state are enriched live at runtime via
150
+ `GET /api/packages/recommended` (falling back to offline descriptions on
151
+ network failure).
152
+
153
+ ### GitHub SSH notes
154
+
155
+ The `pi-flows` and `pi-anthropic-messages` entries install via `pi install
156
+ git@github.com:…` (SSH). If your system doesn't have a GitHub SSH key
157
+ configured the clone will fail with a "Permission denied (publickey)"
158
+ error. Set up a key by following
159
+ [GitHub's SSH docs](https://docs.github.com/en/authentication/connecting-to-github-with-ssh),
160
+ or substitute the equivalent HTTPS URL in the manifest if your fork is
161
+ public.
115
162
 
116
163
  ### Quick test (without installing)
117
164
 
118
165
  To try the extension in a single pi session without registering it:
119
166
 
120
167
  ```bash
121
- pi -e /path/to/pi-agent-dashboard/src/extension/bridge.ts
168
+ pi -e /path/to/pi-agent-dashboard/packages/extension/src/bridge.ts
122
169
  ```
123
170
 
171
+ ## Prerequisites
172
+
173
+ Only needed for Option B/C (the Electron app handles everything automatically).
174
+
175
+ | Requirement | Why | Install |
176
+ |-------------|-----|---------|
177
+ | **[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` |
178
+ | **Node.js ≥ 20** | Runtime for the dashboard server | [nodejs.org](https://nodejs.org/) |
179
+ | **C++ build tools** | Required by `node-pty` native addon for terminal emulation | Xcode CLI Tools (macOS) / `build-essential` (Linux) |
180
+
181
+ ### Optional tools
182
+
183
+ | Tool | Purpose | When needed |
184
+ |------|---------|-------------|
185
+ | **tmux** | Spawn new pi sessions from the browser in a tmux window | When `spawnStrategy` is `"tmux"` |
186
+ | **[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) |
187
+
124
188
  ## Configuration
125
189
 
126
190
  Config file: **`~/.pi/dashboard/config.json`** (auto-created with defaults on first run)
@@ -202,7 +266,11 @@ PI_DASHBOARD_URL=ws://192.168.1.100:9999 pi
202
266
 
203
267
  ## Installation Methods
204
268
 
205
- ### From npm (recommended)
269
+ ### Electron Desktop App (standalone)
270
+
271
+ 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).
272
+
273
+ ### From npm (recommended for CLI users)
206
274
 
207
275
  ```bash
208
276
  # pi
@@ -264,9 +332,9 @@ To disable: set `"autoStart": false` in `~/.pi/dashboard/config.json`.
264
332
  ### Manual server start
265
333
 
266
334
  ```bash
267
- npx tsx src/server/cli.ts
268
- npx tsx src/server/cli.ts --port 8000 --pi-port 9999
269
- npx tsx src/server/cli.ts --dev # proxy to Vite dev server
335
+ npx tsx packages/server/src/cli.ts
336
+ npx tsx packages/server/src/cli.ts --port 8000 --pi-port 9999
337
+ npx tsx packages/server/src/cli.ts --dev # proxy to Vite dev server
270
338
  ```
271
339
 
272
340
  ### Daemon mode
@@ -385,13 +453,13 @@ npm run reload:check # Type-check + reload all pi sessions
385
453
 
386
454
  ```bash
387
455
  # Terminal 1: Dashboard server in dev mode
388
- npx tsx src/server/cli.ts --dev
456
+ npx tsx packages/server/src/cli.ts --dev
389
457
 
390
458
  # Terminal 2: Vite dev server (HMR for the web client)
391
459
  npm run dev
392
460
 
393
461
  # Terminal 3: pi with the bridge extension
394
- pi -e src/extension/bridge.ts # or just `pi` if installed
462
+ pi -e packages/extension/src/bridge.ts # or just `pi` if installed
395
463
 
396
464
  # Open http://localhost:8000 (server proxies to Vite for SPA routes + assets)
397
465
  # Or http://localhost:3000 (Vite directly, proxies API/WS to :8000)
@@ -424,50 +492,92 @@ curl -X POST http://localhost:8000/api/restart -H 'Content-Type: application/jso
424
492
 
425
493
  ### Project Structure
426
494
 
427
- ```
428
- src/
429
- ├── shared/ # Shared TypeScript types
430
- │ ├── protocol.ts # Extension ↔ Server messages
431
- ├── browser-protocol.ts # Server Browser messages (incl. PromptBus types)
432
- ├── types.ts # Data models
433
- ├── config.ts # Shared config loader
434
- └── rest-api.ts # REST API types
495
+ The project is a monorepo with npm workspaces:
496
+
497
+ ```
498
+ packages/
499
+ ├── shared/ # Shared TypeScript types & utilities
500
+ └── src/
501
+ ├── protocol.ts # Extension Server messages
502
+ ├── browser-protocol.ts # Server Browser messages (incl. PromptBus types)
503
+ │ ├── types.ts # Data models
504
+ │ ├── config.ts # Shared config loader
505
+ │ ├── rest-api.ts # REST API types
506
+ │ ├── session-meta.ts # Session metadata sidecar (.meta.json) read/write
507
+ │ ├── state-replay.ts # Event synthesis on reconnect
508
+ │ ├── stats-extractor.ts # Token/cost stats extraction
509
+ │ ├── server-identity.ts # Server detection & identity
510
+ │ ├── mdns-discovery.ts # mDNS network auto-discovery
511
+ │ └── openspec-poller.ts # OpenSpec change data polling
435
512
  ├── extension/ # Bridge extension (runs in pi)
436
- ├── bridge.ts # Main extension entry
437
- ├── connection.ts # WebSocket with reconnection
438
- ├── event-forwarder.ts # Event mapping
439
- ├── source-detector.ts # Session source detection (via .meta.json sidecar)
440
- ├── command-handler.ts # Command relay
441
- ├── server-probe.ts # TCP probe for server detection
442
- ├── server-launcher.ts # Auto-start server as detached process
443
- ├── git-info.ts # Git branch/remote/PR detection
444
- ├── openspec-poller.ts # OpenSpec change data polling
445
- ├── session-history.ts # Session history sync
446
- ├── state-replay.ts # Event synthesis on reconnect
447
- ├── stats-extractor.ts # Token/cost stats extraction
448
- └── dev-build.ts # Dev build-on-reload helper
513
+ └── src/
514
+ ├── bridge.ts # Main extension entry
515
+ ├── connection.ts # WebSocket with reconnection
516
+ ├── event-forwarder.ts # Event mapping
517
+ ├── flow-event-wiring.ts # pi-flows event forwarding
518
+ ├── prompt-bus.ts # PromptBus unified prompt routing with adapters
519
+ ├── dashboard-default-adapter.ts # Default PromptBus adapter for dashboard UI
520
+ ├── prompt-expander.ts # Prompt template expansion from disk
521
+ ├── provider-register.ts # Provider auth registration & sync
522
+ ├── model-tracker.ts # Model selection tracking
523
+ ├── source-detector.ts # Session source detection (via .meta.json sidecar)
524
+ ├── command-handler.ts # Command relay
525
+ ├── server-probe.ts # TCP probe for server detection
526
+ │ ├── server-auto-start.ts # Auto-start logic on session launch
527
+ │ ├── server-launcher.ts # Spawn server as detached process
528
+ │ ├── session-sync.ts # Session history sync
529
+ │ ├── process-metrics.ts # Agent process CPU/memory metrics
530
+ │ ├── process-scanner.ts # Running process detection
531
+ │ ├── git-info.ts # Git branch/remote/PR detection
532
+ │ ├── git-link-builder.ts # GitHub/GitLab permalink generation
533
+ │ └── dev-build.ts # Dev build-on-reload helper
449
534
  ├── server/ # Dashboard server
450
- ├── cli.ts # CLI entry (start/stop/restart/status)
451
- ├── server.ts # HTTP + WebSocket server
452
- ├── pi-gateway.ts # Extension WebSocket gateway
453
- ├── browser-gateway.ts # Browser WebSocket gateway
454
- ├── memory-event-store.ts # In-memory event buffer (LRU, per-session cap, truncation)
455
- ├── memory-session-manager.ts # In-memory session registry
456
- ├── state-store.ts # User prefs: hidden sessions, pinned dirs, session order
457
- ├── state-store.ts # JSON-backed user preferences
458
- ├── session-persistence.ts # Session metadata persistence
459
- ├── session-order-manager.ts # Per-cwd session ordering
460
- ├── process-manager.ts # tmux/headless session spawning
461
- ├── editor-registry.ts # Available editor detection
462
- ├── tunnel.ts # Zrok tunnel with reserved shares for persistent URLs, binary detection, PID tracking
463
- ├── server-pid.ts # PID file for daemon management
464
- └── json-store.ts # Atomic JSON file helpers
465
- ├── shared/session-meta.ts # Session metadata sidecar (.meta.json) read/write
466
- └── client/ # React web client
467
- ├── App.tsx
468
- ├── hooks/ # WebSocket hook
469
- ├── lib/ # Event reducer, command filter
470
- └── components/ # UI components
535
+ └── src/
536
+ ├── cli.ts # CLI entry (start/stop/restart/status)
537
+ ├── server.ts # HTTP + WebSocket server
538
+ ├── pi-gateway.ts # Extension WebSocket gateway
539
+ ├── browser-gateway.ts # Browser WebSocket gateway
540
+ ├── memory-event-store.ts # In-memory event buffer (LRU, per-session cap, truncation)
541
+ ├── memory-session-manager.ts # In-memory session registry
542
+ ├── preferences-store.ts # User prefs: hidden sessions, pinned dirs
543
+ ├── meta-persistence.ts # Session metadata persistence
544
+ ├── session-order-manager.ts # Per-cwd session ordering
545
+ ├── session-discovery.ts # Session file scanning & loading
546
+ ├── process-manager.ts # tmux/headless session spawning
547
+ ├── headless-pid-registry.ts # Track headless process PIDs
548
+ ├── editor-registry.ts # Available editor detection
549
+ ├── editor-manager.ts # Editor launch & file opening
550
+ ├── provider-auth-storage.ts # Provider credential persistence
551
+ │ ├── provider-auth-handlers.ts # OAuth flow handlers
552
+ ├── npm-search-proxy.ts # npm registry search proxy
553
+ ├── package-manager-wrapper.ts # pi package install/remove
554
+ ├── pending-fork-registry.ts # Flow fork decision persistence
555
+ │ ├── tunnel.ts # Zrok tunnel with reserved shares
556
+ │ ├── terminal-manager.ts # Browser terminal sessions (xterm.js + node-pty)
557
+ │ ├── server-pid.ts # PID file for daemon management
558
+ │ ├── auth.ts # OAuth2 authentication
559
+ │ └── json-store.ts # Atomic JSON file helpers
560
+ ├── client/ # React web client
561
+ │ └── src/
562
+ │ ├── App.tsx
563
+ │ ├── hooks/ # WebSocket hooks, mobile detection
564
+ │ ├── lib/ # Event reducer, command filter
565
+ │ └── components/ # UI components
566
+ │ ├── FlowDashboard.tsx # Live flow execution view
567
+ │ ├── FlowAgentCard.tsx # Per-agent status cards
568
+ │ ├── FlowGraph.tsx # DAG visualization
569
+ │ ├── FlowArchitect.tsx # Flow designer UI
570
+ │ ├── FlowSummary.tsx # Post-flow result summary
571
+ │ ├── DiffView.tsx # Side-by-side diff viewer
572
+ │ ├── TerminalView.tsx # Browser terminal emulator
573
+ │ ├── PackageBrowser.tsx # Package search & install
574
+ │ ├── ProviderAuthSection.tsx # Provider sign-in UI
575
+ │ ├── SettingsPanel.tsx # Config editor
576
+ │ └── ... # 80+ components
577
+ └── electron/ # Electron desktop app wrapper
578
+ ├── src/main.ts
579
+ ├── scripts/
580
+ └── resources/
471
581
  ```
472
582
 
473
583
  ## Monitoring
@@ -502,12 +612,20 @@ Supported methods: `confirm`, `select`, `input`, `notify`.
502
612
 
503
613
  ## Electron Desktop App
504
614
 
505
- The project includes an Electron wrapper at `packages/electron/` that bundles the dashboard as a native desktop app.
615
+ 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.
616
+
617
+ The Electron app supports two modes:
618
+
619
+ | Mode | Description |
620
+ |------|-------------|
621
+ | **Standalone** | Bundles Node.js, auto-installs pi + dashboard into `~/.pi-dashboard/`. Zero prerequisites. |
622
+ | **Power User** | Detects and uses your existing system pi + dashboard install. |
623
+
624
+ 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
625
 
507
- ### Prerequisites
626
+ ### Building from Source
508
627
 
509
- - **Node.js 22.12+** (required for building the Vite plugin and native dependencies need it)
510
- - Platform-specific tools are handled by Electron Forge automatically
628
+ > **Prerequisites for building:** Node.js 22.12+, platform-specific tools handled by Electron Forge automatically.
511
629
 
512
630
  ### Building for Your Platform
513
631
 
@@ -573,22 +691,25 @@ cd packages/electron
573
691
  npm run icons # Generates .icns (macOS), .ico (Windows), and resized PNGs
574
692
  ```
575
693
 
576
- ### CI Builds
694
+ ### CI Builds & GitHub Releases
577
695
 
578
- The Electron build workflow (`.github/workflows/electron-build.yml`) builds installers for all platforms using GitHub-hosted runners:
696
+ The release workflow (`.github/workflows/publish.yml`) builds Electron installers for **all platforms** on every version tag (`v*`):
579
697
 
580
- - **macOS arm64** `macos-14` runner → `.dmg`
581
- - **macOS x64** — `macos-13` runner → `.dmg`
582
- - **Linux x64** — `ubuntu-latest` runner `.deb` + `.AppImage`
583
- - **Windows x64** `windows-latest` runner `.exe` (NSIS)
698
+ | Runner | Platform | Outputs |
699
+ |--------|----------|---------|
700
+ | `macos-14` | macOS arm64 | `.dmg` |
701
+ | `ubuntu-latest` | Linux x64 | `.deb` + `.AppImage` |
702
+ | `ubuntu-24.04-arm` | Linux arm64 | `.deb` |
703
+ | `windows-latest` | Windows x64 | `.exe` (NSIS) + `.zip` + portable |
704
+ | `windows-latest` | Windows arm64 | `.zip` + portable (x64 Node.js via WoW64) |
584
705
 
585
- Triggered by version tags (`v*`) or manually via GitHub Actions "Run workflow".
706
+ 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
707
 
587
708
  ## CI/CD
588
709
 
589
710
  ### Continuous Integration
590
711
 
591
- Every push to `main` and every pull request triggers the CI workflow (`.github/workflows/ci.yml`):
712
+ Every push to `develop` and every pull request against `develop` triggers the CI workflow (`.github/workflows/ci.yml`):
592
713
 
593
714
  1. `npm ci` — install dependencies
594
715
  2. `npm run lint` — type check