@timurproko/a1 0.1.8-dev.112 → 0.1.8-dev.121
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/bin/cli.js +7 -7
- package/bin/guardian.js +1 -1
- package/bin/supervisor.js +1 -1
- package/bin/ui.js +3 -3
- package/dist/{src/cli → cli}/packages.d.ts +1 -1
- 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 +25 -0
- package/dist/composition/owned-ui.js +40 -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 +73 -0
- package/dist/{src/features → features}/owned-ui/customization.d.ts +1 -1
- package/dist/{src/features → features}/owned-ui/customization.js +1 -1
- package/dist/{src/features → features}/owned-ui/diagnostics.d.ts +1 -1
- package/dist/{src/features → features}/owned-ui/run.d.ts +2 -2
- package/dist/{src/features → features}/owned-ui/settings-app.d.ts +3 -3
- package/dist/{src/features → features}/owned-ui/settings-app.js +1 -1
- package/dist/{src/features → features}/workspace/capabilities.d.ts +1 -1
- package/dist/{src/features → features}/workspace/reducer.d.ts +1 -1
- package/dist/{src/features → features}/workspace/reducer.js +1 -1
- package/dist/{src/features → features}/workspace/router.d.ts +1 -1
- package/dist/{src/features → features}/workspace/store.d.ts +1 -1
- package/dist/{src/foundation → foundation}/launch-guardian/main.js +8 -2
- package/dist/foundation/lifecycle/paths.d.ts +28 -0
- package/dist/{src/foundation → foundation}/lifecycle/paths.js +21 -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/{src/foundation → foundation}/release/bootstrap.js +42 -10
- package/dist/foundation/release/endpoints.d.ts +20 -0
- package/dist/foundation/release/endpoints.js +50 -0
- package/dist/{src/foundation → foundation}/release/index.d.ts +1 -0
- package/dist/{src/foundation → foundation}/release/index.js +1 -0
- package/dist/{src/foundation → foundation}/release/release-gc.d.ts +4 -1
- package/dist/{src/foundation → foundation}/release/release-gc.js +9 -1
- package/dist/{src/foundation → foundation}/release/update.d.ts +8 -0
- package/dist/{src/foundation → foundation}/release/update.js +60 -22
- package/dist/{src/foundation → foundation}/storage/control-store.d.ts +1 -1
- package/dist/{src/foundation → foundation}/storage/control-store.js +1 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/backpressure.d.ts +1 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/backpressure.js +1 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/commands.d.ts +1 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/commands.js +1 -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 +1 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/reconnection.js +1 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/state.d.ts +1 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/state.js +1 -1
- package/dist/foundation/supervision/index.d.ts +3 -0
- package/dist/foundation/supervision/index.js +3 -0
- package/dist/{src/foundation → foundation}/supervision/main.js +11 -5
- package/dist/foundation/supervision/paths.d.ts +1 -0
- package/dist/foundation/supervision/paths.js +1 -0
- package/dist/{src/foundation → foundation}/supervision/server.d.ts +18 -1
- package/dist/{src/foundation → foundation}/supervision/server.js +52 -1
- 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.js +2 -2
- 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 +1 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-presenters-transcript.d.ts +1 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-presenters-transcript.js +1 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-selectors-dialogs.d.ts +1 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-shared-facade.d.ts +1 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-footer.d.ts +1 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/adapter.d.ts +2 -2
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/adapter.js +59 -6
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/conformance.js +2 -2
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/model-auth-integration.d.ts +1 -1
- 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 +1 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/resource-extension-integration.d.ts +1 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/session-integration.d.ts +1 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/session-integration.js +1 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/settings-integration.d.ts +1 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflow-controllers.d.ts +1 -1
- package/dist/{src/foundation/pi-owned-ui-integration → integrations/pi/owned-ui}/route-host.d.ts +1 -1
- package/dist/{src/foundation/pi-owned-ui-integration/session-shell.d.ts → integrations/pi/owned-ui/session-shell-root.d.ts} +7 -46
- package/dist/integrations/pi/owned-ui/session-shell-root.js +722 -0
- package/dist/integrations/pi/owned-ui/session-shell.d.ts +46 -0
- package/dist/{src/foundation/pi-owned-ui-integration → integrations/pi/owned-ui}/session-shell.js +6 -720
- 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 +1 -1
- package/dist/native/linux-x64/manifest.json +1 -1
- package/dist/native/win32-x64/manifest.json +2 -2
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/{src/foundation/ui-apps → ui/apps}/contracts.d.ts +1 -1
- package/dist/{src/foundation/ui-apps → ui/apps}/host.d.ts +1 -1
- package/dist/{src/foundation/ui-apps → ui/apps}/host.js +1 -1
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/session.d.ts +1 -1
- package/docs/architecture/boundaries.md +8 -8
- package/docs/architecture/project-structure.md +52 -29
- package/docs/architecture/toolchain.md +4 -4
- package/docs/ci-release-runbook.md +1 -1
- package/docs/features/launch-profiles.md +6 -8
- package/docs/manual-owned-ui-checkpoint.md +52 -0
- package/docs/manual-terminal-colour-check.md +1 -1
- package/package.json +23 -23
- package/dist/src/composition/index.d.ts +0 -48
- package/dist/src/composition/index.js +0 -258
- package/dist/src/foundation/lifecycle/paths.d.ts +0 -10
- package/dist/src/foundation/supervision/index.d.ts +0 -3
- package/dist/src/foundation/supervision/index.js +0 -3
- package/dist/src/foundation/supervision/paths.d.ts +0 -1
- package/dist/src/foundation/supervision/paths.js +0 -1
- package/docs/manual-transparent-checkpoint.md +0 -53
- /package/dist/{src/cli → cli}/capabilities.d.ts +0 -0
- /package/dist/{src/cli → cli}/capabilities.js +0 -0
- /package/dist/{src/cli → cli}/dispatch.d.ts +0 -0
- /package/dist/{src/cli → cli}/dispatch.js +0 -0
- /package/dist/{src/cli → cli}/index.d.ts +0 -0
- /package/dist/{src/cli → cli}/index.js +0 -0
- /package/dist/{src/cli → cli}/packages.js +0 -0
- /package/dist/{src/cli → cli}/version-stats.d.ts +0 -0
- /package/dist/{src/cli → cli}/version-stats.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.d.ts +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-validation.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain.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.d.ts +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}/index.d.ts +0 -0
- /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/index.js +0 -0
- /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/model.d.ts +0 -0
- /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/model.js +0 -0
- /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/validation.d.ts +0 -0
- /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/validation.js +0 -0
- /package/dist/{src/foundation/presentation-contracts → contracts/presentation}/index.d.ts +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/development-launch.js +0 -0
- /package/dist/{src/features → features}/launch/index.d.ts +0 -0
- /package/dist/{src/features → features}/launch/index.js +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/intent.d.ts +0 -0
- /package/dist/{src/features → features}/launch/intent.js +0 -0
- /package/dist/{src/features → features}/launch/prepare-launch.d.ts +0 -0
- /package/dist/{src/features → features}/launch/prepare-launch.js +0 -0
- /package/dist/{src/features → features}/launch/profile-paths.d.ts +0 -0
- /package/dist/{src/features → features}/launch/profile-paths.js +0 -0
- /package/dist/{src/features → features}/launch/profiles.d.ts +0 -0
- /package/dist/{src/features → features}/launch/profiles.js +0 -0
- /package/dist/{src/features → features}/launch/runtime-selection.d.ts +0 -0
- /package/dist/{src/features → features}/launch/runtime-selection.js +0 -0
- /package/dist/{src/features → features}/owned-ui/diagnostics.js +0 -0
- /package/dist/{src/features → features}/owned-ui/index.d.ts +0 -0
- /package/dist/{src/features → features}/owned-ui/index.js +0 -0
- /package/dist/{src/features → features}/owned-ui/run.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/features → features}/workspace/router.js +0 -0
- /package/dist/{src/features → features}/workspace/store.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}/launch-guardian/main.d.ts +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/index.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/lifecycle/index.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}/lifecycle/model.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/lifecycle/model.js +0 -0
- /package/dist/{src/foundation → foundation}/native-host-protocol/codec.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/native-host-protocol/codec.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}/process-containment/index.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/index.js +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/linux-process-inspector.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/linux-process-inspector.js +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/native-guardian-containment.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/native-guardian-containment.js +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/windows-process-inspector.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/windows-process-inspector.js +0 -0
- /package/dist/{src/foundation → foundation}/protocol/client.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/protocol/client.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}/protocol/messages.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/protocol/messages.js +0 -0
- /package/dist/{src/foundation → foundation}/release/bootstrap.d.ts +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/cohort-state.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/release/cohort-state.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/release-store.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/release/release-store.js +0 -0
- /package/dist/{src/foundation → foundation}/release/release.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/release/release.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}/release/update-transaction.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/release/update-transaction.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 → foundation}/supervision/main.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/components.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/conformance.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/index.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/index.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-components.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-components.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-editor-autocomplete.js +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}/shell-footer-status.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-selectors-dialogs.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-shared-facade.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/adjacent/core/keybindings.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/adjacent/core/keybindings.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/earendil-announcement.js +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/owned-editor.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/owned-editor.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/scoped-models-selector.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/scoped-models-selector.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-footer.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}/conformance.d.ts +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/index.d.ts +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/index.js +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/model-auth-integration.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}/resource-extension-integration.js +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/runtime-integration.d.ts +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/runtime-integration.js +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/settings-integration.js +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflow-controllers.js +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflows.d.ts +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflows.js +0 -0
- /package/dist/{src/foundation/pi-owned-ui-integration → integrations/pi/owned-ui}/index.d.ts +0 -0
- /package/dist/{src/foundation/pi-owned-ui-integration → integrations/pi/owned-ui}/index.js +0 -0
- /package/dist/{src/foundation/pi-owned-ui-integration → integrations/pi/owned-ui}/route-host.js +0 -0
- /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/adapter.d.ts +0 -0
- /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/adapter.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}/contracts.d.ts +0 -0
- /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/contracts.js +0 -0
- /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/index.d.ts +0 -0
- /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/index.js +0 -0
- /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/presentation-adapter.js +0 -0
- /package/dist/{src/product-identity.d.ts → product-identity.d.ts} +0 -0
- /package/dist/{src/product-identity.js → product-identity.js} +0 -0
- /package/dist/{src/product-identity.json → product-identity.json} +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-apps → ui/apps}/registry.d.ts +0 -0
- /package/dist/{src/foundation/ui-apps → ui/apps}/registry.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}/dialog-panel.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/frame.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/frame.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/index.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/index.js +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}/line-input.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/line-input.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}/list-view.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/list-view.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/mouse.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/mouse.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}/scrollbar.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/scrollbar.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/shortcuts.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/shortcuts.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/spans.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/spans.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}/surface.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/surface.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/text.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/text.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}/declarations.d.ts +0 -0
- /package/dist/{src/foundation/owned-ui-settings → ui/settings}/declarations.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}/migrations.d.ts +0 -0
- /package/dist/{src/foundation/owned-ui-settings → ui/settings}/migrations.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
- /package/dist/{src/foundation/owned-ui-settings → ui/settings}/sections.d.ts +0 -0
- /package/dist/{src/foundation/owned-ui-settings → ui/settings}/sections.js +0 -0
- /package/dist/{src/foundation/owned-ui-settings → ui/settings}/session.js +0 -0
- /package/dist/{src/foundation/owned-ui-settings → ui/settings}/store.d.ts +0 -0
- /package/dist/{src/foundation/owned-ui-settings → ui/settings}/store.js +0 -0
package/bin/cli.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const packageRoot = new URL("..", import.meta.url);
|
|
4
4
|
const { fileURLToPath } = await import("node:url");
|
|
5
5
|
const { readFile } = await import("node:fs/promises");
|
|
6
|
-
const { cliCapabilities, dispatchCli } = await import("../dist/
|
|
6
|
+
const { cliCapabilities, dispatchCli } = await import("../dist/cli/index.js");
|
|
7
7
|
|
|
8
8
|
// Which commands this build exposes follows from the build's own version, so a
|
|
9
9
|
// released a1 cannot be argued into offering the development profiles.
|
|
@@ -12,24 +12,24 @@ const capabilities = cliCapabilities(JSON.parse(await readFile(new URL("package.
|
|
|
12
12
|
process.exitCode = await dispatchCli(process.argv.slice(2), {
|
|
13
13
|
launch: async intent => {
|
|
14
14
|
const [{ prepareInteractiveLaunch }, { runBootstrap }] = await Promise.all([
|
|
15
|
-
import("../dist/
|
|
16
|
-
import("../dist/
|
|
15
|
+
import("../dist/features/launch/index.js"),
|
|
16
|
+
import("../dist/foundation/release/index.js"),
|
|
17
17
|
]);
|
|
18
18
|
const prepared = await prepareInteractiveLaunch(intent);
|
|
19
19
|
return await runBootstrap({ packageRoot: fileURLToPath(packageRoot), launchIntent: intent, environment: prepared.environment });
|
|
20
20
|
},
|
|
21
21
|
version: async () => {
|
|
22
|
-
const { runVersionStats } = await import("../dist/
|
|
22
|
+
const { runVersionStats } = await import("../dist/cli/index.js");
|
|
23
23
|
return await runVersionStats({ packageRoot: fileURLToPath(packageRoot) });
|
|
24
24
|
},
|
|
25
25
|
update: async (channel, target) => {
|
|
26
|
-
const { runSelfUpdate } = await import("../dist/
|
|
26
|
+
const { runSelfUpdate } = await import("../dist/foundation/release/index.js");
|
|
27
27
|
return await runSelfUpdate({ packageRoot: fileURLToPath(packageRoot), channel, ...(target === undefined ? {} : { target }) });
|
|
28
28
|
},
|
|
29
29
|
packages: async request => {
|
|
30
30
|
const [{ runPackageCommand }, { createPiPackagesPort }] = await Promise.all([
|
|
31
|
-
import("../dist/
|
|
32
|
-
import("../dist/
|
|
31
|
+
import("../dist/cli/index.js"),
|
|
32
|
+
import("../dist/integrations/pi/engine/index.js"),
|
|
33
33
|
]);
|
|
34
34
|
return await runPackageCommand(request, { createPort: createPiPackagesPort });
|
|
35
35
|
},
|
package/bin/guardian.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const { fileURLToPath } = await import("node:url");
|
|
4
4
|
const { resolve } = await import("node:path");
|
|
5
|
-
const { runLaunchGuardian } = await import("../dist/
|
|
5
|
+
const { runLaunchGuardian } = await import("../dist/foundation/launch-guardian/index.js");
|
|
6
6
|
|
|
7
7
|
const releaseRoot = process.env.A1_RELEASE_ROOT ?? fileURLToPath(new URL("..", import.meta.url));
|
|
8
8
|
const profileId = process.env.A1_LAUNCH_PROFILE ?? "a1";
|
package/bin/supervisor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { runSupervisor } from "../dist/
|
|
2
|
+
import { runSupervisor } from "../dist/foundation/supervision/index.js";
|
|
3
3
|
|
|
4
4
|
runSupervisor().catch(error => {
|
|
5
5
|
console.error(error instanceof Error ? error.stack ?? error.message : String(error));
|
package/bin/ui.js
CHANGED
|
@@ -10,13 +10,13 @@ const { fileURLToPath } = await import("node:url");
|
|
|
10
10
|
// when that stopped being true.
|
|
11
11
|
assertSinglePiTuiModuleAtLaunch(fileURLToPath(new URL("..", import.meta.url)), message => process.stderr.write(message));
|
|
12
12
|
|
|
13
|
-
const { runSelectedInteractiveRuntime } = await import("../dist/
|
|
13
|
+
const { runSelectedInteractiveRuntime } = await import("../dist/features/launch/index.js");
|
|
14
14
|
|
|
15
15
|
runSelectedInteractiveRuntime(process.env.A1_LAUNCH_PROFILE ?? "a1", {
|
|
16
16
|
ownedUi: async (profileId, ownedSurfaces) => {
|
|
17
17
|
const [{ runOwnedUi }, { composeOwnedUi }] = await Promise.all([
|
|
18
|
-
import("../dist/
|
|
19
|
-
import("../dist/
|
|
18
|
+
import("../dist/features/owned-ui/index.js"),
|
|
19
|
+
import("../dist/composition/index.js"),
|
|
20
20
|
]);
|
|
21
21
|
const { application, settings } = await composeOwnedUi({ cwd: process.cwd(), profileId, ownedSurfaces });
|
|
22
22
|
return await runOwnedUi({ application, ...(settings === null ? {} : { settings }) });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { initializeProductProfile } from "../features/launch/index.js";
|
|
2
|
-
import type { AgentPackageOutcome, AgentPackagesPort, AgentPackagesPortInput } from "../
|
|
2
|
+
import type { AgentPackageOutcome, AgentPackagesPort, AgentPackagesPortInput } from "../contracts/agent-engine/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Package commands manage A1's own profile and nothing else, so no request carries
|
|
5
5
|
* a profile: `update` with no source means every installed package, and refreshing
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { AGENT_ENGINE_CONTRACT_VERSION, assertAgentCommand, } from "../contracts/agent-engine/index.js";
|
|
2
|
+
const CAPABILITIES = {
|
|
3
|
+
contractVersion: AGENT_ENGINE_CONTRACT_VERSION,
|
|
4
|
+
commands: ["prompt", "steer", "follow-up", "abort", "retry", "compact", "bash", "replace-session"],
|
|
5
|
+
events: ["lifecycle", "content", "command-outcome", "snapshot-invalidated", "diagnostic"],
|
|
6
|
+
snapshots: { supported: true, maxBytes: 1024 * 1024 },
|
|
7
|
+
};
|
|
8
|
+
export function createPiAgentEngineBridge(adapter, cwd) {
|
|
9
|
+
return new PiAgentEngineBridge(adapter, cwd);
|
|
10
|
+
}
|
|
11
|
+
class PiAgentEngineBridge {
|
|
12
|
+
adapter;
|
|
13
|
+
cwd;
|
|
14
|
+
capabilities = CAPABILITIES;
|
|
15
|
+
#session;
|
|
16
|
+
constructor(adapter, cwd) {
|
|
17
|
+
this.adapter = adapter;
|
|
18
|
+
this.cwd = cwd;
|
|
19
|
+
}
|
|
20
|
+
async createSession(input) {
|
|
21
|
+
if (this.#session)
|
|
22
|
+
return this.#session;
|
|
23
|
+
if (input.cwd !== this.cwd)
|
|
24
|
+
throw new TypeError("composed Pi engine cannot change working directory");
|
|
25
|
+
await this.adapter.start();
|
|
26
|
+
this.#session = new PiAgentSessionBridge(this.adapter, input.sessionId);
|
|
27
|
+
return this.#session;
|
|
28
|
+
}
|
|
29
|
+
async dispose() { await this.adapter.dispose(); }
|
|
30
|
+
}
|
|
31
|
+
class PiAgentSessionBridge {
|
|
32
|
+
adapter;
|
|
33
|
+
sessionId;
|
|
34
|
+
capabilities = CAPABILITIES;
|
|
35
|
+
lifecycle = "starting";
|
|
36
|
+
#listeners = new Set();
|
|
37
|
+
#unsubscribe;
|
|
38
|
+
constructor(adapter, sessionId) {
|
|
39
|
+
this.adapter = adapter;
|
|
40
|
+
this.sessionId = sessionId;
|
|
41
|
+
this.#unsubscribe = adapter.onEvent(event => {
|
|
42
|
+
const converted = convertEvent(event);
|
|
43
|
+
if (!converted)
|
|
44
|
+
return;
|
|
45
|
+
if (converted.type === "lifecycle")
|
|
46
|
+
this.lifecycle = converted.lifecycle;
|
|
47
|
+
for (const listener of this.#listeners)
|
|
48
|
+
listener(converted);
|
|
49
|
+
});
|
|
50
|
+
this.lifecycle = toLifecycle(adapter.snapshot().view.lifecycle);
|
|
51
|
+
}
|
|
52
|
+
async execute(command) {
|
|
53
|
+
assertAgentCommand(command, this.capabilities);
|
|
54
|
+
if (command.sessionId !== this.sessionId)
|
|
55
|
+
return "rejected";
|
|
56
|
+
if (command.type === "bash") {
|
|
57
|
+
const result = await this.adapter.executeBashWorkflow(command.command, false);
|
|
58
|
+
return !result.cancelled && result.exitCode === 0 ? "completed" : result.cancelled ? "cancelled" : "failed";
|
|
59
|
+
}
|
|
60
|
+
const result = await this.adapter.execute(toOwnedCommand(command));
|
|
61
|
+
return result.outcome === "timed-out" ? "failed" : result.outcome;
|
|
62
|
+
}
|
|
63
|
+
subscribe(listener) { this.#listeners.add(listener); return () => this.#listeners.delete(listener); }
|
|
64
|
+
async snapshot() {
|
|
65
|
+
const snapshot = this.adapter.snapshot();
|
|
66
|
+
return {
|
|
67
|
+
contractVersion: AGENT_ENGINE_CONTRACT_VERSION,
|
|
68
|
+
snapshotId: snapshot.snapshotId,
|
|
69
|
+
sessionId: this.sessionId,
|
|
70
|
+
revision: snapshot.view.revision,
|
|
71
|
+
sequence: snapshot.sequence,
|
|
72
|
+
lifecycle: toLifecycle(snapshot.view.lifecycle),
|
|
73
|
+
content: snapshot.view.transcript.map(toMessage),
|
|
74
|
+
activeCommandIds: snapshot.view.activeCommandIds,
|
|
75
|
+
capabilities: this.capabilities,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
async dispose() { this.#unsubscribe(); this.#listeners.clear(); await this.adapter.dispose(); this.lifecycle = "stopped"; }
|
|
79
|
+
}
|
|
80
|
+
function toOwnedCommand(command) {
|
|
81
|
+
const base = { correlationId: command.commandId, sessionId: command.sessionId };
|
|
82
|
+
if (command.type === "replace-session")
|
|
83
|
+
return command.source.kind === "new" ? { ...base, type: "new-session" } : { ...base, type: "resume-session", sessionPath: command.source.sessionPath };
|
|
84
|
+
if (command.type === "prompt" || command.type === "steer" || command.type === "follow-up")
|
|
85
|
+
return { ...base, type: command.type, text: command.text };
|
|
86
|
+
return { ...base, type: command.type };
|
|
87
|
+
}
|
|
88
|
+
function convertEvent(event) {
|
|
89
|
+
const base = { contractVersion: AGENT_ENGINE_CONTRACT_VERSION, sessionId: event.sessionId, sequence: event.sequence };
|
|
90
|
+
if (event.type === "session-lifecycle")
|
|
91
|
+
return { ...base, type: "lifecycle", lifecycle: toLifecycle(event.lifecycle), reason: event.reason };
|
|
92
|
+
if (event.type === "transcript-block")
|
|
93
|
+
return { ...base, type: "content", content: toMessage(event.block) };
|
|
94
|
+
if (event.type === "command-outcome")
|
|
95
|
+
return { ...base, type: "command-outcome", commandId: event.correlationId, outcome: event.outcome === "timed-out" ? "failed" : event.outcome, diagnostic: event.diagnostic };
|
|
96
|
+
if (event.type === "diagnostic")
|
|
97
|
+
return { ...base, type: "diagnostic", code: event.diagnostic.code, message: event.diagnostic.message, recoverable: event.diagnostic.recoverable };
|
|
98
|
+
if (event.type === "session-view")
|
|
99
|
+
return { ...base, type: "snapshot-invalidated", expectedRevision: event.view.revision };
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
function toLifecycle(lifecycle) {
|
|
103
|
+
return lifecycle === "suspended" ? "ready" : lifecycle;
|
|
104
|
+
}
|
|
105
|
+
function toMessage(block) {
|
|
106
|
+
const role = block.kind === "user" ? "user" : block.kind === "system" ? "system" : block.kind === "tool-call" || block.kind === "tool-result" ? "tool" : "assistant";
|
|
107
|
+
return { id: block.id, role, status: block.status === "live" ? "streaming" : "final", content: [{ kind: "text", text: block.text }] };
|
|
108
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { composeOwnedUi, composeOwnedUiApplication, type OwnedUiComposition, type OwnedUiCompositionOptions, } from "./owned-ui.js";
|
|
2
|
+
export { composeProcess, type ProcessComposition, type ProcessCompositionOptions, } from "./process.js";
|
|
3
|
+
export { createOwnedRouteHost } from "./settings-route-host.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type PiEngineAdapter } from "../integrations/pi/engine/index.js";
|
|
2
|
+
import { OwnedUiSettingsSession } from "../ui/settings/index.js";
|
|
3
|
+
import type { OwnedUiApplicationPort, PresentationTerminalPort } from "../contracts/presentation/index.js";
|
|
4
|
+
export interface OwnedUiCompositionOptions {
|
|
5
|
+
readonly cwd?: string;
|
|
6
|
+
readonly terminal?: PresentationTerminalPort;
|
|
7
|
+
readonly createPiAdapter?: () => Promise<PiEngineAdapter>;
|
|
8
|
+
/**
|
|
9
|
+
* A1 profile whose settings this session reads and writes. Omitted keeps the
|
|
10
|
+
* session settings-free, which is what the pinned comparison paths use.
|
|
11
|
+
*/
|
|
12
|
+
readonly profileId?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether A1's product-specific surfaces are reachable. Comparison profiles
|
|
15
|
+
* use the same composition with those surfaces withheld.
|
|
16
|
+
*/
|
|
17
|
+
readonly ownedSurfaces?: "on" | "off";
|
|
18
|
+
}
|
|
19
|
+
export interface OwnedUiComposition {
|
|
20
|
+
readonly application: OwnedUiApplicationPort;
|
|
21
|
+
/** Present when a profile was supplied, so the caller can resolve settings before start. */
|
|
22
|
+
readonly settings: OwnedUiSettingsSession | null;
|
|
23
|
+
}
|
|
24
|
+
export declare function composeOwnedUiApplication(options?: OwnedUiCompositionOptions): Promise<OwnedUiApplicationPort>;
|
|
25
|
+
export declare function composeOwnedUi(options?: OwnedUiCompositionOptions): Promise<OwnedUiComposition>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { resolveProductPaths } from "../foundation/lifecycle/index.js";
|
|
2
|
+
import { applyConfiguredPiTheme, getAvailablePiThemes } from "../integrations/pi/components/index.js";
|
|
3
|
+
import { createPiEngineAdapter } from "../integrations/pi/engine/index.js";
|
|
4
|
+
import { OwnedUiSessionShell } from "../integrations/pi/owned-ui/index.js";
|
|
5
|
+
import { OwnedUiSettingsSession, OwnedUiSettingsStore } from "../ui/settings/index.js";
|
|
6
|
+
import { createPiTerminalBridge } from "../integrations/pi/tui-runtime/index.js";
|
|
7
|
+
import { createOwnedRouteHost } from "./settings-route-host.js";
|
|
8
|
+
export async function composeOwnedUiApplication(options = {}) {
|
|
9
|
+
return (await composeOwnedUi(options)).application;
|
|
10
|
+
}
|
|
11
|
+
export async function composeOwnedUi(options = {}) {
|
|
12
|
+
const cwd = options.cwd ?? process.cwd();
|
|
13
|
+
const adapter = options.createPiAdapter
|
|
14
|
+
? await options.createPiAdapter()
|
|
15
|
+
: await createPiEngineAdapter({ cwd, availableThemes: () => getAvailablePiThemes().map(theme => theme.name) });
|
|
16
|
+
const settings = options.profileId === undefined
|
|
17
|
+
? null
|
|
18
|
+
: new OwnedUiSettingsSession({
|
|
19
|
+
store: new OwnedUiSettingsStore({ configDir: resolveProductPaths().configDir, profileId: options.profileId }),
|
|
20
|
+
agentProvider: () => adapter.settingsPort(),
|
|
21
|
+
});
|
|
22
|
+
// Before anything is drawn, so every surface uses the configured theme rather
|
|
23
|
+
// than the one guessed from the terminal's background.
|
|
24
|
+
applyConfiguredPiTheme(adapter.configuredTheme());
|
|
25
|
+
const routeHost = settings === null || options.ownedSurfaces === "off" ? null : createOwnedRouteHost(settings);
|
|
26
|
+
const shell = new OwnedUiSessionShell({
|
|
27
|
+
backend: adapter,
|
|
28
|
+
cwd,
|
|
29
|
+
...(options.terminal === undefined ? {} : { terminal: createPiTerminalBridge(options.terminal) }),
|
|
30
|
+
...(routeHost === null ? {} : { routeHost }),
|
|
31
|
+
});
|
|
32
|
+
const application = {
|
|
33
|
+
get disposed() { return adapter.disposed; },
|
|
34
|
+
start: () => shell.start(),
|
|
35
|
+
flush: () => adapter.flushEvents(),
|
|
36
|
+
waitUntilStopped: () => shell.waitUntilStopped(),
|
|
37
|
+
dispose: () => shell.dispose(),
|
|
38
|
+
};
|
|
39
|
+
return { application, settings };
|
|
40
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type AgentEnginePort } from "../contracts/agent-engine/index.js";
|
|
2
|
+
import { type PiEngineAdapter } from "../integrations/pi/engine/index.js";
|
|
3
|
+
import { type PresentationComponentPort, type PresentationRuntimePort, type PresentationTerminalPort } from "../contracts/presentation/index.js";
|
|
4
|
+
export interface ProcessCompositionOptions {
|
|
5
|
+
readonly cwd?: string;
|
|
6
|
+
readonly sessionId?: string;
|
|
7
|
+
readonly engine?: AgentEnginePort;
|
|
8
|
+
readonly presentationFactory?: (root: PresentationComponentPort, terminal: PresentationTerminalPort) => PresentationRuntimePort;
|
|
9
|
+
readonly createPiAdapter?: () => Promise<PiEngineAdapter>;
|
|
10
|
+
}
|
|
11
|
+
export interface ProcessComposition {
|
|
12
|
+
readonly engine: AgentEnginePort;
|
|
13
|
+
createPresentation(root: PresentationComponentPort, terminal: PresentationTerminalPort): PresentationRuntimePort;
|
|
14
|
+
dispose(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare function composeProcess(options?: ProcessCompositionOptions): Promise<ProcessComposition>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { assertAgentCapabilityContract, } from "../contracts/agent-engine/index.js";
|
|
2
|
+
import { createPiEngineAdapter } from "../integrations/pi/engine/index.js";
|
|
3
|
+
import { createPiPresentationRuntime } from "../integrations/pi/tui-runtime/index.js";
|
|
4
|
+
import { assertPresentationComponent, assertPresentationRuntime, } from "../contracts/presentation/index.js";
|
|
5
|
+
import { createPiAgentEngineBridge } from "./agent-engine-bridge.js";
|
|
6
|
+
export async function composeProcess(options = {}) {
|
|
7
|
+
let engine = options.engine;
|
|
8
|
+
if (!engine) {
|
|
9
|
+
const adapter = options.createPiAdapter
|
|
10
|
+
? await options.createPiAdapter()
|
|
11
|
+
: await createPiEngineAdapter({
|
|
12
|
+
...(options.cwd === undefined ? {} : { cwd: options.cwd }),
|
|
13
|
+
...(options.sessionId === undefined ? {} : { sessionId: options.sessionId }),
|
|
14
|
+
});
|
|
15
|
+
engine = createPiAgentEngineBridge(adapter, options.cwd ?? process.cwd());
|
|
16
|
+
}
|
|
17
|
+
assertAgentCapabilityContract(engine.capabilities);
|
|
18
|
+
if (typeof engine.createSession !== "function" || typeof engine.dispose !== "function")
|
|
19
|
+
throw new TypeError("composed engine does not satisfy the neutral engine port");
|
|
20
|
+
const presentations = new Set();
|
|
21
|
+
let disposed = false;
|
|
22
|
+
return {
|
|
23
|
+
engine,
|
|
24
|
+
createPresentation(root, terminal) {
|
|
25
|
+
if (disposed)
|
|
26
|
+
throw new Error("process composition is disposed");
|
|
27
|
+
assertPresentationComponent(root);
|
|
28
|
+
const runtime = options.presentationFactory?.(root, terminal) ?? createPiPresentationRuntime(root, terminal);
|
|
29
|
+
assertPresentationRuntime(runtime);
|
|
30
|
+
presentations.add(runtime);
|
|
31
|
+
return runtime;
|
|
32
|
+
},
|
|
33
|
+
async dispose() {
|
|
34
|
+
if (disposed)
|
|
35
|
+
return;
|
|
36
|
+
disposed = true;
|
|
37
|
+
const failures = [];
|
|
38
|
+
for (const runtime of [...presentations].reverse())
|
|
39
|
+
await runtime.stop().catch(error => failures.push(error));
|
|
40
|
+
await engine.dispose().catch(error => failures.push(error));
|
|
41
|
+
if (failures.length)
|
|
42
|
+
throw new AggregateError(failures, "process composition disposal failed");
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UiRouteHost } from "../integrations/pi/owned-ui/index.js";
|
|
2
|
+
import type { OwnedUiSettingsSession } from "../ui/settings/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Registers the A1-owned screens and adapts the app host to the shell's route
|
|
5
|
+
* seam. The shell mounts whatever surface it is handed and forwards keys; it
|
|
6
|
+
* never learns what an app is.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createOwnedRouteHost(settings: OwnedUiSettingsSession): UiRouteHost;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { SETTINGS_APP_ID, SETTINGS_ROUTE, SettingsApp } from "../features/owned-ui/index.js";
|
|
2
|
+
import { piTheme } from "../integrations/pi/components/index.js";
|
|
3
|
+
import { UiAppHost, UiAppRegistry } from "../ui/apps/index.js";
|
|
4
|
+
import { faint } from "../ui/components/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Registers the A1-owned screens and adapts the app host to the shell's route
|
|
7
|
+
* seam. The shell mounts whatever surface it is handed and forwards keys; it
|
|
8
|
+
* never learns what an app is.
|
|
9
|
+
*/
|
|
10
|
+
export function createOwnedRouteHost(settings) {
|
|
11
|
+
const registry = new UiAppRegistry();
|
|
12
|
+
registry.register({ id: SETTINGS_APP_ID, route: SETTINGS_ROUTE, create: () => new SettingsApp(settings) });
|
|
13
|
+
return {
|
|
14
|
+
claims: route => registry.forRoute(route) !== null,
|
|
15
|
+
open: route => {
|
|
16
|
+
const registration = registry.forRoute(route);
|
|
17
|
+
if (registration === null)
|
|
18
|
+
return null;
|
|
19
|
+
let size = { width: 80, height: 24 };
|
|
20
|
+
let frame = [];
|
|
21
|
+
let closed = false;
|
|
22
|
+
let onRender = () => undefined;
|
|
23
|
+
let onExit = () => undefined;
|
|
24
|
+
const host = new UiAppHost({
|
|
25
|
+
registry,
|
|
26
|
+
closeOnInterrupt: true,
|
|
27
|
+
theme: pinnedTheme(),
|
|
28
|
+
surface: {
|
|
29
|
+
size: () => size,
|
|
30
|
+
requestRender: () => onRender(),
|
|
31
|
+
exit: () => onExit(),
|
|
32
|
+
present: lines => {
|
|
33
|
+
if (lines === null)
|
|
34
|
+
closed = true;
|
|
35
|
+
else
|
|
36
|
+
frame = lines;
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
host.open(registration.id);
|
|
41
|
+
const surface = {
|
|
42
|
+
id: registration.id,
|
|
43
|
+
render: (width, height) => {
|
|
44
|
+
size = { width, height };
|
|
45
|
+
host.render();
|
|
46
|
+
return frame.length === height ? frame : [...frame.slice(0, height), ...Array(Math.max(0, height - frame.length)).fill("")];
|
|
47
|
+
},
|
|
48
|
+
handleInput: data => host.handleInput(data).consumed,
|
|
49
|
+
handleMouse: event => host.handleMouse(event).consumed,
|
|
50
|
+
isClosed: () => closed || !host.isPresenting,
|
|
51
|
+
close: () => host.close(),
|
|
52
|
+
onRenderRequested: listener => { onRender = listener; },
|
|
53
|
+
onExitRequested: listener => { onExit = listener; },
|
|
54
|
+
};
|
|
55
|
+
return surface;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/** Maps A1 UI tokens onto the pinned Pi theme so owned screens match the shell. */
|
|
60
|
+
function pinnedTheme() {
|
|
61
|
+
return {
|
|
62
|
+
fg: (token, text) => piTheme().fg(token, text),
|
|
63
|
+
bold: (text) => piTheme().bold(text),
|
|
64
|
+
// Unpainted, so a list reads against the terminal the reader actually has
|
|
65
|
+
// rather than against the background the configured theme was built for.
|
|
66
|
+
plain: (text) => text,
|
|
67
|
+
// Quiet, and quieter again: the terminal's own faint attribute over the
|
|
68
|
+
// dimmest colour the theme has.
|
|
69
|
+
disabled: (text) => faint(piTheme().fg("dim", text)),
|
|
70
|
+
highlight: (text) => `[48;2;82;82;82m[97m${text}[39m[49m`,
|
|
71
|
+
panel: (text) => `[48;2;55;55;55m${text}[49m`,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type OwnedUiCommand, type OwnedUiCustomization, type OwnedUiSlotId, type OwnedUiTranscriptBlock } from "../../
|
|
1
|
+
import { type OwnedUiCommand, type OwnedUiCustomization, type OwnedUiSlotId, type OwnedUiTranscriptBlock } from "../../contracts/owned-ui/index.js";
|
|
2
2
|
export interface OwnedUiSlotImplementation {
|
|
3
3
|
readonly payload: unknown;
|
|
4
4
|
render?(input: unknown, width: number): readonly string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OwnedUiDiagnostics } from "../../
|
|
1
|
+
import type { OwnedUiDiagnostics } from "../../contracts/owned-ui/index.js";
|
|
2
2
|
export interface OwnedUiFrameObservation {
|
|
3
3
|
readonly requestedFrames: number;
|
|
4
4
|
readonly presentedFrames: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { OwnedUiApplicationPort } from "../../
|
|
2
|
-
import type { OwnedUiSettingsSession } from "../../
|
|
1
|
+
import type { OwnedUiApplicationPort } from "../../contracts/presentation/index.js";
|
|
2
|
+
import type { OwnedUiSettingsSession } from "../../ui/settings/index.js";
|
|
3
3
|
export interface OwnedUiRunOptions {
|
|
4
4
|
readonly application: OwnedUiApplicationPort;
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AppHostServices, UiApp } from "../../
|
|
2
|
-
import { ShortcutRegistry, type PaneInputResult, type PaneMouseEvent, type PaneRect } from "../../
|
|
3
|
-
import type { OwnedUiSettingsSession } from "../../
|
|
1
|
+
import type { AppHostServices, UiApp } from "../../ui/apps/index.js";
|
|
2
|
+
import { ShortcutRegistry, type PaneInputResult, type PaneMouseEvent, type PaneRect } from "../../ui/components/index.js";
|
|
3
|
+
import type { OwnedUiSettingsSession } from "../../ui/settings/index.js";
|
|
4
4
|
export declare const SETTINGS_APP_ID = "settings";
|
|
5
5
|
export declare const SETTINGS_ROUTE = "settings";
|
|
6
6
|
type Action = "move-up" | "move-down" | "block-up" | "block-down" | "first" | "last" | "page-up" | "page-down" | "previous-value" | "next-value" | "activate" | "open-filter" | "close" | "part-previous" | "part-next" | "part-change";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GLOBAL_SCOPE, LineInput, PLAIN_THEME, ShortcutRegistry, PROMPT_GLYPH, blockJumpTarget, dialogValueColumn, numericValues, RAIL_COLUMNS, renderDialogPanel, renderEmptyState, renderGroupHeader, renderInputRow, renderStatusLine, renderListRow, renderNote, dialogRowAt, menuRowAt, regionAt, renderValueMenu, withScrollbarRail, stepperEnds, steppedValue, valueColumnFor, valueMenuFrame, promptRule, caretCell, blockRowSpan, displayWidth, faint, handleLineInputKey, humanizeLabel, humanizeTitle, indexOfKey, isThumbRow, layoutList, moveSelection, rowKey, scrollForSelection, scrollbarGeometry, selectableIndexes, } from "../../
|
|
1
|
+
import { GLOBAL_SCOPE, LineInput, PLAIN_THEME, ShortcutRegistry, PROMPT_GLYPH, blockJumpTarget, dialogValueColumn, numericValues, RAIL_COLUMNS, renderDialogPanel, renderEmptyState, renderGroupHeader, renderInputRow, renderStatusLine, renderListRow, renderNote, dialogRowAt, menuRowAt, regionAt, renderValueMenu, withScrollbarRail, stepperEnds, steppedValue, valueColumnFor, valueMenuFrame, promptRule, caretCell, blockRowSpan, displayWidth, faint, handleLineInputKey, humanizeLabel, humanizeTitle, indexOfKey, isThumbRow, layoutList, moveSelection, rowKey, scrollForSelection, scrollbarGeometry, selectableIndexes, } from "../../ui/components/index.js";
|
|
2
2
|
export const SETTINGS_APP_ID = "settings";
|
|
3
3
|
export const SETTINGS_ROUTE = "settings";
|
|
4
4
|
const SCOPE = SETTINGS_APP_ID;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ManagedAgentDescriptor } from "../../
|
|
1
|
+
import type { ManagedAgentDescriptor } from "../../contracts/workspace/index.js";
|
|
2
2
|
export type WorkspaceCapabilityAction = {
|
|
3
3
|
readonly type: "structured-command";
|
|
4
4
|
readonly command: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ManagedAgentDescriptor } from "../../
|
|
1
|
+
import { type ManagedAgentDescriptor } from "../../contracts/workspace/index.js";
|
|
2
2
|
export interface WorkspaceAgentFailure {
|
|
3
3
|
readonly code: string;
|
|
4
4
|
readonly message: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assertManagedAgentDescriptor, } from "../../
|
|
1
|
+
import { assertManagedAgentDescriptor, } from "../../contracts/workspace/index.js";
|
|
2
2
|
const REMOVABLE_STATES = new Set(["stopped", "failed", "discontinuous"]);
|
|
3
3
|
export class WorkspaceReducer {
|
|
4
4
|
workspaceId;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type StructuredCommandRecord } from "../../foundation/structured-agent-runtime/index.js";
|
|
2
|
-
import type { ManagedAgentDescriptor } from "../../
|
|
2
|
+
import type { ManagedAgentDescriptor } from "../../contracts/workspace/index.js";
|
|
3
3
|
import { WorkspaceReducer, type WorkspaceAgentState, type WorkspaceView } from "./reducer.js";
|
|
4
4
|
export interface RoutedStructuredCommand {
|
|
5
5
|
readonly agentId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentRecoveryAuthority, RecoveryReferenceId } from "../../
|
|
1
|
+
import type { AgentRecoveryAuthority, RecoveryReferenceId } from "../../contracts/workspace/index.js";
|
|
2
2
|
import { WorkspaceReducer, type WorkspaceView } from "./reducer.js";
|
|
3
3
|
export declare class WorkspaceStore {
|
|
4
4
|
#private;
|
|
@@ -4,7 +4,7 @@ import { resolve } from "node:path";
|
|
|
4
4
|
import { assertLaunchProfileId } from "../lifecycle/index.js";
|
|
5
5
|
import { closeVerifiedContainment, LinuxNativeProcessInspector, NativeGuardianContainment, resolveProcessGuardianPath, verifyProcessGuardianArtifact, WindowsNativeProcessInspector, } from "../process-containment/index.js";
|
|
6
6
|
import { SupervisorClient } from "../protocol/index.js";
|
|
7
|
-
import { resolveProductPaths } from "../supervision/index.js";
|
|
7
|
+
import { resolveCohortEndpoint, resolveProductPaths } from "../supervision/index.js";
|
|
8
8
|
export async function runLaunchGuardian(options) {
|
|
9
9
|
assertLaunchProfileId(options.profileId);
|
|
10
10
|
const environment = { ...(options.environment ?? process.env) };
|
|
@@ -17,7 +17,13 @@ export async function runLaunchGuardian(options) {
|
|
|
17
17
|
if (!guardianIdentity)
|
|
18
18
|
throw diagnosticError("launch guardian cannot verify its own native process identity", "PROCESS_IDENTITY_UNAVAILABLE");
|
|
19
19
|
const client = options.control ?? new SupervisorClient(environment[PRODUCT_IDENTITY.environment.releaseId]);
|
|
20
|
-
|
|
20
|
+
// An instance belongs to the cohort that launched it and talks to that cohort's endpoint
|
|
21
|
+
// for its whole life, whatever release becomes the active one meanwhile.
|
|
22
|
+
const releaseId = environment[PRODUCT_IDENTITY.environment.releaseId];
|
|
23
|
+
const endpoint = releaseId
|
|
24
|
+
? resolveCohortEndpoint(paths, releaseId, environment).endpoint
|
|
25
|
+
: paths.endpoint;
|
|
26
|
+
await client.connect(endpoint);
|
|
21
27
|
const containment = options.containment ?? new NativeGuardianContainment(instanceId, helperPath, resolve(paths.runtimeDir, "launch-instances", `${instanceId}.ready.json`));
|
|
22
28
|
const stop = stopRequests(client, instanceId);
|
|
23
29
|
let rootIdentity = null;
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
readonly supervisorLogPath: string;
|
|
12
|
+
}
|
|
13
|
+
/** Where one cohort listens, and where it records that it is listening. */
|
|
14
|
+
export interface CohortEndpointPaths {
|
|
15
|
+
readonly endpoint: string;
|
|
16
|
+
readonly endpointMetadataPath: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Endpoint identity for one release cohort. Two cohorts can be live at once — an update
|
|
20
|
+
* leaves a working session on the release it started on — so the name a supervisor listens
|
|
21
|
+
* on has to name the release as well as the runtime directory, or the two contend for one
|
|
22
|
+
* endpoint and replacing one means ending the other.
|
|
23
|
+
*
|
|
24
|
+
* An explicit endpoint override keeps its single endpoint: it is how an isolated run pins
|
|
25
|
+
* the address it is going to talk to.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveCohortEndpoint(paths: ProductPaths, releaseId: string, environment?: NodeJS.ProcessEnv, hostPlatform?: NodeJS.Platform): CohortEndpointPaths;
|
|
28
|
+
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.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;
|
|
@@ -37,6 +57,7 @@ export function resolveProductPaths(environment = process.env, hostPlatform = pl
|
|
|
37
57
|
databasePath: path.resolve(databaseOverride ?? path.join(dataDir, PRODUCT_IDENTITY.endpoint.databaseFilename)),
|
|
38
58
|
endpoint,
|
|
39
59
|
endpointMetadataPath: path.join(runtimeDir, PRODUCT_IDENTITY.endpoint.metadataFilename),
|
|
60
|
+
endpointsDir: path.join(runtimeDir, "endpoints"),
|
|
40
61
|
supervisorLogPath: path.join(runtimeDir, PRODUCT_IDENTITY.endpoint.supervisorLogFilename),
|
|
41
62
|
};
|
|
42
63
|
}
|
|
@@ -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;
|