@blackbelt-technology/pi-agent-dashboard 0.2.8 → 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.
- package/AGENTS.md +114 -9
- package/README.md +218 -97
- package/docs/architecture.md +107 -7
- package/package.json +9 -4
- package/packages/extension/package.json +1 -1
- package/packages/extension/src/__tests__/ask-user-tool.test.ts +300 -3
- package/packages/extension/src/__tests__/fork-entryid-timing.test.ts +100 -0
- package/packages/extension/src/ask-user-tool.ts +289 -20
- package/packages/extension/src/bridge.ts +38 -4
- package/packages/extension/src/command-handler.ts +34 -39
- package/packages/extension/src/prompt-expander.ts +25 -4
- package/packages/server/package.json +2 -1
- 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__/browse-endpoint.test.ts +229 -10
- package/packages/server/src/__tests__/browser-gateway-handler-errors.test.ts +129 -0
- package/packages/server/src/__tests__/cors.test.ts +34 -2
- 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 +3 -2
- package/packages/server/src/__tests__/fix-pty-permissions.test.ts +59 -0
- 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__/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 +122 -0
- 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__/provider-auth-routes.test.ts +13 -3
- package/packages/server/src/__tests__/recommended-routes.test.ts +389 -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__/test-server-canary.test.ts +31 -0
- package/packages/server/src/__tests__/tunnel.test.ts +91 -0
- package/packages/server/src/__tests__/ws-ping-pong.test.ts +10 -2
- package/packages/server/src/browse.ts +100 -6
- package/packages/server/src/browser-gateway.ts +16 -3
- package/packages/server/src/editor-manager.ts +20 -1
- package/packages/server/src/editor-pid-registry.ts +198 -0
- package/packages/server/src/fix-pty-permissions.ts +44 -0
- package/packages/server/src/headless-pid-registry.ts +9 -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 +31 -0
- package/packages/server/src/pi-core-checker.ts +290 -0
- package/packages/server/src/pi-core-updater.ts +166 -0
- package/packages/server/src/pi-gateway.ts +7 -0
- package/packages/server/src/process-manager.ts +1 -1
- package/packages/server/src/routes/file-routes.ts +30 -3
- package/packages/server/src/routes/openspec-routes.ts +83 -1
- package/packages/server/src/routes/pi-core-routes.ts +117 -0
- package/packages/server/src/routes/provider-auth-routes.ts +4 -2
- package/packages/server/src/routes/provider-routes.ts +12 -2
- package/packages/server/src/routes/recommended-routes.ts +227 -0
- package/packages/server/src/routes/system-routes.ts +10 -1
- package/packages/server/src/server.ts +151 -15
- package/packages/server/src/terminal-manager.ts +4 -0
- 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 +132 -8
- package/packages/shared/package.json +1 -1
- package/packages/shared/src/__tests__/config.test.ts +3 -3
- package/packages/shared/src/__tests__/openspec-poller.test.ts +44 -0
- package/packages/shared/src/__tests__/recommended-extensions.test.ts +123 -0
- package/packages/shared/src/__tests__/source-matching.test.ts +143 -0
- package/packages/shared/src/browser-protocol.ts +23 -1
- package/packages/shared/src/openspec-poller.ts +8 -3
- package/packages/shared/src/recommended-extensions.ts +180 -0
- package/packages/shared/src/rest-api.ts +71 -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/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
|
|
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.
|
|
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** | `
|
|
61
|
-
| **Dashboard Server** | `
|
|
62
|
-
| **Web Client** | `
|
|
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
|
-
##
|
|
78
|
+
## Getting Started
|
|
67
79
|
|
|
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) |
|
|
80
|
+
There are three ways to use the dashboard, from simplest to most flexible:
|
|
73
81
|
|
|
74
|
-
###
|
|
82
|
+
### Option A: Electron Desktop App (standalone — no prerequisites)
|
|
75
83
|
|
|
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) |
|
|
84
|
+
Download a pre-built installer from [GitHub Releases](https://github.com/BlackBeltTechnology/pi-agent-dashboard/releases) for your platform:
|
|
80
85
|
|
|
81
|
-
|
|
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
|
-
|
|
95
|
+
On first launch, a setup wizard guides you through:
|
|
84
96
|
|
|
85
|
-
**
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
**
|
|
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
|
-
###
|
|
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
|
-
|
|
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/
|
|
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
|
-
###
|
|
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
|
|
268
|
-
npx tsx
|
|
269
|
-
npx tsx
|
|
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
|
|
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
|
|
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
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
│
|
|
433
|
-
│
|
|
434
|
-
│
|
|
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
|
-
│
|
|
437
|
-
│
|
|
438
|
-
│
|
|
439
|
-
│
|
|
440
|
-
│
|
|
441
|
-
│
|
|
442
|
-
│
|
|
443
|
-
│
|
|
444
|
-
│
|
|
445
|
-
│
|
|
446
|
-
│
|
|
447
|
-
│
|
|
448
|
-
│
|
|
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
|
-
│
|
|
451
|
-
│
|
|
452
|
-
│
|
|
453
|
-
│
|
|
454
|
-
│
|
|
455
|
-
│
|
|
456
|
-
│
|
|
457
|
-
│
|
|
458
|
-
│
|
|
459
|
-
│
|
|
460
|
-
│
|
|
461
|
-
│
|
|
462
|
-
│
|
|
463
|
-
│
|
|
464
|
-
│
|
|
465
|
-
├──
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
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
|
-
###
|
|
626
|
+
### Building from Source
|
|
508
627
|
|
|
509
|
-
|
|
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
|
|
696
|
+
The release workflow (`.github/workflows/publish.yml`) builds Electron installers for **all platforms** on every version tag (`v*`):
|
|
579
697
|
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
-
|
|
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
|
-
|
|
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 `
|
|
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
|