@timurproko/a1 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +68 -0
- package/bin/addone-supervisor.js +7 -0
- package/bin/addone-ui.js +20 -0
- package/bin/addone.js +26 -0
- package/dist/src/cli/dispatch.d.ts +26 -0
- package/dist/src/cli/dispatch.d.ts.map +1 -0
- package/dist/src/cli/dispatch.js +35 -0
- package/dist/src/cli/dispatch.js.map +1 -0
- package/dist/src/cli/index.d.ts +4 -0
- package/dist/src/cli/index.d.ts.map +1 -0
- package/dist/src/cli/index.js +4 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/cli/version-stats.d.ts +17 -0
- package/dist/src/cli/version-stats.d.ts.map +1 -0
- package/dist/src/cli/version-stats.js +68 -0
- package/dist/src/cli/version-stats.js.map +1 -0
- package/dist/src/cli/version.d.ts +3 -0
- package/dist/src/cli/version.d.ts.map +1 -0
- package/dist/src/cli/version.js +23 -0
- package/dist/src/cli/version.js.map +1 -0
- package/dist/src/features/launch/development-launch.d.ts +9 -0
- package/dist/src/features/launch/development-launch.d.ts.map +1 -0
- package/dist/src/features/launch/development-launch.js +27 -0
- package/dist/src/features/launch/development-launch.js.map +1 -0
- package/dist/src/features/launch/index.d.ts +8 -0
- package/dist/src/features/launch/index.d.ts.map +1 -0
- package/dist/src/features/launch/index.js +8 -0
- package/dist/src/features/launch/index.js.map +1 -0
- package/dist/src/features/launch/initialize-profile.d.ts +7 -0
- package/dist/src/features/launch/initialize-profile.d.ts.map +1 -0
- package/dist/src/features/launch/initialize-profile.js +59 -0
- package/dist/src/features/launch/initialize-profile.js.map +1 -0
- package/dist/src/features/launch/intent.d.ts +8 -0
- package/dist/src/features/launch/intent.d.ts.map +1 -0
- package/dist/src/features/launch/intent.js +5 -0
- package/dist/src/features/launch/intent.js.map +1 -0
- package/dist/src/features/launch/prepare-launch.d.ts +14 -0
- package/dist/src/features/launch/prepare-launch.d.ts.map +1 -0
- package/dist/src/features/launch/prepare-launch.js +22 -0
- package/dist/src/features/launch/prepare-launch.js.map +1 -0
- package/dist/src/features/launch/profile-paths.d.ts +16 -0
- package/dist/src/features/launch/profile-paths.d.ts.map +1 -0
- package/dist/src/features/launch/profile-paths.js +30 -0
- package/dist/src/features/launch/profile-paths.js.map +1 -0
- package/dist/src/features/launch/profiles.d.ts +13 -0
- package/dist/src/features/launch/profiles.d.ts.map +1 -0
- package/dist/src/features/launch/profiles.js +27 -0
- package/dist/src/features/launch/profiles.js.map +1 -0
- package/dist/src/features/launch/runtime-selection.d.ts +15 -0
- package/dist/src/features/launch/runtime-selection.d.ts.map +1 -0
- package/dist/src/features/launch/runtime-selection.js +14 -0
- package/dist/src/features/launch/runtime-selection.js.map +1 -0
- package/dist/src/features/owned-ui/customization.d.ts +36 -0
- package/dist/src/features/owned-ui/customization.d.ts.map +1 -0
- package/dist/src/features/owned-ui/customization.js +110 -0
- package/dist/src/features/owned-ui/customization.js.map +1 -0
- package/dist/src/features/owned-ui/diagnostics.d.ts +34 -0
- package/dist/src/features/owned-ui/diagnostics.d.ts.map +1 -0
- package/dist/src/features/owned-ui/diagnostics.js +95 -0
- package/dist/src/features/owned-ui/diagnostics.js.map +1 -0
- package/dist/src/features/owned-ui/index.d.ts +5 -0
- package/dist/src/features/owned-ui/index.d.ts.map +1 -0
- package/dist/src/features/owned-ui/index.js +5 -0
- package/dist/src/features/owned-ui/index.js.map +1 -0
- package/dist/src/features/owned-ui/pi-session-shell.d.ts +97 -0
- package/dist/src/features/owned-ui/pi-session-shell.d.ts.map +1 -0
- package/dist/src/features/owned-ui/pi-session-shell.js +1437 -0
- package/dist/src/features/owned-ui/pi-session-shell.js.map +1 -0
- package/dist/src/features/owned-ui/run.d.ts +9 -0
- package/dist/src/features/owned-ui/run.d.ts.map +1 -0
- package/dist/src/features/owned-ui/run.js +21 -0
- package/dist/src/features/owned-ui/run.js.map +1 -0
- package/dist/src/features/workspace/capabilities.d.ts +32 -0
- package/dist/src/features/workspace/capabilities.d.ts.map +1 -0
- package/dist/src/features/workspace/capabilities.js +76 -0
- package/dist/src/features/workspace/capabilities.js.map +1 -0
- package/dist/src/features/workspace/index.d.ts +7 -0
- package/dist/src/features/workspace/index.d.ts.map +1 -0
- package/dist/src/features/workspace/index.js +7 -0
- package/dist/src/features/workspace/index.js.map +1 -0
- package/dist/src/features/workspace/presentation.d.ts +31 -0
- package/dist/src/features/workspace/presentation.d.ts.map +1 -0
- package/dist/src/features/workspace/presentation.js +69 -0
- package/dist/src/features/workspace/presentation.js.map +1 -0
- package/dist/src/features/workspace/reconciliation.d.ts +16 -0
- package/dist/src/features/workspace/reconciliation.d.ts.map +1 -0
- package/dist/src/features/workspace/reconciliation.js +83 -0
- package/dist/src/features/workspace/reconciliation.js.map +1 -0
- package/dist/src/features/workspace/reducer.d.ts +43 -0
- package/dist/src/features/workspace/reducer.d.ts.map +1 -0
- package/dist/src/features/workspace/reducer.js +214 -0
- package/dist/src/features/workspace/reducer.js.map +1 -0
- package/dist/src/features/workspace/router.d.ts +32 -0
- package/dist/src/features/workspace/router.d.ts.map +1 -0
- package/dist/src/features/workspace/router.js +125 -0
- package/dist/src/features/workspace/router.js.map +1 -0
- package/dist/src/features/workspace/store.d.ts +18 -0
- package/dist/src/features/workspace/store.d.ts.map +1 -0
- package/dist/src/features/workspace/store.js +55 -0
- package/dist/src/features/workspace/store.js.map +1 -0
- package/dist/src/foundation/lifecycle/index.d.ts +3 -0
- package/dist/src/foundation/lifecycle/index.d.ts.map +1 -0
- package/dist/src/foundation/lifecycle/index.js +3 -0
- package/dist/src/foundation/lifecycle/index.js.map +1 -0
- package/dist/src/foundation/lifecycle/model.d.ts +101 -0
- package/dist/src/foundation/lifecycle/model.d.ts.map +1 -0
- package/dist/src/foundation/lifecycle/model.js +40 -0
- package/dist/src/foundation/lifecycle/model.js.map +1 -0
- package/dist/src/foundation/lifecycle/paths.d.ts +11 -0
- package/dist/src/foundation/lifecycle/paths.d.ts.map +1 -0
- package/dist/src/foundation/lifecycle/paths.js +26 -0
- package/dist/src/foundation/lifecycle/paths.js.map +1 -0
- package/dist/src/foundation/native-host-protocol/codec.d.ts +12 -0
- package/dist/src/foundation/native-host-protocol/codec.d.ts.map +1 -0
- package/dist/src/foundation/native-host-protocol/codec.js +57 -0
- package/dist/src/foundation/native-host-protocol/codec.js.map +1 -0
- package/dist/src/foundation/native-host-protocol/evidence.d.ts +68 -0
- package/dist/src/foundation/native-host-protocol/evidence.d.ts.map +1 -0
- package/dist/src/foundation/native-host-protocol/evidence.js +141 -0
- package/dist/src/foundation/native-host-protocol/evidence.js.map +1 -0
- package/dist/src/foundation/native-host-protocol/index.d.ts +5 -0
- package/dist/src/foundation/native-host-protocol/index.d.ts.map +1 -0
- package/dist/src/foundation/native-host-protocol/index.js +5 -0
- package/dist/src/foundation/native-host-protocol/index.js.map +1 -0
- package/dist/src/foundation/native-host-protocol/messages.d.ts +57 -0
- package/dist/src/foundation/native-host-protocol/messages.d.ts.map +1 -0
- package/dist/src/foundation/native-host-protocol/messages.js +149 -0
- package/dist/src/foundation/native-host-protocol/messages.js.map +1 -0
- package/dist/src/foundation/native-host-protocol/proof-gate.d.ts +14 -0
- package/dist/src/foundation/native-host-protocol/proof-gate.d.ts.map +1 -0
- package/dist/src/foundation/native-host-protocol/proof-gate.js +34 -0
- package/dist/src/foundation/native-host-protocol/proof-gate.js.map +1 -0
- package/dist/src/foundation/owned-ui-contracts/extension-ui.d.ts +303 -0
- package/dist/src/foundation/owned-ui-contracts/extension-ui.d.ts.map +1 -0
- package/dist/src/foundation/owned-ui-contracts/extension-ui.js +69 -0
- package/dist/src/foundation/owned-ui-contracts/extension-ui.js.map +1 -0
- package/dist/src/foundation/owned-ui-contracts/index.d.ts +4 -0
- package/dist/src/foundation/owned-ui-contracts/index.d.ts.map +1 -0
- package/dist/src/foundation/owned-ui-contracts/index.js +4 -0
- package/dist/src/foundation/owned-ui-contracts/index.js.map +1 -0
- package/dist/src/foundation/owned-ui-contracts/model.d.ts +242 -0
- package/dist/src/foundation/owned-ui-contracts/model.d.ts.map +1 -0
- package/dist/src/foundation/owned-ui-contracts/model.js +2 -0
- package/dist/src/foundation/owned-ui-contracts/model.js.map +1 -0
- package/dist/src/foundation/owned-ui-contracts/validation.d.ts +12 -0
- package/dist/src/foundation/owned-ui-contracts/validation.d.ts.map +1 -0
- package/dist/src/foundation/owned-ui-contracts/validation.js +396 -0
- package/dist/src/foundation/owned-ui-contracts/validation.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/components.d.ts +5 -0
- package/dist/src/foundation/pi-component-adapter/components.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/components.js +65 -0
- package/dist/src/foundation/pi-component-adapter/components.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/conformance.d.ts +17 -0
- package/dist/src/foundation/pi-component-adapter/conformance.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/conformance.js +63 -0
- package/dist/src/foundation/pi-component-adapter/conformance.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/index.d.ts +13 -0
- package/dist/src/foundation/pi-component-adapter/index.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/index.js +13 -0
- package/dist/src/foundation/pi-component-adapter/index.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/shell-components.d.ts +7 -0
- package/dist/src/foundation/pi-component-adapter/shell-components.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/shell-components.js +7 -0
- package/dist/src/foundation/pi-component-adapter/shell-components.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.d.ts +12 -0
- package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.js +165 -0
- package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/shell-extension-ui.d.ts +36 -0
- package/dist/src/foundation/pi-component-adapter/shell-extension-ui.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/shell-extension-ui.js +280 -0
- package/dist/src/foundation/pi-component-adapter/shell-extension-ui.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/shell-footer-status.d.ts +8 -0
- package/dist/src/foundation/pi-component-adapter/shell-footer-status.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/shell-footer-status.js +246 -0
- package/dist/src/foundation/pi-component-adapter/shell-footer-status.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.d.ts +43 -0
- package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.js +397 -0
- package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.d.ts +106 -0
- package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.js +234 -0
- package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/shell-shared-facade.d.ts +117 -0
- package/dist/src/foundation/pi-component-adapter/shell-shared-facade.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/shell-shared-facade.js +88 -0
- package/dist/src/foundation/pi-component-adapter/shell-shared-facade.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/theme.d.ts +2 -0
- package/dist/src/foundation/pi-component-adapter/theme.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/theme.js +2 -0
- package/dist/src/foundation/pi-component-adapter/theme.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.d.ts +423 -0
- package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.js +297 -0
- package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/countdown-timer.d.ts +11 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/countdown-timer.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/countdown-timer.js +30 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/countdown-timer.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.d.ts +18 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.js +52 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/daxnuts.d.ts +23 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/daxnuts.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/daxnuts.js +143 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/daxnuts.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.d.ts +5 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.js +43 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.d.ts +18 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.js +82 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.d.ts +25 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.js +106 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/markdown-transform.d.ts +3 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/markdown-transform.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/markdown-transform.js +19 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/markdown-transform.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/mermaid.d.ts +10 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/mermaid.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/mermaid.js +78 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/mermaid.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.d.ts +56 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.js +343 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector-search.d.ts +23 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector-search.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector-search.js +160 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector-search.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.d.ts +96 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.js +890 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.d.ts +20 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.js +45 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.d.ts +31 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.js +60 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.d.ts +99 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.js +1273 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.d.ts +34 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.js +77 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/external-editor.d.ts +10 -0
- package/dist/src/foundation/pi-component-adapter/upstream/external-editor.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/external-editor.js +40 -0
- package/dist/src/foundation/pi-component-adapter/upstream/external-editor.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/model-search.d.ts +16 -0
- package/dist/src/foundation/pi-component-adapter/upstream/model-search.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/model-search.js +15 -0
- package/dist/src/foundation/pi-component-adapter/upstream/model-search.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme-controller.d.ts +26 -0
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme-controller.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme-controller.js +118 -0
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme-controller.js.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.d.ts +54 -0
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.d.ts.map +1 -0
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.js +311 -0
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.js.map +1 -0
- package/dist/src/foundation/pi-engine-adapter/adapter.d.ts +343 -0
- package/dist/src/foundation/pi-engine-adapter/adapter.d.ts.map +1 -0
- package/dist/src/foundation/pi-engine-adapter/adapter.js +2365 -0
- package/dist/src/foundation/pi-engine-adapter/adapter.js.map +1 -0
- package/dist/src/foundation/pi-engine-adapter/conformance.d.ts +14 -0
- package/dist/src/foundation/pi-engine-adapter/conformance.d.ts.map +1 -0
- package/dist/src/foundation/pi-engine-adapter/conformance.js +85 -0
- package/dist/src/foundation/pi-engine-adapter/conformance.js.map +1 -0
- package/dist/src/foundation/pi-engine-adapter/index.d.ts +4 -0
- package/dist/src/foundation/pi-engine-adapter/index.d.ts.map +1 -0
- package/dist/src/foundation/pi-engine-adapter/index.js +4 -0
- package/dist/src/foundation/pi-engine-adapter/index.js.map +1 -0
- package/dist/src/foundation/pi-engine-adapter/workflows.d.ts +165 -0
- package/dist/src/foundation/pi-engine-adapter/workflows.d.ts.map +1 -0
- package/dist/src/foundation/pi-engine-adapter/workflows.js +61 -0
- package/dist/src/foundation/pi-engine-adapter/workflows.js.map +1 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/adapter.d.ts +34 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/adapter.d.ts.map +1 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/adapter.js +485 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/adapter.js.map +1 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/conformance.d.ts +14 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/conformance.d.ts.map +1 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/conformance.js +132 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/conformance.js.map +1 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/contracts.d.ts +122 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/contracts.d.ts.map +1 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/contracts.js +2 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/contracts.js.map +1 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/index.d.ts +4 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/index.d.ts.map +1 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/index.js +4 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/index.js.map +1 -0
- package/dist/src/foundation/protocol/client.d.ts +17 -0
- package/dist/src/foundation/protocol/client.d.ts.map +1 -0
- package/dist/src/foundation/protocol/client.js +127 -0
- package/dist/src/foundation/protocol/client.js.map +1 -0
- package/dist/src/foundation/protocol/index.d.ts +3 -0
- package/dist/src/foundation/protocol/index.d.ts.map +1 -0
- package/dist/src/foundation/protocol/index.js +3 -0
- package/dist/src/foundation/protocol/index.js.map +1 -0
- package/dist/src/foundation/protocol/messages.d.ts +90 -0
- package/dist/src/foundation/protocol/messages.d.ts.map +1 -0
- package/dist/src/foundation/protocol/messages.js +99 -0
- package/dist/src/foundation/protocol/messages.js.map +1 -0
- package/dist/src/foundation/release/bootstrap.d.ts +30 -0
- package/dist/src/foundation/release/bootstrap.d.ts.map +1 -0
- package/dist/src/foundation/release/bootstrap.js +283 -0
- package/dist/src/foundation/release/bootstrap.js.map +1 -0
- package/dist/src/foundation/release/cohort-selection.d.ts +40 -0
- package/dist/src/foundation/release/cohort-selection.d.ts.map +1 -0
- package/dist/src/foundation/release/cohort-selection.js +76 -0
- package/dist/src/foundation/release/cohort-selection.js.map +1 -0
- package/dist/src/foundation/release/cohort-state.d.ts +68 -0
- package/dist/src/foundation/release/cohort-state.d.ts.map +1 -0
- package/dist/src/foundation/release/cohort-state.js +201 -0
- package/dist/src/foundation/release/cohort-state.js.map +1 -0
- package/dist/src/foundation/release/development-preview-release.d.ts +49 -0
- package/dist/src/foundation/release/development-preview-release.d.ts.map +1 -0
- package/dist/src/foundation/release/development-preview-release.js +113 -0
- package/dist/src/foundation/release/development-preview-release.js.map +1 -0
- package/dist/src/foundation/release/index.d.ts +12 -0
- package/dist/src/foundation/release/index.d.ts.map +1 -0
- package/dist/src/foundation/release/index.js +12 -0
- package/dist/src/foundation/release/index.js.map +1 -0
- package/dist/src/foundation/release/process-cleanup.d.ts +15 -0
- package/dist/src/foundation/release/process-cleanup.d.ts.map +1 -0
- package/dist/src/foundation/release/process-cleanup.js +67 -0
- package/dist/src/foundation/release/process-cleanup.js.map +1 -0
- package/dist/src/foundation/release/release-gc.d.ts +6 -0
- package/dist/src/foundation/release/release-gc.d.ts.map +1 -0
- package/dist/src/foundation/release/release-gc.js +17 -0
- package/dist/src/foundation/release/release-gc.js.map +1 -0
- package/dist/src/foundation/release/release-store.d.ts +11 -0
- package/dist/src/foundation/release/release-store.d.ts.map +1 -0
- package/dist/src/foundation/release/release-store.js +115 -0
- package/dist/src/foundation/release/release-store.js.map +1 -0
- package/dist/src/foundation/release/release.d.ts +24 -0
- package/dist/src/foundation/release/release.d.ts.map +1 -0
- package/dist/src/foundation/release/release.js +151 -0
- package/dist/src/foundation/release/release.js.map +1 -0
- package/dist/src/foundation/release/stable-release.d.ts +30 -0
- package/dist/src/foundation/release/stable-release.d.ts.map +1 -0
- package/dist/src/foundation/release/stable-release.js +38 -0
- package/dist/src/foundation/release/stable-release.js.map +1 -0
- package/dist/src/foundation/release/update-transaction.d.ts +31 -0
- package/dist/src/foundation/release/update-transaction.d.ts.map +1 -0
- package/dist/src/foundation/release/update-transaction.js +88 -0
- package/dist/src/foundation/release/update-transaction.js.map +1 -0
- package/dist/src/foundation/release/update.d.ts +55 -0
- package/dist/src/foundation/release/update.d.ts.map +1 -0
- package/dist/src/foundation/release/update.js +316 -0
- package/dist/src/foundation/release/update.js.map +1 -0
- package/dist/src/foundation/storage/control-store.d.ts +61 -0
- package/dist/src/foundation/storage/control-store.d.ts.map +1 -0
- package/dist/src/foundation/storage/control-store.js +459 -0
- package/dist/src/foundation/storage/control-store.js.map +1 -0
- package/dist/src/foundation/storage/index.d.ts +2 -0
- package/dist/src/foundation/storage/index.d.ts.map +1 -0
- package/dist/src/foundation/storage/index.js +2 -0
- package/dist/src/foundation/storage/index.js.map +1 -0
- package/dist/src/foundation/structured-agent-runtime/backpressure.d.ts +47 -0
- package/dist/src/foundation/structured-agent-runtime/backpressure.d.ts.map +1 -0
- package/dist/src/foundation/structured-agent-runtime/backpressure.js +119 -0
- package/dist/src/foundation/structured-agent-runtime/backpressure.js.map +1 -0
- package/dist/src/foundation/structured-agent-runtime/commands.d.ts +53 -0
- package/dist/src/foundation/structured-agent-runtime/commands.d.ts.map +1 -0
- package/dist/src/foundation/structured-agent-runtime/commands.js +165 -0
- package/dist/src/foundation/structured-agent-runtime/commands.js.map +1 -0
- package/dist/src/foundation/structured-agent-runtime/handshake.d.ts +42 -0
- package/dist/src/foundation/structured-agent-runtime/handshake.d.ts.map +1 -0
- package/dist/src/foundation/structured-agent-runtime/handshake.js +151 -0
- package/dist/src/foundation/structured-agent-runtime/handshake.js.map +1 -0
- package/dist/src/foundation/structured-agent-runtime/index.d.ts +6 -0
- package/dist/src/foundation/structured-agent-runtime/index.d.ts.map +1 -0
- package/dist/src/foundation/structured-agent-runtime/index.js +6 -0
- package/dist/src/foundation/structured-agent-runtime/index.js.map +1 -0
- package/dist/src/foundation/structured-agent-runtime/reconnection.d.ts +38 -0
- package/dist/src/foundation/structured-agent-runtime/reconnection.d.ts.map +1 -0
- package/dist/src/foundation/structured-agent-runtime/reconnection.js +130 -0
- package/dist/src/foundation/structured-agent-runtime/reconnection.js.map +1 -0
- package/dist/src/foundation/structured-agent-runtime/state.d.ts +57 -0
- package/dist/src/foundation/structured-agent-runtime/state.d.ts.map +1 -0
- package/dist/src/foundation/structured-agent-runtime/state.js +119 -0
- package/dist/src/foundation/structured-agent-runtime/state.js.map +1 -0
- package/dist/src/foundation/supervision/index.d.ts +4 -0
- package/dist/src/foundation/supervision/index.d.ts.map +1 -0
- package/dist/src/foundation/supervision/index.js +4 -0
- package/dist/src/foundation/supervision/index.js.map +1 -0
- package/dist/src/foundation/supervision/main.d.ts +2 -0
- package/dist/src/foundation/supervision/main.d.ts.map +1 -0
- package/dist/src/foundation/supervision/main.js +40 -0
- package/dist/src/foundation/supervision/main.js.map +1 -0
- package/dist/src/foundation/supervision/paths.d.ts +2 -0
- package/dist/src/foundation/supervision/paths.d.ts.map +1 -0
- package/dist/src/foundation/supervision/paths.js +2 -0
- package/dist/src/foundation/supervision/paths.js.map +1 -0
- package/dist/src/foundation/supervision/server.d.ts +21 -0
- package/dist/src/foundation/supervision/server.d.ts.map +1 -0
- package/dist/src/foundation/supervision/server.js +283 -0
- package/dist/src/foundation/supervision/server.js.map +1 -0
- package/dist/src/foundation/transparent-terminal/command-resolution.d.ts +14 -0
- package/dist/src/foundation/transparent-terminal/command-resolution.d.ts.map +1 -0
- package/dist/src/foundation/transparent-terminal/command-resolution.js +70 -0
- package/dist/src/foundation/transparent-terminal/command-resolution.js.map +1 -0
- package/dist/src/foundation/transparent-terminal/foreground-broker.d.ts +33 -0
- package/dist/src/foundation/transparent-terminal/foreground-broker.d.ts.map +1 -0
- package/dist/src/foundation/transparent-terminal/foreground-broker.js +88 -0
- package/dist/src/foundation/transparent-terminal/foreground-broker.js.map +1 -0
- package/dist/src/foundation/transparent-terminal/index.d.ts +4 -0
- package/dist/src/foundation/transparent-terminal/index.d.ts.map +1 -0
- package/dist/src/foundation/transparent-terminal/index.js +4 -0
- package/dist/src/foundation/transparent-terminal/index.js.map +1 -0
- package/dist/src/foundation/transparent-terminal/main.d.ts +10 -0
- package/dist/src/foundation/transparent-terminal/main.d.ts.map +1 -0
- package/dist/src/foundation/transparent-terminal/main.js +107 -0
- package/dist/src/foundation/transparent-terminal/main.js.map +1 -0
- package/dist/src/foundation/transparent-terminal/native-launcher.d.ts +26 -0
- package/dist/src/foundation/transparent-terminal/native-launcher.d.ts.map +1 -0
- package/dist/src/foundation/transparent-terminal/native-launcher.js +147 -0
- package/dist/src/foundation/transparent-terminal/native-launcher.js.map +1 -0
- package/dist/src/foundation/workspace-contracts/index.d.ts +3 -0
- package/dist/src/foundation/workspace-contracts/index.d.ts.map +1 -0
- package/dist/src/foundation/workspace-contracts/index.js +3 -0
- package/dist/src/foundation/workspace-contracts/index.js.map +1 -0
- package/dist/src/foundation/workspace-contracts/model.d.ts +249 -0
- package/dist/src/foundation/workspace-contracts/model.d.ts.map +1 -0
- package/dist/src/foundation/workspace-contracts/model.js +3 -0
- package/dist/src/foundation/workspace-contracts/model.js.map +1 -0
- package/dist/src/foundation/workspace-contracts/validation.d.ts +14 -0
- package/dist/src/foundation/workspace-contracts/validation.d.ts.map +1 -0
- package/dist/src/foundation/workspace-contracts/validation.js +336 -0
- package/dist/src/foundation/workspace-contracts/validation.js.map +1 -0
- package/docs/architecture/boundaries.md +46 -0
- package/docs/architecture/project-structure.md +81 -0
- package/docs/architecture/resource-and-data-policy.md +55 -0
- package/docs/architecture/terminal-host-proof-gate.md +32 -0
- package/docs/architecture/terminal-host-provenance.md +69 -0
- package/docs/architecture/terminal-host-spike-evidence.md +39 -0
- package/docs/architecture/toolchain.md +66 -0
- package/docs/features/launch-profiles.md +50 -0
- package/docs/manual-transparent-checkpoint.md +53 -0
- package/package.json +73 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
export const CONTROL_ENVELOPE = "addone-control-envelope";
|
|
3
|
+
export const CONTROL_ENVELOPE_REVISION = 1;
|
|
4
|
+
export const REQUIRED_CONTROL_FEATURES = [
|
|
5
|
+
"handshake.features.v1",
|
|
6
|
+
"snapshot.revision.v1",
|
|
7
|
+
"commands.request-identity.v1",
|
|
8
|
+
"generation.lifecycle.v1",
|
|
9
|
+
"terminal.foreground-lease.v1",
|
|
10
|
+
];
|
|
11
|
+
export const OPTIONAL_CONTROL_FEATURES = [
|
|
12
|
+
"messages.unknown-additive-ignore.v1",
|
|
13
|
+
"snapshot.resynchronize.v1",
|
|
14
|
+
];
|
|
15
|
+
export const GENERATED_CONTRACT_DIGEST = createHash("sha256").update(JSON.stringify({
|
|
16
|
+
envelope: CONTROL_ENVELOPE,
|
|
17
|
+
revision: CONTROL_ENVELOPE_REVISION,
|
|
18
|
+
required: [...REQUIRED_CONTROL_FEATURES].sort(),
|
|
19
|
+
optional: [...OPTIONAL_CONTROL_FEATURES].sort(),
|
|
20
|
+
})).digest("hex");
|
|
21
|
+
export const MAX_CONTROL_FRAME_BYTES = 4 * 1024 * 1024;
|
|
22
|
+
export function localControlHello(releaseId) {
|
|
23
|
+
return {
|
|
24
|
+
envelope: CONTROL_ENVELOPE,
|
|
25
|
+
envelopeRevision: CONTROL_ENVELOPE_REVISION,
|
|
26
|
+
requiredFeatures: REQUIRED_CONTROL_FEATURES,
|
|
27
|
+
optionalFeatures: OPTIONAL_CONTROL_FEATURES,
|
|
28
|
+
contractDigest: GENERATED_CONTRACT_DIGEST,
|
|
29
|
+
...(releaseId ? { releaseId } : {}),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function negotiateControlFeatures(client, server = localControlHello()) {
|
|
33
|
+
if (client.envelope !== server.envelope || client.envelopeRevision !== server.envelopeRevision) {
|
|
34
|
+
return {
|
|
35
|
+
ok: false,
|
|
36
|
+
negotiatedFeatures: [],
|
|
37
|
+
missingFromClient: [],
|
|
38
|
+
missingFromServer: [],
|
|
39
|
+
diagnostic: `control envelope mismatch: client ${client.envelope}/${client.envelopeRevision}; server ${server.envelope}/${server.envelopeRevision}`,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const clientFeatures = new Set([...client.requiredFeatures, ...client.optionalFeatures]);
|
|
43
|
+
const serverFeatures = new Set([...server.requiredFeatures, ...server.optionalFeatures]);
|
|
44
|
+
const missingFromClient = server.requiredFeatures.filter(feature => !clientFeatures.has(feature));
|
|
45
|
+
const missingFromServer = client.requiredFeatures.filter(feature => !serverFeatures.has(feature));
|
|
46
|
+
const negotiatedFeatures = [...clientFeatures].filter(feature => serverFeatures.has(feature)).sort();
|
|
47
|
+
return {
|
|
48
|
+
ok: missingFromClient.length === 0 && missingFromServer.length === 0,
|
|
49
|
+
negotiatedFeatures,
|
|
50
|
+
missingFromClient,
|
|
51
|
+
missingFromServer,
|
|
52
|
+
diagnostic: missingFromClient.length === 0 && missingFromServer.length === 0
|
|
53
|
+
? `control features negotiated (${negotiatedFeatures.join(", ")}); contract client=${client.contractDigest} server=${server.contractDigest}`
|
|
54
|
+
: `required control features unavailable; client missing [${missingFromClient.join(", ")}], server missing [${missingFromServer.join(", ")}]; contract client=${client.contractDigest} server=${server.contractDigest}`,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export function encodeFrame(message) {
|
|
58
|
+
return `${JSON.stringify(message)}\n`;
|
|
59
|
+
}
|
|
60
|
+
export class LineFrameDecoder {
|
|
61
|
+
#buffer = "";
|
|
62
|
+
push(chunk) {
|
|
63
|
+
this.#buffer += typeof chunk === "string" ? chunk : chunk.toString("utf8");
|
|
64
|
+
if (Buffer.byteLength(this.#buffer, "utf8") > MAX_CONTROL_FRAME_BYTES) {
|
|
65
|
+
this.#buffer = "";
|
|
66
|
+
throw new Error("control frame exceeds maximum size");
|
|
67
|
+
}
|
|
68
|
+
const messages = [];
|
|
69
|
+
let newline = this.#buffer.indexOf("\n");
|
|
70
|
+
while (newline >= 0) {
|
|
71
|
+
const line = this.#buffer.slice(0, newline);
|
|
72
|
+
this.#buffer = this.#buffer.slice(newline + 1);
|
|
73
|
+
if (line.length > 0)
|
|
74
|
+
messages.push(JSON.parse(line));
|
|
75
|
+
newline = this.#buffer.indexOf("\n");
|
|
76
|
+
}
|
|
77
|
+
return messages;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export function isControlHello(value) {
|
|
81
|
+
if (!isRecord(value) || value.type !== "client-hello" || typeof value.clientId !== "string")
|
|
82
|
+
return false;
|
|
83
|
+
return value.envelope === CONTROL_ENVELOPE
|
|
84
|
+
&& value.envelopeRevision === CONTROL_ENVELOPE_REVISION
|
|
85
|
+
&& isStringArray(value.requiredFeatures)
|
|
86
|
+
&& isStringArray(value.optionalFeatures)
|
|
87
|
+
&& typeof value.contractDigest === "string"
|
|
88
|
+
&& (value.releaseId === undefined || typeof value.releaseId === "string");
|
|
89
|
+
}
|
|
90
|
+
export function isCommandMessage(value) {
|
|
91
|
+
return isRecord(value) && value.type === "command" && isRecord(value.command) && typeof value.command.type === "string";
|
|
92
|
+
}
|
|
93
|
+
function isRecord(value) {
|
|
94
|
+
return typeof value === "object" && value !== null;
|
|
95
|
+
}
|
|
96
|
+
function isStringArray(value) {
|
|
97
|
+
return Array.isArray(value) && value.every(item => typeof item === "string" && item.length > 0);
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/foundation/protocol/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,yBAAkC,CAAC;AACnE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAU,CAAC;AACpD,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,uBAAuB;IACvB,sBAAsB;IACtB,8BAA8B;IAC9B,yBAAyB;IACzB,8BAA8B;CACtB,CAAC;AACX,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,qCAAqC;IACrC,2BAA2B;CACnB,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;IAClF,Q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AK,CAAC,gBAAgB,KAAK,yBAAyB;WACpD,aAAa,CAAC,KAAK,CAAC,gBAAgB,CAAC;WACrC,aAAa,CAAC,KAAK,CAAC,gBAAgB,CAAC;WACrC,OAAO,KAAK,CAAC,cAAc,KAAK,QAAQ;WACxC,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC1H,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AACD,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAClG,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type OwnershipProbe } from "./cohort-selection.js";
|
|
2
|
+
import { type SupervisorEndpointMetadata } from "./cohort-state.js";
|
|
3
|
+
import { type LaunchProfileId } from "../lifecycle/index.js";
|
|
4
|
+
import { cleanupProvenIdleOwner } from "./process-cleanup.js";
|
|
5
|
+
import { type MaterializedRelease } from "./release-store.js";
|
|
6
|
+
export interface BootstrapOptions {
|
|
7
|
+
readonly packageRoot: string;
|
|
8
|
+
readonly launchIntent?: {
|
|
9
|
+
readonly kind: "interactive";
|
|
10
|
+
readonly profile: {
|
|
11
|
+
readonly id: LaunchProfileId;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
readonly environment?: NodeJS.ProcessEnv;
|
|
15
|
+
readonly output?: Pick<NodeJS.WriteStream, "write">;
|
|
16
|
+
}
|
|
17
|
+
export declare function runBootstrap(options: BootstrapOptions): Promise<number>;
|
|
18
|
+
export declare function certifyMaterializedRelease(release: MaterializedRelease, dataDir: string): Promise<string>;
|
|
19
|
+
export declare function startSupervisor(release: MaterializedRelease, environment: NodeJS.ProcessEnv): Promise<void>;
|
|
20
|
+
export declare function releaseEnvironment(environment: NodeJS.ProcessEnv, release: MaterializedRelease): NodeJS.ProcessEnv;
|
|
21
|
+
export declare function waitForVerifiedEndpoint(path: string, release: MaterializedRelease, timeoutMs: number): Promise<void>;
|
|
22
|
+
export declare function readEndpointMetadata(path: string): Promise<SupervisorEndpointMetadata | null>;
|
|
23
|
+
export declare function probeOwnership(metadata: SupervisorEndpointMetadata): Promise<OwnershipProbe>;
|
|
24
|
+
export declare function releaseVerifiedIdleOwner(metadata: SupervisorEndpointMetadata, dataDir: string, operations?: {
|
|
25
|
+
readonly waitForExit?: typeof waitForProcessExit;
|
|
26
|
+
readonly cleanup?: typeof cleanupProvenIdleOwner;
|
|
27
|
+
}): Promise<boolean>;
|
|
28
|
+
export declare function waitForProcessExit(pid: number, timeoutMs: number): Promise<void>;
|
|
29
|
+
export declare function removeEndpointArtifacts(metadataPath: string, endpoint: string): Promise<void>;
|
|
30
|
+
//# sourceMappingURL=bootstrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../../src/foundation/release/bootstrap.ts"],"names":[],"mappings":"AAKA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAoB,KAAK,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAA6C,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExG,OAAO,EA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CAAC,cAAc,CAAC,CAUlG;AAoDD,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,0BAA0B,EACpC,OAAO,EAAE,MAAM,EACf,UAAU,GAAE;IACV,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,kBAAkB,CAAC;IACjD,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,sBAAsB,CAAC;CAC7C,GACL,OAAO,CAAC,OAAO,CAAC,CAWlB;AAyBD,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOtF;AAED,wBAAsB,uBAAuB,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGnG"}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import { connect } from "node:net";
|
|
4
|
+
import { platform } from "node:os";
|
|
5
|
+
import { resolve } from "node:path";
|
|
6
|
+
import { selectCohortLaunch } from "./cohort-selection.js";
|
|
7
|
+
import { CohortStateStore } from "./cohort-state.js";
|
|
8
|
+
import { assertLaunchProfileId, resolveAddOnePaths } from "../lifecycle/index.js";
|
|
9
|
+
import { encodeFrame, LineFrameDecoder } from "../protocol/index.js";
|
|
10
|
+
import { cleanupProvenIdleOwner, processIsAlive } from "./process-cleanup.js";
|
|
11
|
+
import { materializeRelease, readMaterializedRelease, resolveReleaseEntryPoint, verifyMaterializedRelease } from "./release-store.js";
|
|
12
|
+
export async function runBootstrap(options) {
|
|
13
|
+
const environment = { ...(options.environment ?? process.env) };
|
|
14
|
+
const launchProfileId = options.launchIntent?.profile.id ?? "addone";
|
|
15
|
+
assertLaunchProfileId(launchProfileId);
|
|
16
|
+
environment.ADDONE_LAUNCH_PROFILE = launchProfileId;
|
|
17
|
+
const output = options.output ?? process.stderr;
|
|
18
|
+
const paths = resolveAddOnePaths(environment);
|
|
19
|
+
await mkdir(paths.runtimeDir, { recursive: true, mode: 0o700 });
|
|
20
|
+
const candidate = await materializeRelease(options.packageRoot, paths.dataDir);
|
|
21
|
+
const stateStore = new CohortStateStore(paths.dataDir);
|
|
22
|
+
await stateStore.recordCandidate(candidate);
|
|
23
|
+
let state = await stateStore.read();
|
|
24
|
+
if (!state.references.active) {
|
|
25
|
+
const diagnosticsPath = await certifyMaterializedRelease(candidate, paths.dataDir);
|
|
26
|
+
await stateStore.approve(candidate.releaseId, diagnosticsPath);
|
|
27
|
+
await stateStore.activate(candidate.releaseId);
|
|
28
|
+
state = await stateStore.read();
|
|
29
|
+
}
|
|
30
|
+
const endpoint = await readEndpointMetadata(paths.endpointMetadataPath);
|
|
31
|
+
const probe = endpoint ? await probeOwnership(endpoint) : "dead";
|
|
32
|
+
let decision = selectCohortLaunch(candidate, state, endpoint, probe);
|
|
33
|
+
if (decision.action === "blocked") {
|
|
34
|
+
await stateStore.blockPending(decision.reason, endpoint?.ownership.liveGenerationIds ?? []);
|
|
35
|
+
output.write(`AddOne startup is blocked to preserve uncertain live ownership: ${decision.reason}\n`);
|
|
36
|
+
return 1;
|
|
37
|
+
}
|
|
38
|
+
if (decision.action === "clean-stale-owner" && endpoint) {
|
|
39
|
+
const diagnostics = await cleanupProvenIdleOwner(endpoint);
|
|
40
|
+
await writeFile(resolve(paths.dataDir, `cleanup-${Date.now()}.json`), JSON.stringify(diagnostics, null, 2));
|
|
41
|
+
if (!diagnostics.terminated)
|
|
42
|
+
throw new Error(`could not safely clean stale AddOne supervisor ${endpoint.pid}`);
|
|
43
|
+
await removeEndpointArtifacts(paths.endpointMetadataPath, paths.endpoint);
|
|
44
|
+
decision = selectCohortLaunch(candidate, await stateStore.read(), null, "dead");
|
|
45
|
+
}
|
|
46
|
+
else if (endpoint && probe === "dead") {
|
|
47
|
+
await removeEndpointArtifacts(paths.endpointMetadataPath, paths.endpoint);
|
|
48
|
+
}
|
|
49
|
+
if (decision.action === "launch-retained-ui") {
|
|
50
|
+
const retained = await verifyMaterializedRelease(decision.releaseRoot, undefined, resolve(paths.dataDir, "releases"));
|
|
51
|
+
if (decision.recordPending && endpoint) {
|
|
52
|
+
await stateStore.blockPending("candidate activation deferred by live non-resumable generations", endpoint.ownership.nonResumableGenerationIds);
|
|
53
|
+
}
|
|
54
|
+
const code = await launchUi(retained, environment);
|
|
55
|
+
if (decision.recordPending)
|
|
56
|
+
await activatePendingAfterBlockerExit(candidate, stateStore, paths, environment);
|
|
57
|
+
return code;
|
|
58
|
+
}
|
|
59
|
+
if (decision.action === "replace-idle-cohort" && endpoint) {
|
|
60
|
+
const diagnosticsPath = await certifyMaterializedRelease(candidate, paths.dataDir);
|
|
61
|
+
await stateStore.approve(candidate.releaseId, diagnosticsPath);
|
|
62
|
+
const released = await requestIdleOwnershipRelease(endpoint, candidate.releaseId, 2_000);
|
|
63
|
+
if (!released) {
|
|
64
|
+
await stateStore.blockPending("idle supervisor did not verify ownership release", endpoint.ownership.liveGenerationIds);
|
|
65
|
+
output.write("AddOne could not verify idle cohort ownership release; the retained release remains selected.\n");
|
|
66
|
+
return 1;
|
|
67
|
+
}
|
|
68
|
+
if (!await releaseVerifiedIdleOwner(endpoint, paths.dataDir)) {
|
|
69
|
+
await stateStore.blockPending("idle supervisor acknowledged release but did not terminate", endpoint.ownership.liveGenerationIds);
|
|
70
|
+
output.write("AddOne could not complete bounded idle cohort shutdown; the candidate remains pending.\n");
|
|
71
|
+
return 1;
|
|
72
|
+
}
|
|
73
|
+
await removeEndpointArtifacts(paths.endpointMetadataPath, paths.endpoint);
|
|
74
|
+
await stateStore.activate(candidate.releaseId);
|
|
75
|
+
decision = { action: "activate-candidate", releaseId: candidate.releaseId, releaseRoot: candidate.releaseRoot, reason: "idle cohort released ownership" };
|
|
76
|
+
}
|
|
77
|
+
let selected;
|
|
78
|
+
if (decision.action === "activate-candidate") {
|
|
79
|
+
const current = await stateStore.read();
|
|
80
|
+
if (current.releases[candidate.releaseId]?.approval !== "approved") {
|
|
81
|
+
const diagnosticsPath = await certifyMaterializedRelease(candidate, paths.dataDir);
|
|
82
|
+
await stateStore.approve(candidate.releaseId, diagnosticsPath);
|
|
83
|
+
}
|
|
84
|
+
if ((await stateStore.read()).references.active !== candidate.releaseId)
|
|
85
|
+
await stateStore.activate(candidate.releaseId);
|
|
86
|
+
selected = candidate;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
selected = await readMaterializedRelease(decision.releaseRoot);
|
|
90
|
+
}
|
|
91
|
+
await startSupervisor(selected, environment);
|
|
92
|
+
await waitForVerifiedEndpoint(paths.endpointMetadataPath, selected, 8_000);
|
|
93
|
+
return await launchUi(selected, environment);
|
|
94
|
+
}
|
|
95
|
+
export async function certifyMaterializedRelease(release, dataDir) {
|
|
96
|
+
await verifyMaterializedRelease(release.releaseRoot, release, resolve(dataDir, "releases"));
|
|
97
|
+
const path = resolve(dataDir, `certification-${release.releaseId}.json`);
|
|
98
|
+
await writeFile(path, JSON.stringify({
|
|
99
|
+
releaseId: release.releaseId,
|
|
100
|
+
contentDigest: release.contentDigest,
|
|
101
|
+
verifiedAt: new Date().toISOString(),
|
|
102
|
+
checks: [{ id: "immutable-content", passed: true }],
|
|
103
|
+
}, null, 2), { mode: 0o600 });
|
|
104
|
+
return path;
|
|
105
|
+
}
|
|
106
|
+
export async function startSupervisor(release, environment) {
|
|
107
|
+
const entry = await resolveReleaseEntryPoint(release, "bin/addone-supervisor.js");
|
|
108
|
+
const child = spawn(process.execPath, [entry], {
|
|
109
|
+
detached: true,
|
|
110
|
+
env: releaseEnvironment(environment, release),
|
|
111
|
+
stdio: "ignore",
|
|
112
|
+
windowsHide: true,
|
|
113
|
+
});
|
|
114
|
+
await new Promise((resolvePromise, rejectPromise) => {
|
|
115
|
+
child.once("spawn", resolvePromise);
|
|
116
|
+
child.once("error", rejectPromise);
|
|
117
|
+
});
|
|
118
|
+
child.unref();
|
|
119
|
+
}
|
|
120
|
+
async function launchUi(release, environment) {
|
|
121
|
+
const entry = await resolveReleaseEntryPoint(release, "bin/addone-ui.js");
|
|
122
|
+
return await new Promise((resolvePromise, rejectPromise) => {
|
|
123
|
+
const child = spawn(process.execPath, [entry], {
|
|
124
|
+
env: releaseEnvironment(environment, release),
|
|
125
|
+
stdio: "inherit",
|
|
126
|
+
windowsHide: false,
|
|
127
|
+
});
|
|
128
|
+
child.once("error", rejectPromise);
|
|
129
|
+
child.once("close", (code, signal) => resolvePromise(code ?? (signal ? 1 : 0)));
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
export function releaseEnvironment(environment, release) {
|
|
133
|
+
return {
|
|
134
|
+
...environment,
|
|
135
|
+
ADDONE_RELEASE_ID: release.releaseId,
|
|
136
|
+
ADDONE_RELEASE_ROOT: release.releaseRoot,
|
|
137
|
+
ADDONE_RELEASE_DIGEST: release.contentDigest,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
export async function waitForVerifiedEndpoint(path, release, timeoutMs) {
|
|
141
|
+
const deadline = Date.now() + timeoutMs;
|
|
142
|
+
while (Date.now() < deadline) {
|
|
143
|
+
const metadata = await readEndpointMetadata(path);
|
|
144
|
+
if (metadata && metadata.releaseId === release.releaseId && await probeOwnership(metadata) === "live-verified")
|
|
145
|
+
return;
|
|
146
|
+
await new Promise(resolvePromise => setTimeout(resolvePromise, 40));
|
|
147
|
+
}
|
|
148
|
+
throw new Error(`AddOne supervisor did not publish verified endpoint metadata within ${timeoutMs}ms`);
|
|
149
|
+
}
|
|
150
|
+
export async function readEndpointMetadata(path) {
|
|
151
|
+
try {
|
|
152
|
+
const value = JSON.parse(await readFile(path, "utf8"));
|
|
153
|
+
if (!value || typeof value.supervisorId !== "string" || typeof value.endpoint !== "string" || !Number.isSafeInteger(value.pid)
|
|
154
|
+
|| typeof value.pidStartIdentity !== "string" || typeof value.bootNonce !== "string" || typeof value.releaseId !== "string"
|
|
155
|
+
|| typeof value.releaseRoot !== "string" || typeof value.contentDigest !== "string" || !value.ownership
|
|
156
|
+
|| !Array.isArray(value.ownership.liveGenerationIds) || !Array.isArray(value.ownership.nonResumableGenerationIds)) {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
return value;
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
export async function probeOwnership(metadata) {
|
|
166
|
+
if (!processIsAlive(metadata.pid))
|
|
167
|
+
return "dead";
|
|
168
|
+
const identity = await requestIdentity(metadata.endpoint, 500);
|
|
169
|
+
if (!identity)
|
|
170
|
+
return "unresponsive";
|
|
171
|
+
return identity.supervisorId === metadata.supervisorId
|
|
172
|
+
&& identity.bootNonce === metadata.bootNonce
|
|
173
|
+
&& identity.pidStartIdentity === metadata.pidStartIdentity
|
|
174
|
+
&& identity.releaseId === metadata.releaseId
|
|
175
|
+
? "live-verified"
|
|
176
|
+
: "identity-mismatch";
|
|
177
|
+
}
|
|
178
|
+
async function requestIdentity(endpoint, timeoutMs) {
|
|
179
|
+
return await new Promise(resolvePromise => {
|
|
180
|
+
const socket = connect(endpoint);
|
|
181
|
+
const decoder = new LineFrameDecoder();
|
|
182
|
+
let settled = false;
|
|
183
|
+
const finish = (value) => {
|
|
184
|
+
if (settled)
|
|
185
|
+
return;
|
|
186
|
+
settled = true;
|
|
187
|
+
socket.destroy();
|
|
188
|
+
resolvePromise(value);
|
|
189
|
+
};
|
|
190
|
+
socket.once("error", () => finish(null));
|
|
191
|
+
socket.once("connect", () => socket.write(encodeFrame({ type: "identity-probe" })));
|
|
192
|
+
socket.on("data", chunk => {
|
|
193
|
+
try {
|
|
194
|
+
const message = decoder.push(chunk)[0];
|
|
195
|
+
if (message?.type === "identity" && typeof message.supervisorId === "string" && typeof message.bootNonce === "string"
|
|
196
|
+
&& typeof message.pidStartIdentity === "string" && typeof message.releaseId === "string") {
|
|
197
|
+
finish({ supervisorId: message.supervisorId, bootNonce: message.bootNonce, pidStartIdentity: message.pidStartIdentity, releaseId: message.releaseId });
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
finish(null);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
setTimeout(() => finish(null), timeoutMs).unref();
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
async function activatePendingAfterBlockerExit(candidate, stateStore, paths, environment) {
|
|
208
|
+
const deadline = Date.now() + 2_000;
|
|
209
|
+
let endpoint = null;
|
|
210
|
+
while (Date.now() < deadline) {
|
|
211
|
+
endpoint = await readEndpointMetadata(paths.endpointMetadataPath);
|
|
212
|
+
if (!endpoint || endpoint.ownership.liveGenerationIds.length === 0)
|
|
213
|
+
break;
|
|
214
|
+
await new Promise(resolvePromise => setTimeout(resolvePromise, 40));
|
|
215
|
+
}
|
|
216
|
+
if (!endpoint || endpoint.ownership.liveGenerationIds.length > 0 || await probeOwnership(endpoint) !== "live-verified")
|
|
217
|
+
return;
|
|
218
|
+
const diagnosticsPath = await certifyMaterializedRelease(candidate, paths.dataDir);
|
|
219
|
+
await stateStore.approve(candidate.releaseId, diagnosticsPath);
|
|
220
|
+
if (!await requestIdleOwnershipRelease(endpoint, candidate.releaseId, 2_000))
|
|
221
|
+
return;
|
|
222
|
+
if (!await releaseVerifiedIdleOwner(endpoint, paths.dataDir))
|
|
223
|
+
return;
|
|
224
|
+
await removeEndpointArtifacts(paths.endpointMetadataPath, paths.endpoint);
|
|
225
|
+
await stateStore.activate(candidate.releaseId);
|
|
226
|
+
await startSupervisor(candidate, environment);
|
|
227
|
+
await waitForVerifiedEndpoint(paths.endpointMetadataPath, candidate, 8_000);
|
|
228
|
+
}
|
|
229
|
+
export async function releaseVerifiedIdleOwner(metadata, dataDir, operations = {}) {
|
|
230
|
+
try {
|
|
231
|
+
await (operations.waitForExit ?? waitForProcessExit)(metadata.pid, 3_000);
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
// The authenticated idle-release handshake authorizes bounded cleanup of
|
|
236
|
+
// this exact boot when a native handle outlives graceful shutdown.
|
|
237
|
+
const diagnostics = await (operations.cleanup ?? cleanupProvenIdleOwner)(metadata);
|
|
238
|
+
await writeFile(resolve(dataDir, `cleanup-${Date.now()}.json`), JSON.stringify(diagnostics, null, 2));
|
|
239
|
+
return diagnostics.terminated;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
async function requestIdleOwnershipRelease(metadata, candidateReleaseId, timeoutMs) {
|
|
243
|
+
return await new Promise(resolvePromise => {
|
|
244
|
+
const socket = connect(metadata.endpoint);
|
|
245
|
+
const decoder = new LineFrameDecoder();
|
|
246
|
+
let settled = false;
|
|
247
|
+
const finish = (released) => {
|
|
248
|
+
if (settled)
|
|
249
|
+
return;
|
|
250
|
+
settled = true;
|
|
251
|
+
socket.destroy();
|
|
252
|
+
resolvePromise(released);
|
|
253
|
+
};
|
|
254
|
+
socket.once("error", () => finish(false));
|
|
255
|
+
socket.once("connect", () => socket.write(encodeFrame({ type: "release-idle-ownership", bootNonce: metadata.bootNonce, candidateReleaseId })));
|
|
256
|
+
socket.on("data", chunk => {
|
|
257
|
+
try {
|
|
258
|
+
const message = decoder.push(chunk)[0];
|
|
259
|
+
if (message?.type === "release-ownership-result")
|
|
260
|
+
finish(message.released === true);
|
|
261
|
+
}
|
|
262
|
+
catch {
|
|
263
|
+
finish(false);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
setTimeout(() => finish(false), timeoutMs).unref();
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
export async function waitForProcessExit(pid, timeoutMs) {
|
|
270
|
+
const deadline = Date.now() + timeoutMs;
|
|
271
|
+
while (Date.now() < deadline) {
|
|
272
|
+
if (!processIsAlive(pid))
|
|
273
|
+
return;
|
|
274
|
+
await new Promise(resolvePromise => setTimeout(resolvePromise, 25));
|
|
275
|
+
}
|
|
276
|
+
throw new Error(`AddOne supervisor ${pid} did not release process ownership within ${timeoutMs}ms`);
|
|
277
|
+
}
|
|
278
|
+
export async function removeEndpointArtifacts(metadataPath, endpoint) {
|
|
279
|
+
await rm(metadataPath, { force: true });
|
|
280
|
+
if (platform() !== "win32")
|
|
281
|
+
await rm(endpoint, { force: true });
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../../src/foundation/release/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAuB,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAmC,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAwB,MAAM,uBAAuB,CAAC;AACxG,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,yBAAyB,EAA4B,MAAM,oBAAoB,CAAC;AAShK,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAAyB;IAC1D,MAAM,WAAW,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;IAChE,MAAM,eAAe,GAAG,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { CohortState, SupervisorEndpointMetadata } from "./cohort-state.js";
|
|
2
|
+
import type { MaterializedRelease } from "./release-store.js";
|
|
3
|
+
export type OwnershipProbe = "live-verified" | "dead" | "unresponsive" | "identity-mismatch";
|
|
4
|
+
export type CohortLaunchDecision = {
|
|
5
|
+
readonly action: "launch-retained-ui";
|
|
6
|
+
readonly releaseId: string;
|
|
7
|
+
readonly releaseRoot: string;
|
|
8
|
+
readonly reason: string;
|
|
9
|
+
readonly recordPending: boolean;
|
|
10
|
+
} | {
|
|
11
|
+
readonly action: "activate-candidate";
|
|
12
|
+
readonly releaseId: string;
|
|
13
|
+
readonly releaseRoot: string;
|
|
14
|
+
readonly reason: string;
|
|
15
|
+
} | {
|
|
16
|
+
readonly action: "replace-idle-cohort";
|
|
17
|
+
readonly releaseId: string;
|
|
18
|
+
readonly releaseRoot: string;
|
|
19
|
+
readonly reason: string;
|
|
20
|
+
readonly pid: number;
|
|
21
|
+
} | {
|
|
22
|
+
readonly action: "start-active";
|
|
23
|
+
readonly releaseId: string;
|
|
24
|
+
readonly releaseRoot: string;
|
|
25
|
+
readonly reason: string;
|
|
26
|
+
} | {
|
|
27
|
+
readonly action: "clean-stale-owner";
|
|
28
|
+
readonly releaseId: string;
|
|
29
|
+
readonly releaseRoot: string;
|
|
30
|
+
readonly reason: string;
|
|
31
|
+
readonly pid: number;
|
|
32
|
+
} | {
|
|
33
|
+
readonly action: "blocked";
|
|
34
|
+
readonly releaseId: string;
|
|
35
|
+
readonly releaseRoot: string;
|
|
36
|
+
readonly reason: string;
|
|
37
|
+
readonly pid: number | null;
|
|
38
|
+
};
|
|
39
|
+
export declare function selectCohortLaunch(candidate: MaterializedRelease, state: CohortState, endpoint: SupervisorEndpointMetadata | null, probe: OwnershipProbe): CohortLaunchDecision;
|
|
40
|
+
//# sourceMappingURL=cohort-selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACjJ;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAEnJ,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,0BAA0B,GAAG,IAAI,EAC3C,KAAK,EAAE,cAAc,GACpB,oBAAoB,CA6EtB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export function selectCohortLaunch(candidate, state, endpoint, probe) {
|
|
2
|
+
if (endpoint && probe === "live-verified") {
|
|
3
|
+
const retained = state.releases[endpoint.releaseId];
|
|
4
|
+
if (!retained || retained.releaseRoot !== endpoint.releaseRoot || retained.contentDigest !== endpoint.contentDigest) {
|
|
5
|
+
return {
|
|
6
|
+
action: "blocked",
|
|
7
|
+
releaseId: endpoint.releaseId,
|
|
8
|
+
releaseRoot: endpoint.releaseRoot,
|
|
9
|
+
reason: "live supervisor identity does not match a retained verified release record",
|
|
10
|
+
pid: endpoint.pid,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
if (endpoint.releaseId !== candidate.releaseId && endpoint.ownership.liveGenerationIds.length === 0) {
|
|
14
|
+
return {
|
|
15
|
+
action: "replace-idle-cohort",
|
|
16
|
+
releaseId: candidate.releaseId,
|
|
17
|
+
releaseRoot: candidate.releaseRoot,
|
|
18
|
+
reason: "older cohort is idle and can release ownership for verified candidate activation",
|
|
19
|
+
pid: endpoint.pid,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
action: "launch-retained-ui",
|
|
24
|
+
releaseId: endpoint.releaseId,
|
|
25
|
+
releaseRoot: endpoint.releaseRoot,
|
|
26
|
+
reason: endpoint.releaseId === candidate.releaseId
|
|
27
|
+
? "live supervisor already owns the installed release cohort"
|
|
28
|
+
: "live supervisor owns a non-resumable generation; candidate remains pending",
|
|
29
|
+
recordPending: endpoint.releaseId !== candidate.releaseId,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
if (endpoint && probe === "unresponsive") {
|
|
33
|
+
if (endpoint.ownership.liveGenerationIds.length > 0 || endpoint.ownership.nonResumableGenerationIds.length > 0) {
|
|
34
|
+
return {
|
|
35
|
+
action: "blocked",
|
|
36
|
+
releaseId: endpoint.releaseId,
|
|
37
|
+
releaseRoot: endpoint.releaseRoot,
|
|
38
|
+
reason: "ownership of live generations is uncertain; preserving the unresponsive supervisor",
|
|
39
|
+
pid: endpoint.pid,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
action: "clean-stale-owner",
|
|
44
|
+
releaseId: candidate.releaseId,
|
|
45
|
+
releaseRoot: candidate.releaseRoot,
|
|
46
|
+
reason: "unresponsive owner has no recorded live generation and is safe for bounded cleanup",
|
|
47
|
+
pid: endpoint.pid,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
if (endpoint && probe === "identity-mismatch") {
|
|
51
|
+
return {
|
|
52
|
+
action: "blocked",
|
|
53
|
+
releaseId: endpoint.releaseId,
|
|
54
|
+
releaseRoot: endpoint.releaseRoot,
|
|
55
|
+
reason: "endpoint handshake, boot nonce, or process start identity did not match durable ownership metadata",
|
|
56
|
+
pid: endpoint.pid,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const active = state.references.active ? state.releases[state.references.active] : undefined;
|
|
60
|
+
const approvedCandidate = state.releases[candidate.releaseId]?.approval === "approved";
|
|
61
|
+
if (approvedCandidate || !active) {
|
|
62
|
+
return {
|
|
63
|
+
action: "activate-candidate",
|
|
64
|
+
releaseId: candidate.releaseId,
|
|
65
|
+
releaseRoot: candidate.releaseRoot,
|
|
66
|
+
reason: approvedCandidate ? "approved candidate can become the active cohort" : "initial verified release can be certified and activated",
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
action: "start-active",
|
|
71
|
+
releaseId: active.releaseId,
|
|
72
|
+
releaseRoot: active.releaseRoot,
|
|
73
|
+
reason: "candidate is not approved; retaining the active release",
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=cohort-selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cohort-selection.js","sourceRoot":"","sources":["../../../../src/foundation/release/cohort-selection.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,kBAAkB,CAChC,SAA8B,EAC9B,KAAkB,EAClB,QAA2C,EAC3C,KAAqB;IAErB,IAAI,QAAQ,IAAI,KAAK,KAAK,eAAe,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACpD,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,WAAW,KAAK,QAAQ,CAAC,WAAW,IAAI,QAAQ,CAAC,aAAa,KAAK,QAAQ,CAAC,aAAa,EAAE,CAAC;YACpH,OAAO;gBACL,MAAM,EAAE,SAAS;gBACjB,SAAS,EAAE,QAAQ,CAAC,SAAS;gBAC7B,WAAW,EAAE,QAAQ,CAAC,WAAW;gBACjC,MAAM,EAAE,4EAA4E;gBACpF,GAAG,EAAE,QAAQ,CAAC,GAAG;aAClB,CAAC;QACJ,CAAC;QACD,IAAI,QAAQ,CAAC,SAAS,KAAK,SAAS,CAAC,SAAS,IAAI,QAAQ,CAAC,SAAS,CAAC,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpG,OAAO;g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