@timurproko/a1 0.1.8-dev.3b54f21 → 0.1.8-dev.402
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/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 +124 -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
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Point the `#pi-tui` proxy at the copy pinned Pi actually resolves.
|
|
3
|
+
*
|
|
4
|
+
* The proxy (bin/pi-tui.js) re-exports one static path, but npm does not
|
|
5
|
+
* materialize one layout: `npm ci` against A1's lockfile keeps pinned Pi's
|
|
6
|
+
* shrinkwrapped nested pi-tui copy, while a global `npm install -g` of the
|
|
7
|
+
* published tarball hoists pi-tui to A1's node_modules root and materializes
|
|
8
|
+
* no nested copy at all. A static path can only name one of those layouts —
|
|
9
|
+
* whichever the other layout lacks, the proxy's import fails at launch and
|
|
10
|
+
* extension UI never renders.
|
|
11
|
+
*
|
|
12
|
+
* This script runs on postinstall, asks Node what pinned Pi resolves
|
|
13
|
+
* `@earendil-works/pi-tui` to — the copy Pi's extension loader hands to
|
|
14
|
+
* extensions — and rewrites the proxy's single re-export (and its declaration
|
|
15
|
+
* twin) to that file. Whatever tree npm built, the proxy names the module Pi
|
|
16
|
+
* uses, so A1's renderer and Pi's extensions share one class identity.
|
|
17
|
+
*
|
|
18
|
+
* It never fails an install: a tree in which pinned Pi or its pi-tui cannot
|
|
19
|
+
* be resolved is reported on stderr and left untouched, and launch's
|
|
20
|
+
* module-identity check names the same condition to the user.
|
|
21
|
+
*
|
|
22
|
+
* This lives in bin/ (shipped, plain JS) because it inspects and names
|
|
23
|
+
* dependency resolution, which the Pi API boundary policy rightly forbids
|
|
24
|
+
* ordinary production code from touching.
|
|
25
|
+
*/
|
|
26
|
+
import { readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
27
|
+
import { dirname, join, relative } from "node:path";
|
|
28
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
29
|
+
import { resolvePinnedPiTui } from "./module-identity.js";
|
|
30
|
+
|
|
31
|
+
const RE_EXPORT_LINE = /^export \* from "[^"]+";$/m;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Rewrite the proxy pair under packageRoot/bin to re-export the pi-tui module
|
|
35
|
+
* pinned Pi resolves. Returns a discriminated outcome; never throws.
|
|
36
|
+
*/
|
|
37
|
+
export function syncPiTuiProxy(packageRoot) {
|
|
38
|
+
// Platform: resolvePinnedPiTui answers with a canonical real path, so the directory the
|
|
39
|
+
// relative specifier is computed from must be canonical too (Windows short
|
|
40
|
+
// names, symlinked installs).
|
|
41
|
+
const canonicalRoot = canonical(packageRoot);
|
|
42
|
+
let target;
|
|
43
|
+
try {
|
|
44
|
+
target = resolvePinnedPiTui(canonicalRoot);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
return { kind: "unresolved", message: error instanceof Error ? error.message : String(error) };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const binDirectory = join(canonicalRoot, "bin");
|
|
50
|
+
const runtimeSpecifier = relativeSpecifier(binDirectory, target);
|
|
51
|
+
const declarationSpecifier = runtimeSpecifier.replace(/\.js$/, ".d.ts").replace(/\.d\.d\.ts$/, ".d.ts");
|
|
52
|
+
const changed = [];
|
|
53
|
+
for (const [file, specifier] of [
|
|
54
|
+
["pi-tui.js", runtimeSpecifier],
|
|
55
|
+
["pi-tui.d.ts", declarationSpecifier],
|
|
56
|
+
]) {
|
|
57
|
+
if (rewriteReExport(join(binDirectory, file), specifier)) changed.push(file);
|
|
58
|
+
}
|
|
59
|
+
return { kind: "synced", target, changed };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function canonical(path) {
|
|
63
|
+
try {
|
|
64
|
+
return realpathSync.native(path);
|
|
65
|
+
} catch {
|
|
66
|
+
return path;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function relativeSpecifier(fromDirectory, toFile) {
|
|
71
|
+
const specifier = relative(fromDirectory, toFile).split("\\").join("/");
|
|
72
|
+
return specifier.startsWith(".") ? specifier : `./${specifier}`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Replace the file's single re-export line; returns whether the file changed. */
|
|
76
|
+
function rewriteReExport(file, specifier) {
|
|
77
|
+
let source;
|
|
78
|
+
try {
|
|
79
|
+
source = readFileSync(file, "utf8");
|
|
80
|
+
} catch {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
const line = `export * from "${specifier}";`;
|
|
84
|
+
if (source.includes(line) || !RE_EXPORT_LINE.test(source)) return false;
|
|
85
|
+
writeFileSync(file, source.replace(RE_EXPORT_LINE, line));
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const invokedDirectly = process.argv[1] !== undefined
|
|
90
|
+
&& import.meta.url === pathToFileURL(process.argv[1]).href;
|
|
91
|
+
if (invokedDirectly) {
|
|
92
|
+
const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
93
|
+
const outcome = syncPiTuiProxy(packageRoot);
|
|
94
|
+
if (outcome.kind === "unresolved") {
|
|
95
|
+
process.stderr.write(`a1: could not point #pi-tui at pinned Pi's copy (${outcome.message}); extension UI may not render.\n`);
|
|
96
|
+
}
|
|
97
|
+
}
|
package/bin/ui.js
CHANGED
|
@@ -1,30 +1,71 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const startup = await import("../dist/foundation/startup/index.js");
|
|
4
|
+
startup.enableEnvironmentCompileCache(process.env);
|
|
5
|
+
const { readLaunchContext } = await import("../dist/foundation/launch-context/index.js");
|
|
6
|
+
const launchContext = readLaunchContext(process.env, "profile");
|
|
7
|
+
const profile = launchContext.launchProfile;
|
|
8
|
+
const { installFatalExit } = await import("../dist/foundation/terminal-cleanup/index.js");
|
|
9
|
+
const { resolveProductPaths } = await import("../dist/foundation/lifecycle/index.js");
|
|
10
|
+
const { join } = await import("node:path");
|
|
11
|
+
let runningApplication;
|
|
12
|
+
const fatal = profile === "a1" ? installFatalExit({
|
|
13
|
+
directory: join(resolveProductPaths().runtimeDir, "crashes"),
|
|
14
|
+
releaseId: launchContext.releaseId,
|
|
15
|
+
dispose: () => runningApplication?.dispose(),
|
|
16
|
+
}) : undefined;
|
|
17
|
+
// Performance: begin the exact launch graph together while the trace write is pending.
|
|
18
|
+
// Direct owned-module entries avoid evaluating unrelated barrel exports before first paint.
|
|
19
|
+
const modules = Promise.all([
|
|
20
|
+
import("./module-identity.js"),
|
|
21
|
+
import("node:url"),
|
|
22
|
+
import("../dist/features/launch/runtime-selection.js"),
|
|
23
|
+
import("../dist/foundation/lifecycle/session-selection.js"),
|
|
24
|
+
import("../dist/features/owned-ui/project-trust-prompt.js"),
|
|
25
|
+
import("../dist/features/owned-ui/session-fork-prompt.js"),
|
|
26
|
+
import("../dist/features/owned-ui/run.js"),
|
|
27
|
+
import("../dist/composition/owned-ui.js"),
|
|
28
|
+
]);
|
|
29
|
+
await startup.markStartupPhase(process.env, "ui-entry");
|
|
30
|
+
const [
|
|
31
|
+
{ assertSinglePiTuiModuleAtLaunch },
|
|
32
|
+
{ fileURLToPath },
|
|
33
|
+
{ runSelectedInteractiveRuntime },
|
|
34
|
+
{ parseSessionSelection },
|
|
35
|
+
{ createConsoleProjectTrustPrompt },
|
|
36
|
+
{ createConsoleSessionForkPrompt },
|
|
37
|
+
{ runOwnedUi },
|
|
38
|
+
{ composeOwnedUi },
|
|
39
|
+
] = await modules;
|
|
5
40
|
|
|
6
|
-
//
|
|
7
|
-
// resolve it to the same copy, so extensions and the owned UI share one module
|
|
8
|
-
// identity (see bin/module-identity.js for the full story). Nothing is repaired
|
|
9
|
-
// here — A1's package manifest decides which copy wins, and this only reports
|
|
10
|
-
// when that stopped being true.
|
|
41
|
+
// Compatibility: before the composition uses pinned Pi's terminal stack: confirm A1 and Pi
|
|
42
|
+
// resolve it to the same copy, so extensions and the owned UI share one module identity.
|
|
11
43
|
assertSinglePiTuiModuleAtLaunch(fileURLToPath(new URL("..", import.meta.url)), message => process.stderr.write(message));
|
|
44
|
+
await startup.markStartupPhase(process.env, "ui-modules-loaded");
|
|
12
45
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
46
|
+
const sessionSelection = parseSessionSelection(process.argv.slice(2));
|
|
47
|
+
Promise.resolve().then(() => {
|
|
48
|
+
if (sessionSelection && profile !== "a1") throw new Error("session selection requires the normal A1 profile");
|
|
49
|
+
return runSelectedInteractiveRuntime(profile, {
|
|
50
|
+
ownedUi: async (profileId, ownedSurfaces) => {
|
|
51
|
+
const { application, settings } = await composeOwnedUi({
|
|
52
|
+
cwd: process.cwd(),
|
|
53
|
+
profileId,
|
|
54
|
+
ownedSurfaces,
|
|
55
|
+
projectTrustPrompt: createConsoleProjectTrustPrompt(),
|
|
56
|
+
sessionForkPrompt: createConsoleSessionForkPrompt(),
|
|
57
|
+
...(sessionSelection === undefined ? {} : { sessionSelection }),
|
|
58
|
+
});
|
|
59
|
+
runningApplication = application;
|
|
60
|
+
return await runOwnedUi({ application, ...(settings === null ? {} : { settings }) });
|
|
61
|
+
},
|
|
62
|
+
});
|
|
24
63
|
}).then(
|
|
25
|
-
code => { process.exitCode = code; },
|
|
64
|
+
code => { fatal?.remove(); process.exitCode = code; },
|
|
26
65
|
error => {
|
|
27
|
-
|
|
28
|
-
|
|
66
|
+
if (fatal && error?.name !== "PiSessionSelectionError") { fatal.fail(error); return; }
|
|
67
|
+
fatal?.remove();
|
|
68
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
69
|
+
process.exitCode = error?.name === "PiSessionSelectionError" ? error.exitCode : 1;
|
|
29
70
|
},
|
|
30
71
|
);
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// Security: this file intentionally depends only on Node built-ins: the updater copies it into a
|
|
4
|
+
// transaction capsule before npm is allowed to rename or remove the installed package.
|
|
5
|
+
import { spawn } from "node:child_process";
|
|
6
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
7
|
+
import { chmod, lstat, mkdir, open, readFile, realpath, rename, rm, writeFile } from "node:fs/promises";
|
|
8
|
+
import { dirname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
|
|
11
|
+
const SCHEMA = "a1-update-recovery-v1";
|
|
12
|
+
const [, , mode, manifestPath, separator, ...forwarded] = process.argv;
|
|
13
|
+
|
|
14
|
+
if ((mode !== "--worker" && mode !== "--launch") || !manifestPath || (mode === "--launch" && separator !== "--")) {
|
|
15
|
+
throw new Error("invalid A1 update recovery invocation");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const capsule = await readCapsule(manifestPath);
|
|
19
|
+
if (mode === "--worker") {
|
|
20
|
+
await runWorker(capsule);
|
|
21
|
+
} else {
|
|
22
|
+
process.exitCode = await runRecoveredCommand(capsule, forwarded);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async function runWorker(value) {
|
|
26
|
+
await rm(value.resultPath, { force: true });
|
|
27
|
+
await writeJson(value.ownerPath, {
|
|
28
|
+
schema: SCHEMA,
|
|
29
|
+
transactionId: value.transactionId,
|
|
30
|
+
pid: process.pid,
|
|
31
|
+
startIdentity: `${process.pid}:${Math.floor(Date.now() - process.uptime() * 1000)}`,
|
|
32
|
+
startedAt: new Date().toISOString(),
|
|
33
|
+
});
|
|
34
|
+
const heartbeat = setInterval(() => {
|
|
35
|
+
void writeJson(value.ownerPath, {
|
|
36
|
+
schema: SCHEMA,
|
|
37
|
+
transactionId: value.transactionId,
|
|
38
|
+
pid: process.pid,
|
|
39
|
+
startIdentity: `${process.pid}:${Math.floor(Date.now() - process.uptime() * 1000)}`,
|
|
40
|
+
heartbeatAt: new Date().toISOString(),
|
|
41
|
+
});
|
|
42
|
+
}, 500);
|
|
43
|
+
heartbeat.unref?.();
|
|
44
|
+
const child = spawn(process.execPath, [value.npmCli, ...value.npmArguments], {
|
|
45
|
+
detached: false,
|
|
46
|
+
windowsHide: true,
|
|
47
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
48
|
+
});
|
|
49
|
+
const stdout = [];
|
|
50
|
+
const stderr = [];
|
|
51
|
+
child.stdout?.on("data", chunk => stdout.push(Buffer.from(chunk)));
|
|
52
|
+
child.stderr?.on("data", chunk => stderr.push(Buffer.from(chunk)));
|
|
53
|
+
let cancelled = false;
|
|
54
|
+
let forced = false;
|
|
55
|
+
let forceTimer = null;
|
|
56
|
+
const cancellationPoll = setInterval(async () => {
|
|
57
|
+
if (cancelled || !await exists(value.cancellationPath)) return;
|
|
58
|
+
cancelled = true;
|
|
59
|
+
child.kill("SIGTERM");
|
|
60
|
+
forceTimer = setTimeout(() => { forced = true; child.kill("SIGKILL"); }, 2_000);
|
|
61
|
+
forceTimer.unref?.();
|
|
62
|
+
}, 50);
|
|
63
|
+
cancellationPoll.unref?.();
|
|
64
|
+
|
|
65
|
+
let npmExitCode = null;
|
|
66
|
+
let spawnError = null;
|
|
67
|
+
try {
|
|
68
|
+
npmExitCode = await new Promise((resolvePromise, rejectPromise) => {
|
|
69
|
+
child.once("error", rejectPromise);
|
|
70
|
+
child.once("close", code => resolvePromise(code));
|
|
71
|
+
});
|
|
72
|
+
} catch (error) {
|
|
73
|
+
spawnError = error;
|
|
74
|
+
} finally {
|
|
75
|
+
clearInterval(cancellationPoll);
|
|
76
|
+
clearInterval(heartbeat);
|
|
77
|
+
if (forceTimer) clearTimeout(forceTimer);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const targetReady = await installedTargetIsCallable(value);
|
|
81
|
+
let launcherDisposition = "unavailable";
|
|
82
|
+
let outcome = "failed";
|
|
83
|
+
if (targetReady) {
|
|
84
|
+
launcherDisposition = "target";
|
|
85
|
+
outcome = "installed";
|
|
86
|
+
} else {
|
|
87
|
+
await writeRecoveryLaunchers(value);
|
|
88
|
+
if (await recoveryLaunchersAreCallable(value)) {
|
|
89
|
+
launcherDisposition = "recovery";
|
|
90
|
+
outcome = "recovery-launcher";
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
await writeJson(value.resultPath, {
|
|
94
|
+
schema: SCHEMA,
|
|
95
|
+
transactionId: value.transactionId,
|
|
96
|
+
outcome,
|
|
97
|
+
npmExitCode,
|
|
98
|
+
cancelled,
|
|
99
|
+
launcherDisposition,
|
|
100
|
+
stdout: bounded(Buffer.concat(stdout).toString("utf8")),
|
|
101
|
+
stderr: bounded(`${Buffer.concat(stderr).toString("utf8")}${spawnError ? `\n${String(spawnError)}` : ""}${forced ? "\nforced npm termination after cancellation" : ""}`.trim()),
|
|
102
|
+
completedAt: new Date().toISOString(),
|
|
103
|
+
});
|
|
104
|
+
if (launcherDisposition === "unavailable") process.exitCode = 1;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
async function runRecoveredCommand(value, arguments_) {
|
|
108
|
+
let entry = await installedTargetEntry(value);
|
|
109
|
+
if (entry === null && arguments_[0] === "update") {
|
|
110
|
+
await rm(value.cancellationPath, { force: true });
|
|
111
|
+
await rm(value.resultPath, { force: true });
|
|
112
|
+
await rm(value.ownerPath, { force: true });
|
|
113
|
+
const worker = spawn(process.execPath, [fileURLToPath(import.meta.url), "--worker", manifestPath], {
|
|
114
|
+
detached: true,
|
|
115
|
+
windowsHide: true,
|
|
116
|
+
stdio: "ignore",
|
|
117
|
+
});
|
|
118
|
+
worker.unref();
|
|
119
|
+
const deadline = Date.now() + 15 * 60 * 1000;
|
|
120
|
+
const requestCancellation = signal => { void writeJson(value.cancellationPath, { schema: SCHEMA, transactionId: value.transactionId, signal, requestedAt: new Date().toISOString() }); };
|
|
121
|
+
const onSigint = () => requestCancellation("SIGINT");
|
|
122
|
+
const onSigterm = () => requestCancellation("SIGTERM");
|
|
123
|
+
process.on("SIGINT", onSigint);
|
|
124
|
+
process.on("SIGTERM", onSigterm);
|
|
125
|
+
try {
|
|
126
|
+
while (Date.now() < deadline && !await exists(value.resultPath)) await sleep(50);
|
|
127
|
+
} finally {
|
|
128
|
+
process.off("SIGINT", onSigint);
|
|
129
|
+
process.off("SIGTERM", onSigterm);
|
|
130
|
+
}
|
|
131
|
+
entry = await installedTargetEntry(value);
|
|
132
|
+
}
|
|
133
|
+
entry ??= resolve(value.priorReleaseRoot, "bin", "cli.js");
|
|
134
|
+
const child = spawn(process.execPath, [entry, ...arguments_], { stdio: "inherit", windowsHide: false });
|
|
135
|
+
return await new Promise(resolvePromise => {
|
|
136
|
+
child.once("error", error => { console.error(error instanceof Error ? error.message : String(error)); resolvePromise(1); });
|
|
137
|
+
child.once("close", code => resolvePromise(code ?? 1));
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
async function readCapsule(path) {
|
|
142
|
+
const value = JSON.parse(await readFile(path, "utf8"));
|
|
143
|
+
if (value.launchContract !== "neutral-launch-v1") throw new Error("Unsupported private recovery contract; stop existing processes and install directly with npm. Preserve settings, sessions, and history.");
|
|
144
|
+
if (value.schema !== SCHEMA || typeof value.transactionId !== "string" || typeof value.packageName !== "string"
|
|
145
|
+
|| typeof value.packageName !== "string" || !value.packageName.includes("/") || typeof value.targetVersion !== "string" || typeof value.packageRoot !== "string" || typeof value.globalRoot !== "string"
|
|
146
|
+
|| typeof value.launcherRoot !== "string" || !Array.isArray(value.launchers) || typeof value.priorReleaseId !== "string" || typeof value.priorReleaseRoot !== "string"
|
|
147
|
+
|| !/^[a-f0-9]{64}$/.test(value.priorContentDigest) || typeof value.releaseManifestName !== "string"
|
|
148
|
+
|| typeof value.recoveryEntry !== "string" || typeof value.recoveryEntryDigest !== "string" || value.nodeExecutable !== process.execPath || typeof value.npmCli !== "string"
|
|
149
|
+
|| !Array.isArray(value.npmArguments) || typeof value.resultPath !== "string" || typeof value.cancellationPath !== "string") {
|
|
150
|
+
throw new Error("invalid A1 update recovery capsule");
|
|
151
|
+
}
|
|
152
|
+
const lexicalCapsuleRoot = dirname(resolve(path));
|
|
153
|
+
if (lexicalCapsuleRoot.split(sep).at(-1) !== value.transactionId) throw new Error("A1 update recovery transaction path is invalid");
|
|
154
|
+
const capsuleRoot = await realpath(lexicalCapsuleRoot);
|
|
155
|
+
const entry = await realpath(value.recoveryEntry);
|
|
156
|
+
assertDirectChild(capsuleRoot, entry);
|
|
157
|
+
if (!samePath(entry, resolve(capsuleRoot, "recovery.js"))) throw new Error("A1 update recovery entry path is invalid");
|
|
158
|
+
const digest = createHash("sha256").update(await readFile(entry)).digest("hex");
|
|
159
|
+
if (digest !== value.recoveryEntryDigest) throw new Error("A1 update recovery payload digest mismatch");
|
|
160
|
+
const globalRoot = await realpath(value.globalRoot);
|
|
161
|
+
const packageRoot = await realpath(value.packageRoot).catch(() => resolve(value.packageRoot));
|
|
162
|
+
const expectedPackage = resolve(globalRoot, ...value.packageName.split("/"));
|
|
163
|
+
if (!samePath(packageRoot, expectedPackage) || !containedBy(globalRoot, packageRoot)) throw new Error("A1 update recovery package root escapes npm global root");
|
|
164
|
+
const expectedNpmArguments = ["install", "--global", "--loglevel=error", "--no-fund", "--no-audit", `${value.packageName}@${value.targetVersion}`];
|
|
165
|
+
if (JSON.stringify(value.npmArguments) !== JSON.stringify(expectedNpmArguments)) throw new Error("A1 update recovery npm arguments are invalid");
|
|
166
|
+
const launcherRoot = resolve(value.launcherRoot);
|
|
167
|
+
const expectedLaunchers = process.platform === "win32"
|
|
168
|
+
? [resolve(launcherRoot, "a1"), resolve(launcherRoot, "a1.cmd"), resolve(launcherRoot, "a1.ps1")]
|
|
169
|
+
: [resolve(launcherRoot, "a1")];
|
|
170
|
+
if (JSON.stringify(value.launchers.map(path => resolve(path))) !== JSON.stringify(expectedLaunchers)) throw new Error("A1 update recovery launcher set is invalid");
|
|
171
|
+
for (const launcher of value.launchers) assertDirectChild(launcherRoot, resolve(launcher));
|
|
172
|
+
const expectedSidecars = [resolve(lexicalCapsuleRoot, "cancel.json"), resolve(lexicalCapsuleRoot, "result.json"), resolve(lexicalCapsuleRoot, "owner.json")];
|
|
173
|
+
if (![value.cancellationPath, value.resultPath, value.ownerPath].every((candidate, index) => samePath(candidate, expectedSidecars[index]))) {
|
|
174
|
+
throw new Error("A1 update recovery sidecar paths are invalid");
|
|
175
|
+
}
|
|
176
|
+
const dataDir = dirname(dirname(capsuleRoot));
|
|
177
|
+
const releasesRoot = await realpath(resolve(dataDir, "releases"));
|
|
178
|
+
const priorReleaseRoot = await realpath(value.priorReleaseRoot);
|
|
179
|
+
assertDirectChild(releasesRoot, priorReleaseRoot);
|
|
180
|
+
if (priorReleaseRoot.split(sep).at(-1) !== value.priorReleaseId) throw new Error("A1 update recovery prior release identity is invalid");
|
|
181
|
+
const priorManifest = JSON.parse(await readFile(resolve(priorReleaseRoot, value.releaseManifestName), "utf8"));
|
|
182
|
+
if (priorManifest.launchContract !== "neutral-launch-v1") throw new Error("Unsupported prior private launch contract; manual cutover is required.");
|
|
183
|
+
if (priorManifest.releaseId !== value.priorReleaseId || priorManifest.contentDigest !== value.priorContentDigest) {
|
|
184
|
+
throw new Error("A1 update recovery prior release manifest is invalid");
|
|
185
|
+
}
|
|
186
|
+
const npmMetadata = await lstat(value.npmCli);
|
|
187
|
+
if (!npmMetadata.isFile() || npmMetadata.isSymbolicLink()) throw new Error("A1 update recovery npm entry is invalid");
|
|
188
|
+
return value;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
async function installedTargetEntry(value) {
|
|
192
|
+
try {
|
|
193
|
+
const manifest = JSON.parse(await readFile(resolve(value.packageRoot, "package.json"), "utf8"));
|
|
194
|
+
const entry = resolve(value.packageRoot, "bin", "cli.js");
|
|
195
|
+
if (manifest.privateLaunchContract !== "neutral-launch-v1" || manifest.name !== value.packageName || manifest.version !== value.targetVersion || !(await lstat(entry)).isFile()) return null;
|
|
196
|
+
return entry;
|
|
197
|
+
} catch { return null; }
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
async function installedTargetIsCallable(value) {
|
|
201
|
+
if (await installedTargetEntry(value) === null) return false;
|
|
202
|
+
const token = `node_modules/${value.packageName}/bin/cli.js`;
|
|
203
|
+
for (const path of value.launchers) {
|
|
204
|
+
try {
|
|
205
|
+
const metadata = await lstat(path);
|
|
206
|
+
if (!metadata.isFile() || metadata.isSymbolicLink()) return false;
|
|
207
|
+
if (process.platform !== "win32" && (metadata.mode & 0o111) === 0) return false;
|
|
208
|
+
const normalized = (await readFile(path, "utf8")).replaceAll("\\", "/");
|
|
209
|
+
if (!normalized.includes(token)) return false;
|
|
210
|
+
} catch { return false; }
|
|
211
|
+
}
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
async function writeRecoveryLaunchers(value) {
|
|
216
|
+
const node = value.nodeExecutable ?? process.execPath;
|
|
217
|
+
const entry = value.recoveryEntry;
|
|
218
|
+
const manifest = manifestPath;
|
|
219
|
+
const shell = `#!/bin/sh\nexec ${shellQuote(node)} ${shellQuote(entry)} --launch ${shellQuote(manifest)} -- "$@"\n`;
|
|
220
|
+
const command = `@ECHO off\r\n"${node}" "${entry}" --launch "${manifest}" -- %*\r\n`;
|
|
221
|
+
const powershell = `& '${psQuote(node)}' '${psQuote(entry)}' --launch '${psQuote(manifest)}' -- $args\nexit $LASTEXITCODE\n`;
|
|
222
|
+
const content = process.platform === "win32" ? [shell, command, powershell] : [shell];
|
|
223
|
+
await mkdir(value.launcherRoot, { recursive: true });
|
|
224
|
+
for (let index = 0; index < value.launchers.length; index += 1) await atomicWrite(value.launchers[index], content[index], 0o755);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
async function recoveryLaunchersAreCallable(value) {
|
|
228
|
+
for (const path of value.launchers) {
|
|
229
|
+
try {
|
|
230
|
+
const metadata = await lstat(path);
|
|
231
|
+
if (!metadata.isFile() || metadata.isSymbolicLink()) return false;
|
|
232
|
+
if (process.platform !== "win32" && (metadata.mode & 0o111) === 0) return false;
|
|
233
|
+
if (!(await readFile(path, "utf8")).includes(value.recoveryEntry)) return false;
|
|
234
|
+
} catch { return false; }
|
|
235
|
+
}
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
async function atomicWrite(path, content, mode) {
|
|
240
|
+
const temporary = `${path}.${process.pid}.${randomUUID()}.tmp`;
|
|
241
|
+
await writeFile(temporary, content, { mode });
|
|
242
|
+
await chmod(temporary, mode);
|
|
243
|
+
await rm(path, { force: true });
|
|
244
|
+
await rename(temporary, path);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
async function writeJson(path, value) {
|
|
248
|
+
await mkdir(dirname(path), { recursive: true, mode: 0o700 });
|
|
249
|
+
const temporary = `${path}.${process.pid}.${randomUUID()}.tmp`;
|
|
250
|
+
const file = await open(temporary, "wx", 0o600);
|
|
251
|
+
try { await file.writeFile(JSON.stringify(value, null, 2)); await file.sync(); }
|
|
252
|
+
finally { await file.close(); }
|
|
253
|
+
await rm(path, { force: true });
|
|
254
|
+
await rename(temporary, path);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function samePath(left, right) {
|
|
258
|
+
return process.platform === "win32" ? resolve(left).toLowerCase() === resolve(right).toLowerCase() : resolve(left) === resolve(right);
|
|
259
|
+
}
|
|
260
|
+
function containedBy(parent, child) {
|
|
261
|
+
const fromParent = relative(parent, child);
|
|
262
|
+
return fromParent.length > 0 && fromParent !== ".." && !fromParent.startsWith(`..${sep}`) && !isAbsolute(fromParent);
|
|
263
|
+
}
|
|
264
|
+
function assertDirectChild(parent, child) {
|
|
265
|
+
const expectedParent = resolve(parent);
|
|
266
|
+
const actualParent = dirname(resolve(child));
|
|
267
|
+
const matches = process.platform === "win32" ? actualParent.toLowerCase() === expectedParent.toLowerCase() : actualParent === expectedParent;
|
|
268
|
+
if (!matches) throw new Error(`A1 update recovery path escapes its managed root: ${child}`);
|
|
269
|
+
}
|
|
270
|
+
function shellQuote(value) { return `'${String(value).replaceAll("'", `'"'"'`)}'`; }
|
|
271
|
+
function psQuote(value) { return String(value).replaceAll("'", "''"); }
|
|
272
|
+
function bounded(value) { return value.length <= 64 * 1024 ? value : value.slice(-64 * 1024); }
|
|
273
|
+
async function exists(path) { return await lstat(path).then(() => true).catch(() => false); }
|
|
274
|
+
async function sleep(ms) { await new Promise(resolvePromise => setTimeout(resolvePromise, ms)); }
|
package/bin/warmup.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const startup = await import("../dist/foundation/startup/index.js");
|
|
4
|
+
startup.assertImmutableWarmupEnvironment(process.env);
|
|
5
|
+
startup.enableEnvironmentCompileCache(process.env);
|
|
6
|
+
|
|
7
|
+
// Security: this entry imports the exact interactive graph but never composes it, so it
|
|
8
|
+
// creates no terminal, profile/session path, trust callback, executable resource loader,
|
|
9
|
+
// extension runner, or network client.
|
|
10
|
+
const [identity, launch, selection, trustPrompt, forkPrompt, run, composition] = await Promise.all([
|
|
11
|
+
import("./module-identity.js"),
|
|
12
|
+
import("../dist/features/launch/runtime-selection.js"),
|
|
13
|
+
import("../dist/foundation/lifecycle/session-selection.js"),
|
|
14
|
+
import("../dist/features/owned-ui/project-trust-prompt.js"),
|
|
15
|
+
import("../dist/features/owned-ui/session-fork-prompt.js"),
|
|
16
|
+
import("../dist/features/owned-ui/run.js"),
|
|
17
|
+
import("../dist/composition/owned-ui.js"),
|
|
18
|
+
]);
|
|
19
|
+
if (typeof identity.assertSinglePiTuiModuleAtLaunch !== "function"
|
|
20
|
+
|| typeof launch.runSelectedInteractiveRuntime !== "function"
|
|
21
|
+
|| typeof selection.parseSessionSelection !== "function"
|
|
22
|
+
|| typeof trustPrompt.createConsoleProjectTrustPrompt !== "function"
|
|
23
|
+
|| typeof forkPrompt.createConsoleSessionForkPrompt !== "function"
|
|
24
|
+
|| typeof run.runOwnedUi !== "function"
|
|
25
|
+
|| typeof composition.composeOwnedUi !== "function") {
|
|
26
|
+
throw new Error("immutable startup graph is incomplete");
|
|
27
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The Pi comparison launch is a prerelease development instrument, not product. */
|
|
2
|
+
export interface CliCapabilities {
|
|
3
|
+
readonly developmentComparison: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function cliCapabilities(version: string): CliCapabilities;
|
|
6
|
+
export declare function isPrereleaseVersion(version: string): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { prerelease } from "semver";
|
|
2
2
|
export function cliCapabilities(version) {
|
|
3
|
-
return Object.freeze({
|
|
3
|
+
return Object.freeze({ developmentComparison: isPrereleaseVersion(version) });
|
|
4
4
|
}
|
|
5
5
|
export function isPrereleaseVersion(version) {
|
|
6
6
|
return (prerelease(version)?.length ?? 0) > 0;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type InteractiveLaunchIntent, type LaunchProfileId } from "../features/launch/index.js";
|
|
1
|
+
import { type InteractiveLaunchIntent, type LaunchProfileId, type SessionSelection } from "../features/launch/index.js";
|
|
2
2
|
import type { CliCapabilities } from "./capabilities.js";
|
|
3
3
|
import type { PackageCommandRequest } from "./packages.js";
|
|
4
|
+
import { type PackageCliVerb, type PackageSyntaxDiagnostic } from "./package-messages.js";
|
|
4
5
|
export type UpdateChannel = "stable" | "next";
|
|
5
6
|
export interface CliHandlers {
|
|
6
7
|
readonly launch: (intent: InteractiveLaunchIntent) => Promise<number>;
|
|
@@ -9,13 +10,26 @@ export interface CliHandlers {
|
|
|
9
10
|
readonly packages: (request: PackageCommandRequest) => Promise<number>;
|
|
10
11
|
}
|
|
11
12
|
export interface CliOutput {
|
|
13
|
+
readonly stdout: (message: string) => void;
|
|
12
14
|
readonly stderr: (message: string) => void;
|
|
13
15
|
}
|
|
14
16
|
export declare function cliUsage(capabilities: CliCapabilities): string;
|
|
17
|
+
export declare function cliHelp(capabilities: CliCapabilities): string;
|
|
15
18
|
export declare function dispatchCli(arguments_: readonly string[], handlers: CliHandlers, output: CliOutput, capabilities: CliCapabilities): Promise<number>;
|
|
16
19
|
export type CliCommand = {
|
|
20
|
+
readonly kind: "noop";
|
|
21
|
+
} | {
|
|
22
|
+
readonly kind: "help";
|
|
23
|
+
} | {
|
|
24
|
+
readonly kind: "package-help";
|
|
25
|
+
readonly verb: PackageCliVerb;
|
|
26
|
+
} | {
|
|
27
|
+
readonly kind: "package-error";
|
|
28
|
+
readonly diagnostic: PackageSyntaxDiagnostic;
|
|
29
|
+
} | {
|
|
17
30
|
readonly kind: "launch";
|
|
18
31
|
readonly profileId: LaunchProfileId;
|
|
32
|
+
readonly sessionSelection?: SessionSelection;
|
|
19
33
|
} | {
|
|
20
34
|
readonly kind: "version";
|
|
21
35
|
} | {
|