@timurproko/a1 0.2.7-dev.1249 → 0.2.7-dev.1255
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 +11 -36
- package/bin/cli.js +2 -17
- package/bin/ui.js +10 -51
- package/dist/app/session-shell/clipboard-diagnostics.d.ts +2 -2
- package/dist/app/session-shell/clipboard-image.d.ts +0 -1
- package/dist/app/session-shell/clipboard-image.js +1 -1
- package/dist/app/session-shell/dialog-coordinator.d.ts +6 -5
- package/dist/app/session-shell/dialog-coordinator.js +3 -4
- package/dist/app/session-shell/dock-chrome.d.ts +11 -6
- package/dist/app/session-shell/dock-chrome.js +5 -8
- package/dist/app/session-shell/editor-hyperlink-budget.d.ts +0 -2
- package/dist/app/session-shell/editor-hyperlink-budget.js +1 -1
- package/dist/app/session-shell/exit-notice.d.ts +3 -3
- package/dist/app/session-shell/exit-notice.js +10 -10
- package/dist/app/session-shell/extension-surface.d.ts +8 -7
- package/dist/app/session-shell/helper-pool.d.ts +3 -4
- package/dist/app/session-shell/helper-pool.js +1 -1
- package/dist/app/session-shell/image-preparation-client.d.ts +4 -3
- package/dist/app/session-shell/image-preparation.d.ts +0 -2
- package/dist/app/session-shell/image-preparation.js +2 -2
- package/dist/app/session-shell/image-source.d.ts +2 -3
- package/dist/app/session-shell/image-source.js +2 -2
- package/dist/app/session-shell/input-surface-switch.d.ts +9 -7
- package/dist/app/session-shell/input-surface-switch.js +1 -2
- package/dist/app/session-shell/login-interaction.d.ts +5 -4
- package/dist/app/session-shell/login-interaction.js +2 -3
- package/dist/app/session-shell/paste-executor.d.ts +4 -8
- package/dist/app/session-shell/paste-executor.js +2 -2
- package/dist/app/session-shell/paste-protocol.d.ts +2 -2
- package/dist/app/session-shell/path-chip-presentation.d.ts +0 -5
- package/dist/app/session-shell/path-chip-presentation.js +3 -3
- package/dist/app/session-shell/prompt-chips.d.ts +8 -7
- package/dist/app/session-shell/prompt-history-controller.d.ts +3 -3
- package/dist/app/session-shell/prompt-submission.d.ts +7 -6
- package/dist/app/session-shell/prompt-submission.js +7 -28
- package/dist/app/session-shell/quit-outro-effects.d.ts +3 -3
- package/dist/app/session-shell/quit-outro-effects.js +1 -4
- package/dist/app/session-shell/quit-outro.d.ts +9 -12
- package/dist/app/session-shell/quit-outro.js +11 -11
- package/dist/app/session-shell/response-copy-protocol.d.ts +3 -2
- package/dist/app/session-shell/response-copy-transport.d.ts +2 -14
- package/dist/app/session-shell/response-copy-transport.js +2 -3
- package/dist/app/session-shell/session-lifecycle.d.ts +3 -3
- package/dist/app/session-shell/session-lifecycle.js +2 -4
- package/dist/app/session-shell/session-shell-root.d.ts +74 -120
- package/dist/app/session-shell/session-shell-root.js +82 -115
- package/dist/app/session-shell/session-shell.d.ts +13 -16
- package/dist/app/session-shell/session-shell.js +149 -314
- package/dist/app/session-shell/session-viewport-controller.d.ts +7 -6
- package/dist/app/session-shell/session-viewport-controller.js +5 -8
- package/dist/app/session-shell/settings-bindings.d.ts +24 -2
- package/dist/app/session-shell/settings-bindings.js +24 -0
- package/dist/app/session-shell/share-operation.d.ts +3 -3
- package/dist/app/session-shell/share-operation.js +4 -6
- package/dist/app/session-shell/shell-clipboard.d.ts +59 -0
- package/dist/app/session-shell/shell-clipboard.js +119 -0
- package/dist/app/session-shell/shell-editor-factory.d.ts +8 -4
- package/dist/app/session-shell/shell-editor-factory.js +13 -15
- package/dist/app/session-shell/shell-host.d.ts +16 -17
- package/dist/app/session-shell/shell-host.js +20 -37
- package/dist/app/session-shell/shell-layout.d.ts +2 -2
- package/dist/app/session-shell/shell-prompt-suggestions.d.ts +26 -0
- package/dist/app/session-shell/shell-prompt-suggestions.js +48 -0
- package/dist/app/session-shell/suggestion-surface.d.ts +1 -6
- package/dist/app/session-shell/suggestion-surface.js +1 -1
- package/dist/app/session-shell/system-clipboard.d.ts +2 -14
- package/dist/app/session-shell/system-clipboard.js +2 -7
- package/dist/app/session-shell/transcript-document.d.ts +12 -10
- package/dist/app/session-shell/transcript-document.js +15 -41
- package/dist/app/session-shell/viewport-layout.d.ts +2 -2
- package/dist/app/session-shell/workflow-output.d.ts +5 -3
- package/dist/app/session-shell/workflow-output.js +13 -15
- package/dist/app/session-shell/workflow-router.d.ts +1 -3
- package/dist/app/session-shell/workflow-router.js +1 -4
- package/dist/cli/dispatch.d.ts +1 -11
- package/dist/cli/dispatch.js +5 -92
- package/dist/cli/package-messages.d.ts +0 -1
- package/dist/cli/package-messages.js +1 -1
- package/dist/cli/session-context.d.ts +1 -1
- package/dist/cli/session-context.js +5 -7
- package/dist/cli/uninstall.d.ts +4 -7
- package/dist/cli/uninstall.js +6 -35
- package/dist/cli/version-stats.js +4 -7
- package/dist/composition/owned-settings.d.ts +2 -2
- package/dist/composition/owned-settings.js +0 -4
- package/dist/composition/owned-ui.d.ts +3 -25
- package/dist/composition/owned-ui.js +37 -113
- package/dist/composition/reference-selection-options.d.ts +1 -1
- package/dist/composition/reference-selection-options.js +1 -1
- package/dist/composition/release-update-observation.d.ts +4 -4
- package/dist/composition/release-update-observation.js +17 -47
- package/dist/composition/session-backend.d.ts +0 -1
- package/dist/composition/session-runtime-registry.d.ts +5 -4
- package/dist/composition/settings-route-host.d.ts +0 -7
- package/dist/composition/settings-route-host.js +7 -20
- package/dist/composition/settings-search-input.d.ts +2 -1
- package/dist/composition/startup-route.d.ts +2 -3
- package/dist/composition/startup-route.js +2 -3
- package/dist/contracts/owned-ui/extension-ui.d.ts +2 -1
- package/dist/contracts/owned-ui/index.d.ts +2 -1
- package/dist/contracts/owned-ui/model.d.ts +0 -3
- package/dist/contracts/owned-ui/session-presenters.d.ts +3 -0
- package/dist/contracts/owned-ui/session-workflows.d.ts +1 -4
- package/dist/contracts/owned-ui/shell-components.d.ts +543 -0
- package/dist/contracts/presentation/component.d.ts +17 -0
- package/dist/contracts/presentation/component.js +8 -0
- package/dist/contracts/presentation/index.d.ts +6 -15
- package/dist/contracts/presentation/index.js +2 -0
- package/dist/contracts/presentation/terminal.d.ts +290 -0
- package/dist/contracts/presentation/theme.d.ts +46 -0
- package/dist/features/launch/development-launch.js +1 -2
- package/dist/features/launch/index.d.ts +1 -1
- package/dist/features/launch/intent.d.ts +1 -3
- package/dist/features/launch/intent.js +2 -4
- package/dist/features/launch/runtime-selection.d.ts +2 -2
- package/dist/features/launch/runtime-selection.js +2 -2
- package/dist/features/launch/session-context.d.ts +2 -2
- package/dist/features/owned-ui/project-trust-prompt.d.ts +2 -2
- package/dist/features/owned-ui/project-trust-prompt.js +1 -1
- package/dist/features/owned-ui/reference-screen-app.d.ts +0 -2
- package/dist/features/owned-ui/reference-screen-app.js +2 -9
- package/dist/features/owned-ui/release-note-state.d.ts +2 -1
- package/dist/features/owned-ui/settings-app.d.ts +0 -6
- package/dist/features/owned-ui/settings-app.js +42 -254
- package/dist/features/owned-ui/settings-edits.d.ts +31 -0
- package/dist/features/owned-ui/settings-edits.js +139 -0
- package/dist/features/owned-ui/settings-scroll-rail.d.ts +29 -0
- package/dist/features/owned-ui/settings-scroll-rail.js +79 -0
- package/dist/features/owned-ui/settings-search-input.d.ts +2 -1
- package/dist/features/prompt-history/service.d.ts +3 -2
- package/dist/foundation/launch-context/index.d.ts +0 -12
- package/dist/foundation/launch-context/index.js +0 -26
- package/dist/foundation/lifecycle/claim-gate.d.ts +9 -0
- package/dist/foundation/lifecycle/claim-gate.js +37 -0
- package/dist/foundation/lifecycle/index.d.ts +5 -9
- package/dist/foundation/lifecycle/index.js +3 -4
- package/dist/foundation/lifecycle/model.d.ts +2 -59
- package/dist/foundation/lifecycle/model.js +0 -35
- package/dist/foundation/lifecycle/paths.d.ts +0 -24
- package/dist/foundation/lifecycle/paths.js +0 -40
- package/dist/foundation/lifecycle/process-liveness.d.ts +8 -0
- package/dist/foundation/lifecycle/process-liveness.js +18 -0
- package/dist/foundation/lifecycle/session-claim-lock.d.ts +1 -1
- package/dist/foundation/lifecycle/session-claim-lock.js +2 -2
- package/dist/foundation/lifecycle/session-repository-context.d.ts +6 -6
- package/dist/foundation/lifecycle/session-repository-context.js +2 -3
- package/dist/foundation/release/automatic-update.d.ts +6 -17
- package/dist/foundation/release/automatic-update.js +23 -44
- package/dist/foundation/release/bootstrap.d.ts +2 -25
- package/dist/foundation/release/bootstrap.js +37 -348
- package/dist/foundation/release/dependency-certification.d.ts +1 -2
- package/dist/foundation/release/dependency-certification.js +1 -1
- package/dist/foundation/release/early-accent.d.ts +2 -2
- package/dist/foundation/release/early-accent.js +1 -1
- package/dist/foundation/release/index.d.ts +10 -17
- package/dist/foundation/release/index.js +7 -11
- package/dist/foundation/release/latest-release.d.ts +3 -19
- package/dist/foundation/release/latest-release.js +11 -12
- package/dist/foundation/release/ordinary-launch-selection.d.ts +1 -1
- package/dist/foundation/release/ordinary-launch-selection.js +1 -1
- package/dist/foundation/release/process-liveness.d.ts +2 -0
- package/dist/foundation/release/process-liveness.js +12 -0
- package/dist/foundation/release/release-gc.d.ts +13 -10
- package/dist/foundation/release/release-gc.js +37 -101
- package/dist/foundation/release/{cohort-state.d.ts → release-state.d.ts} +44 -69
- package/dist/foundation/release/{cohort-state.js → release-state.js} +38 -70
- package/dist/foundation/release/release-store.d.ts +2 -2
- package/dist/foundation/release/release-store.js +2 -2
- package/dist/foundation/release/restart-certification.js +1 -1
- package/dist/foundation/release/update-activation.d.ts +2 -9
- package/dist/foundation/release/update-activation.js +30 -45
- package/dist/foundation/release/update-execution-lease.d.ts +2 -3
- package/dist/foundation/release/update-execution-lease.js +2 -2
- package/dist/foundation/release/update-launch.d.ts +2 -4
- package/dist/foundation/release/update-launch.js +0 -7
- package/dist/foundation/release/update-recovery.js +1 -1
- package/dist/foundation/release/update-transaction.d.ts +1 -1
- package/dist/foundation/release/update-transaction.js +5 -2
- package/dist/foundation/release/update.d.ts +2 -12
- package/dist/foundation/release/update.js +37 -214
- package/dist/foundation/session-writer-lock/index.d.ts +14 -6
- package/dist/foundation/session-writer-lock/index.js +48 -103
- package/dist/foundation/startup/startup-budget.d.ts +5 -5
- package/dist/foundation/startup/startup-budget.js +2 -2
- package/dist/foundation/startup/startup-runtime.d.ts +1 -1
- package/dist/foundation/terminal-cleanup/exit-notice.d.ts +6 -0
- package/dist/foundation/terminal-cleanup/exit-notice.js +36 -0
- package/dist/foundation/terminal-cleanup/index.d.ts +2 -1
- package/dist/foundation/terminal-cleanup/index.js +2 -1
- package/dist/foundation/terminal-cleanup/terminal-reset.d.ts +0 -5
- package/dist/foundation/terminal-cleanup/terminal-reset.js +0 -5
- package/dist/integrations/pi/components/editor-interaction.d.ts +4 -12
- package/dist/integrations/pi/components/index.d.ts +15 -9
- package/dist/integrations/pi/components/index.js +9 -5
- package/dist/integrations/pi/components/lazy-selectors.d.ts +2 -10
- package/dist/integrations/pi/components/lazy-selectors.js +1 -1
- package/dist/integrations/pi/components/modal-frame.d.ts +5 -22
- package/dist/integrations/pi/components/modal-frame.js +3 -23
- package/dist/integrations/pi/components/owned-editor-ux.d.ts +4 -3
- package/dist/integrations/pi/components/prompt-input-port.d.ts +2 -19
- package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -1
- package/dist/integrations/pi/components/shell-editor-autocomplete.d.ts +3 -2
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +1 -4
- package/dist/integrations/pi/components/shell-footer-status.d.ts +3 -3
- package/dist/integrations/pi/components/shell-footer-status.js +5 -4
- package/dist/integrations/pi/components/shell-hotkey-sections.js +1 -1
- package/dist/integrations/pi/components/shell-presenters-info.d.ts +6 -8
- package/dist/integrations/pi/components/shell-presenters-info.js +6 -19
- package/dist/integrations/pi/components/shell-presenters-transcript.d.ts +1 -1
- package/dist/integrations/pi/components/shell-presenters-transcript.js +1 -1
- package/dist/integrations/pi/components/shell-session-info-reference.d.ts +2 -1
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +33 -229
- package/dist/integrations/pi/components/shell-shared-facade.js +8 -1
- package/dist/integrations/pi/components/skills-command.d.ts +1 -9
- package/dist/integrations/pi/components/skills-command.js +5 -5
- package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +2 -5
- package/dist/integrations/pi/components/submitted-prompt-adapter.js +2 -16
- package/dist/integrations/pi/components/theme.d.ts +9 -2
- package/dist/integrations/pi/components/theme.js +17 -2
- package/dist/integrations/pi/components/thinking-selector-dialog.d.ts +2 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +2 -2
- package/dist/integrations/pi/components/upstream/components/session-footer.d.ts +1 -2
- package/dist/integrations/pi/components/upstream/components/session-footer.js +6 -8
- package/dist/integrations/pi/engine/adapter.d.ts +3 -6
- package/dist/integrations/pi/engine/adapter.js +4 -28
- package/dist/integrations/pi/engine/changelog.d.ts +2 -2
- package/dist/integrations/pi/engine/changelog.js +3 -3
- package/dist/integrations/pi/engine/compaction-progress.d.ts +2 -3
- package/dist/integrations/pi/engine/compaction-progress.js +1 -1
- package/dist/integrations/pi/engine/conformance.d.ts +2 -1
- package/dist/integrations/pi/engine/default-model-setting.d.ts +0 -2
- package/dist/integrations/pi/engine/default-model-setting.js +1 -2
- package/dist/integrations/pi/engine/diagnostics-state.d.ts +0 -1
- package/dist/integrations/pi/engine/diagnostics-state.js +0 -14
- package/dist/integrations/pi/engine/event-delivery.d.ts +2 -1
- package/dist/integrations/pi/engine/extension-ui-binding.d.ts +2 -1
- package/dist/integrations/pi/engine/host.js +2 -2
- package/dist/integrations/pi/engine/message-values.d.ts +0 -1
- package/dist/integrations/pi/engine/message-values.js +1 -1
- package/dist/integrations/pi/engine/pending-delivery.d.ts +0 -4
- package/dist/integrations/pi/engine/pending-delivery.js +3 -3
- package/dist/integrations/pi/engine/ports.d.ts +7 -1
- package/dist/integrations/pi/engine/ports.js +4 -0
- package/dist/integrations/pi/engine/project-trust-preflight.d.ts +2 -1
- package/dist/integrations/pi/engine/prompt-suggestions.d.ts +3 -3
- package/dist/integrations/pi/engine/prompt-suggestions.js +0 -40
- package/dist/integrations/pi/engine/provider-authentication.d.ts +1 -1
- package/dist/integrations/pi/engine/public-main-entry.d.ts +1 -5
- package/dist/integrations/pi/engine/public-main-entry.js +1 -1
- package/dist/integrations/pi/engine/repository-pr-rest.d.ts +1 -9
- package/dist/integrations/pi/engine/repository-pr-rest.js +2 -2
- package/dist/integrations/pi/engine/repository-pr.d.ts +1 -3
- package/dist/integrations/pi/engine/repository-pr.js +1 -1
- package/dist/integrations/pi/engine/resource-catalog.d.ts +2 -1
- package/dist/integrations/pi/engine/session-integration.d.ts +1 -1
- package/dist/integrations/pi/engine/session-runtime.d.ts +4 -3
- package/dist/integrations/pi/engine/session-runtime.js +0 -2
- package/dist/integrations/pi/engine/settings-bridge.d.ts +0 -2
- package/dist/integrations/pi/engine/settings-bridge.js +1 -1
- package/dist/integrations/pi/engine/settings-port.d.ts +3 -2
- package/dist/integrations/pi/engine/transcript-projection.d.ts +2 -1
- package/dist/integrations/pi/engine/workflow-contexts.d.ts +1 -1
- package/dist/integrations/pi/engine/workflow-runner.d.ts +1 -1
- package/dist/integrations/pi/engine/workflow-runner.js +1 -1
- package/dist/integrations/pi/engine/workflow-support.d.ts +0 -6
- package/dist/integrations/pi/engine/workflow-support.js +4 -18
- package/dist/integrations/pi/engine/workflows.d.ts +5 -5
- package/dist/integrations/pi/session-presenters/components.d.ts +3 -0
- package/dist/integrations/pi/session-presenters/components.js +75 -0
- package/dist/integrations/pi/session-presenters/index.d.ts +1 -0
- package/dist/integrations/pi/session-presenters/index.js +1 -0
- package/dist/integrations/pi/session-presenters/presentation.d.ts +3 -0
- package/dist/integrations/pi/session-presenters/presentation.js +10 -0
- package/dist/integrations/pi/session-presenters/presenters.d.ts +2 -1
- package/dist/integrations/pi/session-presenters/presenters.js +3 -1
- package/dist/integrations/pi/tui-runtime/adapter.d.ts +2 -2
- package/dist/integrations/pi/tui-runtime/adapter.js +23 -32
- package/dist/integrations/pi/tui-runtime/contracts.d.ts +22 -166
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +5 -40
- package/dist/integrations/pi/tui-runtime/index.d.ts +1 -0
- package/dist/integrations/pi/tui-runtime/index.js +1 -0
- package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.d.ts +4 -6
- package/dist/integrations/pi/tui-runtime/overlay-geometry.d.ts +2 -8
- package/dist/integrations/pi/tui-runtime/overlay-geometry.js +3 -9
- package/dist/integrations/pi/tui-runtime/runtime-factory.d.ts +3 -0
- package/dist/integrations/pi/tui-runtime/runtime-factory.js +11 -0
- package/dist/product-identity.d.ts +4 -6
- package/dist/product-identity.js +6 -11
- package/dist/product-identity.json +1 -40
- package/dist/runtime-payload-inventory.json +0 -3
- package/dist/ui/components/index.d.ts +4 -4
- package/dist/ui/components/index.js +2 -2
- package/dist/ui/components/selection-copy.d.ts +0 -1
- package/dist/ui/components/selection-copy.js +0 -12
- package/dist/ui/components/submitted-prompt.d.ts +3 -13
- package/dist/ui/components/submitted-prompt.js +8 -41
- package/dist/ui/components/theme.d.ts +4 -19
- package/dist/ui/components/theme.js +6 -0
- package/dist/ui/components/transcript-viewport.d.ts +1 -3
- package/dist/ui/components/transcript-viewport.js +1 -4
- package/dist/ui/settings/declarations.d.ts +2 -97
- package/dist/ui/settings/declarations.js +2 -78
- package/dist/ui/settings/early-accent.js +1 -1
- package/dist/ui/settings/index.d.ts +3 -5
- package/dist/ui/settings/index.js +2 -3
- package/dist/ui/settings/manager.d.ts +0 -4
- package/dist/ui/settings/manager.js +6 -62
- package/dist/ui/settings/resolution.d.ts +6 -18
- package/dist/ui/settings/resolution.js +4 -103
- package/dist/ui/settings/sections.d.ts +0 -4
- package/dist/ui/settings/sections.js +1 -1
- package/docs/architecture/boundaries.md +23 -40
- package/docs/architecture/code-documentation.md +2 -2
- package/docs/architecture/internal-naming.md +11 -17
- package/docs/architecture/project-structure.md +13 -16
- package/docs/architecture/resource-and-data-policy.md +16 -31
- package/docs/architecture/toolchain.md +14 -19
- package/docs/architecture/ui-reference-provenance.md +2 -2
- package/docs/ci-release-runbook.md +5 -5
- package/docs/features/launch-profiles.md +11 -17
- package/docs/features/prompt-history.md +10 -11
- package/docs/local-worktree-cleanup.md +28 -1
- package/docs/manual-owned-ui-checkpoint.md +0 -1
- package/docs/validation.md +5 -11
- package/docs/worktree-link-recovery.md +6 -6
- package/package.json +7 -20
- package/bin/guardian.js +0 -42
- package/bin/supervisor.js +0 -7
- package/bin/tab-launch-context.d.ts +0 -27
- package/bin/tab-launch-context.js +0 -94
- package/dist/app/session-shell/resident-tab-coordinator.d.ts +0 -38
- package/dist/app/session-shell/resident-tab-coordinator.js +0 -77
- package/dist/cli/tabs-request.d.ts +0 -7
- package/dist/cli/tabs.d.ts +0 -14
- package/dist/cli/tabs.js +0 -151
- package/dist/composition/resident-tab-bridge.d.ts +0 -41
- package/dist/composition/resident-tab-bridge.js +0 -209
- package/dist/composition/utility-tab.d.ts +0 -28
- package/dist/composition/utility-tab.js +0 -244
- package/dist/features/owned-ui/plus-menu-dialog.d.ts +0 -28
- package/dist/features/owned-ui/plus-menu-dialog.js +0 -89
- package/dist/features/resident-tab/auto-name.d.ts +0 -11
- package/dist/features/resident-tab/auto-name.js +0 -44
- package/dist/features/resident-tab/index.d.ts +0 -5
- package/dist/features/resident-tab/index.js +0 -7
- package/dist/features/resident-tab/shortcut-bindings-file.d.ts +0 -8
- package/dist/features/resident-tab/shortcut-bindings-file.js +0 -40
- package/dist/features/resident-tab/shortcut-declarations.d.ts +0 -13
- package/dist/features/resident-tab/shortcut-declarations.js +0 -26
- package/dist/features/resident-tab/shortcut-projection.d.ts +0 -29
- package/dist/features/resident-tab/shortcut-projection.js +0 -64
- package/dist/features/resident-tab/status-deriver.d.ts +0 -10
- package/dist/features/resident-tab/status-deriver.js +0 -12
- package/dist/foundation/launch-guardian/exit-watcher.d.ts +0 -14
- package/dist/foundation/launch-guardian/exit-watcher.js +0 -103
- package/dist/foundation/launch-guardian/index.d.ts +0 -2
- package/dist/foundation/launch-guardian/index.js +0 -1
- package/dist/foundation/launch-guardian/main.d.ts +0 -39
- package/dist/foundation/launch-guardian/main.js +0 -232
- package/dist/foundation/lifecycle/commands.d.ts +0 -40
- package/dist/foundation/lifecycle/launch-instance.d.ts +0 -46
- package/dist/foundation/lifecycle/launch-instance.js +0 -134
- package/dist/foundation/lifecycle/native-claim-gate.d.ts +0 -5
- package/dist/foundation/lifecycle/native-claim-gate.js +0 -41
- package/dist/foundation/lifecycle/supervisor-startup.d.ts +0 -30
- package/dist/foundation/lifecycle/supervisor-startup.js +0 -106
- package/dist/foundation/process-containment/addon-containment.d.ts +0 -20
- package/dist/foundation/process-containment/addon-containment.js +0 -139
- package/dist/foundation/process-containment/addon-process-inspector.d.ts +0 -11
- package/dist/foundation/process-containment/addon-process-inspector.js +0 -36
- package/dist/foundation/process-containment/addon.d.ts +0 -47
- package/dist/foundation/process-containment/addon.js +0 -57
- package/dist/foundation/process-containment/artifact.d.ts +0 -1
- package/dist/foundation/process-containment/artifact.js +0 -35
- package/dist/foundation/process-containment/contracts.d.ts +0 -33
- package/dist/foundation/process-containment/contracts.js +0 -35
- package/dist/foundation/process-containment/index.d.ts +0 -9
- package/dist/foundation/process-containment/index.js +0 -7
- package/dist/foundation/process-containment/linux-process-inspector.d.ts +0 -7
- package/dist/foundation/process-containment/linux-process-inspector.js +0 -27
- package/dist/foundation/process-containment/native-process-inspector.d.ts +0 -4
- package/dist/foundation/process-containment/native-process-inspector.js +0 -21
- package/dist/foundation/protocol/client.d.ts +0 -18
- package/dist/foundation/protocol/client.js +0 -130
- package/dist/foundation/protocol/index.d.ts +0 -3
- package/dist/foundation/protocol/index.js +0 -2
- package/dist/foundation/protocol/messages.d.ts +0 -90
- package/dist/foundation/protocol/messages.js +0 -100
- package/dist/foundation/release/cohort-selection.d.ts +0 -33
- package/dist/foundation/release/cohort-selection.js +0 -67
- package/dist/foundation/release/endpoint-lock.d.ts +0 -2
- package/dist/foundation/release/endpoint-lock.js +0 -37
- package/dist/foundation/release/endpoint-recovery.d.ts +0 -10
- package/dist/foundation/release/endpoint-recovery.js +0 -45
- package/dist/foundation/release/endpoints.d.ts +0 -32
- package/dist/foundation/release/endpoints.js +0 -152
- package/dist/foundation/release/prepared-update-activation.d.ts +0 -3
- package/dist/foundation/release/prepared-update-activation.js +0 -27
- package/dist/foundation/release/process-cleanup.d.ts +0 -14
- package/dist/foundation/release/process-cleanup.js +0 -76
- package/dist/foundation/release/supervisor-identity.d.ts +0 -15
- package/dist/foundation/release/supervisor-identity.js +0 -63
- package/dist/foundation/resident-tabs/boot-identity.d.ts +0 -6
- package/dist/foundation/resident-tabs/boot-identity.js +0 -16
- package/dist/foundation/resident-tabs/bounded-host-command.d.ts +0 -20
- package/dist/foundation/resident-tabs/bounded-host-command.js +0 -62
- package/dist/foundation/resident-tabs/bridge-client.d.ts +0 -73
- package/dist/foundation/resident-tabs/bridge-client.js +0 -327
- package/dist/foundation/resident-tabs/continuity.d.ts +0 -12
- package/dist/foundation/resident-tabs/continuity.js +0 -63
- package/dist/foundation/resident-tabs/doctor.d.ts +0 -28
- package/dist/foundation/resident-tabs/doctor.js +0 -166
- package/dist/foundation/resident-tabs/draft-checkpoint.d.ts +0 -27
- package/dist/foundation/resident-tabs/draft-checkpoint.js +0 -145
- package/dist/foundation/resident-tabs/ensure-terminal-host.d.ts +0 -36
- package/dist/foundation/resident-tabs/ensure-terminal-host.js +0 -151
- package/dist/foundation/resident-tabs/fault-injection.d.ts +0 -8
- package/dist/foundation/resident-tabs/fault-injection.js +0 -26
- package/dist/foundation/resident-tabs/fixture-control.d.ts +0 -7
- package/dist/foundation/resident-tabs/fixture-control.js +0 -35
- package/dist/foundation/resident-tabs/host-entry.js +0 -17
- package/dist/foundation/resident-tabs/index.d.ts +0 -15
- package/dist/foundation/resident-tabs/index.js +0 -10
- package/dist/foundation/resident-tabs/maintenance.d.ts +0 -39
- package/dist/foundation/resident-tabs/maintenance.js +0 -75
- package/dist/foundation/resident-tabs/progress-observation-schema.d.ts +0 -34
- package/dist/foundation/resident-tabs/progress-observation-schema.js +0 -1
- package/dist/foundation/resident-tabs/progress-observation.d.ts +0 -4
- package/dist/foundation/resident-tabs/progress-observation.js +0 -150
- package/dist/foundation/resident-tabs/prompt-journal.d.ts +0 -63
- package/dist/foundation/resident-tabs/prompt-journal.js +0 -213
- package/dist/foundation/resident-tabs/protocol.d.ts +0 -12
- package/dist/foundation/resident-tabs/protocol.js +0 -195
- package/dist/foundation/resident-tabs/recovery.d.ts +0 -26
- package/dist/foundation/resident-tabs/recovery.js +0 -205
- package/dist/foundation/resident-tabs/release-holds.d.ts +0 -28
- package/dist/foundation/resident-tabs/release-holds.js +0 -78
- package/dist/foundation/resident-tabs/routes.d.ts +0 -5
- package/dist/foundation/resident-tabs/routes.js +0 -5
- package/dist/foundation/resident-tabs/routing.d.ts +0 -11
- package/dist/foundation/resident-tabs/routing.js +0 -10
- package/dist/foundation/resident-tabs/runtime-control.d.ts +0 -38
- package/dist/foundation/resident-tabs/runtime-control.js +0 -74
- package/dist/foundation/resident-tabs/session-sync.d.ts +0 -14
- package/dist/foundation/resident-tabs/session-sync.js +0 -37
- package/dist/foundation/resident-tabs/settings.d.ts +0 -16
- package/dist/foundation/resident-tabs/settings.js +0 -60
- package/dist/foundation/resident-tabs/terminal-host-artifact.d.ts +0 -14
- package/dist/foundation/resident-tabs/terminal-host-artifact.js +0 -78
- package/dist/foundation/resident-tabs/zip-archive.d.ts +0 -9
- package/dist/foundation/resident-tabs/zip-archive.js +0 -56
- package/dist/foundation/storage/control-store.d.ts +0 -20
- package/dist/foundation/storage/control-store.js +0 -331
- package/dist/foundation/storage/index.d.ts +0 -1
- package/dist/foundation/storage/index.js +0 -1
- package/dist/foundation/supervision/index.d.ts +0 -3
- package/dist/foundation/supervision/index.js +0 -3
- package/dist/foundation/supervision/main.d.ts +0 -1
- package/dist/foundation/supervision/main.js +0 -86
- package/dist/foundation/supervision/paths.d.ts +0 -1
- package/dist/foundation/supervision/paths.js +0 -1
- package/dist/foundation/supervision/server.d.ts +0 -46
- package/dist/foundation/supervision/server.js +0 -611
- package/dist/integrations/pi/components/components.d.ts +0 -4
- package/dist/integrations/pi/components/components.js +0 -48
- package/dist/integrations/pi/components/conformance.d.ts +0 -18
- package/dist/integrations/pi/components/conformance.js +0 -70
- package/dist/integrations/pi/components/shell-components.d.ts +0 -7
- package/dist/integrations/pi/components/shell-components.js +0 -7
- package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +0 -33
- package/dist/integrations/pi/components/upstream/theme/theme-controller.js +0 -114
- package/dist/integrations/pi/engine/offline-settings-port.d.ts +0 -23
- package/dist/integrations/pi/engine/offline-settings-port.js +0 -54
- package/dist/native/darwin-arm64/manifest.json +0 -23
- package/dist/native/darwin-arm64/process-guardian.node +0 -0
- package/dist/native/darwin-arm64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -10500
- package/dist/native/darwin-arm64/terminal-host.manifest.json +0 -46
- package/dist/native/darwin-arm64/terminal-host.node +0 -0
- package/dist/native/darwin-x64/manifest.json +0 -23
- package/dist/native/darwin-x64/process-guardian.node +0 -0
- package/dist/native/darwin-x64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -10737
- package/dist/native/darwin-x64/terminal-host.manifest.json +0 -46
- package/dist/native/darwin-x64/terminal-host.node +0 -0
- package/dist/native/linux-x64/manifest.json +0 -23
- package/dist/native/linux-x64/process-guardian.node +0 -0
- package/dist/native/linux-x64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -11226
- package/dist/native/linux-x64/terminal-host.manifest.json +0 -46
- package/dist/native/linux-x64/terminal-host.node +0 -0
- package/dist/native/win32-x64/manifest.json +0 -23
- package/dist/native/win32-x64/process-guardian.node +0 -0
- package/dist/native/win32-x64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -10757
- package/dist/native/win32-x64/terminal-host.manifest.json +0 -46
- package/dist/native/win32-x64/terminal-host.node +0 -0
- package/dist/ui/settings/migrations.d.ts +0 -19
- package/dist/ui/settings/migrations.js +0 -209
- package/dist/ui/settings/progress-palette.generated.d.ts +0 -139
- package/dist/ui/settings/progress-palette.generated.js +0 -139
- package/docs/architecture/evidence/resident-tabs/linux-x64.md +0 -37
- package/docs/architecture/evidence/resident-tabs/macos-arm64.md +0 -36
- package/docs/architecture/evidence/resident-tabs/macos-x64.md +0 -35
- package/docs/architecture/evidence/resident-tabs/windows-x64.md +0 -36
- package/docs/architecture/evidence/terminal-host-spike/manual-one-pane-terminal-host.md +0 -70
- package/docs/architecture/evidence/terminal-host-spike/manual-two-by-two-basic-terminal-host.md +0 -32
- package/docs/architecture/evidence/terminal-host-spike/milestone-baseline.json +0 -115
- package/docs/architecture/evidence/terminal-host-spike/owned-ui-foundation-prerequisite.json +0 -48
- package/docs/architecture/evidence/terminal-host-spike/terminal-host-provenance.json +0 -125
- package/docs/architecture/evidence/terminal-host-spike/terminal-host-task-5-1.json +0 -56
- package/docs/architecture/evidence/terminal-host-spike/terminal-host-task-5-3.json +0 -174
- package/docs/architecture/evidence/terminal-host-spike/terminal-spike-acceptance-record.json +0 -18
- package/docs/architecture/native-fixture-isolation.md +0 -23
- package/docs/architecture/process-guardian-provenance.md +0 -36
- package/docs/architecture/resident-tabs-requirements.md +0 -18
- package/docs/architecture/resident-tabs.md +0 -668
- package/docs/architecture/terminal-host-proof-gate.md +0 -34
- package/docs/architecture/terminal-host-provenance.md +0 -81
- package/docs/architecture/terminal-host-spike-evidence.md +0 -39
- package/docs/launch-recovery.md +0 -23
- package/docs/manual-launch-instance-acceptance.md +0 -43
- package/docs/manual-resident-tabs-acceptance.md +0 -51
- /package/dist/{cli/tabs-request.js → contracts/owned-ui/shell-components.js} +0 -0
- /package/dist/{foundation/release → contracts/presentation}/progress-palette.generated.d.ts +0 -0
- /package/dist/{foundation/release → contracts/presentation}/progress-palette.generated.js +0 -0
- /package/dist/{foundation/lifecycle/commands.js → contracts/presentation/terminal.js} +0 -0
- /package/dist/{foundation/resident-tabs/host-entry.d.ts → contracts/presentation/theme.js} +0 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { MaterializedRelease } from "./release-store.js";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const RELEASE_STATE_SCHEMA: string;
|
|
3
|
+
/** How long a release stays on disk after its approval, so processes started from it keep their files. */
|
|
4
|
+
export declare const RELEASE_RETENTION_MS: number;
|
|
3
5
|
export type ReleaseApproval = "candidate" | "approved" | "rejected";
|
|
4
6
|
export interface ReleaseRecord {
|
|
5
7
|
readonly releaseId: string;
|
|
@@ -9,6 +11,7 @@ export interface ReleaseRecord {
|
|
|
9
11
|
readonly launchContract?: string;
|
|
10
12
|
readonly approval: ReleaseApproval;
|
|
11
13
|
readonly materializedAt: string;
|
|
14
|
+
/** When the release was approved; retention measures its age from this instant. */
|
|
12
15
|
readonly certifiedAt: string | null;
|
|
13
16
|
readonly diagnosticsPath: string | null;
|
|
14
17
|
}
|
|
@@ -19,12 +22,6 @@ export interface ReleaseReferences {
|
|
|
19
22
|
readonly rollback: string | null;
|
|
20
23
|
readonly retention: readonly string[];
|
|
21
24
|
}
|
|
22
|
-
export type ExternalReleaseHoldAuthority = "agent" | "migration" | "resident";
|
|
23
|
-
/** A current hold supplied by an authority that must participate in every reconciliation. */
|
|
24
|
-
export interface ExternalReleaseHold {
|
|
25
|
-
readonly authority: ExternalReleaseHoldAuthority;
|
|
26
|
-
readonly releaseId: string;
|
|
27
|
-
}
|
|
28
25
|
export interface ActiveReleaseTransactionReference {
|
|
29
26
|
readonly status: "active" | "completed" | "rolled-back" | "failed";
|
|
30
27
|
readonly priorActiveReleaseId: string | null;
|
|
@@ -69,49 +66,21 @@ export interface ReleaseCleanupState {
|
|
|
69
66
|
readonly diagnostics: readonly ReleaseCleanupDiagnostic[];
|
|
70
67
|
readonly workerRuns: readonly ReleaseCleanupWorkerRun[];
|
|
71
68
|
}
|
|
72
|
-
export interface
|
|
73
|
-
readonly schema: typeof
|
|
69
|
+
export interface ReleaseState {
|
|
70
|
+
readonly schema: typeof RELEASE_STATE_SCHEMA;
|
|
74
71
|
readonly revision: number;
|
|
75
72
|
readonly releases: Readonly<Record<string, ReleaseRecord>>;
|
|
76
73
|
readonly references: ReleaseReferences;
|
|
77
74
|
readonly cleanup: ReleaseCleanupState;
|
|
78
|
-
readonly activation: {
|
|
79
|
-
readonly state: "idle" | "pending" | "draining" | "blocked" | "failed";
|
|
80
|
-
readonly reason: string | null;
|
|
81
|
-
readonly blockerGenerationIds: readonly string[];
|
|
82
|
-
readonly updatedAt: string;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
export interface EndpointOwnership {
|
|
86
|
-
readonly state: "idle" | "busy" | "draining" | "released" | "blocked";
|
|
87
|
-
readonly liveInstanceIds: readonly string[];
|
|
88
|
-
readonly nonResumableInstanceIds: readonly string[];
|
|
89
|
-
readonly uncertainInstanceIds: readonly string[];
|
|
90
|
-
}
|
|
91
|
-
export interface SupervisorEndpointMetadata {
|
|
92
|
-
readonly schema: string;
|
|
93
|
-
readonly supervisorId: string;
|
|
94
|
-
readonly endpoint: string;
|
|
95
|
-
readonly pid: number;
|
|
96
|
-
readonly pidStartIdentity: string;
|
|
97
|
-
/** Exact OS creation token; absent on historical supervisor metadata. */
|
|
98
|
-
readonly nativeStartIdentity?: string;
|
|
99
|
-
readonly bootNonce: string;
|
|
100
|
-
readonly startedAt: string;
|
|
101
|
-
readonly releaseId: string;
|
|
102
|
-
readonly releaseRoot: string;
|
|
103
|
-
readonly contentDigest: string;
|
|
104
|
-
readonly ownership: EndpointOwnership;
|
|
105
|
-
readonly envelope: string;
|
|
106
|
-
readonly envelopeRevision: number;
|
|
107
|
-
readonly requiredFeatures: readonly string[];
|
|
108
|
-
readonly optionalFeatures: readonly string[];
|
|
109
|
-
readonly contractDigest: string;
|
|
110
75
|
}
|
|
111
76
|
export interface ProtectedReleaseInputs {
|
|
112
|
-
|
|
113
|
-
readonly
|
|
77
|
+
/** Releases the reconciling command itself runs from; they are never collected under it. */
|
|
78
|
+
readonly ownReleaseIds?: readonly string[];
|
|
114
79
|
readonly transaction?: ActiveReleaseTransactionReference | null;
|
|
80
|
+
/** Clock for the age window; defaults to the wall clock. */
|
|
81
|
+
readonly now?: number;
|
|
82
|
+
/** Age window measured from approval; defaults to seven days. */
|
|
83
|
+
readonly retentionMs?: number;
|
|
115
84
|
}
|
|
116
85
|
export interface ProtectedReleasePlan {
|
|
117
86
|
readonly protectedReleaseIds: readonly string[];
|
|
@@ -124,38 +93,44 @@ export interface OrphanReleaseDisposition {
|
|
|
124
93
|
readonly trashPath?: string | null;
|
|
125
94
|
}
|
|
126
95
|
export interface ReleaseRetentionReconciliation {
|
|
127
|
-
readonly state:
|
|
96
|
+
readonly state: ReleaseState;
|
|
128
97
|
readonly plan: ProtectedReleasePlan;
|
|
129
98
|
readonly detachedReleaseIds: readonly string[];
|
|
130
99
|
}
|
|
131
100
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
101
|
+
* Age-based retention. A release stays while a selector names it (active, its rollback, or a
|
|
102
|
+
* candidate still being certified), while an unfinished update may return to it, while the
|
|
103
|
+
* reconciling command runs from it, or while its approval is younger than the retention window.
|
|
104
|
+
* Nothing asks which processes are running: a session that outlives the window and two updates
|
|
105
|
+
* can lose its release files, which is the documented trade-off.
|
|
134
106
|
*/
|
|
135
|
-
export declare function planProtectedReleases(state:
|
|
136
|
-
/**
|
|
137
|
-
|
|
107
|
+
export declare function planProtectedReleases(state: ReleaseState, inputs?: ProtectedReleaseInputs): ProtectedReleasePlan;
|
|
108
|
+
/**
|
|
109
|
+
* Whether a release is young enough to keep. An approved release counts from its approval; a
|
|
110
|
+
* candidate still awaiting certification counts from its materialization so concurrent work is
|
|
111
|
+
* not collected under it. A record without a readable timestamp is treated as old.
|
|
112
|
+
*/
|
|
113
|
+
export declare function withinRetention(release: ReleaseRecord, now: number, retentionMs?: number): boolean;
|
|
114
|
+
/** Serializes validated release-state revisions under a lock and commits each update atomically. */
|
|
115
|
+
export declare class ReleaseStateStore {
|
|
138
116
|
readonly path: string;
|
|
139
117
|
constructor(dataDir: string);
|
|
140
|
-
read(): Promise<
|
|
141
|
-
update(operation: (current:
|
|
142
|
-
recordCandidate(release: MaterializedRelease): Promise<
|
|
143
|
-
approve(releaseId: string, diagnosticsPath: string): Promise<
|
|
144
|
-
activate(releaseId: string): Promise<
|
|
118
|
+
read(): Promise<ReleaseState>;
|
|
119
|
+
update(operation: (current: ReleaseState) => ReleaseState | Promise<ReleaseState>): Promise<ReleaseState>;
|
|
120
|
+
recordCandidate(release: MaterializedRelease): Promise<ReleaseState>;
|
|
121
|
+
approve(releaseId: string, diagnosticsPath: string): Promise<ReleaseState>;
|
|
122
|
+
activate(releaseId: string): Promise<ReleaseState>;
|
|
145
123
|
/** Atomically advances ordinary launch without allowing an older installation to roll active state back. */
|
|
146
|
-
activateForLaunch(releaseId: string, replaceUnlaunchableActiveId?: string): Promise<
|
|
147
|
-
|
|
148
|
-
rollback(ownershipReleased: boolean): Promise<CohortState>;
|
|
149
|
-
setRetention(releaseIds: readonly string[]): Promise<CohortState>;
|
|
124
|
+
activateForLaunch(releaseId: string, replaceUnlaunchableActiveId?: string): Promise<ReleaseState>;
|
|
125
|
+
rollback(): Promise<ReleaseState>;
|
|
150
126
|
/** Atomically replace legacy retention history and detach every currently collectible record. */
|
|
151
|
-
reconcileRetention(resolveInputs: (current:
|
|
152
|
-
markCleanupTrash(releaseId: string, trashPath: string): Promise<
|
|
153
|
-
recordCleanupFailure(releaseId: string, stage: string, error: unknown): Promise<
|
|
154
|
-
completeCleanup(releaseId: string): Promise<
|
|
155
|
-
recordCleanupWorkerScheduled(runId: string): Promise<
|
|
156
|
-
recordCleanupWorkerStarted(runId: string, pid: number): Promise<
|
|
157
|
-
recordCleanupWorkerProgress(runId: string, summary: ReleaseCleanupWorkerSummary): Promise<
|
|
158
|
-
recordCleanupWorkerFinished(runId: string, status: Exclude<ReleaseCleanupWorkerStatus, "scheduled" | "running">, summary: ReleaseCleanupWorkerSummary, error?: unknown): Promise<
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
export declare function emptyState(): CohortState;
|
|
127
|
+
reconcileRetention(resolveInputs: (current: ReleaseState) => ProtectedReleaseInputs | Promise<ProtectedReleaseInputs>, orphans?: readonly OrphanReleaseDisposition[]): Promise<ReleaseRetentionReconciliation>;
|
|
128
|
+
markCleanupTrash(releaseId: string, trashPath: string): Promise<ReleaseState>;
|
|
129
|
+
recordCleanupFailure(releaseId: string, stage: string, error: unknown): Promise<ReleaseState>;
|
|
130
|
+
completeCleanup(releaseId: string): Promise<ReleaseState>;
|
|
131
|
+
recordCleanupWorkerScheduled(runId: string): Promise<ReleaseState>;
|
|
132
|
+
recordCleanupWorkerStarted(runId: string, pid: number): Promise<ReleaseState>;
|
|
133
|
+
recordCleanupWorkerProgress(runId: string, summary: ReleaseCleanupWorkerSummary): Promise<ReleaseState>;
|
|
134
|
+
recordCleanupWorkerFinished(runId: string, status: Exclude<ReleaseCleanupWorkerStatus, "scheduled" | "running">, summary: ReleaseCleanupWorkerSummary, error?: unknown): Promise<ReleaseState>;
|
|
135
|
+
}
|
|
136
|
+
export declare function emptyState(): ReleaseState;
|
|
@@ -3,33 +3,34 @@ import { mkdir, open, readFile, rename, rm, stat } from "node:fs/promises";
|
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
4
|
import { selectOrdinaryLaunchReleaseId } from "./ordinary-launch-selection.js";
|
|
5
5
|
import { PRODUCT_IDENTITY } from "../../product-identity.js";
|
|
6
|
-
export const
|
|
6
|
+
export const RELEASE_STATE_SCHEMA = PRODUCT_IDENTITY.protocol.releaseCohortSchema;
|
|
7
7
|
const RELEASE_ID_PATTERN = /^[0-9A-Za-z.+_-]+-[a-f0-9]{20}$/;
|
|
8
|
+
/** How long a release stays on disk after its approval, so processes started from it keep their files. */
|
|
9
|
+
export const RELEASE_RETENTION_MS = 7 * 24 * 60 * 60 * 1_000;
|
|
8
10
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
+
* Age-based retention. A release stays while a selector names it (active, its rollback, or a
|
|
12
|
+
* candidate still being certified), while an unfinished update may return to it, while the
|
|
13
|
+
* reconciling command runs from it, or while its approval is younger than the retention window.
|
|
14
|
+
* Nothing asks which processes are running: a session that outlives the window and two updates
|
|
15
|
+
* can lose its release files, which is the documented trade-off.
|
|
11
16
|
*/
|
|
12
17
|
export function planProtectedReleases(state, inputs = {}) {
|
|
13
|
-
const holds = inputs.externalHolds ?? [];
|
|
14
|
-
for (const hold of holds) {
|
|
15
|
-
if (hold.authority !== "agent" && hold.authority !== "migration" && hold.authority !== "resident")
|
|
16
|
-
throw new Error(`unknown release hold authority: ${String(hold.authority)}`);
|
|
17
|
-
if (!state.releases[hold.releaseId] && !state.cleanup.pending[hold.releaseId]) {
|
|
18
|
-
throw new Error(`external ${hold.authority} hold names unknown release ${hold.releaseId}`);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
18
|
const protectedIds = new Set();
|
|
22
19
|
for (const id of [state.references.active, state.references.pending, state.references.approved, state.references.rollback]) {
|
|
23
20
|
if (id !== null)
|
|
24
21
|
protectedIds.add(id);
|
|
25
22
|
}
|
|
26
|
-
for (const id of inputs.
|
|
23
|
+
for (const id of inputs.ownReleaseIds ?? [])
|
|
27
24
|
protectedIds.add(id);
|
|
28
|
-
for (const hold of holds)
|
|
29
|
-
protectedIds.add(hold.releaseId);
|
|
30
25
|
if (inputs.transaction?.status === "active" && inputs.transaction.priorActiveReleaseId !== null) {
|
|
31
26
|
protectedIds.add(inputs.transaction.priorActiveReleaseId);
|
|
32
27
|
}
|
|
28
|
+
const now = inputs.now ?? Date.now();
|
|
29
|
+
const window = inputs.retentionMs ?? RELEASE_RETENTION_MS;
|
|
30
|
+
for (const release of Object.values(state.releases)) {
|
|
31
|
+
if (withinRetention(release, now, window))
|
|
32
|
+
protectedIds.add(release.releaseId);
|
|
33
|
+
}
|
|
33
34
|
const protectedReleaseIds = [...protectedIds].sort();
|
|
34
35
|
const known = Object.keys(state.releases).sort();
|
|
35
36
|
return {
|
|
@@ -38,8 +39,20 @@ export function planProtectedReleases(state, inputs = {}) {
|
|
|
38
39
|
collectibleReleaseIds: known.filter(id => !protectedIds.has(id)),
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
|
-
/**
|
|
42
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Whether a release is young enough to keep. An approved release counts from its approval; a
|
|
44
|
+
* candidate still awaiting certification counts from its materialization so concurrent work is
|
|
45
|
+
* not collected under it. A record without a readable timestamp is treated as old.
|
|
46
|
+
*/
|
|
47
|
+
export function withinRetention(release, now, retentionMs = RELEASE_RETENTION_MS) {
|
|
48
|
+
if (release.approval === "rejected")
|
|
49
|
+
return false;
|
|
50
|
+
const stamp = release.approval === "approved" ? release.certifiedAt : release.materializedAt;
|
|
51
|
+
const at = stamp === null ? Number.NaN : Date.parse(stamp);
|
|
52
|
+
return Number.isFinite(at) && now - at < retentionMs;
|
|
53
|
+
}
|
|
54
|
+
/** Serializes validated release-state revisions under a lock and commits each update atomically. */
|
|
55
|
+
export class ReleaseStateStore {
|
|
43
56
|
path;
|
|
44
57
|
constructor(dataDir) {
|
|
45
58
|
this.path = resolve(dataDir, "release-state.json");
|
|
@@ -103,7 +116,6 @@ export class CohortStateStore {
|
|
|
103
116
|
...current.references,
|
|
104
117
|
pending: current.references.active === release.releaseId ? current.references.pending : release.releaseId,
|
|
105
118
|
},
|
|
106
|
-
activation: activation("pending", "candidate awaits certification and safe activation"),
|
|
107
119
|
};
|
|
108
120
|
});
|
|
109
121
|
}
|
|
@@ -132,7 +144,6 @@ export class CohortStateStore {
|
|
|
132
144
|
approved: releaseId,
|
|
133
145
|
rollback: prior && prior !== releaseId ? prior : current.references.rollback,
|
|
134
146
|
},
|
|
135
|
-
activation: activation("idle", null),
|
|
136
147
|
};
|
|
137
148
|
});
|
|
138
149
|
}
|
|
@@ -153,7 +164,6 @@ export class CohortStateStore {
|
|
|
153
164
|
pending: current.references.pending === releaseId ? null : current.references.pending,
|
|
154
165
|
approved: selectedId,
|
|
155
166
|
},
|
|
156
|
-
activation: activation("idle", null),
|
|
157
167
|
};
|
|
158
168
|
}
|
|
159
169
|
const prior = current.references.active;
|
|
@@ -166,16 +176,10 @@ export class CohortStateStore {
|
|
|
166
176
|
approved: releaseId,
|
|
167
177
|
rollback: prior && prior !== releaseId ? prior : current.references.rollback,
|
|
168
178
|
},
|
|
169
|
-
activation: activation("idle", null),
|
|
170
179
|
};
|
|
171
180
|
});
|
|
172
181
|
}
|
|
173
|
-
async
|
|
174
|
-
return await this.update(current => ({ ...current, activation: { ...activation("blocked", reason), blockerGenerationIds: [...blockerGenerationIds] } }));
|
|
175
|
-
}
|
|
176
|
-
async rollback(ownershipReleased) {
|
|
177
|
-
if (!ownershipReleased)
|
|
178
|
-
throw new Error("cannot roll back before current cohort ownership is released");
|
|
182
|
+
async rollback() {
|
|
179
183
|
return await this.update(current => {
|
|
180
184
|
const rollbackId = current.references.rollback;
|
|
181
185
|
if (!rollbackId)
|
|
@@ -192,17 +196,9 @@ export class CohortStateStore {
|
|
|
192
196
|
approved: rollbackId,
|
|
193
197
|
rollback: current.references.active,
|
|
194
198
|
},
|
|
195
|
-
activation: activation("idle", null),
|
|
196
199
|
};
|
|
197
200
|
});
|
|
198
201
|
}
|
|
199
|
-
async setRetention(releaseIds) {
|
|
200
|
-
return await this.update(current => {
|
|
201
|
-
for (const releaseId of releaseIds)
|
|
202
|
-
requiredRelease(current, releaseId);
|
|
203
|
-
return { ...current, references: { ...current.references, retention: unique(releaseIds) } };
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
202
|
/** Atomically replace legacy retention history and detach every currently collectible record. */
|
|
207
203
|
async reconcileRetention(resolveInputs, orphans = []) {
|
|
208
204
|
let plan = null;
|
|
@@ -318,40 +314,14 @@ export class CohortStateStore {
|
|
|
318
314
|
error: error === null ? null : boundedError(error),
|
|
319
315
|
})));
|
|
320
316
|
}
|
|
321
|
-
async removeUnreferencedRelease(releaseId, externalReferences) {
|
|
322
|
-
return await this.update(current => {
|
|
323
|
-
const release = requiredRelease(current, releaseId);
|
|
324
|
-
const protectedIds = new Set([
|
|
325
|
-
current.references.active,
|
|
326
|
-
current.references.pending,
|
|
327
|
-
current.references.approved,
|
|
328
|
-
current.references.rollback,
|
|
329
|
-
...current.references.retention,
|
|
330
|
-
...externalReferences,
|
|
331
|
-
].filter((value) => value !== null));
|
|
332
|
-
if (protectedIds.has(releaseId))
|
|
333
|
-
throw new Error(`release ${releaseId} is still referenced and cannot be collected`);
|
|
334
|
-
const releases = { ...current.releases };
|
|
335
|
-
delete releases[releaseId];
|
|
336
|
-
return {
|
|
337
|
-
...current,
|
|
338
|
-
releases,
|
|
339
|
-
cleanup: {
|
|
340
|
-
...current.cleanup,
|
|
341
|
-
pending: { ...current.cleanup.pending, [releaseId]: cleanupDisposition(release, "detached", null) },
|
|
342
|
-
},
|
|
343
|
-
};
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
317
|
}
|
|
347
318
|
export function emptyState() {
|
|
348
319
|
return {
|
|
349
|
-
schema:
|
|
320
|
+
schema: RELEASE_STATE_SCHEMA,
|
|
350
321
|
revision: 0,
|
|
351
322
|
releases: {},
|
|
352
323
|
references: { active: null, pending: null, approved: null, rollback: null, retention: [] },
|
|
353
324
|
cleanup: { pending: {}, diagnostics: [], workerRuns: [] },
|
|
354
|
-
activation: activation("idle", null),
|
|
355
325
|
};
|
|
356
326
|
}
|
|
357
327
|
function cleanupDisposition(release, stage, trashPath) {
|
|
@@ -382,16 +352,12 @@ function replaceCleanupWorkerRun(current, runId, operation) {
|
|
|
382
352
|
: [...current.cleanup.workerRuns, operation(undefined)];
|
|
383
353
|
return { ...current, cleanup: { ...current.cleanup, workerRuns: workerRuns.slice(-16) } };
|
|
384
354
|
}
|
|
385
|
-
function activation(state, reason) {
|
|
386
|
-
return { state, reason, blockerGenerationIds: [], updatedAt: new Date().toISOString() };
|
|
387
|
-
}
|
|
388
355
|
function requiredRelease(state, releaseId) {
|
|
389
356
|
const release = state.releases[releaseId];
|
|
390
357
|
if (!release)
|
|
391
358
|
throw new Error(`unknown release ${releaseId}`);
|
|
392
359
|
return release;
|
|
393
360
|
}
|
|
394
|
-
function unique(values) { return [...new Set(values)]; }
|
|
395
361
|
async function acquireLock(path) {
|
|
396
362
|
const deadline = Date.now() + 5_000;
|
|
397
363
|
while (true) {
|
|
@@ -452,7 +418,9 @@ async function reclaimAbandonedLock(path) {
|
|
|
452
418
|
function normalizeState(value) {
|
|
453
419
|
if (!value || typeof value !== "object")
|
|
454
420
|
return value;
|
|
455
|
-
|
|
421
|
+
// Compatibility: state written while supervisors coordinated activation carries an
|
|
422
|
+
// `activation` record that nothing reads any more; it is dropped on the next write.
|
|
423
|
+
const { activation: _activation, ...state } = value;
|
|
456
424
|
const cleanup = state.cleanup;
|
|
457
425
|
return {
|
|
458
426
|
...state,
|
|
@@ -462,11 +430,11 @@ function normalizeState(value) {
|
|
|
462
430
|
};
|
|
463
431
|
}
|
|
464
432
|
function validateState(state) {
|
|
465
|
-
if (!state || state.schema !==
|
|
433
|
+
if (!state || state.schema !== RELEASE_STATE_SCHEMA || !Number.isSafeInteger(state.revision) || state.revision < 0
|
|
466
434
|
|| !state.releases || typeof state.releases !== "object" || !state.references || !Array.isArray(state.references.retention)
|
|
467
435
|
|| !state.cleanup || typeof state.cleanup.pending !== "object" || !Array.isArray(state.cleanup.diagnostics)
|
|
468
436
|
|| !Array.isArray(state.cleanup.workerRuns)) {
|
|
469
|
-
throw new Error("invalid release
|
|
437
|
+
throw new Error("invalid release state");
|
|
470
438
|
}
|
|
471
439
|
for (const run of state.cleanup.workerRuns) {
|
|
472
440
|
if (!run || typeof run.runId !== "string" || run.runId.length === 0
|
|
@@ -501,9 +469,9 @@ function validateReleaseRecord(releaseId, release) {
|
|
|
501
469
|
function validateTransition(current, next) {
|
|
502
470
|
validateState(next);
|
|
503
471
|
if (next.schema !== current.schema)
|
|
504
|
-
throw new Error("release
|
|
472
|
+
throw new Error("release schema cannot change during a state update");
|
|
505
473
|
if (next.revision !== current.revision)
|
|
506
|
-
throw new Error("release
|
|
474
|
+
throw new Error("release revision is controlled by the state store");
|
|
507
475
|
}
|
|
508
476
|
function boundedError(error) {
|
|
509
477
|
return (error instanceof Error ? error.message : String(error)).replace(/[\r\n]+/g, " ").slice(0, 1_000);
|
|
@@ -51,8 +51,8 @@ export declare function assertCertifiedFilesPresent(releaseRoot: string): Promis
|
|
|
51
51
|
export declare function repairMaterializedRelease(packageRoot: string, releaseRoot: string): Promise<MaterializedRelease>;
|
|
52
52
|
/**
|
|
53
53
|
* Load metadata for a release whose bytes were already certified by the
|
|
54
|
-
* current parent process or an authenticated
|
|
55
|
-
* establish
|
|
54
|
+
* current parent process or recorded by an authenticated certification. Callers must
|
|
55
|
+
* establish that precondition; untrusted releases require full
|
|
56
56
|
* verification.
|
|
57
57
|
*/
|
|
58
58
|
export declare function readCertifiedReleaseManifest(record: CertifiedReleaseRecord, selectedStoreRoot: string, options?: ReadCertifiedReleaseManifestOptions): Promise<MaterializedRelease>;
|
|
@@ -167,8 +167,8 @@ export async function repairMaterializedRelease(packageRoot, releaseRoot) {
|
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
169
169
|
* Load metadata for a release whose bytes were already certified by the
|
|
170
|
-
* current parent process or an authenticated
|
|
171
|
-
* establish
|
|
170
|
+
* current parent process or recorded by an authenticated certification. Callers must
|
|
171
|
+
* establish that precondition; untrusted releases require full
|
|
172
172
|
* verification.
|
|
173
173
|
*/
|
|
174
174
|
export async function readCertifiedReleaseManifest(record, selectedStoreRoot, options = {}) {
|
|
@@ -10,7 +10,7 @@ import { PRODUCT_PACKAGE_NAME } from "./release.js";
|
|
|
10
10
|
import { RELEASE_MANIFEST_FILENAME } from "./release-store.js";
|
|
11
11
|
import { UpdateTransactionStore } from "./update-transaction.js";
|
|
12
12
|
const RESTART_SEAL_VERSION = 1;
|
|
13
|
-
const REQUIRED_LAUNCH_ENTRIES = ["bin/
|
|
13
|
+
const REQUIRED_LAUNCH_ENTRIES = ["bin/ui.js"];
|
|
14
14
|
/** Build compact restart authority after complete content verification established read-only payload files. */
|
|
15
15
|
export async function createRestartSeal(release, dataDir) {
|
|
16
16
|
const policy = immutablePlatformPolicy();
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ContinuityOptions } from "../resident-tabs/index.js";
|
|
2
1
|
/**
|
|
3
2
|
* The one activation contract an installed tree can offer the updater that installed it.
|
|
4
3
|
* The updater knows nothing else about the tree: the manifest names the contracts the tree
|
|
@@ -9,10 +8,6 @@ export declare const UPDATE_ACTIVATION_ENTRY = "bin/activate.js";
|
|
|
9
8
|
/** Manifest field listing the activation contracts an installed tree serves. */
|
|
10
9
|
export declare const UPDATE_ACTIVATION_MANIFEST_FIELD = "updateActivationContracts";
|
|
11
10
|
export type UpdateActivationPhase = "materialized" | "certified" | "active-reference-committed";
|
|
12
|
-
/** A certified candidate is safe to retain, but resident control continuity blocks selection. */
|
|
13
|
-
export declare class UpdateActivationBlockedError extends Error {
|
|
14
|
-
readonly code: "resident-continuity-blocked";
|
|
15
|
-
}
|
|
16
11
|
/**
|
|
17
12
|
* Copying the release is the longest step with nothing to say for itself, so it
|
|
18
13
|
* reports the files it has written against the files it must write. A caller that
|
|
@@ -49,12 +44,11 @@ export type UpdateActivationEvent = {
|
|
|
49
44
|
} | {
|
|
50
45
|
readonly event: "failed";
|
|
51
46
|
readonly message: string;
|
|
52
|
-
readonly code?: UpdateActivationBlockedError["code"];
|
|
53
47
|
};
|
|
54
48
|
/**
|
|
55
49
|
* Activate the installed tree at `packageRoot` with this process's own release code:
|
|
56
|
-
* materialize it into the immutable store, certify, warm,
|
|
57
|
-
*
|
|
50
|
+
* materialize it into the immutable store, certify, warm, and only then move the active
|
|
51
|
+
* reference. This is what the installed tree runs for itself through
|
|
58
52
|
* its activation entry, and what an updater runs in-process for a tree older than the contract.
|
|
59
53
|
*/
|
|
60
54
|
export declare function activateInstalledRelease(request: UpdateActivationRequest, callbacks: UpdateActivationCallbacks): Promise<void>;
|
|
@@ -76,4 +70,3 @@ export declare function delegateActivation(request: UpdateActivationRequest, cal
|
|
|
76
70
|
export declare function runActivationEntry(argv: readonly string[], entryUrl: string, io?: {
|
|
77
71
|
write(line: string): void;
|
|
78
72
|
}, environment?: NodeJS.ProcessEnv): Promise<number>;
|
|
79
|
-
export declare function assertContinuityOrBlock(context: ContinuityOptions): Promise<void>;
|
|
@@ -2,10 +2,9 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import {
|
|
6
|
-
import { certifyMaterializedRelease
|
|
7
|
-
import {
|
|
8
|
-
import { encodeFrame, LineFrameDecoder } from "../protocol/index.js";
|
|
5
|
+
import { PRODUCT_TEXT } from "../../product-identity.js";
|
|
6
|
+
import { certifyMaterializedRelease } from "./bootstrap.js";
|
|
7
|
+
import { ReleaseStateStore } from "./release-state.js";
|
|
9
8
|
import { resolveProductPaths } from "../lifecycle/index.js";
|
|
10
9
|
import { materializeRelease } from "./release-store.js";
|
|
11
10
|
import { warmMaterializedRelease } from "./warmup.js";
|
|
@@ -19,18 +18,16 @@ export const UPDATE_ACTIVATION_ENTRY = "bin/activate.js";
|
|
|
19
18
|
/** Manifest field listing the activation contracts an installed tree serves. */
|
|
20
19
|
export const UPDATE_ACTIVATION_MANIFEST_FIELD = "updateActivationContracts";
|
|
21
20
|
const ACTIVATION_DIAGNOSTIC_LIMIT = 2_000;
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
code = "resident-continuity-blocked";
|
|
25
|
-
}
|
|
21
|
+
/** Bound on one progress line; the activator's events are all far shorter. */
|
|
22
|
+
const ACTIVATION_LINE_LIMIT = 64 * 1_024;
|
|
26
23
|
/**
|
|
27
24
|
* Activate the installed tree at `packageRoot` with this process's own release code:
|
|
28
|
-
* materialize it into the immutable store, certify, warm,
|
|
29
|
-
*
|
|
25
|
+
* materialize it into the immutable store, certify, warm, and only then move the active
|
|
26
|
+
* reference. This is what the installed tree runs for itself through
|
|
30
27
|
* its activation entry, and what an updater runs in-process for a tree older than the contract.
|
|
31
28
|
*/
|
|
32
29
|
export async function activateInstalledRelease(request, callbacks) {
|
|
33
|
-
const stateStore = new
|
|
30
|
+
const stateStore = new ReleaseStateStore(request.dataDir);
|
|
34
31
|
let total = 0;
|
|
35
32
|
let completed = 0;
|
|
36
33
|
const candidate = await materializeRelease(request.packageRoot, request.dataDir, {
|
|
@@ -55,16 +52,6 @@ export async function activateInstalledRelease(request, callbacks) {
|
|
|
55
52
|
callbacks.onWarmup?.("started");
|
|
56
53
|
await warmMaterializedRelease(candidate, request.environment);
|
|
57
54
|
callbacks.onWarmup?.("completed");
|
|
58
|
-
await completeActivation(candidate, request, callbacks, stateStore);
|
|
59
|
-
}
|
|
60
|
-
async function completeActivation(candidate, request, callbacks, stateStore) {
|
|
61
|
-
const paths = resolveProductPaths(request.environment);
|
|
62
|
-
const continuity = { releaseRoot: candidate.releaseRoot, dataDir: request.dataDir, environment: request.environment,
|
|
63
|
-
profileRoot: request.environment[PRODUCT_IDENTITY.environment.profileHome] ?? paths.configDir, runtimeDir: paths.runtimeDir };
|
|
64
|
-
await assertContinuityOrBlock(continuity);
|
|
65
|
-
await ensureSupervisor(candidate, request.environment);
|
|
66
|
-
// Invariant: revalidate after supervision, before committing client activation or restart readiness.
|
|
67
|
-
await assertContinuityOrBlock(continuity);
|
|
68
55
|
await stateStore.activate(candidate.releaseId);
|
|
69
56
|
await callbacks.phase("active-reference-committed");
|
|
70
57
|
}
|
|
@@ -94,7 +81,7 @@ export async function delegateActivation(request, callbacks) {
|
|
|
94
81
|
stdio: ["ignore", "pipe", "pipe"],
|
|
95
82
|
windowsHide: true,
|
|
96
83
|
});
|
|
97
|
-
|
|
84
|
+
let pending = "";
|
|
98
85
|
let diagnostics = "";
|
|
99
86
|
let failure = null;
|
|
100
87
|
let completed = false;
|
|
@@ -102,14 +89,25 @@ export async function delegateActivation(request, callbacks) {
|
|
|
102
89
|
let relay = Promise.resolve();
|
|
103
90
|
child.stderr?.setEncoding("utf8");
|
|
104
91
|
child.stderr?.on("data", chunk => { diagnostics = `${diagnostics}${chunk}`.slice(-ACTIVATION_DIAGNOSTIC_LIMIT); });
|
|
92
|
+
child.stdout?.setEncoding("utf8");
|
|
105
93
|
child.stdout?.on("data", chunk => {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
94
|
+
const lines = `${pending}${String(chunk)}`.split("\n");
|
|
95
|
+
pending = lines.pop() ?? "";
|
|
96
|
+
if (pending.length > ACTIVATION_LINE_LIMIT) {
|
|
97
|
+
failure ??= new Error("activation event exceeds the line limit");
|
|
98
|
+
pending = "";
|
|
109
99
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
100
|
+
const events = [];
|
|
101
|
+
for (const line of lines) {
|
|
102
|
+
if (line.trim().length === 0)
|
|
103
|
+
continue;
|
|
104
|
+
try {
|
|
105
|
+
events.push(JSON.parse(line));
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
failure ??= new Error(errorMessage(error));
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
113
111
|
}
|
|
114
112
|
for (const event of events) {
|
|
115
113
|
relay = relay.then(async () => {
|
|
@@ -127,9 +125,7 @@ export async function delegateActivation(request, callbacks) {
|
|
|
127
125
|
else if (parsed.event === "completed")
|
|
128
126
|
completed = true;
|
|
129
127
|
else
|
|
130
|
-
failure ??= parsed.
|
|
131
|
-
? new UpdateActivationBlockedError(parsed.message)
|
|
132
|
-
: new Error(parsed.message);
|
|
128
|
+
failure ??= new Error(parsed.message);
|
|
133
129
|
}).catch(error => { failure ??= new Error(errorMessage(error)); });
|
|
134
130
|
}
|
|
135
131
|
});
|
|
@@ -150,7 +146,7 @@ export async function delegateActivation(request, callbacks) {
|
|
|
150
146
|
* writing one progress event per line so the updater that started it can follow along.
|
|
151
147
|
*/
|
|
152
148
|
export async function runActivationEntry(argv, entryUrl, io = { write: line => process.stdout.write(line) }, environment = process.env) {
|
|
153
|
-
const emit = (event) => io.write(
|
|
149
|
+
const emit = (event) => io.write(`${JSON.stringify(event)}\n`);
|
|
154
150
|
try {
|
|
155
151
|
const arguments_ = parseEntryArguments(argv);
|
|
156
152
|
const packageRoot = resolve(fileURLToPath(new URL("..", entryUrl)));
|
|
@@ -168,7 +164,7 @@ export async function runActivationEntry(argv, entryUrl, io = { write: line => p
|
|
|
168
164
|
return 0;
|
|
169
165
|
}
|
|
170
166
|
catch (error) {
|
|
171
|
-
emit({ event: "failed", message: errorMessage(error)
|
|
167
|
+
emit({ event: "failed", message: errorMessage(error) });
|
|
172
168
|
return 1;
|
|
173
169
|
}
|
|
174
170
|
}
|
|
@@ -206,22 +202,11 @@ function parseActivationEvent(value) {
|
|
|
206
202
|
case "completed":
|
|
207
203
|
return { event: "completed" };
|
|
208
204
|
case "failed":
|
|
209
|
-
return typeof record.message === "string"
|
|
210
|
-
? { event: "failed", message: record.message, ...(record.code === undefined ? {} : { code: record.code }) }
|
|
211
|
-
: null;
|
|
205
|
+
return typeof record.message === "string" ? { event: "failed", message: record.message } : null;
|
|
212
206
|
default:
|
|
213
207
|
return null;
|
|
214
208
|
}
|
|
215
209
|
}
|
|
216
|
-
export async function assertContinuityOrBlock(context) {
|
|
217
|
-
const { assertResidentContinuity } = await import("../resident-tabs/index.js");
|
|
218
|
-
try {
|
|
219
|
-
await assertResidentContinuity(context);
|
|
220
|
-
}
|
|
221
|
-
catch (error) {
|
|
222
|
-
throw new UpdateActivationBlockedError(errorMessage(error), { cause: error });
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
210
|
function summarize(text) {
|
|
226
211
|
const lines = text.split(/\r?\n/).map(line => line.trim()).filter(line => line.length > 0);
|
|
227
212
|
return lines.length === 0 ? "" : `: ${lines.slice(0, 4).join(" | ")}`;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { UpdateChannel } from "./types.js";
|
|
2
2
|
import { type UpdateTransaction } from "./update-transaction.js";
|
|
3
|
-
export declare const UPDATE_EXECUTION_LEASE_FILENAME = "update-execution.json";
|
|
4
3
|
declare const LEASE_SCHEMA = 1;
|
|
5
|
-
|
|
4
|
+
type UpdateExecutionMode = "manual" | "automatic";
|
|
6
5
|
export interface UpdateExecutionOwner {
|
|
7
6
|
readonly schema: typeof LEASE_SCHEMA;
|
|
8
7
|
readonly ownerId: string;
|
|
@@ -14,7 +13,7 @@ export interface UpdateExecutionOwner {
|
|
|
14
13
|
readonly mode: UpdateExecutionMode;
|
|
15
14
|
readonly acquiredAt: string;
|
|
16
15
|
}
|
|
17
|
-
|
|
16
|
+
type UpdateExecutionLeaseResult = {
|
|
18
17
|
readonly status: "acquired";
|
|
19
18
|
readonly owner: UpdateExecutionOwner;
|
|
20
19
|
release(): Promise<void>;
|
|
@@ -2,9 +2,9 @@ import { randomUUID } from "node:crypto";
|
|
|
2
2
|
import { mkdir, open, readFile, rename, rm } from "node:fs/promises";
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
4
|
import lockfile from "proper-lockfile";
|
|
5
|
-
import { processIsAlive } from "./process-
|
|
5
|
+
import { processIsAlive } from "./process-liveness.js";
|
|
6
6
|
import { UpdateTransactionStore } from "./update-transaction.js";
|
|
7
|
-
|
|
7
|
+
const UPDATE_EXECUTION_LEASE_FILENAME = "update-execution.json";
|
|
8
8
|
const LEASE_SCHEMA = 1;
|
|
9
9
|
const MAX_LEASE_BYTES = 8_192;
|
|
10
10
|
/**
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReleaseState, ReleaseRecord } from "./release-state.js";
|
|
2
2
|
import type { UpdateTransaction } from "./update-transaction.js";
|
|
3
3
|
/** Keep interactive launches on the last successful release until the update commits success. */
|
|
4
|
-
export declare function selectUpdateLaunchRelease(state:
|
|
5
|
-
/** Pause cohort retirement during preparation; afterward only the successful launch release admits new sessions. */
|
|
6
|
-
export declare function selectSupervisorLaunchReleaseId(state: CohortState, transaction: UpdateTransaction | null): string | null;
|
|
4
|
+
export declare function selectUpdateLaunchRelease(state: ReleaseState, transaction: UpdateTransaction | null): ReleaseRecord | null;
|