@blackbelt-technology/pi-agent-dashboard 0.10.0 → 0.12.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 +4 -2
- package/README.md +64 -18
- package/docs/architecture.md +2325 -270
- package/package.json +36 -20
- package/packages/extension/package.json +18 -9
- package/packages/extension/src/bridge-context.ts +6 -0
- package/packages/extension/src/bridge-handlers/dispatch.ts +109 -70
- package/packages/extension/src/bridge-handlers/forwarders.ts +19 -42
- package/packages/extension/src/bridge-handlers/instance.ts +31 -13
- package/packages/extension/src/bridge-handlers/lifecycle.ts +149 -66
- package/packages/extension/src/bridge-shutdown.ts +44 -0
- package/packages/extension/src/bridge-ticket-client.ts +61 -7
- package/packages/extension/src/bridge-tls-checks.ts +79 -0
- package/packages/extension/src/bridge.ts +309 -284
- package/packages/extension/src/canvas-tool.ts +2 -0
- package/packages/extension/src/command-handler.ts +106 -37
- package/packages/extension/src/connect-target.ts +23 -0
- package/packages/extension/src/connection.ts +153 -38
- package/packages/extension/src/credential-guard.ts +300 -0
- package/packages/extension/src/custom-entry-forward.ts +27 -18
- package/packages/extension/src/dashboard-http-origin.ts +88 -0
- package/packages/extension/src/default-model-apply.ts +83 -0
- package/packages/extension/src/dev-build.ts +11 -1
- package/packages/extension/src/flow-event-wiring.ts +19 -95
- package/packages/extension/src/followup-drain.ts +19 -5
- package/packages/extension/src/git-link-builder.ts +11 -2
- package/packages/extension/src/inbound-limits.ts +138 -0
- package/packages/extension/src/local-token-header.ts +77 -6
- package/packages/extension/src/model-refresh.ts +69 -0
- package/packages/extension/src/path-gate/decide.ts +68 -5
- package/packages/extension/src/path-gate/handler.ts +16 -8
- package/packages/extension/src/path-gate/index.ts +2 -2
- package/packages/extension/src/path-gate/roots.ts +15 -3
- package/packages/extension/src/path-gate/suppression.ts +3 -0
- package/packages/extension/src/pi-env.d.ts +8 -1
- package/packages/extension/src/pi-retry-settings.ts +11 -2
- package/packages/extension/src/pinned-endpoint.ts +44 -0
- package/packages/extension/src/plugin-event-forward-registry.ts +90 -14
- package/packages/extension/src/preview-path-link.ts +151 -0
- package/packages/extension/src/project-init/scaffold.ts +98 -35
- package/packages/extension/src/project-trust-live.ts +143 -0
- package/packages/extension/src/project-trust.ts +178 -30
- package/packages/extension/src/provider-model-cache.ts +118 -0
- package/packages/extension/src/provider-register.ts +487 -46
- package/packages/extension/src/remote-registration-gate.ts +21 -21
- package/packages/extension/src/remote-upgrade-preparer.ts +104 -0
- package/packages/extension/src/retry-tracker.ts +90 -7
- package/packages/extension/src/role-manager.ts +4 -2
- package/packages/extension/src/role-model-tools.ts +68 -10
- package/packages/extension/src/server-auto-start.ts +69 -3
- package/packages/extension/src/server-launcher.ts +26 -8
- package/packages/extension/src/server-proof-probe.ts +117 -0
- package/packages/extension/src/session-sync.ts +53 -24
- package/packages/extension/src/spawn-new-session.ts +22 -0
- package/packages/extension/src/steer-buffer.ts +164 -0
- package/packages/extension/src/stream-forward-buffer.ts +64 -15
- package/packages/extension/src/sudo-askpass/config-reader.ts +32 -0
- package/packages/extension/src/sudo-askpass/controller.ts +405 -0
- package/packages/extension/src/sudo-askpass/helper-script.ts +69 -0
- package/packages/extension/src/sudo-askpass/in-flight.ts +79 -0
- package/packages/extension/src/sudo-askpass/index.ts +11 -0
- package/packages/extension/src/sudo-askpass/install.ts +143 -0
- package/packages/extension/src/sudo-askpass/password-cache.ts +118 -0
- package/packages/extension/src/sudo-askpass/prompt-text.ts +55 -0
- package/packages/extension/src/sudo-askpass/protocol.ts +18 -0
- package/packages/extension/src/sudo-askpass/sudo-mask-registry.ts +52 -0
- package/packages/extension/src/terminal-reload.ts +19 -5
- package/packages/extension/src/tool-update-filter-registry.ts +210 -0
- package/packages/extension/src/vault-delivery.ts +11 -1
- package/packages/extension/src/vault-redaction.ts +4 -3
- package/packages/server/package.json +17 -14
- package/packages/server/src/access/access-denials.ts +8 -0
- package/packages/server/src/access/access-grants.ts +303 -64
- package/packages/server/src/access/access-health.ts +10 -0
- package/packages/server/src/access/access-plane.ts +12 -1
- package/packages/server/src/access/containment-gate.ts +113 -30
- package/packages/server/src/access/cwd-verdict.ts +3 -3
- package/packages/server/src/access/denial-hold.ts +3 -0
- package/packages/server/src/access/grant-coordinator.ts +17 -1
- package/packages/server/src/access/named-grant.ts +3 -0
- package/packages/server/src/access/pending-grant-registry.ts +32 -5
- package/packages/server/src/access/pi-trust-live.ts +244 -0
- package/packages/server/src/access/pi-trust-mirror-service.ts +50 -11
- package/packages/server/src/access/planes.ts +107 -1
- package/packages/server/src/access/preview-egress-store.ts +153 -0
- package/packages/server/src/access/prompt-channel.ts +5 -0
- package/packages/server/src/access/provisioning-wiring.ts +113 -0
- package/packages/server/src/access/provisioning.ts +763 -0
- package/packages/server/src/access/verified-read.ts +24 -7
- package/packages/server/src/access/yolo-session.ts +54 -2
- package/packages/server/src/acp-bridge/acp-session-adapter.ts +18 -5
- package/packages/server/src/acp-bridge/server-requests.ts +10 -4
- package/packages/server/src/agent-events/agent-event-hub.ts +158 -0
- package/packages/server/src/auth/audit-log.ts +108 -0
- package/packages/server/src/auth/auth-plugin.ts +230 -38
- package/packages/server/src/auth/auth.ts +104 -4
- package/packages/server/src/auth/bearer-auth.ts +52 -12
- package/packages/server/src/auth/bridge-ticket-eligibility.ts +53 -10
- package/packages/server/src/auth/cors-origin.ts +90 -30
- package/packages/server/src/auth/credential-envelope.ts +233 -0
- package/packages/server/src/auth/credential-key-worker.d.mts +16 -0
- package/packages/server/src/auth/credential-key-worker.mjs +108 -0
- package/packages/server/src/auth/credential-key.ts +479 -0
- package/packages/server/src/auth/credential-migration.ts +162 -0
- package/packages/server/src/auth/csp-report-paths.ts +26 -0
- package/packages/server/src/auth/csp-report-sink.ts +302 -0
- package/packages/server/src/auth/csp-report-store.ts +406 -0
- package/packages/server/src/auth/csp.ts +145 -11
- package/packages/server/src/auth/dashboard-credential-store.ts +4 -0
- package/packages/server/src/auth/dashboard-state-caller.ts +29 -0
- package/packages/server/src/auth/device-proof.ts +202 -0
- package/packages/server/src/auth/duplicate-cookie-gate.ts +271 -0
- package/packages/server/src/auth/host-admission.ts +7 -0
- package/packages/server/src/auth/host-gate.ts +13 -2
- package/packages/server/src/auth/local-proof-refusal-log.ts +89 -0
- package/packages/server/src/auth/local-proof.ts +69 -18
- package/packages/server/src/auth/localhost-guard.ts +98 -33
- package/packages/server/src/auth/locked-json-file.ts +68 -6
- package/packages/server/src/auth/models-json-store.ts +269 -0
- package/packages/server/src/auth/mutation-origin-gate.ts +5 -2
- package/packages/server/src/auth/nav-intent.ts +72 -0
- package/packages/server/src/auth/node-guard.ts +36 -49
- package/packages/server/src/auth/passkey/passkey-assets.ts +99 -0
- package/packages/server/src/auth/passkey/passkey-pages.ts +17 -81
- package/packages/server/src/auth/passkey/passkey-routes.ts +8 -0
- package/packages/server/src/auth/pi-legacy-credentials.ts +3 -0
- package/packages/server/src/auth/plugin-credential-store.ts +81 -10
- package/packages/server/src/auth/plugin-server-trust.ts +29 -0
- package/packages/server/src/auth/plugin-trust-store.ts +103 -0
- package/packages/server/src/auth/proven-tls.ts +45 -0
- package/packages/server/src/auth/provider-auth-storage.ts +214 -12
- package/packages/server/src/auth/provider-block-checks.ts +321 -0
- package/packages/server/src/auth/provider-host-detect.ts +151 -0
- package/packages/server/src/auth/provider-key-file.ts +71 -0
- package/packages/server/src/auth/provider-readiness.ts +91 -0
- package/packages/server/src/auth/radius-mcp.ts +1 -1
- package/packages/server/src/auth/request-principal.ts +32 -0
- package/packages/server/src/auth/route-tier-gate.ts +3 -2
- package/packages/server/src/auth/secret-rotation.ts +246 -0
- package/packages/server/src/auth/secure-origin.ts +56 -0
- package/packages/server/src/auth/serve-app-host.ts +111 -11
- package/packages/server/src/auth/vertex-key-check.ts +140 -0
- package/packages/server/src/auth/ws-ticket.ts +40 -2
- package/packages/server/src/auth/ws-upgrade-reject-log.ts +4 -1
- package/packages/server/src/browse.ts +73 -20
- package/packages/server/src/browser-handlers/acp-guard.ts +1 -4
- package/packages/server/src/browser-handlers/directory-handler.ts +34 -24
- package/packages/server/src/browser-handlers/folder-gate.ts +55 -0
- package/packages/server/src/browser-handlers/handler-context.ts +25 -2
- package/packages/server/src/browser-handlers/session-action-handler.ts +167 -63
- package/packages/server/src/browser-handlers/spawn-choice.ts +138 -1
- package/packages/server/src/browser-handlers/subscription-handler.ts +146 -3
- package/packages/server/src/browser-handlers/terminal-handler.ts +108 -10
- package/packages/server/src/build-plugin-send-prompt.ts +18 -0
- package/packages/server/src/canvas/canvas-accumulator.ts +35 -7
- package/packages/server/src/cli/credentials-command.ts +555 -0
- package/packages/server/src/cli.ts +229 -53
- package/packages/server/src/config-api.ts +53 -35
- package/packages/server/src/config-snapshot.ts +197 -1
- package/packages/server/src/directory-service.ts +193 -68
- package/packages/server/src/embed-lifecycle/idle-reaper.ts +13 -3
- package/packages/server/src/event-wiring.ts +322 -207
- package/packages/server/src/git-worktree/ensure-worktree.ts +185 -0
- package/packages/server/src/git-worktree/git-operations.ts +45 -11
- package/packages/server/src/git-worktree/redact-git-text.ts +124 -0
- package/packages/server/src/git-worktree/ref-arg.ts +39 -0
- package/packages/server/src/git-worktree/repo-lock.ts +42 -0
- package/packages/server/src/git-worktree/start-worktree-init.ts +151 -0
- package/packages/server/src/git-worktree/worktree-init-trust.ts +43 -1
- package/packages/server/src/git-worktree/worktree-init.ts +5 -1
- package/packages/server/src/identity/http-road-classification.ts +18 -2
- package/packages/server/src/identity/identity-floor.ts +5 -2
- package/packages/server/src/identity/ws-message-scope.ts +11 -3
- package/packages/server/src/identity/ws-road-classification.ts +3 -1
- package/packages/server/src/known-server-moves.ts +36 -15
- package/packages/server/src/lib/browse-roots.ts +129 -17
- package/packages/server/src/lib/client-dist.ts +36 -21
- package/packages/server/src/lib/content-disposition.ts +20 -0
- package/packages/server/src/lib/dashboard-state-guard.ts +513 -0
- package/packages/server/src/lib/diagram-render.ts +4 -6
- package/packages/server/src/lib/eml.ts +5 -10
- package/packages/server/src/lib/file-cwd-admission.ts +145 -0
- package/packages/server/src/lib/frame-policy-probe.ts +308 -0
- package/packages/server/src/lib/frame-policy-test-seam.ts +99 -0
- package/packages/server/src/lib/frame-policy-verdict.ts +125 -0
- package/packages/server/src/lib/grep-worker.ts +23 -0
- package/packages/server/src/lib/grep.ts +96 -7
- package/packages/server/src/lib/index-html.ts +81 -0
- package/packages/server/src/lib/mention-fuzzy-index.ts +263 -0
- package/packages/server/src/lib/office-preview.ts +49 -13
- package/packages/server/src/lib/path-containment.ts +50 -10
- package/packages/server/src/lib/resolve-file-mention.ts +234 -40
- package/packages/server/src/lib/resolve-mentions-batch.ts +143 -0
- package/packages/server/src/lib/route-admission.ts +80 -0
- package/packages/server/src/lib/writable-handler-target.ts +4 -0
- package/packages/server/src/lib/writable-md-target.ts +26 -0
- package/packages/server/src/lifecycle/boot-parent-liveness.ts +10 -25
- package/packages/server/src/lifecycle/credential-exit-barrier.ts +207 -0
- package/packages/server/src/lifecycle/exit-signal.ts +43 -0
- package/packages/server/src/lifecycle/recovery-server.ts +65 -18
- package/packages/server/src/live-server/capability-redact.ts +31 -0
- package/packages/server/src/live-server/live-browser-gate.ts +22 -0
- package/packages/server/src/live-server/live-capability.ts +615 -44
- package/packages/server/src/live-server/live-csp-report.ts +63 -0
- package/packages/server/src/live-server/live-csp.ts +141 -0
- package/packages/server/src/live-server/live-egress.ts +435 -0
- package/packages/server/src/live-server/live-exposure.ts +149 -0
- package/packages/server/src/live-server/live-log.ts +25 -0
- package/packages/server/src/live-server/live-origin-scan.ts +298 -0
- package/packages/server/src/live-server/live-server-manager.ts +220 -33
- package/packages/server/src/live-server/live-server-proxy.ts +411 -50
- package/packages/server/src/live-server/live-static.ts +231 -0
- package/packages/server/src/live-server/preview-dispatch.ts +286 -0
- package/packages/server/src/live-server/preview-observe.ts +53 -0
- package/packages/server/src/live-server/preview-origin.ts +182 -0
- package/packages/server/src/live-server/preview-path-bridge.ts +70 -0
- package/packages/server/src/live-server/preview-path-store.ts +420 -0
- package/packages/server/src/live-server/preview-path.ts +40 -0
- package/packages/server/src/live-server/preview-pool.ts +385 -0
- package/packages/server/src/live-server/preview-preflight.ts +41 -0
- package/packages/server/src/live-server/preview-reserve.ts +44 -0
- package/packages/server/src/live-server/preview-tier.ts +217 -0
- package/packages/server/src/live-server/preview-viewers.ts +54 -0
- package/packages/server/src/live-server/preview-ws-registry.ts +43 -0
- package/packages/server/src/model-proxy/custom-provider-discovery.ts +4 -2
- package/packages/server/src/model-proxy/internal-auth-storage.ts +5 -1
- package/packages/server/src/model-proxy/internal-registry.ts +283 -21
- package/packages/server/src/model-proxy/models-block-apply.ts +291 -0
- package/packages/server/src/model-proxy/pi-models-validator.ts +164 -0
- package/packages/server/src/model-proxy/registry-singleton.ts +44 -9
- package/packages/server/src/model-proxy/server-model-runtime.ts +17 -0
- package/packages/server/src/openspec/dependencies-file.ts +122 -0
- package/packages/server/src/openspec/openspec-change-watcher.ts +3 -1
- package/packages/server/src/openspec/openspec-dependency-inputs.ts +281 -0
- package/packages/server/src/openspec/openspec-poll-fs-helpers.ts +72 -26
- package/packages/server/src/openspec/openspec-poll-worker-pool.ts +48 -12
- package/packages/server/src/openspec/openspec-poll-worker.ts +95 -9
- package/packages/server/src/openspec/readiness.ts +1 -1
- package/packages/server/src/openspec/workflow-schema-status.ts +379 -0
- package/packages/server/src/openspec/workflow-schema.ts +141 -267
- package/packages/server/src/package/npm-search-proxy.ts +5 -2
- package/packages/server/src/package/provider-probe.ts +202 -7
- package/packages/server/src/pairing/browser-gateway.ts +325 -51
- package/packages/server/src/pairing/device-key-intake.ts +120 -0
- package/packages/server/src/pairing/device-token-services.ts +26 -0
- package/packages/server/src/pairing/paired-devices.ts +702 -27
- package/packages/server/src/pairing/pairing.ts +103 -11
- package/packages/server/src/pairing/{subagent-resync-routing.ts → resync-requester-registry.ts} +6 -10
- package/packages/server/src/pairing/socket-locality.ts +26 -0
- package/packages/server/src/pairing/ws-tier-gate.ts +74 -0
- package/packages/server/src/pending/pending-attach-registry.ts +15 -0
- package/packages/server/src/pending/pending-initial-prompt-registry.ts +15 -0
- package/packages/server/src/persistence/memory-event-store.ts +251 -296
- package/packages/server/src/persistence/preferences-store.ts +61 -2
- package/packages/server/src/pi/bridge-channel.ts +33 -0
- package/packages/server/src/pi/bridge-contention.ts +84 -2
- package/packages/server/src/pi/bridge-upgrade-auth.ts +18 -3
- package/packages/server/src/pi/gateway-listeners.ts +9 -3
- package/packages/server/src/pi/host-project-trust.ts +29 -15
- package/packages/server/src/pi/pi-gateway.ts +398 -41
- package/packages/server/src/pi/provisional-registration.ts +4 -1
- package/packages/server/src/pi/resource-toggle-trust.ts +18 -7
- package/packages/server/src/pi-agent-settings.ts +95 -301
- package/packages/server/src/pi-default-remirror.ts +89 -0
- package/packages/server/src/plugin-append-event.ts +35 -0
- package/packages/server/src/plugin-discovery-wiring.ts +142 -0
- package/packages/server/src/plugin-entry-stats.ts +61 -0
- package/packages/server/src/plugin-event-seam.ts +116 -4
- package/packages/server/src/plugin-local-request.ts +207 -0
- package/packages/server/src/plugin-ownership.ts +111 -0
- package/packages/server/src/plugin-policy-registry.ts +297 -0
- package/packages/server/src/plugin-request-lane.ts +92 -16
- package/packages/server/src/plugin-runtime-clients.ts +89 -0
- package/packages/server/src/preferences-relay.ts +20 -0
- package/packages/server/src/project-seed.ts +347 -0
- package/packages/server/src/push/push-transports/webhook-url.ts +8 -5
- package/packages/server/src/questions/question-store.ts +3 -2
- package/packages/server/src/routes/access-routes.ts +182 -15
- package/packages/server/src/routes/acme-routes.ts +14 -4
- package/packages/server/src/routes/agent-event-stream-routes.ts +137 -0
- package/packages/server/src/routes/canvas-types-routes.ts +20 -6
- package/packages/server/src/routes/csp-violations-routes.ts +162 -0
- package/packages/server/src/routes/file-routes.ts +640 -279
- package/packages/server/src/routes/file-write-binary-routes.ts +97 -24
- package/packages/server/src/routes/folder-project-routes.ts +18 -12
- package/packages/server/src/routes/frame-policy-routes.ts +215 -0
- package/packages/server/src/routes/git-routes.ts +340 -273
- package/packages/server/src/routes/grep-routes.ts +64 -14
- package/packages/server/src/routes/known-servers-routes.ts +189 -91
- package/packages/server/src/routes/live-server-routes.ts +572 -15
- package/packages/server/src/routes/local-proof-routes.ts +14 -0
- package/packages/server/src/routes/models-introspection-routes.ts +1 -1
- package/packages/server/src/routes/nav-intent-routes.ts +46 -0
- package/packages/server/src/routes/openspec-group-routes.ts +53 -44
- package/packages/server/src/routes/openspec-routes.ts +396 -31
- package/packages/server/src/routes/package-routes.ts +58 -10
- package/packages/server/src/routes/pairing-routes.ts +342 -17
- package/packages/server/src/routes/pi-settings-routes.ts +2 -0
- package/packages/server/src/routes/pi-trust-query-routes.ts +330 -0
- package/packages/server/src/routes/plugin-activation-routes.ts +59 -0
- package/packages/server/src/routes/plugin-runtime-client-routes.ts +149 -0
- package/packages/server/src/routes/preferences-auto-name-routes.ts +5 -2
- package/packages/server/src/routes/preferences-claude-compat-routes.ts +49 -0
- package/packages/server/src/routes/provider-auth-routes.ts +181 -10
- package/packages/server/src/routes/provider-override-routes.ts +158 -0
- package/packages/server/src/routes/provider-routes.ts +348 -86
- package/packages/server/src/routes/resource-activation-routes.ts +18 -4
- package/packages/server/src/routes/session-routes.ts +75 -25
- package/packages/server/src/routes/system-routes.ts +169 -52
- package/packages/server/src/routes/ui-link-base.ts +88 -0
- package/packages/server/src/rpc-keeper/keeper-manager.ts +196 -25
- package/packages/server/src/rpc-keeper/keeper.cjs +37 -23
- package/packages/server/src/runtime-overlay/extension-reload.ts +16 -10
- package/packages/server/src/runtime-overlay/runtime-io.ts +2 -9
- package/packages/server/src/runtime-overlay/runtime-stager.ts +4 -2
- package/packages/server/src/server.ts +1139 -291
- package/packages/server/src/services/cli-service.ts +59 -10
- package/packages/server/src/services/secrets-resolver.ts +46 -30
- package/packages/server/src/session/custom-event-group-annotation.ts +3 -3
- package/packages/server/src/session/custom-event-group-resolver.ts +10 -5
- package/packages/server/src/session/death-reason.ts +11 -7
- package/packages/server/src/session/event-status-extraction.ts +5 -1
- package/packages/server/src/session/hydration-state.ts +148 -0
- package/packages/server/src/session/memory-session-manager.ts +31 -2
- package/packages/server/src/session/open-tool-calls.ts +81 -47
- package/packages/server/src/session/pid-target.ts +127 -0
- package/packages/server/src/session/replay-compaction.ts +18 -5
- package/packages/server/src/session/replay-exit-controller.ts +221 -0
- package/packages/server/src/session/retained-transcript.ts +9 -2
- package/packages/server/src/session/seed-discovered-history.ts +85 -0
- package/packages/server/src/session/server-pid-context.ts +14 -0
- package/packages/server/src/session/session-api.ts +78 -29
- package/packages/server/src/session/session-archive.ts +7 -0
- package/packages/server/src/session/session-bootstrap.ts +9 -54
- package/packages/server/src/session/session-load-worker-pool.ts +11 -1
- package/packages/server/src/session/session-load-worker.ts +32 -4
- package/packages/server/src/spawn-process/abort-spawned-run.ts +28 -9
- package/packages/server/src/spawn-process/acp-spawn.ts +8 -2
- package/packages/server/src/spawn-process/headless-pid-registry.ts +393 -77
- package/packages/server/src/spawn-process/link-register.ts +42 -0
- package/packages/server/src/spawn-process/plugin-spawn-choice.ts +48 -0
- package/packages/server/src/spawn-process/plugin-spawn-worktree.ts +290 -0
- package/packages/server/src/spawn-process/process-classifier.ts +8 -3
- package/packages/server/src/spawn-process/process-manager.ts +61 -6
- package/packages/server/src/spawn-process/restored-identity.ts +112 -0
- package/packages/server/src/spawn-process/session-terminator.ts +179 -18
- package/packages/server/src/spawn-process/spawn-env-contributors.ts +2 -1
- package/packages/server/src/spawn-process/spawn-failure-log.ts +9 -0
- package/packages/server/src/spawn-process/spawn-register-watchdog.ts +44 -19
- package/packages/server/src/sudo-credential/relay.ts +337 -0
- package/packages/server/src/terminal/terminal-gateway.ts +10 -0
- package/packages/server/src/terminal/terminal-manager.ts +54 -46
- package/packages/server/src/tls/sources/acme/credentials.ts +3 -2
- package/packages/server/src/tls/sources/acme/runtime.ts +2 -1
- package/packages/server/src/tls/tls-bridge-route.ts +61 -0
- package/packages/server/src/tls/tls-config-validation.ts +2 -0
- package/packages/server/src/vault/device-expiry-sweep.ts +36 -0
- package/packages/server/src/vault/vault-delivery-hub.ts +172 -26
- package/packages/server/src/vault/vault-routes.ts +9 -2
- package/packages/server/src/vault/vault-store.ts +87 -24
- package/packages/server/src/watch-files-handler.ts +66 -0
- package/packages/server/vendor/xlsx/LICENSE +201 -0
- package/packages/server/vendor/xlsx/PROVENANCE.json +13 -0
- package/packages/server/vendor/xlsx/xlsx.d.mts +1065 -0
- package/packages/server/vendor/xlsx/xlsx.mjs +28228 -0
- package/packages/shared/package.json +4 -2
- package/packages/shared/src/agent-credential-files.ts +32 -0
- package/packages/shared/src/browser-protocol.ts +285 -59
- package/packages/shared/src/canvas-declare.ts +27 -0
- package/packages/shared/src/canvas-detect.ts +1 -1
- package/packages/shared/src/canvas-types.ts +2 -2
- package/packages/shared/src/config.ts +443 -187
- package/packages/shared/src/containment-guard.ts +45 -0
- package/packages/shared/src/credential-encryption.ts +87 -0
- package/packages/shared/src/custom-event-groups.ts +2 -0
- package/packages/shared/src/dashboard-plugin/claude-compat.ts +159 -0
- package/packages/shared/src/dashboard-plugin/event-type-owners.ts +50 -0
- package/packages/shared/src/dashboard-plugin/file-handler.ts +2 -0
- package/packages/shared/src/dashboard-plugin/host-api.ts +61 -0
- package/packages/shared/src/dashboard-plugin/host-fx-classes.ts +23 -0
- package/packages/shared/src/dashboard-plugin/host-import-map.ts +38 -0
- package/packages/shared/src/dashboard-plugin/index.ts +2 -0
- package/packages/shared/src/dashboard-plugin/manifest-types.ts +100 -1
- package/packages/shared/src/dashboard-plugin/plugin-status.ts +58 -3
- package/packages/shared/src/dashboard-plugin/replay-entry-types.ts +46 -0
- package/packages/shared/src/dashboard-plugin/slot-props.ts +47 -3
- package/packages/shared/src/dashboard-plugin/slot-types.ts +9 -1
- package/packages/shared/src/dashboard-plugin/ui-primitives.ts +39 -3
- package/packages/shared/src/device-key-proof.ts +309 -0
- package/packages/shared/src/display-prefs.ts +13 -0
- package/packages/shared/src/doctor-core.ts +94 -27
- package/packages/shared/src/event-forward-declaration.ts +85 -12
- package/packages/shared/src/forbidden-subjects.ts +126 -14
- package/packages/shared/src/heap-limits.ts +0 -30
- package/packages/shared/src/host-admission.ts +2 -1
- package/packages/shared/src/index.ts +7 -6
- package/packages/shared/src/live-server.ts +161 -0
- package/packages/shared/src/local-proof-signal.ts +16 -0
- package/packages/shared/src/loopback-host.ts +26 -0
- package/packages/shared/src/mcp/verb-tiers.generated.ts +176 -0
- package/packages/shared/src/mdns-discovery.ts +25 -6
- package/packages/shared/src/models-json-reader.ts +41 -0
- package/packages/shared/src/nav-intent.ts +29 -0
- package/packages/shared/src/network-denial-signal.ts +15 -0
- package/packages/shared/src/node-version.ts +63 -60
- package/packages/shared/src/openspec-dependencies.ts +760 -0
- package/packages/shared/src/openspec-poller.ts +3 -2
- package/packages/shared/src/pairing-knock-client.ts +135 -11
- package/packages/shared/src/pi-agent-settings-lock.ts +311 -0
- package/packages/shared/src/pi-path-compare.ts +31 -0
- package/packages/shared/src/pi-settings-schema.ts +52 -9
- package/packages/shared/src/pi-trust-live-query.ts +93 -0
- package/packages/shared/src/pi-trust-mirror-snapshot.ts +21 -11
- package/packages/shared/src/pi-trust-mirror-types.ts +38 -3
- package/packages/shared/src/pi-trust-mirror.ts +47 -11
- package/packages/shared/src/pi-trust-resource-digest.ts +261 -0
- package/packages/shared/src/pid-namespace.ts +86 -0
- package/packages/shared/src/platform/ensure-bundled-git.ts +57 -34
- package/packages/shared/src/platform/git-source.ts +88 -26
- package/packages/shared/src/platform/git.ts +14 -8
- package/packages/shared/src/platform/native-ts-register.mjs +1 -1
- package/packages/shared/src/platform/process.ts +452 -5
- package/packages/shared/src/platform/resolve-pi-shell.ts +105 -0
- package/packages/shared/src/platform/select-git-source.ts +7 -0
- package/packages/shared/src/platform/spawn-runtime.ts +193 -7
- package/packages/shared/src/plugin-route-cwd.ts +95 -0
- package/packages/shared/src/preview-egress.ts +192 -0
- package/packages/shared/src/preview-origins.ts +398 -0
- package/packages/shared/src/project-root.ts +16 -0
- package/packages/shared/src/prompt-answer.ts +9 -5
- package/packages/shared/src/protocol.ts +187 -86
- package/packages/shared/src/provider-env-catalog.ts +413 -0
- package/packages/shared/src/provider-overrides.ts +112 -0
- package/packages/shared/src/question-types.ts +6 -0
- package/packages/shared/src/recommended-extensions.ts +97 -26
- package/packages/shared/src/recovery-timing.ts +27 -0
- package/packages/shared/src/remote-credentials.ts +63 -0
- package/packages/shared/src/renderer-by-ext.ts +5 -2
- package/packages/shared/src/rest-api.ts +148 -11
- package/packages/shared/src/role-schema.ts +24 -0
- package/packages/shared/src/route-tiers.ts +149 -4
- package/packages/shared/src/runtime-overlay/archive-safety.d.mts +2 -0
- package/packages/shared/src/runtime-overlay/archive-safety.mjs +33 -0
- package/packages/shared/src/runtime-overlay/compat.ts +70 -6
- package/packages/shared/src/runtime-overlay/manifest.d.mts +7 -0
- package/packages/shared/src/runtime-overlay/manifest.mjs +22 -2
- package/packages/shared/src/safe-local-path.ts +24 -0
- package/packages/shared/src/sanitize-profiles.ts +98 -0
- package/packages/shared/src/secret-patterns.ts +49 -0
- package/packages/shared/src/server-launcher.ts +9 -1
- package/packages/shared/src/server-pinning.ts +55 -2
- package/packages/shared/src/server-routes.ts +462 -0
- package/packages/shared/src/session-ui-path.ts +11 -0
- package/packages/shared/src/source-matching.ts +2 -2
- package/packages/shared/src/state-replay.ts +40 -24
- package/packages/shared/src/sudo-credential.ts +71 -0
- package/packages/shared/src/tls-only-token.ts +16 -0
- package/packages/shared/src/tool-path-resolve.ts +16 -1
- package/packages/shared/src/tool-registry/definitions.ts +5 -5
- package/packages/shared/src/tool-registry/strategies.ts +13 -12
- package/packages/shared/src/tool-workdir.ts +56 -0
- package/packages/shared/src/trusted-types-mode.ts +72 -0
- package/packages/shared/src/types.ts +134 -109
- package/packages/shared/src/url-policy.ts +96 -0
- package/packages/shared/src/vault-delivery.ts +15 -0
- package/packages/shared/src/vertex-regions.ts +81 -0
- package/packages/shared/src/ws-message-tiers.ts +11 -3
- package/packages/extension/src/subagent-fanout-admission.ts +0 -234
- package/packages/extension/src/subagent-forward-sites.ts +0 -69
- package/packages/extension/src/subagent-frame-buffer.ts +0 -245
- package/packages/extension/src/subagent-frame-strip.ts +0 -109
- package/packages/extension/src/subagent-saturation.ts +0 -196
- package/packages/extension/src/subagent-tick-throttle.ts +0 -252
- package/packages/shared/src/anthropic-messages-source.ts +0 -8
package/AGENTS.md
CHANGED
|
@@ -69,8 +69,8 @@ grep -nE 'FAIL|Error|✗|✘|Tests +[0-9]+ (failed|passed)' /tmp/pi-test.log
|
|
|
69
69
|
Quick reference:
|
|
70
70
|
```bash
|
|
71
71
|
npm run reload # after packages/extension/ changes
|
|
72
|
-
|
|
73
|
-
npm run build &&
|
|
72
|
+
npx tsx .pi/skills/implement/scripts/restart-server.ts # after packages/server|packages/shared changes (jiti — no build; mints local proof)
|
|
73
|
+
npm run build && npx tsx .pi/skills/implement/scripts/restart-server.ts # after packages/client changes (production)
|
|
74
74
|
curl -s http://localhost:8000/api/health | jq .mode # dev | production
|
|
75
75
|
```
|
|
76
76
|
`/api/restart` is the single restart source of truth (CLI `restart` delegates to it when the dashboard is up). `--dev` proxies to Vite with automatic production fallback. `full-rebuild.ts` = deploy checked-out dev to the local instance; NOT a feature step.
|
|
@@ -98,6 +98,8 @@ Delegate specialist work to the matching subagent (isolated context). Explicit `
|
|
|
98
98
|
|
|
99
99
|
**Discipline-skill checkpoints** (invoke the `eng-disciplines` skill when the signal appears): auth/untrusted-input/secrets/PII → `security-hardening`; latency/throughput budget or large-data path → `performance-optimization`; new endpoint/job/external-call → `observability-instrumentation`; irreversible step (migration/public-API) before it stands → `doubt-driven-review`; bug mid-implementation → `systematic-debugging`; opaque runtime state (jiti/PTY/WS) → `node-inspect-debugger`; non-trivial change + tests pass before commit → `review-code`; works but feels heavy → `code-simplification`.
|
|
100
100
|
|
|
101
|
+
**Mock routing**: any mock / mockup / UI-option / variant request → load the `frontend-mockup-loop-dashboard` skill (live-component mocks on the mock site; never off-loop static HTML).
|
|
102
|
+
|
|
101
103
|
Context inheritance: this repo ships `pi-dashboard-subagents` (default `inheritContext: true` → child gets a compressed parent snapshot, capped by `maxChars`). Still pass exact file paths + the question in `task:`; use `Explore` first if locations are unknown.
|
|
102
104
|
|
|
103
105
|
## OpenSpec Conventions
|
package/README.md
CHANGED
|
@@ -117,13 +117,13 @@ Windows has a few extra one-time setup steps. Run the following in an **Administ
|
|
|
117
117
|
# 1. Enable long paths (required — npm node_modules nesting exceeds 260 chars)
|
|
118
118
|
reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f
|
|
119
119
|
|
|
120
|
-
# 2. Install Node.js LTS
|
|
120
|
+
# 2. Install Node.js LTS (26) via winget — the server requires Node >=26.0.0 <27
|
|
121
121
|
winget install -e --id OpenJS.NodeJS.LTS --accept-source-agreements --accept-package-agreements
|
|
122
122
|
|
|
123
123
|
# 3. CLOSE this PowerShell, open a NEW one as Administrator (PATH refresh)
|
|
124
124
|
|
|
125
125
|
# 4. Verify
|
|
126
|
-
node --version # expect
|
|
126
|
+
node --version # expect v26.x
|
|
127
127
|
npm --version # expect 10.x
|
|
128
128
|
|
|
129
129
|
# 5. Install
|
|
@@ -145,7 +145,7 @@ Before your first change, read [CONTRIBUTING.md](CONTRIBUTING.md) — features a
|
|
|
145
145
|
```bash
|
|
146
146
|
git clone https://github.com/BlackBeltTechnology/pi-agent-dashboard.git
|
|
147
147
|
cd pi-agent-dashboard
|
|
148
|
-
corepack enable
|
|
148
|
+
npm install -g corepack && corepack enable # Node 25+ no longer bundles corepack; activates the pinned pnpm (packageManager field)
|
|
149
149
|
pnpm install
|
|
150
150
|
pnpm run build # one-time client build
|
|
151
151
|
pi install /path/to/pi-agent-dashboard # global
|
|
@@ -254,7 +254,7 @@ This keeps plugin-provided dynamic content, package names, model names, and comm
|
|
|
254
254
|
| Requirement | Why | Install |
|
|
255
255
|
|-------------|-----|---------|
|
|
256
256
|
| **[pi](https://github.com/badlogic/pi-mono)** | The AI coding agent the dashboard monitors | `npm i -g @mariozechner/pi-coding-agent` |
|
|
257
|
-
| **Node.js
|
|
257
|
+
| **Node.js 26** (`>=26.0.0 <27`) | Server runtime. The server refuses Node 22, 24, 25 and 27+. pi itself may still run on Node 22.19+/24: when a pi session auto-starts the dashboard, the bridge looks for a Node 26 (`PATH`, nvm/volta/asdf/mise/fnm default) and shows a one-time warning if it finds none. No Node 26? Use the desktop app (path A), which bundles its own. | `nvm install 26` or [nodejs.org](https://nodejs.org/) |
|
|
258
258
|
| **C++ build tools** | Required by `node-pty` native addon for the integrated terminal | Xcode CLI Tools (macOS) / `build-essential` (Linux) |
|
|
259
259
|
|
|
260
260
|
Optional:
|
|
@@ -298,7 +298,15 @@ CLI flags → environment variables → config file → built-in defaults.
|
|
|
298
298
|
|
|
299
299
|
Push notifications: manage devices and webhooks under Settings ▸ Sessions ▸ Push notifications; details in "Push Notifications" in [docs/architecture.md](docs/architecture.md).
|
|
300
300
|
|
|
301
|
-
The bridge also honours `PI_DASHBOARD_URL=ws://host:port` to point at a remote server instead of localhost.
|
|
301
|
+
The bridge also honours `PI_DASHBOARD_URL=ws://host:port` to point at a remote server instead of localhost. For a remote server, `port` is the **pi gateway** port (default `9999`), not the web UI port.
|
|
302
|
+
|
|
303
|
+
A remote bridge (one with `PI_DASHBOARD_TOKEN` set) also makes HTTP calls to the dashboard (ticket mint, identity check, trust query). It sends those to the dashboard's **HTTP** origin, resolved as:
|
|
304
|
+
|
|
305
|
+
1. `PI_DASHBOARD_HTTP_URL` (e.g. `https://dash.example`) when set. Only its origin is used. It applies to the host named in `PI_DASHBOARD_URL`; an invalid value (not `http(s)`, or with credentials) is refused, never ignored.
|
|
306
|
+
2. Plaintext `ws://host:<port>`: `http://host:<HTTP port>`, where the HTTP port is `PI_DASHBOARD_PORT` → `DASHBOARD_PORT` → `8000`. The bridge machine's own `~/.pi/dashboard/config.json` is not read. If this machine also runs its own dashboard on a custom port, set `PI_DASHBOARD_HTTP_URL` instead.
|
|
307
|
+
3. `wss://host[:port]` or a port-less `ws://host`: the endpoint's own origin (a TLS proxy in front is assumed to route `/api`).
|
|
308
|
+
|
|
309
|
+
**Breaking (narrow):** a plaintext reverse proxy serving both `/api` and the bridge path on one explicit non-default `ws://host:<port>` now needs `PI_DASHBOARD_HTTP_URL` (or `PI_DASHBOARD_PORT=<port>`). The bridge log prints the resolved `http origin <origin> (<source>)`; `bridge ticket wrong-origin` means that origin is not the dashboard's HTTP listener.
|
|
302
310
|
|
|
303
311
|
#### Pi sessions directory
|
|
304
312
|
|
|
@@ -355,7 +363,8 @@ OAuth2 authentication guards external (tunnel) access. Localhost is always ungua
|
|
|
355
363
|
|-----|----------|-------------|
|
|
356
364
|
| `auth.secret` | No | JWT signing secret (auto-generated if omitted) |
|
|
357
365
|
| `auth.providers` | Yes | Map of provider → `{ clientId, clientSecret, issuerUrl? }` |
|
|
358
|
-
| `auth.allowedUsers` | No | Allowlist: usernames, emails, or `*@domain` wildcards.
|
|
366
|
+
| `auth.allowedUsers` | No | Allowlist: usernames, emails, or `*@domain` wildcards. **Public providers** (`github`, `google`, or an `oidc` issuer on a public IdP such as accounts.google.com / github.com / login.microsoftonline.com `/common`) **refuse login when both this and `auth.groupTiers` are empty or unset**. Providers with an issuer of your own (`keycloak`, a private `oidc`) allow every account at `operate` when empty, with a startup warning |
|
|
367
|
+
| `auth.groupTiers` | No | Config-file only. Map of IdP group → tier (`observe` / `control` / `operate`) for OIDC providers. Setting a non-empty valid map lifts the open-enrolment refusal on a public provider |
|
|
359
368
|
|
|
360
369
|
**Supported providers:** `github`, `google`, `keycloak`, `oidc` (generic OIDC with `issuerUrl`).
|
|
361
370
|
|
|
@@ -376,6 +385,17 @@ pi-dashboard open [--url <origin>] # or authorize this browser tab, the
|
|
|
376
385
|
|
|
377
386
|
Docker: `docker exec <container> pi-dashboard pair approve`. The CLI must run as the same OS user as the server. Per-setup table: "How do I approve a pending device pairing request?" in [docs/faq.md](docs/faq.md).
|
|
378
387
|
|
|
388
|
+
### Local access (`requireLocalProof`)
|
|
389
|
+
|
|
390
|
+
Default `requireLocalProof: true`. A caller on the loopback address with no forwarding header (bare loopback) reads observe-tier REST and `/v1/*` only. Every other REST route and WebSocket needs local proof: a `pi_dash_local` cookie, the `X-Pi-Local-Proof` header from the CLI or bridge, the desktop app, or a signed-in/paired principal. Refusal: `403 network_not_allowed` with `reason: "local_proof_required"`.
|
|
391
|
+
|
|
392
|
+
- Browser tab refused: run `pi-dashboard open` (opens the dashboard already authorized). Forwarded loopback (`ssh -L`, VS Code port forward, WSL): run `pi-dashboard open --print` on the server, then open the URL through a forward on the same port (the cookie is bound to the port).
|
|
393
|
+
- Scripts on this host: `pi-dashboard api <METHOD> <path> [--data <json>]` (mints proof per request). Raw `curl` to control routes is refused.
|
|
394
|
+
- Opt-out: `"requireLocalProof": false` in `config.json` (live, no restart). **Opting out re-exposes the control plane to every container on the host** (Docker Desktop `host.docker.internal`, `--network host`, `ssh -R`, `socat` all look like bare loopback). Keep it on unless the host is single-user and no container or relay reaches `127.0.0.1`.
|
|
395
|
+
- Upgrade: the first start rotates the local token and `auth.secret` once, so everyone signs in again. Stop every dashboard instance before upgrading.
|
|
396
|
+
|
|
397
|
+
See [docs/architecture.md](docs/architecture.md) (Trust and Credential Boundaries) and [docs/faq.md](docs/faq.md).
|
|
398
|
+
|
|
379
399
|
### LAN access
|
|
380
400
|
|
|
381
401
|
Bind wide first: `bindHost` or `PI_DASHBOARD_HOST=0.0.0.0` (restart required). Then `network.trustMode` decides who admits LAN peers:
|
|
@@ -395,6 +415,8 @@ Details: [How do I expose the dashboard on my LAN?](docs/faq.md#how-do-i-expose-
|
|
|
395
415
|
|
|
396
416
|
The dashboard auto-connects a [zrok](https://zrok.io/) tunnel on start when `tunnel.enabled` is `true`. Install with `brew install zrok` (macOS) and run `zrok enable <token>` to enrol — the dashboard reads zrok's own config (`~/.zrok2/environment.json`), no keys are stored in the dashboard. Reserved shares provide persistent URLs across restarts.
|
|
397
417
|
|
|
418
|
+
Shell output (`!`, `!!`, exec templates) reaches every tunnel viewer; only credential-vault values are masked. Do not print secrets in shell commands on a tunneled session — see [FAQ](docs/faq.md#can-tunnel-viewers-see-shell-command-output).
|
|
419
|
+
|
|
398
420
|
### OpenSpec background polling
|
|
399
421
|
|
|
400
422
|
Tune how often the server polls known directories for OpenSpec updates (`openspec` block):
|
|
@@ -494,13 +516,16 @@ npx tsx packages/server/src/cli.ts --dev # proxy to Vite dev server
|
|
|
494
516
|
|
|
495
517
|
### Graceful restart via API
|
|
496
518
|
|
|
519
|
+
A bare `curl` to a control or operate route is refused (`403 local_proof_required`): `requireLocalProof` is on by
|
|
520
|
+
default, so a local caller must prove it is on this machine. `pi-dashboard api` mints that proof for each request.
|
|
521
|
+
|
|
497
522
|
```bash
|
|
498
523
|
# Restart in the same mode
|
|
499
|
-
|
|
524
|
+
pi-dashboard api POST /api/restart
|
|
500
525
|
|
|
501
526
|
# Switch to dev / production
|
|
502
|
-
|
|
503
|
-
|
|
527
|
+
pi-dashboard api POST /api/restart --data '{"dev":true}'
|
|
528
|
+
pi-dashboard api POST /api/restart --data '{"dev":false}'
|
|
504
529
|
|
|
505
530
|
# Check current mode
|
|
506
531
|
curl -s http://localhost:8000/api/health | jq .mode
|
|
@@ -590,16 +615,19 @@ Drafts (typed-but-unsent text) are persisted per session in `localStorage` under
|
|
|
590
615
|
|
|
591
616
|
## Recommended extensions
|
|
592
617
|
|
|
593
|
-
The dashboard integrates tightly with a small, curated set of pi extensions — for custom tool rendering
|
|
618
|
+
The dashboard integrates tightly with a small, curated set of pi extensions — for custom tool rendering and the Flow dashboard. The Electron wizard installs them in one go; the **Packages** tab and a top-of-page banner keep them discoverable afterwards.
|
|
594
619
|
|
|
595
620
|
| Extension | Source | Status | Unlocks |
|
|
596
621
|
|---|---|---|---|
|
|
597
|
-
| `pi-anthropic-messages` | `npm:@blackbelt-technology/pi-anthropic-messages` | **required** | Tool calls on Claude-model Anthropic OAuth / 9Router `cc/*` / dashboard model proxy providers. Without it, tool calls fall back to Claude Code's built-in `bash_ide` sandbox and fail. |
|
|
598
622
|
| `pi-dashboard-subagents` | `npm:@blackbelt-technology/pi-dashboard-subagents` | optional | `Agent` tool card UI, subagent inspector (inline expand + popout), agent-md path display |
|
|
599
623
|
| `pi-flows` | `npm:@blackbelt-technology/pi-flows` | strongly suggested | Flow dashboard, role aliases (`@planning`, `@coding`, …), subagent / flow_write / flow_results / agent_write / ask_user / skill_read / finish tools |
|
|
600
624
|
| `pi-web-access` | `npm:pi-web-access` | strongly suggested | `web_search`, `code_search`, `fetch_content`, `get_search_content` |
|
|
601
625
|
| `pi-agent-browser` | `npm:pi-agent-browser` | optional | `browser` tool (open, snapshot, click, screenshot) |
|
|
602
626
|
|
|
627
|
+
**Claude subscription requests.** Anthropic bills subscription requests as extra usage when pi's docs prompt names pi packages. Turn on **Settings ▸ Providers ▸ Claude subscription compat** (global preference `claudeSubscriptionCompat`, default off; needs the Flows plugin).
|
|
628
|
+
|
|
629
|
+
**Upgrade note.** `pi-anthropic-messages` is no longer required. After turning on the compat switch, you may uninstall `pi-anthropic-messages`: `pi remove npm:@blackbelt-technology/pi-anthropic-messages`.
|
|
630
|
+
|
|
603
631
|
Authoritative source: `packages/shared/src/recommended-extensions.ts`. Descriptions, versions, and installed-state are enriched live via `GET /api/packages/recommended` (offline fallback).
|
|
604
632
|
|
|
605
633
|
---
|
|
@@ -625,6 +653,23 @@ The skill has two modes:
|
|
|
625
653
|
|
|
626
654
|
For the slot taxonomy, the manifest schema, and the plugin context API, see the skill's reference docs (or the runtime: [`@blackbelt-technology/dashboard-plugin-runtime`](https://www.npmjs.com/package/@blackbelt-technology/dashboard-plugin-runtime)). The reference fixture is [`packages/demo-plugin/`](packages/demo-plugin/).
|
|
627
655
|
|
|
656
|
+
|
|
657
|
+
### Installing and trusting third-party dashboard plugins
|
|
658
|
+
|
|
659
|
+
A dashboard plugin published as a pi package (keyword `pi-dashboard-plugin`) installs like any pi package:
|
|
660
|
+
|
|
661
|
+
```bash
|
|
662
|
+
pi install npm:<package> --scope global
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
- **Through the dashboard** (Packages tab, or `POST /api/packages/install` with `scope: "global"`): the plugin appears live in the Plugins tab, no restart.
|
|
666
|
+
- **From a terminal `pi install`**: the dashboard is not told, so the plugin appears after a dashboard restart.
|
|
667
|
+
- **Local scope** (`pi install -l`, project `.pi/settings.json`): detected for active sessions' folders and listed as `local-detected`, never loaded. Install it globally to enable it.
|
|
668
|
+
- **Server code** of a plugin that arrives as a pi package (`pi-package` source) is default-deny: it stays `server-untrusted` until a local operator grants server trust in the Plugins tab (`POST /api/plugins/:id/trust {"server": true}`, localhost only). Plugins from other sources run under the existing pi extension trust.
|
|
669
|
+
- **Client UI** of a prebuilt plugin (manifest `clientBundle`) is loaded at runtime only after a local operator trusts that exact build: the grant pins the bundle's content hash (`auth.trustedPlugins`). A rebuilt bundle needs a fresh grant ("Trust this version").
|
|
670
|
+
|
|
671
|
+
Details: [`docs/runtime-plugin-clients.md`](docs/runtime-plugin-clients.md) and [`docs/publishing-plugins.md`](docs/publishing-plugins.md).
|
|
672
|
+
|
|
628
673
|
---
|
|
629
674
|
|
|
630
675
|
## Troubleshooting
|
|
@@ -642,7 +687,8 @@ The log is append-mode with timestamped headers per start attempt, so previous c
|
|
|
642
687
|
|
|
643
688
|
- **`ERR_UNSUPPORTED_ESM_URL_SCHEME` on Windows** — fully fixed in 0.4.0+. The 0.2.10 release wrapped the `--import` loader position as a `file://` URL, but the entry-script position stayed a raw Windows path — which crashed Node on non-`C:` drives (`A:\`, `B:\`, …) because the drive-letter heuristic has gaps there. 0.4.0 routes all four server-spawn call sites through a single `spawnNodeScript` / `toFileUrl` helper that wraps both positions unconditionally, and a repo-level lint test prevents regression. Upgrade the package.
|
|
644
689
|
- **`Cannot find pi's TypeScript loader`** — pi is not installed globally. Run `npm install -g @mariozechner/pi-coding-agent`.
|
|
645
|
-
-
|
|
690
|
+
- **`pi-dashboard cannot start on Node vXX` / `Required: >=26.0.0 <27`** — the server needs Node 26. Run `nvm install 26 && nvm use 26` (or install Node 26 from nodejs.org) and reinstall the package.
|
|
691
|
+
- **"Dashboard server not started: it needs Node >=26.0.0 <27" in a pi session** — pi runs on an older Node and the bridge found no Node 26 to start the server with. Install Node 26 (an nvm `alias/default`, volta, asdf, mise or fnm default is found without a shell) or start the desktop app; the session connects once a dashboard answers. Every skipped candidate is listed in `~/.pi/dashboard/server.log`.
|
|
646
692
|
|
|
647
693
|
### Port already in use
|
|
648
694
|
|
|
@@ -764,7 +810,7 @@ Agent metrics are collected every 15s via heartbeats and include `eventLoopMaxMs
|
|
|
764
810
|
### Commands
|
|
765
811
|
|
|
766
812
|
```bash
|
|
767
|
-
corepack enable
|
|
813
|
+
npm install -g corepack && corepack enable # once (Node 25+ ships no corepack): activate the pinned pnpm (packageManager field)
|
|
768
814
|
pnpm install # Install dependencies
|
|
769
815
|
pnpm test # Run all tests (vitest)
|
|
770
816
|
pnpm run test:watch # Watch mode
|
|
@@ -801,12 +847,12 @@ pi -e packages/extension/src/bridge.ts # or just `pi` if installed
|
|
|
801
847
|
# Chained with && so a refused sync aborts before the restart.
|
|
802
848
|
pnpm run build \
|
|
803
849
|
&& node scripts/sync-served-client.mjs \
|
|
804
|
-
&&
|
|
850
|
+
&& pi-dashboard restart
|
|
805
851
|
# Full verified rebuild script (build + sync + restart + reload)
|
|
806
852
|
./scripts/rebuild-restart.sh
|
|
807
853
|
|
|
808
854
|
# After server changes (runs TypeScript directly, no build needed)
|
|
809
|
-
|
|
855
|
+
pi-dashboard restart # in a dev checkout: npx tsx packages/server/src/cli.ts restart
|
|
810
856
|
|
|
811
857
|
# After bridge extension changes
|
|
812
858
|
pnpm run reload
|
|
@@ -843,7 +889,7 @@ packages/
|
|
|
843
889
|
|
|
844
890
|
## Building the Electron app
|
|
845
891
|
|
|
846
|
-
> **Prerequisites:** Node.js
|
|
892
|
+
> **Prerequisites:** Node.js 26 on `PATH` (or as a version-manager default) — unpackaged/dev launches have no bundled Node and run the server on it; platform-specific tools handled by Electron Forge automatically.
|
|
847
893
|
|
|
848
894
|
### Native build (current platform)
|
|
849
895
|
|
|
@@ -891,7 +937,7 @@ pnpm run electron:build -- --mac-both
|
|
|
891
937
|
|
|
892
938
|
Requires Rosetta 2 (`softwareupdate --install-rosetta --agree-to-license`) so node-pty's x64 prebuilt binary can be unpacked during the cross-arch run. The script wipes per-arch caches between the two builds (`resources/.last-arch` sentinel) so back-to-back runs don't accidentally ship arm64 binaries inside an x64 DMG. Intel macs cannot cross-build arm64 locally (Rosetta is one-way) — use CI for arm64 validation.
|
|
893
939
|
|
|
894
|
-
Docker builds use a Node
|
|
940
|
+
Docker builds use a Node 26 Debian container for Windows cross-compilation. Output goes to `packages/electron/out/make/`.
|
|
895
941
|
|
|
896
942
|
### Electron dev mode
|
|
897
943
|
|
|
@@ -942,7 +988,7 @@ This runs CI, publishes to npm with `--provenance` for supply-chain transparency
|
|
|
942
988
|
|
|
943
989
|
| Runner | Platform | Outputs |
|
|
944
990
|
|--------|----------|---------|
|
|
945
|
-
| `macos-
|
|
991
|
+
| `macos-latest` | macOS arm64 | `.dmg` (Apple Silicon) |
|
|
946
992
|
| `macos-15-intel` | macOS x64 | `.dmg` (Intel; last GitHub-hosted x86_64 image, EOL 2027-08) |
|
|
947
993
|
| `ubuntu-latest` | Linux x64 | `.deb` + `.AppImage` |
|
|
948
994
|
| `ubuntu-24.04-arm` | Linux arm64 | `.deb` |
|