@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
|
@@ -209,6 +209,15 @@ export interface DisplayPrefs {
|
|
|
209
209
|
* See change: render-inline-reasoning-and-custom-entries.
|
|
210
210
|
*/
|
|
211
211
|
reasoningInlineFlow: boolean;
|
|
212
|
+
/**
|
|
213
|
+
* When true (default), the live chat transcript plays arrival-driven motion:
|
|
214
|
+
* entry transitions, paced streaming reveal, a soft trailing edge, glide
|
|
215
|
+
* follow-scroll and tool completion cues. When false the transcript behaves
|
|
216
|
+
* exactly as before. `prefers-reduced-motion: reduce` and a hidden document
|
|
217
|
+
* disable it regardless of this value.
|
|
218
|
+
* See change: add-fluid-chat-motion.
|
|
219
|
+
*/
|
|
220
|
+
chatMotion: boolean;
|
|
212
221
|
/**
|
|
213
222
|
* Per-group visibility for custom chat rows, keyed by custom event group id
|
|
214
223
|
* (see `custom-event-groups.ts`). Shallow-merged field-by-field exactly like
|
|
@@ -254,6 +263,7 @@ export const DISPLAY_PRESETS: Record<"simple" | "standard" | "everything", Displ
|
|
|
254
263
|
showOutOfCwdSessionDiffs: false,
|
|
255
264
|
notifyMinLevel: "all",
|
|
256
265
|
reasoningInlineFlow: false,
|
|
266
|
+
chatMotion: true,
|
|
257
267
|
customEventGroups: defaultCustomEventGroupPrefs(),
|
|
258
268
|
},
|
|
259
269
|
standard: {
|
|
@@ -272,6 +282,7 @@ export const DISPLAY_PRESETS: Record<"simple" | "standard" | "everything", Displ
|
|
|
272
282
|
showOutOfCwdSessionDiffs: false,
|
|
273
283
|
notifyMinLevel: "all",
|
|
274
284
|
reasoningInlineFlow: false,
|
|
285
|
+
chatMotion: true,
|
|
275
286
|
customEventGroups: defaultCustomEventGroupPrefs(),
|
|
276
287
|
},
|
|
277
288
|
everything: {
|
|
@@ -290,6 +301,7 @@ export const DISPLAY_PRESETS: Record<"simple" | "standard" | "everything", Displ
|
|
|
290
301
|
showOutOfCwdSessionDiffs: false,
|
|
291
302
|
notifyMinLevel: "all",
|
|
292
303
|
reasoningInlineFlow: false,
|
|
304
|
+
chatMotion: true,
|
|
293
305
|
customEventGroups: defaultCustomEventGroupPrefs(),
|
|
294
306
|
},
|
|
295
307
|
};
|
|
@@ -350,6 +362,7 @@ export function mergeDisplayPrefs(
|
|
|
350
362
|
override.showOutOfCwdSessionDiffs ?? global.showOutOfCwdSessionDiffs,
|
|
351
363
|
notifyMinLevel: override.notifyMinLevel ?? global.notifyMinLevel,
|
|
352
364
|
reasoningInlineFlow: override.reasoningInlineFlow ?? global.reasoningInlineFlow,
|
|
365
|
+
chatMotion: override.chatMotion ?? global.chatMotion,
|
|
353
366
|
customEventGroups: mergeCustomEventGroupPrefs(global.customEventGroups, override.customEventGroups),
|
|
354
367
|
};
|
|
355
368
|
}
|
|
@@ -21,9 +21,9 @@ import { getDashboardConfigDir } from "./dashboard-paths.js";
|
|
|
21
21
|
import type { LegacyManagedDir } from "./legacy-managed-dir.js";
|
|
22
22
|
import { escapeMdTableCell } from "./md-table-cell.js";
|
|
23
23
|
import { isAtOrAboveEnginesCap } from "./node-version.js";
|
|
24
|
-
import { whichSync } from "./platform/binary-lookup.js";
|
|
24
|
+
import { ToolResolver, whichSync } from "./platform/binary-lookup.js";
|
|
25
25
|
import { execSync } from "./platform/exec.js";
|
|
26
|
-
import { getGitSourceReadout } from "./platform/git-source.js";
|
|
26
|
+
import { type GitSourceReadout, getGitSourceReadout } from "./platform/git-source.js";
|
|
27
27
|
import { buildNativeModuleManifest, findAbiMismatches, type probeNativeModuleAbi } from "./platform/native-module-abi.js";
|
|
28
28
|
import { type ResolvedRuntime, resolvedFamilyEntries } from "./platform/spawn-runtime.js";
|
|
29
29
|
import { resolveNativeTsLoader } from "./platform/ts-loader-select.mjs";
|
|
@@ -662,6 +662,26 @@ export interface AttachedServerVersionDeps {
|
|
|
662
662
|
healthFetcher: () => Promise<AttachedHealthLike | null>;
|
|
663
663
|
}
|
|
664
664
|
|
|
665
|
+
/**
|
|
666
|
+
* Launch-source-specific fix text for an attached server whose version differs
|
|
667
|
+
* from the app. Shared by the Doctor row and the Electron attach-time skew
|
|
668
|
+
* notice (`electron-attach-version-skew`, D6) so the wording cannot drift.
|
|
669
|
+
*/
|
|
670
|
+
export function attachedServerVersionSuggestion(ls: string | undefined, appVersion: string): string {
|
|
671
|
+
if (ls === "standalone") {
|
|
672
|
+
return `Run \`npm i -g @blackbelt-technology/pi-dashboard@${appVersion}\` and restart your terminal session.`;
|
|
673
|
+
}
|
|
674
|
+
if (ls === "bridge" || ls === "bridge-orphaned") {
|
|
675
|
+
return "Stop the pi session that started this server (or run `pi-dashboard stop`) and relaunch the app.";
|
|
676
|
+
}
|
|
677
|
+
if (ls === "electron") {
|
|
678
|
+
return "Quit the other Electron instance or use the zombie-adoption prompt to take ownership.";
|
|
679
|
+
}
|
|
680
|
+
// Unknown / missing launchSource (older server, unenumerated launch mode):
|
|
681
|
+
// don't misattribute it to the electron case — give a source-agnostic hint.
|
|
682
|
+
return "The attached server's version differs from this app bundle. Determine how that server was started (npm, a pi session, or another app) and update it from there.";
|
|
683
|
+
}
|
|
684
|
+
|
|
665
685
|
/**
|
|
666
686
|
* Compare the shell's bundled version against the attached server's
|
|
667
687
|
* `/api/health.version`. Electron-arm only — a server comparing its own pkg
|
|
@@ -701,22 +721,7 @@ export async function checkAttachedServerVersion(
|
|
|
701
721
|
};
|
|
702
722
|
}
|
|
703
723
|
const ls = health.launchSource;
|
|
704
|
-
|
|
705
|
-
if (ls === "standalone") {
|
|
706
|
-
suggestion =
|
|
707
|
-
`Run \`npm i -g @blackbelt-technology/pi-dashboard@${deps.appVersion}\` and restart your terminal session.`;
|
|
708
|
-
} else if (ls === "bridge" || ls === "bridge-orphaned") {
|
|
709
|
-
suggestion =
|
|
710
|
-
"Stop the pi session that started this server (or run `pi-dashboard stop`) and relaunch the app.";
|
|
711
|
-
} else if (ls === "electron") {
|
|
712
|
-
suggestion =
|
|
713
|
-
"Quit the other Electron instance or use the zombie-adoption prompt to take ownership.";
|
|
714
|
-
} else {
|
|
715
|
-
// Unknown / missing launchSource (older server, unenumerated launch mode):
|
|
716
|
-
// don't misattribute it to the electron case — give a source-agnostic hint.
|
|
717
|
-
suggestion =
|
|
718
|
-
"The attached server's version differs from this app bundle. Determine how that server was started (npm, a pi session, or another app) and update it from there.";
|
|
719
|
-
}
|
|
724
|
+
const suggestion = attachedServerVersionSuggestion(ls, deps.appVersion);
|
|
720
725
|
return {
|
|
721
726
|
name: "Attached server version",
|
|
722
727
|
section: "setup",
|
|
@@ -900,6 +905,12 @@ export interface SharedChecksDeps {
|
|
|
900
905
|
* hermetically. See change: unify-pi-runtime-identity.
|
|
901
906
|
*/
|
|
902
907
|
detectLegacyManagedDir?: () => LegacyManagedDir;
|
|
908
|
+
/**
|
|
909
|
+
* Test seam for the Windows git/bash source readout. Defaults to the real
|
|
910
|
+
* `getGitSourceReadout`, fed the same spawn env the server builds for real
|
|
911
|
+
* spawns. See change: fix-windows-bundled-bash-exe.
|
|
912
|
+
*/
|
|
913
|
+
gitSourceReadout?: () => GitSourceReadout | null;
|
|
903
914
|
/**
|
|
904
915
|
* The ladder-resolved pi spawn runtime, passed as an INPUT by the host
|
|
905
916
|
* arm (server: `currentSpawnRuntime()`; Electron: live
|
|
@@ -1599,7 +1610,11 @@ export async function runSharedChecks(deps: SharedChecksDeps): Promise<DoctorChe
|
|
|
1599
1610
|
// Windows-only: bundled-vs-host git & shell source. See change:
|
|
1600
1611
|
// embed-git-bash-on-windows.
|
|
1601
1612
|
try {
|
|
1602
|
-
const readout =
|
|
1613
|
+
const readout = deps.gitSourceReadout
|
|
1614
|
+
? deps.gitSourceReadout()
|
|
1615
|
+
: getGitSourceReadout(whichSync, {
|
|
1616
|
+
spawnEnv: () => new ToolResolver({ processExecPath: process.execPath }).buildSpawnEnv(process.env),
|
|
1617
|
+
});
|
|
1603
1618
|
if (readout) {
|
|
1604
1619
|
const tag = `(${readout.source})`;
|
|
1605
1620
|
const wantHostButBundled = readout.setting === "host" && readout.source === "bundled";
|
|
@@ -1616,14 +1631,7 @@ export async function runSharedChecks(deps: SharedChecksDeps): Promise<DoctorChe
|
|
|
1616
1631
|
? "Install Git for Windows, or set windowsGitSource to 'auto' / 'bundled'."
|
|
1617
1632
|
: undefined,
|
|
1618
1633
|
});
|
|
1619
|
-
checks.push(
|
|
1620
|
-
name: "bash source",
|
|
1621
|
-
section: "runtime",
|
|
1622
|
-
status: readout.shellPath ? "ok" : "warning",
|
|
1623
|
-
message: readout.shellPath ? `sh ${tag}` : "no POSIX shell resolved",
|
|
1624
|
-
code: readout.shellPath ? undefined : "doctor.no_posix_shell",
|
|
1625
|
-
detail: readout.shellPath ?? "sh.exe / bash.exe not resolved",
|
|
1626
|
-
});
|
|
1634
|
+
checks.push(bashSourceCheck(readout));
|
|
1627
1635
|
}
|
|
1628
1636
|
} catch {
|
|
1629
1637
|
/* advisory only — never block doctor output */
|
|
@@ -1632,6 +1640,65 @@ export async function runSharedChecks(deps: SharedChecksDeps): Promise<DoctorChe
|
|
|
1632
1640
|
return checks;
|
|
1633
1641
|
}
|
|
1634
1642
|
|
|
1643
|
+
/**
|
|
1644
|
+
* Windows "bash source" row: reports the shell pi-coding-agent will actually
|
|
1645
|
+
* resolve (readout.shellPath), not the shell the dashboard would like. A WSL
|
|
1646
|
+
* launcher is a warning unless the operator chose `windowsBashSource: "host"`.
|
|
1647
|
+
* See change: fix-windows-bundled-bash-exe.
|
|
1648
|
+
*/
|
|
1649
|
+
function bashSourceCheck(readout: GitSourceReadout): DoctorCheck {
|
|
1650
|
+
const base = { name: "bash source", section: "runtime" as const };
|
|
1651
|
+
const { shellPath } = readout;
|
|
1652
|
+
if (!shellPath) {
|
|
1653
|
+
return {
|
|
1654
|
+
...base,
|
|
1655
|
+
status: "warning",
|
|
1656
|
+
message: "no POSIX shell resolved",
|
|
1657
|
+
code: "doctor.no_posix_shell",
|
|
1658
|
+
detail: "pi would find no bash.exe (sh.exe is not used) — agent bash commands fail with 'No bash shell found'",
|
|
1659
|
+
suggestion: "Install Git for Windows, or reinstall the dashboard app so the bundled bash.exe is present.",
|
|
1660
|
+
};
|
|
1661
|
+
}
|
|
1662
|
+
const tag = `(${readout.source})`;
|
|
1663
|
+
if (readout.shellIsWslLauncher) {
|
|
1664
|
+
if (readout.bashSetting === "host") {
|
|
1665
|
+
return {
|
|
1666
|
+
...base,
|
|
1667
|
+
status: "ok",
|
|
1668
|
+
message: `bash ${tag} — WSL`,
|
|
1669
|
+
detail: `${shellPath} — WSL launcher; requires an installed WSL distro`,
|
|
1670
|
+
};
|
|
1671
|
+
}
|
|
1672
|
+
return {
|
|
1673
|
+
...base,
|
|
1674
|
+
status: "warning",
|
|
1675
|
+
message: "pi would use the WSL launcher as its shell",
|
|
1676
|
+
code: "doctor.bash_is_wsl_launcher",
|
|
1677
|
+
detail: `${shellPath} — fails with 'no installed distributions' unless a WSL distro exists`,
|
|
1678
|
+
suggestion:
|
|
1679
|
+
readout.source === "bundled"
|
|
1680
|
+
? "The bundled bash.exe is missing: update or reinstall the dashboard app. To use WSL on purpose, set windowsBashSource to 'host'."
|
|
1681
|
+
: "Agent commands would run inside WSL. To use a Windows bash: install Git for Windows or set windowsGitSource to bundled. To use WSL on purpose, set windowsBashSource to 'host'.",
|
|
1682
|
+
};
|
|
1683
|
+
}
|
|
1684
|
+
// Shell lives inside the bundled git tree? Compare against the git root derived
|
|
1685
|
+
// from gitPath (<root>\cmd\git.exe) so no bundled-path literal is needed here.
|
|
1686
|
+
const gitRoot = readout.gitPath ? path.win32.dirname(path.win32.dirname(readout.gitPath)) : null;
|
|
1687
|
+
const shellIsBundled =
|
|
1688
|
+
readout.source === "bundled" &&
|
|
1689
|
+
gitRoot !== null &&
|
|
1690
|
+
shellPath.toLowerCase().startsWith(`${gitRoot.toLowerCase()}\\`);
|
|
1691
|
+
return {
|
|
1692
|
+
...base,
|
|
1693
|
+
status: "ok",
|
|
1694
|
+
message: `bash ${tag}`,
|
|
1695
|
+
detail:
|
|
1696
|
+
readout.bashSetting === "host" && shellIsBundled
|
|
1697
|
+
? `${shellPath} — host bash requested, none found — using bundled`
|
|
1698
|
+
: shellPath,
|
|
1699
|
+
};
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1635
1702
|
// ─── Stamping helper ──────────────────────────────────────────────────
|
|
1636
1703
|
|
|
1637
1704
|
/**
|
|
@@ -14,6 +14,28 @@
|
|
|
14
14
|
|
|
15
15
|
export const REGISTER_EVENT_FORWARD_CHANNEL = "dashboard:register-event-forward";
|
|
16
16
|
export const BRIDGE_READY_CHANNEL = "dashboard:bridge-ready";
|
|
17
|
+
/**
|
|
18
|
+
* A plugin bridge emits this with a {@link ToolUpdateFilterDeclaration} to drop
|
|
19
|
+
* data paths from `tool_execution_update` frames of a tool its manifest claims.
|
|
20
|
+
* See change: move-subagents-to-plugin (D5).
|
|
21
|
+
*/
|
|
22
|
+
export const REGISTER_TOOL_UPDATE_FILTER_CHANNEL = "dashboard:register-tool-update-filter";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Ownership table the server derives from loaded plugin manifests and sends to
|
|
26
|
+
* each bridge (`plugin_ownership`): manifest `eventTypes` pattern → pluginId and
|
|
27
|
+
* tool-renderer claim toolName → pluginId. The bridge reads no manifests.
|
|
28
|
+
* See change: move-subagents-to-plugin (D1).
|
|
29
|
+
*/
|
|
30
|
+
export interface PluginOwnershipTable {
|
|
31
|
+
eventTypes: Record<string, string>;
|
|
32
|
+
toolClaims: Record<string, string>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Bare signal any plugin bridge emits to make the core bridge resend
|
|
36
|
+
* `commands_list` (payload ignored). See change: update-flows-plugin (D4).
|
|
37
|
+
*/
|
|
38
|
+
export const COMMANDS_CHANGED_CHANNEL = "dashboard:commands-changed";
|
|
17
39
|
|
|
18
40
|
export type EventForwardDelivery = "live" | "latest" | "stream";
|
|
19
41
|
|
|
@@ -23,11 +45,28 @@ export interface EventForwardChannelSpec {
|
|
|
23
45
|
delivery: EventForwardDelivery;
|
|
24
46
|
/** Top-level payload field grouping retained messages (latest/stream). */
|
|
25
47
|
key?: string;
|
|
48
|
+
/**
|
|
49
|
+
* `latest` only: channels of one plugin naming the same group share ONE
|
|
50
|
+
* retained slot per key (the newest across the group's channels).
|
|
51
|
+
*/
|
|
52
|
+
group?: string;
|
|
26
53
|
}
|
|
27
54
|
|
|
28
55
|
export interface EventForwardDeclaration {
|
|
29
56
|
pluginId: string;
|
|
30
57
|
channels: Record<string, EventForwardChannelSpec>;
|
|
58
|
+
/**
|
|
59
|
+
* Retention key budget for this plugin (default 64, ceiling 256). A larger
|
|
60
|
+
* value is clamped to 256 and counted as a rejection.
|
|
61
|
+
*/
|
|
62
|
+
maxKeys?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Persisted custom-entry types this plugin owns (its manifest
|
|
65
|
+
* `replayEntryTypes`). The live bridge replays them as recorded protocol
|
|
66
|
+
* events and never forwards them as generic `custom_entry` rows. Malformed
|
|
67
|
+
* values contribute nothing. See change: update-flows-plugin (D3).
|
|
68
|
+
*/
|
|
69
|
+
replayEntryTypes?: string[];
|
|
31
70
|
}
|
|
32
71
|
|
|
33
72
|
/** Normalized accepted channel (as resolved, delivery, key). */
|
|
@@ -36,8 +75,11 @@ export interface AcceptedChannelSpec {
|
|
|
36
75
|
as: string;
|
|
37
76
|
delivery: EventForwardDelivery;
|
|
38
77
|
key?: string;
|
|
78
|
+
group?: string;
|
|
39
79
|
}
|
|
40
80
|
|
|
81
|
+
export const DEFAULT_PLUGIN_MAX_KEYS = 64;
|
|
82
|
+
export const MAX_PLUGIN_MAX_KEYS = 256;
|
|
41
83
|
export const MAX_CHANNELS_PER_PLUGIN = 32;
|
|
42
84
|
export const MAX_PLUGIN_CHANNELS_TOTAL = 256;
|
|
43
85
|
|
|
@@ -47,9 +89,10 @@ const AS_RE = /^[a-z0-9_]{1,64}$/;
|
|
|
47
89
|
const KEY_RE = /^[A-Za-z][A-Za-z0-9_]{0,31}$/;
|
|
48
90
|
|
|
49
91
|
/**
|
|
50
|
-
* Event types a plugin channel may NOT forward as: pi core event types
|
|
51
|
-
*
|
|
52
|
-
*
|
|
92
|
+
* Event types a plugin channel may NOT forward as: pi core event types and
|
|
93
|
+
* bridge↔server control message types. A plugin hijacking one would inject
|
|
94
|
+
* frames the reducer trusts. Plugin-owned types are NOT listed here: ownership
|
|
95
|
+
* comes from the manifest `eventTypes` via the server's `plugin_ownership` table.
|
|
53
96
|
*/
|
|
54
97
|
export const RESERVED_EVENT_TYPES: ReadonlySet<string> = new Set([
|
|
55
98
|
// pi core session events
|
|
@@ -61,18 +104,12 @@ export const RESERVED_EVENT_TYPES: ReadonlySet<string> = new Set([
|
|
|
61
104
|
"session_before_compact", "session_before_switch", "session_before_fork", "session_tree",
|
|
62
105
|
"model_select", "user_bash", "auto_compaction_start", "auto_compaction_end",
|
|
63
106
|
"auto_retry_start", "auto_retry_end", "compaction_start", "compaction_end",
|
|
64
|
-
// core-mapped bus channels
|
|
65
|
-
"flow_started", "flow_agent_started", "flow_agent_complete", "flow_agent_error",
|
|
66
|
-
"flow_tool_call", "flow_tool_result", "flow_assistant_text", "flow_thinking_text",
|
|
67
|
-
"flow_loop_iteration", "flow_auto_decision", "flow_complete", "flow_summary_started",
|
|
68
|
-
"flow_summary_ready", "flow_summary_dismissed", "flow_autonomous_changed",
|
|
69
|
-
"subagent_created", "subagent_started", "subagent_completed", "subagent_failed",
|
|
70
107
|
// bridge control / protocol message types
|
|
71
108
|
"event_forward", "entry_persisted", "session_register", "session_unregister",
|
|
72
|
-
"session_heartbeat", "replay_complete", "commands_list",
|
|
109
|
+
"session_heartbeat", "replay_complete", "commands_list",
|
|
73
110
|
"extension_ui_request", "usage_recorded", "prompt_request", "prompt_dismiss",
|
|
74
111
|
"prompt_cancel", "notify", "plugin_pi_message", "plugin_request", "queue_update",
|
|
75
|
-
"bridge_diagnostic",
|
|
112
|
+
"bridge_diagnostic", "plugin_ownership",
|
|
76
113
|
]);
|
|
77
114
|
|
|
78
115
|
export type RejectionReason =
|
|
@@ -82,6 +119,7 @@ export type RejectionReason =
|
|
|
82
119
|
| "reserved-as"
|
|
83
120
|
| "delivery"
|
|
84
121
|
| "key"
|
|
122
|
+
| "group"
|
|
85
123
|
| "per-plugin-cap"
|
|
86
124
|
| "total-cap"
|
|
87
125
|
| "spec-shape";
|
|
@@ -92,6 +130,10 @@ export interface ValidationResult {
|
|
|
92
130
|
pluginId?: string;
|
|
93
131
|
accepted: AcceptedChannelSpec[];
|
|
94
132
|
rejected: Array<{ channel: string; reason: RejectionReason }>;
|
|
133
|
+
/** Validated `maxKeys` (clamped to the ceiling); absent when not declared / invalid. */
|
|
134
|
+
maxKeys?: number;
|
|
135
|
+
/** True when `maxKeys` was invalid or clamped (counted by the registry). */
|
|
136
|
+
maxKeysRejected?: boolean;
|
|
95
137
|
}
|
|
96
138
|
|
|
97
139
|
function own(obj: object, k: string): unknown {
|
|
@@ -122,7 +164,15 @@ function checkChannelSpec(channel: string, spec: unknown): AcceptedChannelSpec |
|
|
|
122
164
|
if (RESERVED_EVENT_TYPES.has(as)) return "reserved-as";
|
|
123
165
|
const key = optionalMatch(own(spec, "key"), KEY_RE);
|
|
124
166
|
if (key === false || (delivery !== "live" && key === undefined)) return "key";
|
|
125
|
-
|
|
167
|
+
const group = optionalMatch(own(spec, "group"), KEY_RE);
|
|
168
|
+
if (group === false || (group !== undefined && delivery !== "latest")) return "group";
|
|
169
|
+
return {
|
|
170
|
+
channel,
|
|
171
|
+
as,
|
|
172
|
+
delivery,
|
|
173
|
+
...(key !== undefined ? { key } : {}),
|
|
174
|
+
...(group !== undefined ? { group } : {}),
|
|
175
|
+
};
|
|
126
176
|
}
|
|
127
177
|
|
|
128
178
|
/** Parse the declaration header; `undefined` when the envelope is malformed. */
|
|
@@ -154,6 +204,15 @@ export function validateDeclaration(
|
|
|
154
204
|
if (!header) return result;
|
|
155
205
|
result.ok = true;
|
|
156
206
|
result.pluginId = header.pluginId;
|
|
207
|
+
const rawMax = own(raw as object, "maxKeys");
|
|
208
|
+
if (rawMax !== undefined) {
|
|
209
|
+
if (typeof rawMax === "number" && Number.isInteger(rawMax) && rawMax >= 1) {
|
|
210
|
+
result.maxKeys = Math.min(rawMax, MAX_PLUGIN_MAX_KEYS);
|
|
211
|
+
if (rawMax > MAX_PLUGIN_MAX_KEYS) result.maxKeysRejected = true;
|
|
212
|
+
} else {
|
|
213
|
+
result.maxKeysRejected = true;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
157
216
|
|
|
158
217
|
let perPlugin = opts.existingForPlugin ?? 0;
|
|
159
218
|
let total = opts.existingTotal ?? 0;
|
|
@@ -185,3 +244,17 @@ export function isValidKeyValue(v: unknown): v is string | number {
|
|
|
185
244
|
if (typeof v === "number") return Number.isFinite(v) && String(v).length <= 128;
|
|
186
245
|
return false;
|
|
187
246
|
}
|
|
247
|
+
|
|
248
|
+
export interface ToolUpdateFilterCondition {
|
|
249
|
+
/** Dot path of a string value; read as a sibling of each drop path first, else absolute. */
|
|
250
|
+
path: string;
|
|
251
|
+
in: string[];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/** Data-only `tool_execution_update` filter declaration (D5). */
|
|
255
|
+
export interface ToolUpdateFilterDeclaration {
|
|
256
|
+
pluginId: string;
|
|
257
|
+
toolName: string;
|
|
258
|
+
dropPaths: string[];
|
|
259
|
+
when?: ToolUpdateFilterCondition;
|
|
260
|
+
}
|
|
@@ -13,24 +13,56 @@
|
|
|
13
13
|
* and to every rung of an offered-ancestor ladder (task 7b.2), so a ladder can
|
|
14
14
|
* never walk up into a forbidden directory.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
16
|
+
* The `sensitive` list also holds the CLI credential directories (`~/.aws`, `~/.config/gh`,
|
|
17
|
+
* `~/.gnupg`, `~/.kube`, `~/.docker`), the exact file `~/.netrc` and the browser user-data
|
|
18
|
+
* roots of the running platform (`browserProfileRoots`). Because every consumer funnels through
|
|
19
|
+
* this module (agent gate flag, grant backstop, ladder, planes, YOLO roots + auto-allow,
|
|
20
|
+
* provisioning, cwd verdicts, allow-once admission, agent grant acceptance, trust-mirror deny,
|
|
21
|
+
* browse roots), one edit here makes them sensitive everywhere. Residual drift: the local lists in
|
|
22
|
+
* `server/src/access/provisioning.ts` and `shared/src/pi-trust-mirror.ts` are left alone (supersets
|
|
23
|
+
* are verified); a fourth list is NOT added.
|
|
24
|
+
*
|
|
25
|
+
* See change: add-access-grants-and-review; harden-agent-tool-guards (D7).
|
|
17
26
|
*/
|
|
18
27
|
import * as fs from "node:fs";
|
|
19
28
|
import os from "node:os";
|
|
20
29
|
import path from "node:path";
|
|
21
30
|
import { samePath } from "./platform/paths.js";
|
|
22
31
|
|
|
23
|
-
/** Resolve symlinks in the nearest existing ancestor, re-appending the tail. */
|
|
32
|
+
/** Resolve symlinks in the nearest existing ancestor, re-appending the tail. Used for a caller-supplied subject. */
|
|
24
33
|
export function realpathNearestAncestor(p: string): string {
|
|
25
34
|
try {
|
|
26
35
|
return fs.realpathSync(p);
|
|
27
36
|
} catch {
|
|
28
37
|
const parent = path.dirname(p);
|
|
29
|
-
|
|
30
|
-
return path.join(realpathNearestAncestor(parent), path.basename(p));
|
|
38
|
+
return parent === p ? p : path.join(realpathNearestAncestor(parent), path.basename(p));
|
|
31
39
|
}
|
|
32
40
|
}
|
|
33
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Same resolution for the LISTED credential locations (home-derived constants, never request input).
|
|
44
|
+
*
|
|
45
|
+
* Most listed entries do not exist on a given host, and each miss throws ENOENT from `realpathSync`.
|
|
46
|
+
* With the extended sensitive list (harden-agent-tool-guards D7, ~30 entries) that was a measurable
|
|
47
|
+
* cost on the denial path, almost all of it capturing a stack trace nobody reads. The caller
|
|
48
|
+
* (`forbiddenGrantSubjects`) therefore zeroes `Error.stackTraceLimit` around the whole list build, and
|
|
49
|
+
* `cache` shares the parent resolution across entries. No extra fs probe is added: an `lstat` here was a
|
|
50
|
+
* CodeQL js/path-injection sink, while `realpathSync` is not.
|
|
51
|
+
*/
|
|
52
|
+
function realpathListedAncestor(p: string, cache: Map<string, string>): string {
|
|
53
|
+
const hit = cache.get(p);
|
|
54
|
+
if (hit !== undefined) return hit;
|
|
55
|
+
let result: string;
|
|
56
|
+
try {
|
|
57
|
+
result = fs.realpathSync(p);
|
|
58
|
+
} catch {
|
|
59
|
+
const parent = path.dirname(p);
|
|
60
|
+
result = parent === p ? p : path.join(realpathListedAncestor(parent, cache), path.basename(p));
|
|
61
|
+
}
|
|
62
|
+
cache.set(p, result);
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
|
|
34
66
|
/** Inputs to the forbidden list. Every field defaults to the running process. */
|
|
35
67
|
export interface ForbiddenSubjectsEnv {
|
|
36
68
|
homedir?: string;
|
|
@@ -85,24 +117,72 @@ const WINDOWS_SYSTEM_DIRS: ReadonlyArray<readonly [string, string]> = [
|
|
|
85
117
|
* and its equality. Shared by the list and every predicate, so a simulated
|
|
86
118
|
* `win32` is Windows end to end (design D8).
|
|
87
119
|
*/
|
|
88
|
-
function pathOps(env?: ForbiddenSubjectsEnv) {
|
|
120
|
+
function pathOps(env?: ForbiddenSubjectsEnv, cache?: Map<string, string>) {
|
|
89
121
|
const platform = env?.platform ?? process.platform;
|
|
90
122
|
const windows = platform === "win32";
|
|
91
123
|
const p = windows ? path.win32 : path.posix;
|
|
92
124
|
const hostIsWindows = process.platform === "win32"; // platform-branch-ok: same path family as the host? (not host behaviour)
|
|
93
125
|
const canonical = (x: string): string => {
|
|
94
126
|
const resolved = p.resolve(x);
|
|
95
|
-
|
|
127
|
+
if (windows !== hostIsWindows) return resolved;
|
|
128
|
+
return cache ? realpathListedAncestor(resolved, cache) : realpathNearestAncestor(resolved);
|
|
96
129
|
};
|
|
97
130
|
const same = (a: string, b: string): boolean => samePath(a, b, platform);
|
|
98
131
|
return { platform, windows, p, canonical, same };
|
|
99
132
|
}
|
|
100
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Browser user-data roots per platform (design D7, NORMATIVE; one test row per browser and platform
|
|
136
|
+
* asserts this table by equality). Chrome equals `chromeUserDataDir` (`chrome-profiles.ts`).
|
|
137
|
+
* Brave is the VENDOR root (`BraveSoftware`, which contains `Brave-Browser/User Data`).
|
|
138
|
+
* Snap / flatpak locations (`~/snap/firefox`, `~/.var/app/*`) are a recorded residual.
|
|
139
|
+
*
|
|
140
|
+
* To add a browser: add its root to the matching platform branch below, add a row to
|
|
141
|
+
* `forbidden-subjects.test.ts` (and the design D7 table), nothing else - every consumer follows.
|
|
142
|
+
*/
|
|
143
|
+
export function browserProfileRoots(
|
|
144
|
+
platform: NodeJS.Platform,
|
|
145
|
+
home: string,
|
|
146
|
+
vars: NodeJS.ProcessEnv,
|
|
147
|
+
): string[] {
|
|
148
|
+
if (platform === "win32") {
|
|
149
|
+
const local = vars.LOCALAPPDATA || path.win32.join(home, "AppData", "Local");
|
|
150
|
+
const roaming = vars.APPDATA || path.win32.join(home, "AppData", "Roaming");
|
|
151
|
+
return [
|
|
152
|
+
path.win32.join(local, "Google", "Chrome", "User Data"),
|
|
153
|
+
path.win32.join(local, "Microsoft", "Edge", "User Data"),
|
|
154
|
+
path.win32.join(local, "BraveSoftware"),
|
|
155
|
+
path.win32.join(roaming, "Mozilla"),
|
|
156
|
+
];
|
|
157
|
+
}
|
|
158
|
+
if (platform === "darwin") {
|
|
159
|
+
const support = path.posix.join(home, "Library", "Application Support");
|
|
160
|
+
return ["Google/Chrome", "Chromium", "Microsoft Edge", "BraveSoftware", "Firefox"].map((d) => path.posix.join(support, d));
|
|
161
|
+
}
|
|
162
|
+
const config = path.posix.join(home, ".config");
|
|
163
|
+
return [
|
|
164
|
+
...["google-chrome", "chromium", "microsoft-edge", "BraveSoftware"].map((d) => path.posix.join(config, d)),
|
|
165
|
+
path.posix.join(home, ".mozilla"),
|
|
166
|
+
];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** CLI credential directories and files under `$HOME` (same on every platform). */
|
|
170
|
+
const HOME_CREDENTIAL_SUBPATHS: ReadonlyArray<readonly string[]> = [
|
|
171
|
+
[".aws"],
|
|
172
|
+
[".config", "gh"],
|
|
173
|
+
[".gnupg"],
|
|
174
|
+
[".kube"],
|
|
175
|
+
[".docker"],
|
|
176
|
+
// exact file only: `~/.netrc.*` siblings and Windows `_netrc` are a recorded residual
|
|
177
|
+
[".netrc"],
|
|
178
|
+
];
|
|
179
|
+
|
|
101
180
|
export function forbiddenGrantSubjects(env?: ForbiddenSubjectsEnv): {
|
|
102
181
|
whole: string[];
|
|
103
182
|
sensitive: string[];
|
|
104
183
|
} {
|
|
105
|
-
|
|
184
|
+
// One resolution cache per call: the ~30 listed paths share parents (`~/.config/*`, `~/Library/...`).
|
|
185
|
+
const { platform, windows, p, canonical } = pathOps(env, new Map());
|
|
106
186
|
const vars = env?.env ?? process.env;
|
|
107
187
|
const home = env?.homedir ?? os.homedir();
|
|
108
188
|
const system = windows
|
|
@@ -110,8 +190,24 @@ export function forbiddenGrantSubjects(env?: ForbiddenSubjectsEnv): {
|
|
|
110
190
|
: POSIX_SYSTEM_DIRS;
|
|
111
191
|
const root = windows ? p.parse(p.resolve(vars.SystemRoot || "C:\\")).root : "/";
|
|
112
192
|
const whole = [root, home, ...system];
|
|
113
|
-
const sensitive = [
|
|
114
|
-
|
|
193
|
+
const sensitive = [
|
|
194
|
+
p.join(home, ".ssh"),
|
|
195
|
+
p.join(home, ".pi"),
|
|
196
|
+
...HOME_CREDENTIAL_SUBPATHS.map((sub) => p.join(home, ...sub)),
|
|
197
|
+
...browserProfileRoots(platform, home, vars),
|
|
198
|
+
];
|
|
199
|
+
return withoutStackTraces(() => ({ whole: whole.map(canonical), sensitive: sensitive.map(canonical) }));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** Run `fn` with error stack capture off: a missing path throws ENOENT from `realpathSync`, and the stack is never read. */
|
|
203
|
+
function withoutStackTraces<T>(fn: () => T): T {
|
|
204
|
+
const limit = Error.stackTraceLimit;
|
|
205
|
+
Error.stackTraceLimit = 0;
|
|
206
|
+
try {
|
|
207
|
+
return fn();
|
|
208
|
+
} finally {
|
|
209
|
+
Error.stackTraceLimit = limit;
|
|
210
|
+
}
|
|
115
211
|
}
|
|
116
212
|
|
|
117
213
|
/**
|
|
@@ -140,8 +236,12 @@ export function isForbiddenGrantSubject(
|
|
|
140
236
|
/** True when `candidate` equals, or is an ancestor of, `other` (selected platform's semantics). */
|
|
141
237
|
function subsumes(candidate: string, other: string, ops: ReturnType<typeof pathOps>): boolean {
|
|
142
238
|
if (ops.same(candidate, other)) return true;
|
|
239
|
+
// POSIX `relative` is a case-sensitive resolve + split: a descendant must be a string-prefix match, so the
|
|
240
|
+
// costly relative() is skipped for the (many) unrelated pairs of the ~30-entry sensitive list.
|
|
241
|
+
if (!ops.windows && !other.startsWith(candidate)) return false;
|
|
143
242
|
const rel = ops.p.relative(candidate, other);
|
|
144
|
-
|
|
243
|
+
// `..x` is a child NAME; only `..` or `..<sep>…` leaves the candidate.
|
|
244
|
+
return rel !== "" && rel !== ".." && !rel.startsWith(`..${ops.p.sep}`) && !ops.p.isAbsolute(rel);
|
|
145
245
|
}
|
|
146
246
|
|
|
147
247
|
/**
|
|
@@ -179,8 +279,20 @@ export function subsumesForbiddenGrantSubject(
|
|
|
179
279
|
* dropped without any test noticing. Callers must pass the subject that will be
|
|
180
280
|
* PERSISTED, not a pre-normalization input (design D15).
|
|
181
281
|
*/
|
|
182
|
-
export function isUngrantableSubject(
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
282
|
+
export function isUngrantableSubject(
|
|
283
|
+
subject: string,
|
|
284
|
+
env?: ForbiddenSubjectsEnv,
|
|
285
|
+
/** Precomputed `forbiddenGrantSubjects(env)`, for a caller testing many subjects (e.g. a stored list). */
|
|
286
|
+
sets?: ReturnType<typeof forbiddenGrantSubjects>,
|
|
287
|
+
): boolean {
|
|
288
|
+
// Built once per call (or by the caller) and shared by both halves (design D7); the subject is
|
|
289
|
+
// canonicalised once, not once per half.
|
|
290
|
+
const ops = pathOps(env);
|
|
291
|
+
const real = withoutStackTraces(() => ops.canonical(subject));
|
|
292
|
+
const { whole, sensitive } = sets ?? forbiddenGrantSubjects(env);
|
|
293
|
+
return (
|
|
294
|
+
whole.some((f) => ops.same(real, f)) ||
|
|
295
|
+
sensitive.some((f) => subsumes(f, real, ops)) ||
|
|
296
|
+
[...whole, ...sensitive].some((f) => subsumes(real, f, ops))
|
|
297
|
+
);
|
|
186
298
|
}
|
|
@@ -76,36 +76,6 @@ export const DEFAULT_SERVER_HEAP: ServerHeapConfig = {
|
|
|
76
76
|
maxOldSpaceMb: 1536,
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
/**
|
|
80
|
-
* Per-child heap guidance figure (MB) below which the session ceiling and the
|
|
81
|
-
* subagent fan-out bound are a risky pairing.
|
|
82
|
-
*/
|
|
83
|
-
export const SUBAGENT_HEAP_GUIDANCE_MB = 100;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Subagents run IN-PROCESS and share the parent's single V8 heap, so
|
|
87
|
-
* `maxConcurrentSubagents` is a memory-safety knob once a ceiling is enforced.
|
|
88
|
-
* `+ 1` accounts for the parent itself.
|
|
89
|
-
*
|
|
90
|
-
* One formula, used by both the settings panel and its tests, so the warning
|
|
91
|
-
* the operator sees and the number the test asserts cannot drift.
|
|
92
|
-
* See change: bound-session-heap-and-gc-telemetry (task 10.8).
|
|
93
|
-
*/
|
|
94
|
-
export function subagentHeapBudget(
|
|
95
|
-
maxOldSpaceMb: number,
|
|
96
|
-
maxConcurrentSubagents: number,
|
|
97
|
-
): { perChildMb: number; warn: boolean } {
|
|
98
|
-
if (
|
|
99
|
-
!Number.isFinite(maxOldSpaceMb) ||
|
|
100
|
-
!Number.isFinite(maxConcurrentSubagents) ||
|
|
101
|
-
maxConcurrentSubagents < 0
|
|
102
|
-
) {
|
|
103
|
-
return { perChildMb: 0, warn: false };
|
|
104
|
-
}
|
|
105
|
-
const perChildMb = Math.floor(maxOldSpaceMb / (maxConcurrentSubagents + 1));
|
|
106
|
-
return { perChildMb, warn: perChildMb < SUBAGENT_HEAP_GUIDANCE_MB };
|
|
107
|
-
}
|
|
108
|
-
|
|
109
79
|
/**
|
|
110
80
|
* Heap MB one MiB of `maxTotalEventBytes` budget costs: 768 MiB of serialized
|
|
111
81
|
* event data ≈ 1 GiB of V8 heap. Per MiB, NOT per byte — the budget is stored
|
|
@@ -40,7 +40,8 @@ export type HostGateAdmittedSource =
|
|
|
40
40
|
| "cors-origin"
|
|
41
41
|
| "live-tunnel"
|
|
42
42
|
| "allowed-host"
|
|
43
|
-
| "tls-listener"
|
|
43
|
+
| "tls-listener"
|
|
44
|
+
| "live-preview";
|
|
44
45
|
|
|
45
46
|
/** One row of the operator-visible *Currently admitted* list. */
|
|
46
47
|
export interface HostGateAdmittedRow {
|
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
* Added by change: doctor-rich-output.
|
|
8
8
|
*/
|
|
9
9
|
export * from "./doctor-core.js";
|
|
10
|
-
export
|
|
11
|
-
export { isValidRoleName } from "./role-name-validation.js";
|
|
12
|
-
export type { RoleNameValidation } from "./role-name-validation.js";
|
|
13
|
-
export type { ViewTarget } from "./types.js";
|
|
10
|
+
export type { FileKind, FileKindResult, ViewerKind } from "./file-kind.js";
|
|
14
11
|
export {
|
|
15
12
|
fileKind,
|
|
16
|
-
TEXT_EXTENSIONS,
|
|
17
13
|
IMAGE_EXTENSIONS,
|
|
14
|
+
TEXT_EXTENSIONS,
|
|
18
15
|
} from "./file-kind.js";
|
|
19
|
-
export
|
|
16
|
+
export * from "./node-version.js";
|
|
17
|
+
export type { RoleNameValidation } from "./role-name-validation.js";
|
|
18
|
+
export { isValidRoleName } from "./role-name-validation.js";
|
|
19
|
+
export { toolWorkdir } from "./tool-workdir.js";
|
|
20
|
+
export type { ViewTarget } from "./types.js";
|