@timurproko/a1 0.1.8-dev.472 → 0.1.8-dev.508
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/bin/cli.js +4 -5
- package/bin/guardian.js +5 -1
- package/bin/module-identity.js +53 -98
- package/bin/module-resolver.js +138 -0
- package/bin/pinned-pi-public.js +25 -6
- package/bin/ui.js +7 -2
- package/bin/update-recovery.js +76 -7
- package/bin/warmup.js +3 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/clipboard-diagnostics.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/clipboard-image.js +1 -1
- package/dist/app/session-shell/helper-pool.d.ts +33 -0
- package/dist/app/session-shell/helper-pool.js +98 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-preparation-client.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-preparation-client.js +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-preparation.js +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-source.js +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-worker.js +1 -1
- package/dist/app/session-shell/index.d.ts +7 -0
- package/dist/app/session-shell/index.js +4 -0
- package/dist/app/session-shell/paste-executor.d.ts +18 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-executor.js +50 -29
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-helper.js +1 -1
- package/dist/app/session-shell/paste-preparation-client.d.ts +31 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-preparation-client.js +19 -8
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-protocol.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-protocol.js +1 -1
- package/dist/app/session-shell/paste-text-preparation.d.ts +6 -0
- package/dist/{integrations/pi/session-ui/paste-text-preparation.d.ts → app/session-shell/paste-types.d.ts} +1 -4
- package/dist/{integrations/pi/session-ui → app/session-shell}/path-chip-presentation.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-chips.d.ts +5 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-chips.js +6 -2
- package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-history-controller.d.ts +2 -2
- package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-history-controller.js +2 -2
- package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-suggestion-controller.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-suggestion-controller.js +2 -2
- package/dist/{integrations/pi/session-ui → app/session-shell}/quit-outro.js +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-coordinator.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-coordinator.js +3 -5
- package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-helper.js +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-protocol.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-transport.d.ts +10 -2
- package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-transport.js +45 -19
- package/dist/{integrations/pi/session-ui → app/session-shell}/session-shell-root.d.ts +75 -53
- package/dist/{integrations/pi/session-ui → app/session-shell}/session-shell-root.js +30 -20
- package/dist/{integrations/pi/session-ui → app/session-shell}/session-shell.d.ts +9 -8
- package/dist/{integrations/pi/session-ui → app/session-shell}/session-shell.js +108 -67
- package/dist/{integrations/pi/session-ui → app/session-shell}/session-viewport-controller.d.ts +5 -5
- package/dist/{integrations/pi/session-ui → app/session-shell}/session-viewport-controller.js +5 -5
- package/dist/{integrations/pi/session-ui → app/session-shell}/system-clipboard.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/system-clipboard.js +1 -1
- package/dist/cli/index.d.ts +8 -5
- package/dist/cli/index.js +4 -5
- package/dist/composition/index.d.ts +0 -1
- package/dist/composition/index.js +0 -1
- package/dist/composition/owned-ui.d.ts +2 -2
- package/dist/composition/owned-ui.js +35 -36
- package/dist/composition/settings-route-host.d.ts +2 -2
- package/dist/contracts/agent-engine/domain.d.ts +6 -1
- package/dist/contracts/agent-engine/index.d.ts +11 -8
- package/dist/contracts/agent-engine/index.js +6 -8
- package/dist/contracts/owned-ui/extension-ui.d.ts +8 -0
- package/dist/contracts/owned-ui/index.d.ts +12 -8
- package/dist/contracts/owned-ui/index.js +8 -8
- package/dist/features/launch/index.d.ts +12 -6
- package/dist/features/launch/index.js +6 -6
- package/dist/features/launch/intent.d.ts +5 -5
- package/dist/features/launch/intent.js +2 -2
- package/dist/features/owned-ui/index.d.ts +6 -6
- package/dist/features/owned-ui/index.js +4 -6
- package/dist/features/owned-ui/run.d.ts +2 -2
- package/dist/features/owned-ui/settings-app.d.ts +2 -2
- package/dist/features/owned-ui/settings-app.js +18 -5
- package/dist/features/prompt-history/service.d.ts +1 -1
- package/dist/features/prompt-history/service.js +1 -1
- package/dist/features/prompt-history/store.js +3 -7
- package/dist/features/prompt-suggestions/diagnostics.js +1 -1
- package/dist/features/prompt-suggestions/index.d.ts +2 -1
- package/dist/features/prompt-suggestions/index.js +1 -1
- package/dist/foundation/launch-guardian/index.d.ts +2 -1
- package/dist/foundation/launch-guardian/index.js +1 -1
- package/dist/foundation/lifecycle/index.d.ts +11 -6
- package/dist/foundation/lifecycle/index.js +5 -6
- package/dist/foundation/process-containment/index.d.ts +8 -6
- package/dist/foundation/process-containment/index.js +6 -6
- package/dist/foundation/process-containment/native-guardian-containment.js +3 -3
- package/dist/foundation/protocol/index.d.ts +3 -2
- package/dist/foundation/protocol/index.js +2 -2
- package/dist/foundation/release/bootstrap.d.ts +0 -4
- package/dist/foundation/release/bootstrap.js +1 -82
- package/dist/foundation/release/dependency-layer.d.ts +2 -5
- package/dist/foundation/release/endpoints.d.ts +4 -0
- package/dist/foundation/release/endpoints.js +86 -2
- package/dist/foundation/release/index.d.ts +30 -16
- package/dist/foundation/release/index.js +16 -16
- package/dist/foundation/release/release.d.ts +1 -1
- package/dist/foundation/release/types.d.ts +11 -0
- package/dist/foundation/release/types.js +1 -0
- package/dist/foundation/release/update-transaction.d.ts +1 -1
- package/dist/foundation/release/update.d.ts +2 -1
- package/dist/foundation/release/update.js +3 -18
- package/dist/foundation/startup/index.d.ts +4 -2
- package/dist/foundation/startup/index.js +2 -2
- package/dist/foundation/startup/startup-descriptor.js +2 -2
- package/dist/foundation/storage/control-store.d.ts +1 -45
- package/dist/foundation/storage/control-store.js +54 -277
- package/dist/foundation/storage/index.d.ts +1 -1
- package/dist/foundation/storage/index.js +1 -1
- package/dist/foundation/supervision/index.d.ts +2 -2
- package/dist/foundation/supervision/index.js +2 -2
- package/dist/foundation/supervision/server.d.ts +5 -10
- package/dist/foundation/supervision/server.js +7 -7
- package/dist/foundation/terminal-cleanup/index.d.ts +3 -2
- package/dist/foundation/terminal-cleanup/index.js +2 -2
- package/dist/integrations/pi/components/editor-interaction.d.ts +1 -1
- package/dist/integrations/pi/components/history-editor-loader.d.ts +1 -1
- package/dist/integrations/pi/components/index.d.ts +20 -13
- package/dist/integrations/pi/components/index.js +12 -13
- package/dist/integrations/pi/components/owned-editor-ux.js +5 -8
- package/dist/integrations/pi/components/resources/builtin-themes.d.ts +7 -5
- package/dist/integrations/pi/components/resources/builtin-themes.js +7 -5
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +1 -1
- package/dist/integrations/pi/components/shell-extension-ui.js +2 -1
- package/dist/integrations/pi/components/shell-footer-status.js +1 -1
- package/dist/integrations/pi/components/shell-presenters-info.d.ts +1 -1
- package/dist/integrations/pi/components/shell-presenters-info.js +1 -1
- package/dist/integrations/pi/components/shell-presenters-transcript.js +1 -1
- package/dist/integrations/pi/components/shell-selectors-dialogs.d.ts +9 -3
- package/dist/integrations/pi/components/shell-selectors-dialogs.js +9 -6
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +3 -1
- package/dist/integrations/pi/components/shell-shared-facade.js +4 -2
- package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +1 -1
- package/dist/integrations/pi/components/submitted-prompt-adapter.js +1 -1
- package/dist/integrations/pi/components/tool-image-presentation.d.ts +1 -1
- package/dist/integrations/pi/components/tool-image-presentation.js +4 -7
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +36 -22
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +43 -7
- package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
- package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +6 -3
- package/dist/integrations/pi/components/upstream/components/daxnuts.d.ts +8 -1
- package/dist/integrations/pi/components/upstream/components/daxnuts.js +7 -3
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +10 -4
- package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +7 -4
- package/dist/integrations/pi/components/upstream/components/extension-editor.js +7 -4
- package/dist/integrations/pi/components/upstream/components/mermaid.js +8 -4
- package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +9 -5
- package/dist/integrations/pi/components/upstream/components/owned-editor.js +10 -6
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +8 -4
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +27 -25
- package/dist/integrations/pi/components/upstream/components/session-footer.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/session-footer.js +8 -10
- package/dist/integrations/pi/components/upstream/components/session-selector-search.js +6 -4
- package/dist/integrations/pi/components/upstream/components/session-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector.js +8 -4
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +7 -5
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +8 -6
- package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +9 -4
- package/dist/integrations/pi/components/upstream/components/status-indicator.js +15 -5
- package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +8 -2
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +58 -37
- package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +7 -4
- package/dist/integrations/pi/components/upstream/components/tree-selector.js +7 -4
- package/dist/integrations/pi/components/upstream/components/trust-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/trust-selector.js +10 -5
- package/dist/integrations/pi/components/upstream/external-editor.js +8 -4
- package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +13 -4
- package/dist/integrations/pi/components/upstream/history/editor-core.js +112 -30
- package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +6 -3
- package/dist/integrations/pi/components/upstream/history/kill-ring.js +6 -3
- package/dist/integrations/pi/components/upstream/history/printable-key.js +7 -4
- package/dist/integrations/pi/components/upstream/history/text-helpers.js +6 -3
- package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +6 -3
- package/dist/integrations/pi/components/upstream/history/undo-stack.js +6 -3
- package/dist/integrations/pi/components/upstream/history/word-navigation.js +6 -3
- package/dist/integrations/pi/components/upstream/model-search.d.ts +5 -2
- package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +8 -0
- package/dist/integrations/pi/components/upstream/theme/theme-controller.js +0 -3
- package/dist/integrations/pi/components/upstream/theme/theme.d.ts +2 -2
- package/dist/integrations/pi/components/upstream/theme/theme.js +17 -6
- package/dist/integrations/pi/engine/adapter.d.ts +39 -138
- package/dist/integrations/pi/engine/adapter.js +338 -3226
- package/dist/integrations/pi/engine/command-dispatch.d.ts +41 -0
- package/dist/integrations/pi/engine/command-dispatch.js +125 -0
- package/dist/integrations/pi/engine/event-delivery.d.ts +100 -0
- package/dist/integrations/pi/engine/event-delivery.js +184 -0
- package/dist/integrations/pi/engine/extension-ui-binding.d.ts +35 -0
- package/dist/integrations/pi/engine/extension-ui-binding.js +81 -0
- package/dist/integrations/pi/engine/index.d.ts +18 -14
- package/dist/integrations/pi/engine/index.js +10 -14
- package/dist/integrations/pi/engine/message-values.d.ts +29 -0
- package/dist/integrations/pi/engine/message-values.js +168 -0
- package/dist/integrations/pi/engine/pending-delivery.d.ts +2 -2
- package/dist/integrations/pi/engine/pending-delivery.js +2 -4
- package/dist/integrations/pi/engine/pi-settings-metadata.json +382 -371
- package/dist/integrations/pi/engine/prompt-suggestions.d.ts +30 -0
- package/dist/integrations/pi/engine/prompt-suggestions.js +102 -0
- package/dist/integrations/pi/engine/provider-authentication.d.ts +34 -0
- package/dist/integrations/pi/engine/provider-authentication.js +209 -0
- package/dist/integrations/pi/engine/resource-catalog.d.ts +49 -0
- package/dist/integrations/pi/engine/resource-catalog.js +289 -0
- package/dist/integrations/pi/engine/resources/changelog.json +4 -4
- package/dist/integrations/pi/engine/session-events.d.ts +48 -0
- package/dist/integrations/pi/engine/session-events.js +223 -0
- package/dist/integrations/pi/engine/session-integration.js +2 -4
- package/dist/integrations/pi/engine/session-runtime.d.ts +84 -0
- package/dist/integrations/pi/engine/session-runtime.js +249 -0
- package/dist/integrations/pi/engine/{settings-effects.d.ts → settings-bridge.d.ts} +57 -2
- package/dist/integrations/pi/engine/settings-bridge.js +514 -0
- package/dist/integrations/pi/engine/settings-metadata.d.ts +31 -0
- package/dist/integrations/pi/engine/settings-metadata.js +67 -0
- package/dist/integrations/pi/engine/settings-port.d.ts +42 -0
- package/dist/integrations/pi/engine/settings-port.js +353 -0
- package/dist/integrations/pi/engine/transcript-projection.d.ts +39 -0
- package/dist/integrations/pi/engine/transcript-projection.js +405 -0
- package/dist/integrations/pi/engine/usage-view.d.ts +4 -0
- package/dist/integrations/pi/engine/usage-view.js +56 -0
- package/dist/integrations/pi/engine/workflow-contexts.d.ts +59 -0
- package/dist/integrations/pi/engine/workflow-contexts.js +316 -0
- package/dist/integrations/pi/engine/workflow-runner.d.ts +60 -0
- package/dist/integrations/pi/engine/workflow-runner.js +509 -0
- package/dist/integrations/pi/engine/workflow-support.d.ts +33 -0
- package/dist/integrations/pi/engine/workflow-support.js +352 -0
- package/dist/integrations/pi/engine/workflows.d.ts +63 -2
- package/dist/integrations/pi/engine/workflows.js +5 -2
- package/dist/integrations/pi/startup-public.js +576 -554
- package/dist/integrations/pi/startup-public.manifest.json +1730 -984
- package/dist/integrations/pi/tui-runtime/adapter.js +10 -13
- package/dist/integrations/pi/tui-runtime/contracts.d.ts +11 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +1 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +4 -7
- package/dist/integrations/pi/tui-runtime/index.d.ts +8 -6
- package/dist/integrations/pi/tui-runtime/index.js +4 -6
- package/dist/integrations/pi/tui-runtime/mouse-report-input.js +2 -4
- package/dist/integrations/pi/tui-runtime/overlay-geometry.d.ts +2 -2
- package/dist/integrations/pi/tui-runtime/overlay-geometry.js +4 -5
- package/dist/integrations/pi/tui-runtime/presentation-adapter.js +1 -1
- package/dist/native/darwin-arm64/manifest.json +1 -1
- package/dist/native/linux-x64/manifest.json +1 -1
- package/dist/native/win32-x64/manifest.json +2 -2
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/runtime-payload-inventory.json +51320 -46509
- package/dist/ui/apps/index.d.ts +5 -3
- package/dist/ui/apps/index.js +3 -3
- package/dist/ui/components/index.d.ts +47 -25
- package/dist/ui/components/index.js +25 -25
- package/dist/ui/components/prompt-input.js +1 -4
- package/dist/ui/settings/declarations.d.ts +119 -0
- package/dist/ui/settings/declarations.js +20 -11
- package/dist/ui/settings/index.d.ts +10 -6
- package/dist/ui/settings/index.js +5 -6
- package/dist/ui/settings/manager.d.ts +54 -0
- package/dist/ui/settings/{session.js → manager.js} +101 -9
- package/dist/ui/settings/sections.d.ts +2 -7
- package/docs/architecture/boundaries.md +4 -4
- package/docs/architecture/history-editor-provenance.md +1 -1
- package/docs/architecture/project-structure.md +6 -6
- package/docs/architecture/prompt-suggestions.md +1 -1
- package/docs/architecture/terminal-host-proof-gate.md +1 -1
- package/docs/architecture/terminal-host-spike-evidence.md +1 -1
- package/docs/architecture/toolchain.md +8 -0
- package/docs/architecture/ui-reference-provenance.md +4 -4
- package/docs/ci-release-runbook.md +7 -1
- package/docs/features/modal-content-interaction.md +2 -2
- package/docs/local-worktree-cleanup.md +4 -2
- package/docs/validation.md +6 -4
- package/package.json +7 -11
- package/bin/pi-tui.d.ts +0 -6
- package/bin/pi-tui.js +0 -28
- package/bin/sync-pi-tui-proxy.js +0 -97
- package/dist/cli/version.d.ts +0 -2
- package/dist/cli/version.js +0 -23
- package/dist/composition/agent-engine-bridge.d.ts +0 -3
- package/dist/composition/agent-engine-bridge.js +0 -108
- package/dist/composition/process.d.ts +0 -16
- package/dist/composition/process.js +0 -45
- package/dist/contracts/workspace/index.d.ts +0 -2
- package/dist/contracts/workspace/index.js +0 -2
- package/dist/contracts/workspace/model.d.ts +0 -248
- package/dist/contracts/workspace/model.js +0 -2
- package/dist/contracts/workspace/validation.d.ts +0 -13
- package/dist/contracts/workspace/validation.js +0 -335
- package/dist/features/owned-ui/customization.d.ts +0 -40
- package/dist/features/owned-ui/customization.js +0 -110
- package/dist/features/owned-ui/diagnostics.d.ts +0 -34
- package/dist/features/owned-ui/diagnostics.js +0 -95
- package/dist/features/workspace/capabilities.d.ts +0 -31
- package/dist/features/workspace/capabilities.js +0 -75
- package/dist/features/workspace/index.d.ts +0 -6
- package/dist/features/workspace/index.js +0 -6
- package/dist/features/workspace/presentation.d.ts +0 -30
- package/dist/features/workspace/presentation.js +0 -70
- package/dist/features/workspace/reconciliation.d.ts +0 -15
- package/dist/features/workspace/reconciliation.js +0 -82
- package/dist/features/workspace/reducer.d.ts +0 -43
- package/dist/features/workspace/reducer.js +0 -214
- package/dist/features/workspace/router.d.ts +0 -32
- package/dist/features/workspace/router.js +0 -125
- package/dist/features/workspace/store.d.ts +0 -18
- package/dist/features/workspace/store.js +0 -55
- package/dist/foundation/native-host-protocol/codec.d.ts +0 -13
- package/dist/foundation/native-host-protocol/codec.js +0 -58
- package/dist/foundation/native-host-protocol/evidence.d.ts +0 -67
- package/dist/foundation/native-host-protocol/evidence.js +0 -141
- package/dist/foundation/native-host-protocol/index.d.ts +0 -4
- package/dist/foundation/native-host-protocol/index.js +0 -4
- package/dist/foundation/native-host-protocol/messages.d.ts +0 -56
- package/dist/foundation/native-host-protocol/messages.js +0 -149
- package/dist/foundation/native-host-protocol/proof-gate.d.ts +0 -13
- package/dist/foundation/native-host-protocol/proof-gate.js +0 -33
- package/dist/foundation/structured-agent-runtime/backpressure.d.ts +0 -47
- package/dist/foundation/structured-agent-runtime/backpressure.js +0 -119
- package/dist/foundation/structured-agent-runtime/commands.d.ts +0 -53
- package/dist/foundation/structured-agent-runtime/commands.js +0 -165
- package/dist/foundation/structured-agent-runtime/handshake.d.ts +0 -41
- package/dist/foundation/structured-agent-runtime/handshake.js +0 -151
- package/dist/foundation/structured-agent-runtime/index.d.ts +0 -5
- package/dist/foundation/structured-agent-runtime/index.js +0 -5
- package/dist/foundation/structured-agent-runtime/reconnection.d.ts +0 -38
- package/dist/foundation/structured-agent-runtime/reconnection.js +0 -130
- package/dist/foundation/structured-agent-runtime/state.d.ts +0 -57
- package/dist/foundation/structured-agent-runtime/state.js +0 -119
- package/dist/integrations/pi/components/upstream/components/custom-entry.d.ts +0 -17
- package/dist/integrations/pi/components/upstream/components/custom-entry.js +0 -51
- package/dist/integrations/pi/components/upstream/components/first-time-setup.d.ts +0 -24
- package/dist/integrations/pi/components/upstream/components/first-time-setup.js +0 -105
- package/dist/integrations/pi/components/upstream/components/markdown-transform.d.ts +0 -2
- package/dist/integrations/pi/components/upstream/components/markdown-transform.js +0 -18
- package/dist/integrations/pi/engine/model-auth-integration.d.ts +0 -31
- package/dist/integrations/pi/engine/model-auth-integration.js +0 -62
- package/dist/integrations/pi/engine/resource-extension-integration.d.ts +0 -32
- package/dist/integrations/pi/engine/resource-extension-integration.js +0 -81
- package/dist/integrations/pi/engine/settings-effects.js +0 -249
- package/dist/integrations/pi/engine/settings-integration.d.ts +0 -43
- package/dist/integrations/pi/engine/settings-integration.js +0 -227
- package/dist/integrations/pi/engine/workflow-controllers.d.ts +0 -21
- package/dist/integrations/pi/engine/workflow-controllers.js +0 -49
- package/dist/integrations/pi/session-ui/index.d.ts +0 -5
- package/dist/integrations/pi/session-ui/index.js +0 -5
- package/dist/integrations/pi/session-ui/paste-executor.d.ts +0 -10
- package/dist/integrations/pi/session-ui/paste-preparation-client.d.ts +0 -16
- package/dist/integrations/pi/session-ui/route-host.d.ts +0 -5
- package/dist/integrations/pi/tui-runtime/conformance.d.ts +0 -18
- package/dist/integrations/pi/tui-runtime/conformance.js +0 -145
- package/dist/ui/components/prompt-row.d.ts +0 -14
- package/dist/ui/components/prompt-row.js +0 -20
- package/dist/ui/settings/session.d.ts +0 -36
- package/dist/ui/settings/store.d.ts +0 -29
- package/dist/ui/settings/store.js +0 -91
- package/dist/{integrations/pi/session-ui → app/session-shell}/clipboard-diagnostics.js +2 -2
- package/dist/{integrations/pi/session-ui → app/session-shell}/clipboard-image.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/editor-hyperlink-budget.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/editor-hyperlink-budget.js +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-preparation.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-source.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-worker.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-helper.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-text-preparation.js +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-text-worker.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-text-worker.js +0 -0
- package/dist/{integrations/pi/session-ui/response-copy-helper.d.ts → app/session-shell/paste-types.js} +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/path-chip-presentation.js +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/quit-outro-effects.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/quit-outro-effects.js +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/quit-outro.d.ts +0 -0
- package/dist/{integrations/pi/session-ui/route-host.js → app/session-shell/response-copy-helper.d.ts} +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-protocol.js +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/stream-presentation-coalescer.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/stream-presentation-coalescer.js +3 -3
- /package/dist/{integrations/pi/session-ui → app/session-shell}/text-paste.d.ts +0 -0
- /package/dist/{integrations/pi/session-ui → app/session-shell}/text-paste.js +0 -0
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { realpathSync } from "node:fs";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
import { dynamicObject, isRecord, requireCapability, stringProperty } from "./message-values.js";
|
|
4
|
+
import { ProjectTrustStore, SessionManager } from "../startup-public.js";
|
|
5
|
+
import { resolveConfiguredModelIds, scopedModelRecords, scopedModelReference, workflowOptions } from "./workflow-support.js";
|
|
6
|
+
/**
|
|
7
|
+
* The selector contexts and option lists the owned UI's workflow dialogs read from pinned Pi:
|
|
8
|
+
* model, scoped-model, session, tree, fork, project-trust, and provider-authentication state,
|
|
9
|
+
* shaped for the owned controllers. Everything here is a read of the current session and runtime
|
|
10
|
+
* plus the few writes the selectors commit directly (scoped models, project trust); running a
|
|
11
|
+
* workflow belongs to the runner.
|
|
12
|
+
*/
|
|
13
|
+
export class PiWorkflowContexts {
|
|
14
|
+
#agentDir;
|
|
15
|
+
#ports;
|
|
16
|
+
constructor(options, ports) {
|
|
17
|
+
this.#agentDir = options.agentDir;
|
|
18
|
+
this.#ports = ports;
|
|
19
|
+
}
|
|
20
|
+
#requireSession() {
|
|
21
|
+
const session = this.#ports.session();
|
|
22
|
+
if (this.#ports.disposed() || !this.#ports.runtime() || !session)
|
|
23
|
+
throw new Error("engine adapter is not running");
|
|
24
|
+
return session;
|
|
25
|
+
}
|
|
26
|
+
pinnedModelSelectorContext() {
|
|
27
|
+
const session = this.#requireSession();
|
|
28
|
+
const runtime = this.#ports.runtime();
|
|
29
|
+
if (!runtime)
|
|
30
|
+
throw new Error("engine runtime is unavailable");
|
|
31
|
+
const scoped = session.scopedModels;
|
|
32
|
+
const modelRuntime = runtime.services.modelRuntime;
|
|
33
|
+
const selectorRuntime = typeof modelRuntime.getAvailableSnapshot === "function"
|
|
34
|
+
? modelRuntime
|
|
35
|
+
: {
|
|
36
|
+
getAvailableSnapshot: () => session.model === undefined ? [] : [session.model],
|
|
37
|
+
getModel: (providerId, modelId) => modelRuntime.getModel(providerId, modelId),
|
|
38
|
+
getError: () => undefined,
|
|
39
|
+
refresh: async () => undefined,
|
|
40
|
+
};
|
|
41
|
+
const settingsManager = runtime.services.settingsManager;
|
|
42
|
+
const defaultProvider = settingsManager?.getDefaultProvider?.();
|
|
43
|
+
const defaultModelId = settingsManager?.getDefaultModel?.();
|
|
44
|
+
return {
|
|
45
|
+
currentModel: this.#ports.activeModel() === null ? undefined : session.model,
|
|
46
|
+
...(defaultProvider && defaultModelId ? { defaultModel: { provider: defaultProvider, id: defaultModelId } } : {}),
|
|
47
|
+
modelRuntime: selectorRuntime,
|
|
48
|
+
scopedModels: Array.isArray(scoped) ? scoped : [],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
pinnedProjectTrustContext() {
|
|
52
|
+
const runtime = this.#ports.runtime();
|
|
53
|
+
if (!runtime)
|
|
54
|
+
throw new Error("engine runtime is unavailable");
|
|
55
|
+
const cwd = resolve(this.#ports.cwd());
|
|
56
|
+
let trustPath = cwd;
|
|
57
|
+
try {
|
|
58
|
+
trustPath = realpathSync(cwd);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// Compatibility: pinned Pi retains the resolved path when real-path lookup fails.
|
|
62
|
+
}
|
|
63
|
+
// Security: trust the target's parent, not the parent containing a directory alias.
|
|
64
|
+
const parent = dirname(trustPath);
|
|
65
|
+
const trustStore = new ProjectTrustStore(this.#agentDir);
|
|
66
|
+
const trustOptions = [
|
|
67
|
+
{ label: "Trust", trusted: true, updates: [{ path: trustPath, decision: true }], savedPath: trustPath },
|
|
68
|
+
...(parent === trustPath ? [] : [{
|
|
69
|
+
label: `Trust parent folder (${parent})`,
|
|
70
|
+
trusted: true,
|
|
71
|
+
updates: [{ path: parent, decision: true }, { path: trustPath, decision: null }],
|
|
72
|
+
savedPath: parent,
|
|
73
|
+
}]),
|
|
74
|
+
{ label: "Do not trust", trusted: false, updates: [{ path: trustPath, decision: false }], savedPath: trustPath },
|
|
75
|
+
];
|
|
76
|
+
return {
|
|
77
|
+
cwd,
|
|
78
|
+
savedDecision: trustStore.getEntry(cwd),
|
|
79
|
+
projectTrusted: runtime.services.settingsManager?.isProjectTrusted?.() === true,
|
|
80
|
+
trustOptions,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
persistProjectTrust(updates) {
|
|
84
|
+
new ProjectTrustStore(this.#agentDir).setMany([...updates]);
|
|
85
|
+
}
|
|
86
|
+
pinnedSessionSelectorContext() {
|
|
87
|
+
const session = this.#requireSession();
|
|
88
|
+
const manager = session.sessionManager;
|
|
89
|
+
const cwd = manager?.getCwd?.();
|
|
90
|
+
const sessionDir = manager?.getSessionDir?.();
|
|
91
|
+
const currentSessionFilePath = manager?.getSessionFile?.();
|
|
92
|
+
const usesDefaultSessionDir = manager?.usesDefaultSessionDir?.() === true;
|
|
93
|
+
const resolvedCwd = typeof cwd === "string" ? cwd : this.#ports.cwd();
|
|
94
|
+
const resolvedSessionDir = typeof sessionDir === "string" ? sessionDir : undefined;
|
|
95
|
+
return {
|
|
96
|
+
currentSessionFilePath: typeof currentSessionFilePath === "string" ? currentSessionFilePath : undefined,
|
|
97
|
+
loadCurrentSessions: onProgress => SessionManager.list(resolvedCwd, resolvedSessionDir, onProgress),
|
|
98
|
+
loadAllSessions: onProgress => usesDefaultSessionDir
|
|
99
|
+
? SessionManager.listAll(onProgress)
|
|
100
|
+
: resolvedSessionDir === undefined ? SessionManager.listAll(onProgress) : SessionManager.listAll(resolvedSessionDir, onProgress),
|
|
101
|
+
renameSession: async (sessionFilePath, nextName) => {
|
|
102
|
+
const next = (nextName ?? "").trim();
|
|
103
|
+
if (!next)
|
|
104
|
+
return;
|
|
105
|
+
SessionManager.open(sessionFilePath).appendSessionInfo(next);
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
pinnedScopedModelsContext() {
|
|
110
|
+
const session = this.#requireSession();
|
|
111
|
+
const runtime = this.#ports.runtime();
|
|
112
|
+
if (!runtime)
|
|
113
|
+
throw new Error("engine runtime is unavailable");
|
|
114
|
+
const models = scopedModelRecords(runtime.services.modelRuntime);
|
|
115
|
+
const scoped = session.scopedModels;
|
|
116
|
+
if (Array.isArray(scoped) && scoped.length > 0) {
|
|
117
|
+
return {
|
|
118
|
+
models: models.map(item => item.descriptor),
|
|
119
|
+
enabledModelIds: scoped.map(scopedModelReference).filter((id) => id !== undefined),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
const patterns = runtime.services.settingsManager?.getEnabledModels?.();
|
|
123
|
+
return {
|
|
124
|
+
models: models.map(item => item.descriptor),
|
|
125
|
+
enabledModelIds: Array.isArray(patterns)
|
|
126
|
+
? resolveConfiguredModelIds(patterns.filter((value) => typeof value === "string"), models)
|
|
127
|
+
: null,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
updateScopedModels(enabledModelIds) {
|
|
131
|
+
const session = this.#requireSession();
|
|
132
|
+
const runtime = this.#ports.runtime();
|
|
133
|
+
if (!runtime)
|
|
134
|
+
throw new Error("engine runtime is unavailable");
|
|
135
|
+
const models = scopedModelRecords(runtime.services.modelRuntime);
|
|
136
|
+
const availableIds = new Set(models.map(item => `${item.descriptor.provider}/${item.descriptor.id}`));
|
|
137
|
+
const selected = enabledModelIds?.filter(id => availableIds.has(id)) ?? [];
|
|
138
|
+
const allAvailableEnabled = enabledModelIds !== null && availableIds.size > 0 && selected.length === availableIds.size;
|
|
139
|
+
const scoped = enabledModelIds !== null && selected.length > 0 && !allAvailableEnabled
|
|
140
|
+
? selected.flatMap(id => {
|
|
141
|
+
const item = models.find(candidate => `${candidate.descriptor.provider}/${candidate.descriptor.id}` === id);
|
|
142
|
+
return item === undefined ? [] : [{ model: item.model }];
|
|
143
|
+
})
|
|
144
|
+
: [];
|
|
145
|
+
requireCapability(session.setScopedModels, "setScopedModels").call(session, scoped);
|
|
146
|
+
this.#ports.emitView();
|
|
147
|
+
}
|
|
148
|
+
persistScopedModels(enabledModelIds) {
|
|
149
|
+
const runtime = this.#ports.runtime();
|
|
150
|
+
if (!runtime)
|
|
151
|
+
throw new Error("engine runtime is unavailable");
|
|
152
|
+
const availableCount = scopedModelRecords(runtime.services.modelRuntime).length;
|
|
153
|
+
const patterns = enabledModelIds === null || enabledModelIds.length === availableCount
|
|
154
|
+
? undefined
|
|
155
|
+
: [...enabledModelIds];
|
|
156
|
+
requireCapability(runtime.services.settingsManager?.setEnabledModels, "setEnabledModels").call(runtime.services.settingsManager, patterns === undefined ? undefined : [...patterns]);
|
|
157
|
+
}
|
|
158
|
+
async refreshScopedModels(signal) {
|
|
159
|
+
const runtime = this.#ports.runtime();
|
|
160
|
+
if (!runtime)
|
|
161
|
+
throw new Error("engine runtime is unavailable");
|
|
162
|
+
const result = await runtime.services.modelRuntime.refresh?.({ signal });
|
|
163
|
+
const context = this.pinnedScopedModelsContext();
|
|
164
|
+
if (isRecord(result) && result.aborted === true) {
|
|
165
|
+
return { ...context, status: "Model refresh timed out; showing cached models.", statusKind: "warning" };
|
|
166
|
+
}
|
|
167
|
+
const errors = isRecord(result) ? result.errors : undefined;
|
|
168
|
+
if (errors instanceof Map && errors.size > 0) {
|
|
169
|
+
return {
|
|
170
|
+
...context,
|
|
171
|
+
status: `Could not refresh ${[...errors.keys()].join(", ")}; showing cached models.`,
|
|
172
|
+
statusKind: "warning",
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
return { ...context, status: "Model catalogs refreshed.", statusKind: "success" };
|
|
176
|
+
}
|
|
177
|
+
pinnedLoginMethodOptions(providerReference) {
|
|
178
|
+
const runtime = this.#ports.runtime();
|
|
179
|
+
if (!runtime)
|
|
180
|
+
throw new Error("engine runtime is unavailable");
|
|
181
|
+
const modelRuntime = runtime.services.modelRuntime;
|
|
182
|
+
const normalized = providerReference.trim().toLowerCase();
|
|
183
|
+
const providers = modelRuntime.getProviders?.();
|
|
184
|
+
const matches = Array.isArray(providers) ? providers.filter(isRecord).filter(candidate => stringProperty(candidate, "id")?.toLowerCase() === normalized
|
|
185
|
+
|| stringProperty(candidate, "name")?.toLowerCase() === normalized) : [];
|
|
186
|
+
const providerId = matches.length === 1 ? stringProperty(matches[0], "id") ?? providerReference : providerReference;
|
|
187
|
+
const provider = modelRuntime.getProvider?.(providerId);
|
|
188
|
+
const providerName = stringProperty(provider, "name") ?? providerId;
|
|
189
|
+
const oauth = dynamicObject(dynamicObject(provider, "auth"), "oauth");
|
|
190
|
+
const loginLabel = stringProperty(oauth, "loginLabel") ?? "Sign in with an account";
|
|
191
|
+
const options = this.loginOptions().filter(option => option.id.endsWith(`:${providerId}`)).map(option => ({
|
|
192
|
+
id: option.id,
|
|
193
|
+
label: option.id.startsWith("api_key:") ? "Sign in with an API key" : loginLabel,
|
|
194
|
+
...(option.description === undefined ? {} : { description: option.description }),
|
|
195
|
+
}));
|
|
196
|
+
return { title: `Select authentication method for ${providerName}:`, options };
|
|
197
|
+
}
|
|
198
|
+
pinnedAmbientAuthentication(selection) {
|
|
199
|
+
if (!selection.startsWith("api_key:"))
|
|
200
|
+
return null;
|
|
201
|
+
const providerId = selection.slice("api_key:".length);
|
|
202
|
+
const provider = this.#ports.runtime()?.services.modelRuntime.getProvider?.(providerId);
|
|
203
|
+
const method = dynamicObject(dynamicObject(provider, "auth"), "apiKey");
|
|
204
|
+
if (!method || typeof method.login === "function")
|
|
205
|
+
return null;
|
|
206
|
+
const providerName = stringProperty(provider, "name") ?? providerId;
|
|
207
|
+
return { providerId, providerName, title: `${providerName} setup`, message: `${stringProperty(method, "name") ?? "Authentication"} is configured outside pi.` };
|
|
208
|
+
}
|
|
209
|
+
pinnedForkOptions() {
|
|
210
|
+
const session = this.#requireSession();
|
|
211
|
+
const messages = requireCapability(session.getUserMessagesForForking, "getUserMessagesForForking").call(session);
|
|
212
|
+
return workflowOptions(messages, "entryId", "text");
|
|
213
|
+
}
|
|
214
|
+
pinnedTreeSelectorContext() {
|
|
215
|
+
const manager = this.#requireSession().sessionManager;
|
|
216
|
+
const settings = this.#ports.runtime()?.services.settingsManager;
|
|
217
|
+
const tree = manager?.getTree?.();
|
|
218
|
+
const leaf = manager?.getLeafId?.();
|
|
219
|
+
const configuredFilter = settings?.getTreeFilterMode?.();
|
|
220
|
+
const filterMode = configuredFilter === "no-tools" || configuredFilter === "user-only" || configuredFilter === "labeled-only" || configuredFilter === "all"
|
|
221
|
+
? configuredFilter
|
|
222
|
+
: "default";
|
|
223
|
+
return {
|
|
224
|
+
tree: Array.isArray(tree) ? tree : [],
|
|
225
|
+
currentLeafId: typeof leaf === "string" ? leaf : null,
|
|
226
|
+
filterMode,
|
|
227
|
+
skipSummaryPrompt: settings?.getBranchSummarySkipPrompt?.() === true,
|
|
228
|
+
appendLabelChange: (entryId, label) => {
|
|
229
|
+
requireCapability(manager?.appendLabelChange, "appendLabelChange").call(manager, entryId, label);
|
|
230
|
+
},
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
modelOptions() {
|
|
234
|
+
const runtime = this.#ports.runtime();
|
|
235
|
+
if (!runtime)
|
|
236
|
+
return [];
|
|
237
|
+
const models = runtime.services.modelRuntime.getAvailableSnapshot?.();
|
|
238
|
+
if (!Array.isArray(models)) {
|
|
239
|
+
const active = this.#ports.activeModel();
|
|
240
|
+
return active ? [{ id: `${active.providerId}/${active.modelId}`, label: active.displayName, description: `${active.providerId}/${active.modelId}` }] : [];
|
|
241
|
+
}
|
|
242
|
+
return models.filter(isRecord).flatMap(model => {
|
|
243
|
+
const provider = stringProperty(model, "provider");
|
|
244
|
+
const id = stringProperty(model, "id");
|
|
245
|
+
if (!provider || !id)
|
|
246
|
+
return [];
|
|
247
|
+
return [{ id: `${provider}/${id}`, label: stringProperty(model, "name") ?? id, description: `${provider}/${id}` }];
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
loginOptions(authType) {
|
|
251
|
+
const runtime = this.#ports.runtime();
|
|
252
|
+
const modelRuntime = runtime?.services.modelRuntime;
|
|
253
|
+
if (!modelRuntime)
|
|
254
|
+
return [];
|
|
255
|
+
const providers = modelRuntime.getProviders?.();
|
|
256
|
+
if (!Array.isArray(providers))
|
|
257
|
+
return [];
|
|
258
|
+
return providers.filter(isRecord).flatMap(provider => {
|
|
259
|
+
const id = stringProperty(provider, "id");
|
|
260
|
+
if (!id)
|
|
261
|
+
return [];
|
|
262
|
+
const name = stringProperty(provider, "name") ?? id;
|
|
263
|
+
const auth = isRecord(provider.auth) ? provider.auth : {};
|
|
264
|
+
const authStatus = modelRuntime.getProviderAuthStatus?.(id);
|
|
265
|
+
const source = authStatus?.label ?? authStatus?.source;
|
|
266
|
+
const status = authStatus?.configured === true
|
|
267
|
+
? {
|
|
268
|
+
type: modelRuntime.isUsingOAuth?.(id) === true ? "oauth" : "api_key",
|
|
269
|
+
...(source === undefined ? {} : { source }),
|
|
270
|
+
}
|
|
271
|
+
: undefined;
|
|
272
|
+
return [
|
|
273
|
+
...(authType !== "api_key" && auth.oauth ? [{
|
|
274
|
+
id: `oauth:${id}`,
|
|
275
|
+
providerId: id,
|
|
276
|
+
label: name,
|
|
277
|
+
description: "Account / OAuth",
|
|
278
|
+
authType: "oauth",
|
|
279
|
+
...(status === undefined ? {} : { status }),
|
|
280
|
+
}] : []),
|
|
281
|
+
...(authType !== "oauth" && auth.apiKey ? [{
|
|
282
|
+
id: `api_key:${id}`,
|
|
283
|
+
providerId: id,
|
|
284
|
+
label: name,
|
|
285
|
+
description: "API key",
|
|
286
|
+
authType: "api_key",
|
|
287
|
+
...(status === undefined ? {} : { status }),
|
|
288
|
+
}] : []),
|
|
289
|
+
];
|
|
290
|
+
}).sort((left, right) => left.label.localeCompare(right.label));
|
|
291
|
+
}
|
|
292
|
+
async logoutOptions() {
|
|
293
|
+
const runtime = this.#ports.runtime();
|
|
294
|
+
if (!runtime)
|
|
295
|
+
return [];
|
|
296
|
+
const modelRuntime = runtime.services.modelRuntime;
|
|
297
|
+
const credentials = await requireCapability(modelRuntime.listCredentials, "listCredentials").call(modelRuntime, { signal: AbortSignal.timeout(15_000) });
|
|
298
|
+
if (!Array.isArray(credentials))
|
|
299
|
+
return [];
|
|
300
|
+
return credentials.filter(isRecord).flatMap(credential => {
|
|
301
|
+
const providerId = stringProperty(credential, "providerId");
|
|
302
|
+
if (!providerId)
|
|
303
|
+
return [];
|
|
304
|
+
const credentialType = stringProperty(credential, "type") === "api_key" ? "api_key" : "oauth";
|
|
305
|
+
const provider = modelRuntime.getProvider?.(providerId);
|
|
306
|
+
return [{
|
|
307
|
+
id: `${credentialType}:${providerId}`,
|
|
308
|
+
providerId,
|
|
309
|
+
label: stringProperty(provider, "name") ?? providerId,
|
|
310
|
+
description: credentialType,
|
|
311
|
+
authType: credentialType,
|
|
312
|
+
status: { type: credentialType, source: "stored credential" },
|
|
313
|
+
}];
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { AgentSession, AgentSessionRuntime } from "../startup-public.js";
|
|
2
|
+
import type { PiWorkflowContexts } from "./workflow-contexts.js";
|
|
3
|
+
import type { OwnedUiModelInfo, OwnedUiSnapshot, OwnedUiThinkingLevel } from "../../../contracts/owned-ui/index.js";
|
|
4
|
+
import type { PiBashWorkflowResult, PiWorkflowHost, PiWorkflowInteractionHost, PiWorkflowRequest, PiWorkflowResult } from "./workflows.js";
|
|
5
|
+
type PiSessionApi = AgentSession;
|
|
6
|
+
type PiRuntimeApi = AgentSessionRuntime;
|
|
7
|
+
export interface PiWorkflowRunnerOptions {
|
|
8
|
+
readonly agentDir: string;
|
|
9
|
+
readonly host: PiWorkflowHost;
|
|
10
|
+
readonly contexts: PiWorkflowContexts;
|
|
11
|
+
}
|
|
12
|
+
export interface PiWorkflowRunnerPorts {
|
|
13
|
+
session(): PiSessionApi | undefined;
|
|
14
|
+
runtime(): PiRuntimeApi | undefined;
|
|
15
|
+
disposed(): boolean;
|
|
16
|
+
sessionGeneration(): number;
|
|
17
|
+
/** The owned UI's prompt/notify host for login flows; the adapter swaps it when the shell binds. */
|
|
18
|
+
interaction(): PiWorkflowInteractionHost;
|
|
19
|
+
/** True while the adapter refuses new work: delivery overload, stopped admission, or disposal. */
|
|
20
|
+
admissionStopped(): boolean;
|
|
21
|
+
/** Engine commands currently admitted; they share the admission budget with workflows. */
|
|
22
|
+
pendingCommandCount(): number;
|
|
23
|
+
beginRunning(): void;
|
|
24
|
+
endRunning(): void;
|
|
25
|
+
activeModel(): OwnedUiModelInfo | null;
|
|
26
|
+
setActiveModel(model: OwnedUiModelInfo): void;
|
|
27
|
+
thinkingLevel(): OwnedUiThinkingLevel;
|
|
28
|
+
setThinkingLevel(level: OwnedUiThinkingLevel): void;
|
|
29
|
+
emitView(): void;
|
|
30
|
+
reconcileActiveModelAvailability(): void;
|
|
31
|
+
bindExtensionUiToSession(): Promise<void>;
|
|
32
|
+
applyPinnedSetting(selection: string): Promise<PiWorkflowResult>;
|
|
33
|
+
snapshot(): OwnedUiSnapshot;
|
|
34
|
+
dispose(): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Pinned Pi's slash-command workflows, run against the adapter's current session and runtime
|
|
38
|
+
* through ports. The runner owns workflow admission (the pending set and its cancellation), the
|
|
39
|
+
* clipboard writer the owned UI binds, provider authentication, and the per-command result
|
|
40
|
+
* wording; the adapter decides what the session is, how the view is published, and when work is
|
|
41
|
+
* refused, and the contexts collaborator supplies selector state.
|
|
42
|
+
*/
|
|
43
|
+
export declare class PiWorkflowRunner {
|
|
44
|
+
#private;
|
|
45
|
+
constructor(options: PiWorkflowRunnerOptions, ports: PiWorkflowRunnerPorts);
|
|
46
|
+
/** Workflows admitted and not yet settled. */
|
|
47
|
+
get pendingCount(): number;
|
|
48
|
+
/** Resolve every admitted workflow as cancelled, except the named command. */
|
|
49
|
+
cancelPending(except?: PiWorkflowRequest["command"]): void;
|
|
50
|
+
cycleModelWorkflow(direction: "forward" | "backward"): Promise<PiWorkflowResult>;
|
|
51
|
+
/** Bind the owned UI's clipboard lifecycle without changing the comparison host. True means acknowledged delivery. */
|
|
52
|
+
bindClipboardWriter(writer: (text: string) => Promise<boolean>): () => void;
|
|
53
|
+
/** Workflow and tree copying share the active owner's write fence and delivery acknowledgment. */
|
|
54
|
+
copyWorkflowText(text: string): Promise<boolean>;
|
|
55
|
+
abortBashWorkflow(): void;
|
|
56
|
+
executeBashWorkflow(command: string, excludeFromContext: boolean): Promise<PiBashWorkflowResult>;
|
|
57
|
+
reloadBlockedResult(): PiWorkflowResult | null;
|
|
58
|
+
executeWorkflow(request: PiWorkflowRequest): Promise<PiWorkflowResult>;
|
|
59
|
+
}
|
|
60
|
+
export {};
|