@timurproko/a1 0.1.8-dev.3b54f21 → 0.1.8-dev.407
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/README.md +159 -65
- package/bin/cli.js +28 -10
- package/bin/guardian.js +12 -6
- package/bin/module-identity.js +69 -35
- package/bin/pi-tui.d.ts +6 -0
- package/bin/pi-tui.js +28 -0
- package/bin/release-cleanup.js +8 -0
- package/bin/supervisor.js +2 -2
- package/bin/sync-pi-tui-proxy.js +97 -0
- package/bin/ui.js +62 -21
- package/bin/update-recovery.js +274 -0
- package/bin/warmup.js +27 -0
- package/dist/cli/capabilities.d.ts +6 -0
- package/dist/{src/cli → cli}/capabilities.js +1 -1
- package/dist/{src/cli → cli}/dispatch.d.ts +15 -1
- package/dist/cli/dispatch.js +261 -0
- package/dist/cli/package-messages.d.ts +26 -0
- package/dist/cli/package-messages.js +71 -0
- package/dist/{src/cli → cli}/packages.d.ts +11 -2
- package/dist/{src/cli → cli}/packages.js +24 -27
- package/dist/{src/cli → cli}/version-stats.d.ts +6 -0
- package/dist/cli/version-stats.js +112 -0
- package/dist/composition/agent-engine-bridge.d.ts +3 -0
- package/dist/composition/agent-engine-bridge.js +108 -0
- package/dist/composition/index.d.ts +3 -0
- package/dist/composition/index.js +3 -0
- package/dist/composition/owned-ui.d.ts +35 -0
- package/dist/composition/owned-ui.js +118 -0
- package/dist/composition/process.d.ts +16 -0
- package/dist/composition/process.js +45 -0
- package/dist/composition/settings-route-host.d.ts +8 -0
- package/dist/composition/settings-route-host.js +75 -0
- package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/capability-ports.d.ts +2 -2
- package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain-validation.js +22 -4
- package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain.d.ts +17 -0
- package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/package-ports.d.ts +6 -0
- package/dist/contracts/owned-ui/image-attachments.d.ts +36 -0
- package/dist/contracts/owned-ui/image-attachments.js +67 -0
- package/dist/contracts/owned-ui/index.d.ts +8 -0
- package/dist/contracts/owned-ui/index.js +8 -0
- package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/model.d.ts +123 -0
- package/dist/contracts/owned-ui/prompt-history.d.ts +55 -0
- package/dist/contracts/owned-ui/prompt-history.js +23 -0
- package/dist/contracts/owned-ui/prompt-suggestions.d.ts +3 -0
- package/dist/contracts/owned-ui/prompt-suggestions.js +44 -0
- package/dist/contracts/owned-ui/suggestion-diagnostics.d.ts +22 -0
- package/dist/contracts/owned-ui/suggestion-diagnostics.js +9 -0
- package/dist/contracts/owned-ui/transcript-lifecycle.d.ts +5 -0
- package/dist/contracts/owned-ui/transcript-lifecycle.js +33 -0
- package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/validation.d.ts +5 -1
- package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/validation.js +129 -4
- package/dist/{src/foundation/presentation-contracts → contracts/presentation}/index.d.ts +8 -0
- package/dist/{src/features → features}/launch/development-launch.js +11 -3
- package/dist/{src/features → features}/launch/index.d.ts +0 -1
- package/dist/{src/features → features}/launch/index.js +0 -1
- package/dist/features/launch/intent.d.ts +10 -0
- package/dist/features/launch/intent.js +8 -0
- package/dist/{src/features → features}/launch/prepare-launch.d.ts +0 -2
- package/dist/{src/features → features}/launch/prepare-launch.js +2 -9
- package/dist/{src/features → features}/launch/profile-paths.d.ts +3 -2
- package/dist/{src/features → features}/launch/profile-paths.js +13 -8
- package/dist/{src/features → features}/launch/runtime-selection.d.ts +2 -5
- package/dist/{src/features → features}/owned-ui/customization.d.ts +3 -1
- package/dist/{src/features → features}/owned-ui/customization.js +3 -1
- package/dist/{src/features → features}/owned-ui/diagnostics.d.ts +2 -1
- package/dist/{src/features → features}/owned-ui/diagnostics.js +1 -0
- package/dist/{src/features → features}/owned-ui/index.d.ts +2 -0
- package/dist/{src/features → features}/owned-ui/index.js +2 -0
- package/dist/features/owned-ui/project-trust-prompt.d.ts +25 -0
- package/dist/features/owned-ui/project-trust-prompt.js +149 -0
- package/dist/{src/features → features}/owned-ui/run.d.ts +2 -2
- package/dist/features/owned-ui/run.js +32 -0
- package/dist/features/owned-ui/session-fork-prompt.d.ts +8 -0
- package/dist/features/owned-ui/session-fork-prompt.js +34 -0
- package/dist/{src/features → features}/owned-ui/settings-app.d.ts +3 -3
- package/dist/{src/features → features}/owned-ui/settings-app.js +105 -56
- package/dist/features/prompt-history/image-sidecar.d.ts +32 -0
- package/dist/features/prompt-history/image-sidecar.js +130 -0
- package/dist/features/prompt-history/index.d.ts +4 -0
- package/dist/features/prompt-history/index.js +3 -0
- package/dist/features/prompt-history/paths.d.ts +5 -0
- package/dist/features/prompt-history/paths.js +17 -0
- package/dist/features/prompt-history/service.d.ts +54 -0
- package/dist/features/prompt-history/service.js +425 -0
- package/dist/features/prompt-history/store.d.ts +16 -0
- package/dist/features/prompt-history/store.js +223 -0
- package/dist/features/prompt-history/worker.d.ts +9 -0
- package/dist/features/prompt-history/worker.js +45 -0
- package/dist/features/prompt-suggestions/diagnostics.d.ts +18 -0
- package/dist/features/prompt-suggestions/diagnostics.js +82 -0
- package/dist/features/prompt-suggestions/index.d.ts +1 -0
- package/dist/features/prompt-suggestions/index.js +1 -0
- package/dist/{src/features → features}/workspace/capabilities.d.ts +1 -1
- package/dist/{src/features → features}/workspace/reducer.d.ts +2 -1
- package/dist/{src/features → features}/workspace/reducer.js +2 -1
- package/dist/{src/features → features}/workspace/router.d.ts +2 -1
- package/dist/{src/features → features}/workspace/router.js +1 -0
- package/dist/{src/features → features}/workspace/store.d.ts +2 -1
- package/dist/{src/features → features}/workspace/store.js +1 -0
- package/dist/foundation/launch-context/index.d.ts +59 -0
- package/dist/foundation/launch-context/index.js +136 -0
- package/dist/{src/foundation → foundation}/launch-guardian/main.d.ts +2 -0
- package/dist/{src/foundation → foundation}/launch-guardian/main.js +23 -8
- package/dist/{src/foundation → foundation}/lifecycle/index.d.ts +2 -0
- package/dist/{src/foundation → foundation}/lifecycle/index.js +2 -0
- package/dist/{src/foundation → foundation}/lifecycle/model.d.ts +1 -1
- package/dist/{src/foundation → foundation}/lifecycle/model.js +1 -1
- package/dist/foundation/lifecycle/paths.d.ts +30 -0
- package/dist/{src/foundation → foundation}/lifecycle/paths.js +29 -1
- package/dist/foundation/lifecycle/session-selection.d.ts +9 -0
- package/dist/foundation/lifecycle/session-selection.js +39 -0
- package/dist/foundation/lifecycle/supervisor-startup.d.ts +30 -0
- package/dist/foundation/lifecycle/supervisor-startup.js +106 -0
- package/dist/{src/foundation → foundation}/native-host-protocol/codec.d.ts +2 -0
- package/dist/{src/foundation → foundation}/native-host-protocol/codec.js +2 -0
- package/dist/{src/foundation → foundation}/native-host-protocol/messages.d.ts +1 -1
- package/dist/{src/foundation → foundation}/native-host-protocol/messages.js +1 -1
- package/dist/foundation/process-containment/darwin-process-inspector.d.ts +5 -0
- package/dist/foundation/process-containment/darwin-process-inspector.js +7 -0
- package/dist/{src/foundation → foundation}/process-containment/index.d.ts +1 -0
- package/dist/{src/foundation → foundation}/process-containment/index.js +1 -0
- package/dist/{src/foundation → foundation}/process-containment/linux-process-inspector.d.ts +1 -0
- package/dist/{src/foundation → foundation}/process-containment/linux-process-inspector.js +1 -0
- package/dist/{src/foundation → foundation}/process-containment/native-guardian-containment.d.ts +1 -0
- package/dist/{src/foundation → foundation}/process-containment/native-guardian-containment.js +1 -0
- package/dist/{src/foundation → foundation}/process-containment/windows-process-inspector.d.ts +3 -1
- package/dist/{src/foundation → foundation}/process-containment/windows-process-inspector.js +5 -2
- package/dist/{src/foundation → foundation}/protocol/client.d.ts +1 -0
- package/dist/{src/foundation → foundation}/protocol/client.js +1 -0
- package/dist/{src/foundation → foundation}/protocol/messages.d.ts +1 -0
- package/dist/{src/foundation → foundation}/protocol/messages.js +1 -0
- package/dist/foundation/release/bootstrap.d.ts +55 -0
- package/dist/{src/foundation → foundation}/release/bootstrap.js +219 -46
- package/dist/foundation/release/cohort-state.d.ts +157 -0
- package/dist/foundation/release/cohort-state.js +472 -0
- package/dist/foundation/release/dependency-certification-retention.d.ts +7 -0
- package/dist/foundation/release/dependency-certification-retention.js +88 -0
- package/dist/foundation/release/dependency-certification.d.ts +24 -0
- package/dist/foundation/release/dependency-certification.js +266 -0
- package/dist/foundation/release/dependency-layer.d.ts +81 -0
- package/dist/foundation/release/dependency-layer.js +466 -0
- package/dist/foundation/release/endpoints.d.ts +20 -0
- package/dist/foundation/release/endpoints.js +50 -0
- package/dist/foundation/release/immutable-platform.d.ts +6 -0
- package/dist/foundation/release/immutable-platform.js +13 -0
- package/dist/{src/foundation → foundation}/release/index.d.ts +6 -0
- package/dist/{src/foundation → foundation}/release/index.js +6 -0
- package/dist/foundation/release/release-gc.d.ts +71 -0
- package/dist/foundation/release/release-gc.js +764 -0
- package/dist/{src/foundation → foundation}/release/release-store.d.ts +9 -3
- package/dist/{src/foundation → foundation}/release/release-store.js +74 -14
- package/dist/{src/foundation → foundation}/release/release.d.ts +6 -1
- package/dist/{src/foundation → foundation}/release/release.js +15 -4
- package/dist/foundation/release/restart-certification.d.ts +68 -0
- package/dist/foundation/release/restart-certification.js +227 -0
- package/dist/foundation/release/update-launch.d.ts +6 -0
- package/dist/foundation/release/update-launch.js +17 -0
- package/dist/foundation/release/update-recovery.d.ts +76 -0
- package/dist/foundation/release/update-recovery.js +356 -0
- package/dist/{src/foundation → foundation}/release/update-transaction.d.ts +11 -0
- package/dist/{src/foundation → foundation}/release/update-transaction.js +13 -1
- package/dist/{src/foundation → foundation}/release/update.d.ts +40 -4
- package/dist/{src/foundation → foundation}/release/update.js +196 -78
- package/dist/foundation/release/warmup.d.ts +3 -0
- package/dist/foundation/release/warmup.js +47 -0
- package/dist/foundation/startup/index.d.ts +1 -0
- package/dist/foundation/startup/index.js +1 -0
- package/dist/foundation/startup/startup-runtime.d.ts +36 -0
- package/dist/foundation/startup/startup-runtime.js +142 -0
- package/dist/{src/foundation → foundation}/storage/control-store.d.ts +2 -1
- package/dist/{src/foundation → foundation}/storage/control-store.js +39 -4
- package/dist/{src/foundation → foundation}/structured-agent-runtime/backpressure.d.ts +2 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/backpressure.js +2 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/commands.d.ts +2 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/commands.js +2 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/handshake.d.ts +1 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/handshake.js +1 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/reconnection.d.ts +2 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/reconnection.js +2 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/state.d.ts +2 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/state.js +2 -1
- package/dist/foundation/supervision/index.d.ts +3 -0
- package/dist/foundation/supervision/index.js +3 -0
- package/dist/foundation/supervision/main.d.ts +1 -0
- package/dist/foundation/supervision/main.js +84 -0
- package/dist/foundation/supervision/paths.d.ts +1 -0
- package/dist/foundation/supervision/paths.js +1 -0
- package/dist/foundation/supervision/server.d.ts +51 -0
- package/dist/{src/foundation → foundation}/supervision/server.js +142 -20
- package/dist/foundation/terminal-cleanup/fatal-exit.d.ts +12 -0
- package/dist/foundation/terminal-cleanup/fatal-exit.js +85 -0
- package/dist/foundation/terminal-cleanup/index.d.ts +2 -0
- package/dist/foundation/terminal-cleanup/index.js +2 -0
- package/dist/foundation/terminal-cleanup/terminal-reset.d.ts +4 -0
- package/dist/foundation/terminal-cleanup/terminal-reset.js +40 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/components.d.ts +1 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/conformance.d.ts +1 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/conformance.js +3 -2
- package/dist/integrations/pi/components/editor-interaction.d.ts +38 -0
- package/dist/integrations/pi/components/history-editor-loader.d.ts +5 -0
- package/dist/integrations/pi/components/history-editor-loader.js +5 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/index.d.ts +2 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/index.js +2 -1
- package/dist/integrations/pi/components/owned-editor-ux.d.ts +74 -0
- package/dist/integrations/pi/components/owned-editor-ux.js +1093 -0
- package/dist/integrations/pi/components/path-word-ranges.d.ts +2 -0
- package/dist/integrations/pi/components/path-word-ranges.js +37 -0
- package/dist/integrations/pi/components/prompt-input-port.d.ts +18 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-components.d.ts +1 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-components.js +1 -0
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +297 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-extension-ui.d.ts +1 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-footer-status.d.ts +4 -4
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-footer-status.js +58 -23
- package/dist/integrations/pi/components/shell-presenters-info.d.ts +43 -0
- package/dist/integrations/pi/components/shell-presenters-info.js +114 -0
- package/dist/integrations/pi/components/shell-presenters-transcript.d.ts +29 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-presenters-transcript.js +174 -170
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-selectors-dialogs.d.ts +8 -4
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-selectors-dialogs.js +10 -6
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +213 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-shared-facade.js +5 -2
- package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +15 -0
- package/dist/integrations/pi/components/submitted-prompt-adapter.js +43 -0
- package/dist/integrations/pi/components/tool-image-presentation.d.ts +21 -0
- package/dist/integrations/pi/components/tool-image-presentation.js +86 -0
- package/dist/integrations/pi/components/tool-result-adapter.d.ts +6 -0
- package/dist/integrations/pi/components/tool-result-adapter.js +27 -0
- package/dist/integrations/pi/components/transcript-image-resolver.d.ts +7 -0
- package/dist/integrations/pi/components/transcript-image-resolver.js +19 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/adjacent/core/keybindings.d.ts +11 -2
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/adjacent/core/keybindings.js +41 -3
- package/dist/integrations/pi/components/upstream/assets/earendil-image.json +12 -0
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +42 -0
- package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +40 -0
- package/dist/integrations/pi/components/upstream/components/owned-editor.js +166 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/scoped-models-selector.d.ts +1 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/scoped-models-selector.js +3 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-footer.d.ts +3 -2
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-footer.js +12 -7
- package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +61 -0
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +344 -0
- package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +280 -0
- package/dist/integrations/pi/components/upstream/history/editor-core.js +2062 -0
- package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +32 -0
- package/dist/integrations/pi/components/upstream/history/kill-ring.js +48 -0
- package/dist/integrations/pi/components/upstream/history/printable-key.d.ts +1 -0
- package/dist/integrations/pi/components/upstream/history/printable-key.js +40 -0
- package/dist/integrations/pi/components/upstream/history/text-helpers.d.ts +14 -0
- package/dist/integrations/pi/components/upstream/history/text-helpers.js +28 -0
- package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +22 -0
- package/dist/integrations/pi/components/upstream/history/undo-stack.js +36 -0
- package/dist/integrations/pi/components/upstream/history/word-navigation.d.ts +24 -0
- package/dist/integrations/pi/components/upstream/history/word-navigation.js +100 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/adapter.d.ts +74 -6
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/adapter.js +1340 -228
- package/dist/integrations/pi/engine/changelog.d.ts +2 -0
- package/dist/integrations/pi/engine/changelog.js +63 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/conformance.d.ts +4 -2
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/conformance.js +15 -5
- package/dist/integrations/pi/engine/http-dispatcher.d.ts +4 -0
- package/dist/integrations/pi/engine/http-dispatcher.js +25 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/index.d.ts +4 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/index.js +4 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/model-auth-integration.d.ts +2 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/model-auth-integration.js +1 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/package-integration.d.ts +1 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/package-integration.js +32 -26
- package/dist/integrations/pi/engine/pending-delivery.d.ts +30 -0
- package/dist/integrations/pi/engine/pending-delivery.js +158 -0
- package/dist/integrations/pi/engine/project-trust-preflight.d.ts +22 -0
- package/dist/integrations/pi/engine/project-trust-preflight.js +50 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/resource-extension-integration.d.ts +2 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/resource-extension-integration.js +1 -0
- package/dist/integrations/pi/engine/resources/changelog.json +12 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/runtime-integration.d.ts +19 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/runtime-integration.js +56 -5
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/session-integration.d.ts +4 -2
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/session-integration.js +19 -4
- package/dist/integrations/pi/engine/session-selection.d.ts +28 -0
- package/dist/integrations/pi/engine/session-selection.js +90 -0
- package/dist/integrations/pi/engine/settings-effects.d.ts +66 -0
- package/dist/integrations/pi/engine/settings-effects.js +249 -0
- package/dist/integrations/pi/engine/settings-integration.d.ts +43 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/settings-integration.js +102 -108
- package/dist/integrations/pi/engine/tool-rendering.d.ts +13 -0
- package/dist/integrations/pi/engine/tool-rendering.js +145 -0
- package/dist/integrations/pi/engine/transcript-image-assets.d.ts +11 -0
- package/dist/integrations/pi/engine/transcript-image-assets.js +86 -0
- package/dist/integrations/pi/engine/windows-filesystem-hygiene.d.ts +21 -0
- package/dist/integrations/pi/engine/windows-filesystem-hygiene.js +55 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflow-controllers.d.ts +3 -2
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflow-controllers.js +1 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflows.d.ts +19 -2
- package/dist/integrations/pi/session-ui/clipboard-diagnostics.d.ts +16 -0
- package/dist/integrations/pi/session-ui/clipboard-diagnostics.js +65 -0
- package/dist/integrations/pi/session-ui/clipboard-image.d.ts +11 -0
- package/dist/integrations/pi/session-ui/clipboard-image.js +38 -0
- package/dist/integrations/pi/session-ui/editor-hyperlink-budget.d.ts +9 -0
- package/dist/integrations/pi/session-ui/editor-hyperlink-budget.js +23 -0
- package/dist/integrations/pi/session-ui/image-preparation-client.d.ts +20 -0
- package/dist/integrations/pi/session-ui/image-preparation-client.js +145 -0
- package/dist/integrations/pi/session-ui/image-preparation.d.ts +18 -0
- package/dist/integrations/pi/session-ui/image-preparation.js +126 -0
- package/dist/integrations/pi/session-ui/image-source.d.ts +13 -0
- package/dist/integrations/pi/session-ui/image-source.js +171 -0
- package/dist/integrations/pi/session-ui/image-worker.d.ts +17 -0
- package/dist/integrations/pi/session-ui/image-worker.js +23 -0
- package/dist/integrations/pi/session-ui/index.d.ts +5 -0
- package/dist/integrations/pi/session-ui/index.js +5 -0
- package/dist/integrations/pi/session-ui/paste-executor.d.ts +10 -0
- package/dist/integrations/pi/session-ui/paste-executor.js +232 -0
- package/dist/integrations/pi/session-ui/paste-helper.d.ts +1 -0
- package/dist/integrations/pi/session-ui/paste-helper.js +173 -0
- package/dist/integrations/pi/session-ui/paste-preparation-client.d.ts +16 -0
- package/dist/integrations/pi/session-ui/paste-preparation-client.js +159 -0
- package/dist/integrations/pi/session-ui/paste-protocol.d.ts +78 -0
- package/dist/integrations/pi/session-ui/paste-protocol.js +18 -0
- package/dist/integrations/pi/session-ui/paste-text-preparation.d.ts +20 -0
- package/dist/integrations/pi/session-ui/paste-text-preparation.js +134 -0
- package/dist/integrations/pi/session-ui/paste-text-worker.d.ts +1 -0
- package/dist/integrations/pi/session-ui/paste-text-worker.js +12 -0
- package/dist/integrations/pi/session-ui/path-chip-presentation.d.ts +7 -0
- package/dist/integrations/pi/session-ui/path-chip-presentation.js +24 -0
- package/dist/integrations/pi/session-ui/prompt-chips.d.ts +72 -0
- package/dist/integrations/pi/session-ui/prompt-chips.js +503 -0
- package/dist/integrations/pi/session-ui/prompt-history-controller.d.ts +36 -0
- package/dist/integrations/pi/session-ui/prompt-history-controller.js +170 -0
- package/dist/integrations/pi/session-ui/prompt-suggestion-controller.d.ts +35 -0
- package/dist/integrations/pi/session-ui/prompt-suggestion-controller.js +207 -0
- package/dist/integrations/pi/session-ui/response-copy-coordinator.d.ts +27 -0
- package/dist/integrations/pi/session-ui/response-copy-coordinator.js +189 -0
- package/dist/integrations/pi/session-ui/response-copy-helper.d.ts +1 -0
- package/dist/integrations/pi/session-ui/response-copy-helper.js +122 -0
- package/dist/integrations/pi/session-ui/response-copy-protocol.d.ts +56 -0
- package/dist/integrations/pi/session-ui/response-copy-protocol.js +5 -0
- package/dist/integrations/pi/session-ui/response-copy-transport.d.ts +31 -0
- package/dist/integrations/pi/session-ui/response-copy-transport.js +187 -0
- package/dist/integrations/pi/session-ui/route-host.d.ts +5 -0
- package/dist/integrations/pi/session-ui/route-host.js +1 -0
- package/dist/integrations/pi/session-ui/session-shell-root.d.ts +221 -0
- package/dist/integrations/pi/session-ui/session-shell-root.js +1305 -0
- package/dist/integrations/pi/session-ui/session-shell.d.ts +55 -0
- package/dist/integrations/pi/session-ui/session-shell.js +1792 -0
- package/dist/integrations/pi/session-ui/session-viewport-controller.d.ts +56 -0
- package/dist/integrations/pi/session-ui/session-viewport-controller.js +569 -0
- package/dist/integrations/pi/session-ui/stream-presentation-coalescer.d.ts +29 -0
- package/dist/integrations/pi/session-ui/stream-presentation-coalescer.js +79 -0
- package/dist/integrations/pi/session-ui/system-clipboard.d.ts +20 -0
- package/dist/integrations/pi/session-ui/system-clipboard.js +156 -0
- package/dist/integrations/pi/session-ui/text-paste.d.ts +5 -0
- package/dist/integrations/pi/session-ui/text-paste.js +16 -0
- package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/adapter.d.ts +10 -1
- package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/adapter.js +255 -11
- package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/contracts.d.ts +32 -6
- package/dist/integrations/pi/tui-runtime/contracts.js +1 -0
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +81 -0
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +424 -0
- package/dist/integrations/pi/tui-runtime/index.d.ts +7 -0
- package/dist/integrations/pi/tui-runtime/index.js +7 -0
- package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.d.ts +39 -0
- package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.js +139 -0
- package/dist/integrations/pi/tui-runtime/mouse-report-input.d.ts +13 -0
- package/dist/integrations/pi/tui-runtime/mouse-report-input.js +59 -0
- package/dist/integrations/pi/tui-runtime/overlay-geometry.d.ts +32 -0
- package/dist/integrations/pi/tui-runtime/overlay-geometry.js +159 -0
- package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/presentation-adapter.d.ts +1 -1
- package/dist/native/darwin-arm64/manifest.json +4 -4
- package/dist/native/darwin-arm64/process-guardian +0 -0
- package/dist/native/linux-x64/manifest.json +3 -3
- package/dist/native/linux-x64/process-guardian +0 -0
- package/dist/native/win32-x64/manifest.json +3 -3
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/{src/product-identity.d.ts → product-identity.d.ts} +4 -4
- package/dist/{src/product-identity.js → product-identity.js} +7 -38
- package/dist/{src/product-identity.json → product-identity.json} +13 -27
- package/dist/runtime-payload-inventory.json +122333 -0
- package/dist/{src/foundation/ui-apps → ui/apps}/contracts.d.ts +23 -1
- package/dist/{src/foundation/ui-apps → ui/apps}/host.d.ts +1 -1
- package/dist/{src/foundation/ui-apps → ui/apps}/host.js +14 -10
- package/dist/{src/foundation/ui-apps → ui/apps}/registry.d.ts +1 -0
- package/dist/{src/foundation/ui-apps → ui/apps}/registry.js +1 -0
- package/dist/{src/foundation/ui-components → ui/components}/dialog-panel.js +5 -3
- package/dist/{src/foundation/ui-components → ui/components}/frame.d.ts +1 -0
- package/dist/{src/foundation/ui-components → ui/components}/frame.js +1 -0
- package/dist/{src/foundation/ui-components → ui/components}/index.d.ts +7 -0
- package/dist/{src/foundation/ui-components → ui/components}/index.js +7 -0
- package/dist/{src/foundation/ui-components → ui/components}/line-input.d.ts +2 -8
- package/dist/{src/foundation/ui-components → ui/components}/line-input.js +7 -28
- package/dist/{src/foundation/ui-components → ui/components}/list-view.d.ts +0 -6
- package/dist/{src/foundation/ui-components → ui/components}/list-view.js +14 -7
- package/dist/{src/foundation/ui-components → ui/components}/mouse.d.ts +10 -0
- package/dist/{src/foundation/ui-components → ui/components}/mouse.js +24 -0
- package/dist/ui/components/progress-status.d.ts +2 -0
- package/dist/ui/components/progress-status.js +4 -0
- package/dist/ui/components/prompt-input.d.ts +32 -0
- package/dist/ui/components/prompt-input.js +54 -0
- package/dist/ui/components/prompt-row.d.ts +14 -0
- package/dist/ui/components/prompt-row.js +20 -0
- package/dist/{src/foundation/ui-components → ui/components}/scrollbar.d.ts +26 -0
- package/dist/{src/foundation/ui-components → ui/components}/scrollbar.js +35 -0
- package/dist/ui/components/selection-copy.d.ts +24 -0
- package/dist/ui/components/selection-copy.js +39 -0
- package/dist/{src/foundation/ui-components → ui/components}/shortcuts.d.ts +1 -0
- package/dist/{src/foundation/ui-components → ui/components}/shortcuts.js +1 -0
- package/dist/ui/components/spans.d.ts +28 -0
- package/dist/ui/components/spans.js +266 -0
- package/dist/ui/components/submitted-prompt.d.ts +23 -0
- package/dist/ui/components/submitted-prompt.js +50 -0
- package/dist/{src/foundation/ui-components → ui/components}/surface.d.ts +0 -5
- package/dist/{src/foundation/ui-components → ui/components}/surface.js +1 -5
- package/dist/ui/components/text-selection.d.ts +62 -0
- package/dist/ui/components/text-selection.js +210 -0
- package/dist/{src/foundation/ui-components → ui/components}/text.d.ts +14 -0
- package/dist/{src/foundation/ui-components → ui/components}/text.js +67 -5
- package/dist/ui/components/transcript-viewport.d.ts +173 -0
- package/dist/ui/components/transcript-viewport.js +753 -0
- package/dist/ui/components/visible-hyperlinks.d.ts +26 -0
- package/dist/ui/components/visible-hyperlinks.js +97 -0
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/declarations.d.ts +8 -1
- package/dist/ui/settings/declarations.js +94 -0
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/migrations.d.ts +1 -1
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/migrations.js +28 -2
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/sections.d.ts +6 -19
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/sections.js +41 -22
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/session.d.ts +9 -17
- package/dist/ui/settings/session.js +164 -0
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/store.d.ts +1 -0
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/store.js +2 -1
- package/docs/architecture/boundaries.md +14 -10
- package/docs/architecture/code-documentation.md +77 -0
- package/docs/architecture/history-editor-provenance.md +100 -0
- package/docs/architecture/internal-naming.md +91 -0
- package/docs/architecture/process-guardian-provenance.md +3 -1
- package/docs/architecture/project-structure.md +69 -30
- package/docs/architecture/prompt-suggestions.md +68 -0
- package/docs/architecture/resource-and-data-policy.md +28 -2
- package/docs/architecture/response-copy-delivery.md +83 -0
- package/docs/architecture/tool-image-presentation.md +62 -0
- package/docs/architecture/toolchain.md +24 -10
- package/docs/architecture/ui-reference-provenance.md +59 -5
- package/docs/ci-release-runbook.md +236 -79
- package/docs/features/launch-profiles.md +24 -17
- package/docs/features/modal-content-interaction.md +37 -0
- package/docs/features/prompt-history.md +149 -0
- package/docs/local-worktree-cleanup.md +128 -0
- package/docs/manual-code-streaming-cleanup.md +88 -0
- package/docs/manual-ghost-link-baseline.md +89 -0
- package/docs/manual-launch-instance-acceptance.md +12 -35
- package/docs/manual-owned-ui-checkpoint.md +78 -0
- package/docs/manual-pi-boundary-candidate.md +4 -5
- package/docs/manual-terminal-colour-check.md +4 -3
- package/docs/openspec-archive-automation.md +128 -0
- package/docs/repository-governance-live-acceptance.md +77 -0
- package/package.json +45 -28
- package/dist/src/cli/capabilities.d.ts +0 -15
- package/dist/src/cli/dispatch.js +0 -142
- package/dist/src/cli/version-stats.js +0 -72
- package/dist/src/composition/index.d.ts +0 -48
- package/dist/src/composition/index.js +0 -258
- package/dist/src/features/launch/intent.d.ts +0 -7
- package/dist/src/features/launch/intent.js +0 -4
- package/dist/src/features/launch/profiles.d.ts +0 -12
- package/dist/src/features/launch/profiles.js +0 -26
- package/dist/src/features/owned-ui/run.js +0 -15
- package/dist/src/foundation/lifecycle/paths.d.ts +0 -10
- package/dist/src/foundation/owned-ui-contracts/index.d.ts +0 -3
- package/dist/src/foundation/owned-ui-contracts/index.js +0 -3
- package/dist/src/foundation/owned-ui-settings/declarations.js +0 -39
- package/dist/src/foundation/owned-ui-settings/session.js +0 -145
- package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.js +0 -162
- package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.d.ts +0 -57
- package/dist/src/foundation/pi-component-adapter/shell-shared-facade.d.ts +0 -116
- package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.js +0 -19
- package/dist/src/foundation/pi-component-adapter/upstream/components/owned-editor.d.ts +0 -18
- package/dist/src/foundation/pi-component-adapter/upstream/components/owned-editor.js +0 -55
- package/dist/src/foundation/pi-engine-adapter/settings-integration.d.ts +0 -55
- package/dist/src/foundation/pi-owned-ui-integration/index.d.ts +0 -2
- package/dist/src/foundation/pi-owned-ui-integration/index.js +0 -2
- package/dist/src/foundation/pi-owned-ui-integration/route-host.d.ts +0 -29
- package/dist/src/foundation/pi-owned-ui-integration/session-shell.d.ts +0 -106
- package/dist/src/foundation/pi-owned-ui-integration/session-shell.js +0 -1518
- package/dist/src/foundation/pi-tui-runtime-adapter/index.d.ts +0 -4
- package/dist/src/foundation/pi-tui-runtime-adapter/index.js +0 -4
- package/dist/src/foundation/release/bootstrap.d.ts +0 -29
- package/dist/src/foundation/release/cohort-state.d.ts +0 -70
- package/dist/src/foundation/release/cohort-state.js +0 -202
- package/dist/src/foundation/release/release-gc.d.ts +0 -5
- package/dist/src/foundation/release/release-gc.js +0 -16
- package/dist/src/foundation/supervision/index.d.ts +0 -3
- package/dist/src/foundation/supervision/index.js +0 -3
- package/dist/src/foundation/supervision/main.d.ts +0 -1
- package/dist/src/foundation/supervision/main.js +0 -41
- package/dist/src/foundation/supervision/paths.d.ts +0 -1
- package/dist/src/foundation/supervision/paths.js +0 -1
- package/dist/src/foundation/supervision/server.d.ts +0 -22
- package/dist/src/foundation/ui-components/spans.d.ts +0 -7
- package/dist/src/foundation/ui-components/spans.js +0 -59
- package/docs/manual-transparent-checkpoint.md +0 -53
- /package/dist/{src/cli → cli}/index.d.ts +0 -0
- /package/dist/{src/cli → cli}/index.js +0 -0
- /package/dist/{src/cli → cli}/version.d.ts +0 -0
- /package/dist/{src/cli → cli}/version.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/capability-ports.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain-validation.d.ts +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/index.d.ts +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/index.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/model.d.ts +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/model.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/package-ports.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/ports.d.ts +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/ports.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/serialization.d.ts +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/serialization.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/validation.d.ts +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/validation.js +0 -0
- /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/extension-ui.d.ts +0 -0
- /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/extension-ui.js +0 -0
- /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/model.js +0 -0
- /package/dist/{src/foundation/presentation-contracts → contracts/presentation}/index.js +0 -0
- /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/index.d.ts +0 -0
- /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/index.js +0 -0
- /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/model.d.ts +0 -0
- /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/model.js +0 -0
- /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/validation.d.ts +0 -0
- /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/validation.js +0 -0
- /package/dist/{src/features → features}/launch/development-launch.d.ts +0 -0
- /package/dist/{src/features → features}/launch/initialize-profile.d.ts +0 -0
- /package/dist/{src/features → features}/launch/initialize-profile.js +0 -0
- /package/dist/{src/features → features}/launch/runtime-selection.js +0 -0
- /package/dist/{src/features → features}/workspace/capabilities.js +0 -0
- /package/dist/{src/features → features}/workspace/index.d.ts +0 -0
- /package/dist/{src/features → features}/workspace/index.js +0 -0
- /package/dist/{src/features → features}/workspace/presentation.d.ts +0 -0
- /package/dist/{src/features → features}/workspace/presentation.js +0 -0
- /package/dist/{src/features → features}/workspace/reconciliation.d.ts +0 -0
- /package/dist/{src/features → features}/workspace/reconciliation.js +0 -0
- /package/dist/{src/foundation → foundation}/launch-guardian/index.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/launch-guardian/index.js +0 -0
- /package/dist/{src/foundation → foundation}/lifecycle/commands.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/lifecycle/commands.js +0 -0
- /package/dist/{src/foundation → foundation}/lifecycle/launch-instance.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/lifecycle/launch-instance.js +0 -0
- /package/dist/{src/foundation → foundation}/native-host-protocol/evidence.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/native-host-protocol/evidence.js +0 -0
- /package/dist/{src/foundation → foundation}/native-host-protocol/index.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/native-host-protocol/index.js +0 -0
- /package/dist/{src/foundation → foundation}/native-host-protocol/proof-gate.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/native-host-protocol/proof-gate.js +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/artifact.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/artifact.js +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/contracts.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/contracts.js +0 -0
- /package/dist/{src/foundation → foundation}/protocol/index.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/protocol/index.js +0 -0
- /package/dist/{src/foundation → foundation}/release/cohort-selection.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/release/cohort-selection.js +0 -0
- /package/dist/{src/foundation → foundation}/release/concurrency.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/release/concurrency.js +0 -0
- /package/dist/{src/foundation → foundation}/release/process-cleanup.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/release/process-cleanup.js +0 -0
- /package/dist/{src/foundation → foundation}/release/stable-release.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/release/stable-release.js +0 -0
- /package/dist/{src/foundation → foundation}/storage/index.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/storage/index.js +0 -0
- /package/dist/{src/foundation → foundation}/structured-agent-runtime/index.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/structured-agent-runtime/index.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/components.js +0 -0
- /package/dist/{src/foundation/pi-owned-ui-integration/route-host.js → integrations/pi/components/editor-interaction.js} +0 -0
- /package/dist/{src/foundation/pi-tui-runtime-adapter/contracts.js → integrations/pi/components/prompt-input-port.js} +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/resources/builtin-themes.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/resources/builtin-themes.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-editor-autocomplete.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-extension-ui.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/theme.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/theme.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/countdown-timer.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/countdown-timer.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/custom-entry.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/custom-entry.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/daxnuts.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/daxnuts.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/earendil-announcement.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/extension-editor.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/extension-editor.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/first-time-setup.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/first-time-setup.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/markdown-transform.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/markdown-transform.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/mermaid.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/mermaid.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector-search.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector-search.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/skill-invocation-message.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/skill-invocation-message.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/status-indicator.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/status-indicator.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/tree-selector.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/tree-selector.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/trust-selector.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/trust-selector.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/external-editor.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/external-editor.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/model-search.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/model-search.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme-controller.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme-controller.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme.js +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/pi-settings-metadata.json +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/public-main-entry.d.ts +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/public-main-entry.js +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflows.js +0 -0
- /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/conformance.d.ts +0 -0
- /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/conformance.js +0 -0
- /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/presentation-adapter.js +0 -0
- /package/dist/{src/foundation/ui-apps → ui/apps}/contracts.js +0 -0
- /package/dist/{src/foundation/ui-apps → ui/apps}/index.d.ts +0 -0
- /package/dist/{src/foundation/ui-apps → ui/apps}/index.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/dialog-panel.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/label.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/label.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/list-block.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/list-block.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/pane.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/pane.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/revision.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/revision.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/status-line.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/status-line.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/stepper.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/stepper.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/theme.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/theme.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/value-menu.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/value-menu.js +0 -0
- /package/dist/{src/foundation/owned-ui-settings → ui/settings}/index.d.ts +0 -0
- /package/dist/{src/foundation/owned-ui-settings → ui/settings}/index.js +0 -0
- /package/dist/{src/foundation/owned-ui-settings → ui/settings}/resolution.d.ts +0 -0
- /package/dist/{src/foundation/owned-ui-settings → ui/settings}/resolution.js +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LaunchInstanceStopIntent, LaunchProfileId, SupervisorCommand } from "../lifecycle/index.js";
|
|
2
|
+
import { type SessionSelection } from "../lifecycle/index.js";
|
|
2
3
|
import { type NativeProcessInspector, type ProcessContainment } from "../process-containment/index.js";
|
|
3
4
|
interface GuardianControl {
|
|
4
5
|
connect(endpoint: string, timeoutMs?: number): Promise<unknown>;
|
|
@@ -19,6 +20,7 @@ export interface LaunchGuardianOptions {
|
|
|
19
20
|
readonly profileId: LaunchProfileId;
|
|
20
21
|
readonly releaseRoot: string;
|
|
21
22
|
readonly uiEntry: string;
|
|
23
|
+
readonly sessionSelection?: SessionSelection;
|
|
22
24
|
readonly environment?: NodeJS.ProcessEnv;
|
|
23
25
|
readonly cwd?: string;
|
|
24
26
|
readonly helperPath?: string;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
import {
|
|
2
|
+
import { PRODUCT_TEXT } from "../../product-identity.js";
|
|
3
|
+
import { readLaunchContext } from "../launch-context/index.js";
|
|
3
4
|
import { resolve } from "node:path";
|
|
4
|
-
import { assertLaunchProfileId } from "../lifecycle/index.js";
|
|
5
|
-
import { closeVerifiedContainment, LinuxNativeProcessInspector, NativeGuardianContainment, resolveProcessGuardianPath, verifyProcessGuardianArtifact, WindowsNativeProcessInspector, } from "../process-containment/index.js";
|
|
5
|
+
import { assertLaunchProfileId, sessionSelectionArguments } from "../lifecycle/index.js";
|
|
6
|
+
import { closeVerifiedContainment, DarwinNativeProcessInspector, LinuxNativeProcessInspector, NativeGuardianContainment, resolveProcessGuardianPath, verifyProcessGuardianArtifact, WindowsNativeProcessInspector, } from "../process-containment/index.js";
|
|
6
7
|
import { SupervisorClient } from "../protocol/index.js";
|
|
7
|
-
import { resolveProductPaths } from "../supervision/index.js";
|
|
8
|
+
import { resolveCohortEndpoint, resolveProductPaths } from "../supervision/index.js";
|
|
9
|
+
import { markStartupPhase } from "../startup/index.js";
|
|
8
10
|
export async function runLaunchGuardian(options) {
|
|
9
11
|
assertLaunchProfileId(options.profileId);
|
|
12
|
+
const sessionArgs = sessionSelectionArguments(options.sessionSelection);
|
|
13
|
+
if (sessionArgs.length > 0 && options.profileId !== "a1")
|
|
14
|
+
throw new Error("session selection requires the normal A1 profile");
|
|
10
15
|
const environment = { ...(options.environment ?? process.env) };
|
|
11
16
|
const paths = resolveProductPaths(environment);
|
|
12
17
|
const instanceId = randomUUID();
|
|
@@ -16,8 +21,16 @@ export async function runLaunchGuardian(options) {
|
|
|
16
21
|
const guardianIdentity = await inspector.observe(process.pid);
|
|
17
22
|
if (!guardianIdentity)
|
|
18
23
|
throw diagnosticError("launch guardian cannot verify its own native process identity", "PROCESS_IDENTITY_UNAVAILABLE");
|
|
19
|
-
const
|
|
20
|
-
|
|
24
|
+
const context = readLaunchContext(environment);
|
|
25
|
+
const client = options.control ?? new SupervisorClient(context.releaseId);
|
|
26
|
+
// Invariant: an instance belongs to the cohort that launched it and talks to that cohort's endpoint
|
|
27
|
+
// for its whole life, whatever release becomes the active one meanwhile.
|
|
28
|
+
const releaseId = context.releaseId;
|
|
29
|
+
const endpoint = releaseId
|
|
30
|
+
? resolveCohortEndpoint(paths, releaseId, environment).endpoint
|
|
31
|
+
: paths.endpoint;
|
|
32
|
+
await client.connect(endpoint);
|
|
33
|
+
await markStartupPhase(environment, "guardian-connected");
|
|
21
34
|
const containment = options.containment ?? new NativeGuardianContainment(instanceId, helperPath, resolve(paths.runtimeDir, "launch-instances", `${instanceId}.ready.json`));
|
|
22
35
|
const stop = stopRequests(client, instanceId);
|
|
23
36
|
let rootIdentity = null;
|
|
@@ -32,7 +45,7 @@ export async function runLaunchGuardian(options) {
|
|
|
32
45
|
});
|
|
33
46
|
let handle;
|
|
34
47
|
try {
|
|
35
|
-
handle = await containment.spawn(process.execPath, [options.uiEntry], {
|
|
48
|
+
handle = await containment.spawn(process.execPath, [options.uiEntry, ...sessionArgs], {
|
|
36
49
|
cwd: options.cwd ?? process.cwd(),
|
|
37
50
|
environment: environmentEntries(environment),
|
|
38
51
|
...(environment.TERM ? { terminalType: environment.TERM } : {}),
|
|
@@ -96,6 +109,8 @@ function platformInspector(helperPath) {
|
|
|
96
109
|
return new WindowsNativeProcessInspector(helperPath);
|
|
97
110
|
if (process.platform === "linux")
|
|
98
111
|
return new LinuxNativeProcessInspector();
|
|
112
|
+
if (process.platform === "darwin")
|
|
113
|
+
return new DarwinNativeProcessInspector(helperPath);
|
|
99
114
|
throw diagnosticError(`launch-instance process containment is unsupported on ${process.platform}`, "CONTAINMENT_UNSUPPORTED");
|
|
100
115
|
}
|
|
101
116
|
function stopRequests(client, instanceId) {
|
|
@@ -161,5 +176,5 @@ function exitCode(outcome) {
|
|
|
161
176
|
return 1;
|
|
162
177
|
}
|
|
163
178
|
function diagnosticError(message, code) {
|
|
164
|
-
return Object.assign(new Error(
|
|
179
|
+
return Object.assign(new Error(`${PRODUCT_TEXT.displayName}: ${message}`), { code });
|
|
165
180
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PRODUCT_TEXT } from "../../product-identity.js";
|
|
2
2
|
export function assertLaunchProfileId(value) {
|
|
3
|
-
if (value !== "a1" && value !== "pi"
|
|
3
|
+
if (value !== "a1" && value !== "pi")
|
|
4
4
|
throw new TypeError(PRODUCT_TEXT.diagnostic(`launch profile is invalid: ${String(value)}`));
|
|
5
5
|
}
|
|
6
6
|
export function assertDimensions(dimensions) {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface ProductPaths {
|
|
2
|
+
readonly configDir: string;
|
|
3
|
+
readonly dataDir: string;
|
|
4
|
+
readonly runtimeDir: string;
|
|
5
|
+
readonly databasePath: string;
|
|
6
|
+
/** The endpoint written by releases that predate cohort-scoped identity. */
|
|
7
|
+
readonly endpoint: string;
|
|
8
|
+
/** The metadata written by releases that predate cohort-scoped identity. */
|
|
9
|
+
readonly endpointMetadataPath: string;
|
|
10
|
+
readonly endpointsDir: string;
|
|
11
|
+
/** A short, A1-managed socket directory when the host imposes a small Unix-path limit. */
|
|
12
|
+
readonly endpointDirectory?: string | null;
|
|
13
|
+
readonly supervisorLogPath: string;
|
|
14
|
+
}
|
|
15
|
+
/** Where one cohort listens, and where it records that it is listening. */
|
|
16
|
+
export interface CohortEndpointPaths {
|
|
17
|
+
readonly endpoint: string;
|
|
18
|
+
readonly endpointMetadataPath: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Endpoint identity for one release cohort. Two cohorts can be live at once — an update
|
|
22
|
+
* leaves a working session on the release it started on — so the name a supervisor listens
|
|
23
|
+
* on has to name the release as well as the runtime directory, or the two contend for one
|
|
24
|
+
* endpoint and replacing one means ending the other.
|
|
25
|
+
*
|
|
26
|
+
* An explicit endpoint override keeps its single endpoint: it is how an isolated run pins
|
|
27
|
+
* the address it is going to talk to.
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveCohortEndpoint(paths: ProductPaths, releaseId: string, environment?: NodeJS.ProcessEnv, hostPlatform?: NodeJS.Platform): CohortEndpointPaths;
|
|
30
|
+
export declare function resolveProductPaths(environment?: NodeJS.ProcessEnv, hostPlatform?: NodeJS.Platform, fallbackHome?: string): ProductPaths;
|
|
@@ -2,6 +2,26 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { homedir, platform } from "node:os";
|
|
3
3
|
import { posix, win32 } from "node:path";
|
|
4
4
|
import { PRODUCT_IDENTITY } from "../../product-identity.js";
|
|
5
|
+
/**
|
|
6
|
+
* Endpoint identity for one release cohort. Two cohorts can be live at once — an update
|
|
7
|
+
* leaves a working session on the release it started on — so the name a supervisor listens
|
|
8
|
+
* on has to name the release as well as the runtime directory, or the two contend for one
|
|
9
|
+
* endpoint and replacing one means ending the other.
|
|
10
|
+
*
|
|
11
|
+
* An explicit endpoint override keeps its single endpoint: it is how an isolated run pins
|
|
12
|
+
* the address it is going to talk to.
|
|
13
|
+
*/
|
|
14
|
+
export function resolveCohortEndpoint(paths, releaseId, environment = process.env, hostPlatform = platform()) {
|
|
15
|
+
if (environment[PRODUCT_IDENTITY.environment.endpoint]) {
|
|
16
|
+
return { endpoint: paths.endpoint, endpointMetadataPath: paths.endpointMetadataPath };
|
|
17
|
+
}
|
|
18
|
+
const path = hostPlatform === "win32" ? win32 : posix;
|
|
19
|
+
const token = createHash("sha256").update(releaseId).digest("hex").slice(0, 16);
|
|
20
|
+
const endpoint = hostPlatform === "win32"
|
|
21
|
+
? `${paths.endpoint}-${token}`
|
|
22
|
+
: path.join(paths.endpointDirectory ?? paths.runtimeDir, `${token}-${PRODUCT_IDENTITY.endpoint.unixSocketFilename}`);
|
|
23
|
+
return { endpoint, endpointMetadataPath: path.join(paths.endpointsDir, `${token}.json`) };
|
|
24
|
+
}
|
|
5
25
|
export function resolveProductPaths(environment = process.env, hostPlatform = platform(), fallbackHome = homedir()) {
|
|
6
26
|
const windows = hostPlatform === "win32";
|
|
7
27
|
const path = windows ? win32 : posix;
|
|
@@ -26,10 +46,16 @@ export function resolveProductPaths(environment = process.env, hostPlatform = pl
|
|
|
26
46
|
? path.join(environment.XDG_RUNTIME_DIR, PRODUCT_IDENTITY.state.unixControlDirectory)
|
|
27
47
|
: path.join(dataDir, "runtime")));
|
|
28
48
|
const namespace = createHash("sha256").update(runtimeDir.toLowerCase()).digest("hex").slice(0, 20);
|
|
49
|
+
// Platform: Darwin limits Unix-domain socket paths to roughly 104 bytes. Runtime roots
|
|
50
|
+
// under /var/folders can exceed that before the cohort suffix is added, so only socket
|
|
51
|
+
// files use a short owned namespace while metadata remains under the selected runtime.
|
|
52
|
+
const endpointDirectory = !endpointOverride && hostPlatform === "darwin"
|
|
53
|
+
? posix.join("/tmp", `${PRODUCT_IDENTITY.state.unixControlDirectory}-${namespace}`)
|
|
54
|
+
: null;
|
|
29
55
|
const endpoint = endpointOverride
|
|
30
56
|
?? (windows
|
|
31
57
|
? `\\\\.\\pipe\\${PRODUCT_IDENTITY.endpoint.windowsPipeStem}-${namespace}`
|
|
32
|
-
: path.join(runtimeDir, PRODUCT_IDENTITY.endpoint.unixSocketFilename));
|
|
58
|
+
: path.join(endpointDirectory ?? runtimeDir, PRODUCT_IDENTITY.endpoint.unixSocketFilename));
|
|
33
59
|
return {
|
|
34
60
|
configDir,
|
|
35
61
|
dataDir,
|
|
@@ -37,6 +63,8 @@ export function resolveProductPaths(environment = process.env, hostPlatform = pl
|
|
|
37
63
|
databasePath: path.resolve(databaseOverride ?? path.join(dataDir, PRODUCT_IDENTITY.endpoint.databaseFilename)),
|
|
38
64
|
endpoint,
|
|
39
65
|
endpointMetadataPath: path.join(runtimeDir, PRODUCT_IDENTITY.endpoint.metadataFilename),
|
|
66
|
+
endpointsDir: path.join(runtimeDir, "endpoints"),
|
|
67
|
+
endpointDirectory,
|
|
40
68
|
supervisorLogPath: path.join(runtimeDir, PRODUCT_IDENTITY.endpoint.supervisorLogFilename),
|
|
41
69
|
};
|
|
42
70
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Invocation-scoped selection; never inferred from a parent's active-session environment. */
|
|
2
|
+
export interface SessionSelection {
|
|
3
|
+
readonly target: string;
|
|
4
|
+
readonly sessionDir?: string;
|
|
5
|
+
}
|
|
6
|
+
/** Shared public/internal grammar, deliberately not arbitrary Pi argument passthrough. */
|
|
7
|
+
export declare function parseSessionSelection(arguments_: readonly string[]): SessionSelection | undefined;
|
|
8
|
+
/** Encode only validated values into separate argv entries; no shell quoting or evaluation. */
|
|
9
|
+
export declare function sessionSelectionArguments(selection?: SessionSelection): string[];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Shared public/internal grammar, deliberately not arbitrary Pi argument passthrough. */
|
|
2
|
+
export function parseSessionSelection(arguments_) {
|
|
3
|
+
if (arguments_.length === 0)
|
|
4
|
+
return undefined;
|
|
5
|
+
let target;
|
|
6
|
+
let sessionDir;
|
|
7
|
+
for (let index = 0; index < arguments_.length; index += 2) {
|
|
8
|
+
const option = arguments_[index];
|
|
9
|
+
if (option !== "--session" && option !== "--session-dir")
|
|
10
|
+
throw new Error("expected --session <path|id> with optional --session-dir <dir>");
|
|
11
|
+
const value = arguments_[index + 1];
|
|
12
|
+
if (value === undefined || value.startsWith("-") || !validValue(value))
|
|
13
|
+
throw new Error(`${option} requires a nonempty value`);
|
|
14
|
+
if (option === "--session") {
|
|
15
|
+
if (target !== undefined)
|
|
16
|
+
throw new Error("--session may occur only once");
|
|
17
|
+
target = value;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
if (sessionDir !== undefined)
|
|
21
|
+
throw new Error("--session-dir may occur only once");
|
|
22
|
+
sessionDir = value;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target === undefined)
|
|
26
|
+
throw new Error("--session-dir requires --session <path|id>");
|
|
27
|
+
return Object.freeze({ target, ...(sessionDir === undefined ? {} : { sessionDir }) });
|
|
28
|
+
}
|
|
29
|
+
/** Encode only validated values into separate argv entries; no shell quoting or evaluation. */
|
|
30
|
+
export function sessionSelectionArguments(selection) {
|
|
31
|
+
if (selection === undefined)
|
|
32
|
+
return [];
|
|
33
|
+
const args = [...(selection.sessionDir === undefined ? [] : ["--session-dir", selection.sessionDir]), "--session", selection.target];
|
|
34
|
+
parseSessionSelection(args);
|
|
35
|
+
return args;
|
|
36
|
+
}
|
|
37
|
+
function validValue(value) {
|
|
38
|
+
return value.trim().length > 0 && value.length <= 32_768 && !/[\u0000\r\n]/.test(value);
|
|
39
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare const STARTUP_SCHEMA = "a1-supervisor-startup-v1";
|
|
2
|
+
export interface SupervisorStartupAttemptIdentity {
|
|
3
|
+
readonly attemptId: string;
|
|
4
|
+
readonly releaseId: string;
|
|
5
|
+
readonly resultPath: string;
|
|
6
|
+
}
|
|
7
|
+
export type SupervisorStartupResult = {
|
|
8
|
+
readonly schema: typeof STARTUP_SCHEMA;
|
|
9
|
+
readonly attemptId: string;
|
|
10
|
+
readonly releaseId: string;
|
|
11
|
+
readonly outcome: "ready";
|
|
12
|
+
readonly pid: number;
|
|
13
|
+
} | {
|
|
14
|
+
readonly schema: typeof STARTUP_SCHEMA;
|
|
15
|
+
readonly attemptId: string;
|
|
16
|
+
readonly releaseId: string;
|
|
17
|
+
readonly outcome: "failure";
|
|
18
|
+
readonly stage: string;
|
|
19
|
+
readonly code: string | null;
|
|
20
|
+
readonly message: string;
|
|
21
|
+
};
|
|
22
|
+
/** Create one unguessable startup result authority under the protected runtime root. */
|
|
23
|
+
export declare function createSupervisorStartupAttempt(runtimeDir: string, releaseId: string): Promise<SupervisorStartupAttemptIdentity>;
|
|
24
|
+
export declare function supervisorStartupResultPath(runtimeDir: string, attemptId: string): string;
|
|
25
|
+
/** Atomically publish the bounded result for one detached supervisor startup attempt. */
|
|
26
|
+
export declare function publishSupervisorStartupResult(path: string, result: SupervisorStartupResult): Promise<void>;
|
|
27
|
+
export declare function readSupervisorStartupResult(path: string, attemptId: string, releaseId: string): Promise<SupervisorStartupResult | null>;
|
|
28
|
+
export declare function supervisorStartupFailure(error: unknown, attemptId: string, releaseId: string, stage: string): SupervisorStartupResult;
|
|
29
|
+
export declare function supervisorStartupReady(attemptId: string, releaseId: string): SupervisorStartupResult;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { mkdir, readFile, readdir, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
const STARTUP_SCHEMA = "a1-supervisor-startup-v1";
|
|
5
|
+
const MAX_RESULT_BYTES = 8 * 1024;
|
|
6
|
+
const MAX_MESSAGE_LENGTH = 1_024;
|
|
7
|
+
const MAX_RETAINED_RESULTS = 16;
|
|
8
|
+
const MAX_RESULT_AGE_MS = 7 * 24 * 60 * 60 * 1_000;
|
|
9
|
+
const ATTEMPT_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/;
|
|
10
|
+
/** Create one unguessable startup result authority under the protected runtime root. */
|
|
11
|
+
export async function createSupervisorStartupAttempt(runtimeDir, releaseId) {
|
|
12
|
+
const attemptId = randomUUID();
|
|
13
|
+
const directory = resolve(runtimeDir, "supervisor-startup");
|
|
14
|
+
await mkdir(directory, { recursive: true, mode: 0o700 });
|
|
15
|
+
await pruneSupervisorStartupResults(directory);
|
|
16
|
+
return { attemptId, releaseId, resultPath: supervisorStartupResultPath(runtimeDir, attemptId) };
|
|
17
|
+
}
|
|
18
|
+
export function supervisorStartupResultPath(runtimeDir, attemptId) {
|
|
19
|
+
if (!ATTEMPT_PATTERN.test(attemptId))
|
|
20
|
+
throw new TypeError("supervisor startup attempt identity is invalid");
|
|
21
|
+
return resolve(runtimeDir, "supervisor-startup", `${attemptId}.json`);
|
|
22
|
+
}
|
|
23
|
+
/** Atomically publish the bounded result for one detached supervisor startup attempt. */
|
|
24
|
+
export async function publishSupervisorStartupResult(path, result) {
|
|
25
|
+
validateSupervisorStartupResult(result, result.attemptId, result.releaseId);
|
|
26
|
+
const body = `${JSON.stringify(result)}\n`;
|
|
27
|
+
if (Buffer.byteLength(body) > MAX_RESULT_BYTES)
|
|
28
|
+
throw new Error("supervisor startup result exceeds its size bound");
|
|
29
|
+
const temporary = `${path}.${process.pid}.tmp`;
|
|
30
|
+
await writeFile(temporary, body, { encoding: "utf8", mode: 0o600 });
|
|
31
|
+
await rename(temporary, path);
|
|
32
|
+
}
|
|
33
|
+
export async function readSupervisorStartupResult(path, attemptId, releaseId) {
|
|
34
|
+
let metadata;
|
|
35
|
+
try {
|
|
36
|
+
metadata = await stat(path);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
if (isNodeError(error, "ENOENT"))
|
|
40
|
+
return null;
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
if (!metadata.isFile() || metadata.size > MAX_RESULT_BYTES)
|
|
44
|
+
throw new Error("supervisor startup result is invalid or oversized");
|
|
45
|
+
const value = JSON.parse(await readFile(path, "utf8"));
|
|
46
|
+
return validateSupervisorStartupResult(value, attemptId, releaseId);
|
|
47
|
+
}
|
|
48
|
+
export function supervisorStartupFailure(error, attemptId, releaseId, stage) {
|
|
49
|
+
const source = error instanceof Error ? error : new Error(String(error));
|
|
50
|
+
return {
|
|
51
|
+
schema: STARTUP_SCHEMA,
|
|
52
|
+
attemptId,
|
|
53
|
+
releaseId,
|
|
54
|
+
outcome: "failure",
|
|
55
|
+
stage: boundedToken(stage, "unknown"),
|
|
56
|
+
code: "code" in source && typeof source.code === "string" ? boundedToken(source.code, "UNKNOWN") : null,
|
|
57
|
+
message: sanitizeMessage(source.message),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export function supervisorStartupReady(attemptId, releaseId) {
|
|
61
|
+
return { schema: STARTUP_SCHEMA, attemptId, releaseId, outcome: "ready", pid: process.pid };
|
|
62
|
+
}
|
|
63
|
+
async function pruneSupervisorStartupResults(directory) {
|
|
64
|
+
const now = Date.now();
|
|
65
|
+
const entries = await readdir(directory, { withFileTypes: true });
|
|
66
|
+
const files = (await Promise.all(entries.filter(entry => entry.isFile() && entry.name.endsWith(".json")).map(async (entry) => {
|
|
67
|
+
const path = resolve(directory, entry.name);
|
|
68
|
+
const metadata = await stat(path).catch(() => null);
|
|
69
|
+
return metadata ? { path, modified: metadata.mtimeMs } : null;
|
|
70
|
+
}))).filter((file) => file !== null);
|
|
71
|
+
files.sort((left, right) => right.modified - left.modified);
|
|
72
|
+
await Promise.all(files.flatMap((file, index) => index >= MAX_RETAINED_RESULTS - 1 || now - file.modified > MAX_RESULT_AGE_MS
|
|
73
|
+
? [rm(file.path, { force: true })]
|
|
74
|
+
: []));
|
|
75
|
+
}
|
|
76
|
+
function validateSupervisorStartupResult(value, attemptId, releaseId) {
|
|
77
|
+
if (!value || typeof value !== "object")
|
|
78
|
+
throw new Error("supervisor startup result is malformed");
|
|
79
|
+
const result = value;
|
|
80
|
+
if (result.schema !== STARTUP_SCHEMA || result.attemptId !== attemptId || result.releaseId !== releaseId) {
|
|
81
|
+
throw new Error("supervisor startup result does not match the selected attempt and release");
|
|
82
|
+
}
|
|
83
|
+
if (result.outcome === "ready" && Number.isSafeInteger(result.pid) && Number(result.pid) > 0)
|
|
84
|
+
return result;
|
|
85
|
+
if (result.outcome === "failure" && typeof result.stage === "string" && result.stage.length > 0 && result.stage.length <= 128
|
|
86
|
+
&& (result.code === null || typeof result.code === "string") && typeof result.message === "string" && result.message.length <= MAX_MESSAGE_LENGTH) {
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
throw new Error("supervisor startup result is malformed");
|
|
90
|
+
}
|
|
91
|
+
function sanitizeMessage(message) {
|
|
92
|
+
let value = message.replace(/[\u0000-\u001f\u007f]+/g, " ").replace(/:\/\/[^\s/@:]+:[^\s/@]+@/g, "://<redacted>@");
|
|
93
|
+
for (const [name, secret] of Object.entries(process.env)) {
|
|
94
|
+
if (!secret || secret.length < 4 || !/(?:TOKEN|SECRET|PASSWORD|COOKIE|CREDENTIAL|AUTH)/i.test(name))
|
|
95
|
+
continue;
|
|
96
|
+
value = value.split(secret).join("<redacted>");
|
|
97
|
+
}
|
|
98
|
+
return value.trim().slice(0, MAX_MESSAGE_LENGTH) || "supervisor startup failed";
|
|
99
|
+
}
|
|
100
|
+
function boundedToken(value, fallback) {
|
|
101
|
+
const normalized = value.replace(/[^A-Za-z0-9_.:-]/g, "-").slice(0, 128);
|
|
102
|
+
return normalized || fallback;
|
|
103
|
+
}
|
|
104
|
+
function isNodeError(error, code) {
|
|
105
|
+
return error instanceof Error && "code" in error && error.code === code;
|
|
106
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type NativeHostProofMessage } from "./messages.js";
|
|
2
|
+
/** Identifies a bounded native-host framing or message-contract failure. */
|
|
2
3
|
export declare class NativeHostProtocolError extends Error {
|
|
3
4
|
readonly code: "frame-too-large" | "malformed-frame" | "invalid-message";
|
|
4
5
|
constructor(code: "frame-too-large" | "malformed-frame" | "invalid-message", message: string);
|
|
5
6
|
}
|
|
7
|
+
/** Encodes and incrementally decodes size-bounded newline-delimited native-host proof messages. */
|
|
6
8
|
export declare class NativeHostFrameCodec {
|
|
7
9
|
#private;
|
|
8
10
|
encode(message: NativeHostProofMessage): string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MAX_NATIVE_HOST_MESSAGE_BYTES, assertNativeHostProofMessage, } from "./messages.js";
|
|
2
|
+
/** Identifies a bounded native-host framing or message-contract failure. */
|
|
2
3
|
export class NativeHostProtocolError extends Error {
|
|
3
4
|
code;
|
|
4
5
|
constructor(code, message) {
|
|
@@ -7,6 +8,7 @@ export class NativeHostProtocolError extends Error {
|
|
|
7
8
|
this.name = "NativeHostProtocolError";
|
|
8
9
|
}
|
|
9
10
|
}
|
|
11
|
+
/** Encodes and incrementally decodes size-bounded newline-delimited native-host proof messages. */
|
|
10
12
|
export class NativeHostFrameCodec {
|
|
11
13
|
#buffer = "";
|
|
12
14
|
encode(message) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CorrelationId, type NativeHostCommand, type NativeHostEvent, type NativeHostHello, type PaneId, type TerminalSessionLaunch } from "
|
|
1
|
+
import { type CorrelationId, type NativeHostCommand, type NativeHostEvent, type NativeHostHello, type PaneId, type TerminalSessionLaunch } from "../../contracts/workspace/index.js";
|
|
2
2
|
export declare const NATIVE_HOST_PROTOCOL_NAME: string;
|
|
3
3
|
export declare const MAX_NATIVE_HOST_MESSAGE_BYTES: number;
|
|
4
4
|
export type NativeHostProofMessage = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NATIVE_HOST_PROTOCOL_VERSION, assertNativeHostCommand, assertTerminalSessionLaunch, } from "
|
|
1
|
+
import { NATIVE_HOST_PROTOCOL_VERSION, assertNativeHostCommand, assertTerminalSessionLaunch, } from "../../contracts/workspace/index.js";
|
|
2
2
|
import { PRODUCT_IDENTITY } from "../../product-identity.js";
|
|
3
3
|
export const NATIVE_HOST_PROTOCOL_NAME = PRODUCT_IDENTITY.protocol.nativeHostSchema;
|
|
4
4
|
export const MAX_NATIVE_HOST_MESSAGE_BYTES = 1024 * 1024;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { WindowsNativeProcessInspector, type InspectorCommandRunner } from "./windows-process-inspector.js";
|
|
2
|
+
/** Verifies Darwin process identity through the bounded native guardian inspection command. */
|
|
3
|
+
export declare class DarwinNativeProcessInspector extends WindowsNativeProcessInspector {
|
|
4
|
+
constructor(helperPath: string, runner?: InspectorCommandRunner);
|
|
5
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { WindowsNativeProcessInspector } from "./windows-process-inspector.js";
|
|
2
|
+
/** Verifies Darwin process identity through the bounded native guardian inspection command. */
|
|
3
|
+
export class DarwinNativeProcessInspector extends WindowsNativeProcessInspector {
|
|
4
|
+
constructor(helperPath, runner) {
|
|
5
|
+
super(helperPath, runner, "darwin-proc-start:");
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { NativeProcessIdentity } from "../lifecycle/index.js";
|
|
2
2
|
import type { NativeProcessInspector } from "./contracts.js";
|
|
3
|
+
/** Verifies Linux process identity from the PID and kernel start-time field in procfs. */
|
|
3
4
|
export declare class LinuxNativeProcessInspector implements NativeProcessInspector {
|
|
4
5
|
observe(pid: number): Promise<NativeProcessIdentity | null>;
|
|
5
6
|
matches(identity: NativeProcessIdentity): Promise<boolean>;
|
package/dist/{src/foundation → foundation}/process-containment/native-guardian-containment.d.ts
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { NativeProcessIdentity, ProcessContainmentIdentity } from "../lifecycle/index.js";
|
|
2
2
|
import type { ContainedProcessHandle, ContainedSpawnOptions, ProcessContainment } from "./contracts.js";
|
|
3
|
+
/** Delegates one root runtime to the native guardian and exposes its verified containment identity. */
|
|
3
4
|
export declare class NativeGuardianContainment implements ProcessContainment {
|
|
4
5
|
#private;
|
|
5
6
|
readonly instanceId: string;
|
package/dist/{src/foundation → foundation}/process-containment/native-guardian-containment.js
RENAMED
|
@@ -2,6 +2,7 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import { mkdir, readFile, rm } from "node:fs/promises";
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
4
|
import { PRODUCT_IDENTITY } from "../../product-identity.js";
|
|
5
|
+
/** Delegates one root runtime to the native guardian and exposes its verified containment identity. */
|
|
5
6
|
export class NativeGuardianContainment {
|
|
6
7
|
instanceId;
|
|
7
8
|
helperPath;
|
package/dist/{src/foundation → foundation}/process-containment/windows-process-inspector.d.ts
RENAMED
|
@@ -8,10 +8,12 @@ export interface InspectorCommandResult {
|
|
|
8
8
|
export interface InspectorCommandRunner {
|
|
9
9
|
run(executable: string, arguments_: readonly string[]): Promise<InspectorCommandResult>;
|
|
10
10
|
}
|
|
11
|
+
/** Verifies Windows process identity through the bounded process-guardian inspection command. */
|
|
11
12
|
export declare class WindowsNativeProcessInspector implements NativeProcessInspector {
|
|
12
13
|
readonly helperPath: string;
|
|
13
14
|
private readonly runner;
|
|
14
|
-
|
|
15
|
+
private readonly identityPrefix;
|
|
16
|
+
constructor(helperPath: string, runner?: InspectorCommandRunner, identityPrefix?: string);
|
|
15
17
|
observe(pid: number): Promise<NativeProcessIdentity | null>;
|
|
16
18
|
matches(identity: NativeProcessIdentity): Promise<boolean>;
|
|
17
19
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { execFile } from "node:child_process";
|
|
2
|
+
/** Verifies Windows process identity through the bounded process-guardian inspection command. */
|
|
2
3
|
export class WindowsNativeProcessInspector {
|
|
3
4
|
helperPath;
|
|
4
5
|
runner;
|
|
5
|
-
|
|
6
|
+
identityPrefix;
|
|
7
|
+
constructor(helperPath, runner = defaultRunner, identityPrefix = "windows-filetime:") {
|
|
6
8
|
this.helperPath = helperPath;
|
|
7
9
|
this.runner = runner;
|
|
10
|
+
this.identityPrefix = identityPrefix;
|
|
8
11
|
if (!helperPath || helperPath.includes("\0"))
|
|
9
12
|
throw new TypeError("process guardian helper path is invalid");
|
|
10
13
|
}
|
|
@@ -25,7 +28,7 @@ export class WindowsNativeProcessInspector {
|
|
|
25
28
|
catch {
|
|
26
29
|
throw Object.assign(new Error("process guardian returned malformed identity data"), { code: "PROCESS_INSPECTION_INVALID" });
|
|
27
30
|
}
|
|
28
|
-
if (!isIdentity(value) || value.pid !== pid || !value.startIdentity.startsWith(
|
|
31
|
+
if (!isIdentity(value) || value.pid !== pid || !value.startIdentity.startsWith(this.identityPrefix)) {
|
|
29
32
|
throw Object.assign(new Error("process guardian returned mismatched identity data"), { code: "PROCESS_INSPECTION_INVALID" });
|
|
30
33
|
}
|
|
31
34
|
return value;
|
|
@@ -5,6 +5,7 @@ interface ClientEvents {
|
|
|
5
5
|
stopIntent: [LaunchInstanceStopIntent];
|
|
6
6
|
disconnect: [];
|
|
7
7
|
}
|
|
8
|
+
/** Maintains one negotiated supervisor connection and rejects all pending commands on disconnect. */
|
|
8
9
|
export declare class SupervisorClient extends EventEmitter<ClientEvents> {
|
|
9
10
|
#private;
|
|
10
11
|
readonly clientId: `${string}-${string}-${string}-${string}-${string}`;
|
|
@@ -2,6 +2,7 @@ import { EventEmitter } from "node:events";
|
|
|
2
2
|
import { connect } from "node:net";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { CONTROL_ENVELOPE, CONTROL_ENVELOPE_REVISION, encodeFrame, LineFrameDecoder, localControlHello, negotiateControlFeatures } from "./messages.js";
|
|
5
|
+
/** Maintains one negotiated supervisor connection and rejects all pending commands on disconnect. */
|
|
5
6
|
export class SupervisorClient extends EventEmitter {
|
|
6
7
|
clientId = randomUUID();
|
|
7
8
|
releaseId;
|
|
@@ -76,6 +76,7 @@ export interface ControlNegotiation {
|
|
|
76
76
|
export declare function localControlHello(releaseId?: string): ControlHello;
|
|
77
77
|
export declare function negotiateControlFeatures(client: ControlHello, server?: ControlHello): ControlNegotiation;
|
|
78
78
|
export declare function encodeFrame(message: ClientMessage | ServerMessage | Readonly<Record<string, unknown>>): string;
|
|
79
|
+
/** Incrementally decodes size-bounded newline-delimited control frames from arbitrary chunks. */
|
|
79
80
|
export declare class LineFrameDecoder {
|
|
80
81
|
#private;
|
|
81
82
|
push(chunk: Buffer | string): unknown[];
|
|
@@ -58,6 +58,7 @@ export function negotiateControlFeatures(client, server = localControlHello()) {
|
|
|
58
58
|
export function encodeFrame(message) {
|
|
59
59
|
return `${JSON.stringify(message)}\n`;
|
|
60
60
|
}
|
|
61
|
+
/** Incrementally decodes size-bounded newline-delimited control frames from arbitrary chunks. */
|
|
61
62
|
export class LineFrameDecoder {
|
|
62
63
|
#buffer = "";
|
|
63
64
|
push(chunk) {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type OwnershipProbe } from "./cohort-selection.js";
|
|
2
|
+
import { type SupervisorEndpointMetadata } from "./cohort-state.js";
|
|
3
|
+
import { resolveProductPaths, type SessionSelection, type LaunchProfileId, type SupervisorStartupAttemptIdentity } from "../lifecycle/index.js";
|
|
4
|
+
import { cleanupProvenIdleOwner } from "./process-cleanup.js";
|
|
5
|
+
import { type MaterializedRelease, type VerifyMaterializedReleaseOptions } from "./release-store.js";
|
|
6
|
+
export interface BootstrapOptions {
|
|
7
|
+
readonly packageRoot: string;
|
|
8
|
+
readonly launchIntent?: {
|
|
9
|
+
readonly kind: "interactive";
|
|
10
|
+
readonly profileId: LaunchProfileId;
|
|
11
|
+
readonly sessionSelection?: SessionSelection;
|
|
12
|
+
};
|
|
13
|
+
readonly environment?: NodeJS.ProcessEnv;
|
|
14
|
+
readonly output?: Pick<NodeJS.WriteStream, "write">;
|
|
15
|
+
/**
|
|
16
|
+
* Whether a materialized release copy is fit to launch. The active release
|
|
17
|
+
* is normally reused while its version matches the installation, but a copy
|
|
18
|
+
* can be broken in ways a version cannot see — materialized from a tree a
|
|
19
|
+
* blocked postinstall never finished repairing. The probe is injected from
|
|
20
|
+
* the bin entry because deciding it requires inspecting dependency
|
|
21
|
+
* resolution, which stays out of production code. Absent means every
|
|
22
|
+
* release is fit.
|
|
23
|
+
*/
|
|
24
|
+
readonly releaseIsLaunchable?: (releaseRoot: string) => boolean;
|
|
25
|
+
/** Test seam for bounded maintenance scheduled after stale endpoint sweeping. */
|
|
26
|
+
readonly scheduleMaintenance?: (dataDir: string, paths: ReturnType<typeof resolveProductPaths>) => Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
export declare function runBootstrap(options: BootstrapOptions): Promise<number>;
|
|
29
|
+
export declare function certifyMaterializedRelease(release: MaterializedRelease, dataDir: string, verification?: VerifyMaterializedReleaseOptions): Promise<string>;
|
|
30
|
+
/** Persist current-format evidence after an authenticated parent has certified the exact release. */
|
|
31
|
+
export declare function recordParentCertifiedRelease(release: MaterializedRelease, dataDir: string): Promise<string>;
|
|
32
|
+
export interface SupervisorStartupAttempt extends SupervisorStartupAttemptIdentity {
|
|
33
|
+
readonly childOutcome: Promise<{
|
|
34
|
+
readonly exitCode: number | null;
|
|
35
|
+
readonly signal: NodeJS.Signals | null;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
/** Reuse a verified owner, or join the winner if another launch starts the same cohort first. */
|
|
39
|
+
export declare function ensureSupervisor(release: MaterializedRelease, environment: NodeJS.ProcessEnv): Promise<void>;
|
|
40
|
+
export declare function startSupervisor(release: MaterializedRelease, environment: NodeJS.ProcessEnv): Promise<SupervisorStartupAttempt>;
|
|
41
|
+
/**
|
|
42
|
+
* Hand a release the key set its own build reads. A retained pre-cutover release is
|
|
43
|
+
* still startable this way, which is what lets a launch fall back to the previous
|
|
44
|
+
* version instead of failing while an installation is being replaced.
|
|
45
|
+
*/
|
|
46
|
+
export declare function releaseEnvironment(environment: NodeJS.ProcessEnv, release: MaterializedRelease, profile?: LaunchProfileId): NodeJS.ProcessEnv;
|
|
47
|
+
export declare function waitForVerifiedEndpoint(path: string, release: MaterializedRelease, timeoutMs: number, startup?: SupervisorStartupAttempt): Promise<void>;
|
|
48
|
+
export declare function readEndpointMetadata(path: string): Promise<SupervisorEndpointMetadata | null>;
|
|
49
|
+
export declare function probeOwnership(metadata: SupervisorEndpointMetadata): Promise<OwnershipProbe>;
|
|
50
|
+
export declare function releaseVerifiedIdleOwner(metadata: SupervisorEndpointMetadata, dataDir: string, operations?: {
|
|
51
|
+
readonly waitForExit?: typeof waitForProcessExit;
|
|
52
|
+
readonly cleanup?: typeof cleanupProvenIdleOwner;
|
|
53
|
+
}): Promise<boolean>;
|
|
54
|
+
export declare function waitForProcessExit(pid: number, timeoutMs: number): Promise<void>;
|
|
55
|
+
export declare function removeEndpointArtifacts(metadataPath: string, endpoint: string): Promise<void>;
|