@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,459 @@
|
|
|
1
|
+
import { DatabaseSync } from "node:sqlite";
|
|
2
|
+
import { mkdirSync } from "node:fs";
|
|
3
|
+
import { dirname } from "node:path";
|
|
4
|
+
import { assertManagedAgentDescriptor, assertRecoveryAuthority, assertTerminalSessionLaunch, assertTerminalTopologySnapshot, } from "../workspace-contracts/index.js";
|
|
5
|
+
export const DEFAULT_WORKSPACE_ID = "workspace-default";
|
|
6
|
+
const INITIAL_WORKSPACE_ID = DEFAULT_WORKSPACE_ID;
|
|
7
|
+
export class ControlStore {
|
|
8
|
+
bootNonce;
|
|
9
|
+
database;
|
|
10
|
+
constructor(path, bootNonce = null) {
|
|
11
|
+
this.bootNonce = bootNonce;
|
|
12
|
+
mkdirSync(dirname(path), { recursive: true, mode: 0o700 });
|
|
13
|
+
this.database = new DatabaseSync(path);
|
|
14
|
+
this.database.exec("PRAGMA journal_mode = WAL");
|
|
15
|
+
this.database.exec("PRAGMA foreign_keys = ON");
|
|
16
|
+
this.migrate();
|
|
17
|
+
if (bootNonce !== null) {
|
|
18
|
+
this.reconcilePriorBootGenerations(bootNonce);
|
|
19
|
+
this.reconcilePriorBootForegroundTerminalLeases(bootNonce);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
migrate() {
|
|
23
|
+
const versionRow = this.database.prepare("PRAGMA user_version").get();
|
|
24
|
+
const version = versionRow.user_version;
|
|
25
|
+
if (version > 4)
|
|
26
|
+
throw new Error(`control database version ${version} is newer than supported version 4`);
|
|
27
|
+
if (version === 0) {
|
|
28
|
+
this.database.exec(`
|
|
29
|
+
BEGIN IMMEDIATE;
|
|
30
|
+
CREATE TABLE workspaces (
|
|
31
|
+
id TEXT PRIMARY KEY,
|
|
32
|
+
name TEXT NOT NULL,
|
|
33
|
+
selected_agent_id TEXT,
|
|
34
|
+
created_at TEXT NOT NULL
|
|
35
|
+
);
|
|
36
|
+
CREATE TABLE driver_profiles (
|
|
37
|
+
id TEXT PRIMARY KEY,
|
|
38
|
+
kind TEXT NOT NULL,
|
|
39
|
+
profile_json TEXT NOT NULL,
|
|
40
|
+
created_at TEXT NOT NULL
|
|
41
|
+
);
|
|
42
|
+
CREATE TABLE terminal_agents (
|
|
43
|
+
id TEXT PRIMARY KEY,
|
|
44
|
+
workspace_id TEXT NOT NULL REFERENCES workspaces(id) ON DELETE CASCADE,
|
|
45
|
+
name TEXT NOT NULL,
|
|
46
|
+
profile_id TEXT NOT NULL REFERENCES driver_profiles(id),
|
|
47
|
+
profile_json TEXT NOT NULL,
|
|
48
|
+
surface_json TEXT,
|
|
49
|
+
created_at TEXT NOT NULL
|
|
50
|
+
);
|
|
51
|
+
CREATE TABLE process_generations (
|
|
52
|
+
id TEXT PRIMARY KEY,
|
|
53
|
+
agent_id TEXT NOT NULL REFERENCES terminal_agents(id) ON DELETE CASCADE,
|
|
54
|
+
sequence INTEGER NOT NULL,
|
|
55
|
+
profile_id TEXT NOT NULL REFERENCES driver_profiles(id),
|
|
56
|
+
state TEXT NOT NULL,
|
|
57
|
+
capabilities_json TEXT NOT NULL,
|
|
58
|
+
started_at TEXT NOT NULL,
|
|
59
|
+
exited_at TEXT,
|
|
60
|
+
exit_code INTEGER,
|
|
61
|
+
signal INTEGER,
|
|
62
|
+
error TEXT,
|
|
63
|
+
owner_boot_nonce TEXT,
|
|
64
|
+
UNIQUE(agent_id, sequence)
|
|
65
|
+
);
|
|
66
|
+
CREATE INDEX idx_agents_workspace ON terminal_agents(workspace_id, created_at);
|
|
67
|
+
CREATE INDEX idx_generations_agent ON process_generations(agent_id, sequence DESC);
|
|
68
|
+
CREATE INDEX idx_generations_owner_boot ON process_generations(owner_boot_nonce, state);
|
|
69
|
+
PRAGMA user_version = 1;
|
|
70
|
+
COMMIT;
|
|
71
|
+
`);
|
|
72
|
+
const now = new Date().toISOString();
|
|
73
|
+
this.database.prepare("INSERT INTO workspaces (id, name, selected_agent_id, created_at) VALUES (?, ?, NULL, ?)")
|
|
74
|
+
.run(INITIAL_WORKSPACE_ID, "Workspace", now);
|
|
75
|
+
}
|
|
76
|
+
if (version <= 1) {
|
|
77
|
+
const columns = this.database.prepare("PRAGMA table_info(process_generations)").all();
|
|
78
|
+
if (!columns.some(column => column.name === "owner_boot_nonce")) {
|
|
79
|
+
this.database.exec("ALTER TABLE process_generations ADD COLUMN owner_boot_nonce TEXT");
|
|
80
|
+
}
|
|
81
|
+
this.database.exec(`
|
|
82
|
+
BEGIN IMMEDIATE;
|
|
83
|
+
CREATE INDEX IF NOT EXISTS idx_generations_owner_boot ON process_generations(owner_boot_nonce, state);
|
|
84
|
+
CREATE TABLE foreground_terminal_leases (
|
|
85
|
+
id TEXT PRIMARY KEY,
|
|
86
|
+
owner_id TEXT NOT NULL,
|
|
87
|
+
profile_json TEXT NOT NULL,
|
|
88
|
+
state TEXT NOT NULL,
|
|
89
|
+
generation_id TEXT,
|
|
90
|
+
process_identity_json TEXT,
|
|
91
|
+
acquired_at TEXT NOT NULL,
|
|
92
|
+
heartbeat_at TEXT,
|
|
93
|
+
released_at TEXT,
|
|
94
|
+
outcome_json TEXT,
|
|
95
|
+
owner_boot_nonce TEXT NOT NULL
|
|
96
|
+
);
|
|
97
|
+
CREATE UNIQUE INDEX idx_one_live_foreground_lease ON foreground_terminal_leases((1)) WHERE state IN ('requested', 'active');
|
|
98
|
+
CREATE INDEX idx_foreground_lease_boot ON foreground_terminal_leases(owner_boot_nonce, state);
|
|
99
|
+
PRAGMA user_version = 2;
|
|
100
|
+
COMMIT;
|
|
101
|
+
`);
|
|
102
|
+
}
|
|
103
|
+
if (version <= 2) {
|
|
104
|
+
this.database.exec(`
|
|
105
|
+
BEGIN IMMEDIATE;
|
|
106
|
+
CREATE TABLE workspace_agents (
|
|
107
|
+
id TEXT PRIMARY KEY,
|
|
108
|
+
workspace_id TEXT NOT NULL REFERENCES workspaces(id) ON DELETE CASCADE,
|
|
109
|
+
display_name TEXT NOT NULL,
|
|
110
|
+
adapter_id TEXT NOT NULL,
|
|
111
|
+
runtime_kind TEXT NOT NULL CHECK (runtime_kind IN ('structured', 'composed-terminal')),
|
|
112
|
+
lifecycle TEXT NOT NULL,
|
|
113
|
+
capability_json TEXT NOT NULL,
|
|
114
|
+
recovery_reference_id TEXT,
|
|
115
|
+
created_at TEXT NOT NULL,
|
|
116
|
+
updated_at TEXT NOT NULL,
|
|
117
|
+
CHECK (json_valid(capability_json))
|
|
118
|
+
);
|
|
119
|
+
CREATE INDEX idx_workspace_agents_workspace ON workspace_agents(workspace_id, created_at);
|
|
120
|
+
CREATE INDEX idx_workspace_agents_recovery ON workspace_agents(recovery_reference_id);
|
|
121
|
+
|
|
122
|
+
CREATE TABLE native_host_topology (
|
|
123
|
+
host_instance_id TEXT PRIMARY KEY,
|
|
124
|
+
protocol_version INTEGER NOT NULL CHECK (protocol_version = 1),
|
|
125
|
+
revision INTEGER NOT NULL CHECK (revision >= 0),
|
|
126
|
+
topology_json TEXT NOT NULL CHECK (json_valid(topology_json)),
|
|
127
|
+
rollback_json TEXT NOT NULL CHECK (json_valid(rollback_json)),
|
|
128
|
+
updated_at TEXT NOT NULL
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
CREATE TABLE terminal_sessions (
|
|
132
|
+
id TEXT PRIMARY KEY,
|
|
133
|
+
host_instance_id TEXT NOT NULL REFERENCES native_host_topology(host_instance_id) ON DELETE CASCADE,
|
|
134
|
+
pane_id TEXT NOT NULL,
|
|
135
|
+
lifecycle TEXT NOT NULL,
|
|
136
|
+
launch_json TEXT NOT NULL CHECK (json_valid(launch_json)),
|
|
137
|
+
recovery_reference_id TEXT,
|
|
138
|
+
updated_at TEXT NOT NULL
|
|
139
|
+
);
|
|
140
|
+
CREATE UNIQUE INDEX idx_terminal_sessions_pane ON terminal_sessions(host_instance_id, pane_id);
|
|
141
|
+
CREATE INDEX idx_terminal_sessions_recovery ON terminal_sessions(recovery_reference_id);
|
|
142
|
+
|
|
143
|
+
CREATE TABLE recovery_references (
|
|
144
|
+
id TEXT PRIMARY KEY,
|
|
145
|
+
agent_id TEXT NOT NULL REFERENCES workspace_agents(id) ON DELETE CASCADE,
|
|
146
|
+
authority_json TEXT NOT NULL CHECK (json_valid(authority_json)),
|
|
147
|
+
status TEXT NOT NULL CHECK (status IN ('pending', 'accepted', 'rejected', 'discontinuous')),
|
|
148
|
+
rollback_json TEXT NOT NULL CHECK (json_valid(rollback_json)),
|
|
149
|
+
created_at TEXT NOT NULL,
|
|
150
|
+
updated_at TEXT NOT NULL
|
|
151
|
+
);
|
|
152
|
+
CREATE INDEX idx_recovery_references_agent ON recovery_references(agent_id, status);
|
|
153
|
+
PRAGMA user_version = 3;
|
|
154
|
+
COMMIT;
|
|
155
|
+
`);
|
|
156
|
+
}
|
|
157
|
+
if (version <= 3) {
|
|
158
|
+
this.database.exec(`
|
|
159
|
+
BEGIN IMMEDIATE;
|
|
160
|
+
ALTER TABLE workspace_agents ADD COLUMN unread_count INTEGER NOT NULL DEFAULT 0 CHECK (unread_count >= 0);
|
|
161
|
+
ALTER TABLE workspace_agents ADD COLUMN attention INTEGER NOT NULL DEFAULT 0 CHECK (attention IN (0, 1));
|
|
162
|
+
ALTER TABLE workspace_agents ADD COLUMN failure_json TEXT CHECK (failure_json IS NULL OR json_valid(failure_json));
|
|
163
|
+
ALTER TABLE workspaces ADD COLUMN revision INTEGER NOT NULL DEFAULT 0 CHECK (revision >= 0);
|
|
164
|
+
PRAGMA user_version = 4;
|
|
165
|
+
COMMIT;
|
|
166
|
+
`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
reconcilePriorBootGenerations(bootNonce) {
|
|
170
|
+
const now = new Date().toISOString();
|
|
171
|
+
return this.#transaction(() => {
|
|
172
|
+
const result = this.database.prepare(`UPDATE process_generations
|
|
173
|
+
SET state = 'interrupted', exited_at = ?, error = COALESCE(error, 'supervisor ownership ended before a terminal outcome')
|
|
174
|
+
WHERE state NOT IN ('exited', 'stopped', 'interrupted', 'error')
|
|
175
|
+
AND (owner_boot_nonce IS NULL OR owner_boot_nonce <> ?)`)
|
|
176
|
+
.run(now, bootNonce);
|
|
177
|
+
return Number(result.changes);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
acquireForegroundTerminalLease(lease) {
|
|
181
|
+
if (this.bootNonce === null)
|
|
182
|
+
throw new Error("foreground lease storage requires a supervisor boot identity");
|
|
183
|
+
if (lease.state !== "requested" || lease.generationId !== null || lease.processIdentity !== null || lease.releasedAt !== null || lease.outcome !== null) {
|
|
184
|
+
throw new Error("new foreground lease must be requested and unactivated");
|
|
185
|
+
}
|
|
186
|
+
try {
|
|
187
|
+
this.database.prepare(`INSERT INTO foreground_terminal_leases
|
|
188
|
+
(id, owner_id, profile_json, state, generation_id, process_identity_json, acquired_at, heartbeat_at, released_at, outcome_json, owner_boot_nonce)
|
|
189
|
+
VALUES (?, ?, ?, 'requested', NULL, NULL, ?, NULL, NULL, NULL, ?)`)
|
|
190
|
+
.run(lease.id, lease.ownerId, JSON.stringify(lease.profile), lease.acquiredAt, this.bootNonce);
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
if (error instanceof Error && /UNIQUE constraint failed/i.test(error.message))
|
|
194
|
+
throw new Error("an exclusive foreground terminal lease is already live");
|
|
195
|
+
throw error;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
activateForegroundTerminalLease(leaseId, generationId, processIdentity, heartbeatAt) {
|
|
199
|
+
if (this.bootNonce === null)
|
|
200
|
+
throw new Error("foreground lease storage requires a supervisor boot identity");
|
|
201
|
+
const result = this.database.prepare(`UPDATE foreground_terminal_leases
|
|
202
|
+
SET state = 'active', generation_id = ?, process_identity_json = ?, heartbeat_at = ?
|
|
203
|
+
WHERE id = ? AND state = 'requested' AND owner_boot_nonce = ?`)
|
|
204
|
+
.run(generationId, JSON.stringify(processIdentity), heartbeatAt, leaseId, this.bootNonce);
|
|
205
|
+
return Number(result.changes) === 1;
|
|
206
|
+
}
|
|
207
|
+
heartbeatForegroundTerminalLease(leaseId, processIdentity, heartbeatAt) {
|
|
208
|
+
if (this.bootNonce === null)
|
|
209
|
+
throw new Error("foreground lease storage requires a supervisor boot identity");
|
|
210
|
+
const result = this.database.prepare(`UPDATE foreground_terminal_leases SET heartbeat_at = ?
|
|
211
|
+
WHERE id = ? AND state = 'active' AND owner_boot_nonce = ? AND process_identity_json = ?`)
|
|
212
|
+
.run(heartbeatAt, leaseId, this.bootNonce, JSON.stringify(processIdentity));
|
|
213
|
+
return Number(result.changes) === 1;
|
|
214
|
+
}
|
|
215
|
+
releaseForegroundTerminalLease(leaseId, processIdentity, outcome, releasedAt) {
|
|
216
|
+
if (this.bootNonce === null)
|
|
217
|
+
throw new Error("foreground lease storage requires a supervisor boot identity");
|
|
218
|
+
const expectedIdentity = processIdentity === null ? null : JSON.stringify(processIdentity);
|
|
219
|
+
const result = this.database.prepare(`UPDATE foreground_terminal_leases
|
|
220
|
+
SET state = 'released', released_at = ?, outcome_json = ?
|
|
221
|
+
WHERE id = ? AND state IN ('requested', 'active') AND owner_boot_nonce = ?
|
|
222
|
+
AND ((process_identity_json IS NULL AND ? IS NULL) OR process_identity_json = ?)`)
|
|
223
|
+
.run(releasedAt, JSON.stringify(outcome), leaseId, this.bootNonce, expectedIdentity, expectedIdentity);
|
|
224
|
+
return Number(result.changes) === 1;
|
|
225
|
+
}
|
|
226
|
+
loadLiveForegroundTerminalLease() {
|
|
227
|
+
const row = this.database.prepare("SELECT * FROM foreground_terminal_leases WHERE state IN ('requested', 'active') LIMIT 1").get();
|
|
228
|
+
return row ? foregroundLeaseFromRow(row) : null;
|
|
229
|
+
}
|
|
230
|
+
reconcilePriorBootForegroundTerminalLeases(bootNonce, reconciledAt = new Date().toISOString()) {
|
|
231
|
+
const outcome = { kind: "broker-error", message: "foreground lease owner ended before a terminal outcome", code: "stale-owner-boot" };
|
|
232
|
+
const result = this.database.prepare(`UPDATE foreground_terminal_leases
|
|
233
|
+
SET state = 'released', released_at = ?, outcome_json = ?
|
|
234
|
+
WHERE state IN ('requested', 'active') AND owner_boot_nonce <> ?`)
|
|
235
|
+
.run(reconciledAt, JSON.stringify(outcome), bootNonce);
|
|
236
|
+
return Number(result.changes);
|
|
237
|
+
}
|
|
238
|
+
persistWorkspaceAgent(agent, updatedAt = new Date().toISOString()) {
|
|
239
|
+
const existing = this.loadWorkspaceAgentRecord(agent.id);
|
|
240
|
+
this.persistWorkspaceAgentRecord({
|
|
241
|
+
agent,
|
|
242
|
+
presentation: existing?.presentation ?? { unreadActivity: 0, attention: false, failure: null },
|
|
243
|
+
}, updatedAt);
|
|
244
|
+
}
|
|
245
|
+
persistWorkspaceAgentRecord(record, updatedAt = new Date().toISOString()) {
|
|
246
|
+
assertManagedAgentDescriptor(record.agent);
|
|
247
|
+
assertWorkspaceAgentPresentation(record.presentation);
|
|
248
|
+
this.#upsertWorkspaceAgentRecord(record, updatedAt);
|
|
249
|
+
}
|
|
250
|
+
replaceWorkspaceAgentRecords(records, selectedAgentId, revision, updatedAt = new Date().toISOString()) {
|
|
251
|
+
if (!Number.isSafeInteger(revision) || revision < 0)
|
|
252
|
+
throw new RangeError("workspace revision must be a non-negative safe integer");
|
|
253
|
+
const ids = new Set();
|
|
254
|
+
for (const record of records) {
|
|
255
|
+
assertManagedAgentDescriptor(record.agent);
|
|
256
|
+
assertWorkspaceAgentPresentation(record.presentation);
|
|
257
|
+
if (ids.has(record.agent.id))
|
|
258
|
+
throw new TypeError(`duplicate workspace agent id: ${record.agent.id}`);
|
|
259
|
+
ids.add(record.agent.id);
|
|
260
|
+
}
|
|
261
|
+
if (selectedAgentId !== null && !ids.has(selectedAgentId))
|
|
262
|
+
throw new TypeError("selected workspace agent must exist in the replacement set");
|
|
263
|
+
this.#transaction(() => {
|
|
264
|
+
if (records.length === 0)
|
|
265
|
+
this.database.prepare("DELETE FROM workspace_agents").run();
|
|
266
|
+
else {
|
|
267
|
+
const placeholders = records.map(() => "?").join(", ");
|
|
268
|
+
this.database.prepare(`DELETE FROM workspace_agents WHERE id NOT IN (${placeholders})`).run(...records.map(record => record.agent.id));
|
|
269
|
+
}
|
|
270
|
+
for (const record of records)
|
|
271
|
+
this.#upsertWorkspaceAgentRecord(record, updatedAt);
|
|
272
|
+
this.database.prepare("UPDATE workspaces SET selected_agent_id = ?, revision = ? WHERE id = ?").run(selectedAgentId, revision, INITIAL_WORKSPACE_ID);
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
loadWorkspaceAgents() {
|
|
276
|
+
return this.loadWorkspaceAgentRecords().map(record => record.agent);
|
|
277
|
+
}
|
|
278
|
+
loadWorkspaceAgentRecord(agentId) {
|
|
279
|
+
const row = this.database.prepare("SELECT * FROM workspace_agents WHERE id = ?").get(agentId);
|
|
280
|
+
return row ? workspaceAgentFromRow(row) : null;
|
|
281
|
+
}
|
|
282
|
+
loadWorkspaceAgentRecords() {
|
|
283
|
+
const rows = this.database.prepare("SELECT * FROM workspace_agents ORDER BY created_at, id").all();
|
|
284
|
+
return rows.map(workspaceAgentFromRow);
|
|
285
|
+
}
|
|
286
|
+
loadSelectedWorkspaceAgentId() {
|
|
287
|
+
const row = this.database.prepare("SELECT selected_agent_id FROM workspaces WHERE id = ?").get(INITIAL_WORKSPACE_ID);
|
|
288
|
+
return row?.selected_agent_id ?? null;
|
|
289
|
+
}
|
|
290
|
+
loadWorkspaceRevision() {
|
|
291
|
+
const row = this.database.prepare("SELECT revision FROM workspaces WHERE id = ?").get(INITIAL_WORKSPACE_ID);
|
|
292
|
+
return row?.revision ?? 0;
|
|
293
|
+
}
|
|
294
|
+
#upsertWorkspaceAgentRecord(record, updatedAt) {
|
|
295
|
+
const agent = record.agent;
|
|
296
|
+
this.database.prepare(`INSERT INTO workspace_agents
|
|
297
|
+
(id, workspace_id, display_name, adapter_id, runtime_kind, lifecycle, capability_json, recovery_reference_id, unread_count, attention, failure_json, created_at, updated_at)
|
|
298
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
299
|
+
ON CONFLICT(id) DO UPDATE SET
|
|
300
|
+
workspace_id = excluded.workspace_id,
|
|
301
|
+
display_name = excluded.display_name,
|
|
302
|
+
adapter_id = excluded.adapter_id,
|
|
303
|
+
runtime_kind = excluded.runtime_kind,
|
|
304
|
+
lifecycle = excluded.lifecycle,
|
|
305
|
+
capability_json = excluded.capability_json,
|
|
306
|
+
recovery_reference_id = excluded.recovery_reference_id,
|
|
307
|
+
unread_count = excluded.unread_count,
|
|
308
|
+
attention = excluded.attention,
|
|
309
|
+
failure_json = excluded.failure_json,
|
|
310
|
+
updated_at = excluded.updated_at`)
|
|
311
|
+
.run(agent.id, INITIAL_WORKSPACE_ID, agent.displayName, agent.adapterId, agent.runtime, agent.lifecycle, JSON.stringify(agent.capability), agent.recoveryReferenceId, record.presentation.unreadActivity, record.presentation.attention ? 1 : 0, record.presentation.failure === null ? null : JSON.stringify(record.presentation.failure), agent.createdAt, updatedAt);
|
|
312
|
+
}
|
|
313
|
+
saveNativeHostTopology(topology, rollbackTopology, updatedAt = new Date().toISOString()) {
|
|
314
|
+
assertTerminalTopologySnapshot(topology);
|
|
315
|
+
if (rollbackTopology !== null)
|
|
316
|
+
assertTerminalTopologySnapshot(rollbackTopology);
|
|
317
|
+
if (rollbackTopology !== null && rollbackTopology.hostInstanceId !== topology.hostInstanceId) {
|
|
318
|
+
throw new TypeError("topology rollback metadata must identify the same native host");
|
|
319
|
+
}
|
|
320
|
+
const prior = this.loadNativeHostTopology(topology.hostInstanceId);
|
|
321
|
+
if (prior !== null && topology.revision < prior.topology.revision) {
|
|
322
|
+
throw new RangeError(`stale native-host topology revision ${topology.revision}; persisted revision is ${prior.topology.revision}`);
|
|
323
|
+
}
|
|
324
|
+
if (rollbackTopology !== null && rollbackTopology.revision > topology.revision) {
|
|
325
|
+
throw new RangeError("topology rollback revision cannot be newer than the persisted topology");
|
|
326
|
+
}
|
|
327
|
+
const rollbackJson = rollbackTopology === null
|
|
328
|
+
? JSON.stringify({ contractVersion: 1, reason: "initial native-host topology", topology: null })
|
|
329
|
+
: JSON.stringify({ contractVersion: 1, reason: "backward-readable prior authoritative topology", topology: rollbackTopology });
|
|
330
|
+
this.database.prepare(`INSERT INTO native_host_topology
|
|
331
|
+
(host_instance_id, protocol_version, revision, topology_json, rollback_json, updated_at)
|
|
332
|
+
VALUES (?, 1, ?, ?, ?, ?)
|
|
333
|
+
ON CONFLICT(host_instance_id) DO UPDATE SET
|
|
334
|
+
revision = excluded.revision,
|
|
335
|
+
topology_json = excluded.topology_json,
|
|
336
|
+
rollback_json = excluded.rollback_json,
|
|
337
|
+
updated_at = excluded.updated_at`)
|
|
338
|
+
.run(topology.hostInstanceId, topology.revision, JSON.stringify(topology), rollbackJson, updatedAt);
|
|
339
|
+
}
|
|
340
|
+
loadNativeHostTopology(hostInstanceId) {
|
|
341
|
+
const row = this.database.prepare("SELECT * FROM native_host_topology WHERE host_instance_id = ?").get(hostInstanceId);
|
|
342
|
+
if (!row)
|
|
343
|
+
return null;
|
|
344
|
+
const topology = JSON.parse(row.topology_json);
|
|
345
|
+
assertTerminalTopologySnapshot(topology);
|
|
346
|
+
return { topology, rollback: JSON.parse(row.rollback_json), updatedAt: row.updated_at };
|
|
347
|
+
}
|
|
348
|
+
persistTerminalSession(session, hostInstanceId, paneId, lifecycle, recoveryReferenceId, updatedAt = new Date().toISOString()) {
|
|
349
|
+
assertTerminalSessionLaunch(session);
|
|
350
|
+
this.database.prepare(`INSERT INTO terminal_sessions
|
|
351
|
+
(id, host_instance_id, pane_id, lifecycle, launch_json, recovery_reference_id, updated_at)
|
|
352
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
353
|
+
ON CONFLICT(id) DO UPDATE SET
|
|
354
|
+
host_instance_id = excluded.host_instance_id,
|
|
355
|
+
pane_id = excluded.pane_id,
|
|
356
|
+
lifecycle = excluded.lifecycle,
|
|
357
|
+
launch_json = excluded.launch_json,
|
|
358
|
+
recovery_reference_id = excluded.recovery_reference_id,
|
|
359
|
+
updated_at = excluded.updated_at`)
|
|
360
|
+
.run(session.id, hostInstanceId, paneId, lifecycle, JSON.stringify(session), recoveryReferenceId, updatedAt);
|
|
361
|
+
}
|
|
362
|
+
loadTerminalSessions() {
|
|
363
|
+
const rows = this.database.prepare("SELECT * FROM terminal_sessions ORDER BY id").all();
|
|
364
|
+
return rows.map(row => {
|
|
365
|
+
const session = JSON.parse(row.launch_json);
|
|
366
|
+
assertTerminalSessionLaunch(session);
|
|
367
|
+
return { session, hostInstanceId: row.host_instance_id, paneId: row.pane_id, lifecycle: row.lifecycle, recoveryReferenceId: row.recovery_reference_id };
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
persistRecoveryReference(authority, status, rollbackMetadata, updatedAt = new Date().toISOString()) {
|
|
371
|
+
assertRecoveryAuthority(authority);
|
|
372
|
+
const createdAt = typeof rollbackMetadata.createdAt === "string" ? rollbackMetadata.createdAt : updatedAt;
|
|
373
|
+
const rollbackJson = JSON.stringify({ contractVersion: 1, ...rollbackMetadata });
|
|
374
|
+
this.database.prepare(`INSERT INTO recovery_references
|
|
375
|
+
(id, agent_id, authority_json, status, rollback_json, created_at, updated_at)
|
|
376
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
377
|
+
ON CONFLICT(id) DO UPDATE SET
|
|
378
|
+
agent_id = excluded.agent_id,
|
|
379
|
+
authority_json = excluded.authority_json,
|
|
380
|
+
status = excluded.status,
|
|
381
|
+
rollback_json = excluded.rollback_json,
|
|
382
|
+
updated_at = excluded.updated_at`)
|
|
383
|
+
.run(authority.referenceId, authority.agentId, JSON.stringify(authority), status, rollbackJson, createdAt, updatedAt);
|
|
384
|
+
}
|
|
385
|
+
loadRecoveryReference(id) {
|
|
386
|
+
const row = this.database.prepare("SELECT * FROM recovery_references WHERE id = ?").get(id);
|
|
387
|
+
if (!row)
|
|
388
|
+
return null;
|
|
389
|
+
const authority = JSON.parse(row.authority_json);
|
|
390
|
+
assertRecoveryAuthority(authority);
|
|
391
|
+
return { authority, status: row.status, rollback: JSON.parse(row.rollback_json), updatedAt: row.updated_at };
|
|
392
|
+
}
|
|
393
|
+
close() {
|
|
394
|
+
this.database.close();
|
|
395
|
+
}
|
|
396
|
+
#transaction(operation) {
|
|
397
|
+
this.database.exec("BEGIN IMMEDIATE");
|
|
398
|
+
try {
|
|
399
|
+
const result = operation();
|
|
400
|
+
this.database.exec("COMMIT");
|
|
401
|
+
return result;
|
|
402
|
+
}
|
|
403
|
+
catch (error) {
|
|
404
|
+
this.database.exec("ROLLBACK");
|
|
405
|
+
throw error;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
function workspaceAgentFromRow(row) {
|
|
410
|
+
const descriptor = {
|
|
411
|
+
id: row.id,
|
|
412
|
+
displayName: row.display_name,
|
|
413
|
+
adapterId: row.adapter_id,
|
|
414
|
+
runtime: row.runtime_kind,
|
|
415
|
+
lifecycle: row.lifecycle,
|
|
416
|
+
capability: JSON.parse(row.capability_json),
|
|
417
|
+
createdAt: row.created_at,
|
|
418
|
+
recoveryReferenceId: row.recovery_reference_id,
|
|
419
|
+
};
|
|
420
|
+
assertManagedAgentDescriptor(descriptor);
|
|
421
|
+
const failure = row.failure_json === null ? null : JSON.parse(row.failure_json);
|
|
422
|
+
const presentation = {
|
|
423
|
+
unreadActivity: row.unread_count,
|
|
424
|
+
attention: row.attention === 1,
|
|
425
|
+
failure,
|
|
426
|
+
};
|
|
427
|
+
assertWorkspaceAgentPresentation(presentation);
|
|
428
|
+
return { agent: descriptor, presentation };
|
|
429
|
+
}
|
|
430
|
+
function assertWorkspaceAgentPresentation(presentation) {
|
|
431
|
+
if (!Number.isSafeInteger(presentation.unreadActivity) || presentation.unreadActivity < 0) {
|
|
432
|
+
throw new RangeError("workspace unread activity must be a non-negative safe integer");
|
|
433
|
+
}
|
|
434
|
+
if (typeof presentation.attention !== "boolean")
|
|
435
|
+
throw new TypeError("workspace attention must be boolean");
|
|
436
|
+
if (presentation.failure !== null) {
|
|
437
|
+
if (!presentation.failure.code || presentation.failure.code.length > 128 || presentation.failure.code.includes("\0")) {
|
|
438
|
+
throw new TypeError("workspace failure code is invalid");
|
|
439
|
+
}
|
|
440
|
+
if (!presentation.failure.message || presentation.failure.message.length > 4_096 || presentation.failure.message.includes("\0")) {
|
|
441
|
+
throw new TypeError("workspace failure message is invalid");
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
function foregroundLeaseFromRow(row) {
|
|
446
|
+
return {
|
|
447
|
+
id: row.id,
|
|
448
|
+
ownerId: row.owner_id,
|
|
449
|
+
profile: JSON.parse(row.profile_json),
|
|
450
|
+
state: row.state,
|
|
451
|
+
generationId: row.generation_id,
|
|
452
|
+
processIdentity: row.process_identity_json ? JSON.parse(row.process_identity_json) : null,
|
|
453
|
+
acquiredAt: row.acquired_at,
|
|
454
|
+
heartbeatAt: row.heartbeat_at,
|
|
455
|
+
releasedAt: row.released_at,
|
|
456
|
+
outcome: row.outcome_json ? JSON.parse(row.outcome_json) : null,
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
//# sourceMappingURL=control-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-store.js","sourceRoot":"","sources":["../../../../src/foundation/storage/control-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,EACvB,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,iCAAiC,CAAC;AASzC,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AACxD,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAmBlD,MAAM,OAAO,YAAY;IAGY;IAF1B,QAAQ,CAAe;IAEhC,YAAY,IAAY,EAAW,YAA2B,IAAI;QAA/B,cAAS,GAAT,SAAS,CAAsB;QAChE,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;QAChD,IAAI,CAAC,QAA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AI,SAAS,CAAC,sCAAsC,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,GAAuB;IACrD,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,OAAO,EAAE,GAAG,CAAC,QAAQ;QACrB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAuC;QAC3E,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,YAAY,EAAE,GAAG,CAAC,aAAa;QAC/B,eAAe,EAAE,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,qBAAqB,CAA0B,CAAC,CAAC,CAAC,IAAI;QAClH,UAAU,EAAE,GAAG,CAAC,WAAW;QAC3B,WAAW,EAAE,GAAG,CAAC,YAAY;QAC7B,UAAU,EAAE,GAAG,CAAC,WAAW;QAC3B,OAAO,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAwC,CAAC,CAAC,CAAC,IAAI;KACvG,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/foundation/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/foundation/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type StructuredCapabilityContract } from "../workspace-contracts/index.js";
|
|
2
|
+
export type StructuredBackpressureResource = "events" | "commands" | "snapshots" | "attachments" | "reconnect-replay";
|
|
3
|
+
export type StructuredBackpressureAction = "none" | "reject-payload" | "pause-adapter" | "reject-request" | "disconnect-adapter";
|
|
4
|
+
export interface StructuredResourceLease {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly resource: StructuredBackpressureResource;
|
|
7
|
+
readonly units: number;
|
|
8
|
+
readonly bytes: number;
|
|
9
|
+
}
|
|
10
|
+
export interface StructuredResourceUsage {
|
|
11
|
+
readonly resource: StructuredBackpressureResource;
|
|
12
|
+
readonly units: number;
|
|
13
|
+
readonly bytes: number;
|
|
14
|
+
readonly unitLimit: number;
|
|
15
|
+
readonly byteLimit: number;
|
|
16
|
+
}
|
|
17
|
+
export type StructuredBackpressureAcquireResult = {
|
|
18
|
+
readonly kind: "accepted";
|
|
19
|
+
readonly lease: StructuredResourceLease;
|
|
20
|
+
readonly usage: StructuredResourceUsage;
|
|
21
|
+
} | {
|
|
22
|
+
readonly kind: "rejected";
|
|
23
|
+
readonly code: "invalid-request" | "payload-too-large" | "resource-exhausted" | "replay-exhausted";
|
|
24
|
+
readonly action: Exclude<StructuredBackpressureAction, "none">;
|
|
25
|
+
readonly usage: StructuredResourceUsage;
|
|
26
|
+
readonly diagnostic: string;
|
|
27
|
+
};
|
|
28
|
+
export type StructuredBackpressureReleaseResult = {
|
|
29
|
+
readonly kind: "released";
|
|
30
|
+
readonly usage: StructuredResourceUsage;
|
|
31
|
+
} | {
|
|
32
|
+
readonly kind: "rejected";
|
|
33
|
+
readonly code: "unknown-lease" | "invalid-request";
|
|
34
|
+
readonly diagnostic: string;
|
|
35
|
+
};
|
|
36
|
+
export declare class StructuredBackpressureController {
|
|
37
|
+
#private;
|
|
38
|
+
readonly adapterId: string;
|
|
39
|
+
constructor(adapterId: string, capability: StructuredCapabilityContract);
|
|
40
|
+
acquire(resource: StructuredBackpressureResource, units?: number, bytes?: number): StructuredBackpressureAcquireResult;
|
|
41
|
+
release(lease: StructuredResourceLease): StructuredBackpressureReleaseResult;
|
|
42
|
+
resetReconnectReplay(): void;
|
|
43
|
+
usage(resource: StructuredBackpressureResource): StructuredResourceUsage;
|
|
44
|
+
leaseCount(): number;
|
|
45
|
+
replayExhausted(): boolean;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=backpressure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backpressure.d.ts","sourceRoot":"","sources":["../../../../src/foundation/structured-agent-runtime/backpressure.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,iCAAiC,CAAC;AAEzC,MAAM,MAAM,8BAA8B,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,kBAAkB,CAAC;AACtH,MAAM,MAAM,4BAA4B,GAAG,MAAM,GAAG,gBAAgB,GAAG,eAAe,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAEjI,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,8BAA8B,CAAC;IAClD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,QAAQ,EAAE,8BAA8B,CAAC;IAClD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,MAAM,mCAAmC,GAC3C;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,uBAAuB,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,uBAAuB,CAAA;CAAE,GAC/G;IACA,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,GAAG,mBAAmB,GAAG,oBAAoB,GAAG,kBAAkB,CAAC;IACnG,Q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