@timurproko/a1 0.1.8-dev.0b6d8cc → 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/README.md +29 -23
- 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}/dispatch.js +14 -12
- package/dist/{src/cli → cli}/packages.d.ts +10 -2
- package/dist/{src/cli → cli}/packages.js +24 -20
- package/dist/{src/cli → cli}/version-stats.js +4 -4
- 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 +9 -1
- package/dist/{src/foundation → foundation}/release/update.js +69 -35
- 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 +113 -16
- 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} +13 -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 +24 -704
- 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 +5 -5
- package/docs/ci-release-runbook.md +76 -79
- package/docs/features/launch-profiles.md +7 -9
- package/docs/manual-owned-ui-checkpoint.md +52 -0
- package/docs/manual-terminal-colour-check.md +1 -1
- package/package.json +24 -22
- 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}/index.d.ts +0 -0
- /package/dist/{src/cli → cli}/index.js +0 -0
- /package/dist/{src/cli → cli}/version-stats.d.ts +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/README.md
CHANGED
|
@@ -10,13 +10,14 @@ npm install --global @timurproko/a1@latest
|
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
12
|
a1 # A1-owned UI and profile: ~/.a1/agent
|
|
13
|
-
a1 version # show Installed, Release
|
|
14
|
-
a1 update # update to
|
|
15
|
-
a1 update:
|
|
13
|
+
a1 version # show Installed, Release, and Develop versions
|
|
14
|
+
a1 update # update to the current release
|
|
15
|
+
a1 update:develop # update to the current development preview
|
|
16
|
+
a1 update:107 # install numbered development preview 107
|
|
16
17
|
a1 update --models # refresh A1's model catalogs
|
|
17
18
|
```
|
|
18
19
|
|
|
19
|
-
Prerelease builds — what `a1 update:
|
|
20
|
+
Prerelease builds — what `a1 update:develop` installs — add two development profiles
|
|
20
21
|
for comparing against pinned Pi and for experimenting against an isolated profile.
|
|
21
22
|
A release build does not carry them.
|
|
22
23
|
|
|
@@ -63,24 +64,30 @@ npm run test:full # complete non-physical suite
|
|
|
63
64
|
Two channels, both published by CI from the exact bytes it validated. Nothing is
|
|
64
65
|
ever published from a workstation.
|
|
65
66
|
|
|
66
|
-
###
|
|
67
|
+
### Development previews
|
|
67
68
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
installed preview says exactly which source produced it.
|
|
69
|
+
Ordinary pushes to `develop` do not publish. The nightly run at `03:17 UTC` always
|
|
70
|
+
performs complete verification of current `origin/develop`; it publishes only when
|
|
71
|
+
that source's preview is absent. A maintainer can request the same authoritative
|
|
72
|
+
GitHub Actions path and wait for its result:
|
|
73
73
|
|
|
74
74
|
```sh
|
|
75
|
-
|
|
76
|
-
a1 update:7eabe9e # install the preview built from that commit
|
|
75
|
+
npm run develop
|
|
77
76
|
```
|
|
78
77
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
A preview is `<major.minor.patch>-dev.<pull-request number>`, stamped only into the
|
|
79
|
+
package. For example, the source GitHub presents as `develop (#107)` produces
|
|
80
|
+
`0.1.8-dev.107`. Repeating a request for immutable version 107 succeeds without
|
|
81
|
+
building or publishing again.
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
a1 update:develop # install the current development preview
|
|
85
|
+
a1 update:107 # install preview 107
|
|
86
|
+
a1 update:0.1.8-dev.107 # install that exact full preview version
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The published version list is authoritative: an unpublished number is refused
|
|
90
|
+
rather than guessed. npm's `next` dist-tag remains an internal registry detail.
|
|
84
91
|
|
|
85
92
|
### Stable — npm `latest`
|
|
86
93
|
|
|
@@ -93,12 +100,11 @@ npm run release -- major # 0.1.1 -> 1.0.0
|
|
|
93
100
|
npm run release -- 0.4.0 # an exact version
|
|
94
101
|
```
|
|
95
102
|
|
|
96
|
-
It lands the version on `develop` through a pull request that merges itself
|
|
97
|
-
|
|
98
|
-
on Windows, Linux, and macOS, publishes to npm
|
|
99
|
-
then writes the `v<version>` tag and records the
|
|
100
|
-
|
|
101
|
-
immediately.
|
|
103
|
+
It lands the version on `develop` through a pull request that merges itself, then
|
|
104
|
+
explicitly dispatches publication for that exact commit. GitHub Actions builds,
|
|
105
|
+
validates the packed release on Windows, Linux, and macOS, publishes to npm
|
|
106
|
+
`latest` with provenance, and only then writes the `v<version>` tag and records the
|
|
107
|
+
GitHub Release. The command waits for success before opening the next `-dev` line.
|
|
102
108
|
|
|
103
109
|
```sh
|
|
104
110
|
a1 update # install the newest stable release
|
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 }) });
|
|
@@ -6,8 +6,8 @@ export function cliUsage(capabilities) {
|
|
|
6
6
|
...(capabilities.developmentProfiles ? ["pi", "sandbox"] : []),
|
|
7
7
|
"version",
|
|
8
8
|
"update [self|--models]",
|
|
9
|
-
"update:
|
|
10
|
-
"update:<
|
|
9
|
+
"update:develop",
|
|
10
|
+
"update:<number>",
|
|
11
11
|
"pi install <source>",
|
|
12
12
|
"pi remove <source>",
|
|
13
13
|
"pi list",
|
|
@@ -58,20 +58,22 @@ export function parseCliCommand(arguments_, capabilities) {
|
|
|
58
58
|
return { kind: "error", message: PRODUCT_TEXT.diagnostic(`received an unknown command: ${command ?? ""}`) };
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
* What follows the colon says which build to move to. `
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* commit alone is enough to find it.
|
|
61
|
+
* What follows the colon says which development build to move to. `develop`
|
|
62
|
+
* selects the channel head; a positive decimal or a full numbered preview names
|
|
63
|
+
* one immutable publication.
|
|
65
64
|
*/
|
|
66
65
|
function parseColonUpdate(suffix, rest) {
|
|
67
66
|
if (rest.length > 0)
|
|
68
67
|
return { kind: "error", message: PRODUCT_TEXT.diagnostic("update takes what to move to after the colon, and nothing else.") };
|
|
69
|
-
if (suffix === "next")
|
|
68
|
+
if (suffix === "next") {
|
|
69
|
+
return { kind: "error", message: PRODUCT_TEXT.diagnostic(`renamed its development channel; run ${PRODUCT_TEXT.commandName} update:develop.`) };
|
|
70
|
+
}
|
|
71
|
+
if (suffix === "develop")
|
|
70
72
|
return { kind: "update", channel: "next" };
|
|
71
73
|
if (suffix.length === 0)
|
|
72
|
-
return { kind: "error", message: PRODUCT_TEXT.diagnostic(`update: needs a preview after the colon, as in ${PRODUCT_TEXT.commandName} update:
|
|
73
|
-
if (!/^[
|
|
74
|
-
return { kind: "error", message: PRODUCT_TEXT.diagnostic(`received an unusable preview: ${suffix}`) };
|
|
74
|
+
return { kind: "error", message: PRODUCT_TEXT.diagnostic(`update: needs a preview after the colon, as in ${PRODUCT_TEXT.commandName} update:develop.`) };
|
|
75
|
+
if (!/^[1-9]\d*$/.test(suffix) && !/^\d+\.\d+\.\d+-dev\.[1-9]\d*$/.test(suffix)) {
|
|
76
|
+
return { kind: "error", message: PRODUCT_TEXT.diagnostic(`received an unusable numbered preview: ${suffix}`) };
|
|
75
77
|
}
|
|
76
78
|
return { kind: "update", channel: "next", target: suffix };
|
|
77
79
|
}
|
|
@@ -94,8 +96,8 @@ function parseUpdate(rest) {
|
|
|
94
96
|
message: PRODUCT_TEXT.diagnostic(`pins the Pi version it was certified against; run ${PRODUCT_TEXT.commandName} update to move ${PRODUCT_TEXT.displayName} itself.`),
|
|
95
97
|
};
|
|
96
98
|
}
|
|
97
|
-
if (target === "next" || target === "stable") {
|
|
98
|
-
const form = target === "
|
|
99
|
+
if (target === "next" || target === "develop" || target === "stable") {
|
|
100
|
+
const form = target === "stable" ? `${PRODUCT_TEXT.commandName} update` : `${PRODUCT_TEXT.commandName} update:develop`;
|
|
99
101
|
return { kind: "error", message: PRODUCT_TEXT.diagnostic(`selects a release channel with a colon; run ${form}.`) };
|
|
100
102
|
}
|
|
101
103
|
if (target === "--models")
|
|
@@ -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
|
|
@@ -11,6 +11,12 @@ export interface PackageCommandRequest {
|
|
|
11
11
|
readonly verb: PackageCommandVerb;
|
|
12
12
|
readonly source: string | null;
|
|
13
13
|
}
|
|
14
|
+
export interface PackageCommandStyle {
|
|
15
|
+
readonly dim: (message: string) => string;
|
|
16
|
+
readonly bold: (message: string) => string;
|
|
17
|
+
readonly green: (message: string) => string;
|
|
18
|
+
readonly red: (message: string) => string;
|
|
19
|
+
}
|
|
14
20
|
export interface PackageCommandEnvironment {
|
|
15
21
|
readonly createPort: (input: AgentPackagesPortInput) => AgentPackagesPort;
|
|
16
22
|
readonly cwd?: string;
|
|
@@ -18,6 +24,8 @@ export interface PackageCommandEnvironment {
|
|
|
18
24
|
readonly stdout?: (message: string) => void;
|
|
19
25
|
readonly stderr?: (message: string) => void;
|
|
20
26
|
readonly initializeProfile?: typeof initializeProductProfile;
|
|
27
|
+
/** Defaults to Chalk's terminal-aware styles; injectable for transcript tests. */
|
|
28
|
+
readonly style?: PackageCommandStyle;
|
|
21
29
|
}
|
|
22
30
|
export declare function runPackageCommand(request: PackageCommandRequest, environment: PackageCommandEnvironment): Promise<number>;
|
|
23
|
-
export declare function renderPackageOutcome(outcome: AgentPackageOutcome, profileRoot: string): string;
|
|
31
|
+
export declare function renderPackageOutcome(outcome: AgentPackageOutcome, profileRoot: string, style?: PackageCommandStyle): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
1
2
|
import { configurationRootForProfile, initializeProductProfile, resolveLaunchProfilePaths } from "../features/launch/index.js";
|
|
2
3
|
import { PRODUCT_TEXT } from "../product-identity.js";
|
|
3
4
|
export async function runPackageCommand(request, environment) {
|
|
@@ -5,6 +6,7 @@ export async function runPackageCommand(request, environment) {
|
|
|
5
6
|
const stderr = environment.stderr ?? (message => process.stderr.write(message));
|
|
6
7
|
const cwd = environment.cwd ?? process.cwd();
|
|
7
8
|
const processEnvironment = environment.environment ?? process.env;
|
|
9
|
+
const style = environment.style ?? chalk;
|
|
8
10
|
const paths = resolveLaunchProfilePaths({ environment: processEnvironment });
|
|
9
11
|
const profileRoot = configurationRootForProfile("a1", paths);
|
|
10
12
|
if (profileRoot === null)
|
|
@@ -19,10 +21,10 @@ export async function runPackageCommand(request, environment) {
|
|
|
19
21
|
const port = environment.createPort({
|
|
20
22
|
profileRoot,
|
|
21
23
|
cwd,
|
|
22
|
-
onProgress: progress => stdout(`${progress.message}\n`),
|
|
24
|
+
onProgress: progress => stdout(`${style.dim(progress.message)}\n`),
|
|
23
25
|
});
|
|
24
26
|
const outcome = await runVerb(port, request);
|
|
25
|
-
const rendered = renderPackageOutcome(outcome, profileRoot);
|
|
27
|
+
const rendered = renderPackageOutcome(outcome, profileRoot, style);
|
|
26
28
|
(outcome.status === "completed" ? stdout : stderr)(rendered);
|
|
27
29
|
return outcome.status === "completed" ? 0 : 1;
|
|
28
30
|
}
|
|
@@ -37,38 +39,40 @@ async function runVerb(port, request) {
|
|
|
37
39
|
throw new Error(PRODUCT_TEXT.diagnostic(`requires a source for ${request.verb}`));
|
|
38
40
|
return request.verb === "install" ? await port.install(request.source) : await port.remove(request.source);
|
|
39
41
|
}
|
|
40
|
-
export function renderPackageOutcome(outcome, profileRoot) {
|
|
41
|
-
|
|
42
|
+
export function renderPackageOutcome(outcome, profileRoot, style = chalk) {
|
|
43
|
+
// Model refresh remains an A1 top-level command. The `a1 pi` compatibility
|
|
44
|
+
// transcript applies to package operations only.
|
|
45
|
+
if (outcome.operation === "refresh-models") {
|
|
46
|
+
if (outcome.status === "failed") {
|
|
47
|
+
return `${PRODUCT_TEXT.diagnostic(`could not ${describeOperation(outcome.operation)}: ${outcome.detail ?? "unknown failure"}`)}\n`;
|
|
48
|
+
}
|
|
49
|
+
return `${PRODUCT_TEXT.displayName} refreshed the model catalogs in ${profileRoot}.\n`;
|
|
50
|
+
}
|
|
42
51
|
if (outcome.status === "failed") {
|
|
43
|
-
return `${
|
|
52
|
+
return `${style.red(`Error: ${outcome.detail ?? "Unknown package command error"}`)}\n`;
|
|
44
53
|
}
|
|
45
54
|
if (outcome.status === "not-found") {
|
|
46
|
-
return `${
|
|
55
|
+
return `${style.red(`No matching package found for ${outcome.source ?? "that source"}`)}\n`;
|
|
47
56
|
}
|
|
48
57
|
switch (outcome.operation) {
|
|
49
58
|
case "install":
|
|
50
|
-
return `${
|
|
51
|
-
+ `Restart ${PRODUCT_TEXT.commandName} for a running session to load it.\n`;
|
|
59
|
+
return `${style.green(`Installed ${outcome.source}`)}\n`;
|
|
52
60
|
case "remove":
|
|
53
|
-
return `${
|
|
61
|
+
return `${style.green(`Removed ${outcome.source}`)}\n`;
|
|
54
62
|
case "update":
|
|
55
|
-
return outcome.source === null
|
|
56
|
-
? `${name} updated the packages in ${profileRoot}.\n`
|
|
57
|
-
: `${name} updated ${outcome.source}.\n`;
|
|
58
|
-
case "refresh-models":
|
|
59
|
-
return `${name} refreshed the model catalogs in ${profileRoot}.\n`;
|
|
63
|
+
return `${style.green(outcome.source === null ? "Updated packages" : `Updated ${outcome.source}`)}\n`;
|
|
60
64
|
case "list":
|
|
61
|
-
return renderPackageList(outcome,
|
|
65
|
+
return renderPackageList(outcome, style);
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
|
-
function renderPackageList(outcome,
|
|
68
|
+
function renderPackageList(outcome, style) {
|
|
65
69
|
if (outcome.packages.length === 0)
|
|
66
|
-
return `${
|
|
67
|
-
const lines = [
|
|
70
|
+
return `${style.dim("No packages installed.")}\n`;
|
|
71
|
+
const lines = [style.bold("User packages:")];
|
|
68
72
|
for (const entry of outcome.packages) {
|
|
69
|
-
lines.push(` ${entry.source}${entry.filtered ? " (
|
|
73
|
+
lines.push(` ${entry.source}${entry.filtered ? " (filtered)" : ""}`);
|
|
70
74
|
if (entry.installedPath !== null)
|
|
71
|
-
lines.push(` ${entry.installedPath}`);
|
|
75
|
+
lines.push(style.dim(` ${entry.installedPath}`));
|
|
72
76
|
}
|
|
73
77
|
return `${lines.join("\n")}\n`;
|
|
74
78
|
}
|
|
@@ -21,7 +21,7 @@ export async function runVersionStats(options) {
|
|
|
21
21
|
return 1;
|
|
22
22
|
}
|
|
23
23
|
const remote = await queryDistTags(runner);
|
|
24
|
-
output.stdout(`Installed: ${installed}\nRelease: ${remote.release ?? "unavailable"}\
|
|
24
|
+
output.stdout(`Installed: ${installed}\nRelease: ${remote.release ?? "unavailable"}\nDevelop: ${remote.develop ?? "unavailable"}\n`);
|
|
25
25
|
if (remote.error)
|
|
26
26
|
output.stderr(`${PRODUCT_TEXT.diagnostic(`could not resolve npm dist-tags: ${remote.error}`)}\n`);
|
|
27
27
|
return 0;
|
|
@@ -42,15 +42,15 @@ async function queryDistTags(runner) {
|
|
|
42
42
|
throw new TypeError("npm returned a non-object dist-tags value");
|
|
43
43
|
const tags = metadata;
|
|
44
44
|
const release = parseVersion(tags.latest, "npm latest");
|
|
45
|
-
const
|
|
46
|
-
return { release,
|
|
45
|
+
const develop = tags.next === undefined ? null : parseVersion(tags.next, "npm development channel");
|
|
46
|
+
return { release, develop, error: null };
|
|
47
47
|
}
|
|
48
48
|
catch (error) {
|
|
49
49
|
return unavailable(message(error));
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
function unavailable(error) {
|
|
53
|
-
return { release: null,
|
|
53
|
+
return { release: null, develop: null, error };
|
|
54
54
|
}
|
|
55
55
|
function createVersionProcessRunner() {
|
|
56
56
|
return async (command, arguments_) => await new Promise((resolvePromise, rejectPromise) => {
|
|
@@ -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;
|