@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
|
@@ -3,6 +3,21 @@
|
|
|
3
3
|
// the verdict is not described twice. See change: fix-false-unresponsive-badge.
|
|
4
4
|
import type { HostPressure } from "./host-pressure.js";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* The pid namespace a pi process reported with its pid (`session_register.pidNamespace`).
|
|
8
|
+
* `kind: "wsl"` carries the WSL `distro`. `nsId` is the Linux `/proc/self/ns/pid`
|
|
9
|
+
* link; `hostId` the Linux `boot_id`, else the hostname. Unreadable fields are
|
|
10
|
+
* omitted. Built by `buildPidNamespace()` (`pid-namespace.ts`).
|
|
11
|
+
* See change: scope-pids-to-namespace.
|
|
12
|
+
*/
|
|
13
|
+
export interface PidNamespace {
|
|
14
|
+
platform: string;
|
|
15
|
+
kind: "host" | "wsl";
|
|
16
|
+
distro?: string;
|
|
17
|
+
nsId?: string;
|
|
18
|
+
hostId?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
6
21
|
/**
|
|
7
22
|
* The auto-namer's enumerated durable state set: carried across an extension
|
|
8
23
|
* reload as VALUES (never the namer object, whose closures would hold a stale
|
|
@@ -468,6 +483,15 @@ export interface DashboardSession {
|
|
|
468
483
|
* See change: fix-session-reclaim-tmux.
|
|
469
484
|
*/
|
|
470
485
|
pidRecordedAt?: number;
|
|
486
|
+
/**
|
|
487
|
+
* Server-only: the pid namespace the bridge reported with `pid`, stored
|
|
488
|
+
* atomically with it in memory (a register without `pid` clears both).
|
|
489
|
+
* Persisted nowhere, like `pid` (design S5, decision A); a non-enumerable
|
|
490
|
+
* property, so no browser, peer or meta payload carries it. `null` = the bridge
|
|
491
|
+
* sent a malformed report (resolves `unknown`); absent = legacy bridge.
|
|
492
|
+
* See change: scope-pids-to-namespace.
|
|
493
|
+
*/
|
|
494
|
+
pidNamespace?: PidNamespace | null;
|
|
471
495
|
/** Active child processes detected by bridge process scanner. Server
|
|
472
496
|
* enriches each with classification fields. See change:
|
|
473
497
|
* classify-process-list-entries. */
|
|
@@ -537,12 +561,13 @@ export interface DashboardSession {
|
|
|
537
561
|
* `steering[]` typically empties every turn boundary (1-15 s); `followUp`
|
|
538
562
|
* holds up to 20 entries (and a 32 MiB aggregate byte ceiling, both bridge-
|
|
539
563
|
* enforced) and drains ONE entry per `agent_end`.
|
|
540
|
-
* `followUp` carries entry objects (text + image COUNT); `steering`
|
|
541
|
-
*
|
|
564
|
+
* `followUp` carries entry objects (text + image COUNT); `steering` carries
|
|
565
|
+
* bridge-held steer views `{ id, text, imageCount }` (legacy bridges still
|
|
566
|
+
* send plain strings for one release — clients normalise on read).
|
|
542
567
|
* See capability `mid-turn-prompt-queue`. See change: add-followup-edit-and-steer-cancel,
|
|
543
|
-
* fix-bridge-followup-image-drop.
|
|
568
|
+
* fix-bridge-followup-image-drop, bridge-owned-cancellable-steer.
|
|
544
569
|
*/
|
|
545
|
-
pendingQueues?: { steering: string[]; followUp: FollowUpEntryView[] };
|
|
570
|
+
pendingQueues?: { steering: (SteerEntryView | string)[]; followUp: FollowUpEntryView[] };
|
|
546
571
|
/**
|
|
547
572
|
* Session classification. Currently the only non-default value is
|
|
548
573
|
* `"automation"`, stamped on sessions spawned by the automation-plugin's
|
|
@@ -559,9 +584,11 @@ export interface DashboardSession {
|
|
|
559
584
|
* board visibility (per-automation `visibility` field ?? settings default,
|
|
560
585
|
* default `"hidden"`) so the board filter can decide inclusion without
|
|
561
586
|
* re-reading the automation config. Persisted to `.meta.json`.
|
|
562
|
-
*
|
|
587
|
+
* `scope` names the automation scope the run belongs to; orphan Stop
|
|
588
|
+
* requires it to match the request (stamps without it are refused).
|
|
589
|
+
* See change: add-automation-plugin, polish-automation-board.
|
|
563
590
|
*/
|
|
564
|
-
automationRun?: { name: string; runId: string; visibility?: "hidden" | "shown" };
|
|
591
|
+
automationRun?: { name: string; runId: string; visibility?: "hidden" | "shown"; scope?: "folder" | "global" };
|
|
565
592
|
/**
|
|
566
593
|
* Owning goal id when this session was spawned under / linked to a
|
|
567
594
|
* folder-scoped `GoalRecord`. Persisted to `.meta.json`. The session-card
|
|
@@ -783,14 +810,6 @@ export interface DashboardEvent {
|
|
|
783
810
|
data: Record<string, unknown>;
|
|
784
811
|
}
|
|
785
812
|
|
|
786
|
-
/** Info about an available flow from pi-flows */
|
|
787
|
-
export interface FlowInfo {
|
|
788
|
-
name: string;
|
|
789
|
-
description: string;
|
|
790
|
-
taskRequired: boolean;
|
|
791
|
-
source?: string;
|
|
792
|
-
}
|
|
793
|
-
|
|
794
813
|
/** Info about an available command */
|
|
795
814
|
export interface CommandInfo {
|
|
796
815
|
name: string;
|
|
@@ -824,6 +843,19 @@ export interface FollowUpEntryView {
|
|
|
824
843
|
imageCount: number;
|
|
825
844
|
}
|
|
826
845
|
|
|
846
|
+
/**
|
|
847
|
+
* Wire view of one bridge-held steer: stable `id` (`<instanceNonce>:<seq>`,
|
|
848
|
+
* never reused across bridge lifetimes), text, image COUNT. Image bytes never
|
|
849
|
+
* cross the wire. A plain `string` in a `steering` array is a legacy (pre-
|
|
850
|
+
* cancellable) bridge entry and carries no id — clients render it without a
|
|
851
|
+
* cancel control. See change: bridge-owned-cancellable-steer (D8).
|
|
852
|
+
*/
|
|
853
|
+
export interface SteerEntryView {
|
|
854
|
+
id: string;
|
|
855
|
+
text: string;
|
|
856
|
+
imageCount: number;
|
|
857
|
+
}
|
|
858
|
+
|
|
827
859
|
// PendingPrompt removed in change: add-followup-edit-and-steer-cancel.
|
|
828
860
|
// Pi's native queues are now the single source of truth; `Session.pendingQueues`
|
|
829
861
|
// holds `string[]` arrays directly from pi's `queue_update` event.
|
|
@@ -949,6 +981,20 @@ export interface ProviderInfo {
|
|
|
949
981
|
* custom OAuth provider needs its login button.
|
|
950
982
|
*/
|
|
951
983
|
custom?: boolean;
|
|
984
|
+
/**
|
|
985
|
+
* True when another extension registered this provider with `models` or
|
|
986
|
+
* `oauth.modifyModels` (the bridge's own registrations excluded); Endpoint /
|
|
987
|
+
* Models / JSON stay read-only. See change: add-provider-advanced-settings (D2).
|
|
988
|
+
*/
|
|
989
|
+
modelsSetByExtension?: true;
|
|
990
|
+
/** Base provider id when this id is a `providers.json` copy (`copyOf`). */
|
|
991
|
+
copyOf?: string;
|
|
992
|
+
/**
|
|
993
|
+
* Copy-row warning. `needs_key`: base not signed in / key unresolvable in the
|
|
994
|
+
* session; `name_taken`: id now used by a pi built-in (copy not registered);
|
|
995
|
+
* `command_key`: base key is a command (server-side warning, set by the server).
|
|
996
|
+
*/
|
|
997
|
+
rowWarning?: "needs_key" | "command_key" | "name_taken";
|
|
952
998
|
}
|
|
953
999
|
|
|
954
1000
|
/** Role assignment info (from pi-flows role-manager) */
|
|
@@ -997,6 +1043,60 @@ export interface OpenSpecChange {
|
|
|
997
1043
|
* OpenSpec actions are blocked for this change. See change: use-openspec-status-all.
|
|
998
1044
|
*/
|
|
999
1045
|
error?: { code: string; message: string };
|
|
1046
|
+
/**
|
|
1047
|
+
* Computed change-to-change dependency graph entry (declared + inferred edges,
|
|
1048
|
+
* waves, validator issues). Absent on the fallback poll path (CLI without
|
|
1049
|
+
* `status --all`). See change: add-openspec-change-dependencies.
|
|
1050
|
+
*/
|
|
1051
|
+
dependencies?: ChangeDependencies;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
/** Where a dependency edge came from. */
|
|
1055
|
+
export type DependencyEdgeSource = "declared" | "inferred-text" | "inferred-capability";
|
|
1056
|
+
|
|
1057
|
+
/** One `blocked by` edge of a change. `satisfied` = the blocker is archived. */
|
|
1058
|
+
export interface DependencyEdge {
|
|
1059
|
+
/** The blocking change name. */
|
|
1060
|
+
change: string;
|
|
1061
|
+
source: DependencyEdgeSource;
|
|
1062
|
+
/** Declared reason, matched proposal line (≤ 200 chars) or capability name. */
|
|
1063
|
+
reason?: string;
|
|
1064
|
+
state: "open" | "satisfied";
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
export type DependencyIssueCode =
|
|
1068
|
+
| "invalid-file"
|
|
1069
|
+
| "self-reference"
|
|
1070
|
+
| "cycle"
|
|
1071
|
+
| "blocked-by-cycle"
|
|
1072
|
+
| "unknown-change"
|
|
1073
|
+
| "conflicting-entry"
|
|
1074
|
+
| "duplicate-capability";
|
|
1075
|
+
|
|
1076
|
+
export interface DependencyIssue {
|
|
1077
|
+
severity: "error" | "warning";
|
|
1078
|
+
code: DependencyIssueCode;
|
|
1079
|
+
message: string;
|
|
1080
|
+
/** Canonical cycle path (`cycle` only), e.g. `["a", "b", "a"]`. */
|
|
1081
|
+
path?: string[];
|
|
1082
|
+
/** Other change names involved (`duplicate-capability`, `unknown-change`, `conflicting-entry`). */
|
|
1083
|
+
with?: string[];
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
/** Computed dependency entry of one active change. See change: add-openspec-change-dependencies. */
|
|
1087
|
+
export interface ChangeDependencies {
|
|
1088
|
+
/** Whether `dependencies.yaml` exists for the change. */
|
|
1089
|
+
hasFile: boolean;
|
|
1090
|
+
blockedBy: DependencyEdge[];
|
|
1091
|
+
/** Active changes with an open edge to this one (computed inverse). */
|
|
1092
|
+
blocks: string[];
|
|
1093
|
+
/** Non-blocking references (declared `related` + backticked prose mentions). */
|
|
1094
|
+
related: string[];
|
|
1095
|
+
/** Active changes sharing a capability delta (undirected, never blocking). */
|
|
1096
|
+
overlaps: string[];
|
|
1097
|
+
/** Execution wave (1 = no open blockers); `null` for cycle members and their dependents. */
|
|
1098
|
+
wave: number | null;
|
|
1099
|
+
issues: DependencyIssue[];
|
|
1000
1100
|
}
|
|
1001
1101
|
|
|
1002
1102
|
/** Schema version for the per-repo OpenSpec groups file at
|
|
@@ -1339,10 +1439,13 @@ export interface OpenSpecData {
|
|
|
1339
1439
|
*/
|
|
1340
1440
|
hasOpenspecDir?: boolean;
|
|
1341
1441
|
/**
|
|
1342
|
-
* Whether `<configRoot>/.pi/skills/openspec-explore/`
|
|
1442
|
+
* Whether `<configRoot>/.pi/skills/openspec-explore/` OR
|
|
1443
|
+
* `<configRoot>/.agents/skills/openspec-explore/` exists — i.e. will
|
|
1343
1444
|
* `/skill:openspec-explore` resolve. Resolved at the cwd's config root
|
|
1344
1445
|
* (main checkout for a worktree) because `.pi/skills/openspec-*` is
|
|
1345
|
-
* gitignored and never checks out into a worktree
|
|
1446
|
+
* gitignored and never checks out into a worktree; the shared
|
|
1447
|
+
* `.agents/skills/` layout is committed but is still answered at the config
|
|
1448
|
+
* root only (no ancestor walk).
|
|
1346
1449
|
*
|
|
1347
1450
|
* Optional for backwards compatibility — absence means "unknown, infer
|
|
1348
1451
|
* nothing". See change: add-openspec-init-affordances.
|
|
@@ -1399,6 +1502,18 @@ export interface OpenSpecWorkflowSchemaStatus {
|
|
|
1399
1502
|
* See change: add-pi-spec-driven-schema.
|
|
1400
1503
|
*/
|
|
1401
1504
|
projectSchemas: string[];
|
|
1505
|
+
/**
|
|
1506
|
+
* Members of `affectedChanges` without a regular `dependencies.yaml`; with
|
|
1507
|
+
* patch v2 they stay in planning until they declare. Absent until the server
|
|
1508
|
+
* computes it. See change: add-openspec-change-dependencies.
|
|
1509
|
+
*/
|
|
1510
|
+
undeclaredChanges?: string[];
|
|
1511
|
+
/**
|
|
1512
|
+
* True when the pending `outdated` update lifts the installed stamp across the patch that adds the
|
|
1513
|
+
* required `dependencies` artifact; gates the Update dialog's "return to planning" message.
|
|
1514
|
+
* See change: add-openspec-change-dependencies.
|
|
1515
|
+
*/
|
|
1516
|
+
raisesToDependencies?: boolean;
|
|
1402
1517
|
}
|
|
1403
1518
|
|
|
1404
1519
|
/** OpenSpec workflow phase detected from tool calls */
|
|
@@ -1495,10 +1610,9 @@ export interface CommandFeedbackData {
|
|
|
1495
1610
|
message?: string;
|
|
1496
1611
|
}
|
|
1497
1612
|
|
|
1498
|
-
// ── Flow
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
export type FlowAgentStatus = "pending" | "running" | "complete" | "error" | "blocked";
|
|
1613
|
+
// ── Flow card display entries (shared with the architect state) ──────
|
|
1614
|
+
// Flow-run types (FlowState, FlowAgentState, …) live in the flows plugin.
|
|
1615
|
+
// See change: update-flows-plugin (D5).
|
|
1502
1616
|
|
|
1503
1617
|
/** A recent tool call displayed on an agent card */
|
|
1504
1618
|
export interface FlowRecentTool {
|
|
@@ -1513,95 +1627,6 @@ export type FlowDetailEntry =
|
|
|
1513
1627
|
| { kind: "thinking"; text: string }
|
|
1514
1628
|
| { kind: "error"; text: string };
|
|
1515
1629
|
|
|
1516
|
-
/** Agent card config from pi-flows AgentConfig (minimal subset) */
|
|
1517
|
-
export interface FlowAgentCardConfig {
|
|
1518
|
-
name: string;
|
|
1519
|
-
description?: string;
|
|
1520
|
-
model?: string;
|
|
1521
|
-
card?: { label?: string; metric?: string; role?: string };
|
|
1522
|
-
sourcePath?: string;
|
|
1523
|
-
}
|
|
1524
|
-
|
|
1525
|
-
/** First-class node-kind discriminator emitted by every pi-flows executor.
|
|
1526
|
-
* Decided once at the node's started event; carried on the event payload so it
|
|
1527
|
-
* persists + replays. Distinct from FlowDetailEntry.kind (text|thinking|tool|error).
|
|
1528
|
-
* See change: rework-flows-plugin-for-new-pi-flows (consumes pi-flows surface-node-kind). */
|
|
1529
|
-
export type NodeKind =
|
|
1530
|
-
| "agent"
|
|
1531
|
-
| "agent-decision"
|
|
1532
|
-
| "code"
|
|
1533
|
-
| "code-decision"
|
|
1534
|
-
| "fork";
|
|
1535
|
-
|
|
1536
|
-
/** Per-agent (per-step) state tracked in flow state */
|
|
1537
|
-
export interface FlowAgentState {
|
|
1538
|
-
agentName: string;
|
|
1539
|
-
stepId: string;
|
|
1540
|
-
/** Step type from the flow config (agent, fork, agent-decision, etc.) */
|
|
1541
|
-
stepType?: string;
|
|
1542
|
-
/** Node-kind from the lifecycle started event; selects the card renderer. */
|
|
1543
|
-
nodeKind?: NodeKind;
|
|
1544
|
-
/** Failure outcome from the completion event: routed-soft vs flow-halting-hard. */
|
|
1545
|
-
outcome?: "success" | "soft" | "hard";
|
|
1546
|
-
/** Typed outputs from the completion event (code/agent contract). */
|
|
1547
|
-
typedOutputs?: Record<string, string>;
|
|
1548
|
-
/** Chosen branch label for code-decision / agent-decision nodes. */
|
|
1549
|
-
branch?: string;
|
|
1550
|
-
/** Resolved handler target path for code / code-decision nodes (from started). */
|
|
1551
|
-
codeTarget?: string;
|
|
1552
|
-
status: FlowAgentStatus;
|
|
1553
|
-
label?: string;
|
|
1554
|
-
model?: string;
|
|
1555
|
-
resolvedModel?: string;
|
|
1556
|
-
cardRole?: string;
|
|
1557
|
-
blockedBy: string[];
|
|
1558
|
-
tokens?: { input: number; output: number };
|
|
1559
|
-
/** Accumulated per-agent USD cost from `flow_agent_complete` (`result.cost`).
|
|
1560
|
-
* Sibling of `tokens`; `undefined` when the session predates cost surfacing. */
|
|
1561
|
-
cost?: number;
|
|
1562
|
-
duration?: number;
|
|
1563
|
-
summary?: string;
|
|
1564
|
-
files?: string[];
|
|
1565
|
-
recentTools: FlowRecentTool[];
|
|
1566
|
-
detailHistory: FlowDetailEntry[];
|
|
1567
|
-
loopIteration?: number;
|
|
1568
|
-
loopMax?: number;
|
|
1569
|
-
sourcePath?: string;
|
|
1570
|
-
runCount?: number;
|
|
1571
|
-
}
|
|
1572
|
-
|
|
1573
|
-
/** Overall flow execution status. `interrupted` = orphaned run reconciled on resume
|
|
1574
|
-
* (pi-flows clear-orphaned synthesized terminal). */
|
|
1575
|
-
export type FlowStatus = "running" | "success" | "error" | "aborted" | "interrupted";
|
|
1576
|
-
|
|
1577
|
-
/** Flow execution state tracked client-side by the event reducer */
|
|
1578
|
-
export interface FlowState {
|
|
1579
|
-
flowName: string;
|
|
1580
|
-
task: string;
|
|
1581
|
-
status: FlowStatus;
|
|
1582
|
-
autonomousMode: boolean;
|
|
1583
|
-
/** Path to the flow YAML file (for YAML viewer) */
|
|
1584
|
-
flowSource?: string;
|
|
1585
|
-
/** Ordered map — insertion order matches step order from flow config */
|
|
1586
|
-
agents: Map<string, FlowAgentState>;
|
|
1587
|
-
/** All steps from the flow configuration — used for DAG graph rendering.
|
|
1588
|
-
* Includes non-agent steps (fork, agent-decision, code-decision). `branches`
|
|
1589
|
-
* carries decision routing (label → target) emitted by `flow:flow-started`. */
|
|
1590
|
-
dagSteps?: Array<{ id: string; stepType: string; agent?: string; blockedBy: string[]; branches?: Record<string, string>; onComplete?: string; onError?: string }>;
|
|
1591
|
-
/** Set after flow_complete event */
|
|
1592
|
-
flowResult?: Record<string, unknown>;
|
|
1593
|
-
|
|
1594
|
-
/** Next flow to run (workflow stage resolution) */
|
|
1595
|
-
nextStep?: string | null;
|
|
1596
|
-
/** Pre-computed summary stats */
|
|
1597
|
-
summaryStats?: {
|
|
1598
|
-
agentCount: number;
|
|
1599
|
-
duration: string;
|
|
1600
|
-
fileCount: number;
|
|
1601
|
-
perAgent: Array<{ name: string; status: string; fileCount: number }>;
|
|
1602
|
-
};
|
|
1603
|
-
}
|
|
1604
|
-
|
|
1605
1630
|
// ── Architect Dashboard Types ───────────────────────────────────────
|
|
1606
1631
|
|
|
1607
1632
|
/** Phase of the architect lifecycle */
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One navigation-target classifier for the dashboard client, plugins and the
|
|
3
|
+
* Electron shell (change: harden-client-sinks, design D2).
|
|
4
|
+
*
|
|
5
|
+
* Decides NAVIGATION targets only (`<a href>`, `window.open`, `location.*`,
|
|
6
|
+
* `openExternal`). Media sources and the markdown protocol set stay with
|
|
7
|
+
* `safeUrlTransform` / `is-external-href.ts`.
|
|
8
|
+
*
|
|
9
|
+
* Pure (WHATWG `URL` only, no DOM) and never throws.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export type UrlClass = "internal" | "loopback" | "external" | "mailto" | "blocked";
|
|
13
|
+
|
|
14
|
+
/** Trim leading/trailing C0 controls and space (index-based: no backtracking regex). */
|
|
15
|
+
function trimEdges(s: string): string {
|
|
16
|
+
let start = 0;
|
|
17
|
+
let end = s.length;
|
|
18
|
+
while (start < end && s.charCodeAt(start) <= 0x20) start++;
|
|
19
|
+
while (end > start && s.charCodeAt(end - 1) <= 0x20) end--;
|
|
20
|
+
return s.slice(start, end);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Any C0 control, DEL, or backslash left after trimming. The URL parser
|
|
24
|
+
* silently strips TAB/CR/LF and treats `\` as `/` for special schemes, so the
|
|
25
|
+
* RAW string is checked before parsing.
|
|
26
|
+
*/
|
|
27
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: matching control characters is the point
|
|
28
|
+
const RAW_FORBIDDEN = /[\u0000-\u001f\u007f\\]/;
|
|
29
|
+
const HAS_SCHEME = /^[a-zA-Z][a-zA-Z0-9+.-]*:/;
|
|
30
|
+
|
|
31
|
+
function parseOrigin(origin: string | null): string | null {
|
|
32
|
+
if (origin === null) return null;
|
|
33
|
+
try {
|
|
34
|
+
const o = new URL(origin).origin;
|
|
35
|
+
return o === "null" ? null : o;
|
|
36
|
+
} catch {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Loopback decided on the parser-normalized hostname (`0x7f.0.0.1` → `127.0.0.1`). */
|
|
42
|
+
function isLoopbackHost(hostname: string): boolean {
|
|
43
|
+
const h = hostname.toLowerCase();
|
|
44
|
+
if (h === "localhost" || h === "localhost.") return true;
|
|
45
|
+
if (h.endsWith(".localhost") || h.endsWith(".localhost.")) return true;
|
|
46
|
+
if (h === "[::1]") return true;
|
|
47
|
+
return /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(h);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function classifyHttp(url: URL): UrlClass {
|
|
51
|
+
return isLoopbackHost(url.hostname) ? "loopback" : "external";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Classify `raw` relative to the page `origin`. With `origin === null`
|
|
56
|
+
* (callers with no page, e.g. the Electron main process) there is no
|
|
57
|
+
* `internal` class and relative or scheme-relative input is `blocked`.
|
|
58
|
+
*/
|
|
59
|
+
export function classifyUrl(raw: unknown, origin: string | null): UrlClass {
|
|
60
|
+
if (typeof raw !== "string") return "blocked";
|
|
61
|
+
const s = trimEdges(raw);
|
|
62
|
+
if (s === "" || RAW_FORBIDDEN.test(s)) return "blocked";
|
|
63
|
+
const pageOrigin = parseOrigin(origin);
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
// Scheme-relative: never internal, even when the host matches the origin.
|
|
67
|
+
if (s.startsWith("//")) {
|
|
68
|
+
if (pageOrigin === null) return "blocked";
|
|
69
|
+
const url = new URL(s, pageOrigin);
|
|
70
|
+
return url.protocol === "http:" || url.protocol === "https:" ? classifyHttp(url) : "blocked";
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!HAS_SCHEME.test(s)) {
|
|
74
|
+
// Relative path/query/fragment.
|
|
75
|
+
if (pageOrigin === null) return "blocked";
|
|
76
|
+
const url = new URL(s, pageOrigin);
|
|
77
|
+
return url.origin === pageOrigin && url.pathname.startsWith("/") && !url.pathname.startsWith("//")
|
|
78
|
+
? "internal"
|
|
79
|
+
: "blocked";
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const url = new URL(s);
|
|
83
|
+
switch (url.protocol) {
|
|
84
|
+
case "mailto:":
|
|
85
|
+
return "mailto";
|
|
86
|
+
case "http:":
|
|
87
|
+
case "https:":
|
|
88
|
+
if (pageOrigin !== null && url.origin === pageOrigin) return "internal";
|
|
89
|
+
return classifyHttp(url);
|
|
90
|
+
default:
|
|
91
|
+
return "blocked";
|
|
92
|
+
}
|
|
93
|
+
} catch {
|
|
94
|
+
return "blocked";
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -36,6 +36,21 @@ export type VaultDeliveryOutcome =
|
|
|
36
36
|
| "no-project"
|
|
37
37
|
| "vault-unavailable";
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Which proof a refused remote session is missing (never a value). Carried on the
|
|
41
|
+
* session vault state next to `VaultDeliveryOutcome`, which is unchanged.
|
|
42
|
+
* See change: prove-vault-bridge-tls (D5, D8).
|
|
43
|
+
*/
|
|
44
|
+
export type VaultTrustDetail =
|
|
45
|
+
| "unattributed"
|
|
46
|
+
| "local-unproven"
|
|
47
|
+
| "device-inactive"
|
|
48
|
+
| "plain-transport"
|
|
49
|
+
| "bearer-exposed"
|
|
50
|
+
| "history-unknown"
|
|
51
|
+
| "ticket-plain"
|
|
52
|
+
| "bridge-outdated";
|
|
53
|
+
|
|
39
54
|
// ── Env name rule ───────────────────────────────────────────────────────────
|
|
40
55
|
//
|
|
41
56
|
// One definition for the hub (at binding creation and snapshot building) and
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vertex AI API-key endpoint: the Project/Region a key is bound to, as the
|
|
3
|
+
* `baseUrl` pi sends requests to (pi's key client sends no project/location).
|
|
4
|
+
*
|
|
5
|
+
* Source of the region list: Google's Vertex generative-AI locations page,
|
|
6
|
+
* {@link VERTEX_REGIONS_SOURCE_URL}. No `us`/`eu` multi-regions (no regional
|
|
7
|
+
* `baseUrl` form exists for them).
|
|
8
|
+
*
|
|
9
|
+
* See change: add-provider-advanced-settings (D5).
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export const VERTEX_REGIONS_SOURCE_URL = "https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations";
|
|
13
|
+
|
|
14
|
+
/** Concrete regions Google lists (besides `global`). */
|
|
15
|
+
export const VERTEX_REGIONS: readonly string[] = [
|
|
16
|
+
"asia-east1",
|
|
17
|
+
"asia-east2",
|
|
18
|
+
"asia-northeast1",
|
|
19
|
+
"asia-northeast3",
|
|
20
|
+
"asia-south1",
|
|
21
|
+
"asia-southeast1",
|
|
22
|
+
"australia-southeast1",
|
|
23
|
+
"europe-central2",
|
|
24
|
+
"europe-north1",
|
|
25
|
+
"europe-southwest1",
|
|
26
|
+
"europe-west1",
|
|
27
|
+
"europe-west2",
|
|
28
|
+
"europe-west3",
|
|
29
|
+
"europe-west4",
|
|
30
|
+
"europe-west6",
|
|
31
|
+
"europe-west8",
|
|
32
|
+
"europe-west9",
|
|
33
|
+
"me-central1",
|
|
34
|
+
"me-central2",
|
|
35
|
+
"me-west1",
|
|
36
|
+
"northamerica-northeast1",
|
|
37
|
+
"southamerica-east1",
|
|
38
|
+
"us-central1",
|
|
39
|
+
"us-east1",
|
|
40
|
+
"us-east4",
|
|
41
|
+
"us-east5",
|
|
42
|
+
"us-south1",
|
|
43
|
+
"us-west1",
|
|
44
|
+
"us-west4",
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
/** Region typed under "Other". */
|
|
48
|
+
export const VERTEX_REGION_OTHER_PATTERN = /^[a-z]+-[a-z]+[0-9]+$/;
|
|
49
|
+
/** Google's project-id rule: 6-30 chars, starts with a letter, no trailing hyphen. */
|
|
50
|
+
export const VERTEX_PROJECT_PATTERN = /^[a-z][a-z0-9-]{4,28}[a-z0-9]$/;
|
|
51
|
+
|
|
52
|
+
const GLOBAL_HOST = "aiplatform.googleapis.com";
|
|
53
|
+
|
|
54
|
+
export function validateVertexProject(project: string): boolean {
|
|
55
|
+
return VERTEX_PROJECT_PATTERN.test(project);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function validateVertexRegion(region: string): boolean {
|
|
59
|
+
return region === "global" || VERTEX_REGION_OTHER_PATTERN.test(region);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** The `baseUrl` for a Project/Region, or `null` when either is invalid. */
|
|
63
|
+
export function buildVertexBaseUrl(project: string, region: string): string | null {
|
|
64
|
+
if (!validateVertexProject(project) || !validateVertexRegion(region)) return null;
|
|
65
|
+
const host = region === "global" ? GLOBAL_HOST : `${region}-${GLOBAL_HOST}`;
|
|
66
|
+
return `https://${host}/v1/projects/${project}/locations/${region}`;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Project/Region of a Vertex-form `baseUrl` (either form), or `null` for anything else. */
|
|
70
|
+
export function parseVertexBaseUrl(url: string): { project: string; region: string } | null {
|
|
71
|
+
const m = /^https:\/\/(?:([a-z]+-[a-z]+[0-9]+)-)?aiplatform\.googleapis\.com\/v1\/projects\/([^/]+)\/locations\/([^/]+)$/.exec(url.trim());
|
|
72
|
+
if (!m) return null;
|
|
73
|
+
const [, hostRegion, project, region] = m;
|
|
74
|
+
if ((hostRegion ?? "global") !== region) return null;
|
|
75
|
+
return buildVertexBaseUrl(project, region) ? { project, region } : null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Whether `url` targets Google's Vertex host (empty/global or `<r>-` regional), in any path form. */
|
|
79
|
+
export function isVertexBaseUrl(url: string): boolean {
|
|
80
|
+
return /^https:\/\/(?:[a-z]+-[a-z]+[0-9]+-)?aiplatform\.googleapis\.com(?:\/|$)/.test(url.trim());
|
|
81
|
+
}
|
|
@@ -21,7 +21,11 @@ export const WS_MESSAGE_TIERS: Readonly<Record<string, Tier>> = {
|
|
|
21
21
|
browser_relay_subscribe: "observe",
|
|
22
22
|
browser_relay_unsubscribe: "observe",
|
|
23
23
|
fetch_content: "observe",
|
|
24
|
+
// Ack of a flows-plugin `flows_open` pin: stores nothing server-side, so a
|
|
25
|
+
// read-only viewer is counted too. See change: add-flow-open-tool.
|
|
26
|
+
flows_open_ack: "observe",
|
|
24
27
|
history_backfill: "observe",
|
|
28
|
+
live_preview_accept: "observe",
|
|
25
29
|
list_files: "observe",
|
|
26
30
|
list_sessions: "observe",
|
|
27
31
|
openspec_get: "observe",
|
|
@@ -33,7 +37,6 @@ export const WS_MESSAGE_TIERS: Readonly<Record<string, Tier>> = {
|
|
|
33
37
|
session_unview: "observe",
|
|
34
38
|
session_view: "observe",
|
|
35
39
|
sessions_page: "observe",
|
|
36
|
-
subagent_resync_request: "observe",
|
|
37
40
|
subscribe: "observe",
|
|
38
41
|
unsubscribe: "observe",
|
|
39
42
|
watch_files: "observe",
|
|
@@ -48,6 +51,7 @@ export const WS_MESSAGE_TIERS: Readonly<Record<string, Tier>> = {
|
|
|
48
51
|
archive_session: "control",
|
|
49
52
|
attach_proposal: "control",
|
|
50
53
|
clear_followup_entries: "control",
|
|
54
|
+
clear_steering_entries: "control",
|
|
51
55
|
create_workspace: "control",
|
|
52
56
|
delete_workspace: "control",
|
|
53
57
|
detach_proposal: "control",
|
|
@@ -55,17 +59,20 @@ export const WS_MESSAGE_TIERS: Readonly<Record<string, Tier>> = {
|
|
|
55
59
|
edit_followup_entry: "control",
|
|
56
60
|
extension_ui_response: "control",
|
|
57
61
|
favorite_model: "control",
|
|
58
|
-
flow_control: "control",
|
|
59
|
-
flow_management: "control",
|
|
60
62
|
move_folder_to_workspace: "control",
|
|
61
63
|
openspec_bulk_archive: "control",
|
|
62
64
|
openspec_refresh: "control",
|
|
63
65
|
pin_directory: "control",
|
|
64
66
|
promote_followup_entry: "control",
|
|
65
67
|
prompt_response: "control",
|
|
68
|
+
sudo_credential_cancel: "control",
|
|
69
|
+
sudo_credential_forget: "control",
|
|
70
|
+
sudo_credential_response: "control",
|
|
71
|
+
sudo_credential_shown: "control",
|
|
66
72
|
recovery_dismiss: "control",
|
|
67
73
|
remove_folder_from_workspace: "control",
|
|
68
74
|
remove_followup_entry: "control",
|
|
75
|
+
remove_steering_entry: "control",
|
|
69
76
|
remove_tag_globally: "control",
|
|
70
77
|
rename_session: "control",
|
|
71
78
|
rename_workspace: "control",
|
|
@@ -116,6 +123,7 @@ export const WS_MESSAGE_TIERS: Readonly<Record<string, Tier>> = {
|
|
|
116
123
|
open_inline_terminal: "operate",
|
|
117
124
|
plugin_action: "operate",
|
|
118
125
|
plugin_config_write: "operate",
|
|
126
|
+
provision_response: "operate",
|
|
119
127
|
rename_terminal: "operate",
|
|
120
128
|
role_preset_delete: "operate",
|
|
121
129
|
role_preset_load: "operate",
|