@blackbelt-technology/pi-dashboard-extension 0.7.0 → 0.9.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/.pi/skills/browser/SKILL.md +84 -29
- package/.pi/skills/browser/UPSTREAM.md +13 -1
- package/.pi/skills/browser/references/challenge.md +183 -0
- package/.pi/skills/browser/references/dashboard-relay.md +150 -0
- package/.pi/skills/browser/references/electron.agent.md +57 -0
- package/.pi/skills/browser/references/own-browser.md +305 -0
- package/.pi/skills/browser/references/web.agent.md +323 -0
- package/.pi/skills/browser/scripts/check-panerelay.sh +157 -0
- package/.pi/skills/doctor/SKILL.md +4 -9
- package/.pi/skills/doctor/_lib/checks.ts +133 -54
- package/.pi/skills/doctor/_lib/derive-tokens.ts +5 -0
- package/.pi/skills/doctor/modules/apple-tools.knowledge.hash +1 -0
- package/.pi/skills/doctor/modules/apple-tools.md +52 -0
- package/.pi/skills/doctor/modules/mcp-builtin.knowledge.hash +1 -0
- package/.pi/skills/doctor/modules/mcp-builtin.md +61 -0
- package/.pi/skills/doctor/modules/oauth-redirect-base.knowledge.hash +1 -0
- package/.pi/skills/doctor/modules/oauth-redirect-base.md +71 -0
- package/.pi/skills/doctor/modules/pi-resolution.knowledge.hash +1 -1
- package/.pi/skills/doctor/modules/pi-resolution.md +21 -1
- package/.pi/skills/doctor/modules/plugins-bridges.md +14 -1
- package/.pi/skills/pi-dashboard/SKILL.md +10 -3
- package/.pi/skills/pi-dashboard/references/api-reference.agent.md +69 -0
- package/.pi/skills/pi-dashboard/scripts/dashboard-bus.ts +4 -4
- package/.pi/skills/project-init/SKILL.md +41 -34
- package/.pi/skills/project-init/profiles/coding/AGENTS.md.tmpl +0 -23
- package/.pi/skills/project-init/profiles/docs/profile.json +1 -1
- package/README.md +19 -0
- package/agents/DoxTriage.md +80 -0
- package/package.json +30 -16
- package/src/ask-user-tool.ts +4 -0
- package/src/auto-session-namer.ts +486 -70
- package/src/autostart-guard.ts +99 -0
- package/src/autostart-lock.ts +258 -0
- package/src/bridge-activation.ts +26 -0
- package/src/bridge-context.ts +106 -23
- package/src/bridge-default-model-gate.ts +38 -0
- package/src/bridge-polling.ts +148 -0
- package/src/bridge-ticket-client.ts +105 -0
- package/src/bridge.ts +1760 -350
- package/src/canvas-tool.ts +5 -0
- package/src/command-handler.ts +392 -71
- package/src/connect-target.ts +130 -0
- package/src/connection.ts +846 -17
- package/src/custom-entry-forward.ts +92 -0
- package/src/endpoint-resolution.ts +253 -0
- package/src/event-forwarder.ts +42 -0
- package/src/extension-identity.ts +59 -0
- package/src/flow-event-wiring.ts +125 -3
- package/src/followup-buffer.ts +217 -0
- package/src/git-dir-watcher.ts +79 -0
- package/src/git-poll.ts +45 -12
- package/src/git-probe-scheduler.ts +119 -0
- package/src/git-tracker.ts +284 -0
- package/src/instance-verification.ts +156 -0
- package/src/local-token-header.ts +44 -0
- package/src/mcp-token-delivery.ts +147 -0
- package/src/message-update-coalescer.ts +340 -0
- package/src/model-refresh.ts +95 -0
- package/src/model-tracker.ts +118 -35
- package/src/notify-proxy.ts +36 -0
- package/src/path-gate/decide.ts +149 -0
- package/src/path-gate/grant-cache.ts +71 -0
- package/src/path-gate/grant-link.ts +108 -0
- package/src/path-gate/handler.ts +307 -0
- package/src/path-gate/index.ts +155 -0
- package/src/path-gate/resolve.ts +126 -0
- package/src/path-gate/roots.ts +137 -0
- package/src/path-gate/suppression.ts +27 -0
- package/src/pending-prompt-emitter.ts +59 -0
- package/src/pi-env.d.ts +6 -10
- package/src/pi-retry-settings.ts +91 -0
- package/src/plugin-request-client.ts +114 -0
- package/src/poll-cost.ts +40 -0
- package/src/pr-status.ts +338 -0
- package/src/process-metrics.ts +77 -1
- package/src/process-scan-scheduler.ts +137 -0
- package/src/process-scanner.ts +226 -247
- package/src/project-init/dox-kb-config.ts +3 -0
- package/src/project-init/scaffold.ts +1 -4
- package/src/project-init/seed-doctrine.ts +23 -60
- package/src/prompt-bus.ts +13 -0
- package/src/provider-register.ts +92 -21
- package/src/remote-registration-gate.ts +102 -0
- package/src/retry-tracker.ts +258 -86
- package/src/role-manager.ts +38 -91
- package/src/role-model-tools.ts +44 -3
- package/src/server-auto-start.ts +331 -20
- package/src/server-launcher.ts +70 -34
- package/src/server-pin-store.ts +92 -0
- package/src/session-move.ts +275 -0
- package/src/session-sync.ts +75 -20
- package/src/slash-dispatch.ts +66 -81
- package/src/subagent-fanout-admission.ts +234 -0
- package/src/subagent-forward-sites.ts +69 -0
- package/src/subagent-frame-buffer.ts +24 -3
- package/src/subagent-frame-strip.ts +109 -0
- package/src/subagent-saturation.ts +196 -0
- package/src/subagent-tick-throttle.ts +250 -0
- package/src/terminal-reload.ts +298 -0
- package/src/transcript-backfill.ts +151 -0
- package/src/transport-diagnostics.ts +76 -0
- package/src/tui-prompt-adapter.ts +13 -1
- package/src/turn-actionability.ts +20 -0
- package/src/ui-stale-guard.ts +58 -0
- package/src/usage-drain.ts +167 -0
- package/src/vcs-info.ts +261 -63
- package/.pi/skills/doctor/AGENTS.md +0 -27
- package/.pi/skills/project-init/dox-doctrine.md +0 -104
- package/src/AGENTS.md +0 -57
- package/src/__tests__/abort-latch.test.ts +0 -97
- package/src/__tests__/agent-settled.test.ts +0 -82
- package/src/__tests__/artifact-roots.test.ts +0 -83
- package/src/__tests__/ask-user-attachments.test.ts +0 -106
- package/src/__tests__/ask-user-schema-discriminator.test.ts +0 -141
- package/src/__tests__/ask-user-tool.test.ts +0 -571
- package/src/__tests__/auto-session-namer.test.ts +0 -339
- package/src/__tests__/bridge-default-model-apply.test.ts +0 -242
- package/src/__tests__/bridge-default-model-gate.test.ts +0 -50
- package/src/__tests__/bridge-entry-id-pi-070.test.ts +0 -174
- package/src/__tests__/bridge-followup-chat-order.test.ts +0 -215
- package/src/__tests__/bridge-followup-multi-entry.test.ts +0 -202
- package/src/__tests__/bridge-followup-mutation.test.ts +0 -217
- package/src/__tests__/bridge-followup-queue-drain.test.ts +0 -266
- package/src/__tests__/bridge-hasui-flip.test.ts +0 -109
- package/src/__tests__/bridge-no-queue-mutation.test.ts +0 -112
- package/src/__tests__/bridge-plugin-emit-event.test.ts +0 -44
- package/src/__tests__/bridge-queue-update-forward.test.ts +0 -77
- package/src/__tests__/bridge-resume-disconnect.test.ts +0 -333
- package/src/__tests__/bridge-shadow-queue-gate.test.ts +0 -299
- package/src/__tests__/bridge-shutdown-reset.test.ts +0 -159
- package/src/__tests__/bridge-slash-command-routing.test.ts +0 -458
- package/src/__tests__/bridge-stop-after-turn.test.ts +0 -72
- package/src/__tests__/bridge-system-followup.test.ts +0 -163
- package/src/__tests__/bridge-thinking-level-select.test.ts +0 -68
- package/src/__tests__/browser-skill-registered.test.ts +0 -84
- package/src/__tests__/build-provider-catalogue.test.ts +0 -210
- package/src/__tests__/command-handler.test.ts +0 -1180
- package/src/__tests__/commit-draft.test.ts +0 -100
- package/src/__tests__/connection-dropped-frames.test.ts +0 -78
- package/src/__tests__/connection-suppress-auto-start.test.ts +0 -97
- package/src/__tests__/connection.test.ts +0 -344
- package/src/__tests__/credentials-updated.test.ts +0 -26
- package/src/__tests__/custom-provider-apikey-roundtrip.test.ts +0 -128
- package/src/__tests__/cwd-missing-probe.test.ts +0 -82
- package/src/__tests__/dashboard-commands-shipped.test.ts +0 -53
- package/src/__tests__/dashboard-context-injector.test.ts +0 -190
- package/src/__tests__/dashboard-default-adapter.test.ts +0 -77
- package/src/__tests__/dev-build.test.ts +0 -79
- package/src/__tests__/doctor/checks.test.ts +0 -121
- package/src/__tests__/doctor/modules.test.ts +0 -64
- package/src/__tests__/doctor/provenance-hash.test.ts +0 -94
- package/src/__tests__/doctor/router.test.ts +0 -143
- package/src/__tests__/empty-actionable-guard-config.test.ts +0 -32
- package/src/__tests__/empty-actionable-guard.test.ts +0 -73
- package/src/__tests__/enrich-model-metadata.test.ts +0 -222
- package/src/__tests__/event-forwarder.test.ts +0 -119
- package/src/__tests__/extension-slash-command-detection.test.ts +0 -143
- package/src/__tests__/filter-enabled-models.test.ts +0 -151
- package/src/__tests__/fixtures/turn-actionability-fixtures.ts +0 -69
- package/src/__tests__/fork-entryid-timing.test.ts +0 -88
- package/src/__tests__/git-info-status.test.ts +0 -73
- package/src/__tests__/git-link-builder.test.ts +0 -102
- package/src/__tests__/git-poll.test.ts +0 -69
- package/src/__tests__/markdown-image-inliner.test.ts +0 -392
- package/src/__tests__/model-resolve.test.ts +0 -379
- package/src/__tests__/multiselect-dashboard-routing.test.ts +0 -203
- package/src/__tests__/multiselect-list.test.ts +0 -137
- package/src/__tests__/multiselect-polyfill.test.ts +0 -92
- package/src/__tests__/no-session-replacement-calls.test.ts +0 -99
- package/src/__tests__/no-tui-multiselect-arm-regression.test.ts +0 -81
- package/src/__tests__/openspec-activity-detector.test.ts +0 -337
- package/src/__tests__/openspec-cli-shim.test.ts +0 -145
- package/src/__tests__/openspec-poller.test.ts +0 -124
- package/src/__tests__/pi-version-tracker.test.ts +0 -109
- package/src/__tests__/process-metrics.test.ts +0 -47
- package/src/__tests__/process-scanner-kill.test.ts +0 -61
- package/src/__tests__/process-scanner.test.ts +0 -292
- package/src/__tests__/project-init-detect-stack.test.ts +0 -61
- package/src/__tests__/project-init-dox-kb-config.test.ts +0 -53
- package/src/__tests__/project-init-profiles.test.ts +0 -84
- package/src/__tests__/project-init-scaffold.test.ts +0 -139
- package/src/__tests__/project-init-seed-doctrine.test.ts +0 -100
- package/src/__tests__/project-trust.test.ts +0 -92
- package/src/__tests__/prompt-bus-wiring.test.ts +0 -791
- package/src/__tests__/prompt-bus.test.ts +0 -513
- package/src/__tests__/prompt-expander.test.ts +0 -398
- package/src/__tests__/provider-register-native-models.test.ts +0 -182
- package/src/__tests__/provider-register-reload.test.ts +0 -498
- package/src/__tests__/provider-register-thinking-levels.test.ts +0 -104
- package/src/__tests__/retry-tracker.test.ts +0 -152
- package/src/__tests__/role-manager.test.ts +0 -585
- package/src/__tests__/role-model-tools-registry-readiness.test.ts +0 -114
- package/src/__tests__/role-model-tools.test.ts +0 -229
- package/src/__tests__/search-files-completeness.test.ts +0 -111
- package/src/__tests__/search-files-ranking.test.ts +0 -168
- package/src/__tests__/server-auto-start.test.ts +0 -375
- package/src/__tests__/server-launcher-launch.test.ts +0 -96
- package/src/__tests__/server-launcher.test.ts +0 -101
- package/src/__tests__/server-probe.test.ts +0 -25
- package/src/__tests__/session-switch.test.ts +0 -139
- package/src/__tests__/session-sync.test.ts +0 -243
- package/src/__tests__/single-derivation-guard.test.ts +0 -39
- package/src/__tests__/source-detector.test.ts +0 -88
- package/src/__tests__/stats-extractor.test.ts +0 -92
- package/src/__tests__/subagent-frame-buffer.test.ts +0 -239
- package/src/__tests__/tool-result-image-inliner.test.ts +0 -206
- package/src/__tests__/tui-prompt-adapter.test.ts +0 -213
- package/src/__tests__/turn-actionability.test.ts +0 -86
- package/src/__tests__/ui-decorators.test.ts +0 -309
- package/src/__tests__/ui-modules.test.ts +0 -293
- package/src/__tests__/vcs-info.test.ts +0 -265
- package/src/__tests__/visibility-intent.test.ts +0 -43
- package/src/__tests__/watchdog.test.ts +0 -161
- package/src/abort-latch.ts.AGENTS.md +0 -3
- package/src/agent-settled.ts +0 -72
- package/src/agent-settled.ts.AGENTS.md +0 -3
- package/src/artifact-roots.ts.AGENTS.md +0 -3
- package/src/ask-user-attachments.ts.AGENTS.md +0 -3
- package/src/ask-user-tool.ts.AGENTS.md +0 -3
- package/src/auto-session-namer.ts.AGENTS.md +0 -3
- package/src/bridge-context.ts.AGENTS.md +0 -3
- package/src/bridge-default-model-gate.ts.AGENTS.md +0 -3
- package/src/bridge.ts.AGENTS.md +0 -3
- package/src/command-handler.ts.AGENTS.md +0 -3
- package/src/commit-draft-agent.ts.AGENTS.md +0 -3
- package/src/commit-draft.ts.AGENTS.md +0 -3
- package/src/connection.ts.AGENTS.md +0 -3
- package/src/dashboard-context-injector.ts.AGENTS.md +0 -3
- package/src/dashboard-default-adapter.ts.AGENTS.md +0 -3
- package/src/dev-build.ts.AGENTS.md +0 -3
- package/src/empty-actionable-guard-config.ts.AGENTS.md +0 -3
- package/src/empty-actionable-guard.ts.AGENTS.md +0 -3
- package/src/event-forwarder.ts.AGENTS.md +0 -3
- package/src/flow-event-wiring.ts.AGENTS.md +0 -3
- package/src/git-link-builder.ts.AGENTS.md +0 -3
- package/src/git-poll.ts.AGENTS.md +0 -3
- package/src/hasui-flip.ts.AGENTS.md +0 -3
- package/src/markdown-image-inliner.ts.AGENTS.md +0 -3
- package/src/model-tracker.ts.AGENTS.md +0 -3
- package/src/multiselect-decode.ts.AGENTS.md +0 -3
- package/src/multiselect-list.ts.AGENTS.md +0 -3
- package/src/multiselect-polyfill.ts.AGENTS.md +0 -3
- package/src/openspec-cli-shim.ts.AGENTS.md +0 -7
- package/src/process-metrics.ts.AGENTS.md +0 -3
- package/src/process-scanner.ts.AGENTS.md +0 -3
- package/src/project-init/AGENTS.md +0 -12
- package/src/project-trust.ts.AGENTS.md +0 -3
- package/src/prompt-bus.ts.AGENTS.md +0 -3
- package/src/prompt-expander.ts.AGENTS.md +0 -3
- package/src/provider-register.ts.AGENTS.md +0 -3
- package/src/retry-tracker.ts.AGENTS.md +0 -3
- package/src/role-manager.ts.AGENTS.md +0 -3
- package/src/role-model-tools.ts.AGENTS.md +0 -3
- package/src/server-auto-start.ts.AGENTS.md +0 -3
- package/src/server-launcher.ts.AGENTS.md +0 -3
- package/src/session-sync.ts.AGENTS.md +0 -3
- package/src/slash-dispatch.ts.AGENTS.md +0 -3
- package/src/source-detector.ts.AGENTS.md +0 -3
- package/src/subagent-frame-buffer.ts.AGENTS.md +0 -3
- package/src/tool-result-image-inliner.ts.AGENTS.md +0 -3
- package/src/tui-prompt-adapter.ts.AGENTS.md +0 -3
- package/src/turn-actionability.ts.AGENTS.md +0 -3
- package/src/ui-modules.ts.AGENTS.md +0 -3
- package/src/vcs-info.ts.AGENTS.md +0 -3
- package/src/visibility-intent.ts.AGENTS.md +0 -3
|
@@ -16,6 +16,7 @@ derives-from:
|
|
|
16
16
|
- managed ~/.pi-dashboard node_modules (live)
|
|
17
17
|
- createRequire(sessionCwd) resolution (live)
|
|
18
18
|
- packages/server/package.json#piCompatibility.minimum (floor)
|
|
19
|
+
- packages/shared/src/pi-installs/ (enumeration + floor reader, shared)
|
|
19
20
|
---
|
|
20
21
|
|
|
21
22
|
## SCOPE
|
|
@@ -35,9 +36,22 @@ versions. Never assume "pi is one thing":
|
|
|
35
36
|
- Per-session-cwd `createRequire(cwd+'/_').resolve(...)` — what a launched
|
|
36
37
|
session actually loads.
|
|
37
38
|
|
|
39
|
+
TWO divergence questions. Never conflate them:
|
|
40
|
+
- **Consumer divergence** — the `pi` (session spawn) and `pi-coding-agent`
|
|
41
|
+
(server import) tools resolve to DIFFERENT installs. Predicate: realpath'd
|
|
42
|
+
package-directory inequality, NOT version inequality. Two different installs
|
|
43
|
+
at the same version ARE diverged.
|
|
44
|
+
- **Install-set divergence** — >1 distinct version anywhere on the box. One
|
|
45
|
+
unused old install triggers this and NOT consumer divergence.
|
|
46
|
+
`/api/health.piRuntime` reports both under distinct fields
|
|
47
|
+
(`consumerDiverged` + `installSetDiverged`); the Settings runtime picker
|
|
48
|
+
reports consumer divergence only.
|
|
49
|
+
|
|
38
50
|
Failure modes:
|
|
39
51
|
- Dashboard `/api/health` `piVersion` ≠ the version resolved at the session cwd
|
|
40
52
|
→ dashboard and sessions run different pi.
|
|
53
|
+
- Consumer divergence → the runtime is split in half: sessions spawn one pi,
|
|
54
|
+
the server imports another.
|
|
41
55
|
- Any location below `piCompatibility.minimum` → that consumer fails.
|
|
42
56
|
|
|
43
57
|
## CHECKS
|
|
@@ -45,7 +59,13 @@ Failure modes:
|
|
|
45
59
|
- Read version from repo `node_modules/@earendil-works/pi-coding-agent/package.json`.
|
|
46
60
|
- `node -e "console.log(require('module').createRequire(process.cwd()+'/_').resolve('@earendil-works/pi-coding-agent'))"` — session cwd resolution.
|
|
47
61
|
- Use `enumeratePiInstalls({ label: dir })` + `piVersionDivergence()` from
|
|
48
|
-
`_lib/checks.ts
|
|
62
|
+
`_lib/checks.ts` (re-exports `shared/src/pi-installs/` — ONE implementation,
|
|
63
|
+
shared with the server); compare each to `readPiFloor(serverPkgJsonPath)`.
|
|
64
|
+
`piVersionDivergence` answers INSTALL-SET divergence only.
|
|
65
|
+
- `enumeratePiCandidates()` (same module) derives the candidate set the picker
|
|
66
|
+
offers; `GET /api/pi/installs` returns it with per-consumer `usedBy`.
|
|
67
|
+
- `curl -s localhost:8000/api/health | jq .piRuntime` — both divergence labels
|
|
68
|
+
plus the two consumer versions, with the server up.
|
|
49
69
|
- Multiple versions are OK **only** if every one ≥ floor.
|
|
50
70
|
|
|
51
71
|
## FIX ROUTING
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plugins-bridges
|
|
3
|
-
scope: Surface bridge registration (packages[] vs dashboardPluginBridges) + activation.
|
|
3
|
+
scope: Surface bridge registration (packages[] vs dashboardPluginBridges) + activation, and kb-extension presence for DOX doctrine injection.
|
|
4
4
|
symptoms:
|
|
5
5
|
- flow wont show
|
|
6
6
|
- bridge not registered
|
|
@@ -8,6 +8,9 @@ symptoms:
|
|
|
8
8
|
- bridge misregistered
|
|
9
9
|
- plugin not loading
|
|
10
10
|
- bridge degraded
|
|
11
|
+
- doctrine not injected
|
|
12
|
+
- dox doctrine missing
|
|
13
|
+
- first-contact nudge keeps firing
|
|
11
14
|
depends-on:
|
|
12
15
|
- peers
|
|
13
16
|
derives-from:
|
|
@@ -41,6 +44,13 @@ partial load. A disabled dashboard plugin auto-deregisters its bridge entirely.
|
|
|
41
44
|
`packages[]`, not `dashboardPluginBridges`-only or missing.
|
|
42
45
|
- Anthropic bridge not active → report status + the per-peer probe result from
|
|
43
46
|
the `peers` module.
|
|
47
|
+
- **doctrine configured but kb extension not loaded**: when the project's
|
|
48
|
+
`.pi/dashboard/knowledge_base.json` supplies a `doctrine` key but
|
|
49
|
+
`pi-dashboard-kb-extension` is ABSENT from `settings.json#packages[]`, report
|
|
50
|
+
FAIL: "doctrine configured but kb extension not loaded" — the project recorded
|
|
51
|
+
a doctrine choice, yet nothing injects the text. A pointer-only `AGENTS.md`
|
|
52
|
+
(`<!-- dox-doctrine -->`, no `doctrine` key) is the supported opt-out — the
|
|
53
|
+
project may never install the extension — so it is NOT a finding.
|
|
44
54
|
|
|
45
55
|
## FIX ROUTING
|
|
46
56
|
- misregistered (dashboardPluginBridges-only) → dashboard ≥ 0.5.4 writes both;
|
|
@@ -48,6 +58,9 @@ partial load. A disabled dashboard plugin auto-deregisters its bridge entirely.
|
|
|
48
58
|
- `waiting_peers` → fix the failed peer (peers module), then respawn the session
|
|
49
59
|
(bridges wire hooks once per process).
|
|
50
60
|
- plugin disabled → enable it → the bridge auto-registers.
|
|
61
|
+
- doctrine configured but kb extension not loaded → add
|
|
62
|
+
`@blackbelt-technology/pi-dashboard-kb-extension` to `settings.json#packages[]`
|
|
63
|
+
(or `pi install` it), then reload the session.
|
|
51
64
|
|
|
52
65
|
## DERIVES-FROM
|
|
53
66
|
Live: `settings.json` packages[]/dashboardPluginBridges. Server-enriched:
|
|
@@ -41,7 +41,7 @@ orchestration (spawn → prompt → until idle → read → plugin) using `conne
|
|
|
41
41
|
### Tier split
|
|
42
42
|
|
|
43
43
|
- **COMMAND verbs → bus** (`dashboard-bus.ts`): abort, send_prompt, spawn,
|
|
44
|
-
resume, flow_control, set_model, set_thinking_level, rename,
|
|
44
|
+
resume, flow_control, set_model, set_thinking_level, rename, archive/unarchive,
|
|
45
45
|
attach/detach_proposal, plugin goal.
|
|
46
46
|
- **READ-ONLY + no-WS-twin → REST** (`dashboard-api.sh`): session / health /
|
|
47
47
|
config reads, git ops, grep/browse, `plugin_config_write`, tunnel, peer scan,
|
|
@@ -101,8 +101,15 @@ curl -s -b "pi_dash_token=YOUR_JWT" "$BASE/api/sessions" | jq .
|
|
|
101
101
|
| Abort | `curl -s -X POST "$BASE/api/session/ID/abort" -H 'Content-Type: application/json' -d '{}'` |
|
|
102
102
|
| Shutdown session | `curl -s -X POST "$BASE/api/session/ID/shutdown" -H 'Content-Type: application/json' -d '{}'` |
|
|
103
103
|
| Rename | `curl -s -X POST "$BASE/api/session/ID/rename" -H 'Content-Type: application/json' -d '{"name":"my-name"}'` |
|
|
104
|
-
|
|
|
105
|
-
|
|
|
104
|
+
| Archive | `curl -s -X POST "$BASE/api/session/ID/archive" -H 'Content-Type: application/json' -d '{}'` |
|
|
105
|
+
| Unarchive | `curl -s -X POST "$BASE/api/session/ID/unarchive" -H 'Content-Type: application/json' -d '{}'` |
|
|
106
|
+
|
|
107
|
+
> `GET /api/sessions` lists RESIDENT sessions only — archived sessions are excluded.
|
|
108
|
+
> Resolve an archived id with `GET /api/sessions/archived?q=<text>` (or
|
|
109
|
+
> `?cwd=<group-path>`), or read one row with `GET /api/sessions/archived/:id`.
|
|
110
|
+
> Archiving an alive-but-idle session terminates its pi process and completes on
|
|
111
|
+
> the ended transition; a running or interrupted (`live:true`) session is refused
|
|
112
|
+
> (WS error / REST 409).
|
|
106
113
|
| Spawn new | `curl -s -X POST "$BASE/api/session/spawn" -H 'Content-Type: application/json' -d '{"cwd":"/path"}'` |
|
|
107
114
|
| Resume/Fork | `curl -s -X POST "$BASE/api/session/ID/resume" -H 'Content-Type: application/json' -d '{"mode":"continue"}'` |
|
|
108
115
|
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# api-reference.md — index
|
|
2
|
+
|
|
3
|
+
Pull-only condensed map. Source: packages/extension/.pi/skills/pi-dashboard/references/api-reference.md. Endpoint → method+path, body, response. Base URL `http://localhost:{port}` (default 8000; config `~/.pi/dashboard/config.json`). JSON responses; mutations need `Content-Type: application/json`.
|
|
4
|
+
|
|
5
|
+
## WebSocket bus verbs
|
|
6
|
+
- Session/flow COMMAND verbs — prefer WS bus over REST; client `@blackbelt-technology/pi-dashboard-bus-client` (`scripts/dashboard-bus.ts`). Verbs = `BrowserToServerMessage` union; `plugin_config_write` excluded → stays REST. `spawn`/`resume` replies exact-correlated; other waits structural (session-id + status).
|
|
7
|
+
|
|
8
|
+
## Health & Status
|
|
9
|
+
- `GET /api/health` — liveness `{ ok, pid, uptime }`. `GET /auth/status` — `{ authenticated, authEnabled }`.
|
|
10
|
+
|
|
11
|
+
## Sessions
|
|
12
|
+
- `GET /api/sessions` — list all. Fields: `id, cwd, name?, source (tui|zed|tmux|dashboard|terminal|unknown), status (active|idle|streaming|ended), model?, thinkingLevel?, startedAt, endedAt?, tokensIn?, tokensOut?, cost?, currentTool?, gitBranch?, attachedProposal?, hidden?, activeFlowName?, flowStatus? (running|success|error|aborted), sessionFile?`.
|
|
13
|
+
|
|
14
|
+
## Session Control
|
|
15
|
+
- `POST /api/session/:id/prompt` — `{ text (required), images? [{ type:"image", data, mimeType }] }`. 400 no text, 404, 502 no bridge.
|
|
16
|
+
- `POST /api/session/:id/abort` — 200 / 404. `POST /api/session/:id/shutdown` — terminates pi process, not server.
|
|
17
|
+
- `POST /api/session/:id/rename` — `{ name }`. 400 missing name, 404.
|
|
18
|
+
- `POST /api/session/:id/hide` / `unhide` — 200 / 404.
|
|
19
|
+
- `POST /api/session/spawn` — `{ cwd }`. 400 missing cwd, 500. `POST /api/session/:id/resume` — `{ mode: "continue"|"fork" }`. 400, 404, 409 active/already resuming, 500.
|
|
20
|
+
|
|
21
|
+
## Flow Control
|
|
22
|
+
- `POST /api/session/:id/flow-control` — `{ action: "abort"|"toggle_autonomous" }`. 400, 404.
|
|
23
|
+
|
|
24
|
+
## Model Configuration
|
|
25
|
+
- `GET /api/models` — reachable model catalogue. `annotated=1` → +`excludedReason` (`no-credential`|`oauth-incompatible`). `{ object:"list", data:[{ id:"provider/modelId", provider, reasoning?, input?, contextWindow?, maxTokens?, cost?, excludedReason? }] }`. 503 pi-ai down. Do NOT parse `~/.pi/agent/providers.json` / `models.json`.
|
|
26
|
+
- `POST /api/session/:id/model` — `{ provider, modelId }`. 400, 404.
|
|
27
|
+
- `POST /api/session/:id/thinking-level` — `{ level }`. 400, 404.
|
|
28
|
+
|
|
29
|
+
## OpenSpec
|
|
30
|
+
- `POST /api/session/:id/attach-proposal` — `{ changeName }`; auto-names unnamed session. 400, 404.
|
|
31
|
+
- `POST /api/session/:id/detach-proposal` — 200 / 404.
|
|
32
|
+
- `GET /api/openspec-archive?cwd=CWD` — `data: [{ name, date, path }]`.
|
|
33
|
+
|
|
34
|
+
## Git Operations
|
|
35
|
+
- All git endpoints — localhost-only.
|
|
36
|
+
- `GET /api/git/branches?cwd=CWD` — `{ current, detached, branches:[{ name, isRemote, isCurrent }] }`.
|
|
37
|
+
- `POST /api/git/checkout` — `{ cwd, branch, stash? }`. 409 dirty → `{ success:false, dirty:true, files:[...] }`.
|
|
38
|
+
- `POST /api/git/init` — `{ cwd }`. `POST /api/git/stash-pop` — `{ cwd }` → `{ conflicts }`.
|
|
39
|
+
|
|
40
|
+
## Files & Browse
|
|
41
|
+
- All localhost-only.
|
|
42
|
+
- `GET /api/file?cwd=CWD&path=RELPATH` — file `{ type:"file", content }` | dir `{ type:"directory", entries }`.
|
|
43
|
+
- `GET /api/browse?path=PATH` — `{ current, parent, entries:[{ name, path, isGit, isPi }] }`.
|
|
44
|
+
- `GET /api/readme?cwd=CWD` — README.md content.
|
|
45
|
+
|
|
46
|
+
## Events
|
|
47
|
+
- `GET /api/events/:sessionId/:seq` — `{ eventType, timestamp, data }`.
|
|
48
|
+
- `GET /api/session-diff?sessionId=ID` — localhost-only. `{ isGitRepo, files:[{ path, changes:[{ type, timestamp, message }], gitDiff }] }`.
|
|
49
|
+
|
|
50
|
+
## Configuration
|
|
51
|
+
- `GET /api/config` — redacted secrets; localhost-only.
|
|
52
|
+
- `PUT /api/config` — partial merge; localhost-only. Any subset: `port, autoShutdown, shutdownIdleSeconds, spawnStrategy, tunnel`.
|
|
53
|
+
|
|
54
|
+
## Tunnel
|
|
55
|
+
- `GET /api/tunnel-status` — `{ status: active|inactive|unavailable, url, serverOs }`.
|
|
56
|
+
- `POST /api/tunnel-connect` — create connection.
|
|
57
|
+
- `POST /api/tunnel-disconnect` — `{ forget?: true }`. forget=true → releases reserved URL (`zrok2 delete name`) + clears `tunnel.zrok.reservedName`; forget=false/absent → URL stable next connect.
|
|
58
|
+
|
|
59
|
+
## Server Lifecycle
|
|
60
|
+
- `POST /api/shutdown` — localhost-only; flushes persistence; `{ ok:true }`.
|
|
61
|
+
|
|
62
|
+
## Pi Resources
|
|
63
|
+
- All localhost-only.
|
|
64
|
+
- `GET /api/pi-resources?cwd=CWD` — discovered extensions, skills, prompts.
|
|
65
|
+
- `GET /api/pi-resource-file?path=FILEPATH` — restricted to allowed locations.
|
|
66
|
+
- `GET /api/editors?path=CWD` — available editors. `POST /api/open-editor` — `{ path, editor, file?, line? }`.
|
|
67
|
+
|
|
68
|
+
## Pinned Directories
|
|
69
|
+
- `GET /api/pinned-dirs` — `{ success, data: ["/path"] }`.
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* npx tsx ./scripts/dashboard-bus.ts model <id-prefix> <provider> <modelId>
|
|
19
19
|
* npx tsx ./scripts/dashboard-bus.ts thinking <id-prefix> <level>
|
|
20
20
|
* npx tsx ./scripts/dashboard-bus.ts rename <id-prefix> <name...>
|
|
21
|
-
* npx tsx ./scripts/dashboard-bus.ts
|
|
21
|
+
* npx tsx ./scripts/dashboard-bus.ts archive|unarchive <id-prefix>
|
|
22
22
|
* npx tsx ./scripts/dashboard-bus.ts resume <id-prefix> [--fork]
|
|
23
23
|
* npx tsx ./scripts/dashboard-bus.ts flow <id-prefix> <abort|toggle_autonomous|dismiss_summary>
|
|
24
24
|
* npx tsx ./scripts/dashboard-bus.ts proposal-attach <id-prefix> <change>
|
|
@@ -149,10 +149,10 @@ async function main(): Promise<void> {
|
|
|
149
149
|
console.log(`renamed ${id.slice(0, 8)} → ${name}`);
|
|
150
150
|
break;
|
|
151
151
|
}
|
|
152
|
-
case "
|
|
153
|
-
case "
|
|
152
|
+
case "archive":
|
|
153
|
+
case "unarchive": {
|
|
154
154
|
const id = resolveId(pos[0] ?? die(`${cmd} needs <id-prefix>`));
|
|
155
|
-
client.send({ type: cmd === "
|
|
155
|
+
client.send({ type: cmd === "archive" ? "archive_session" : "unarchive_session", sessionId: id });
|
|
156
156
|
console.log(`${cmd} ${id.slice(0, 8)}`);
|
|
157
157
|
break;
|
|
158
158
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: project-init
|
|
3
|
-
description:
|
|
4
|
-
Scaffold an unconfigured directory into a configured pi project. Interactive,
|
|
5
|
-
profile-driven: lists project profiles (coding, docs, plus user profiles),
|
|
6
|
-
asks which to use, previews the planned writes, and on confirmation writes
|
|
7
|
-
AGENTS.md, .pi/settings.json (with a worktreeInit hook + toolset), and prompt
|
|
8
|
-
files. Use when a bare directory needs turning into a working pi project, or
|
|
9
|
-
when the dashboard's "Initialize" button spawns this session.
|
|
3
|
+
description: 'Scaffold an unconfigured directory into a configured pi project. Interactive, profile-driven: previews the planned writes, then writes AGENTS.md, .pi/settings.json and prompt files — optionally also a knowledge base, an openspec/ scaffold, and user-global ~/.pi/agent/settings.json. Use on a bare directory, or when the dashboard''s "Initialize" button spawns this session.'
|
|
10
4
|
license: MIT
|
|
11
5
|
metadata:
|
|
12
6
|
author: pi-dashboard
|
|
@@ -127,8 +121,8 @@ confirm). The writes for profile `<p>` are:
|
|
|
127
121
|
|
|
128
122
|
When `DOX_ENABLED` is true, ALSO name in the preview:
|
|
129
123
|
|
|
130
|
-
- the DOX
|
|
131
|
-
- the kb toolset flip written to `./.pi/dashboard/knowledge_base.json`
|
|
124
|
+
- the DOX pointer block appended to `./AGENTS.md` (see Step 5)
|
|
125
|
+
- the `doctrine` choice + kb toolset flip written to `./.pi/dashboard/knowledge_base.json`
|
|
132
126
|
|
|
133
127
|
When `OPENSPEC_INIT` is true, ALSO disclose the side effect (see Step 6) — NOT a
|
|
134
128
|
plain file write:
|
|
@@ -206,49 +200,62 @@ branch, never on the present/installed path (so a successfully-wired project
|
|
|
206
200
|
never carries a false "not detected" line). The install is always user-global
|
|
207
201
|
and never forced.
|
|
208
202
|
|
|
209
|
-
## Step 5 — DOX
|
|
203
|
+
## Step 5 — DOX pointer seed (only when `DOX_ENABLED` is true)
|
|
210
204
|
|
|
211
205
|
> Gated on the user's Step 3a answer (`DOX_ENABLED`), NOT the raw `profile.json`
|
|
212
206
|
> `dox` flag — the flag only supplied the default. Skip this step entirely when
|
|
213
207
|
> the user declined DOX.
|
|
214
208
|
|
|
209
|
+
Do NOT copy any doctrine text. The per-turn DOX doctrine (READ + WRITE) is
|
|
210
|
+
injected by the `pi-dashboard-kb-extension`; the project's `AGENTS.md` carries
|
|
211
|
+
only a marker + pointer block. Tune it via `.pi/dashboard/knowledge_base.json`.
|
|
215
212
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
is present, skip this step entirely).
|
|
213
|
+
**1. Seed the pointer block.** Append it to `./AGENTS.md` **only when it does
|
|
214
|
+
not already carry the marker** `<!-- dox-doctrine -->` (idempotent — if the
|
|
215
|
+
marker is present, skip this step entirely):
|
|
220
216
|
|
|
221
|
-
|
|
217
|
+
```markdown
|
|
218
|
+
<!-- dox-doctrine -->
|
|
222
219
|
|
|
223
|
-
|
|
224
|
-
2. The WRITE discipline — the text between `<!-- dox:write:start -->` and
|
|
225
|
-
`<!-- dox:write:end -->` in `dox-doctrine.md`.
|
|
226
|
-
3. ONE READ discipline variant — **skip this item entirely when the chosen
|
|
227
|
-
profile's `AGENTS.md.tmpl` already embeds a `## Finding docs (READ
|
|
228
|
-
discipline)` section** (the shipped `coding` profile does; seeding it again
|
|
229
|
-
would duplicate the gate). Seed only the WRITE discipline in that case.
|
|
230
|
-
Otherwise:
|
|
231
|
-
- If the kb toolset is wired (this profile writes
|
|
232
|
-
`knowledge_base.json` with `indexAgentsFiles`/`directoryLevelAgents`),
|
|
233
|
-
use the text between `<!-- dox:read:kb:start -->` and
|
|
234
|
-
`<!-- dox:read:kb:end -->` (references `kb agents` / `kb_search`).
|
|
235
|
-
- Otherwise use the text between `<!-- dox:read:manual:start -->` and
|
|
236
|
-
`<!-- dox:read:manual:end -->` (manual chain-walk; no kb references).
|
|
220
|
+
## DOX doctrine
|
|
237
221
|
|
|
238
|
-
|
|
239
|
-
|
|
222
|
+
Per-turn DOX doctrine — the kb-first READ discipline and the directory `AGENTS.md`
|
|
223
|
+
WRITE discipline — is injected by the `pi-dashboard-kb-extension`. Tune it in
|
|
224
|
+
`.pi/dashboard/knowledge_base.json` under the `doctrine` key (`inject`, `write`).
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**2. Record the doctrine choice.** Read-merge-write
|
|
228
|
+
`./.pi/dashboard/knowledge_base.json` — read the file if present, set ONLY the
|
|
229
|
+
`doctrine` key, preserve every other key, write valid JSON. Since `DOX_ENABLED`
|
|
230
|
+
is true here, write:
|
|
231
|
+
|
|
232
|
+
```json
|
|
233
|
+
"doctrine": { "inject": "kb", "write": true }
|
|
234
|
+
```
|
|
240
235
|
|
|
241
|
-
|
|
242
|
-
directory-level AGENTS.md toolset:
|
|
236
|
+
When the file is absent, also enable the directory-level AGENTS.md toolset:
|
|
243
237
|
|
|
244
238
|
```json
|
|
245
239
|
{
|
|
246
240
|
"sources": [{ "kind": "filesystem", "ref": "." }],
|
|
247
241
|
"indexAgentsFiles": true,
|
|
248
|
-
"directoryLevelAgents": { "enabled": true }
|
|
242
|
+
"directoryLevelAgents": { "enabled": true },
|
|
243
|
+
"doctrine": { "inject": "kb", "write": true }
|
|
249
244
|
}
|
|
250
245
|
```
|
|
251
246
|
|
|
247
|
+
**3. Scaffold the directory `AGENTS.md` tree** (path-only rows):
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
kb dox init
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**4. Offer `dox-describe`.** After the tree is scaffolded, ask the user
|
|
254
|
+
(`ask_user` confirm): "Fill the empty Purpose cells now with `dox-describe`?
|
|
255
|
+
(one subagent per `AGENTS.md`, plan-then-confirm, ≤50 rows per run)". On yes,
|
|
256
|
+
invoke the `dox-describe` skill (ships with `packages/kb-extension`); on no,
|
|
257
|
+
tell the user they can run it later.
|
|
258
|
+
|
|
252
259
|
## Step 6 — Run OpenSpec init (only when `OPENSPEC_INIT` is true)
|
|
253
260
|
|
|
254
261
|
Gated on the user's Step 3b answer (`OPENSPEC_INIT`); this only becomes true for
|
|
@@ -23,9 +23,6 @@ speed. For trivial tasks, use judgment.
|
|
|
23
23
|
(`kb agents <path>` / `kb_search`) first, then read the specific file.
|
|
24
24
|
- Before any major change, confirm the plan.
|
|
25
25
|
|
|
26
|
-
See the **Finding docs (READ discipline)** section for the kb-first
|
|
27
|
-
substitution table (which `kb_*` call replaces which raw-search reflex).
|
|
28
|
-
|
|
29
26
|
### 2. Simplicity First
|
|
30
27
|
|
|
31
28
|
- Minimum code that solves the problem. Nothing speculative.
|
|
@@ -50,26 +47,6 @@ substitution table (which `kb_*` call replaces which raw-search reflex).
|
|
|
50
47
|
|
|
51
48
|
- Give a high-level explanation of what changed — don't dump diffs without summary.
|
|
52
49
|
|
|
53
|
-
## Finding docs (READ discipline)
|
|
54
|
-
|
|
55
|
-
`kb_*` tools return a one-line purpose + key exports per file, not raw bytes —
|
|
56
|
-
faster and cheaper than raw search. **This fires on the ACTION, not the
|
|
57
|
-
intent**: before you `grep`/`rg` for a symbol, `cat`/read a file to learn what
|
|
58
|
-
it does, or chase an import, the doc lookup goes first — even mid-task when you
|
|
59
|
-
already know the file. When your reflex is the left column, run the right:
|
|
60
|
-
|
|
61
|
-
| You're about to… | Do this FIRST instead |
|
|
62
|
-
|---|---|
|
|
63
|
-
| `grep -rn "SymbolName" src/` — find where a fn / type / const lives | `kb_search --doc-type agents "SymbolName"` (or read the nearest directory `AGENTS.md` if kb is not wired) |
|
|
64
|
-
| `grep -rn "feature\|topic" src/` — how does X work / where's X handled | `kb_search "feature topic"` (or walk the root→nearest `AGENTS.md` chain) |
|
|
65
|
-
| `cat` / read a file just to learn its purpose before editing | `kb agents <path>` — one-line purpose + exports + change history |
|
|
66
|
-
| chase imports / callers across files | `kb_neighbors <path\|heading>` |
|
|
67
|
-
| read one doc section in full | `kb_get <path> <section>` |
|
|
68
|
-
|
|
69
|
-
**Fall-through:** if the kb call (or the tree) returns nothing relevant, `rg` /
|
|
70
|
-
source read is allowed — then add the missing directory `AGENTS.md` row per the
|
|
71
|
-
Documentation Update Protocol. The doc lookup does NOT replace grep; it goes first.
|
|
72
|
-
|
|
73
50
|
## Commands
|
|
74
51
|
|
|
75
52
|
<!-- Filled from the detected project stack; edit if your commands differ. -->
|
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Pi Dashboard Bridge Extension
|
|
2
|
+
|
|
3
|
+
The pi extension that connects a running `pi` session to a Pi Dashboard server.
|
|
4
|
+
|
|
5
|
+
Loaded into every pi session, it forwards session events over a WebSocket to the
|
|
6
|
+
dashboard and accepts remote commands (prompt, abort, steer) coming back.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pi package add @blackbelt-technology/pi-dashboard-extension
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Also ships the `pi-dashboard`, `browser`, `project-init` and `doctor` skills, plus
|
|
15
|
+
bundled subagent definitions under `agents/`.
|
|
16
|
+
|
|
17
|
+
## License
|
|
18
|
+
|
|
19
|
+
MIT — part of [pi-agent-dashboard](https://github.com/BlackBeltTechnology/pi-agent-dashboard).
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Judge whether a DOX AGENTS.md row is still accurate after its source file changed. Reads the real git diff since the row was last acknowledged and returns KEEP or REWRITE. Cheap, isolated, batched — never edits files itself.
|
|
3
|
+
model: "@fast"
|
|
4
|
+
inherit_context: false
|
|
5
|
+
tools: [read, bash, kb_search, kb_get]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are the DoxTriage subagent — a fast, isolated judge for one question:
|
|
9
|
+
|
|
10
|
+
**Given a DOX row and the diff its source file has accrued since that row was
|
|
11
|
+
last acknowledged, is the row's purpose text still ACCURATE?**
|
|
12
|
+
|
|
13
|
+
You do NOT edit files. You return a verdict per item. The parent applies them.
|
|
14
|
+
|
|
15
|
+
═══════════════════════════════════════════════════════════════════════
|
|
16
|
+
INPUT — the parent gives you a JSON array of work items
|
|
17
|
+
═══════════════════════════════════════════════════════════════════════
|
|
18
|
+
Each item:
|
|
19
|
+
```
|
|
20
|
+
{ "agentsFile": "packages/x/src/AGENTS.md", // which tree node owns the row
|
|
21
|
+
"row": "thing.ts", // row path, as written in the table
|
|
22
|
+
"target": "packages/x/src/thing.ts", // repo-relative real file
|
|
23
|
+
"purpose": "<current row text>",
|
|
24
|
+
"diff": "<git diff since the acked commit, possibly truncated>" }
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
═══════════════════════════════════════════════════════════════════════
|
|
28
|
+
THE ONLY QUESTION THAT MATTERS
|
|
29
|
+
═══════════════════════════════════════════════════════════════════════
|
|
30
|
+
"Bytes changed" is NOT drift. A row is a ONE-LINE PURPOSE SUMMARY, not an export
|
|
31
|
+
manifest. It is allowed to omit exports, params and internals.
|
|
32
|
+
|
|
33
|
+
Return **REWRITE** only when the diff makes the row text *factually wrong*:
|
|
34
|
+
• it names a function/const/type/env/flag/path that the diff DELETED or RENAMED
|
|
35
|
+
• it states a behaviour, default, port, or contract the diff CHANGED
|
|
36
|
+
• the file's core responsibility changed and the row now describes the old one
|
|
37
|
+
• it points at a path the diff moved
|
|
38
|
+
|
|
39
|
+
Return **KEEP** when:
|
|
40
|
+
• the diff only ADDS things the row never claimed (new exports, new branches)
|
|
41
|
+
• changes are internal refactors, formatting, comments, tests, type-only edits
|
|
42
|
+
• the row is vaguer than the diff but still true
|
|
43
|
+
• the diff is empty, unavailable, or you cannot tell → KEEP and say why in `note`
|
|
44
|
+
|
|
45
|
+
Bias to KEEP. A false REWRITE corrupts good documentation; a false KEEP leaves a
|
|
46
|
+
row no worse than it already was. When genuinely torn, KEEP with a note.
|
|
47
|
+
|
|
48
|
+
═══════════════════════════════════════════════════════════════════════
|
|
49
|
+
IF YOU REWRITE — house "caveman" style, verbatim rule
|
|
50
|
+
═══════════════════════════════════════════════════════════════════════
|
|
51
|
+
Short declarative fragments. Drop articles/copulas. Subject→verb→object. One fact
|
|
52
|
+
per line. Concrete tokens (paths/fns/env/ports) over prose. Symbols verbatim.
|
|
53
|
+
|
|
54
|
+
• PRESERVE every `See change: <name>` marker, unchanged, at the end.
|
|
55
|
+
• PRESERVE any `→ see \`X.AGENTS.md\`` sidecar pointer.
|
|
56
|
+
• Change the MINIMUM: correct the wrong clause, keep the rest verbatim.
|
|
57
|
+
• Never exceed ~200 chars unless the original already did.
|
|
58
|
+
• Output the purpose CELL ONLY — no leading `|`, no backticked path, no trailing `|`.
|
|
59
|
+
|
|
60
|
+
═══════════════════════════════════════════════════════════════════════
|
|
61
|
+
TOOLS
|
|
62
|
+
═══════════════════════════════════════════════════════════════════════
|
|
63
|
+
The diff is usually enough. Only `read` the target file when the diff is
|
|
64
|
+
truncated or ambiguous. Do NOT read whole directories; do NOT grep the repo.
|
|
65
|
+
Budget: at most a couple of reads across the whole batch — you exist to be cheap.
|
|
66
|
+
|
|
67
|
+
═══════════════════════════════════════════════════════════════════════
|
|
68
|
+
OUTPUT — a fenced ```json block, nothing else after it
|
|
69
|
+
═══════════════════════════════════════════════════════════════════════
|
|
70
|
+
```json
|
|
71
|
+
[
|
|
72
|
+
{ "agentsFile": "...", "row": "...", "verdict": "KEEP",
|
|
73
|
+
"note": "diff only adds putConfig; row never enumerated exports" },
|
|
74
|
+
{ "agentsFile": "...", "row": "...", "verdict": "REWRITE",
|
|
75
|
+
"purpose": "<corrected cell, See change preserved>",
|
|
76
|
+
"note": "row named startTunnel(); diff renamed it to connectTunnel()" }
|
|
77
|
+
]
|
|
78
|
+
```
|
|
79
|
+
One object per input item, same order. `purpose` present ONLY for REWRITE.
|
|
80
|
+
`note` is one short clause — the evidence for your verdict.
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blackbelt-technology/pi-dashboard-extension",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Pi bridge extension for pi-dashboard",
|
|
5
|
+
"license": "MIT",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
@@ -20,6 +21,17 @@
|
|
|
20
21
|
".pi/skills/browser",
|
|
21
22
|
".pi/skills/project-init",
|
|
22
23
|
".pi/skills/doctor"
|
|
24
|
+
],
|
|
25
|
+
"tools": [
|
|
26
|
+
{
|
|
27
|
+
"id": "agent-browser",
|
|
28
|
+
"probe": "resolve"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "chromium",
|
|
32
|
+
"probe": "pw-browser",
|
|
33
|
+
"optional": true
|
|
34
|
+
}
|
|
23
35
|
]
|
|
24
36
|
},
|
|
25
37
|
"files": [
|
|
@@ -27,21 +39,26 @@
|
|
|
27
39
|
".pi/skills/pi-dashboard/",
|
|
28
40
|
".pi/skills/browser/",
|
|
29
41
|
".pi/skills/project-init/",
|
|
30
|
-
".pi/skills/doctor/"
|
|
42
|
+
".pi/skills/doctor/",
|
|
43
|
+
"agents/",
|
|
44
|
+
"!**/AGENTS.md",
|
|
45
|
+
"!**/*.AGENTS.md",
|
|
46
|
+
"!**/__tests__",
|
|
47
|
+
"!**/*.test.ts",
|
|
48
|
+
"!**/*.test.tsx"
|
|
31
49
|
],
|
|
32
50
|
"dependencies": {
|
|
33
|
-
"@blackbelt-technology/pi-dashboard-bus-client": "^0.
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
51
|
+
"@blackbelt-technology/pi-dashboard-bus-client": "^0.9.0",
|
|
52
|
+
"@blackbelt-technology/pi-dashboard-shared": "^0.9.0",
|
|
53
|
+
"@fission-ai/openspec": "1.11.0",
|
|
36
54
|
"minimatch": "^10.0.0",
|
|
37
55
|
"ws": "^8.18.0"
|
|
38
56
|
},
|
|
39
57
|
"peerDependencies": {
|
|
40
|
-
"@earendil-works/pi-
|
|
41
|
-
"@earendil-works/pi-
|
|
42
|
-
"@
|
|
43
|
-
"
|
|
44
|
-
"typebox": "*"
|
|
58
|
+
"@earendil-works/pi-ai": ">=1.0.0",
|
|
59
|
+
"@earendil-works/pi-coding-agent": ">=1.0.0",
|
|
60
|
+
"@earendil-works/pi-tui": ">=1.0.0",
|
|
61
|
+
"typebox": ">=1.3.6"
|
|
45
62
|
},
|
|
46
63
|
"peerDependenciesMeta": {
|
|
47
64
|
"@earendil-works/pi-coding-agent": {
|
|
@@ -50,16 +67,13 @@
|
|
|
50
67
|
"@earendil-works/pi-tui": {
|
|
51
68
|
"optional": true
|
|
52
69
|
},
|
|
53
|
-
"@
|
|
54
|
-
"optional": true
|
|
55
|
-
},
|
|
56
|
-
"@mariozechner/pi-tui": {
|
|
70
|
+
"@earendil-works/pi-ai": {
|
|
57
71
|
"optional": true
|
|
58
72
|
}
|
|
59
73
|
},
|
|
60
74
|
"devDependencies": {
|
|
61
|
-
"@earendil-works/pi-tui": "
|
|
75
|
+
"@earendil-works/pi-tui": "^1.0.0",
|
|
62
76
|
"@types/ws": "^8.18.1",
|
|
63
|
-
"typebox": "^1.
|
|
77
|
+
"typebox": "^1.3.7"
|
|
64
78
|
}
|
|
65
79
|
}
|
package/src/ask-user-tool.ts
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
* Called at runtime (session_start) rather than extension load time to avoid
|
|
5
5
|
* static tool-name conflicts with other extensions (e.g. pi-flows) that also
|
|
6
6
|
* register ask_user. Runtime registration bypasses detectExtensionConflicts.
|
|
7
|
+
*
|
|
8
|
+
* Cwd-independence (change: update-pi-core-0-85-adopt-apis, task 5.1): pure
|
|
9
|
+
* `ctx.ui` interaction — it renders the prompt and returns the answer, resolves
|
|
10
|
+
* no filesystem path and spawns no process, so `ctx.cwd` is never consulted.
|
|
7
11
|
*/
|
|
8
12
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
9
13
|
import { Type } from "typebox";
|