@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
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
import piSettingsMetadata from "./pi-settings-metadata.json" with { type: "json" };
|
|
2
|
-
import { PI_SETTING_EFFECTS, PiSettingsCoordinator, settingsEffectInventoryDrift, } from "./settings-effects.js";
|
|
3
|
-
export const AUTOMATIC_THEME = "automatic";
|
|
4
|
-
const LIGHT_APPEARANCE_THEME = "light";
|
|
5
|
-
const DARK_APPEARANCE_THEME = "dark";
|
|
6
|
-
const THEME_KEY = "theme";
|
|
7
|
-
const THINKING_KEY = "thinkingLevel";
|
|
8
|
-
export function parseAutomaticTheme(stored) {
|
|
9
|
-
const at = stored.indexOf("/");
|
|
10
|
-
if (at < 0 || stored.indexOf("/", at + 1) >= 0)
|
|
11
|
-
return null;
|
|
12
|
-
const light = stored.slice(0, at).trim();
|
|
13
|
-
const dark = stored.slice(at + 1).trim();
|
|
14
|
-
return light.length > 0 && dark.length > 0 ? { light, dark } : null;
|
|
15
|
-
}
|
|
16
|
-
const PRESENTATION = piSettingsMetadata;
|
|
17
|
-
export const EXPOSED_SETTING_KEYS = PRESENTATION.presented;
|
|
18
|
-
export function settingsInventoryDrift(presented, mapped) {
|
|
19
|
-
const has = new Set(mapped);
|
|
20
|
-
const engine = new Set(presented);
|
|
21
|
-
return {
|
|
22
|
-
unmapped: presented.filter(key => !has.has(key)),
|
|
23
|
-
stale: mapped.filter(key => !engine.has(key)),
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
function offered(key) {
|
|
27
|
-
return PRESENTATION.settings[key]?.values ?? [];
|
|
28
|
-
}
|
|
29
|
-
function offeredNumbers(key) {
|
|
30
|
-
return offered(key).map(value => Number.parseInt(value, 10)).filter(value => Number.isSafeInteger(value));
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Pi settings boundary backed by the transactional settings coordinator. The
|
|
34
|
-
* generated metadata owns presentation while the reviewed effect registry owns
|
|
35
|
-
* timing, availability, and active behavior.
|
|
36
|
-
*/
|
|
37
|
-
export class PiSettingsIntegration {
|
|
38
|
-
settings;
|
|
39
|
-
capabilities = { write: true, flush: true };
|
|
40
|
-
#operations;
|
|
41
|
-
#providers;
|
|
42
|
-
#coordinator;
|
|
43
|
-
constructor(settings, providers = {}) {
|
|
44
|
-
this.settings = settings;
|
|
45
|
-
this.#providers = providers;
|
|
46
|
-
const mapped = operations(settings, providers);
|
|
47
|
-
this.#operations = new Map(mapped.map(operation => [operation.key, operation]));
|
|
48
|
-
const presentationDrift = settingsInventoryDrift(EXPOSED_SETTING_KEYS, mapped.map(operation => operation.key));
|
|
49
|
-
const effectDrift = settingsEffectInventoryDrift(EXPOSED_SETTING_KEYS);
|
|
50
|
-
if (presentationDrift.unmapped.length > 0 || presentationDrift.stale.length > 0
|
|
51
|
-
|| effectDrift.unmapped.length > 0 || effectDrift.stale.length > 0 || effectDrift.duplicated.length > 0) {
|
|
52
|
-
throw new Error([
|
|
53
|
-
`unmapped operations: ${presentationDrift.unmapped.join(", ")}`,
|
|
54
|
-
`stale operations: ${presentationDrift.stale.join(", ")}`,
|
|
55
|
-
`unmapped effects: ${effectDrift.unmapped.join(", ")}`,
|
|
56
|
-
`stale effects: ${effectDrift.stale.join(", ")}`,
|
|
57
|
-
`duplicated effects: ${effectDrift.duplicated.join(", ")}`,
|
|
58
|
-
].join("; "));
|
|
59
|
-
}
|
|
60
|
-
this.#coordinator = new PiSettingsCoordinator(mapped, {
|
|
61
|
-
productMode: providers.productMode ?? "bare",
|
|
62
|
-
flush: () => settings.flush(),
|
|
63
|
-
drainErrors: () => settings.drainErrors(),
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
bindOwner(owner, handlers) {
|
|
67
|
-
return this.#coordinator.bindOwner(owner, handlers);
|
|
68
|
-
}
|
|
69
|
-
unbindOwner(owner) {
|
|
70
|
-
this.#coordinator.unbindOwner(owner);
|
|
71
|
-
}
|
|
72
|
-
async listSettings() {
|
|
73
|
-
const rank = (key) => {
|
|
74
|
-
const at = PRESENTATION.order.indexOf(key);
|
|
75
|
-
return at < 0 ? PRESENTATION.order.length : at;
|
|
76
|
-
};
|
|
77
|
-
return [...this.#operations.values()]
|
|
78
|
-
.filter(operation => this.#coordinator.available(operation.key))
|
|
79
|
-
.map(operation => {
|
|
80
|
-
const key = operation.key;
|
|
81
|
-
const wording = PRESENTATION.settings[key];
|
|
82
|
-
const flags = PRESENTATION.dialogs[key];
|
|
83
|
-
const bounds = PRESENTATION.bounds[key];
|
|
84
|
-
const descriptor = {
|
|
85
|
-
...operation.descriptor,
|
|
86
|
-
application: PI_SETTING_EFFECTS[key].application,
|
|
87
|
-
owner: PI_SETTING_EFFECTS[key].owner,
|
|
88
|
-
available: true,
|
|
89
|
-
limitationReason: null,
|
|
90
|
-
writable: true,
|
|
91
|
-
storedValue: this.#coordinator.storedValue(key),
|
|
92
|
-
effectiveValue: this.#coordinator.effectiveValue(key),
|
|
93
|
-
...(bounds === undefined ? {} : bounds),
|
|
94
|
-
...(wording === undefined ? {} : { label: wording.label, description: wording.description }),
|
|
95
|
-
...(flags === undefined ? {} : { flags }),
|
|
96
|
-
};
|
|
97
|
-
return this.#resolved(descriptor);
|
|
98
|
-
})
|
|
99
|
-
.sort((left, right) => rank(left.key) - rank(right.key));
|
|
100
|
-
}
|
|
101
|
-
#resolved(descriptor) {
|
|
102
|
-
if (descriptor.key === THEME_KEY) {
|
|
103
|
-
const themes = this.#themes();
|
|
104
|
-
if (themes.length === 0)
|
|
105
|
-
return descriptor;
|
|
106
|
-
return { ...descriptor, valueType: "enum", resolvedWhenRead: true, choices: [AUTOMATIC_THEME, ...themes] };
|
|
107
|
-
}
|
|
108
|
-
if (descriptor.key === THINKING_KEY) {
|
|
109
|
-
const levels = this.#providers.thinkingLevels?.() ?? [];
|
|
110
|
-
if (levels.length === 0)
|
|
111
|
-
return descriptor;
|
|
112
|
-
return { ...descriptor, resolvedWhenRead: true, choices: [...levels] };
|
|
113
|
-
}
|
|
114
|
-
return descriptor;
|
|
115
|
-
}
|
|
116
|
-
#themes() {
|
|
117
|
-
return this.#providers.themes?.() ?? [];
|
|
118
|
-
}
|
|
119
|
-
async readSetting(key) {
|
|
120
|
-
return isPiSettingKey(key) && this.#operations.has(key) ? this.#coordinator.storedValue(key) : undefined;
|
|
121
|
-
}
|
|
122
|
-
async writeSetting(key, value) {
|
|
123
|
-
if (!isPiSettingKey(key) || !this.#operations.has(key))
|
|
124
|
-
throw new Error(`setting is unavailable: ${key}`);
|
|
125
|
-
return await this.#coordinator.apply(key, value);
|
|
126
|
-
}
|
|
127
|
-
/** Shared route used by the pinned selector and owned settings surface. */
|
|
128
|
-
async writeSettingNow(key, value) {
|
|
129
|
-
return await this.writeSetting(key, value);
|
|
130
|
-
}
|
|
131
|
-
async flush() {
|
|
132
|
-
await this.#coordinator.flush();
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
function operations(settings, providers) {
|
|
136
|
-
const themes = () => providers.themes?.() ?? [];
|
|
137
|
-
return [
|
|
138
|
-
bool("autoCompact", () => settings.getCompactionEnabled(), value => settings.setCompactionEnabled(value)),
|
|
139
|
-
bool("showImages", () => settings.getShowImages(), value => settings.setShowImages(value)),
|
|
140
|
-
numberSetting("imageWidthCells", () => settings.getImageWidthCells(), value => settings.setImageWidthCells(value), 1),
|
|
141
|
-
bool("autoResizeImages", () => settings.getImageAutoResize(), value => settings.setImageAutoResize(value)),
|
|
142
|
-
bool("blockImages", () => settings.getBlockImages(), value => settings.setBlockImages(value)),
|
|
143
|
-
bool("enableSkillCommands", () => settings.getEnableSkillCommands(), value => settings.setEnableSkillCommands(value)),
|
|
144
|
-
choice("steeringMode", offered("steeringMode"), () => settings.getSteeringMode(), value => settings.setSteeringMode(value)),
|
|
145
|
-
choice("followUpMode", offered("followUpMode"), () => settings.getFollowUpMode(), value => settings.setFollowUpMode(value)),
|
|
146
|
-
choice("transport", offered("transport"), () => settings.getTransport(), value => settings.setTransport(value)),
|
|
147
|
-
numberSetting("httpIdleTimeoutMs", () => settings.getHttpIdleTimeoutMs(), value => settings.setHttpIdleTimeoutMs(value), 0),
|
|
148
|
-
choice("thinkingLevel", ["off", "minimal", "low", "medium", "high", "xhigh"], () => settings.getDefaultThinkingLevel() ?? "medium", value => settings.setDefaultThinkingLevel(value)),
|
|
149
|
-
themeSetting(settings, themes),
|
|
150
|
-
bool("hideThinkingBlock", () => settings.getHideThinkingBlock(), value => settings.setHideThinkingBlock(value)),
|
|
151
|
-
choice("mermaidRenderingMode", offered("mermaidRenderingMode"), () => settings.getMermaidRenderingMode(), value => settings.setMermaidRenderingMode(value)),
|
|
152
|
-
bool("showCacheMissNotices", () => settings.getShowCacheMissNotices(), value => settings.setShowCacheMissNotices(value)),
|
|
153
|
-
bool("collapseChangelog", () => settings.getCollapseChangelog(), value => settings.setCollapseChangelog(value)),
|
|
154
|
-
bool("enableInstallTelemetry", () => settings.getEnableInstallTelemetry(), value => settings.setEnableInstallTelemetry(value)),
|
|
155
|
-
bool("quietStartup", () => settings.getQuietStartup(), value => settings.setQuietStartup(value)),
|
|
156
|
-
choice("defaultProjectTrust", offered("defaultProjectTrust"), () => settings.getDefaultProjectTrust(), value => settings.setDefaultProjectTrust(value)),
|
|
157
|
-
choice("doubleEscapeAction", offered("doubleEscapeAction"), () => settings.getDoubleEscapeAction(), value => settings.setDoubleEscapeAction(value)),
|
|
158
|
-
choice("treeFilterMode", offered("treeFilterMode"), () => settings.getTreeFilterMode(), value => settings.setTreeFilterMode(value)),
|
|
159
|
-
bool("showHardwareCursor", () => settings.getShowHardwareCursor(), value => settings.setShowHardwareCursor(value)),
|
|
160
|
-
numberSetting("editorPaddingX", () => settings.getEditorPaddingX(), value => settings.setEditorPaddingX(value), 0),
|
|
161
|
-
choice("outputPad", offeredNumbers("outputPad"), () => settings.getOutputPad(), value => settings.setOutputPad(value)),
|
|
162
|
-
numberSetting("autocompleteMaxVisible", () => settings.getAutocompleteMaxVisible(), value => settings.setAutocompleteMaxVisible(value), 1),
|
|
163
|
-
bool("clearOnShrink", () => settings.getClearOnShrink(), value => settings.setClearOnShrink(value)),
|
|
164
|
-
bool("showTerminalProgress", () => settings.getShowTerminalProgress(), value => settings.setShowTerminalProgress(value)),
|
|
165
|
-
choice("tuiMode", offered("tuiMode"), () => settings.getTuiMode(), value => settings.setTuiMode(value)),
|
|
166
|
-
choice("fullscreenExitOutput", offered("fullscreenExitOutput"), () => settings.getFullscreenExitOutput(), value => settings.setFullscreenExitOutput(value)),
|
|
167
|
-
choice("fullscreenScrollbar", offered("fullscreenScrollbar"), () => settings.getFullscreenScrollbar(), value => settings.setFullscreenScrollbar(value)),
|
|
168
|
-
jsonObject("warnings", () => settings.getWarnings(), value => settings.setWarnings(value)),
|
|
169
|
-
];
|
|
170
|
-
}
|
|
171
|
-
function bool(key, read, write) {
|
|
172
|
-
return operation(key, "boolean", read, value => { if (typeof value !== "boolean")
|
|
173
|
-
invalid(key); }, value => write(value));
|
|
174
|
-
}
|
|
175
|
-
function numberSetting(key, read, write, minimum) {
|
|
176
|
-
const declared = PRESENTATION.bounds[key];
|
|
177
|
-
const low = declared?.minimum ?? minimum;
|
|
178
|
-
const high = declared?.maximum;
|
|
179
|
-
return operation(key, "number", read, value => {
|
|
180
|
-
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < low || (high !== undefined && value > high))
|
|
181
|
-
invalid(key);
|
|
182
|
-
}, value => write(value));
|
|
183
|
-
}
|
|
184
|
-
function jsonObject(key, read, write) {
|
|
185
|
-
const boundedRead = () => Object.fromEntries(Object.entries(read()).filter((entry) => typeof entry[1] === "boolean"));
|
|
186
|
-
return operation(key, "json", boundedRead, value => {
|
|
187
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
188
|
-
invalid(key);
|
|
189
|
-
}, write);
|
|
190
|
-
}
|
|
191
|
-
function choice(key, choices, read, write) {
|
|
192
|
-
return {
|
|
193
|
-
...operation(key, "enum", read, value => { if (!choices.includes(value))
|
|
194
|
-
invalid(key); }, write),
|
|
195
|
-
descriptor: { key, valueType: "enum", choices },
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
function themeSetting(settings, themes) {
|
|
199
|
-
const raw = () => settings.getThemeSetting() ?? "default";
|
|
200
|
-
const read = () => parseAutomaticTheme(raw()) === null ? raw() : AUTOMATIC_THEME;
|
|
201
|
-
return operation(THEME_KEY, "string", read, value => {
|
|
202
|
-
if (typeof value !== "string" || value.length === 0)
|
|
203
|
-
invalid(THEME_KEY);
|
|
204
|
-
}, value => {
|
|
205
|
-
const selected = value;
|
|
206
|
-
if (selected !== AUTOMATIC_THEME) {
|
|
207
|
-
settings.setTheme(selected);
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
if (parseAutomaticTheme(raw()) !== null)
|
|
211
|
-
return;
|
|
212
|
-
const installed = themes();
|
|
213
|
-
const current = raw();
|
|
214
|
-
const light = installed.includes(LIGHT_APPEARANCE_THEME) ? LIGHT_APPEARANCE_THEME : current;
|
|
215
|
-
const dark = installed.includes(DARK_APPEARANCE_THEME) ? DARK_APPEARANCE_THEME : current;
|
|
216
|
-
settings.setTheme(`${light}/${dark}`);
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
function operation(key, valueType, read, validate, write) {
|
|
220
|
-
return { key, descriptor: { key, valueType }, read, validate, write };
|
|
221
|
-
}
|
|
222
|
-
function isPiSettingKey(key) {
|
|
223
|
-
return Object.hasOwn(PI_SETTING_EFFECTS, key);
|
|
224
|
-
}
|
|
225
|
-
function invalid(key) {
|
|
226
|
-
throw new TypeError(`setting value is invalid: ${key}`);
|
|
227
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { AgentJsonValue, AgentWorkflowDescriptor, AgentWorkflowPort } from "../../../contracts/agent-engine/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
|
-
/** Capability-gates pinned Pi workflows before delegating execution through the neutral workflow port. */
|
|
10
|
-
export declare class PiWorkflowControllerPort implements AgentWorkflowPort {
|
|
11
|
-
#private;
|
|
12
|
-
private readonly execute;
|
|
13
|
-
readonly capabilities: {
|
|
14
|
-
execute: boolean;
|
|
15
|
-
};
|
|
16
|
-
constructor(available: readonly WorkflowCapability[], execute: (workflowId: PiWorkflowRoute, input: AgentJsonValue, signal?: AbortSignal) => Promise<WorkflowControllerResult>);
|
|
17
|
-
listWorkflows(): Promise<readonly AgentWorkflowDescriptor[]>;
|
|
18
|
-
executeWorkflow(workflowId: string, input: AgentJsonValue, signal?: AbortSignal): Promise<AgentJsonValue>;
|
|
19
|
-
}
|
|
20
|
-
export declare const PI_BUILTIN_WORKFLOW_ROUTES: readonly ("name" | "share" | "model" | "login" | "logout" | "settings" | "reload" | "compact" | "new" | "resume" | "quit" | "session" | "tree" | "scoped-models" | "export" | "import" | "copy" | "changelog" | "hotkeys" | "fork" | "clone" | "trust" | "debug" | "arminsayshi" | "dementedelves")[];
|
|
21
|
-
export declare const PI_WORKFLOW_CAPABILITIES: readonly WorkflowCapability[];
|
|
@@ -1,49 +0,0 @@
|
|
|
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
|
-
/** Capability-gates pinned Pi workflows before delegating execution through the neutral workflow port. */
|
|
12
|
-
export class PiWorkflowControllerPort {
|
|
13
|
-
execute;
|
|
14
|
-
capabilities = { execute: true };
|
|
15
|
-
#available;
|
|
16
|
-
constructor(available, execute) {
|
|
17
|
-
this.execute = execute;
|
|
18
|
-
this.#available = new Set(available);
|
|
19
|
-
}
|
|
20
|
-
async listWorkflows() {
|
|
21
|
-
return DEFINITIONS.map(definition => ({ id: definition.id, label: definition.id, requiredCommands: definition.required }));
|
|
22
|
-
}
|
|
23
|
-
async executeWorkflow(workflowId, input, signal) {
|
|
24
|
-
const definition = DEFINITIONS.find(value => value.id === workflowId);
|
|
25
|
-
if (!definition)
|
|
26
|
-
return failure(`workflow is unavailable: ${workflowId}`);
|
|
27
|
-
const missing = definition.required.filter(capability => !this.#available.has(capability));
|
|
28
|
-
if (missing.length > 0)
|
|
29
|
-
return failure(`${workflowId} requires unavailable capabilities: ${missing.join(", ")}`);
|
|
30
|
-
if (signal?.aborted)
|
|
31
|
-
return { outcome: "cancelled", message: "workflow cancelled" };
|
|
32
|
-
try {
|
|
33
|
-
const result = await this.execute(definition.id, input, signal);
|
|
34
|
-
return { ...result, message: bounded(result.message) };
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
return failure(`${workflowId} failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
export const PI_BUILTIN_WORKFLOW_ROUTES = Object.freeze([...PINNED_PI_WORKFLOW_COMMAND_NAMES, ...PINNED_PI_HIDDEN_COMMAND_NAMES]);
|
|
42
|
-
export const PI_WORKFLOW_CAPABILITIES = Object.freeze([
|
|
43
|
-
"prompt", "abort", "compact", "bash", "models.read", "models.write", "auth.login", "auth.logout", "settings.read", "settings.write",
|
|
44
|
-
"resources.read", "resources.reload", "session.read", "session.new", "session.resume", "session.fork", "session.tree", "session.import",
|
|
45
|
-
"clipboard.write", "export.write", "share.write", "process.quit", "diagnostics.read",
|
|
46
|
-
]);
|
|
47
|
-
function define(id, ...required) { return { id, required }; }
|
|
48
|
-
function failure(message) { return { outcome: "failed", message: bounded(message) }; }
|
|
49
|
-
function bounded(message) { return message.length <= 512 ? message : `${message.slice(0, 509)}...`; }
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { PiShellClipboardContent } from "../components/shell-shared-facade.js";
|
|
2
|
-
import { type PreparedPaste, type PasteEvent } from "./paste-protocol.js";
|
|
3
|
-
export interface PasteExecutorJob {
|
|
4
|
-
readonly result: Promise<PreparedPaste>;
|
|
5
|
-
readonly stopped: Promise<void>;
|
|
6
|
-
cancel(): void;
|
|
7
|
-
}
|
|
8
|
-
export type PastePhase = (phase: PasteEvent["phase"], bytes?: number) => void;
|
|
9
|
-
/** Streams bounded fragments through a killable child; native/codec/filesystem work never runs on the UI thread. */
|
|
10
|
-
export declare function startPasteExecutor(content: PiShellClipboardContent | undefined, signal: AbortSignal, phase?: PastePhase, helper?: URL): PasteExecutorJob;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type PasteEvent, type PasteSource, type PreparedPaste } from "./paste-protocol.js";
|
|
2
|
-
export interface PreparedPasteJob<T> {
|
|
3
|
-
readonly result: Promise<T>;
|
|
4
|
-
cancel(): void;
|
|
5
|
-
complete(): void;
|
|
6
|
-
isCurrent(): boolean;
|
|
7
|
-
}
|
|
8
|
-
/** Keeps eight distinct paste transactions alive through insertion; canceled executors retain capacity until fenced. */
|
|
9
|
-
export declare class PastePreparationClient {
|
|
10
|
-
#private;
|
|
11
|
-
private readonly onEvent?;
|
|
12
|
-
constructor(onEvent?: ((event: PasteEvent) => void) | undefined);
|
|
13
|
-
start<T>(source: PasteSource, adopt: (value: PreparedPaste, signal: AbortSignal) => Promise<T> | T, onImage: () => void, onText?: () => void): PreparedPasteJob<T>;
|
|
14
|
-
reset(): void;
|
|
15
|
-
dispose(): Promise<void>;
|
|
16
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface PiTuiRuntimeConformanceOptions {
|
|
2
|
-
readonly packageVersion: string;
|
|
3
|
-
}
|
|
4
|
-
export interface PiTuiRuntimeConformanceReport {
|
|
5
|
-
readonly packageName: "@earendil-works/pi-tui";
|
|
6
|
-
readonly packageVersion: string;
|
|
7
|
-
readonly mode: "regular" | "fullscreen";
|
|
8
|
-
readonly constructedModes: readonly ("regular" | "fullscreen")[];
|
|
9
|
-
readonly lifecycleRestored: boolean;
|
|
10
|
-
readonly inputRouted: boolean;
|
|
11
|
-
readonly overlayRouted: boolean;
|
|
12
|
-
readonly focusRouted: boolean;
|
|
13
|
-
readonly widthBounded: boolean;
|
|
14
|
-
readonly differentialRendering: boolean;
|
|
15
|
-
readonly resizeRedraw: boolean;
|
|
16
|
-
readonly terminalNativeSelection: boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare function runPiTuiRuntimeConformance(options: PiTuiRuntimeConformanceOptions): Promise<PiTuiRuntimeConformanceReport>;
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { PiTuiRuntimeAdapter, PiTuiRuntimeError } from "./adapter.js";
|
|
2
|
-
export async function runPiTuiRuntimeConformance(options) {
|
|
3
|
-
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(options.packageVersion)) {
|
|
4
|
-
throw new TypeError("Pi TUI conformance requires an exact package version from compatibility authority");
|
|
5
|
-
}
|
|
6
|
-
const terminal = new ConformanceTerminal();
|
|
7
|
-
const root = new ConformanceComponent(["stable row", "before"]);
|
|
8
|
-
const overlay = new ConformanceComponent(["overlay"]);
|
|
9
|
-
const runtime = new PiTuiRuntimeAdapter({ root, terminal, mouse: false });
|
|
10
|
-
try {
|
|
11
|
-
runtime.start();
|
|
12
|
-
runtime.renderNow(true);
|
|
13
|
-
root.lines = ["stable row", "after"];
|
|
14
|
-
const writesBeforeDifferential = terminal.writes.length;
|
|
15
|
-
runtime.renderNow();
|
|
16
|
-
const differentialFrame = terminal.writes.slice(writesBeforeDifferential).join("");
|
|
17
|
-
terminal.input("root-input");
|
|
18
|
-
runtime.renderNow();
|
|
19
|
-
const overlayHandle = runtime.showOverlay(overlay, { width: 12, anchor: "center" });
|
|
20
|
-
runtime.renderNow();
|
|
21
|
-
terminal.input("overlay-input");
|
|
22
|
-
runtime.renderNow();
|
|
23
|
-
const overlayRouted = overlay.inputs.includes("overlay-input") && !root.inputs.includes("overlay-input");
|
|
24
|
-
overlayHandle.hide();
|
|
25
|
-
const redrawsBeforeResize = runtime.fullRedraws;
|
|
26
|
-
terminal.resize(60, 10);
|
|
27
|
-
runtime.renderNow();
|
|
28
|
-
const resizeRedraw = runtime.fullRedraws > redrawsBeforeResize && runtime.viewport().columns === 60;
|
|
29
|
-
const fullscreenConstructed = runtime.switchMode("fullscreen");
|
|
30
|
-
runtime.renderNow(true);
|
|
31
|
-
const regularRestored = runtime.switchMode("regular");
|
|
32
|
-
runtime.renderNow(true);
|
|
33
|
-
await runtime.stop({ drainMaxMs: 1, drainIdleMs: 1 });
|
|
34
|
-
const emitted = terminal.writes.join("");
|
|
35
|
-
return {
|
|
36
|
-
packageName: "@earendil-works/pi-tui",
|
|
37
|
-
packageVersion: options.packageVersion,
|
|
38
|
-
mode: runtime.mode,
|
|
39
|
-
constructedModes: fullscreenConstructed && regularRestored ? ["regular", "fullscreen"] : ["regular"],
|
|
40
|
-
lifecycleRestored: terminal.startCount >= 1
|
|
41
|
-
&& terminal.startCount === terminal.stopCount
|
|
42
|
-
&& terminal.drainCount === 1
|
|
43
|
-
&& (emitted.match(/\x1b\[\?1049h/g)?.length ?? 0) === (emitted.match(/\x1b\[\?1049l/g)?.length ?? 0)
|
|
44
|
-
&& root.disposed,
|
|
45
|
-
inputRouted: root.inputs.includes("root-input"),
|
|
46
|
-
overlayRouted,
|
|
47
|
-
focusRouted: root.focusChanges.includes(true) && overlay.focusChanges.includes(true),
|
|
48
|
-
widthBounded: root.widths.every(width => width <= terminal.columns) && overlay.widths.every(width => width <= 12),
|
|
49
|
-
differentialRendering: differentialFrame.includes("after") && !differentialFrame.includes("stable row"),
|
|
50
|
-
resizeRedraw,
|
|
51
|
-
terminalNativeSelection: !emitted.includes("\x1b[?1000h") && !emitted.includes("\x1b[?1006h"),
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
catch (error) {
|
|
55
|
-
if (runtime.active)
|
|
56
|
-
await runtime.stop({ drainInput: false }).catch(() => { });
|
|
57
|
-
if (error instanceof PiTuiRuntimeError)
|
|
58
|
-
throw error;
|
|
59
|
-
throw new PiTuiRuntimeError("construction", error);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
class ConformanceComponent {
|
|
63
|
-
lines;
|
|
64
|
-
inputs = [];
|
|
65
|
-
focusChanges = [];
|
|
66
|
-
widths = [];
|
|
67
|
-
disposed = false;
|
|
68
|
-
constructor(lines) {
|
|
69
|
-
this.lines = lines;
|
|
70
|
-
}
|
|
71
|
-
render(width) {
|
|
72
|
-
this.widths.push(width);
|
|
73
|
-
return this.lines;
|
|
74
|
-
}
|
|
75
|
-
setFocused(focused) {
|
|
76
|
-
this.focusChanges.push(focused);
|
|
77
|
-
}
|
|
78
|
-
handleInput(data) {
|
|
79
|
-
this.inputs.push(data);
|
|
80
|
-
}
|
|
81
|
-
invalidate() { }
|
|
82
|
-
dispose() {
|
|
83
|
-
this.disposed = true;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
class ConformanceTerminal {
|
|
87
|
-
columns = 40;
|
|
88
|
-
rows = 6;
|
|
89
|
-
kittyProtocolActive = false;
|
|
90
|
-
writes = [];
|
|
91
|
-
startCount = 0;
|
|
92
|
-
stopCount = 0;
|
|
93
|
-
drainCount = 0;
|
|
94
|
-
#onInput;
|
|
95
|
-
#onResize;
|
|
96
|
-
start(onInput, onResize) {
|
|
97
|
-
this.startCount += 1;
|
|
98
|
-
this.#onInput = onInput;
|
|
99
|
-
this.#onResize = onResize;
|
|
100
|
-
}
|
|
101
|
-
stop() {
|
|
102
|
-
this.stopCount += 1;
|
|
103
|
-
this.#onInput = undefined;
|
|
104
|
-
this.#onResize = undefined;
|
|
105
|
-
}
|
|
106
|
-
async drainInput() {
|
|
107
|
-
this.drainCount += 1;
|
|
108
|
-
}
|
|
109
|
-
write(data) {
|
|
110
|
-
this.writes.push(data);
|
|
111
|
-
}
|
|
112
|
-
input(data) {
|
|
113
|
-
this.#onInput?.(data);
|
|
114
|
-
}
|
|
115
|
-
resize(columns, rows) {
|
|
116
|
-
this.columns = columns;
|
|
117
|
-
this.rows = rows;
|
|
118
|
-
this.#onResize?.();
|
|
119
|
-
}
|
|
120
|
-
moveBy(lines) {
|
|
121
|
-
if (lines !== 0)
|
|
122
|
-
this.write(`move:${lines}`);
|
|
123
|
-
}
|
|
124
|
-
hideCursor() {
|
|
125
|
-
this.write("\x1b[?25l");
|
|
126
|
-
}
|
|
127
|
-
showCursor() {
|
|
128
|
-
this.write("\x1b[?25h");
|
|
129
|
-
}
|
|
130
|
-
clearLine() {
|
|
131
|
-
this.write("\x1b[K");
|
|
132
|
-
}
|
|
133
|
-
clearFromCursor() {
|
|
134
|
-
this.write("\x1b[J");
|
|
135
|
-
}
|
|
136
|
-
clearScreen() {
|
|
137
|
-
this.write("\x1b[2J\x1b[H");
|
|
138
|
-
}
|
|
139
|
-
setTitle(title) {
|
|
140
|
-
this.write(`title:${title}`);
|
|
141
|
-
}
|
|
142
|
-
setProgress(active) {
|
|
143
|
-
this.write(`progress:${active}`);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface TimestampedPromptRowsInput {
|
|
2
|
-
readonly width: number;
|
|
3
|
-
readonly sourceTimestamp: number | Date;
|
|
4
|
-
readonly render: (contentWidth: number) => readonly string[];
|
|
5
|
-
/** Styles the reserved suffix while keeping policy independent of a vendor theme. */
|
|
6
|
-
readonly decorateSuffix?: (text: string, firstRow: boolean) => string;
|
|
7
|
-
readonly minimumWidth?: number;
|
|
8
|
-
}
|
|
9
|
-
export declare function formatPromptTimestamp(source: number | Date): string | null;
|
|
10
|
-
/**
|
|
11
|
-
* Reserves timestamp columns before wrapping, so the clock never overwrites
|
|
12
|
-
* prompt content. At narrow widths the same renderer is used without a clock.
|
|
13
|
-
*/
|
|
14
|
-
export declare function composeTimestampedPromptRows(input: TimestampedPromptRowsInput): readonly string[];
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { overlaySpan } from "./spans.js";
|
|
2
|
-
export function formatPromptTimestamp(source) {
|
|
3
|
-
const date = source instanceof Date ? source : new Date(source);
|
|
4
|
-
if (Number.isNaN(date.getTime()))
|
|
5
|
-
return null;
|
|
6
|
-
return `${String(date.getHours()).padStart(2, "0")}:${String(date.getMinutes()).padStart(2, "0")}`;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Reserves timestamp columns before wrapping, so the clock never overwrites
|
|
10
|
-
* prompt content. At narrow widths the same renderer is used without a clock.
|
|
11
|
-
*/
|
|
12
|
-
export function composeTimestampedPromptRows(input) {
|
|
13
|
-
const timestamp = formatPromptTimestamp(input.sourceTimestamp);
|
|
14
|
-
if (timestamp === null || input.width < (input.minimumWidth ?? 20))
|
|
15
|
-
return input.render(input.width);
|
|
16
|
-
const suffixWidth = timestamp.length + 2;
|
|
17
|
-
const contentWidth = Math.max(1, input.width - suffixWidth);
|
|
18
|
-
const decorate = input.decorateSuffix ?? ((text) => text);
|
|
19
|
-
return input.render(contentWidth).map((row, index) => overlaySpan(row, contentWidth, input.width, decorate(index === 0 ? ` ${timestamp}` : " ".repeat(suffixWidth), index === 0)));
|
|
20
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { AgentJsonValue, AgentSettingApplicationBoundary, AgentSettingsPort } from "../../contracts/agent-engine/index.js";
|
|
2
|
-
import type { OwnedUiSettingValue } from "./declarations.js";
|
|
3
|
-
import type { OwnedUiSettingsResolution } from "./resolution.js";
|
|
4
|
-
import { type OwnedUiSettingsBackend, type OwnedUiSettingsSection } from "./sections.js";
|
|
5
|
-
import type { OwnedUiSettingsStore } from "./store.js";
|
|
6
|
-
export interface OwnedUiSettingsChangeOutcome {
|
|
7
|
-
readonly status: "applied" | "deferred" | "unavailable" | "failed";
|
|
8
|
-
readonly applied: boolean;
|
|
9
|
-
/** Compatibility projection for existing A1 restart-bound declarations. */
|
|
10
|
-
readonly pendingRestart: boolean;
|
|
11
|
-
readonly application: AgentSettingApplicationBoundary | null;
|
|
12
|
-
readonly storedValue: AgentJsonValue | null;
|
|
13
|
-
readonly effectiveValue: AgentJsonValue | null;
|
|
14
|
-
readonly limitationReason: string | null;
|
|
15
|
-
readonly failure: string | null;
|
|
16
|
-
}
|
|
17
|
-
export interface OwnedUiSettingsSessionOptions {
|
|
18
|
-
readonly store: OwnedUiSettingsStore;
|
|
19
|
-
readonly agent?: AgentSettingsPort | null;
|
|
20
|
-
readonly agentProvider?: () => AgentSettingsPort | null;
|
|
21
|
-
readonly hiddenAgentSettingIds?: readonly string[];
|
|
22
|
-
}
|
|
23
|
-
export type OwnedUiSettingsListener = (session: OwnedUiSettingsSession) => void;
|
|
24
|
-
/** Routes every accepted setting change only to its owning backend. */
|
|
25
|
-
export declare class OwnedUiSettingsSession {
|
|
26
|
-
#private;
|
|
27
|
-
constructor(options: OwnedUiSettingsSessionOptions);
|
|
28
|
-
get resolution(): OwnedUiSettingsResolution;
|
|
29
|
-
load(): Promise<void>;
|
|
30
|
-
sections(): readonly OwnedUiSettingsSection[];
|
|
31
|
-
value(id: string): OwnedUiSettingValue | null;
|
|
32
|
-
pendingValue(id: string): OwnedUiSettingValue | null;
|
|
33
|
-
onChange(listener: OwnedUiSettingsListener): () => void;
|
|
34
|
-
changeStructured(backend: OwnedUiSettingsBackend, id: string, value: Readonly<Record<string, unknown>>): Promise<OwnedUiSettingsChangeOutcome>;
|
|
35
|
-
change(backend: OwnedUiSettingsBackend, id: string, value: OwnedUiSettingValue): Promise<OwnedUiSettingsChangeOutcome>;
|
|
36
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type OwnedUiSettingDeclaration, type OwnedUiSettingValue } from "./declarations.js";
|
|
2
|
-
import { type OwnedUiSettingsMigration } from "./migrations.js";
|
|
3
|
-
import { type OwnedUiSettingsResolution } from "./resolution.js";
|
|
4
|
-
export interface OwnedUiSettingsStoreOptions {
|
|
5
|
-
/** A1 configuration root. Settings live under `<configDir>/settings/`. */
|
|
6
|
-
readonly configDir: string;
|
|
7
|
-
readonly profileId: string;
|
|
8
|
-
readonly declarations?: readonly OwnedUiSettingDeclaration[];
|
|
9
|
-
readonly migrations?: readonly OwnedUiSettingsMigration[];
|
|
10
|
-
}
|
|
11
|
-
export interface OwnedUiSettingsWriteOutcome {
|
|
12
|
-
readonly stored: boolean;
|
|
13
|
-
/** Present when the write failed; the caller must not report the change as saved. */
|
|
14
|
-
readonly failure: string | null;
|
|
15
|
-
}
|
|
16
|
-
/** Resolves and atomically persists one profile's owned settings without discarding unknown keys. */
|
|
17
|
-
export declare class OwnedUiSettingsStore {
|
|
18
|
-
#private;
|
|
19
|
-
constructor(options: OwnedUiSettingsStoreOptions);
|
|
20
|
-
get file(): string;
|
|
21
|
-
/** Reads and resolves. Never throws: every failure becomes a notice. */
|
|
22
|
-
read(): OwnedUiSettingsResolution;
|
|
23
|
-
/**
|
|
24
|
-
* Writes the resolved form with `id` set to `value`, preserving undeclared keys.
|
|
25
|
-
* Atomic: a temporary sibling is renamed over the target, so an interrupted
|
|
26
|
-
* write leaves either the complete previous document or the complete new one.
|
|
27
|
-
*/
|
|
28
|
-
write(resolution: OwnedUiSettingsResolution, id: string, value: OwnedUiSettingValue): OwnedUiSettingsWriteOutcome;
|
|
29
|
-
}
|