@blackbelt-technology/pi-dashboard-extension 0.5.4 → 0.6.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 (254) hide show
  1. package/.pi/skills/browser/LICENSE +201 -0
  2. package/.pi/skills/browser/SKILL.md +105 -0
  3. package/.pi/skills/browser/UPSTREAM.md +46 -0
  4. package/.pi/skills/browser/references/electron.md +351 -0
  5. package/.pi/skills/browser/references/web.md +2789 -0
  6. package/.pi/skills/browser/scripts/detect-dashboard.sh +55 -0
  7. package/.pi/skills/doctor/AGENTS.md +27 -0
  8. package/.pi/skills/doctor/SKILL.md +89 -0
  9. package/.pi/skills/doctor/_lib/checks.ts +177 -0
  10. package/.pi/skills/doctor/_lib/derive-tokens.ts +43 -0
  11. package/.pi/skills/doctor/_lib/front-matter.ts +122 -0
  12. package/.pi/skills/doctor/_lib/index.ts +14 -0
  13. package/.pi/skills/doctor/_lib/knowledge-hash.ts +74 -0
  14. package/.pi/skills/doctor/_lib/provenance.ts +50 -0
  15. package/.pi/skills/doctor/_lib/regenerate.ts +100 -0
  16. package/.pi/skills/doctor/_lib/router.ts +155 -0
  17. package/.pi/skills/doctor/_lib/server-tier.ts +62 -0
  18. package/.pi/skills/doctor/modules/build-reload.knowledge.hash +1 -0
  19. package/.pi/skills/doctor/modules/build-reload.md +51 -0
  20. package/.pi/skills/doctor/modules/env-node.knowledge.hash +1 -0
  21. package/.pi/skills/doctor/modules/env-node.md +49 -0
  22. package/.pi/skills/doctor/modules/install-topology.knowledge.hash +1 -0
  23. package/.pi/skills/doctor/modules/install-topology.md +53 -0
  24. package/.pi/skills/doctor/modules/model-resolution.knowledge.hash +1 -0
  25. package/.pi/skills/doctor/modules/model-resolution.md +53 -0
  26. package/.pi/skills/doctor/modules/peers.knowledge.hash +1 -0
  27. package/.pi/skills/doctor/modules/peers.md +57 -0
  28. package/.pi/skills/doctor/modules/pi-resolution.knowledge.hash +1 -0
  29. package/.pi/skills/doctor/modules/pi-resolution.md +60 -0
  30. package/.pi/skills/doctor/modules/plugins-bridges.knowledge.hash +1 -0
  31. package/.pi/skills/doctor/modules/plugins-bridges.md +56 -0
  32. package/.pi/skills/pi-dashboard/SKILL.md +68 -0
  33. package/.pi/skills/pi-dashboard/commands/README.md +45 -0
  34. package/.pi/skills/pi-dashboard/commands/dashboard-flow-abort.md +10 -0
  35. package/.pi/skills/pi-dashboard/commands/dashboard-flow-auto.md +10 -0
  36. package/.pi/skills/pi-dashboard/commands/dashboard-git-branches.md +6 -0
  37. package/.pi/skills/pi-dashboard/commands/dashboard-git-init.md +8 -0
  38. package/.pi/skills/pi-dashboard/commands/dashboard-git-stash-pop.md +8 -0
  39. package/.pi/skills/pi-dashboard/commands/dashboard-list-models.md +10 -0
  40. package/.pi/skills/pi-dashboard/commands/dashboard-peer-list.md +6 -0
  41. package/.pi/skills/pi-dashboard/commands/dashboard-peer-scan.md +6 -0
  42. package/.pi/skills/pi-dashboard/commands/dashboard-pin-list.md +5 -0
  43. package/.pi/skills/pi-dashboard/commands/dashboard-proposal-archive.md +6 -0
  44. package/.pi/skills/pi-dashboard/commands/dashboard-proposal-attach.md +10 -0
  45. package/.pi/skills/pi-dashboard/commands/dashboard-proposal-detach.md +10 -0
  46. package/.pi/skills/pi-dashboard/commands/dashboard-server-config.md +5 -0
  47. package/.pi/skills/pi-dashboard/commands/dashboard-server-health.md +6 -0
  48. package/.pi/skills/pi-dashboard/commands/dashboard-server-tunnel-off.md +6 -0
  49. package/.pi/skills/pi-dashboard/commands/dashboard-server-tunnel-on.md +6 -0
  50. package/.pi/skills/pi-dashboard/commands/dashboard-server-tunnel-status.md +6 -0
  51. package/.pi/skills/pi-dashboard/commands/dashboard-session-abort-all.md +14 -0
  52. package/.pi/skills/pi-dashboard/commands/dashboard-session-abort.md +10 -0
  53. package/.pi/skills/pi-dashboard/commands/dashboard-session-diff.md +11 -0
  54. package/.pi/skills/pi-dashboard/commands/dashboard-session-fork.md +10 -0
  55. package/.pi/skills/pi-dashboard/commands/dashboard-session-hide.md +10 -0
  56. package/.pi/skills/pi-dashboard/commands/dashboard-session-info.md +11 -0
  57. package/.pi/skills/pi-dashboard/commands/dashboard-session-kill.md +10 -0
  58. package/.pi/skills/pi-dashboard/commands/dashboard-session-list-active.md +8 -0
  59. package/.pi/skills/pi-dashboard/commands/dashboard-session-list-here.md +8 -0
  60. package/.pi/skills/pi-dashboard/commands/dashboard-session-list.md +6 -0
  61. package/.pi/skills/pi-dashboard/commands/dashboard-session-model.md +10 -0
  62. package/.pi/skills/pi-dashboard/commands/dashboard-session-rename.md +10 -0
  63. package/.pi/skills/pi-dashboard/commands/dashboard-session-resume.md +10 -0
  64. package/.pi/skills/pi-dashboard/commands/dashboard-session-spawn.md +10 -0
  65. package/.pi/skills/pi-dashboard/commands/dashboard-session-tell.md +10 -0
  66. package/.pi/skills/pi-dashboard/commands/dashboard-session-thinking.md +10 -0
  67. package/.pi/skills/pi-dashboard/commands/dashboard-session-unhide.md +10 -0
  68. package/.pi/skills/pi-dashboard/references/api-reference.md +30 -0
  69. package/.pi/skills/pi-dashboard/references/recipes.md +38 -0
  70. package/.pi/skills/pi-dashboard/references/slash-commands.md +71 -0
  71. package/.pi/skills/pi-dashboard/scripts/dashboard-api.sh +6 -0
  72. package/.pi/skills/pi-dashboard/scripts/dashboard-bus.ts +217 -0
  73. package/.pi/skills/project-init/SKILL.md +279 -0
  74. package/.pi/skills/project-init/dox-doctrine.md +104 -0
  75. package/.pi/skills/project-init/profiles/coding/AGENTS.md.tmpl +111 -0
  76. package/.pi/skills/project-init/profiles/coding/profile.json +5 -0
  77. package/.pi/skills/project-init/profiles/coding/prompts/plan-change.md +5 -0
  78. package/.pi/skills/project-init/profiles/coding/prompts/tdd-loop.md +6 -0
  79. package/.pi/skills/project-init/profiles/coding/settings.json.tmpl +9 -0
  80. package/.pi/skills/project-init/profiles/docs/AGENTS.md.tmpl +37 -0
  81. package/.pi/skills/project-init/profiles/docs/profile.json +4 -0
  82. package/.pi/skills/project-init/profiles/docs/prompts/draft-page.md +5 -0
  83. package/.pi/skills/project-init/profiles/docs/settings.json.tmpl +9 -0
  84. package/package.json +12 -4
  85. package/src/AGENTS.md +56 -0
  86. package/src/__tests__/abort-latch.test.ts +97 -0
  87. package/src/__tests__/agent-settled.test.ts +82 -0
  88. package/src/__tests__/artifact-roots.test.ts +83 -0
  89. package/src/__tests__/ask-user-attachments.test.ts +106 -0
  90. package/src/__tests__/ask-user-tool.test.ts +90 -27
  91. package/src/__tests__/auto-session-namer.test.ts +339 -0
  92. package/src/__tests__/bridge-default-model-apply.test.ts +242 -0
  93. package/src/__tests__/bridge-default-model-gate.test.ts +6 -3
  94. package/src/__tests__/bridge-followup-mutation.test.ts +217 -0
  95. package/src/__tests__/bridge-followup-queue-drain.test.ts +266 -0
  96. package/src/__tests__/bridge-hasui-flip.test.ts +109 -0
  97. package/src/__tests__/bridge-no-queue-mutation.test.ts +112 -0
  98. package/src/__tests__/bridge-plugin-emit-event.test.ts +44 -0
  99. package/src/__tests__/bridge-shutdown-reset.test.ts +57 -136
  100. package/src/__tests__/bridge-slash-command-routing.test.ts +7 -7
  101. package/src/__tests__/bridge-stop-after-turn.test.ts +72 -0
  102. package/src/__tests__/bridge-system-followup.test.ts +163 -0
  103. package/src/__tests__/bridge-thinking-level-select.test.ts +68 -0
  104. package/src/__tests__/browser-skill-registered.test.ts +84 -0
  105. package/src/__tests__/build-provider-catalogue.test.ts +35 -1
  106. package/src/__tests__/command-handler.test.ts +331 -35
  107. package/src/__tests__/commit-draft.test.ts +100 -0
  108. package/src/__tests__/connection-dropped-frames.test.ts +78 -0
  109. package/src/__tests__/custom-provider-apikey-roundtrip.test.ts +128 -0
  110. package/src/__tests__/cwd-missing-probe.test.ts +82 -0
  111. package/src/__tests__/dashboard-commands-shipped.test.ts +53 -0
  112. package/src/__tests__/dashboard-context-injector.test.ts +190 -0
  113. package/src/__tests__/doctor/checks.test.ts +121 -0
  114. package/src/__tests__/doctor/modules.test.ts +64 -0
  115. package/src/__tests__/doctor/provenance-hash.test.ts +94 -0
  116. package/src/__tests__/doctor/router.test.ts +143 -0
  117. package/src/__tests__/empty-actionable-guard-config.test.ts +32 -0
  118. package/src/__tests__/empty-actionable-guard.test.ts +73 -0
  119. package/src/__tests__/enrich-model-metadata.test.ts +21 -0
  120. package/src/__tests__/extension-slash-command-detection.test.ts +37 -1
  121. package/src/__tests__/filter-enabled-models.test.ts +151 -0
  122. package/src/__tests__/fixtures/turn-actionability-fixtures.ts +69 -0
  123. package/src/__tests__/git-info-status.test.ts +73 -0
  124. package/src/__tests__/git-poll.test.ts +69 -0
  125. package/src/__tests__/markdown-image-inliner.test.ts +37 -0
  126. package/src/__tests__/model-resolve.test.ts +379 -0
  127. package/src/__tests__/pi-version-tracker.test.ts +109 -0
  128. package/src/__tests__/process-scanner.test.ts +112 -22
  129. package/src/__tests__/project-init-detect-stack.test.ts +61 -0
  130. package/src/__tests__/project-init-dox-kb-config.test.ts +53 -0
  131. package/src/__tests__/project-init-profiles.test.ts +84 -0
  132. package/src/__tests__/project-init-scaffold.test.ts +139 -0
  133. package/src/__tests__/project-init-seed-doctrine.test.ts +100 -0
  134. package/src/__tests__/project-trust.test.ts +92 -0
  135. package/src/__tests__/prompt-expander.test.ts +191 -1
  136. package/src/__tests__/provider-register-reload.test.ts +36 -6
  137. package/src/__tests__/provider-register-thinking-levels.test.ts +51 -0
  138. package/src/__tests__/retry-tracker.test.ts +75 -70
  139. package/src/__tests__/role-manager.test.ts +585 -0
  140. package/src/__tests__/role-model-tools-registry-readiness.test.ts +114 -0
  141. package/src/__tests__/role-model-tools.test.ts +229 -0
  142. package/src/__tests__/search-files-completeness.test.ts +111 -0
  143. package/src/__tests__/search-files-ranking.test.ts +168 -0
  144. package/src/__tests__/server-auto-start.test.ts +121 -4
  145. package/src/__tests__/server-launcher-launch.test.ts +24 -6
  146. package/src/__tests__/server-launcher.test.ts +19 -2
  147. package/src/__tests__/session-sync.test.ts +36 -0
  148. package/src/__tests__/subagent-frame-buffer.test.ts +239 -0
  149. package/src/__tests__/tool-result-image-inliner.test.ts +206 -0
  150. package/src/__tests__/tui-prompt-adapter.test.ts +70 -64
  151. package/src/__tests__/turn-actionability.test.ts +86 -0
  152. package/src/__tests__/vcs-info.test.ts +145 -4
  153. package/src/__tests__/visibility-intent.test.ts +43 -0
  154. package/src/abort-latch.ts +55 -0
  155. package/src/abort-latch.ts.AGENTS.md +3 -0
  156. package/src/agent-settled.ts +72 -0
  157. package/src/agent-settled.ts.AGENTS.md +3 -0
  158. package/src/artifact-roots.ts +73 -0
  159. package/src/artifact-roots.ts.AGENTS.md +3 -0
  160. package/src/ask-user-attachments.ts +121 -0
  161. package/src/ask-user-attachments.ts.AGENTS.md +3 -0
  162. package/src/ask-user-tool.ts +56 -58
  163. package/src/ask-user-tool.ts.AGENTS.md +3 -0
  164. package/src/auto-session-namer.ts +334 -0
  165. package/src/auto-session-namer.ts.AGENTS.md +3 -0
  166. package/src/bridge-context.ts +86 -8
  167. package/src/bridge-context.ts.AGENTS.md +3 -0
  168. package/src/bridge-default-model-gate.ts +22 -6
  169. package/src/bridge-default-model-gate.ts.AGENTS.md +3 -0
  170. package/src/bridge.ts +1241 -360
  171. package/src/bridge.ts.AGENTS.md +3 -0
  172. package/src/canvas-tool.ts +107 -0
  173. package/src/command-handler.ts +490 -51
  174. package/src/command-handler.ts.AGENTS.md +3 -0
  175. package/src/commit-draft-agent.ts +114 -0
  176. package/src/commit-draft-agent.ts.AGENTS.md +3 -0
  177. package/src/commit-draft.ts +136 -0
  178. package/src/commit-draft.ts.AGENTS.md +3 -0
  179. package/src/connection.ts +32 -1
  180. package/src/connection.ts.AGENTS.md +3 -0
  181. package/src/dashboard-context-injector.ts +124 -0
  182. package/src/dashboard-context-injector.ts.AGENTS.md +3 -0
  183. package/src/dashboard-default-adapter.ts.AGENTS.md +3 -0
  184. package/src/dev-build.ts.AGENTS.md +3 -0
  185. package/src/empty-actionable-guard-config.ts +32 -0
  186. package/src/empty-actionable-guard-config.ts.AGENTS.md +3 -0
  187. package/src/empty-actionable-guard.ts +90 -0
  188. package/src/empty-actionable-guard.ts.AGENTS.md +3 -0
  189. package/src/event-forwarder.ts.AGENTS.md +3 -0
  190. package/src/flow-event-wiring.ts +4 -14
  191. package/src/flow-event-wiring.ts.AGENTS.md +3 -0
  192. package/src/git-link-builder.ts.AGENTS.md +3 -0
  193. package/src/git-poll.ts +38 -0
  194. package/src/git-poll.ts.AGENTS.md +3 -0
  195. package/src/hasui-flip.ts +56 -0
  196. package/src/hasui-flip.ts.AGENTS.md +3 -0
  197. package/src/markdown-image-inliner.ts +45 -2
  198. package/src/markdown-image-inliner.ts.AGENTS.md +3 -0
  199. package/src/model-tracker.ts +145 -19
  200. package/src/model-tracker.ts.AGENTS.md +3 -0
  201. package/src/multiselect-decode.ts.AGENTS.md +3 -0
  202. package/src/multiselect-list.ts.AGENTS.md +3 -0
  203. package/src/multiselect-polyfill.ts.AGENTS.md +3 -0
  204. package/src/process-metrics.ts.AGENTS.md +3 -0
  205. package/src/process-scanner.ts +114 -103
  206. package/src/process-scanner.ts.AGENTS.md +3 -0
  207. package/src/project-init/AGENTS.md +12 -0
  208. package/src/project-init/detect-stack.ts +146 -0
  209. package/src/project-init/dox-kb-config.ts +47 -0
  210. package/src/project-init/profiles.ts +135 -0
  211. package/src/project-init/scaffold.ts +192 -0
  212. package/src/project-init/seed-doctrine.ts +95 -0
  213. package/src/project-trust.ts +63 -0
  214. package/src/project-trust.ts.AGENTS.md +3 -0
  215. package/src/prompt-bus.ts +10 -1
  216. package/src/prompt-bus.ts.AGENTS.md +3 -0
  217. package/src/prompt-expander.ts +238 -37
  218. package/src/prompt-expander.ts.AGENTS.md +3 -0
  219. package/src/provider-register.ts +323 -54
  220. package/src/provider-register.ts.AGENTS.md +3 -0
  221. package/src/retry-tracker.ts +64 -39
  222. package/src/retry-tracker.ts.AGENTS.md +3 -0
  223. package/src/role-manager.ts +436 -0
  224. package/src/role-manager.ts.AGENTS.md +3 -0
  225. package/src/role-model-tools.ts +301 -0
  226. package/src/role-model-tools.ts.AGENTS.md +3 -0
  227. package/src/server-auto-start.ts +59 -23
  228. package/src/server-auto-start.ts.AGENTS.md +3 -0
  229. package/src/server-launcher.ts +56 -16
  230. package/src/server-launcher.ts.AGENTS.md +3 -0
  231. package/src/session-sync.ts +111 -15
  232. package/src/session-sync.ts.AGENTS.md +3 -0
  233. package/src/slash-dispatch.ts +13 -11
  234. package/src/slash-dispatch.ts.AGENTS.md +3 -0
  235. package/src/source-detector.ts.AGENTS.md +3 -0
  236. package/src/subagent-frame-buffer.ts +220 -0
  237. package/src/subagent-frame-buffer.ts.AGENTS.md +3 -0
  238. package/src/tool-result-image-inliner.ts +204 -0
  239. package/src/tool-result-image-inliner.ts.AGENTS.md +3 -0
  240. package/src/tui-prompt-adapter.ts +123 -0
  241. package/src/tui-prompt-adapter.ts.AGENTS.md +3 -0
  242. package/src/turn-actionability.ts +117 -0
  243. package/src/turn-actionability.ts.AGENTS.md +3 -0
  244. package/src/ui-modules.ts.AGENTS.md +3 -0
  245. package/src/vcs-info.ts +91 -129
  246. package/src/vcs-info.ts.AGENTS.md +3 -0
  247. package/src/visibility-intent.ts +34 -0
  248. package/src/visibility-intent.ts.AGENTS.md +3 -0
  249. package/src/__tests__/bridge-retry-ordering.test.ts +0 -148
  250. package/src/__tests__/bridge-shadow-queue-drain.test.ts +0 -221
  251. package/src/__tests__/fixtures/usage-limit-error-strings.ts +0 -127
  252. package/src/__tests__/usage-limit-orderer.test.ts +0 -117
  253. package/src/__tests__/vcs-info-jj.test.ts +0 -145
  254. package/src/usage-limit-orderer.ts +0 -93
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: plugins-bridges
3
+ scope: Surface bridge registration (packages[] vs dashboardPluginBridges) + activation.
4
+ symptoms:
5
+ - flow wont show
6
+ - bridge not registered
7
+ - no sessions reporting
8
+ - bridge misregistered
9
+ - plugin not loading
10
+ - bridge degraded
11
+ depends-on:
12
+ - peers
13
+ derives-from:
14
+ - ~/.pi/agent/settings.json#packages[] + #dashboardPluginBridges (live)
15
+ - /api/health plugin bridgeLoadedFrom (server-enriched)
16
+ - packages/shared/src/plugin-bridge-register.ts (registration model)
17
+ ---
18
+
19
+ ## SCOPE
20
+ Report each bridge's `bridgeLoadedFrom`, flag any bridge present only in
21
+ `dashboardPluginBridges` (invisible to pi's `packages[]` reader), and report
22
+ activation status.
23
+
24
+ ## KNOWLEDGE
25
+ pi reads `packages[]`, NOT `dashboardPluginBridges`. A bridge listed ONLY in
26
+ `dashboardPluginBridges` is never invoked by pi → the "no sessions reporting"
27
+ bug. A correctly registered bridge appears in BOTH; `reconcilePluginBridgePackages`
28
+ (dashboard ≥ 0.5.4) writes both on restart.
29
+
30
+ The four dashboard bridges: `dashboard-flows`,
31
+ `dashboard-flows-anthropic-bridge`, `dashboard-goal`, `dashboard-automation`.
32
+
33
+ Activation: a bridge re-probes peers only on `session_start`. Status
34
+ `waiting_peers` names WHICH peer failed (see `peers` module); `degraded` means a
35
+ partial load. A disabled dashboard plugin auto-deregisters its bridge entirely.
36
+
37
+ ## CHECKS
38
+ - Read `settings.json#packages[]` and `#dashboardPluginBridges`; a bridge in the
39
+ latter but not the former → misregistered (flag it).
40
+ - `/api/health` (server-enriched): each plugin's `bridgeLoadedFrom` should be
41
+ `packages[]`, not `dashboardPluginBridges`-only or missing.
42
+ - Anthropic bridge not active → report status + the per-peer probe result from
43
+ the `peers` module.
44
+
45
+ ## FIX ROUTING
46
+ - misregistered (dashboardPluginBridges-only) → dashboard ≥ 0.5.4 writes both;
47
+ `POST /api/restart` to run `reconcilePluginBridgePackages`.
48
+ - `waiting_peers` → fix the failed peer (peers module), then respawn the session
49
+ (bridges wire hooks once per process).
50
+ - plugin disabled → enable it → the bridge auto-registers.
51
+
52
+ ## DERIVES-FROM
53
+ Live: `settings.json` packages[]/dashboardPluginBridges. Server-enriched:
54
+ `/api/health` `bridgeLoadedFrom`. Model:
55
+ `packages/shared/src/plugin-bridge-register.ts`. Hash sidecar:
56
+ `plugins-bridges.knowledge.hash`.
@@ -16,6 +16,37 @@ metadata:
16
16
 
17
17
  Interact with the pi-dashboard server from any pi session via its REST API.
18
18
 
19
+ ## Typed bus client (preferred for commands)
20
+
21
+ Session/flow COMMAND verbs now ride the SAME WebSocket bus the web client uses,
22
+ via [`scripts/dashboard-bus.ts`](scripts/dashboard-bus.ts) — a thin CLI wrapping
23
+ `@blackbelt-technology/pi-dashboard-bus-client`. It discovers the port itself
24
+ (config.json / `DASHBOARD_PORT` / 8000) and resolves an id-prefix to a full
25
+ session id from the live subscription snapshot, so command prose no longer needs
26
+ to teach BASE-URL derivation or GET `/api/sessions` id-resolution.
27
+
28
+ Canonical example:
29
+
30
+ ```bash
31
+ npx tsx ./scripts/dashboard-bus.ts spawn /path/to/proj --prompt "/opsx-explore add-auth"
32
+ npx tsx ./scripts/dashboard-bus.ts until <id> idle
33
+ npx tsx ./scripts/dashboard-bus.ts prompt <id> "run the tests"
34
+ ```
35
+
36
+ LLM authors can also write an ordinary type-checked `.ts` script importing
37
+ `{ connect }` from `@blackbelt-technology/pi-dashboard-bus-client` for multi-step
38
+ orchestration (spawn → prompt → until idle → read → plugin) using `connect()`,
39
+ `spawn()`, `prompt()`, `until()`, `read.sessions()`, and `plugin("goal", …)`.
40
+
41
+ ### Tier split
42
+
43
+ - **COMMAND verbs → bus** (`dashboard-bus.ts`): abort, send_prompt, spawn,
44
+ resume, flow_control, set_model, set_thinking_level, rename, hide/unhide,
45
+ attach/detach_proposal, plugin goal.
46
+ - **READ-ONLY + no-WS-twin → REST** (`dashboard-api.sh`): session / health /
47
+ config reads, git ops, grep/browse, `plugin_config_write`, tunnel, peer scan,
48
+ openspec archive/toggle. REST remains a supported compatibility shell.
49
+
19
50
  ## Setup — Discover the Dashboard URL
20
51
 
21
52
  Read the port from config, defaulting to `8000`:
@@ -60,6 +91,10 @@ curl -s -b "pi_dash_token=YOUR_JWT" "$BASE/api/sessions" | jq .
60
91
 
61
92
  ### Control Sessions
62
93
 
94
+ > The `/dashboard:session-*` and `/dashboard:flow-*` MUTATION commands now route
95
+ > through the bus CLI (`scripts/dashboard-bus.ts`). The REST rows below stay as a
96
+ > supported compatibility shell.
97
+
63
98
  | Action | Command |
64
99
  |--------|---------|
65
100
  | Send prompt | `curl -s -X POST "$BASE/api/session/ID/prompt" -H 'Content-Type: application/json' -d '{"text":"your message"}'` |
@@ -128,7 +163,40 @@ A convenience wrapper is available at [scripts/dashboard-api.sh](scripts/dashboa
128
163
  ./scripts/dashboard-api.sh POST /api/session/spawn '{"cwd":"/path/to/project"}'
129
164
  ```
130
165
 
166
+ ## Slash Commands
167
+
168
+ The `/dashboard:*` namespace wraps common operations as one-shot slash commands.
169
+ Files live in [`commands/`](commands/) and are auto-discovered by the bridge's
170
+ prompt-expander (`/dashboard:session-list` resolves `dashboard-session-list.md`).
171
+
172
+ Two classes:
173
+
174
+ - **LLM-free** (`executable: bash` frontmatter) — body runs as bash, output
175
+ renders in chat, the LLM is never invoked (chat shows an "ℹ ran locally"
176
+ footer). Read-only / zero-blast-radius ops. Example:
177
+
178
+ ```
179
+ /dashboard:session-list # table of every session, no token cost
180
+ /dashboard:session-info abc123 # all fields for a session by id-prefix
181
+ /dashboard:server-health # pid + uptime
182
+ ```
183
+
184
+ - **LLM-bound** (no `executable` frontmatter) — body expands into a user
185
+ message the LLM interprets. Mutations needing judgment or free-form text.
186
+ Example:
187
+
188
+ ```
189
+ /dashboard:session-tell abc123 please run the tests
190
+ /dashboard:session-abort-all # asks which sessions before aborting
191
+ ```
192
+
193
+ LLM-free bodies get `PI_DASHBOARD_PORT` / `PI_DASHBOARD_BASE` injected, so they
194
+ curl the running dashboard without re-deriving the port. Full list:
195
+ [references/slash-commands.md](references/slash-commands.md).
196
+ Convention + frontmatter: [commands/README.md](commands/README.md).
197
+
131
198
  ## Detailed References
132
199
 
200
+ - [Slash Commands](references/slash-commands.md) — every `/dashboard:*` command, args, LLM-free vs LLM-bound
133
201
  - [API Reference](references/api-reference.md) — Complete endpoint documentation with request/response schemas
134
202
  - [Recipes](references/recipes.md) — Multi-step orchestration workflows
@@ -0,0 +1,45 @@
1
+ # pi-dashboard slash commands
2
+
3
+ Slash commands under the `/dashboard:*` namespace. Each file is a prompt
4
+ template resolved by the bridge's prompt-expander. The `:` ↔ `-` alias means
5
+ `/dashboard:session-list` resolves `dashboard-session-list.md`.
6
+
7
+ ## Naming
8
+
9
+ `/dashboard:<resource>-<verb>[-<modifier>]` — singular resource, hyphen-joined
10
+ verb. Files are named `dashboard-<resource>-<verb>[-<modifier>].md`.
11
+
12
+ Resource families: `server`, `session`, `proposal`, `flow`, `git`, `peer`, `pin`.
13
+
14
+ ## Two classes
15
+
16
+ - **LLM-free** (`executable: bash` frontmatter): the body runs as bash, output
17
+ renders in chat, the LLM is never invoked. Read-only / zero-blast-radius ops
18
+ whose inputs are simple identifiers. Chat shows an "ℹ ran locally" footer.
19
+ - **LLM-bound** (no `executable` frontmatter): the body expands into a user
20
+ message the LLM interprets. Used for mutations needing judgment or free-form
21
+ text (e.g. `session-tell`).
22
+
23
+ ## Frontmatter
24
+
25
+ ```yaml
26
+ ---
27
+ executable: bash # opt-in; only "bash" supported. Omit for LLM-bound.
28
+ excludeFromContext: true # default true for executable: bash (no LLM context).
29
+ description: "one-liner" # cosmetic.
30
+ ---
31
+ <body>
32
+ ```
33
+
34
+ ## Resolution
35
+
36
+ The expander scans `<cwd>/.pi/skills/<skill>/commands/*.md` (one level) and
37
+ keys each file by basename. No install into `~/.pi/prompts/` is required.
38
+ See change: add-dashboard-slash-commands.
39
+
40
+ ## Env available to executable: bash bodies
41
+
42
+ - `PI_DASHBOARD_PORT` — dashboard port (from `~/.pi/dashboard/config.json`, default 8000).
43
+ - `PI_DASHBOARD_BASE` — `http://localhost:$PI_DASHBOARD_PORT`.
44
+
45
+ Positional args bind as `$1`, `$2`, … (whitespace-split, quoting not honoured in v1).
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Abort the running flow on a session. Usage /dashboard:flow-abort <id-prefix>
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Abort the running flow on a session over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts flow <id-prefix> abort
7
+
8
+ The CLI resolves the id-prefix to a full session id from the live snapshot and sends the typed `flow_control` verb with action `abort`. Report the result, or the error if no session matches the prefix.
9
+
10
+ Argument (id-prefix):
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Toggle autonomous mode for a session's flow. Usage /dashboard:flow-auto <id-prefix>
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Toggle autonomous mode for a session's flow over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts flow <id-prefix> toggle_autonomous
7
+
8
+ The CLI resolves the id-prefix to a full session id from the live snapshot and sends the typed `flow_control` verb with action `toggle_autonomous`. Report the new state, or the error if no session matches the prefix.
9
+
10
+ Argument (id-prefix):
@@ -0,0 +1,6 @@
1
+ ---
2
+ executable: bash
3
+ description: List git branches for the current dir (current marked *). Runs locally, no LLM.
4
+ ---
5
+ curl -s "$PI_DASHBOARD_BASE/api/git/branches?cwd=$PWD" \
6
+ | jq -r '.data.branches[] | (if .isCurrent then "* " else " " end) + .name'
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: Initialise a git repo in a directory. Usage /dashboard:git-init [cwd]
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Discover the base URL: prefer the $PI_DASHBOARD_PORT or $DASHBOARD_PORT env var, else read the port from ~/.pi/dashboard/config.json (default 8000); BASE="http://localhost:$PORT". When auth is enabled, include the JWT cookie. Resolve any <id-prefix> via GET /api/sessions, matching the first session whose id starts with the prefix.
5
+
6
+ Task: POST /api/git/init with body {"cwd": "<cwd>"}. Default <cwd> to the current working directory if no argument is given. Report the result.
7
+
8
+ Optional argument (cwd):
@@ -0,0 +1,8 @@
1
+ ---
2
+ description: git stash pop in a directory. Usage /dashboard:git-stash-pop [cwd]
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Discover the base URL: prefer the $PI_DASHBOARD_PORT or $DASHBOARD_PORT env var, else read the port from ~/.pi/dashboard/config.json (default 8000); BASE="http://localhost:$PORT". When auth is enabled, include the JWT cookie. Resolve any <id-prefix> via GET /api/sessions, matching the first session whose id starts with the prefix.
5
+
6
+ Task: POST /api/git/stash-pop with body {"cwd": "<cwd>"}. Default <cwd> to the current working directory if no argument is given. Report the result.
7
+
8
+ Optional argument (cwd):
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: List reachable models from the dashboard registry. Usage /dashboard:list-models [annotated]
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Discover the base URL: prefer the $PI_DASHBOARD_PORT or $DASHBOARD_PORT env var, else read the port from ~/.pi/dashboard/config.json (default 8000); BASE="http://localhost:$PORT". When auth is enabled, include the JWT cookie.
5
+
6
+ Task: GET $BASE/api/models. If the argument is `annotated` (or `1`), GET $BASE/api/models?annotated=1 instead. The response is `{ "object": "list", "data": [...] }` where each row is `{ id: "provider/modelId", provider, reasoning?, input?, contextWindow?, maxTokens?, cost? }`. In annotated mode each row also carries `excludedReason` (`null` = reachable, `no-credential` or `oauth-incompatible` = why it is not). Report the rows (id + provider + key capabilities; in annotated mode note the excludedReason for unreachable ones).
7
+
8
+ IMPORTANT: never parse ~/.pi/agent/providers.json or ~/.pi/agent/models.json for model inventory — those files hold roles/presets/custom entries, NOT the reachable catalogue, and a parse returns empty (silent failure). GET /api/models is the only correct model-introspection surface.
9
+
10
+ Arguments (optional `annotated`):
@@ -0,0 +1,6 @@
1
+ ---
2
+ executable: bash
3
+ description: List known remote dashboard servers. Runs locally, no LLM.
4
+ ---
5
+ curl -s "$PI_DASHBOARD_BASE/api/known-servers" \
6
+ | jq -r '.data[]? | "\(.label // "-") \(.host):\(.port)"'
@@ -0,0 +1,6 @@
1
+ ---
2
+ executable: bash
3
+ description: mDNS scan for peer dashboard servers on the network. Runs locally, no LLM.
4
+ ---
5
+ curl -s -X POST "$PI_DASHBOARD_BASE/api/discover-servers" \
6
+ | jq -r '.data[]? | "\(.host):\(.port) v\(.version // "-") \(if .isLocal then "(local)" else "" end)"'
@@ -0,0 +1,5 @@
1
+ ---
2
+ executable: bash
3
+ description: List pinned directories. Runs locally, no LLM.
4
+ ---
5
+ curl -s "$PI_DASHBOARD_BASE/api/pinned-dirs" | jq -r '.data[]?'
@@ -0,0 +1,6 @@
1
+ ---
2
+ executable: bash
3
+ description: List archived OpenSpec changes for the current dir (newest first). Runs locally, no LLM.
4
+ ---
5
+ curl -s "$PI_DASHBOARD_BASE/api/openspec-archive?cwd=$PWD" \
6
+ | jq -r '.data | sort_by(.date) | reverse[] | "\(.date) \(.name)"'
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Attach an OpenSpec change to a session. Usage /dashboard:proposal-attach <id-prefix> <change-name>
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Attach an OpenSpec change to a session over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts proposal-attach <id-prefix> <change>
7
+
8
+ The CLI resolves the id-prefix (first argument) to a full session id and sends the typed `attach_proposal` verb with the change name. Report the result, or the error if no session matches the prefix.
9
+
10
+ Arguments (id-prefix then change-name):
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Detach the OpenSpec change from a session. Usage /dashboard:proposal-detach <id-prefix>
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Detach the OpenSpec change from a session over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts proposal-detach <id-prefix>
7
+
8
+ The CLI resolves the id-prefix to a full session id from the live snapshot and sends the typed `detach_proposal` verb. Report the result, or the error if no session matches the prefix.
9
+
10
+ Argument (id-prefix):
@@ -0,0 +1,5 @@
1
+ ---
2
+ executable: bash
3
+ description: Dashboard server config (secrets redacted). Runs locally, no LLM.
4
+ ---
5
+ curl -s "$PI_DASHBOARD_BASE/api/config" | jq .
@@ -0,0 +1,6 @@
1
+ ---
2
+ executable: bash
3
+ description: Dashboard server liveness (pid, uptime). Runs locally, no LLM.
4
+ ---
5
+ curl -s "$PI_DASHBOARD_BASE/api/health" \
6
+ | jq -r '"ok=\(.ok) pid=\(.pid) uptime=\(.uptime)s"'
@@ -0,0 +1,6 @@
1
+ ---
2
+ description: Disconnect the public tunnel. Usage /dashboard:server-tunnel-off
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Discover the base URL: prefer the $PI_DASHBOARD_PORT or $DASHBOARD_PORT env var, else read the port from ~/.pi/dashboard/config.json (default 8000); BASE="http://localhost:$PORT". When auth is enabled, include the JWT cookie. Resolve any <id-prefix> via GET /api/sessions, matching the first session whose id starts with the prefix.
5
+
6
+ Task: POST /api/tunnel-disconnect. Then GET /api/tunnel-status and confirm it is inactive.
@@ -0,0 +1,6 @@
1
+ ---
2
+ description: Connect the public tunnel. Usage /dashboard:server-tunnel-on
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Discover the base URL: prefer the $PI_DASHBOARD_PORT or $DASHBOARD_PORT env var, else read the port from ~/.pi/dashboard/config.json (default 8000); BASE="http://localhost:$PORT". When auth is enabled, include the JWT cookie. Resolve any <id-prefix> via GET /api/sessions, matching the first session whose id starts with the prefix.
5
+
6
+ Task: POST /api/tunnel-connect. Then GET /api/tunnel-status and report the public URL.
@@ -0,0 +1,6 @@
1
+ ---
2
+ executable: bash
3
+ description: Tunnel status + public URL. Runs locally, no LLM.
4
+ ---
5
+ curl -s "$PI_DASHBOARD_BASE/api/tunnel-status" \
6
+ | jq -r '"status=\(.status) url=\(.url // "-") os=\(.serverOs // "-")"'
@@ -0,0 +1,14 @@
1
+ ---
2
+ description: Abort multiple running sessions (asks which). Usage /dashboard:session-abort-all
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). List active sessions over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts sessions
7
+
8
+ This prints sessions from the live snapshot (status streaming or active). Confirm scope with the user (all of them, only those in the current cwd, or a named subset) BEFORE acting. Then abort each chosen session:
9
+
10
+ npx tsx ./scripts/dashboard-bus.ts abort <id>
11
+
12
+ The CLI resolves each id-prefix to a full session id and sends the typed `abort` verb. Report per-session results.
13
+
14
+ Optional argument (a filter hint, e.g. 'here' or a cwd):
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Abort the current run of a session. Usage /dashboard:session-abort <id-prefix>
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Abort a session's current run over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts abort <id-prefix>
7
+
8
+ The CLI resolves the id-prefix to a full session id from the live subscription snapshot and sends the typed `abort` verb. It discovers the port itself. Report the result, or the error if no session matches the prefix.
9
+
10
+ Argument (id-prefix):
@@ -0,0 +1,11 @@
1
+ ---
2
+ executable: bash
3
+ description: Show file changes (git diff) for a session by id-prefix. Usage /dashboard:session-diff <id>. Runs locally, no LLM.
4
+ ---
5
+ ID="$1"
6
+ if [ -z "$ID" ]; then echo "usage: /dashboard:session-diff <id-prefix>" >&2; exit 2; fi
7
+ FULL=$(curl -s "$PI_DASHBOARD_BASE/api/sessions" \
8
+ | jq -r --arg id "$ID" '.data[] | select(.id | startswith($id)) | .id' | head -1)
9
+ if [ -z "$FULL" ]; then echo "no session matching $ID" >&2; exit 1; fi
10
+ curl -s "$PI_DASHBOARD_BASE/api/session-diff?sessionId=$FULL" \
11
+ | jq -r '.data.files[]? | "=== \(.path) ===\n\(.gitDiff // "(no git diff)")"'
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Fork a session into a new one. Usage /dashboard:session-fork <id-prefix>
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Fork a session into a new one over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts resume <id-prefix> --fork
7
+
8
+ The CLI resolves the id-prefix to a full session id from the live snapshot and sends the typed `resume` verb in fork mode. Report the new session id, or the error if no session matches the prefix.
9
+
10
+ Argument (id-prefix):
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Hide a session from the dashboard list. Usage /dashboard:session-hide <id-prefix>
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Hide a session from the dashboard list over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts hide <id-prefix>
7
+
8
+ The CLI resolves the id-prefix to a full session id from the live snapshot and sends the typed `hide` verb. Report the result, or the error if no session matches the prefix.
9
+
10
+ Argument (id-prefix):
@@ -0,0 +1,11 @@
1
+ ---
2
+ executable: bash
3
+ description: Show every field of a session by id-prefix. Usage /dashboard:session-info <id>. Runs locally, no LLM.
4
+ ---
5
+ ID="$1"
6
+ if [ -z "$ID" ]; then echo "usage: /dashboard:session-info <id-prefix>" >&2; exit 2; fi
7
+ curl -s "$PI_DASHBOARD_BASE/api/sessions" \
8
+ | jq -r --arg id "$ID" '
9
+ (.data[] | select(.id | startswith($id)))
10
+ // ("no session matching " + $id | halt_error(1))
11
+ | to_entries[] | "\(.key): \(.value)"'
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Shut down (kill) a session. DESTRUCTIVE. Usage /dashboard:session-kill <id-prefix>
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). This is DESTRUCTIVE — the session process is terminated. Confirm with the user first, then kill the session over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts kill <id-prefix>
7
+
8
+ The CLI resolves the id-prefix to a full session id from the live snapshot and sends the typed shutdown verb. Report the result, or the error if no session matches the prefix.
9
+
10
+ Argument (id-prefix):
@@ -0,0 +1,8 @@
1
+ ---
2
+ executable: bash
3
+ description: List active/streaming sessions only. Runs locally, no LLM.
4
+ ---
5
+ curl -s "$PI_DASHBOARD_BASE/api/sessions" \
6
+ | jq -r '.data[]
7
+ | select(.status=="streaming" or .status=="active")
8
+ | "\(.id[0:8]) \(.status) \(.name // "-") \(.cwd)"'
@@ -0,0 +1,8 @@
1
+ ---
2
+ executable: bash
3
+ description: List sessions whose cwd matches the current directory. Runs locally, no LLM.
4
+ ---
5
+ curl -s "$PI_DASHBOARD_BASE/api/sessions" \
6
+ | jq -r --arg pwd "$PWD" '.data[]
7
+ | select(.cwd==$pwd)
8
+ | "\(.id[0:8]) \(.status // "-") \(.name // "-")"'
@@ -0,0 +1,6 @@
1
+ ---
2
+ executable: bash
3
+ description: List all pi sessions (id, status, name, cwd). Runs locally, no LLM.
4
+ ---
5
+ curl -s "$PI_DASHBOARD_BASE/api/sessions" \
6
+ | jq -r '.data[] | "\(.id[0:8]) \(.status // "-") \(.name // "-") \(.cwd)"'
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Switch a session's model. Usage /dashboard:session-model <id-prefix> <provider/modelId>
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Switch a session's model over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts model <id-prefix> <provider> <modelId>
7
+
8
+ Split the `<provider/modelId>` argument on the first '/' into provider and modelId. The CLI resolves the id-prefix to a full session id and sends the typed `set_model` verb. Report the result, or the error if no session matches the prefix.
9
+
10
+ Arguments (id-prefix then provider/modelId):
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Rename a session. Usage /dashboard:session-rename <id-prefix> <name>
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Rename a session over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts rename <id-prefix> <name...>
7
+
8
+ The CLI resolves the id-prefix (first argument) to a full session id and sends the typed `rename` verb with the remaining text as the new name. Report the result, or the error if no session matches the prefix.
9
+
10
+ Arguments (id-prefix then new name):
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Resume a session (continue mode). Usage /dashboard:session-resume <id-prefix>
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Resume a session (continue mode) over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts resume <id-prefix>
7
+
8
+ The CLI resolves the id-prefix to a full session id from the live snapshot and sends the typed `resume` verb. Report the result, or the error if no session matches the prefix.
9
+
10
+ Argument (id-prefix):
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Spawn a new session in a directory. Usage /dashboard:session-spawn [cwd]
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Spawn a new session over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts spawn <cwd> [--prompt <text>] [--attach <change>]
7
+
8
+ Default <cwd> to the current working directory if no argument is given. Optionally pass `--prompt <text>` to send an initial prompt and `--attach <change>` to attach an OpenSpec change. The CLI sends the typed `spawn` verb and correlates the reply exactly. Report the new session id.
9
+
10
+ Optional argument (cwd):
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Send a prompt to another session. Usage /dashboard:session-tell <id-prefix> <text>
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Send a prompt to another session over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts prompt <id-prefix> <text...>
7
+
8
+ The CLI resolves the id-prefix (first argument) to a full session id from the live snapshot and sends the typed `send_prompt` verb with the remaining text. Report success, or the error if no session matches the prefix.
9
+
10
+ Arguments (id-prefix then prompt text):
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Set a session's thinking level. Usage /dashboard:session-thinking <id-prefix> <level>
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Set a session's thinking level over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts thinking <id-prefix> <level>
7
+
8
+ Levels are off, low, medium, high. The CLI resolves the id-prefix to a full session id and sends the typed `set_thinking_level` verb. Report the result, or the error if no session matches the prefix.
9
+
10
+ Arguments (id-prefix then level):
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Unhide a previously hidden session. Usage /dashboard:session-unhide <id-prefix>
3
+ ---
4
+ Use the pi-dashboard skill (see ../SKILL.md). Unhide a previously hidden session over the WebSocket bus:
5
+
6
+ npx tsx ./scripts/dashboard-bus.ts unhide <id-prefix>
7
+
8
+ The CLI resolves the id-prefix to a full session id from the live snapshot and sends the typed `unhide` verb. Report the result, or the error if no session matches the prefix.
9
+
10
+ Argument (id-prefix):
@@ -6,6 +6,20 @@ All responses use JSON. Mutation endpoints require `Content-Type: application/js
6
6
 
7
7
  ---
8
8
 
9
+ ## WebSocket bus verbs
10
+
11
+ Session/flow COMMAND verbs are preferably driven over the SAME WebSocket bus the
12
+ web client uses, via `@blackbelt-technology/pi-dashboard-bus-client` (wrapped by
13
+ [`scripts/dashboard-bus.ts`](../scripts/dashboard-bus.ts)). The client sends
14
+ `BrowserToServerMessage` verbs; the per-verb helpers are codegen'd from that
15
+ union, with a denylist that excludes `plugin_config_write` (stays REST). `spawn`
16
+ and `resume` replies are **exact-correlated** to the request; all other waits are
17
+ **structural** (matched on session-id + status). The REST endpoints below remain
18
+ a supported compatibility shell for the same operations plus the read-only and
19
+ no-WS-twin endpoints.
20
+
21
+ ---
22
+
9
23
  ## Health & Status
10
24
 
11
25
  ### `GET /api/health`
@@ -198,6 +212,16 @@ Control a running flow.
198
212
 
199
213
  ## Model Configuration
200
214
 
215
+ ### `GET /api/models`
216
+ List the dashboard's reachable model catalogue (model-introspection surface). Ungated beyond the dashboard's own auth gate — no `pi-proxy-...` Bearer key required (same posture as `GET /api/provider-auth/status`). To inspect available/reachable models, call this endpoint; do NOT parse `~/.pi/agent/providers.json` or `~/.pi/agent/models.json` — that path is wrong and fails silently (those files hold roles/presets, not the catalogue).
217
+
218
+ **Query:**
219
+ - `annotated=1`: return every model plus `excludedReason` (`no-credential` | `oauth-incompatible`); default returns only reachable models.
220
+
221
+ **Responses:**
222
+ - `200`: `{ "object": "list", "data": [{ "id": "provider/modelId", "provider", "reasoning?", "input?", "contextWindow?", "maxTokens?", "cost?", "excludedReason?" }] }` (capability/cost metadata only — never credentials)
223
+ - `503`: model runtime (pi-ai) unavailable
224
+
201
225
  ### `POST /api/session/:id/model`
202
226
  Set the model for a session.
203
227
 
@@ -427,6 +451,12 @@ Create a tunnel connection.
427
451
  ### `POST /api/tunnel-disconnect`
428
452
  Disconnect the active tunnel.
429
453
 
454
+ **Body (optional):**
455
+ ```json
456
+ { "forget": true }
457
+ ```
458
+ When `forget: true`, releases reserved URL (zrok v2 `zrok2 delete name`) and clears config `tunnel.zrok.reservedName`. Without body or `forget: false`, plain disconnect preserves reserved URL + config (URL stable on next connect).
459
+
430
460
  ---
431
461
 
432
462
  ## Server Lifecycle