@timurproko/a1 0.1.0 → 0.1.1-dev.2
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 +8 -6
- package/bin/a1-ui.js +24 -0
- package/bin/{addone.js → a1.js} +2 -2
- 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 +22 -0
- package/dist/src/composition/index.js +166 -0
- package/dist/src/composition/transparent-runtime.d.ts +6 -0
- package/dist/src/composition/transparent-runtime.js +19 -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 +1 -2
- 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 +2 -3
- package/dist/src/features/launch/profiles.js +5 -6
- package/dist/src/features/launch/runtime-selection.d.ts +1 -2
- package/dist/src/features/launch/runtime-selection.js +1 -2
- 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 +0 -2
- package/dist/src/features/owned-ui/index.js +0 -2
- package/dist/src/features/owned-ui/run.d.ts +3 -7
- package/dist/src/features/owned-ui/run.js +7 -15
- 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 +90 -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/lifecycle/index.d.ts +0 -1
- package/dist/src/foundation/lifecycle/index.js +0 -1
- package/dist/src/foundation/lifecycle/model.d.ts +1 -2
- 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/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 +0 -1
- package/dist/src/foundation/pi-component-adapter/index.js +0 -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 +0 -1
- package/dist/src/foundation/pi-component-adapter/shell-selectors-dialogs.js +0 -1
- 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 +0 -1
- package/dist/src/foundation/pi-component-adapter/upstream/theme/theme.js +18 -15
- package/dist/src/foundation/pi-engine-adapter/adapter.d.ts +2 -202
- package/dist/src/foundation/pi-engine-adapter/adapter.js +76 -174
- 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/public-main-entry.d.ts +5 -0
- package/dist/src/foundation/pi-engine-adapter/public-main-entry.js +18 -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 +17 -0
- package/dist/src/foundation/pi-engine-adapter/settings-integration.js +85 -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 +0 -1
- package/dist/src/foundation/pi-engine-adapter/workflows.js +0 -1
- package/dist/src/foundation/pi-owned-ui-integration/index.d.ts +1 -0
- package/dist/src/foundation/pi-owned-ui-integration/index.js +1 -0
- package/dist/src/{features/owned-ui/pi-session-shell.d.ts → foundation/pi-owned-ui-integration/session-shell.d.ts} +17 -14
- package/dist/src/{features/owned-ui/pi-session-shell.js → foundation/pi-owned-ui-integration/session-shell.js} +59 -60
- package/dist/src/foundation/pi-tui-runtime-adapter/adapter.d.ts +0 -1
- package/dist/src/foundation/pi-tui-runtime-adapter/adapter.js +0 -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/protocol/client.d.ts +0 -1
- package/dist/src/foundation/protocol/client.js +0 -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 +1 -2
- package/dist/src/foundation/protocol/messages.js +2 -2
- package/dist/src/foundation/release/bootstrap.d.ts +0 -1
- package/dist/src/foundation/release/bootstrap.js +55 -22
- package/dist/src/foundation/release/cohort-selection.d.ts +0 -1
- package/dist/src/foundation/release/cohort-selection.js +0 -1
- package/dist/src/foundation/release/cohort-state.d.ts +3 -2
- 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 +0 -1
- package/dist/src/foundation/release/process-cleanup.js +0 -1
- 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 +24 -6
- package/dist/src/foundation/release/release-store.js +56 -21
- package/dist/src/foundation/release/release.d.ts +5 -6
- package/dist/src/foundation/release/release.js +21 -19
- 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 +2 -3
- package/dist/src/foundation/release/update.js +31 -29
- package/dist/src/foundation/storage/control-store.d.ts +0 -1
- package/dist/src/foundation/storage/control-store.js +28 -7
- 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 +3 -4
- package/dist/src/foundation/supervision/server.js +7 -6
- package/dist/src/foundation/transparent-terminal/command-resolution.d.ts +0 -1
- package/dist/src/foundation/transparent-terminal/command-resolution.js +0 -1
- package/dist/src/foundation/transparent-terminal/foreground-broker.d.ts +0 -1
- package/dist/src/foundation/transparent-terminal/foreground-broker.js +0 -1
- package/dist/src/foundation/transparent-terminal/index.d.ts +1 -1
- package/dist/src/foundation/transparent-terminal/index.js +1 -1
- package/dist/src/foundation/transparent-terminal/main.d.ts +3 -4
- package/dist/src/foundation/transparent-terminal/main.js +8 -21
- package/dist/src/foundation/transparent-terminal/native-launcher.d.ts +0 -1
- package/dist/src/foundation/transparent-terminal/native-launcher.js +0 -1
- 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 +149 -0
- package/dist/src/product-identity.json +96 -0
- package/docs/architecture/boundaries.md +2 -2
- 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 +33 -7
- package/docs/features/launch-profiles.md +6 -6
- package/docs/manual-pi-boundary-candidate.md +33 -0
- package/docs/manual-transparent-checkpoint.md +11 -11
- package/package.json +10 -3
- 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.map +0 -1
- package/dist/src/foundation/transparent-terminal/command-resolution.js.map +0 -1
- package/dist/src/foundation/transparent-terminal/foreground-broker.d.ts.map +0 -1
- package/dist/src/foundation/transparent-terminal/foreground-broker.js.map +0 -1
- package/dist/src/foundation/transparent-terminal/index.d.ts.map +0 -1
- package/dist/src/foundation/transparent-terminal/index.js.map +0 -1
- package/dist/src/foundation/transparent-terminal/main.d.ts.map +0 -1
- package/dist/src/foundation/transparent-terminal/main.js.map +0 -1
- package/dist/src/foundation/transparent-terminal/native-launcher.d.ts.map +0 -1
- 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 → a1-supervisor.js} +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export const EXPOSED_SETTING_KEYS = Object.freeze([
|
|
2
|
+
"autoCompact", "showImages", "imageWidthCells", "autoResizeImages", "blockImages", "enableSkillCommands",
|
|
3
|
+
"steeringMode", "followUpMode", "transport", "httpIdleTimeoutMs", "thinkingLevel", "theme", "hideThinkingBlock",
|
|
4
|
+
"mermaidRenderingMode", "showCacheMissNotices", "collapseChangelog", "enableInstallTelemetry", "quietStartup",
|
|
5
|
+
"defaultProjectTrust", "doubleEscapeAction", "treeFilterMode", "showHardwareCursor", "editorPaddingX", "outputPad",
|
|
6
|
+
"autocompleteMaxVisible", "clearOnShrink", "showTerminalProgress", "tuiMode", "fullscreenExitOutput", "fullscreenScrollbar", "warnings",
|
|
7
|
+
]);
|
|
8
|
+
export class PiSettingsIntegration {
|
|
9
|
+
settings;
|
|
10
|
+
capabilities = { write: true, flush: true };
|
|
11
|
+
#operations;
|
|
12
|
+
constructor(settings) {
|
|
13
|
+
this.settings = settings;
|
|
14
|
+
this.#operations = new Map(operations(settings).map(operation => [operation.descriptor.key, operation]));
|
|
15
|
+
if (this.#operations.size !== EXPOSED_SETTING_KEYS.length || EXPOSED_SETTING_KEYS.some(key => !this.#operations.has(key))) {
|
|
16
|
+
throw new Error("Pi settings integration does not cover every A1-exposed setting");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
async listSettings() { return [...this.#operations.values()].map(operation => operation.descriptor); }
|
|
20
|
+
async readSetting(key) { return this.#operations.get(key)?.read(); }
|
|
21
|
+
async writeSetting(key, value) { this.writeSettingNow(key, value); }
|
|
22
|
+
writeSettingNow(key, value) {
|
|
23
|
+
const operation = this.#operations.get(key);
|
|
24
|
+
if (!operation)
|
|
25
|
+
throw new Error(`setting is unavailable: ${key}`);
|
|
26
|
+
operation.write(value);
|
|
27
|
+
}
|
|
28
|
+
async flush() { await this.settings.flush(); }
|
|
29
|
+
}
|
|
30
|
+
function operations(settings) {
|
|
31
|
+
return [
|
|
32
|
+
bool("autoCompact", () => settings.getCompactionEnabled(), value => settings.setCompactionEnabled(value)),
|
|
33
|
+
bool("showImages", () => settings.getShowImages(), value => settings.setShowImages(value)),
|
|
34
|
+
numberSetting("imageWidthCells", () => settings.getImageWidthCells(), value => settings.setImageWidthCells(value), 1),
|
|
35
|
+
bool("autoResizeImages", () => settings.getImageAutoResize(), value => settings.setImageAutoResize(value)),
|
|
36
|
+
bool("blockImages", () => settings.getBlockImages(), value => settings.setBlockImages(value)),
|
|
37
|
+
bool("enableSkillCommands", () => settings.getEnableSkillCommands(), value => settings.setEnableSkillCommands(value)),
|
|
38
|
+
choice("steeringMode", ["all", "one-at-a-time"], () => settings.getSteeringMode(), value => settings.setSteeringMode(value)),
|
|
39
|
+
choice("followUpMode", ["all", "one-at-a-time"], () => settings.getFollowUpMode(), value => settings.setFollowUpMode(value)),
|
|
40
|
+
choice("transport", ["sse", "websocket", "websocket-cached", "auto"], () => settings.getTransport(), value => settings.setTransport(value)),
|
|
41
|
+
numberSetting("httpIdleTimeoutMs", () => settings.getHttpIdleTimeoutMs(), value => settings.setHttpIdleTimeoutMs(value), 0),
|
|
42
|
+
choice("thinkingLevel", ["off", "minimal", "low", "medium", "high", "xhigh"], () => settings.getDefaultThinkingLevel() ?? "medium", value => settings.setDefaultThinkingLevel(value)),
|
|
43
|
+
stringSetting("theme", () => settings.getTheme() ?? "default", value => settings.setTheme(value)),
|
|
44
|
+
bool("hideThinkingBlock", () => settings.getHideThinkingBlock(), value => settings.setHideThinkingBlock(value)),
|
|
45
|
+
choice("mermaidRenderingMode", ["off", "final", "streaming"], () => settings.getMermaidRenderingMode(), value => settings.setMermaidRenderingMode(value)),
|
|
46
|
+
bool("showCacheMissNotices", () => settings.getShowCacheMissNotices(), value => settings.setShowCacheMissNotices(value)),
|
|
47
|
+
bool("collapseChangelog", () => settings.getCollapseChangelog(), value => settings.setCollapseChangelog(value)),
|
|
48
|
+
bool("enableInstallTelemetry", () => settings.getEnableInstallTelemetry(), value => settings.setEnableInstallTelemetry(value)),
|
|
49
|
+
bool("quietStartup", () => settings.getQuietStartup(), value => settings.setQuietStartup(value)),
|
|
50
|
+
choice("defaultProjectTrust", ["ask", "always", "never"], () => settings.getDefaultProjectTrust(), value => settings.setDefaultProjectTrust(value)),
|
|
51
|
+
choice("doubleEscapeAction", ["fork", "tree", "none"], () => settings.getDoubleEscapeAction(), value => settings.setDoubleEscapeAction(value)),
|
|
52
|
+
choice("treeFilterMode", ["default", "no-tools", "user-only", "labeled-only", "all"], () => settings.getTreeFilterMode(), value => settings.setTreeFilterMode(value)),
|
|
53
|
+
bool("showHardwareCursor", () => settings.getShowHardwareCursor(), value => settings.setShowHardwareCursor(value)),
|
|
54
|
+
numberSetting("editorPaddingX", () => settings.getEditorPaddingX(), value => settings.setEditorPaddingX(value), 0),
|
|
55
|
+
choice("outputPad", [0, 1], () => settings.getOutputPad(), value => settings.setOutputPad(value)),
|
|
56
|
+
numberSetting("autocompleteMaxVisible", () => settings.getAutocompleteMaxVisible(), value => settings.setAutocompleteMaxVisible(value), 1),
|
|
57
|
+
bool("clearOnShrink", () => settings.getClearOnShrink(), value => settings.setClearOnShrink(value)),
|
|
58
|
+
bool("showTerminalProgress", () => settings.getShowTerminalProgress(), value => settings.setShowTerminalProgress(value)),
|
|
59
|
+
choice("tuiMode", ["regular", "fullscreen"], () => settings.getTuiMode(), value => settings.setTuiMode(value)),
|
|
60
|
+
choice("fullscreenExitOutput", ["transcript", "resume-hint"], () => settings.getFullscreenExitOutput(), value => settings.setFullscreenExitOutput(value)),
|
|
61
|
+
choice("fullscreenScrollbar", ["hidden", "auto", "always"], () => settings.getFullscreenScrollbar(), value => settings.setFullscreenScrollbar(value)),
|
|
62
|
+
jsonObject("warnings", () => settings.getWarnings(), value => settings.setWarnings(value)),
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
function bool(key, read, write) {
|
|
66
|
+
return { descriptor: { key, valueType: "boolean", writable: true }, read, write(value) { if (typeof value !== "boolean")
|
|
67
|
+
invalid(key); write(value); } };
|
|
68
|
+
}
|
|
69
|
+
function numberSetting(key, read, write, minimum) {
|
|
70
|
+
return { descriptor: { key, valueType: "number", writable: true }, read, write(value) { if (typeof value !== "number" || !Number.isSafeInteger(value) || value < minimum)
|
|
71
|
+
invalid(key); write(value); } };
|
|
72
|
+
}
|
|
73
|
+
function stringSetting(key, read, write) {
|
|
74
|
+
return { descriptor: { key, valueType: "string", writable: true }, read, write(value) { if (typeof value !== "string" || value.length === 0)
|
|
75
|
+
invalid(key); write(value); } };
|
|
76
|
+
}
|
|
77
|
+
function jsonObject(key, read, write) {
|
|
78
|
+
return { descriptor: { key, valueType: "json", writable: true }, read: () => Object.fromEntries(Object.entries(read()).filter((entry) => typeof entry[1] === "boolean")), write(value) { if (!value || typeof value !== "object" || Array.isArray(value))
|
|
79
|
+
invalid(key); write(value); } };
|
|
80
|
+
}
|
|
81
|
+
function choice(key, choices, read, write) {
|
|
82
|
+
return { descriptor: { key, valueType: "enum", writable: true, choices }, read, write(value) { if (!choices.includes(value))
|
|
83
|
+
invalid(key); write(value); } };
|
|
84
|
+
}
|
|
85
|
+
function invalid(key) { throw new TypeError(`setting value is invalid: ${key}`); }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AgentJsonValue, AgentWorkflowDescriptor, AgentWorkflowPort } from "../agent-engine-contracts/index.js";
|
|
2
|
+
import { type PiWorkflowRoute } from "./workflows.js";
|
|
3
|
+
export type WorkflowCapability = "prompt" | "abort" | "compact" | "bash" | "models.read" | "models.write" | "auth.login" | "auth.logout" | "settings.read" | "settings.write" | "resources.read" | "resources.reload" | "session.read" | "session.new" | "session.resume" | "session.fork" | "session.tree" | "session.import" | "clipboard.write" | "export.write" | "share.write" | "process.quit" | "diagnostics.read";
|
|
4
|
+
export interface WorkflowControllerResult {
|
|
5
|
+
readonly outcome: "completed" | "cancelled" | "failed";
|
|
6
|
+
readonly message: string;
|
|
7
|
+
readonly value?: AgentJsonValue;
|
|
8
|
+
}
|
|
9
|
+
export declare class PiWorkflowControllerPort implements AgentWorkflowPort {
|
|
10
|
+
#private;
|
|
11
|
+
private readonly execute;
|
|
12
|
+
readonly capabilities: {
|
|
13
|
+
execute: boolean;
|
|
14
|
+
};
|
|
15
|
+
constructor(available: readonly WorkflowCapability[], execute: (workflowId: PiWorkflowRoute, input: AgentJsonValue, signal?: AbortSignal) => Promise<WorkflowControllerResult>);
|
|
16
|
+
listWorkflows(): Promise<readonly AgentWorkflowDescriptor[]>;
|
|
17
|
+
executeWorkflow(workflowId: string, input: AgentJsonValue, signal?: AbortSignal): Promise<AgentJsonValue>;
|
|
18
|
+
}
|
|
19
|
+
export declare const PI_BUILTIN_WORKFLOW_ROUTES: readonly ("name" | "share" | "model" | "login" | "logout" | "settings" | "reload" | "compact" | "new" | "resume" | "scoped-models" | "export" | "import" | "copy" | "session" | "changelog" | "hotkeys" | "fork" | "clone" | "tree" | "trust" | "quit" | "debug" | "arminsayshi" | "dementedelves")[];
|
|
20
|
+
export declare const PI_WORKFLOW_CAPABILITIES: readonly WorkflowCapability[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PINNED_PI_HIDDEN_COMMAND_NAMES, PINNED_PI_WORKFLOW_COMMAND_NAMES } from "./workflows.js";
|
|
2
|
+
const DEFINITIONS = [
|
|
3
|
+
define("settings", "settings.read", "settings.write"), define("model", "models.read", "models.write"),
|
|
4
|
+
define("scoped-models", "models.read", "models.write"), define("export", "export.write"), define("import", "session.import"),
|
|
5
|
+
define("share", "share.write"), define("copy", "clipboard.write"), define("name", "session.read"), define("session", "session.read"),
|
|
6
|
+
define("changelog", "resources.read"), define("hotkeys", "resources.read"), define("fork", "session.fork"), define("clone", "session.fork"),
|
|
7
|
+
define("tree", "session.tree"), define("trust", "settings.write"), define("login", "auth.login"), define("logout", "auth.logout"),
|
|
8
|
+
define("new", "session.new"), define("compact", "compact"), define("resume", "session.resume"), define("reload", "resources.reload"),
|
|
9
|
+
define("quit", "process.quit"), define("debug", "diagnostics.read"), define("arminsayshi", "resources.read"), define("dementedelves", "resources.read"),
|
|
10
|
+
];
|
|
11
|
+
export class PiWorkflowControllerPort {
|
|
12
|
+
execute;
|
|
13
|
+
capabilities = { execute: true };
|
|
14
|
+
#available;
|
|
15
|
+
constructor(available, execute) {
|
|
16
|
+
this.execute = execute;
|
|
17
|
+
this.#available = new Set(available);
|
|
18
|
+
}
|
|
19
|
+
async listWorkflows() {
|
|
20
|
+
return DEFINITIONS.map(definition => ({ id: definition.id, label: definition.id, requiredCommands: definition.required }));
|
|
21
|
+
}
|
|
22
|
+
async executeWorkflow(workflowId, input, signal) {
|
|
23
|
+
const definition = DEFINITIONS.find(value => value.id === workflowId);
|
|
24
|
+
if (!definition)
|
|
25
|
+
return failure(`workflow is unavailable: ${workflowId}`);
|
|
26
|
+
const missing = definition.required.filter(capability => !this.#available.has(capability));
|
|
27
|
+
if (missing.length > 0)
|
|
28
|
+
return failure(`${workflowId} requires unavailable capabilities: ${missing.join(", ")}`);
|
|
29
|
+
if (signal?.aborted)
|
|
30
|
+
return { outcome: "cancelled", message: "workflow cancelled" };
|
|
31
|
+
try {
|
|
32
|
+
const result = await this.execute(definition.id, input, signal);
|
|
33
|
+
return { ...result, message: bounded(result.message) };
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
return failure(`${workflowId} failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export const PI_BUILTIN_WORKFLOW_ROUTES = Object.freeze([...PINNED_PI_WORKFLOW_COMMAND_NAMES, ...PINNED_PI_HIDDEN_COMMAND_NAMES]);
|
|
41
|
+
export const PI_WORKFLOW_CAPABILITIES = Object.freeze([
|
|
42
|
+
"prompt", "abort", "compact", "bash", "models.read", "models.write", "auth.login", "auth.logout", "settings.read", "settings.write",
|
|
43
|
+
"resources.read", "resources.reload", "session.read", "session.new", "session.resume", "session.fork", "session.tree", "session.import",
|
|
44
|
+
"clipboard.write", "export.write", "share.write", "process.quit", "diagnostics.read",
|
|
45
|
+
]);
|
|
46
|
+
function define(id, ...required) { return { id, required }; }
|
|
47
|
+
function failure(message) { return { outcome: "failed", message: bounded(message) }; }
|
|
48
|
+
function bounded(message) { return message.length <= 512 ? message : `${message.slice(0, 509)}...`; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./session-shell.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./session-shell.js";
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import type { OwnedUiSessionViewModel, OwnedUiThinkingLevel } from "
|
|
2
|
-
import { type AdapterCommandResult, type PiEngineAdapter, type PiWorkflowRequest, type PiWorkflowResult } from "
|
|
3
|
-
import { type PiShellComponentPort, type PiShellEditorPort, type PiShellExtensionRendererResolver, type PiShellHeaderOptions, type PiShellHeaderPort, type PiShellLoadedResourcesPort, type PiShellSelectorOption, type PiShellTranscriptComponentPort } from "
|
|
4
|
-
import { PiTuiRuntimeAdapter, type PiTuiComponentPort, type PiTuiLayoutNode, type PiTuiOverlayHandle, type PiTuiTerminalPort } from "
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import type { OwnedUiSessionViewModel, OwnedUiThinkingLevel } from "../owned-ui-contracts/index.js";
|
|
2
|
+
import { type AdapterCommandResult, type PiEngineAdapter, type PiWorkflowRequest, type PiWorkflowResult } from "../pi-engine-adapter/index.js";
|
|
3
|
+
import { type PiShellComponentPort, type PiShellEditorPort, type PiShellExtensionRendererResolver, type PiShellHeaderOptions, type PiShellHeaderPort, type PiShellLoadedResourcesPort, type PiShellSelectorOption, type PiShellTranscriptComponentPort } from "../pi-component-adapter/index.js";
|
|
4
|
+
import { PiTuiRuntimeAdapter, type PiTuiComponentPort, type PiTuiLayoutNode, type PiTuiOverlayHandle, type PiTuiTerminalPort } from "../pi-tui-runtime-adapter/index.js";
|
|
5
|
+
type OwnedUiBackendPort = PiEngineAdapter;
|
|
6
|
+
type OwnedUiTerminalPort = PiTuiTerminalPort;
|
|
7
|
+
type OwnedUiStartupOptions = PiShellHeaderOptions;
|
|
8
|
+
export interface OwnedUiSessionShellOptions {
|
|
9
|
+
readonly backend: OwnedUiBackendPort;
|
|
7
10
|
readonly cwd: string;
|
|
8
|
-
readonly terminal?:
|
|
9
|
-
readonly startup?:
|
|
11
|
+
readonly terminal?: OwnedUiTerminalPort;
|
|
12
|
+
readonly startup?: OwnedUiStartupOptions;
|
|
10
13
|
}
|
|
11
|
-
export declare class
|
|
14
|
+
export declare class OwnedUiSessionShellRoot implements PiTuiComponentPort {
|
|
12
15
|
#private;
|
|
13
16
|
readonly editor: PiShellEditorPort;
|
|
14
17
|
readonly header: PiShellHeaderPort;
|
|
@@ -54,12 +57,12 @@ export declare class PiSessionShellRoot implements PiTuiComponentPort {
|
|
|
54
57
|
setFocused(focused: boolean): void;
|
|
55
58
|
dispose(): void;
|
|
56
59
|
}
|
|
57
|
-
export declare class
|
|
60
|
+
export declare class OwnedUiSessionShell {
|
|
58
61
|
#private;
|
|
59
|
-
readonly
|
|
60
|
-
readonly root:
|
|
62
|
+
readonly backend: OwnedUiBackendPort;
|
|
63
|
+
readonly root: OwnedUiSessionShellRoot;
|
|
61
64
|
readonly runtime: PiTuiRuntimeAdapter;
|
|
62
|
-
constructor(options:
|
|
65
|
+
constructor(options: OwnedUiSessionShellOptions);
|
|
63
66
|
view(): OwnedUiSessionViewModel;
|
|
64
67
|
start(): void;
|
|
65
68
|
onView(listener: (view: OwnedUiSessionViewModel) => void): () => void;
|
|
@@ -94,4 +97,4 @@ export declare class PiSessionShell {
|
|
|
94
97
|
showScopedModelsSelector(): void;
|
|
95
98
|
dispose(): Promise<void>;
|
|
96
99
|
}
|
|
97
|
-
|
|
100
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PINNED_PI_HIDDEN_COMMAND_NAMES, PINNED_PI_WORKFLOW_COMMAND_NAMES, } from "
|
|
2
|
-
import { createPiExtensionUiBridge, createPiQueuedInputStatus, createPiShellArmin, createPiShellAuthProviderSelector, createPiShellChangelog, createPiShellDaxnuts, createPiShellDialog, createPiShellEarendilAnnouncement, createPiShellEditor, createPiShellExtensionSelector, createPiShellFooter, createPiShellHeader, createPiShellHotkeys, createPiShellLoadedResources, createPiShellLoginDialog, createPiShellModelSelector, createPiShellOperationLoader, createPiShellReloadBox, createPiShellScopedModelsSelector, createPiShellSelector, createPiShellSessionInfo, createPiShellSessionSelector, createPiShellSettingsSelector, createPiShellStatus, createPiShellTranscriptComponent, createPiShellTreeSelector, createPiShellTrustSelector, createPiShellUserMessageSelector, piTheme, renderPiShellStatusText, renderPiShellTranscriptBlock, } from "
|
|
3
|
-
import { PiTuiRuntimeAdapter, } from "
|
|
4
|
-
export class
|
|
1
|
+
import { PINNED_PI_HIDDEN_COMMAND_NAMES, PINNED_PI_WORKFLOW_COMMAND_NAMES, } from "../pi-engine-adapter/index.js";
|
|
2
|
+
import { createPiExtensionUiBridge, createPiQueuedInputStatus, createPiShellArmin, createPiShellAuthProviderSelector, createPiShellChangelog, createPiShellDaxnuts, createPiShellDialog, createPiShellEarendilAnnouncement, createPiShellEditor, createPiShellExtensionSelector, createPiShellFooter, createPiShellHeader, createPiShellHotkeys, createPiShellLoadedResources, createPiShellLoginDialog, createPiShellModelSelector, createPiShellOperationLoader, createPiShellReloadBox, createPiShellScopedModelsSelector, createPiShellSelector, createPiShellSessionInfo, createPiShellSessionSelector, createPiShellSettingsSelector, createPiShellStatus, createPiShellTranscriptComponent, createPiShellTreeSelector, createPiShellTrustSelector, createPiShellUserMessageSelector, piTheme, renderPiShellStatusText, renderPiShellTranscriptBlock, } from "../pi-component-adapter/index.js";
|
|
3
|
+
import { PiTuiRuntimeAdapter, } from "../pi-tui-runtime-adapter/index.js";
|
|
4
|
+
export class OwnedUiSessionShellRoot {
|
|
5
5
|
editor;
|
|
6
6
|
header;
|
|
7
7
|
resources;
|
|
@@ -495,8 +495,8 @@ function layoutPort(render, invalidate, handleInput) {
|
|
|
495
495
|
...(handleInput === undefined ? {} : { handleInput }),
|
|
496
496
|
};
|
|
497
497
|
}
|
|
498
|
-
function shellResourceEntries(
|
|
499
|
-
const resources =
|
|
498
|
+
function shellResourceEntries(backend) {
|
|
499
|
+
const resources = backend.nonVisualResources().map(resource => ({
|
|
500
500
|
section: resource.kind === "skill"
|
|
501
501
|
? "Skills"
|
|
502
502
|
: resource.kind === "prompt-template"
|
|
@@ -512,7 +512,7 @@ function shellResourceEntries(adapter) {
|
|
|
512
512
|
sourcePath: resource.sourcePath,
|
|
513
513
|
diagnostic: resource.diagnostic,
|
|
514
514
|
}));
|
|
515
|
-
for (const extension of
|
|
515
|
+
for (const extension of backend.extensionResources()) {
|
|
516
516
|
if (extension.hidden)
|
|
517
517
|
continue;
|
|
518
518
|
resources.push({
|
|
@@ -531,8 +531,8 @@ function compactResourceLabel(path) {
|
|
|
531
531
|
return segments.at(-2) ?? leaf;
|
|
532
532
|
return leaf;
|
|
533
533
|
}
|
|
534
|
-
export class
|
|
535
|
-
|
|
534
|
+
export class OwnedUiSessionShell {
|
|
535
|
+
backend;
|
|
536
536
|
root;
|
|
537
537
|
runtime;
|
|
538
538
|
#cwd;
|
|
@@ -551,14 +551,14 @@ export class PiSessionShell {
|
|
|
551
551
|
#activeLoginDialog;
|
|
552
552
|
#sessionGeneration;
|
|
553
553
|
constructor(options) {
|
|
554
|
-
this.
|
|
555
|
-
this.#sessionGeneration = this.
|
|
554
|
+
this.backend = options.backend;
|
|
555
|
+
this.#sessionGeneration = this.backend.sessionGeneration;
|
|
556
556
|
this.#cwd = options.cwd;
|
|
557
557
|
this.#stopped = new Promise(resolve => {
|
|
558
558
|
this.#resolveStopped = resolve;
|
|
559
559
|
});
|
|
560
560
|
let runtime;
|
|
561
|
-
this.root = new
|
|
561
|
+
this.root = new OwnedUiSessionShellRoot(this.backend.view(), options.cwd, {
|
|
562
562
|
getColumns: () => runtime?.viewport().columns ?? options.terminal?.columns ?? 80,
|
|
563
563
|
getRows: () => runtime?.viewport().rows ?? options.terminal?.rows ?? 24,
|
|
564
564
|
requestRender: () => runtime?.requestRender(),
|
|
@@ -578,15 +578,15 @@ export class PiSessionShell {
|
|
|
578
578
|
onDequeue: () => this.restoreQueuedInput(),
|
|
579
579
|
}, {
|
|
580
580
|
...options.startup,
|
|
581
|
-
resources: options.startup?.resources ?? shellResourceEntries(this.
|
|
582
|
-
}, this.
|
|
583
|
-
getMessageRenderer: customType => this.
|
|
584
|
-
getToolDefinition: toolName => this.
|
|
581
|
+
resources: options.startup?.resources ?? shellResourceEntries(this.backend),
|
|
582
|
+
}, this.backend.agentDir, {
|
|
583
|
+
getMessageRenderer: customType => this.backend.pinnedMessageRenderer(customType),
|
|
584
|
+
getToolDefinition: toolName => this.backend.pinnedToolDefinition(toolName),
|
|
585
585
|
});
|
|
586
|
-
const tuiMode = this.
|
|
586
|
+
const tuiMode = this.backend.disposed ? "regular" : this.backend.pinnedSettingsSnapshot().tuiMode;
|
|
587
587
|
const runtimeOptions = options.terminal === undefined
|
|
588
|
-
? { root: this.root, mode: tuiMode, layoutRoot: this.root.layoutRoot(), hardwareCursor: this.
|
|
589
|
-
: { root: this.root, mode: tuiMode, layoutRoot: this.root.layoutRoot(), terminal: options.terminal, hardwareCursor: this.
|
|
588
|
+
? { root: this.root, mode: tuiMode, layoutRoot: this.root.layoutRoot(), hardwareCursor: this.backend.view().terminal.hardwareCursor }
|
|
589
|
+
: { root: this.root, mode: tuiMode, layoutRoot: this.root.layoutRoot(), terminal: options.terminal, hardwareCursor: this.backend.view().terminal.hardwareCursor };
|
|
590
590
|
runtime = new PiTuiRuntimeAdapter(runtimeOptions);
|
|
591
591
|
this.runtime = runtime;
|
|
592
592
|
this.#extensionBridge = createPiExtensionUiBridge({
|
|
@@ -595,7 +595,7 @@ export class PiSessionShell {
|
|
|
595
595
|
getRows: () => this.runtime.viewport().rows,
|
|
596
596
|
requestRender: () => this.runtime.requestRender(),
|
|
597
597
|
},
|
|
598
|
-
agentDir: this.
|
|
598
|
+
agentDir: this.backend.agentDir,
|
|
599
599
|
setInputSurface: component => this.root.setInputSurface(component),
|
|
600
600
|
showOverlay: (component, overlayOptions) => this.runtime.showOverlay(component, overlayOptions),
|
|
601
601
|
listenInput: handler => this.runtime.addInputListener(handler),
|
|
@@ -615,32 +615,32 @@ export class PiSessionShell {
|
|
|
615
615
|
getToolsExpanded: () => this.root.toolsExpanded,
|
|
616
616
|
setToolsExpanded: expanded => this.root.setToolsExpanded(expanded),
|
|
617
617
|
});
|
|
618
|
-
this.
|
|
618
|
+
this.backend.setWorkflowInteractionHost({
|
|
619
619
|
startLogin: request => this.#startWorkflowLogin(request),
|
|
620
620
|
prompt: request => this.#requestWorkflowInput(request),
|
|
621
621
|
notify: event => this.#notifyWorkflowLogin(event),
|
|
622
622
|
finishLogin: () => this.#finishWorkflowLogin(),
|
|
623
623
|
});
|
|
624
|
-
this.root.editor.setAutocompleteCommands(this.
|
|
625
|
-
this.#unsubscribe = this.
|
|
624
|
+
this.root.editor.setAutocompleteCommands(this.backend.workflowAutocompleteCommands());
|
|
625
|
+
this.#unsubscribe = this.backend.onEvent(event => {
|
|
626
626
|
this.#syncView();
|
|
627
627
|
if (this.view().lifecycle === "ready" && this.#compactionQueue.length > 0)
|
|
628
628
|
void this.#flushCompactionQueue();
|
|
629
629
|
if (event.type === "session-lifecycle" && event.lifecycle === "stopped")
|
|
630
630
|
this.#resolveStopped?.();
|
|
631
631
|
});
|
|
632
|
-
if (this.
|
|
632
|
+
if (this.backend.view().lifecycle === "stopped")
|
|
633
633
|
this.#resolveStopped?.();
|
|
634
634
|
}
|
|
635
635
|
view() {
|
|
636
|
-
return this.
|
|
636
|
+
return this.backend.view();
|
|
637
637
|
}
|
|
638
638
|
start() {
|
|
639
639
|
if (this.#started)
|
|
640
640
|
return;
|
|
641
641
|
this.#started = true;
|
|
642
642
|
this.runtime.start();
|
|
643
|
-
void this.
|
|
643
|
+
void this.backend.bindExtensionUi(this.#extensionBridge.context, () => { void this.shutdown(); });
|
|
644
644
|
this.#syncView();
|
|
645
645
|
}
|
|
646
646
|
onView(listener) {
|
|
@@ -663,7 +663,7 @@ export class PiSessionShell {
|
|
|
663
663
|
if (command) {
|
|
664
664
|
this.root.editor.addToHistory(input);
|
|
665
665
|
try {
|
|
666
|
-
const result = await this.
|
|
666
|
+
const result = await this.backend.executeBashWorkflow(command, excludeFromContext);
|
|
667
667
|
const workflow = {
|
|
668
668
|
command: "debug",
|
|
669
669
|
outcome: result.cancelled ? "cancelled" : result.exitCode === 0 || result.exitCode === undefined ? "completed" : "failed",
|
|
@@ -694,7 +694,7 @@ export class PiSessionShell {
|
|
|
694
694
|
return this.#execute({
|
|
695
695
|
type,
|
|
696
696
|
correlationId: this.#correlation(type),
|
|
697
|
-
sessionId: this.
|
|
697
|
+
sessionId: this.backend.sessionId,
|
|
698
698
|
text: input,
|
|
699
699
|
});
|
|
700
700
|
}
|
|
@@ -731,7 +731,7 @@ export class PiSessionShell {
|
|
|
731
731
|
return this.#execute({
|
|
732
732
|
type: "resume-session",
|
|
733
733
|
correlationId: this.#correlation("resume"),
|
|
734
|
-
sessionId: this.
|
|
734
|
+
sessionId: this.backend.sessionId,
|
|
735
735
|
sessionPath,
|
|
736
736
|
});
|
|
737
737
|
}
|
|
@@ -739,7 +739,7 @@ export class PiSessionShell {
|
|
|
739
739
|
return this.#execute({
|
|
740
740
|
type: "set-model",
|
|
741
741
|
correlationId: this.#correlation("model"),
|
|
742
|
-
sessionId: this.
|
|
742
|
+
sessionId: this.backend.sessionId,
|
|
743
743
|
model: { providerId, modelId, displayName: modelId },
|
|
744
744
|
});
|
|
745
745
|
}
|
|
@@ -747,7 +747,7 @@ export class PiSessionShell {
|
|
|
747
747
|
return this.#execute({
|
|
748
748
|
type: "set-thinking-level",
|
|
749
749
|
correlationId: this.#correlation("thinking"),
|
|
750
|
-
sessionId: this.
|
|
750
|
+
sessionId: this.backend.sessionId,
|
|
751
751
|
thinkingLevel,
|
|
752
752
|
});
|
|
753
753
|
}
|
|
@@ -757,7 +757,7 @@ export class PiSessionShell {
|
|
|
757
757
|
return this.setThinkingLevel(levels[(current + 1) % levels.length] ?? "off");
|
|
758
758
|
}
|
|
759
759
|
async cycleModel(direction) {
|
|
760
|
-
const result = await this.
|
|
760
|
+
const result = await this.backend.cycleModelWorkflow(direction);
|
|
761
761
|
this.root.appendWorkflowResult(result);
|
|
762
762
|
if (result.outcome === "completed")
|
|
763
763
|
this.#showDaxnutsForActiveModel();
|
|
@@ -777,12 +777,12 @@ export class PiSessionShell {
|
|
|
777
777
|
return this.#execute({
|
|
778
778
|
type: "follow-up",
|
|
779
779
|
correlationId: this.#correlation("follow-up"),
|
|
780
|
-
sessionId: this.
|
|
780
|
+
sessionId: this.backend.sessionId,
|
|
781
781
|
text,
|
|
782
782
|
});
|
|
783
783
|
}
|
|
784
784
|
restoreQueuedInput() {
|
|
785
|
-
const queued = [...this.
|
|
785
|
+
const queued = [...this.backend.clearQueuedWorkflows(), ...this.#compactionQueue.map(item => item.text)];
|
|
786
786
|
this.#compactionQueue = [];
|
|
787
787
|
if (queued.length === 0)
|
|
788
788
|
return;
|
|
@@ -810,7 +810,7 @@ export class PiSessionShell {
|
|
|
810
810
|
return handle;
|
|
811
811
|
}
|
|
812
812
|
showModelSelector() {
|
|
813
|
-
const context = this.
|
|
813
|
+
const context = this.backend.pinnedModelSelectorContext();
|
|
814
814
|
const close = () => {
|
|
815
815
|
this.root.setInputSurface(null);
|
|
816
816
|
this.runtime.requestRender();
|
|
@@ -832,7 +832,7 @@ export class PiSessionShell {
|
|
|
832
832
|
this.runtime.requestRender();
|
|
833
833
|
}
|
|
834
834
|
showForkSelector() {
|
|
835
|
-
const options = this.
|
|
835
|
+
const options = this.backend.pinnedForkOptions();
|
|
836
836
|
if (options.length === 0) {
|
|
837
837
|
this.root.appendWorkflowResult({ command: "fork", outcome: "failed", message: "No user messages available to fork from" });
|
|
838
838
|
this.runtime.requestRender();
|
|
@@ -850,7 +850,7 @@ export class PiSessionShell {
|
|
|
850
850
|
this.runtime.requestRender();
|
|
851
851
|
}
|
|
852
852
|
async showLogoutSelector() {
|
|
853
|
-
const options = await this.
|
|
853
|
+
const options = await this.backend.pinnedLogoutOptions();
|
|
854
854
|
if (options.length === 0) {
|
|
855
855
|
this.root.appendWorkflowStatus("No authenticated providers available.");
|
|
856
856
|
this.runtime.requestRender();
|
|
@@ -868,7 +868,7 @@ export class PiSessionShell {
|
|
|
868
868
|
this.runtime.requestRender();
|
|
869
869
|
}
|
|
870
870
|
showLoginMethodSelector(providerReference) {
|
|
871
|
-
const method = this.
|
|
871
|
+
const method = this.backend.pinnedLoginMethodOptions(providerReference);
|
|
872
872
|
if (method.options.length === 0) {
|
|
873
873
|
this.root.appendWorkflowResult({ command: "login", outcome: "failed", message: `No authentication methods available for ${providerReference}` });
|
|
874
874
|
this.runtime.requestRender();
|
|
@@ -896,7 +896,7 @@ export class PiSessionShell {
|
|
|
896
896
|
this.runtime.requestRender();
|
|
897
897
|
}
|
|
898
898
|
showTreeSelector(initialSelectedId) {
|
|
899
|
-
const context = this.
|
|
899
|
+
const context = this.backend.pinnedTreeSelectorContext();
|
|
900
900
|
if (context.tree.length === 0) {
|
|
901
901
|
this.root.appendWorkflowStatus("No entries in session");
|
|
902
902
|
this.runtime.requestRender();
|
|
@@ -941,7 +941,7 @@ export class PiSessionShell {
|
|
|
941
941
|
this.runtime.requestRender();
|
|
942
942
|
}
|
|
943
943
|
showLoginProviderSelector(authType) {
|
|
944
|
-
const options = this.
|
|
944
|
+
const options = this.backend.pinnedLoginOptions(authType);
|
|
945
945
|
if (options.length === 0) {
|
|
946
946
|
this.root.appendWorkflowStatus(authType === "oauth" ? "No subscription providers available." : "No API key providers available.");
|
|
947
947
|
this.runtime.requestRender();
|
|
@@ -962,7 +962,7 @@ export class PiSessionShell {
|
|
|
962
962
|
this.runtime.requestRender();
|
|
963
963
|
}
|
|
964
964
|
showSessionSelector() {
|
|
965
|
-
const context = this.
|
|
965
|
+
const context = this.backend.pinnedSessionSelectorContext();
|
|
966
966
|
const close = () => {
|
|
967
967
|
this.root.setInputSurface(null);
|
|
968
968
|
this.runtime.requestRender();
|
|
@@ -987,7 +987,7 @@ export class PiSessionShell {
|
|
|
987
987
|
this.runtime.requestRender();
|
|
988
988
|
}
|
|
989
989
|
showSettingsSelector() {
|
|
990
|
-
const snapshot = this.
|
|
990
|
+
const snapshot = this.backend.pinnedSettingsSnapshot();
|
|
991
991
|
const close = () => {
|
|
992
992
|
this.root.setInputSurface(null);
|
|
993
993
|
this.runtime.requestRender();
|
|
@@ -1013,7 +1013,7 @@ export class PiSessionShell {
|
|
|
1013
1013
|
return;
|
|
1014
1014
|
}
|
|
1015
1015
|
}
|
|
1016
|
-
const result = this.
|
|
1016
|
+
const result = this.backend.applyPinnedSettingValue(callback, value);
|
|
1017
1017
|
if (result.outcome === "failed")
|
|
1018
1018
|
this.root.appendWorkflowResult(result);
|
|
1019
1019
|
else if (callback === "onTuiModeChange")
|
|
@@ -1091,7 +1091,7 @@ export class PiSessionShell {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
let result;
|
|
1093
1093
|
try {
|
|
1094
|
-
result = await this.
|
|
1094
|
+
result = await this.backend.executeWorkflow(request);
|
|
1095
1095
|
}
|
|
1096
1096
|
finally {
|
|
1097
1097
|
if (operationSurface) {
|
|
@@ -1109,7 +1109,7 @@ export class PiSessionShell {
|
|
|
1109
1109
|
return { outcome: "failed", diagnostic: `Owned controller missing for ${request.command}` };
|
|
1110
1110
|
}
|
|
1111
1111
|
if (request.command === "reload" && result.outcome === "completed") {
|
|
1112
|
-
this.root.editor.setAutocompleteCommands(this.
|
|
1112
|
+
this.root.editor.setAutocompleteCommands(this.backend.workflowAutocompleteCommands());
|
|
1113
1113
|
}
|
|
1114
1114
|
this.root.appendWorkflowResult(result);
|
|
1115
1115
|
if (request.command === "model" && result.outcome === "completed")
|
|
@@ -1118,7 +1118,7 @@ export class PiSessionShell {
|
|
|
1118
1118
|
return workflowAdapterResult(result);
|
|
1119
1119
|
}
|
|
1120
1120
|
showTrustSelector() {
|
|
1121
|
-
const context = this.
|
|
1121
|
+
const context = this.backend.pinnedProjectTrustContext();
|
|
1122
1122
|
const close = () => {
|
|
1123
1123
|
this.root.setInputSurface(null);
|
|
1124
1124
|
this.runtime.requestRender();
|
|
@@ -1127,7 +1127,7 @@ export class PiSessionShell {
|
|
|
1127
1127
|
...context,
|
|
1128
1128
|
onSelect: selection => {
|
|
1129
1129
|
try {
|
|
1130
|
-
this.
|
|
1130
|
+
this.backend.persistProjectTrust(selection.updates);
|
|
1131
1131
|
close();
|
|
1132
1132
|
this.root.appendWorkflowStatus(`Saved trust decision: ${selection.trusted ? "trusted" : "untrusted"}. Restart pi for this to take effect.`);
|
|
1133
1133
|
}
|
|
@@ -1143,7 +1143,7 @@ export class PiSessionShell {
|
|
|
1143
1143
|
this.runtime.requestRender();
|
|
1144
1144
|
}
|
|
1145
1145
|
showScopedModelsSelector() {
|
|
1146
|
-
const initial = this.
|
|
1146
|
+
const initial = this.backend.pinnedScopedModelsContext();
|
|
1147
1147
|
let currentEnabledIds = initial.enabledModelIds === null ? null : [...initial.enabledModelIds];
|
|
1148
1148
|
let selectionChanged = false;
|
|
1149
1149
|
let disposed = false;
|
|
@@ -1167,12 +1167,12 @@ export class PiSessionShell {
|
|
|
1167
1167
|
onChange: enabledIds => {
|
|
1168
1168
|
selectionChanged = true;
|
|
1169
1169
|
currentEnabledIds = enabledIds === null ? null : [...enabledIds];
|
|
1170
|
-
this.
|
|
1170
|
+
this.backend.updateScopedModels(currentEnabledIds);
|
|
1171
1171
|
this.runtime.requestRender();
|
|
1172
1172
|
},
|
|
1173
1173
|
onPersist: enabledIds => {
|
|
1174
1174
|
currentEnabledIds = enabledIds === null ? null : [...enabledIds];
|
|
1175
|
-
this.
|
|
1175
|
+
this.backend.persistScopedModels(currentEnabledIds);
|
|
1176
1176
|
this.root.appendWorkflowStatus("Model selection saved to settings");
|
|
1177
1177
|
this.runtime.requestRender();
|
|
1178
1178
|
},
|
|
@@ -1189,7 +1189,7 @@ export class PiSessionShell {
|
|
|
1189
1189
|
};
|
|
1190
1190
|
this.root.setInputSurface(component);
|
|
1191
1191
|
this.runtime.requestRender();
|
|
1192
|
-
void this.
|
|
1192
|
+
void this.backend.refreshScopedModels(controller.signal).then(refreshed => {
|
|
1193
1193
|
if (disposed)
|
|
1194
1194
|
return;
|
|
1195
1195
|
if (!selectionChanged) {
|
|
@@ -1198,7 +1198,7 @@ export class PiSessionShell {
|
|
|
1198
1198
|
}
|
|
1199
1199
|
else {
|
|
1200
1200
|
component.updateModels(refreshed.models);
|
|
1201
|
-
this.
|
|
1201
|
+
this.backend.updateScopedModels(currentEnabledIds);
|
|
1202
1202
|
}
|
|
1203
1203
|
component.setRefreshStatus(timedOut ? "Model refresh timed out; showing cached models." : refreshed.status, timedOut ? "warning" : refreshed.statusKind);
|
|
1204
1204
|
this.runtime.requestRender();
|
|
@@ -1223,14 +1223,14 @@ export class PiSessionShell {
|
|
|
1223
1223
|
this.#disposed = true;
|
|
1224
1224
|
this.#unsubscribe();
|
|
1225
1225
|
this.#dialogHandle?.hide();
|
|
1226
|
-
await this.
|
|
1226
|
+
await this.backend.unbindExtensionUi();
|
|
1227
1227
|
this.#extensionBridge.dispose();
|
|
1228
1228
|
await this.runtime.dispose();
|
|
1229
1229
|
}
|
|
1230
1230
|
#syncView() {
|
|
1231
1231
|
const view = this.view();
|
|
1232
|
-
if (this.
|
|
1233
|
-
this.#sessionGeneration = this.
|
|
1232
|
+
if (this.backend.sessionGeneration !== this.#sessionGeneration) {
|
|
1233
|
+
this.#sessionGeneration = this.backend.sessionGeneration;
|
|
1234
1234
|
this.#activeLoginDialog = undefined;
|
|
1235
1235
|
this.#extensionBridge.reset();
|
|
1236
1236
|
this.root.setInputSurface(null);
|
|
@@ -1280,7 +1280,7 @@ export class PiSessionShell {
|
|
|
1280
1280
|
return this.#execute({
|
|
1281
1281
|
type: this.view().lifecycle === "busy" ? "steer" : "prompt",
|
|
1282
1282
|
correlationId: this.#correlation("prompt-command"),
|
|
1283
|
-
sessionId: this.
|
|
1283
|
+
sessionId: this.backend.sessionId,
|
|
1284
1284
|
text,
|
|
1285
1285
|
});
|
|
1286
1286
|
}
|
|
@@ -1396,16 +1396,16 @@ export class PiSessionShell {
|
|
|
1396
1396
|
await this.#execute({
|
|
1397
1397
|
type: item.type,
|
|
1398
1398
|
correlationId: this.#correlation(`compaction-${item.type}`),
|
|
1399
|
-
sessionId: this.
|
|
1399
|
+
sessionId: this.backend.sessionId,
|
|
1400
1400
|
text: item.text,
|
|
1401
1401
|
});
|
|
1402
1402
|
}
|
|
1403
1403
|
}
|
|
1404
1404
|
async #execute(command) {
|
|
1405
|
-
return this.
|
|
1405
|
+
return this.backend.execute(command);
|
|
1406
1406
|
}
|
|
1407
1407
|
#simple(type) {
|
|
1408
|
-
return { type, correlationId: this.#correlation(type), sessionId: this.
|
|
1408
|
+
return { type, correlationId: this.#correlation(type), sessionId: this.backend.sessionId };
|
|
1409
1409
|
}
|
|
1410
1410
|
#correlation(prefix) {
|
|
1411
1411
|
this.#sequence += 1;
|
|
@@ -1434,4 +1434,3 @@ function isWorkflowRoute(value) {
|
|
|
1434
1434
|
return PINNED_PI_WORKFLOW_COMMAND_NAMES.includes(value)
|
|
1435
1435
|
|| PINNED_PI_HIDDEN_COMMAND_NAMES.includes(value);
|
|
1436
1436
|
}
|
|
1437
|
-
//# sourceMappingURL=pi-session-shell.js.map
|