@timurproko/a1 0.1.0 → 0.1.1-dev.10
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 +10 -43
- package/bin/{addone.js → cli.js} +2 -2
- package/bin/guardian.js +22 -0
- package/bin/ui.js +20 -0
- package/dist/native/darwin-arm64/manifest.json +20 -0
- package/dist/native/darwin-arm64/process-guardian +0 -0
- package/dist/native/linux-x64/manifest.json +20 -0
- package/dist/native/linux-x64/process-guardian +0 -0
- package/dist/native/win32-x64/manifest.json +20 -0
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/src/cli/dispatch.d.ts +4 -5
- package/dist/src/cli/dispatch.js +11 -11
- package/dist/src/cli/index.d.ts +0 -1
- package/dist/src/cli/index.js +0 -1
- package/dist/src/cli/version-stats.d.ts +0 -1
- package/dist/src/cli/version-stats.js +27 -23
- package/dist/src/cli/version.d.ts +1 -2
- package/dist/src/cli/version.js +4 -4
- package/dist/src/composition/index.d.ts +48 -0
- package/dist/src/composition/index.js +258 -0
- package/dist/src/features/launch/development-launch.d.ts +0 -1
- package/dist/src/features/launch/development-launch.js +12 -11
- package/dist/src/features/launch/index.d.ts +0 -1
- package/dist/src/features/launch/index.js +0 -1
- package/dist/src/features/launch/initialize-profile.d.ts +1 -2
- package/dist/src/features/launch/initialize-profile.js +24 -4
- package/dist/src/features/launch/intent.d.ts +0 -1
- package/dist/src/features/launch/intent.js +0 -1
- package/dist/src/features/launch/prepare-launch.d.ts +2 -3
- package/dist/src/features/launch/prepare-launch.js +3 -4
- package/dist/src/features/launch/profile-paths.d.ts +2 -3
- package/dist/src/features/launch/profile-paths.js +9 -8
- package/dist/src/features/launch/profiles.d.ts +3 -4
- package/dist/src/features/launch/profiles.js +7 -8
- package/dist/src/features/launch/runtime-selection.d.ts +13 -9
- package/dist/src/features/launch/runtime-selection.js +6 -7
- package/dist/src/features/owned-ui/customization.d.ts +5 -3
- package/dist/src/features/owned-ui/customization.js +2 -4
- package/dist/src/features/owned-ui/diagnostics.d.ts +0 -1
- package/dist/src/features/owned-ui/diagnostics.js +0 -1
- package/dist/src/features/owned-ui/index.d.ts +1 -2
- package/dist/src/features/owned-ui/index.js +1 -2
- package/dist/src/features/owned-ui/run.d.ts +9 -7
- package/dist/src/features/owned-ui/run.js +9 -15
- package/dist/src/features/owned-ui/settings-app.d.ts +22 -0
- package/dist/src/features/owned-ui/settings-app.js +633 -0
- package/dist/src/features/workspace/capabilities.d.ts +0 -1
- package/dist/src/features/workspace/capabilities.js +0 -1
- package/dist/src/features/workspace/index.d.ts +0 -1
- package/dist/src/features/workspace/index.js +0 -1
- package/dist/src/features/workspace/presentation.d.ts +1 -2
- package/dist/src/features/workspace/presentation.js +5 -4
- package/dist/src/features/workspace/reconciliation.d.ts +0 -1
- package/dist/src/features/workspace/reconciliation.js +0 -1
- package/dist/src/features/workspace/reducer.d.ts +0 -1
- package/dist/src/features/workspace/reducer.js +0 -1
- package/dist/src/features/workspace/router.d.ts +0 -1
- package/dist/src/features/workspace/router.js +0 -1
- package/dist/src/features/workspace/store.d.ts +0 -1
- package/dist/src/features/workspace/store.js +0 -1
- package/dist/src/foundation/agent-engine-contracts/capability-ports.d.ts +95 -0
- package/dist/src/foundation/agent-engine-contracts/capability-ports.js +35 -0
- package/dist/src/foundation/agent-engine-contracts/domain-validation.d.ts +12 -0
- package/dist/src/foundation/agent-engine-contracts/domain-validation.js +89 -0
- package/dist/src/foundation/agent-engine-contracts/domain.d.ts +116 -0
- package/dist/src/foundation/agent-engine-contracts/domain.js +1 -0
- package/dist/src/foundation/agent-engine-contracts/index.d.ts +7 -0
- package/dist/src/foundation/agent-engine-contracts/index.js +7 -0
- package/dist/src/foundation/agent-engine-contracts/model.d.ts +78 -0
- package/dist/src/foundation/agent-engine-contracts/model.js +1 -0
- package/dist/src/foundation/agent-engine-contracts/ports.d.ts +18 -0
- package/dist/src/foundation/agent-engine-contracts/ports.js +1 -0
- package/dist/src/foundation/agent-engine-contracts/serialization.d.ts +7 -0
- package/dist/src/foundation/agent-engine-contracts/serialization.js +58 -0
- package/dist/src/foundation/agent-engine-contracts/validation.d.ts +5 -0
- package/dist/src/foundation/agent-engine-contracts/validation.js +128 -0
- package/dist/src/foundation/launch-guardian/index.d.ts +1 -0
- package/dist/src/foundation/launch-guardian/index.js +1 -0
- package/dist/src/foundation/launch-guardian/main.d.ts +31 -0
- package/dist/src/foundation/launch-guardian/main.js +165 -0
- package/dist/src/foundation/lifecycle/commands.d.ts +40 -0
- package/dist/src/foundation/lifecycle/commands.js +1 -0
- package/dist/src/foundation/lifecycle/index.d.ts +2 -1
- package/dist/src/foundation/lifecycle/index.js +2 -1
- package/dist/src/foundation/lifecycle/launch-instance.d.ts +46 -0
- package/dist/src/foundation/lifecycle/launch-instance.js +134 -0
- package/dist/src/foundation/lifecycle/model.d.ts +7 -44
- package/dist/src/foundation/lifecycle/model.js +3 -3
- package/dist/src/foundation/lifecycle/paths.d.ts +2 -3
- package/dist/src/foundation/lifecycle/paths.js +32 -16
- package/dist/src/foundation/native-host-protocol/codec.d.ts +0 -1
- package/dist/src/foundation/native-host-protocol/codec.js +0 -1
- package/dist/src/foundation/native-host-protocol/evidence.d.ts +2 -3
- package/dist/src/foundation/native-host-protocol/evidence.js +4 -4
- package/dist/src/foundation/native-host-protocol/index.d.ts +0 -1
- package/dist/src/foundation/native-host-protocol/index.js +0 -1
- package/dist/src/foundation/native-host-protocol/messages.d.ts +1 -2
- package/dist/src/foundation/native-host-protocol/messages.js +2 -2
- package/dist/src/foundation/native-host-protocol/proof-gate.d.ts +0 -1
- package/dist/src/foundation/native-host-protocol/proof-gate.js +0 -1
- package/dist/src/foundation/owned-ui-contracts/extension-ui.d.ts +0 -1
- package/dist/src/foundation/owned-ui-contracts/extension-ui.js +0 -1
- package/dist/src/foundation/owned-ui-contracts/index.d.ts +0 -1
- package/dist/src/foundation/owned-ui-contracts/index.js +0 -1
- package/dist/src/foundation/owned-ui-contracts/model.d.ts +0 -1
- package/dist/src/foundation/owned-ui-contracts/model.js +0 -1
- package/dist/src/foundation/owned-ui-contracts/validation.d.ts +0 -1
- package/dist/src/foundation/owned-ui-contracts/validation.js +0 -1
- package/dist/src/foundation/owned-ui-settings/declarations.d.ts +13 -0
- package/dist/src/foundation/owned-ui-settings/declarations.js +39 -0
- package/dist/src/foundation/owned-ui-settings/index.d.ts +6 -0
- package/dist/src/foundation/owned-ui-settings/index.js +6 -0
- package/dist/src/foundation/owned-ui-settings/migrations.d.ts +13 -0
- package/dist/src/foundation/owned-ui-settings/migrations.js +28 -0
- package/dist/src/foundation/owned-ui-settings/resolution.d.ts +45 -0
- package/dist/src/foundation/owned-ui-settings/resolution.js +147 -0
- package/dist/src/foundation/owned-ui-settings/sections.d.ts +70 -0
- package/dist/src/foundation/owned-ui-settings/sections.js +93 -0
- package/dist/src/foundation/owned-ui-settings/session.d.ts +44 -0
- package/dist/src/foundation/owned-ui-settings/session.js +145 -0
- package/dist/src/foundation/owned-ui-settings/store.d.ts +28 -0
- package/dist/src/foundation/owned-ui-settings/store.js +90 -0
- package/dist/src/foundation/pi-component-adapter/components.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/components.js +0 -1
- package/dist/src/foundation/pi-component-adapter/conformance.d.ts +1 -1
- package/dist/src/foundation/pi-component-adapter/conformance.js +10 -4
- package/dist/src/foundation/pi-component-adapter/index.d.ts +1 -1
- package/dist/src/foundation/pi-component-adapter/index.js +1 -1
- package/dist/src/foundation/pi-component-adapter/resources/builtin-themes.d.ts +165 -0
- package/dist/src/foundation/pi-component-adapter/resources/builtin-themes.js +166 -0
- package/dist/src/foundation/pi-component-adapter/shell-components.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-components.js +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.js +10 -13
- package/dist/src/foundation/pi-component-adapter/shell-extension-ui.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-extension-ui.js +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-footer-status.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-footer-status.js +5 -62
- package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.js +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.d.ts +9 -2
- package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.js +10 -9
- package/dist/src/foundation/pi-component-adapter/shell-shared-facade.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-shared-facade.js +0 -1
- package/dist/src/foundation/pi-component-adapter/theme.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/theme.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/countdown-timer.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/countdown-timer.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/daxnuts.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/daxnuts.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.js +3 -27
- package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/markdown-transform.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/markdown-transform.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/mermaid.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/mermaid.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/owned-editor.d.ts +18 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/owned-editor.js +55 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-footer.d.ts +10 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-footer.js +120 -0
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector-search.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector-search.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.d.ts +1 -2
- package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.js +1 -2
- package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/external-editor.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/external-editor.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/model-search.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/model-search.js +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme-controller.d.ts +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme-controller.js +1 -2
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.d.ts +8 -1
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.js +30 -15
- package/dist/src/foundation/pi-engine-adapter/adapter.d.ts +19 -205
- package/dist/src/foundation/pi-engine-adapter/adapter.js +156 -181
- package/dist/src/foundation/pi-engine-adapter/conformance.d.ts +24 -1
- package/dist/src/foundation/pi-engine-adapter/conformance.js +60 -15
- package/dist/src/foundation/pi-engine-adapter/index.d.ts +6 -1
- package/dist/src/foundation/pi-engine-adapter/index.js +6 -1
- package/dist/src/foundation/pi-engine-adapter/model-auth-integration.d.ts +30 -0
- package/dist/src/foundation/pi-engine-adapter/model-auth-integration.js +61 -0
- package/dist/src/foundation/pi-engine-adapter/pi-settings-metadata.json +374 -0
- package/dist/src/foundation/pi-engine-adapter/public-main-entry.d.ts +5 -0
- package/dist/src/foundation/pi-engine-adapter/public-main-entry.js +27 -0
- package/dist/src/foundation/pi-engine-adapter/resource-extension-integration.d.ts +31 -0
- package/dist/src/foundation/pi-engine-adapter/resource-extension-integration.js +80 -0
- package/dist/src/foundation/pi-engine-adapter/runtime-integration.d.ts +18 -0
- package/dist/src/foundation/pi-engine-adapter/runtime-integration.js +32 -0
- package/dist/src/foundation/pi-engine-adapter/session-integration.d.ts +43 -0
- package/dist/src/foundation/pi-engine-adapter/session-integration.js +97 -0
- package/dist/src/foundation/pi-engine-adapter/settings-integration.d.ts +55 -0
- package/dist/src/foundation/pi-engine-adapter/settings-integration.js +233 -0
- package/dist/src/foundation/pi-engine-adapter/workflow-controllers.d.ts +20 -0
- package/dist/src/foundation/pi-engine-adapter/workflow-controllers.js +48 -0
- package/dist/src/foundation/pi-engine-adapter/workflows.d.ts +9 -1
- package/dist/src/foundation/pi-engine-adapter/workflows.js +0 -1
- package/dist/src/foundation/pi-owned-ui-integration/index.d.ts +2 -0
- package/dist/src/foundation/pi-owned-ui-integration/index.js +2 -0
- package/dist/src/foundation/pi-owned-ui-integration/route-host.d.ts +29 -0
- package/dist/src/foundation/pi-owned-ui-integration/route-host.js +1 -0
- package/dist/src/{features/owned-ui/pi-session-shell.d.ts → foundation/pi-owned-ui-integration/session-shell.d.ts} +23 -14
- package/dist/src/{features/owned-ui/pi-session-shell.js → foundation/pi-owned-ui-integration/session-shell.js} +130 -61
- package/dist/src/foundation/pi-tui-runtime-adapter/adapter.d.ts +6 -1
- package/dist/src/foundation/pi-tui-runtime-adapter/adapter.js +9 -1
- package/dist/src/foundation/pi-tui-runtime-adapter/conformance.d.ts +8 -4
- package/dist/src/foundation/pi-tui-runtime-adapter/conformance.js +22 -9
- package/dist/src/foundation/pi-tui-runtime-adapter/contracts.d.ts +0 -2
- package/dist/src/foundation/pi-tui-runtime-adapter/contracts.js +1 -2
- package/dist/src/foundation/pi-tui-runtime-adapter/index.d.ts +1 -1
- package/dist/src/foundation/pi-tui-runtime-adapter/index.js +1 -1
- package/dist/src/foundation/pi-tui-runtime-adapter/presentation-adapter.d.ts +4 -0
- package/dist/src/foundation/pi-tui-runtime-adapter/presentation-adapter.js +48 -0
- package/dist/src/foundation/presentation-contracts/index.d.ts +96 -0
- package/dist/src/foundation/presentation-contracts/index.js +38 -0
- package/dist/src/foundation/process-containment/artifact.d.ts +1 -0
- package/dist/src/foundation/process-containment/artifact.js +34 -0
- package/dist/src/foundation/process-containment/contracts.d.ts +31 -0
- package/dist/src/foundation/process-containment/contracts.js +35 -0
- package/dist/src/foundation/process-containment/index.d.ts +5 -0
- package/dist/src/foundation/process-containment/index.js +5 -0
- package/dist/src/foundation/process-containment/linux-process-inspector.d.ts +6 -0
- package/dist/src/foundation/process-containment/linux-process-inspector.js +26 -0
- package/dist/src/foundation/process-containment/native-guardian-containment.d.ts +16 -0
- package/dist/src/foundation/process-containment/native-guardian-containment.js +139 -0
- package/dist/src/foundation/process-containment/windows-process-inspector.d.ts +17 -0
- package/dist/src/foundation/process-containment/windows-process-inspector.js +53 -0
- package/dist/src/foundation/protocol/client.d.ts +2 -2
- package/dist/src/foundation/protocol/client.js +3 -1
- package/dist/src/foundation/protocol/index.d.ts +0 -1
- package/dist/src/foundation/protocol/index.js +0 -1
- package/dist/src/foundation/protocol/messages.d.ts +6 -7
- package/dist/src/foundation/protocol/messages.js +3 -3
- package/dist/src/foundation/release/bootstrap.d.ts +2 -3
- package/dist/src/foundation/release/bootstrap.js +85 -33
- package/dist/src/foundation/release/cohort-selection.d.ts +0 -1
- package/dist/src/foundation/release/cohort-selection.js +3 -4
- package/dist/src/foundation/release/cohort-state.d.ts +6 -4
- package/dist/src/foundation/release/cohort-state.js +5 -4
- package/dist/src/foundation/release/concurrency.d.ts +1 -0
- package/dist/src/foundation/release/concurrency.js +17 -0
- package/dist/src/foundation/release/development-preview-release.d.ts +2 -2
- package/dist/src/foundation/release/development-preview-release.js +3 -2
- package/dist/src/foundation/release/index.d.ts +0 -1
- package/dist/src/foundation/release/index.js +0 -1
- package/dist/src/foundation/release/process-cleanup.d.ts +1 -2
- package/dist/src/foundation/release/process-cleanup.js +2 -3
- package/dist/src/foundation/release/release-gc.d.ts +0 -1
- package/dist/src/foundation/release/release-gc.js +0 -1
- package/dist/src/foundation/release/release-store.d.ts +38 -6
- package/dist/src/foundation/release/release-store.js +103 -43
- package/dist/src/foundation/release/release.d.ts +20 -6
- package/dist/src/foundation/release/release.js +77 -48
- package/dist/src/foundation/release/stable-release.d.ts +2 -2
- package/dist/src/foundation/release/stable-release.js +6 -5
- package/dist/src/foundation/release/update-transaction.d.ts +2 -2
- package/dist/src/foundation/release/update-transaction.js +8 -7
- package/dist/src/foundation/release/update.d.ts +20 -4
- package/dist/src/foundation/release/update.js +152 -36
- package/dist/src/foundation/storage/control-store.d.ts +8 -8
- package/dist/src/foundation/storage/control-store.js +132 -61
- package/dist/src/foundation/storage/index.d.ts +0 -1
- package/dist/src/foundation/storage/index.js +0 -1
- package/dist/src/foundation/structured-agent-runtime/backpressure.d.ts +0 -1
- package/dist/src/foundation/structured-agent-runtime/backpressure.js +0 -1
- package/dist/src/foundation/structured-agent-runtime/commands.d.ts +0 -1
- package/dist/src/foundation/structured-agent-runtime/commands.js +0 -1
- package/dist/src/foundation/structured-agent-runtime/handshake.d.ts +2 -3
- package/dist/src/foundation/structured-agent-runtime/handshake.js +13 -13
- package/dist/src/foundation/structured-agent-runtime/index.d.ts +0 -1
- package/dist/src/foundation/structured-agent-runtime/index.js +0 -1
- package/dist/src/foundation/structured-agent-runtime/reconnection.d.ts +0 -1
- package/dist/src/foundation/structured-agent-runtime/reconnection.js +0 -1
- package/dist/src/foundation/structured-agent-runtime/state.d.ts +0 -1
- package/dist/src/foundation/structured-agent-runtime/state.js +0 -1
- package/dist/src/foundation/supervision/index.d.ts +1 -2
- package/dist/src/foundation/supervision/index.js +1 -2
- package/dist/src/foundation/supervision/main.d.ts +0 -1
- package/dist/src/foundation/supervision/main.js +11 -10
- package/dist/src/foundation/supervision/paths.d.ts +1 -2
- package/dist/src/foundation/supervision/paths.js +1 -2
- package/dist/src/foundation/supervision/server.d.ts +6 -5
- package/dist/src/foundation/supervision/server.js +259 -91
- package/dist/src/foundation/ui-apps/contracts.d.ts +42 -0
- package/dist/src/foundation/ui-apps/contracts.js +12 -0
- package/dist/src/foundation/ui-apps/host.d.ts +42 -0
- package/dist/src/foundation/ui-apps/host.js +152 -0
- package/dist/src/foundation/ui-apps/index.d.ts +3 -0
- package/dist/src/foundation/ui-apps/index.js +3 -0
- package/dist/src/foundation/ui-apps/registry.d.ts +11 -0
- package/dist/src/foundation/ui-apps/registry.js +32 -0
- package/dist/src/foundation/ui-components/dialog-panel.d.ts +36 -0
- package/dist/src/foundation/ui-components/dialog-panel.js +47 -0
- package/dist/src/foundation/ui-components/frame.d.ts +21 -0
- package/dist/src/foundation/ui-components/frame.js +54 -0
- package/dist/src/foundation/ui-components/index.d.ts +18 -0
- package/dist/src/foundation/ui-components/index.js +18 -0
- package/dist/src/foundation/ui-components/label.d.ts +8 -0
- package/dist/src/foundation/ui-components/label.js +36 -0
- package/dist/src/foundation/ui-components/line-input.d.ts +74 -0
- package/dist/src/foundation/ui-components/line-input.js +245 -0
- package/dist/src/foundation/ui-components/list-block.d.ts +66 -0
- package/dist/src/foundation/ui-components/list-block.js +176 -0
- package/dist/src/foundation/ui-components/list-view.d.ts +66 -0
- package/dist/src/foundation/ui-components/list-view.js +76 -0
- package/dist/src/foundation/ui-components/mouse.d.ts +15 -0
- package/dist/src/foundation/ui-components/mouse.js +46 -0
- package/dist/src/foundation/ui-components/pane.d.ts +33 -0
- package/dist/src/foundation/ui-components/pane.js +7 -0
- package/dist/src/foundation/ui-components/revision.d.ts +35 -0
- package/dist/src/foundation/ui-components/revision.js +79 -0
- package/dist/src/foundation/ui-components/scrollbar.d.ts +62 -0
- package/dist/src/foundation/ui-components/scrollbar.js +102 -0
- package/dist/src/foundation/ui-components/shortcuts.d.ts +57 -0
- package/dist/src/foundation/ui-components/shortcuts.js +81 -0
- package/dist/src/foundation/ui-components/spans.d.ts +7 -0
- package/dist/src/foundation/ui-components/spans.js +59 -0
- package/dist/src/foundation/ui-components/status-line.d.ts +16 -0
- package/dist/src/foundation/ui-components/status-line.js +14 -0
- package/dist/src/foundation/ui-components/stepper.d.ts +24 -0
- package/dist/src/foundation/ui-components/stepper.js +33 -0
- package/dist/src/foundation/ui-components/surface.d.ts +20 -0
- package/dist/src/foundation/ui-components/surface.js +38 -0
- package/dist/src/foundation/ui-components/text.d.ts +24 -0
- package/dist/src/foundation/ui-components/text.js +123 -0
- package/dist/src/foundation/ui-components/theme.d.ts +23 -0
- package/dist/src/foundation/ui-components/theme.js +13 -0
- package/dist/src/foundation/ui-components/value-menu.d.ts +41 -0
- package/dist/src/foundation/ui-components/value-menu.js +33 -0
- package/dist/src/foundation/workspace-contracts/index.d.ts +0 -1
- package/dist/src/foundation/workspace-contracts/index.js +0 -1
- package/dist/src/foundation/workspace-contracts/model.d.ts +0 -1
- package/dist/src/foundation/workspace-contracts/model.js +0 -1
- package/dist/src/foundation/workspace-contracts/validation.d.ts +0 -1
- package/dist/src/foundation/workspace-contracts/validation.js +0 -1
- package/dist/src/product-identity.d.ts +37 -0
- package/dist/src/product-identity.js +150 -0
- package/dist/src/product-identity.json +99 -0
- package/docs/architecture/boundaries.md +32 -14
- package/docs/architecture/process-guardian-provenance.md +26 -0
- package/docs/architecture/project-structure.md +2 -2
- package/docs/architecture/resource-and-data-policy.md +1 -1
- package/docs/architecture/terminal-host-proof-gate.md +2 -2
- package/docs/architecture/terminal-host-provenance.md +3 -3
- package/docs/architecture/terminal-host-spike-evidence.md +1 -1
- package/docs/architecture/toolchain.md +40 -8
- package/docs/architecture/ui-reference-provenance.md +50 -0
- package/docs/ci-release-runbook.md +67 -0
- package/docs/features/launch-profiles.md +12 -6
- package/docs/manual-launch-instance-acceptance.md +66 -0
- package/docs/manual-pi-boundary-candidate.md +33 -0
- package/docs/manual-terminal-colour-check.md +55 -0
- package/docs/manual-transparent-checkpoint.md +11 -11
- package/package.json +27 -14
- package/bin/addone-ui.js +0 -20
- package/dist/src/cli/dispatch.d.ts.map +0 -1
- package/dist/src/cli/dispatch.js.map +0 -1
- package/dist/src/cli/index.d.ts.map +0 -1
- package/dist/src/cli/index.js.map +0 -1
- package/dist/src/cli/version-stats.d.ts.map +0 -1
- package/dist/src/cli/version-stats.js.map +0 -1
- package/dist/src/cli/version.d.ts.map +0 -1
- package/dist/src/cli/version.js.map +0 -1
- package/dist/src/features/launch/development-launch.d.ts.map +0 -1
- package/dist/src/features/launch/development-launch.js.map +0 -1
- package/dist/src/features/launch/index.d.ts.map +0 -1
- package/dist/src/features/launch/index.js.map +0 -1
- package/dist/src/features/launch/initialize-profile.d.ts.map +0 -1
- package/dist/src/features/launch/initialize-profile.js.map +0 -1
- package/dist/src/features/launch/intent.d.ts.map +0 -1
- package/dist/src/features/launch/intent.js.map +0 -1
- package/dist/src/features/launch/prepare-launch.d.ts.map +0 -1
- package/dist/src/features/launch/prepare-launch.js.map +0 -1
- package/dist/src/features/launch/profile-paths.d.ts.map +0 -1
- package/dist/src/features/launch/profile-paths.js.map +0 -1
- package/dist/src/features/launch/profiles.d.ts.map +0 -1
- package/dist/src/features/launch/profiles.js.map +0 -1
- package/dist/src/features/launch/runtime-selection.d.ts.map +0 -1
- package/dist/src/features/launch/runtime-selection.js.map +0 -1
- package/dist/src/features/owned-ui/customization.d.ts.map +0 -1
- package/dist/src/features/owned-ui/customization.js.map +0 -1
- package/dist/src/features/owned-ui/diagnostics.d.ts.map +0 -1
- package/dist/src/features/owned-ui/diagnostics.js.map +0 -1
- package/dist/src/features/owned-ui/index.d.ts.map +0 -1
- package/dist/src/features/owned-ui/index.js.map +0 -1
- package/dist/src/features/owned-ui/pi-session-shell.d.ts.map +0 -1
- package/dist/src/features/owned-ui/pi-session-shell.js.map +0 -1
- package/dist/src/features/owned-ui/run.d.ts.map +0 -1
- package/dist/src/features/owned-ui/run.js.map +0 -1
- package/dist/src/features/workspace/capabilities.d.ts.map +0 -1
- package/dist/src/features/workspace/capabilities.js.map +0 -1
- package/dist/src/features/workspace/index.d.ts.map +0 -1
- package/dist/src/features/workspace/index.js.map +0 -1
- package/dist/src/features/workspace/presentation.d.ts.map +0 -1
- package/dist/src/features/workspace/presentation.js.map +0 -1
- package/dist/src/features/workspace/reconciliation.d.ts.map +0 -1
- package/dist/src/features/workspace/reconciliation.js.map +0 -1
- package/dist/src/features/workspace/reducer.d.ts.map +0 -1
- package/dist/src/features/workspace/reducer.js.map +0 -1
- package/dist/src/features/workspace/router.d.ts.map +0 -1
- package/dist/src/features/workspace/router.js.map +0 -1
- package/dist/src/features/workspace/store.d.ts.map +0 -1
- package/dist/src/features/workspace/store.js.map +0 -1
- package/dist/src/foundation/lifecycle/index.d.ts.map +0 -1
- package/dist/src/foundation/lifecycle/index.js.map +0 -1
- package/dist/src/foundation/lifecycle/model.d.ts.map +0 -1
- package/dist/src/foundation/lifecycle/model.js.map +0 -1
- package/dist/src/foundation/lifecycle/paths.d.ts.map +0 -1
- package/dist/src/foundation/lifecycle/paths.js.map +0 -1
- package/dist/src/foundation/native-host-protocol/codec.d.ts.map +0 -1
- package/dist/src/foundation/native-host-protocol/codec.js.map +0 -1
- package/dist/src/foundation/native-host-protocol/evidence.d.ts.map +0 -1
- package/dist/src/foundation/native-host-protocol/evidence.js.map +0 -1
- package/dist/src/foundation/native-host-protocol/index.d.ts.map +0 -1
- package/dist/src/foundation/native-host-protocol/index.js.map +0 -1
- package/dist/src/foundation/native-host-protocol/messages.d.ts.map +0 -1
- package/dist/src/foundation/native-host-protocol/messages.js.map +0 -1
- package/dist/src/foundation/native-host-protocol/proof-gate.d.ts.map +0 -1
- package/dist/src/foundation/native-host-protocol/proof-gate.js.map +0 -1
- package/dist/src/foundation/owned-ui-contracts/extension-ui.d.ts.map +0 -1
- package/dist/src/foundation/owned-ui-contracts/extension-ui.js.map +0 -1
- package/dist/src/foundation/owned-ui-contracts/index.d.ts.map +0 -1
- package/dist/src/foundation/owned-ui-contracts/index.js.map +0 -1
- package/dist/src/foundation/owned-ui-contracts/model.d.ts.map +0 -1
- package/dist/src/foundation/owned-ui-contracts/model.js.map +0 -1
- package/dist/src/foundation/owned-ui-contracts/validation.d.ts.map +0 -1
- package/dist/src/foundation/owned-ui-contracts/validation.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/components.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/components.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/conformance.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/conformance.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/index.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/index.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-components.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-components.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-extension-ui.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-extension-ui.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-footer-status.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-footer-status.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-shared-facade.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-shared-facade.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/theme.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/theme.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/adjacent/core/keybindings.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/countdown-timer.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/countdown-timer.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/custom-entry.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/daxnuts.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/daxnuts.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/extension-editor.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/first-time-setup.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/markdown-transform.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/markdown-transform.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/mermaid.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/mermaid.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/scoped-models-selector.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector-search.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector-search.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/session-selector.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/skill-invocation-message.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/status-indicator.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/tree-selector.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/components/trust-selector.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/external-editor.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/external-editor.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/model-search.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/model-search.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme-controller.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme-controller.js.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.d.ts.map +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.js.map +0 -1
- package/dist/src/foundation/pi-engine-adapter/adapter.d.ts.map +0 -1
- package/dist/src/foundation/pi-engine-adapter/adapter.js.map +0 -1
- package/dist/src/foundation/pi-engine-adapter/conformance.d.ts.map +0 -1
- package/dist/src/foundation/pi-engine-adapter/conformance.js.map +0 -1
- package/dist/src/foundation/pi-engine-adapter/index.d.ts.map +0 -1
- package/dist/src/foundation/pi-engine-adapter/index.js.map +0 -1
- package/dist/src/foundation/pi-engine-adapter/workflows.d.ts.map +0 -1
- package/dist/src/foundation/pi-engine-adapter/workflows.js.map +0 -1
- package/dist/src/foundation/pi-tui-runtime-adapter/adapter.d.ts.map +0 -1
- package/dist/src/foundation/pi-tui-runtime-adapter/adapter.js.map +0 -1
- package/dist/src/foundation/pi-tui-runtime-adapter/conformance.d.ts.map +0 -1
- package/dist/src/foundation/pi-tui-runtime-adapter/conformance.js.map +0 -1
- package/dist/src/foundation/pi-tui-runtime-adapter/contracts.d.ts.map +0 -1
- package/dist/src/foundation/pi-tui-runtime-adapter/contracts.js.map +0 -1
- package/dist/src/foundation/pi-tui-runtime-adapter/index.d.ts.map +0 -1
- package/dist/src/foundation/pi-tui-runtime-adapter/index.js.map +0 -1
- package/dist/src/foundation/protocol/client.d.ts.map +0 -1
- package/dist/src/foundation/protocol/client.js.map +0 -1
- package/dist/src/foundation/protocol/index.d.ts.map +0 -1
- package/dist/src/foundation/protocol/index.js.map +0 -1
- package/dist/src/foundation/protocol/messages.d.ts.map +0 -1
- package/dist/src/foundation/protocol/messages.js.map +0 -1
- package/dist/src/foundation/release/bootstrap.d.ts.map +0 -1
- package/dist/src/foundation/release/bootstrap.js.map +0 -1
- package/dist/src/foundation/release/cohort-selection.d.ts.map +0 -1
- package/dist/src/foundation/release/cohort-selection.js.map +0 -1
- package/dist/src/foundation/release/cohort-state.d.ts.map +0 -1
- package/dist/src/foundation/release/cohort-state.js.map +0 -1
- package/dist/src/foundation/release/development-preview-release.d.ts.map +0 -1
- package/dist/src/foundation/release/development-preview-release.js.map +0 -1
- package/dist/src/foundation/release/index.d.ts.map +0 -1
- package/dist/src/foundation/release/index.js.map +0 -1
- package/dist/src/foundation/release/process-cleanup.d.ts.map +0 -1
- package/dist/src/foundation/release/process-cleanup.js.map +0 -1
- package/dist/src/foundation/release/release-gc.d.ts.map +0 -1
- package/dist/src/foundation/release/release-gc.js.map +0 -1
- package/dist/src/foundation/release/release-store.d.ts.map +0 -1
- package/dist/src/foundation/release/release-store.js.map +0 -1
- package/dist/src/foundation/release/release.d.ts.map +0 -1
- package/dist/src/foundation/release/release.js.map +0 -1
- package/dist/src/foundation/release/stable-release.d.ts.map +0 -1
- package/dist/src/foundation/release/stable-release.js.map +0 -1
- package/dist/src/foundation/release/update-transaction.d.ts.map +0 -1
- package/dist/src/foundation/release/update-transaction.js.map +0 -1
- package/dist/src/foundation/release/update.d.ts.map +0 -1
- package/dist/src/foundation/release/update.js.map +0 -1
- package/dist/src/foundation/storage/control-store.d.ts.map +0 -1
- package/dist/src/foundation/storage/control-store.js.map +0 -1
- package/dist/src/foundation/storage/index.d.ts.map +0 -1
- package/dist/src/foundation/storage/index.js.map +0 -1
- package/dist/src/foundation/structured-agent-runtime/backpressure.d.ts.map +0 -1
- package/dist/src/foundation/structured-agent-runtime/backpressure.js.map +0 -1
- package/dist/src/foundation/structured-agent-runtime/commands.d.ts.map +0 -1
- package/dist/src/foundation/structured-agent-runtime/commands.js.map +0 -1
- package/dist/src/foundation/structured-agent-runtime/handshake.d.ts.map +0 -1
- package/dist/src/foundation/structured-agent-runtime/handshake.js.map +0 -1
- package/dist/src/foundation/structured-agent-runtime/index.d.ts.map +0 -1
- package/dist/src/foundation/structured-agent-runtime/index.js.map +0 -1
- package/dist/src/foundation/structured-agent-runtime/reconnection.d.ts.map +0 -1
- package/dist/src/foundation/structured-agent-runtime/reconnection.js.map +0 -1
- package/dist/src/foundation/structured-agent-runtime/state.d.ts.map +0 -1
- package/dist/src/foundation/structured-agent-runtime/state.js.map +0 -1
- package/dist/src/foundation/supervision/index.d.ts.map +0 -1
- package/dist/src/foundation/supervision/index.js.map +0 -1
- package/dist/src/foundation/supervision/main.d.ts.map +0 -1
- package/dist/src/foundation/supervision/main.js.map +0 -1
- package/dist/src/foundation/supervision/paths.d.ts.map +0 -1
- package/dist/src/foundation/supervision/paths.js.map +0 -1
- package/dist/src/foundation/supervision/server.d.ts.map +0 -1
- package/dist/src/foundation/supervision/server.js.map +0 -1
- package/dist/src/foundation/transparent-terminal/command-resolution.d.ts +0 -14
- package/dist/src/foundation/transparent-terminal/command-resolution.d.ts.map +0 -1
- package/dist/src/foundation/transparent-terminal/command-resolution.js +0 -70
- package/dist/src/foundation/transparent-terminal/command-resolution.js.map +0 -1
- package/dist/src/foundation/transparent-terminal/foreground-broker.d.ts +0 -33
- package/dist/src/foundation/transparent-terminal/foreground-broker.d.ts.map +0 -1
- package/dist/src/foundation/transparent-terminal/foreground-broker.js +0 -88
- package/dist/src/foundation/transparent-terminal/foreground-broker.js.map +0 -1
- package/dist/src/foundation/transparent-terminal/index.d.ts +0 -4
- package/dist/src/foundation/transparent-terminal/index.d.ts.map +0 -1
- package/dist/src/foundation/transparent-terminal/index.js +0 -4
- package/dist/src/foundation/transparent-terminal/index.js.map +0 -1
- package/dist/src/foundation/transparent-terminal/main.d.ts +0 -10
- package/dist/src/foundation/transparent-terminal/main.d.ts.map +0 -1
- package/dist/src/foundation/transparent-terminal/main.js +0 -107
- package/dist/src/foundation/transparent-terminal/main.js.map +0 -1
- package/dist/src/foundation/transparent-terminal/native-launcher.d.ts +0 -26
- package/dist/src/foundation/transparent-terminal/native-launcher.d.ts.map +0 -1
- package/dist/src/foundation/transparent-terminal/native-launcher.js +0 -147
- package/dist/src/foundation/transparent-terminal/native-launcher.js.map +0 -1
- package/dist/src/foundation/workspace-contracts/index.d.ts.map +0 -1
- package/dist/src/foundation/workspace-contracts/index.js.map +0 -1
- package/dist/src/foundation/workspace-contracts/model.d.ts.map +0 -1
- package/dist/src/foundation/workspace-contracts/model.js.map +0 -1
- package/dist/src/foundation/workspace-contracts/validation.d.ts.map +0 -1
- package/dist/src/foundation/workspace-contracts/validation.js.map +0 -1
- /package/bin/{addone-supervisor.js → supervisor.js} +0 -0
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
export interface PiTuiRuntimeConformanceOptions {
|
|
2
|
+
readonly packageVersion: string;
|
|
3
|
+
}
|
|
2
4
|
export interface PiTuiRuntimeConformanceReport {
|
|
3
5
|
readonly packageName: "@earendil-works/pi-tui";
|
|
4
|
-
readonly packageVersion:
|
|
6
|
+
readonly packageVersion: string;
|
|
5
7
|
readonly mode: "regular" | "fullscreen";
|
|
8
|
+
readonly constructedModes: readonly ("regular" | "fullscreen")[];
|
|
6
9
|
readonly lifecycleRestored: boolean;
|
|
7
10
|
readonly inputRouted: boolean;
|
|
8
11
|
readonly overlayRouted: boolean;
|
|
12
|
+
readonly focusRouted: boolean;
|
|
13
|
+
readonly widthBounded: boolean;
|
|
9
14
|
readonly differentialRendering: boolean;
|
|
10
15
|
readonly resizeRedraw: boolean;
|
|
11
16
|
readonly terminalNativeSelection: boolean;
|
|
12
17
|
}
|
|
13
|
-
export declare function runPiTuiRuntimeConformance(): Promise<PiTuiRuntimeConformanceReport>;
|
|
14
|
-
//# sourceMappingURL=conformance.d.ts.map
|
|
18
|
+
export declare function runPiTuiRuntimeConformance(options: PiTuiRuntimeConformanceOptions): Promise<PiTuiRuntimeConformanceReport>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { PI_TUI_PACKAGE_VERSION } from "./contracts.js";
|
|
2
1
|
import { PiTuiRuntimeAdapter, PiTuiRuntimeError } from "./adapter.js";
|
|
3
|
-
export async function runPiTuiRuntimeConformance() {
|
|
2
|
+
export async function runPiTuiRuntimeConformance(options) {
|
|
3
|
+
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(options.packageVersion)) {
|
|
4
|
+
throw new TypeError("Pi TUI conformance requires an exact package version from compatibility authority");
|
|
5
|
+
}
|
|
4
6
|
const terminal = new ConformanceTerminal();
|
|
5
7
|
const root = new ConformanceComponent(["stable row", "before"]);
|
|
6
8
|
const overlay = new ConformanceComponent(["overlay"]);
|
|
@@ -24,20 +26,26 @@ export async function runPiTuiRuntimeConformance() {
|
|
|
24
26
|
terminal.resize(60, 10);
|
|
25
27
|
runtime.renderNow();
|
|
26
28
|
const resizeRedraw = runtime.fullRedraws > redrawsBeforeResize && runtime.viewport().columns === 60;
|
|
29
|
+
const fullscreenConstructed = runtime.switchMode("fullscreen");
|
|
30
|
+
runtime.renderNow(true);
|
|
31
|
+
const regularRestored = runtime.switchMode("regular");
|
|
32
|
+
runtime.renderNow(true);
|
|
27
33
|
await runtime.stop({ drainMaxMs: 1, drainIdleMs: 1 });
|
|
28
34
|
const emitted = terminal.writes.join("");
|
|
29
35
|
return {
|
|
30
36
|
packageName: "@earendil-works/pi-tui",
|
|
31
|
-
packageVersion:
|
|
37
|
+
packageVersion: options.packageVersion,
|
|
32
38
|
mode: runtime.mode,
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
constructedModes: fullscreenConstructed && regularRestored ? ["regular", "fullscreen"] : ["regular"],
|
|
40
|
+
lifecycleRestored: terminal.startCount >= 1
|
|
41
|
+
&& terminal.startCount === terminal.stopCount
|
|
35
42
|
&& terminal.drainCount === 1
|
|
36
|
-
&&
|
|
37
|
-
&& !emitted.includes("\x1b[?1049l")
|
|
43
|
+
&& (emitted.match(/\x1b\[\?1049h/g)?.length ?? 0) === (emitted.match(/\x1b\[\?1049l/g)?.length ?? 0)
|
|
38
44
|
&& root.disposed,
|
|
39
45
|
inputRouted: root.inputs.includes("root-input"),
|
|
40
46
|
overlayRouted,
|
|
47
|
+
focusRouted: root.focusChanges.includes(true) && overlay.focusChanges.includes(true),
|
|
48
|
+
widthBounded: root.widths.every(width => width <= terminal.columns) && overlay.widths.every(width => width <= 12),
|
|
41
49
|
differentialRendering: differentialFrame.includes("after") && !differentialFrame.includes("stable row"),
|
|
42
50
|
resizeRedraw,
|
|
43
51
|
terminalNativeSelection: !emitted.includes("\x1b[?1000h") && !emitted.includes("\x1b[?1006h"),
|
|
@@ -54,13 +62,19 @@ export async function runPiTuiRuntimeConformance() {
|
|
|
54
62
|
class ConformanceComponent {
|
|
55
63
|
lines;
|
|
56
64
|
inputs = [];
|
|
65
|
+
focusChanges = [];
|
|
66
|
+
widths = [];
|
|
57
67
|
disposed = false;
|
|
58
68
|
constructor(lines) {
|
|
59
69
|
this.lines = lines;
|
|
60
70
|
}
|
|
61
|
-
render() {
|
|
71
|
+
render(width) {
|
|
72
|
+
this.widths.push(width);
|
|
62
73
|
return this.lines;
|
|
63
74
|
}
|
|
75
|
+
setFocused(focused) {
|
|
76
|
+
this.focusChanges.push(focused);
|
|
77
|
+
}
|
|
64
78
|
handleInput(data) {
|
|
65
79
|
this.inputs.push(data);
|
|
66
80
|
}
|
|
@@ -129,4 +143,3 @@ class ConformanceTerminal {
|
|
|
129
143
|
this.write(`progress:${active}`);
|
|
130
144
|
}
|
|
131
145
|
}
|
|
132
|
-
//# sourceMappingURL=conformance.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const PI_TUI_PACKAGE_VERSION: "0.84.2";
|
|
2
1
|
export type PiTuiRuntimeState = "idle" | "running" | "stopping" | "stopped" | "failed";
|
|
3
2
|
export interface PiTuiViewport {
|
|
4
3
|
readonly columns: number;
|
|
@@ -119,4 +118,3 @@ export interface PiTuiStopOptions {
|
|
|
119
118
|
readonly drainMaxMs?: number;
|
|
120
119
|
readonly drainIdleMs?: number;
|
|
121
120
|
}
|
|
122
|
-
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
//# sourceMappingURL=contracts.js.map
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PresentationComponentPort, PresentationRuntimePort, PresentationTerminalPort } from "../presentation-contracts/index.js";
|
|
2
|
+
import type { PiTuiTerminalPort } from "./contracts.js";
|
|
3
|
+
export declare function createPiPresentationRuntime(root: PresentationComponentPort, terminal: PresentationTerminalPort): PresentationRuntimePort;
|
|
4
|
+
export declare function createPiTerminalBridge(terminal: PresentationTerminalPort): PiTuiTerminalPort;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PiTuiRuntimeAdapter } from "./adapter.js";
|
|
2
|
+
export function createPiPresentationRuntime(root, terminal) {
|
|
3
|
+
return new PresentationRuntimeAdapter(root, terminal);
|
|
4
|
+
}
|
|
5
|
+
class PresentationRuntimeAdapter {
|
|
6
|
+
terminal;
|
|
7
|
+
#runtime;
|
|
8
|
+
constructor(root, terminal) {
|
|
9
|
+
this.terminal = terminal;
|
|
10
|
+
this.#runtime = new PiTuiRuntimeAdapter({ root, terminal: createPiTerminalBridge(terminal), mouse: false });
|
|
11
|
+
}
|
|
12
|
+
get state() { return this.#runtime.state; }
|
|
13
|
+
start() { this.#runtime.start(); }
|
|
14
|
+
render(force) { this.#runtime.renderNow(force); }
|
|
15
|
+
showOverlay(component, options) {
|
|
16
|
+
const handle = this.#runtime.showOverlay(component, {
|
|
17
|
+
anchor: options.anchor === "top" ? "top-center" : options.anchor === "bottom" ? "bottom-center" : "center",
|
|
18
|
+
...(options.width === undefined ? {} : { width: options.width }),
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
get visible() { return !handle.isHidden(); },
|
|
22
|
+
hide: () => handle.hide(),
|
|
23
|
+
show: () => handle.setHidden(false),
|
|
24
|
+
focus: () => handle.focus(),
|
|
25
|
+
dispose: () => handle.hide(),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
async stop() { await this.#runtime.stop(); }
|
|
29
|
+
}
|
|
30
|
+
export function createPiTerminalBridge(terminal) {
|
|
31
|
+
return {
|
|
32
|
+
get columns() { return terminal.columns; },
|
|
33
|
+
get rows() { return terminal.rows; },
|
|
34
|
+
get kittyProtocolActive() { return terminal.enhancedKeyboard; },
|
|
35
|
+
start: (input, resize) => terminal.start(input, resize),
|
|
36
|
+
stop: () => terminal.stop(),
|
|
37
|
+
drainInput: (max, idle) => terminal.drainInput(max, idle),
|
|
38
|
+
write: data => terminal.write(data),
|
|
39
|
+
moveBy: lines => terminal.moveBy(lines),
|
|
40
|
+
hideCursor: () => terminal.hideCursor(),
|
|
41
|
+
showCursor: () => terminal.showCursor(),
|
|
42
|
+
clearLine: () => terminal.clearLine(),
|
|
43
|
+
clearFromCursor: () => terminal.clearFromCursor(),
|
|
44
|
+
clearScreen: () => terminal.clearScreen(),
|
|
45
|
+
setTitle: title => terminal.setTitle(title),
|
|
46
|
+
setProgress: active => terminal.setProgress(active),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export type PresentationRuntimeState = "idle" | "running" | "stopping" | "stopped" | "failed";
|
|
2
|
+
export interface PresentationComponentPort {
|
|
3
|
+
render(width: number): readonly string[];
|
|
4
|
+
invalidate(): void;
|
|
5
|
+
handleInput?(data: string): void;
|
|
6
|
+
setFocused?(focused: boolean): void;
|
|
7
|
+
dispose?(): void;
|
|
8
|
+
}
|
|
9
|
+
export interface PresentationEditorPort extends PresentationComponentPort {
|
|
10
|
+
getText(): string;
|
|
11
|
+
setText(text: string): void;
|
|
12
|
+
submit(): Promise<void> | void;
|
|
13
|
+
}
|
|
14
|
+
export interface PresentationSelectorItem {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly label: string;
|
|
17
|
+
readonly detail?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface PresentationSelectorPort extends PresentationComponentPort {
|
|
20
|
+
setItems(items: readonly PresentationSelectorItem[]): void;
|
|
21
|
+
readonly selectedId: string | null;
|
|
22
|
+
}
|
|
23
|
+
export interface PresentationDialogPort extends PresentationComponentPort {
|
|
24
|
+
readonly dialogId: string;
|
|
25
|
+
close(outcome: "accepted" | "cancelled"): void;
|
|
26
|
+
}
|
|
27
|
+
export interface PresentationExtensionUiPort {
|
|
28
|
+
mount(slot: PresentationContributionSlot, component: PresentationComponentPort): () => void;
|
|
29
|
+
}
|
|
30
|
+
export type PresentationContributionSlot = "transcript" | "tool" | "editor" | "status" | "dialog" | "overlay";
|
|
31
|
+
export type PresentationFocusTarget = "transcript" | "editor" | "dialog" | "overlay" | "status";
|
|
32
|
+
export interface PresentationFocusPort {
|
|
33
|
+
readonly focused: PresentationFocusTarget;
|
|
34
|
+
focus(target: PresentationFocusTarget): void;
|
|
35
|
+
}
|
|
36
|
+
export interface PresentationTerminalPort {
|
|
37
|
+
readonly columns: number;
|
|
38
|
+
readonly rows: number;
|
|
39
|
+
readonly enhancedKeyboard: boolean;
|
|
40
|
+
start(onInput: (data: string) => void, onResize: () => void): void;
|
|
41
|
+
stop(): void;
|
|
42
|
+
drainInput(maxMs?: number, idleMs?: number): Promise<void>;
|
|
43
|
+
write(data: string): void;
|
|
44
|
+
moveBy(lines: number): void;
|
|
45
|
+
clearLine(): void;
|
|
46
|
+
clearFromCursor(): void;
|
|
47
|
+
clearScreen(): void;
|
|
48
|
+
setTitle(title: string): void;
|
|
49
|
+
setProgress(active: boolean): void;
|
|
50
|
+
showCursor(): void;
|
|
51
|
+
hideCursor(): void;
|
|
52
|
+
}
|
|
53
|
+
export type PresentationLayoutNode = {
|
|
54
|
+
readonly type: "component";
|
|
55
|
+
readonly component: PresentationComponentPort;
|
|
56
|
+
} | {
|
|
57
|
+
readonly type: "stack";
|
|
58
|
+
readonly direction: "vertical" | "horizontal";
|
|
59
|
+
readonly children: readonly PresentationLayoutNode[];
|
|
60
|
+
readonly gap?: number;
|
|
61
|
+
} | {
|
|
62
|
+
readonly type: "scroll";
|
|
63
|
+
readonly id: string;
|
|
64
|
+
readonly child: PresentationLayoutNode;
|
|
65
|
+
readonly follow: "none" | "end";
|
|
66
|
+
};
|
|
67
|
+
export interface PresentationOverlayOptions {
|
|
68
|
+
readonly anchor: "center" | "top" | "bottom";
|
|
69
|
+
readonly width?: number | `${number}%`;
|
|
70
|
+
readonly modal: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface PresentationOverlayHandle {
|
|
73
|
+
readonly visible: boolean;
|
|
74
|
+
hide(): void;
|
|
75
|
+
show(): void;
|
|
76
|
+
focus(): void;
|
|
77
|
+
dispose(): void;
|
|
78
|
+
}
|
|
79
|
+
export interface OwnedUiApplicationPort {
|
|
80
|
+
readonly disposed: boolean;
|
|
81
|
+
start(): void;
|
|
82
|
+
flush(): Promise<void>;
|
|
83
|
+
waitUntilStopped(): Promise<void>;
|
|
84
|
+
dispose(): Promise<void>;
|
|
85
|
+
}
|
|
86
|
+
export interface PresentationRuntimePort {
|
|
87
|
+
readonly state: PresentationRuntimeState;
|
|
88
|
+
readonly terminal: PresentationTerminalPort;
|
|
89
|
+
start(): void;
|
|
90
|
+
render(force?: boolean): void;
|
|
91
|
+
showOverlay(component: PresentationComponentPort, options: PresentationOverlayOptions): PresentationOverlayHandle;
|
|
92
|
+
stop(): Promise<void>;
|
|
93
|
+
}
|
|
94
|
+
export declare function assertPresentationComponent(component: PresentationComponentPort): void;
|
|
95
|
+
export declare function assertPresentationRuntime(runtime: PresentationRuntimePort): void;
|
|
96
|
+
export declare function probePresentationLifecycle(runtime: PresentationRuntimePort): Promise<void>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export function assertPresentationComponent(component) {
|
|
2
|
+
requiredFunctions(component, ["render", "invalidate"], "presentation component");
|
|
3
|
+
const lines = component.render(80);
|
|
4
|
+
if (!Array.isArray(lines) || lines.some(line => typeof line !== "string" || line.includes("\n") || line.includes("\r"))) {
|
|
5
|
+
throw new TypeError("presentation component render must return newline-free string rows");
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export function assertPresentationRuntime(runtime) {
|
|
9
|
+
requiredFunctions(runtime, ["start", "render", "showOverlay", "stop"], "presentation runtime");
|
|
10
|
+
if (!new Set(["idle", "running", "stopping", "stopped", "failed"]).has(runtime.state))
|
|
11
|
+
throw new TypeError("presentation runtime state is invalid");
|
|
12
|
+
const terminal = runtime.terminal;
|
|
13
|
+
requiredFunctions(terminal, ["start", "stop", "drainInput", "write", "moveBy", "clearLine", "clearFromCursor", "clearScreen", "setTitle", "setProgress", "showCursor", "hideCursor"], "presentation terminal");
|
|
14
|
+
if (!Number.isSafeInteger(terminal.columns) || terminal.columns < 1 || !Number.isSafeInteger(terminal.rows) || terminal.rows < 1)
|
|
15
|
+
throw new TypeError("presentation terminal geometry is invalid");
|
|
16
|
+
}
|
|
17
|
+
export async function probePresentationLifecycle(runtime) {
|
|
18
|
+
assertPresentationRuntime(runtime);
|
|
19
|
+
if (runtime.state !== "idle")
|
|
20
|
+
throw new TypeError("presentation runtime must begin idle");
|
|
21
|
+
runtime.start();
|
|
22
|
+
if (runtime.state !== "running")
|
|
23
|
+
throw new TypeError("presentation runtime did not enter running state");
|
|
24
|
+
runtime.render(true);
|
|
25
|
+
await runtime.stop();
|
|
26
|
+
if (runtime.state !== "stopped")
|
|
27
|
+
throw new TypeError("presentation runtime did not enter stopped state");
|
|
28
|
+
await runtime.stop();
|
|
29
|
+
if (runtime.state !== "stopped")
|
|
30
|
+
throw new TypeError("presentation runtime stop is not idempotent");
|
|
31
|
+
}
|
|
32
|
+
function requiredFunctions(value, names, label) {
|
|
33
|
+
if (!value)
|
|
34
|
+
throw new TypeError(`${label} is required`);
|
|
35
|
+
for (const name of names)
|
|
36
|
+
if (typeof value[name] !== "function")
|
|
37
|
+
throw new TypeError(`${label} requires ${name}`);
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function verifyProcessGuardianArtifact(helperPath: string, platform?: NodeJS.Platform, architecture?: string): Promise<void>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readFile, stat } from "node:fs/promises";
|
|
3
|
+
import { basename, dirname, resolve } from "node:path";
|
|
4
|
+
export async function verifyProcessGuardianArtifact(helperPath, platform = process.platform, architecture = process.arch) {
|
|
5
|
+
const manifestPath = resolve(dirname(helperPath), "manifest.json");
|
|
6
|
+
let manifest;
|
|
7
|
+
try {
|
|
8
|
+
manifest = JSON.parse(await readFile(manifestPath, "utf8"));
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
throw artifactError(`process guardian manifest is missing or malformed: ${errorMessage(error)}`, "CONTAINMENT_ARTIFACT_MISSING");
|
|
12
|
+
}
|
|
13
|
+
if (manifest.schema !== "a1-process-guardian-artifact-v1" || manifest.protocolVersion !== 1
|
|
14
|
+
|| manifest.platform !== platform || manifest.architecture !== architecture
|
|
15
|
+
|| manifest.artifact?.filename !== basename(helperPath)) {
|
|
16
|
+
throw artifactError("process guardian manifest is incompatible with this platform or protocol", "CONTAINMENT_ARTIFACT_INCOMPATIBLE");
|
|
17
|
+
}
|
|
18
|
+
if (manifest.capability !== "supported") {
|
|
19
|
+
throw artifactError(`process containment is not certified for ${platform}-${architecture}`, "CONTAINMENT_UNSUPPORTED");
|
|
20
|
+
}
|
|
21
|
+
const [bytes, metadata] = await Promise.all([readFile(helperPath), stat(helperPath)]).catch(error => {
|
|
22
|
+
throw artifactError(`process guardian artifact is unavailable: ${errorMessage(error)}`, "CONTAINMENT_ARTIFACT_MISSING");
|
|
23
|
+
});
|
|
24
|
+
const digest = createHash("sha256").update(bytes).digest("hex");
|
|
25
|
+
if (metadata.size !== manifest.artifact.size || digest !== manifest.artifact.sha256) {
|
|
26
|
+
throw artifactError("process guardian artifact integrity verification failed", "CONTAINMENT_ARTIFACT_TAMPERED");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function artifactError(message, code) {
|
|
30
|
+
return Object.assign(new Error(message), { code });
|
|
31
|
+
}
|
|
32
|
+
function errorMessage(error) {
|
|
33
|
+
return error instanceof Error ? error.message : String(error);
|
|
34
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { LaunchInstanceOutcome, LaunchInstanceStopReason, NativeProcessIdentity, ProcessContainmentIdentity } from "../lifecycle/index.js";
|
|
2
|
+
export interface ContainedSpawnOptions {
|
|
3
|
+
readonly cwd: string;
|
|
4
|
+
readonly environment: Readonly<Record<string, string>>;
|
|
5
|
+
readonly terminalType?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ContainedProcessHandle {
|
|
8
|
+
readonly identity: NativeProcessIdentity;
|
|
9
|
+
readonly outcome: Promise<LaunchInstanceOutcome>;
|
|
10
|
+
}
|
|
11
|
+
export interface NativeProcessInspector {
|
|
12
|
+
observe(pid: number): Promise<NativeProcessIdentity | null>;
|
|
13
|
+
matches(identity: NativeProcessIdentity): Promise<boolean>;
|
|
14
|
+
}
|
|
15
|
+
export interface ProcessContainment {
|
|
16
|
+
readonly identity: ProcessContainmentIdentity;
|
|
17
|
+
spawn(executable: string, arguments_: readonly string[], options: ContainedSpawnOptions): Promise<ContainedProcessHandle>;
|
|
18
|
+
contains(identity: NativeProcessIdentity): Promise<boolean>;
|
|
19
|
+
stop(force: boolean): Promise<void>;
|
|
20
|
+
waitForEmpty(timeoutMs: number): Promise<boolean>;
|
|
21
|
+
close(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export interface ProcessContainmentFactory {
|
|
24
|
+
create(instanceId: string): Promise<ProcessContainment>;
|
|
25
|
+
}
|
|
26
|
+
export interface ContainmentCloseResult {
|
|
27
|
+
readonly outcome: LaunchInstanceOutcome;
|
|
28
|
+
readonly graceful: boolean;
|
|
29
|
+
readonly forced: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare function closeVerifiedContainment(containment: ProcessContainment, inspector: NativeProcessInspector, rootIdentity: NativeProcessIdentity, reason: LaunchInstanceStopReason, deadlineMs?: number): Promise<ContainmentCloseResult>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export async function closeVerifiedContainment(containment, inspector, rootIdentity, reason, deadlineMs = 1_500) {
|
|
2
|
+
if (!await ownershipMatches(containment, inspector, rootIdentity)) {
|
|
3
|
+
return ownershipMismatch("refusing graceful cleanup because launch-instance ownership changed");
|
|
4
|
+
}
|
|
5
|
+
await containment.stop(false);
|
|
6
|
+
if (await containment.waitForEmpty(deadlineMs)) {
|
|
7
|
+
return { outcome: { kind: "stopped", reason }, graceful: true, forced: false };
|
|
8
|
+
}
|
|
9
|
+
if (!await ownershipMatches(containment, inspector, rootIdentity)) {
|
|
10
|
+
return ownershipMismatch("refusing forced cleanup because launch-instance ownership changed");
|
|
11
|
+
}
|
|
12
|
+
await containment.stop(true);
|
|
13
|
+
if (await containment.waitForEmpty(deadlineMs)) {
|
|
14
|
+
return { outcome: { kind: "stopped", reason }, graceful: false, forced: true };
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
outcome: {
|
|
18
|
+
kind: "cleanup-error",
|
|
19
|
+
message: "launch-instance process tree did not exit within the bounded cleanup deadline",
|
|
20
|
+
code: "CONTAINMENT_CLEANUP_TIMEOUT",
|
|
21
|
+
},
|
|
22
|
+
graceful: false,
|
|
23
|
+
forced: true,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
async function ownershipMatches(containment, inspector, rootIdentity) {
|
|
27
|
+
return await inspector.matches(rootIdentity) && await containment.contains(rootIdentity);
|
|
28
|
+
}
|
|
29
|
+
function ownershipMismatch(message) {
|
|
30
|
+
return {
|
|
31
|
+
outcome: { kind: "cleanup-error", message, code: "PROCESS_IDENTITY_MISMATCH" },
|
|
32
|
+
graceful: false,
|
|
33
|
+
forced: false,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { NativeProcessIdentity } from "../lifecycle/index.js";
|
|
2
|
+
import type { NativeProcessInspector } from "./contracts.js";
|
|
3
|
+
export declare class LinuxNativeProcessInspector implements NativeProcessInspector {
|
|
4
|
+
observe(pid: number): Promise<NativeProcessIdentity | null>;
|
|
5
|
+
matches(identity: NativeProcessIdentity): Promise<boolean>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
export class LinuxNativeProcessInspector {
|
|
3
|
+
async observe(pid) {
|
|
4
|
+
if (!Number.isSafeInteger(pid) || pid <= 0)
|
|
5
|
+
throw new TypeError("inspected PID must be a positive safe integer");
|
|
6
|
+
let stat;
|
|
7
|
+
try {
|
|
8
|
+
stat = await readFile(`/proc/${pid}/stat`, "utf8");
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT")
|
|
12
|
+
return null;
|
|
13
|
+
throw error;
|
|
14
|
+
}
|
|
15
|
+
const commandEnd = stat.lastIndexOf(")");
|
|
16
|
+
const fields = commandEnd >= 0 ? stat.slice(commandEnd + 1).trim().split(/\s+/) : [];
|
|
17
|
+
const startTicks = fields[19];
|
|
18
|
+
if (!startTicks || !/^\d+$/.test(startTicks))
|
|
19
|
+
throw new Error("process stat has no valid start-time field");
|
|
20
|
+
return { pid, startIdentity: `linux-proc-start:${startTicks}` };
|
|
21
|
+
}
|
|
22
|
+
async matches(identity) {
|
|
23
|
+
const observed = await this.observe(identity.pid);
|
|
24
|
+
return observed !== null && observed.startIdentity === identity.startIdentity;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NativeProcessIdentity, ProcessContainmentIdentity } from "../lifecycle/index.js";
|
|
2
|
+
import type { ContainedProcessHandle, ContainedSpawnOptions, ProcessContainment } from "./contracts.js";
|
|
3
|
+
export declare class NativeGuardianContainment implements ProcessContainment {
|
|
4
|
+
#private;
|
|
5
|
+
readonly instanceId: string;
|
|
6
|
+
readonly helperPath: string;
|
|
7
|
+
readonly statusPath: string;
|
|
8
|
+
constructor(instanceId: string, helperPath: string, statusPath: string);
|
|
9
|
+
get identity(): ProcessContainmentIdentity;
|
|
10
|
+
spawn(executable: string, arguments_: readonly string[], options: ContainedSpawnOptions): Promise<ContainedProcessHandle>;
|
|
11
|
+
contains(identity: NativeProcessIdentity): Promise<boolean>;
|
|
12
|
+
stop(force: boolean): Promise<void>;
|
|
13
|
+
waitForEmpty(timeoutMs: number): Promise<boolean>;
|
|
14
|
+
close(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare function resolveProcessGuardianPath(releaseRoot: string, environment?: NodeJS.ProcessEnv, platform?: NodeJS.Platform, architecture?: string): string;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { mkdir, readFile, rm } from "node:fs/promises";
|
|
3
|
+
import { dirname, resolve } from "node:path";
|
|
4
|
+
import { PRODUCT_IDENTITY } from "../../product-identity.js";
|
|
5
|
+
export class NativeGuardianContainment {
|
|
6
|
+
instanceId;
|
|
7
|
+
helperPath;
|
|
8
|
+
statusPath;
|
|
9
|
+
#identity;
|
|
10
|
+
#helper = null;
|
|
11
|
+
#rootIdentity = null;
|
|
12
|
+
#outcome = null;
|
|
13
|
+
constructor(instanceId, helperPath, statusPath) {
|
|
14
|
+
this.instanceId = instanceId;
|
|
15
|
+
this.helperPath = helperPath;
|
|
16
|
+
this.statusPath = statusPath;
|
|
17
|
+
this.#identity = { provider: "native-guardian-pending", token: instanceId };
|
|
18
|
+
}
|
|
19
|
+
get identity() {
|
|
20
|
+
return this.#identity;
|
|
21
|
+
}
|
|
22
|
+
async spawn(executable, arguments_, options) {
|
|
23
|
+
if (this.#helper)
|
|
24
|
+
throw new Error("process containment already has a root runtime");
|
|
25
|
+
await mkdir(dirname(this.statusPath), { recursive: true, mode: 0o700 });
|
|
26
|
+
await rm(this.statusPath, { force: true });
|
|
27
|
+
const helper = spawn(this.helperPath, [
|
|
28
|
+
"--parent-pid", String(process.pid),
|
|
29
|
+
"--instance", this.instanceId,
|
|
30
|
+
"--status-file", this.statusPath,
|
|
31
|
+
"--", executable, ...arguments_,
|
|
32
|
+
], {
|
|
33
|
+
cwd: options.cwd,
|
|
34
|
+
env: { ...options.environment, ...(options.terminalType ? { TERM: options.terminalType } : {}) },
|
|
35
|
+
shell: false,
|
|
36
|
+
stdio: "inherit",
|
|
37
|
+
windowsHide: false,
|
|
38
|
+
});
|
|
39
|
+
this.#helper = helper;
|
|
40
|
+
this.#outcome = helperOutcome(helper);
|
|
41
|
+
const status = await waitForReadyStatus(this.statusPath, this.#outcome, 5_000);
|
|
42
|
+
this.#rootIdentity = { pid: status.pid, startIdentity: status.startIdentity };
|
|
43
|
+
this.#identity = { provider: status.containmentProvider, token: status.containmentToken };
|
|
44
|
+
return { identity: this.#rootIdentity, outcome: this.#outcome };
|
|
45
|
+
}
|
|
46
|
+
async contains(identity) {
|
|
47
|
+
return this.#rootIdentity !== null
|
|
48
|
+
&& identity.pid === this.#rootIdentity.pid
|
|
49
|
+
&& identity.startIdentity === this.#rootIdentity.startIdentity;
|
|
50
|
+
}
|
|
51
|
+
async stop(force) {
|
|
52
|
+
const root = this.#rootIdentity;
|
|
53
|
+
if (!root)
|
|
54
|
+
return;
|
|
55
|
+
try {
|
|
56
|
+
process.kill(root.pid, force ? "SIGKILL" : "SIGTERM");
|
|
57
|
+
}
|
|
58
|
+
catch { }
|
|
59
|
+
}
|
|
60
|
+
async waitForEmpty(timeoutMs) {
|
|
61
|
+
if (!this.#helper || this.#helper.exitCode !== null || this.#helper.signalCode !== null)
|
|
62
|
+
return true;
|
|
63
|
+
return await new Promise(resolvePromise => {
|
|
64
|
+
const timer = setTimeout(() => finish(false), timeoutMs);
|
|
65
|
+
timer.unref();
|
|
66
|
+
const finish = (empty) => {
|
|
67
|
+
clearTimeout(timer);
|
|
68
|
+
this.#helper?.off("close", onClose);
|
|
69
|
+
resolvePromise(empty);
|
|
70
|
+
};
|
|
71
|
+
const onClose = () => finish(true);
|
|
72
|
+
this.#helper?.once("close", onClose);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
async close() {
|
|
76
|
+
const helper = this.#helper;
|
|
77
|
+
if (helper && helper.exitCode === null && helper.signalCode === null)
|
|
78
|
+
helper.kill("SIGKILL");
|
|
79
|
+
await this.waitForEmpty(1_500);
|
|
80
|
+
await rm(this.statusPath, { force: true });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export function resolveProcessGuardianPath(releaseRoot, environment = process.env, platform = process.platform, architecture = process.arch) {
|
|
84
|
+
const override = environment[PRODUCT_IDENTITY.environment.processGuardianPath]?.trim();
|
|
85
|
+
if (override)
|
|
86
|
+
return resolve(override);
|
|
87
|
+
const executable = platform === "win32"
|
|
88
|
+
? `${PRODUCT_IDENTITY.artifacts.processGuardianExecutable}.exe`
|
|
89
|
+
: PRODUCT_IDENTITY.artifacts.processGuardianExecutable;
|
|
90
|
+
return resolve(releaseRoot, "dist", "native", `${platform}-${architecture}`, executable);
|
|
91
|
+
}
|
|
92
|
+
function helperOutcome(helper) {
|
|
93
|
+
return new Promise(resolvePromise => {
|
|
94
|
+
let settled = false;
|
|
95
|
+
const settle = (outcome) => {
|
|
96
|
+
if (settled)
|
|
97
|
+
return;
|
|
98
|
+
settled = true;
|
|
99
|
+
resolvePromise(outcome);
|
|
100
|
+
};
|
|
101
|
+
helper.once("error", error => settle({ kind: "guardian-error", message: error.message, code: errorCode(error) }));
|
|
102
|
+
helper.once("close", (code, signal) => {
|
|
103
|
+
if (signal)
|
|
104
|
+
settle({ kind: "signaled", signal });
|
|
105
|
+
else
|
|
106
|
+
settle({ kind: "exited", exitCode: code ?? 1 });
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
async function waitForReadyStatus(path, outcome, timeoutMs) {
|
|
111
|
+
const deadline = Date.now() + timeoutMs;
|
|
112
|
+
let terminalOutcome = null;
|
|
113
|
+
void outcome.then(value => { terminalOutcome = value; });
|
|
114
|
+
while (Date.now() < deadline) {
|
|
115
|
+
try {
|
|
116
|
+
const value = JSON.parse(await readFile(path, "utf8"));
|
|
117
|
+
if (isReadyStatus(value))
|
|
118
|
+
return value;
|
|
119
|
+
throw new Error("process guardian published invalid ready status");
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
|
|
123
|
+
throw error;
|
|
124
|
+
}
|
|
125
|
+
if (terminalOutcome)
|
|
126
|
+
throw new Error(`process guardian exited before readiness: ${JSON.stringify(terminalOutcome)}`);
|
|
127
|
+
await new Promise(resolvePromise => setTimeout(resolvePromise, 20));
|
|
128
|
+
}
|
|
129
|
+
throw new Error(`process guardian did not publish readiness within ${timeoutMs}ms`);
|
|
130
|
+
}
|
|
131
|
+
function isReadyStatus(value) {
|
|
132
|
+
return Number.isSafeInteger(value.pid) && Number(value.pid) > 0
|
|
133
|
+
&& typeof value.startIdentity === "string" && value.startIdentity.length > 0
|
|
134
|
+
&& typeof value.containmentProvider === "string" && value.containmentProvider.length > 0
|
|
135
|
+
&& typeof value.containmentToken === "string" && value.containmentToken.length > 0;
|
|
136
|
+
}
|
|
137
|
+
function errorCode(error) {
|
|
138
|
+
return "code" in error && typeof error.code === "string" ? error.code : null;
|
|
139
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { NativeProcessIdentity } from "../lifecycle/index.js";
|
|
2
|
+
import type { NativeProcessInspector } from "./contracts.js";
|
|
3
|
+
export interface InspectorCommandResult {
|
|
4
|
+
readonly exitCode: number;
|
|
5
|
+
readonly stdout: string;
|
|
6
|
+
readonly stderr: string;
|
|
7
|
+
}
|
|
8
|
+
export interface InspectorCommandRunner {
|
|
9
|
+
run(executable: string, arguments_: readonly string[]): Promise<InspectorCommandResult>;
|
|
10
|
+
}
|
|
11
|
+
export declare class WindowsNativeProcessInspector implements NativeProcessInspector {
|
|
12
|
+
readonly helperPath: string;
|
|
13
|
+
private readonly runner;
|
|
14
|
+
constructor(helperPath: string, runner?: InspectorCommandRunner);
|
|
15
|
+
observe(pid: number): Promise<NativeProcessIdentity | null>;
|
|
16
|
+
matches(identity: NativeProcessIdentity): Promise<boolean>;
|
|
17
|
+
}
|