@timurproko/a1 0.2.6 → 0.2.7-dev.1222
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -3
- package/bin/automatic-update.js +7 -0
- package/bin/cli.js +4 -0
- package/bin/guardian.js +5 -0
- package/bin/tab-launch-context.d.ts +27 -0
- package/bin/tab-launch-context.js +94 -0
- package/bin/ui.js +107 -59
- package/dist/app/session-shell/clipboard-diagnostics.js +1 -1
- package/dist/app/session-shell/dialog-coordinator.d.ts +42 -0
- package/dist/app/session-shell/dialog-coordinator.js +133 -0
- package/dist/app/session-shell/dock-chrome.d.ts +34 -0
- package/dist/app/session-shell/dock-chrome.js +109 -0
- package/dist/app/session-shell/exit-notice.d.ts +1 -1
- package/dist/app/session-shell/exit-notice.js +1 -1
- package/dist/app/session-shell/extension-surface.d.ts +30 -0
- package/dist/app/session-shell/extension-surface.js +105 -0
- package/dist/app/session-shell/helper-pool.d.ts +3 -5
- package/dist/app/session-shell/helper-pool.js +3 -5
- package/dist/app/session-shell/input-surface-switch.d.ts +36 -0
- package/dist/app/session-shell/input-surface-switch.js +85 -0
- package/dist/app/session-shell/login-interaction.d.ts +27 -0
- package/dist/app/session-shell/login-interaction.js +91 -0
- package/dist/app/session-shell/prompt-submission.d.ts +48 -0
- package/dist/app/session-shell/prompt-submission.js +276 -0
- package/dist/app/session-shell/resident-tab-coordinator.d.ts +38 -0
- package/dist/app/session-shell/resident-tab-coordinator.js +77 -0
- package/dist/app/session-shell/response-copy-helper.js +21 -6
- package/dist/app/session-shell/response-copy-protocol.d.ts +1 -1
- package/dist/app/session-shell/response-copy-transport.d.ts +16 -6
- package/dist/app/session-shell/response-copy-transport.js +69 -17
- package/dist/app/session-shell/session-concern.d.ts +22 -0
- package/dist/app/session-shell/session-concern.js +29 -0
- package/dist/app/session-shell/session-lifecycle.d.ts +29 -0
- package/dist/app/session-shell/session-lifecycle.js +49 -0
- package/dist/app/session-shell/session-shell-root.d.ts +42 -6
- package/dist/app/session-shell/session-shell-root.js +197 -908
- package/dist/app/session-shell/session-shell.d.ts +3 -8
- package/dist/app/session-shell/session-shell.js +327 -835
- package/dist/app/session-shell/session-viewport-controller.d.ts +2 -1
- package/dist/app/session-shell/session-viewport-controller.js +41 -38
- package/dist/app/session-shell/settings-bindings.d.ts +17 -0
- package/dist/app/session-shell/settings-bindings.js +91 -0
- package/dist/app/session-shell/shell-editor-factory.d.ts +27 -0
- package/dist/app/session-shell/shell-editor-factory.js +105 -0
- package/dist/app/session-shell/shell-host.d.ts +6 -0
- package/dist/app/session-shell/shell-host.js +34 -7
- package/dist/app/session-shell/shell-layout.d.ts +64 -0
- package/dist/app/session-shell/shell-layout.js +18 -0
- package/dist/app/session-shell/suggestion-surface.d.ts +25 -0
- package/dist/app/session-shell/suggestion-surface.js +63 -0
- package/dist/app/session-shell/transcript-document.d.ts +78 -0
- package/dist/app/session-shell/transcript-document.js +365 -0
- package/dist/app/session-shell/viewport-layout.d.ts +31 -0
- package/dist/app/session-shell/viewport-layout.js +160 -0
- package/dist/app/session-shell/workflow-output.d.ts +33 -0
- package/dist/app/session-shell/workflow-output.js +174 -0
- package/dist/app/session-shell/workflow-router.d.ts +25 -0
- package/dist/app/session-shell/workflow-router.js +39 -0
- package/dist/cli/dispatch.d.ts +11 -1
- package/dist/cli/dispatch.js +79 -5
- package/dist/cli/tabs-request.d.ts +7 -0
- package/dist/cli/tabs-request.js +1 -0
- package/dist/cli/tabs.d.ts +14 -0
- package/dist/cli/tabs.js +151 -0
- package/dist/cli/version-stats.js +38 -3
- package/dist/composition/owned-settings.d.ts +12 -0
- package/dist/composition/owned-settings.js +36 -0
- package/dist/composition/owned-ui.d.ts +27 -28
- package/dist/composition/owned-ui.js +207 -153
- package/dist/composition/reference-selection-options.d.ts +3 -0
- package/dist/composition/reference-selection-options.js +16 -0
- package/dist/composition/resident-tab-bridge.d.ts +25 -0
- package/dist/composition/resident-tab-bridge.js +180 -0
- package/dist/composition/session-backend.d.ts +19 -0
- package/dist/composition/session-backend.js +1 -0
- package/dist/composition/session-runtime-registry.d.ts +20 -0
- package/dist/composition/session-runtime-registry.js +85 -0
- package/dist/composition/settings-route-host.d.ts +16 -2
- package/dist/composition/settings-route-host.js +42 -17
- package/dist/composition/settings-search-input.d.ts +9 -0
- package/dist/composition/settings-search-input.js +61 -0
- package/dist/composition/startup-route.d.ts +32 -0
- package/dist/composition/startup-route.js +72 -0
- package/dist/composition/utility-tab.d.ts +28 -0
- package/dist/composition/utility-tab.js +244 -0
- package/dist/contracts/owned-ui/index.d.ts +1 -1
- package/dist/contracts/owned-ui/model.d.ts +3 -0
- package/dist/contracts/owned-ui/session-backend.d.ts +3 -0
- package/dist/contracts/owned-ui/session-workflows.d.ts +11 -4
- package/dist/contracts/presentation/index.d.ts +11 -0
- package/dist/contracts/presentation/index.js +12 -0
- package/dist/features/launch/development-launch.js +6 -0
- package/dist/features/launch/index.d.ts +1 -1
- package/dist/features/launch/intent.d.ts +3 -1
- package/dist/features/launch/intent.js +7 -4
- package/dist/features/launch/profile-paths.js +4 -0
- package/dist/features/owned-ui/plus-menu-dialog.d.ts +22 -0
- package/dist/features/owned-ui/plus-menu-dialog.js +84 -0
- package/dist/features/owned-ui/project-trust-dialog.d.ts +1 -1
- package/dist/features/owned-ui/project-trust-dialog.js +6 -8
- package/dist/features/owned-ui/project-trust-prompt.d.ts +1 -0
- package/dist/features/owned-ui/project-trust-prompt.js +7 -3
- package/dist/features/owned-ui/reference-document-selection.d.ts +30 -0
- package/dist/features/owned-ui/reference-document-selection.js +179 -0
- package/dist/features/owned-ui/reference-screen-app.d.ts +6 -1
- package/dist/features/owned-ui/reference-screen-app.js +51 -10
- package/dist/features/owned-ui/settings-app.d.ts +13 -2
- package/dist/features/owned-ui/settings-app.js +136 -97
- package/dist/features/owned-ui/settings-search-input.d.ts +29 -0
- package/dist/features/owned-ui/settings-search-input.js +1 -0
- package/dist/features/prompt-history/index.d.ts +1 -1
- package/dist/features/prompt-history/paths.d.ts +2 -1
- package/dist/features/prompt-history/paths.js +10 -2
- package/dist/features/prompt-history/service.d.ts +5 -0
- package/dist/features/prompt-history/service.js +1 -1
- package/dist/features/resident-tab/auto-name.d.ts +11 -0
- package/dist/features/resident-tab/auto-name.js +44 -0
- package/dist/features/resident-tab/index.d.ts +5 -0
- package/dist/features/resident-tab/index.js +7 -0
- package/dist/features/resident-tab/shortcut-bindings-file.d.ts +8 -0
- package/dist/features/resident-tab/shortcut-bindings-file.js +40 -0
- package/dist/features/resident-tab/shortcut-declarations.d.ts +13 -0
- package/dist/features/resident-tab/shortcut-declarations.js +26 -0
- package/dist/features/resident-tab/shortcut-projection.d.ts +29 -0
- package/dist/features/resident-tab/shortcut-projection.js +64 -0
- package/dist/features/resident-tab/status-deriver.d.ts +10 -0
- package/dist/features/resident-tab/status-deriver.js +12 -0
- package/dist/foundation/launch-context/index.d.ts +12 -0
- package/dist/foundation/launch-context/index.js +26 -0
- package/dist/foundation/launch-guardian/exit-watcher.d.ts +14 -0
- package/dist/foundation/launch-guardian/exit-watcher.js +94 -0
- package/dist/foundation/launch-guardian/main.d.ts +7 -1
- package/dist/foundation/launch-guardian/main.js +60 -7
- package/dist/foundation/lifecycle/session-repository-context.js +16 -2
- package/dist/foundation/process-containment/{native-guardian-containment.d.ts → addon-containment.d.ts} +7 -5
- package/dist/foundation/process-containment/addon-containment.js +139 -0
- package/dist/foundation/process-containment/addon-process-inspector.d.ts +11 -0
- package/dist/foundation/process-containment/addon-process-inspector.js +36 -0
- package/dist/foundation/process-containment/addon.d.ts +42 -0
- package/dist/foundation/process-containment/addon.js +57 -0
- package/dist/foundation/process-containment/artifact.d.ts +1 -1
- package/dist/foundation/process-containment/artifact.js +6 -5
- package/dist/foundation/process-containment/contracts.d.ts +2 -0
- package/dist/foundation/process-containment/index.d.ts +4 -4
- package/dist/foundation/process-containment/index.js +3 -3
- package/dist/foundation/process-containment/native-process-inspector.d.ts +2 -1
- package/dist/foundation/process-containment/native-process-inspector.js +10 -10
- package/dist/foundation/release/automatic-update.d.ts +37 -0
- package/dist/foundation/release/automatic-update.js +265 -0
- package/dist/foundation/release/bootstrap.d.ts +7 -9
- package/dist/foundation/release/bootstrap.js +107 -24
- package/dist/foundation/release/cohort-state.d.ts +1 -1
- package/dist/foundation/release/cohort-state.js +1 -1
- package/dist/foundation/release/dependency-certification.js +54 -19
- package/dist/foundation/release/early-accent.d.ts +12 -0
- package/dist/foundation/release/early-accent.js +59 -0
- package/dist/foundation/release/index.d.ts +2 -2
- package/dist/foundation/release/index.js +2 -2
- package/dist/foundation/release/latest-release.d.ts +24 -2
- package/dist/foundation/release/latest-release.js +51 -1
- package/dist/foundation/release/progress-palette.generated.d.ts +137 -3
- package/dist/foundation/release/progress-palette.generated.js +137 -3
- package/dist/foundation/release/release-gc.d.ts +3 -0
- package/dist/foundation/release/release-gc.js +59 -8
- package/dist/foundation/release/release-store.d.ts +12 -0
- package/dist/foundation/release/release-store.js +124 -2
- package/dist/foundation/release/update-execution-lease.d.ts +48 -0
- package/dist/foundation/release/update-execution-lease.js +161 -0
- package/dist/foundation/release/update.d.ts +12 -7
- package/dist/foundation/release/update.js +281 -196
- package/dist/foundation/resident-tabs/bounded-host-command.d.ts +18 -0
- package/dist/foundation/resident-tabs/bounded-host-command.js +39 -0
- package/dist/foundation/resident-tabs/bridge-client.d.ts +70 -0
- package/dist/foundation/resident-tabs/bridge-client.js +321 -0
- package/dist/foundation/resident-tabs/doctor.d.ts +28 -0
- package/dist/foundation/resident-tabs/doctor.js +166 -0
- package/dist/foundation/resident-tabs/draft-checkpoint.d.ts +27 -0
- package/dist/foundation/resident-tabs/draft-checkpoint.js +145 -0
- package/dist/foundation/resident-tabs/ensure-terminal-host.d.ts +36 -0
- package/dist/foundation/resident-tabs/ensure-terminal-host.js +151 -0
- package/dist/foundation/resident-tabs/fault-injection.d.ts +8 -0
- package/dist/foundation/resident-tabs/fault-injection.js +26 -0
- package/dist/foundation/resident-tabs/fixture-control.d.ts +7 -0
- package/dist/foundation/resident-tabs/fixture-control.js +35 -0
- package/dist/foundation/resident-tabs/host-entry.d.ts +1 -0
- package/dist/foundation/resident-tabs/host-entry.js +17 -0
- package/dist/foundation/resident-tabs/index.d.ts +12 -0
- package/dist/foundation/resident-tabs/index.js +6 -0
- package/dist/foundation/resident-tabs/maintenance.d.ts +39 -0
- package/dist/foundation/resident-tabs/maintenance.js +75 -0
- package/dist/foundation/resident-tabs/progress-observation-schema.d.ts +34 -0
- package/dist/foundation/resident-tabs/progress-observation-schema.js +1 -0
- package/dist/foundation/resident-tabs/progress-observation.d.ts +4 -0
- package/dist/foundation/resident-tabs/progress-observation.js +150 -0
- package/dist/foundation/resident-tabs/prompt-journal.d.ts +63 -0
- package/dist/foundation/resident-tabs/prompt-journal.js +213 -0
- package/dist/foundation/resident-tabs/protocol.d.ts +12 -0
- package/dist/foundation/resident-tabs/protocol.js +195 -0
- package/dist/foundation/resident-tabs/recovery.d.ts +26 -0
- package/dist/foundation/resident-tabs/recovery.js +205 -0
- package/dist/foundation/resident-tabs/release-holds.d.ts +28 -0
- package/dist/foundation/resident-tabs/release-holds.js +75 -0
- package/dist/foundation/resident-tabs/routes.d.ts +5 -0
- package/dist/foundation/resident-tabs/routes.js +5 -0
- package/dist/foundation/resident-tabs/routing.d.ts +11 -0
- package/dist/foundation/resident-tabs/routing.js +10 -0
- package/dist/foundation/resident-tabs/session-sync.d.ts +14 -0
- package/dist/foundation/resident-tabs/session-sync.js +37 -0
- package/dist/foundation/resident-tabs/settings.d.ts +12 -0
- package/dist/foundation/resident-tabs/settings.js +58 -0
- package/dist/foundation/resident-tabs/terminal-host-artifact.d.ts +14 -0
- package/dist/foundation/resident-tabs/terminal-host-artifact.js +78 -0
- package/dist/foundation/resident-tabs/zip-archive.d.ts +9 -0
- package/dist/foundation/resident-tabs/zip-archive.js +56 -0
- package/dist/foundation/session-writer-lock/index.d.ts +30 -0
- package/dist/foundation/session-writer-lock/index.js +203 -0
- package/dist/foundation/startup/startup-descriptor.js +2 -2
- package/dist/foundation/terminal-cleanup/index.d.ts +1 -1
- package/dist/foundation/terminal-cleanup/index.js +1 -1
- package/dist/foundation/terminal-cleanup/terminal-reset.d.ts +6 -0
- package/dist/foundation/terminal-cleanup/terminal-reset.js +6 -0
- package/dist/integrations/pi/components/editor-interaction.d.ts +2 -0
- package/dist/integrations/pi/components/modal-frame.d.ts +17 -1
- package/dist/integrations/pi/components/modal-frame.js +48 -9
- package/dist/integrations/pi/components/models-dialog.js +4 -52
- package/dist/integrations/pi/components/owned-editor-ux.d.ts +6 -1
- package/dist/integrations/pi/components/owned-editor-ux.js +138 -11
- package/dist/integrations/pi/components/resources/builtin-themes.d.ts +4 -4
- package/dist/integrations/pi/components/resources/builtin-themes.js +4 -4
- package/dist/integrations/pi/components/share-operation-dialog.d.ts +2 -0
- package/dist/integrations/pi/components/share-operation-dialog.js +2 -1
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +58 -36
- package/dist/integrations/pi/components/shell-extension-ui.js +79 -60
- package/dist/integrations/pi/components/shell-footer-status.d.ts +1 -1
- package/dist/integrations/pi/components/shell-footer-status.js +21 -5
- package/dist/integrations/pi/components/shell-hotkey-sections.js +1 -1
- package/dist/integrations/pi/components/shell-presenters-info.d.ts +5 -2
- package/dist/integrations/pi/components/shell-presenters-info.js +18 -4
- package/dist/integrations/pi/components/shell-presenters-transcript.js +4 -1
- package/dist/integrations/pi/components/shell-selectors-dialogs.js +5 -1
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +12 -1
- package/dist/integrations/pi/components/skills-dialog.js +2 -2
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +17 -4
- package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
- package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-input.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
- package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +8 -6
- package/dist/integrations/pi/components/upstream/components/owned-editor.js +16 -9
- package/dist/integrations/pi/components/upstream/components/pi-logo.js +1 -1
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +4 -4
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +2 -2
- package/dist/integrations/pi/components/upstream/components/session-footer.d.ts +2 -1
- package/dist/integrations/pi/components/upstream/components/session-footer.js +31 -25
- package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector.js +8 -7
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +1 -1
- package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +2 -2
- package/dist/integrations/pi/components/upstream/components/status-indicator.js +3 -3
- package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/themed-text.js +1 -1
- package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +8 -7
- package/dist/integrations/pi/components/upstream/components/thinking-selector.js +10 -9
- package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +2 -6
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +103 -101
- package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +9 -9
- package/dist/integrations/pi/components/upstream/components/tree-selector.js +13 -21
- package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +2 -2
- package/dist/integrations/pi/components/upstream/history/editor-core.js +7 -5
- package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
- package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
- package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
- package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
- package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
- package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/program-status-reporter.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/theme/theme.d.ts +5 -0
- package/dist/integrations/pi/components/upstream/theme/theme.js +29 -2
- package/dist/integrations/pi/engine/adapter.d.ts +5 -77
- package/dist/integrations/pi/engine/adapter.js +95 -394
- package/dist/integrations/pi/engine/command-dispatch.d.ts +13 -0
- package/dist/integrations/pi/engine/command-dispatch.js +57 -0
- package/dist/integrations/pi/engine/host.js +2 -2
- package/dist/integrations/pi/engine/offline-settings-port.d.ts +23 -0
- package/dist/integrations/pi/engine/offline-settings-port.js +53 -0
- package/dist/integrations/pi/engine/pi-settings-metadata.json +14 -2
- package/dist/integrations/pi/engine/ports.d.ts +56 -0
- package/dist/integrations/pi/engine/ports.js +93 -0
- package/dist/integrations/pi/engine/prompt-suggestions.d.ts +1 -0
- package/dist/integrations/pi/engine/prompt-suggestions.js +40 -0
- package/dist/integrations/pi/engine/resources/changelog.json +4 -4
- package/dist/integrations/pi/engine/runtime-integration.js +102 -29
- package/dist/integrations/pi/engine/session-runtime.d.ts +0 -6
- package/dist/integrations/pi/engine/session-runtime.js +13 -5
- package/dist/integrations/pi/engine/session-selection.d.ts +3 -0
- package/dist/integrations/pi/engine/session-selection.js +45 -9
- package/dist/integrations/pi/engine/settings-bridge.d.ts +5 -0
- package/dist/integrations/pi/engine/settings-bridge.js +15 -0
- package/dist/integrations/pi/engine/settings-port.js +11 -15
- package/dist/integrations/pi/engine/view-state.d.ts +42 -0
- package/dist/integrations/pi/engine/view-state.js +126 -0
- package/dist/integrations/pi/engine/workflow-contexts.js +10 -1
- package/dist/integrations/pi/engine/workflow-runner.js +74 -5
- package/dist/integrations/pi/engine/workflow-support.d.ts +12 -0
- package/dist/integrations/pi/engine/workflow-support.js +36 -0
- package/dist/integrations/pi/engine/workflows.d.ts +3 -1
- package/dist/integrations/pi/engine/workflows.js +1 -0
- package/dist/integrations/pi/startup-public.js +257 -310
- package/dist/integrations/pi/startup-public.manifest.json +564 -440
- package/dist/integrations/pi/tui-runtime/adapter.d.ts +6 -0
- package/dist/integrations/pi/tui-runtime/adapter.js +32 -1
- package/dist/integrations/pi/tui-runtime/contracts.d.ts +5 -0
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +12 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +31 -2
- package/dist/native/darwin-arm64/manifest.json +10 -7
- package/dist/native/darwin-arm64/process-guardian.node +0 -0
- package/dist/native/darwin-arm64/terminal-host-THIRD-PARTY-NOTICES.txt +10500 -0
- package/dist/native/darwin-arm64/terminal-host.manifest.json +46 -0
- package/dist/native/darwin-arm64/terminal-host.node +0 -0
- package/dist/native/darwin-x64/manifest.json +23 -0
- package/dist/native/darwin-x64/process-guardian.node +0 -0
- package/dist/native/darwin-x64/terminal-host-THIRD-PARTY-NOTICES.txt +10737 -0
- package/dist/native/darwin-x64/terminal-host.manifest.json +46 -0
- package/dist/native/darwin-x64/terminal-host.node +0 -0
- package/dist/native/linux-x64/manifest.json +10 -7
- package/dist/native/linux-x64/process-guardian.node +0 -0
- package/dist/native/linux-x64/terminal-host-THIRD-PARTY-NOTICES.txt +11226 -0
- package/dist/native/linux-x64/terminal-host.manifest.json +46 -0
- package/dist/native/linux-x64/terminal-host.node +0 -0
- package/dist/native/win32-x64/manifest.json +10 -7
- package/dist/native/win32-x64/process-guardian.node +0 -0
- package/dist/native/win32-x64/terminal-host-THIRD-PARTY-NOTICES.txt +10757 -0
- package/dist/native/win32-x64/terminal-host.manifest.json +46 -0
- package/dist/native/win32-x64/terminal-host.node +0 -0
- package/dist/product-identity.d.ts +3 -3
- package/dist/product-identity.js +4 -4
- package/dist/product-identity.json +16 -2
- package/dist/runtime-payload-inventory.json +6330 -6677
- package/dist/ui/apps/host.d.ts +2 -0
- package/dist/ui/apps/host.js +7 -1
- package/dist/ui/components/dialog-panel.d.ts +17 -8
- package/dist/ui/components/dialog-panel.js +117 -41
- package/dist/ui/components/index.d.ts +5 -5
- package/dist/ui/components/index.js +4 -4
- package/dist/ui/components/line-input.d.ts +4 -1
- package/dist/ui/components/line-input.js +3 -1
- package/dist/ui/components/prompt-input.d.ts +11 -8
- package/dist/ui/components/prompt-input.js +15 -13
- package/dist/ui/components/scrollbar.d.ts +1 -1
- package/dist/ui/components/scrollbar.js +1 -1
- package/dist/ui/components/selection-copy.d.ts +3 -3
- package/dist/ui/components/selection-copy.js +16 -1
- package/dist/ui/components/spans.js +2 -2
- package/dist/ui/components/submitted-prompt.d.ts +9 -6
- package/dist/ui/components/submitted-prompt.js +20 -12
- package/dist/ui/components/surface.js +4 -2
- package/dist/ui/components/text-selection.d.ts +1 -2
- package/dist/ui/components/text-selection.js +5 -2
- package/dist/ui/components/text.d.ts +3 -6
- package/dist/ui/components/text.js +6 -8
- package/dist/ui/components/transcript-viewport.d.ts +9 -2
- package/dist/ui/components/transcript-viewport.js +179 -58
- package/dist/ui/settings/declarations.d.ts +90 -16
- package/dist/ui/settings/declarations.js +67 -14
- package/dist/ui/settings/early-accent.d.ts +81 -0
- package/dist/ui/settings/early-accent.js +50 -0
- package/dist/ui/settings/index.d.ts +4 -2
- package/dist/ui/settings/index.js +2 -1
- package/dist/ui/settings/manager.d.ts +16 -3
- package/dist/ui/settings/manager.js +122 -33
- package/dist/ui/settings/migrations.d.ts +6 -0
- package/dist/ui/settings/migrations.js +73 -0
- package/dist/ui/settings/profile-document.d.ts +26 -0
- package/dist/ui/settings/profile-document.js +164 -0
- package/dist/ui/settings/progress-palette.generated.d.ts +139 -0
- package/dist/ui/settings/progress-palette.generated.js +139 -0
- package/dist/ui/settings/sections.d.ts +4 -0
- package/dist/ui/settings/sections.js +9 -3
- package/docs/architecture/boundaries.md +24 -9
- package/docs/architecture/evidence/resident-tabs/linux-x64.md +37 -0
- package/docs/architecture/evidence/resident-tabs/macos-arm64.md +36 -0
- package/docs/architecture/evidence/resident-tabs/macos-x64.md +35 -0
- package/docs/architecture/evidence/resident-tabs/windows-x64.md +36 -0
- package/docs/architecture/internal-naming.md +3 -1
- package/docs/architecture/process-guardian-provenance.md +18 -10
- package/docs/architecture/project-structure.md +8 -0
- package/docs/architecture/resident-tabs-requirements.md +18 -0
- package/docs/architecture/resident-tabs.md +649 -0
- package/docs/architecture/response-copy-delivery.md +1 -1
- package/docs/architecture/terminal-host-proof-gate.md +2 -0
- package/docs/architecture/terminal-host-provenance.md +16 -4
- package/docs/architecture/tool-image-presentation.md +2 -1
- package/docs/architecture/toolchain.md +11 -9
- package/docs/ci-release-runbook.md +14 -7
- package/docs/features/launch-profiles.md +11 -8
- package/docs/features/prompt-history.md +41 -20
- package/docs/manual-resident-tabs-acceptance.md +51 -0
- package/docs/openspec-archive-automation.md +49 -22
- package/docs/validation.md +49 -9
- package/package.json +19 -6
- package/dist/foundation/process-containment/darwin-process-inspector.d.ts +0 -5
- package/dist/foundation/process-containment/darwin-process-inspector.js +0 -7
- package/dist/foundation/process-containment/native-guardian-containment.js +0 -152
- package/dist/foundation/process-containment/windows-process-inspector.d.ts +0 -19
- package/dist/foundation/process-containment/windows-process-inspector.js +0 -56
- package/dist/native/darwin-arm64/process-guardian +0 -0
- package/dist/native/linux-x64/process-guardian +0 -0
- package/dist/native/win32-x64/process-guardian.exe +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ImageAttachmentError, OwnedUiSessionViewModel } from "../../contracts/owned-ui/index.js";
|
|
2
|
+
import type { TranscriptViewportFrame } from "../../ui/components/transcript-viewport.js";
|
|
3
|
+
import { type PiShellReleaseUpdateBanner } from "../../integrations/pi/components/shell-presenters-info.js";
|
|
4
|
+
import type { SessionViewportController } from "./session-viewport-controller.js";
|
|
5
|
+
export interface DockNotice {
|
|
6
|
+
readonly kind: "status" | "warning" | "error" | "new-session";
|
|
7
|
+
readonly message: string;
|
|
8
|
+
readonly errorCode?: ImageAttachmentError["code"];
|
|
9
|
+
}
|
|
10
|
+
export interface DockChromePorts {
|
|
11
|
+
/** Chrome changed; the root invalidates its chrome components. */
|
|
12
|
+
readonly invalidateChrome: () => void;
|
|
13
|
+
readonly requestRender: () => void;
|
|
14
|
+
readonly viewport: Pick<SessionViewportController, "tailControlHovered" | "setTailControl">;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The transient chrome around bare A1's dock: the one command notice above the editor, the release
|
|
18
|
+
* banner above Working with its close control, and the short copy acknowledgement.
|
|
19
|
+
*/
|
|
20
|
+
export declare class DockChrome {
|
|
21
|
+
#private;
|
|
22
|
+
constructor(ports: DockChromePorts);
|
|
23
|
+
get notice(): DockNotice | undefined;
|
|
24
|
+
setNotice(notice: DockNotice): void;
|
|
25
|
+
dismissNotice(): void;
|
|
26
|
+
/** Forgets the notice without a chrome invalidation; the caller invalidates as part of a larger change. */
|
|
27
|
+
forgetNotice(): void;
|
|
28
|
+
renderNotice(width: number, outputPad: 0 | 1): readonly string[];
|
|
29
|
+
showCopyAcknowledgement(message: string): void;
|
|
30
|
+
clearCopyAcknowledgement(requestRender: boolean): void;
|
|
31
|
+
renderCopyAcknowledgement(width: number): string | undefined;
|
|
32
|
+
renderReleaseBanner(diagnostics: OwnedUiSessionViewModel["diagnostics"], width: number): PiShellReleaseUpdateBanner | undefined;
|
|
33
|
+
locateReleaseClose(frame: TranscriptViewportFrame, banner: PiShellReleaseUpdateBanner | undefined, tailEnd: number, tailLength: number): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { COPY_ACKNOWLEDGEMENT_DURATION_MS } from "../../ui/components/selection-copy.js";
|
|
2
|
+
import { renderPiShellCommandMessage, renderPiShellReleaseUpdateBanner, renderPiShellStatusText, } from "../../integrations/pi/components/shell-presenters-info.js";
|
|
3
|
+
import { PINNED_PI_LAYOUT, piTheme } from "../../integrations/pi/components/upstream/theme/theme.js";
|
|
4
|
+
import { piShellTruncateToWidth } from "../../integrations/pi/components/shell-shared-facade.js";
|
|
5
|
+
import { parseReleaseUpdateDiagnostic } from "./transcript-document.js";
|
|
6
|
+
/**
|
|
7
|
+
* The transient chrome around bare A1's dock: the one command notice above the editor, the release
|
|
8
|
+
* banner above Working with its close control, and the short copy acknowledgement.
|
|
9
|
+
*/
|
|
10
|
+
export class DockChrome {
|
|
11
|
+
#ports;
|
|
12
|
+
#notice;
|
|
13
|
+
// Invariant: bare A1 docks the release notice above the live status; closing it lasts for this session only.
|
|
14
|
+
#releaseDismissed = false;
|
|
15
|
+
#releaseCloseTarget;
|
|
16
|
+
#copyAcknowledgement;
|
|
17
|
+
#copyAcknowledgementTimer;
|
|
18
|
+
constructor(ports) {
|
|
19
|
+
this.#ports = ports;
|
|
20
|
+
}
|
|
21
|
+
get notice() {
|
|
22
|
+
return this.#notice;
|
|
23
|
+
}
|
|
24
|
+
setNotice(notice) {
|
|
25
|
+
this.#notice = notice;
|
|
26
|
+
this.#ports.invalidateChrome();
|
|
27
|
+
}
|
|
28
|
+
dismissNotice() {
|
|
29
|
+
if (this.#notice === undefined)
|
|
30
|
+
return;
|
|
31
|
+
this.#notice = undefined;
|
|
32
|
+
this.#ports.invalidateChrome();
|
|
33
|
+
}
|
|
34
|
+
/** Forgets the notice without a chrome invalidation; the caller invalidates as part of a larger change. */
|
|
35
|
+
forgetNotice() {
|
|
36
|
+
this.#notice = undefined;
|
|
37
|
+
}
|
|
38
|
+
renderNotice(width, outputPad) {
|
|
39
|
+
const notice = this.#notice;
|
|
40
|
+
if (notice === undefined)
|
|
41
|
+
return [];
|
|
42
|
+
if (notice.kind === "status") {
|
|
43
|
+
// Compatibility: Pi pads its status text by one cell regardless of the output pad setting.
|
|
44
|
+
return ["", ...renderPiShellStatusText(notice.message, width, PINNED_PI_LAYOUT.outputPad)];
|
|
45
|
+
}
|
|
46
|
+
return renderPiShellCommandMessage({
|
|
47
|
+
kind: notice.kind === "new-session" ? "accent" : notice.kind,
|
|
48
|
+
message: notice.message,
|
|
49
|
+
}, width, outputPad);
|
|
50
|
+
}
|
|
51
|
+
showCopyAcknowledgement(message) {
|
|
52
|
+
this.clearCopyAcknowledgement(false);
|
|
53
|
+
this.#copyAcknowledgement = message;
|
|
54
|
+
const timer = setTimeout(() => {
|
|
55
|
+
if (this.#copyAcknowledgementTimer !== timer)
|
|
56
|
+
return;
|
|
57
|
+
this.#copyAcknowledgementTimer = undefined;
|
|
58
|
+
this.#copyAcknowledgement = undefined;
|
|
59
|
+
this.#ports.invalidateChrome();
|
|
60
|
+
this.#ports.requestRender();
|
|
61
|
+
}, COPY_ACKNOWLEDGEMENT_DURATION_MS);
|
|
62
|
+
timer.unref?.();
|
|
63
|
+
this.#copyAcknowledgementTimer = timer;
|
|
64
|
+
this.#ports.invalidateChrome();
|
|
65
|
+
this.#ports.requestRender();
|
|
66
|
+
}
|
|
67
|
+
clearCopyAcknowledgement(requestRender) {
|
|
68
|
+
if (this.#copyAcknowledgementTimer !== undefined)
|
|
69
|
+
clearTimeout(this.#copyAcknowledgementTimer);
|
|
70
|
+
this.#copyAcknowledgementTimer = undefined;
|
|
71
|
+
if (this.#copyAcknowledgement === undefined)
|
|
72
|
+
return;
|
|
73
|
+
this.#copyAcknowledgement = undefined;
|
|
74
|
+
this.#ports.invalidateChrome();
|
|
75
|
+
if (requestRender)
|
|
76
|
+
this.#ports.requestRender();
|
|
77
|
+
}
|
|
78
|
+
renderCopyAcknowledgement(width) {
|
|
79
|
+
if (this.#copyAcknowledgement === undefined || width <= 0)
|
|
80
|
+
return undefined;
|
|
81
|
+
return piTheme().fg("accent", piShellTruncateToWidth(this.#copyAcknowledgement, width));
|
|
82
|
+
}
|
|
83
|
+
renderReleaseBanner(diagnostics, width) {
|
|
84
|
+
if (this.#releaseDismissed)
|
|
85
|
+
return undefined;
|
|
86
|
+
const diagnostic = diagnostics.findLast(item => item.code === "release-update");
|
|
87
|
+
const release = diagnostic === undefined ? null : parseReleaseUpdateDiagnostic(diagnostic.message);
|
|
88
|
+
if (release === null)
|
|
89
|
+
return undefined;
|
|
90
|
+
return renderPiShellReleaseUpdateBanner(release, width, this.#ports.viewport.tailControlHovered(this.#releaseCloseTarget));
|
|
91
|
+
}
|
|
92
|
+
locateReleaseClose(frame, banner, tailEnd, tailLength) {
|
|
93
|
+
// Invariant: the tail is the document suffix, so the control's document row is fixed relative to its
|
|
94
|
+
// end; alignment gap rows precede it and the viewport scroll decides whether it is on screen.
|
|
95
|
+
const bannerStart = tailEnd + frame.descriptor.transientAlignmentGapRows - tailLength - frame.scrollTop + 1;
|
|
96
|
+
const rowStart = banner === undefined ? 0 : Math.max(1, bannerStart + banner.close.rowStart);
|
|
97
|
+
const rowEnd = banner === undefined ? 0 : Math.min(frame.hits.viewportHeight, bannerStart + banner.close.rowEnd);
|
|
98
|
+
this.#releaseCloseTarget = banner !== undefined && rowStart <= rowEnd
|
|
99
|
+
? { rowStart, rowEnd, columnStart: banner.close.columnStart, columnEnd: banner.close.columnEnd }
|
|
100
|
+
: undefined;
|
|
101
|
+
this.#ports.viewport.setTailControl(this.#releaseCloseTarget === undefined ? undefined : {
|
|
102
|
+
...this.#releaseCloseTarget,
|
|
103
|
+
activate: () => {
|
|
104
|
+
this.#releaseDismissed = true;
|
|
105
|
+
this.#releaseCloseTarget = undefined;
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { renameSync, rmSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { PRODUCT_IDENTITY } from "../../product-identity.js";
|
|
9
|
-
import { formatSessionResumeCommand } from "./session-
|
|
9
|
+
import { formatSessionResumeCommand } from "./session-lifecycle.js";
|
|
10
10
|
export function uncleanExitNoticeLines(resume) {
|
|
11
11
|
return [
|
|
12
12
|
`${PRODUCT_IDENTITY.displayName} was stopped unexpectedly.`,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { OwnedUiSessionViewModel } from "../../contracts/owned-ui/index.js";
|
|
2
|
+
import type { PiShellComponentPort } from "../../integrations/pi/components/shell-shared-facade.js";
|
|
3
|
+
export type ExtensionWidgetPlacement = "aboveEditor" | "belowEditor";
|
|
4
|
+
/**
|
|
5
|
+
* What extensions draw into the shell: a header that replaces the built-in one, a footer, widgets
|
|
6
|
+
* above and below the editor, footer statuses, and a working message. It owns those components and
|
|
7
|
+
* disposes each one it replaces; the root decides what to invalidate after a change.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ExtensionSurface {
|
|
10
|
+
#private;
|
|
11
|
+
get header(): PiShellComponentPort | null;
|
|
12
|
+
get footer(): PiShellComponentPort | null;
|
|
13
|
+
get working(): {
|
|
14
|
+
readonly message: string | undefined;
|
|
15
|
+
readonly visible: boolean;
|
|
16
|
+
};
|
|
17
|
+
placeWidget(key: string, component: PiShellComponentPort | null, placement: ExtensionWidgetPlacement): void;
|
|
18
|
+
replaceHeader(component: PiShellComponentPort | null): void;
|
|
19
|
+
replaceFooter(component: PiShellComponentPort | null): void;
|
|
20
|
+
setStatus(key: string, text: string | undefined): void;
|
|
21
|
+
setWorking(message: string | undefined, visible: boolean): void;
|
|
22
|
+
statuses(): Map<string, string>;
|
|
23
|
+
/** The view with extension statuses merged over the engine's footer statuses. */
|
|
24
|
+
withStatuses(view: OwnedUiSessionViewModel): OwnedUiSessionViewModel;
|
|
25
|
+
renderWidgets(placement: ExtensionWidgetPlacement, width: number): readonly string[];
|
|
26
|
+
invalidate(): void;
|
|
27
|
+
/** Disposes and forgets everything an extension set; working visibility is the extension's own choice and stays. */
|
|
28
|
+
reset(): void;
|
|
29
|
+
dispose(): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What extensions draw into the shell: a header that replaces the built-in one, a footer, widgets
|
|
3
|
+
* above and below the editor, footer statuses, and a working message. It owns those components and
|
|
4
|
+
* disposes each one it replaces; the root decides what to invalidate after a change.
|
|
5
|
+
*/
|
|
6
|
+
export class ExtensionSurface {
|
|
7
|
+
#header = null;
|
|
8
|
+
#footer = null;
|
|
9
|
+
#widgets = new Map();
|
|
10
|
+
#statuses = new Map();
|
|
11
|
+
#workingMessage;
|
|
12
|
+
#workingVisible = true;
|
|
13
|
+
get header() {
|
|
14
|
+
return this.#header;
|
|
15
|
+
}
|
|
16
|
+
get footer() {
|
|
17
|
+
return this.#footer;
|
|
18
|
+
}
|
|
19
|
+
get working() {
|
|
20
|
+
return { message: this.#workingMessage, visible: this.#workingVisible };
|
|
21
|
+
}
|
|
22
|
+
placeWidget(key, component, placement) {
|
|
23
|
+
const previous = this.#widgets.get(key)?.component;
|
|
24
|
+
if (component === null)
|
|
25
|
+
this.#widgets.delete(key);
|
|
26
|
+
else
|
|
27
|
+
this.#widgets.set(key, { component, placement });
|
|
28
|
+
if (previous !== undefined && previous !== component)
|
|
29
|
+
previous.dispose?.();
|
|
30
|
+
}
|
|
31
|
+
replaceHeader(component) {
|
|
32
|
+
if (this.#header !== component)
|
|
33
|
+
this.#header?.dispose?.();
|
|
34
|
+
this.#header = component;
|
|
35
|
+
}
|
|
36
|
+
replaceFooter(component) {
|
|
37
|
+
if (this.#footer !== component)
|
|
38
|
+
this.#footer?.dispose?.();
|
|
39
|
+
this.#footer = component;
|
|
40
|
+
}
|
|
41
|
+
setStatus(key, text) {
|
|
42
|
+
if (text === undefined)
|
|
43
|
+
this.#statuses.delete(key);
|
|
44
|
+
else
|
|
45
|
+
this.#statuses.set(key, text);
|
|
46
|
+
}
|
|
47
|
+
setWorking(message, visible) {
|
|
48
|
+
this.#workingMessage = message;
|
|
49
|
+
this.#workingVisible = visible;
|
|
50
|
+
}
|
|
51
|
+
statuses() {
|
|
52
|
+
return new Map(this.#statuses);
|
|
53
|
+
}
|
|
54
|
+
/** The view with extension statuses merged over the engine's footer statuses. */
|
|
55
|
+
withStatuses(view) {
|
|
56
|
+
const footer = view.status.footer;
|
|
57
|
+
const statuses = new Map(footer?.extensionStatuses ?? []);
|
|
58
|
+
for (const [key, text] of this.#statuses)
|
|
59
|
+
statuses.set(key, text);
|
|
60
|
+
return {
|
|
61
|
+
...view,
|
|
62
|
+
status: {
|
|
63
|
+
...view.status,
|
|
64
|
+
footer: {
|
|
65
|
+
...footer,
|
|
66
|
+
branch: footer?.branch ?? null,
|
|
67
|
+
sessionName: footer?.sessionName ?? null,
|
|
68
|
+
availableProviderCount: footer?.availableProviderCount ?? 1,
|
|
69
|
+
extensionStatuses: [...statuses],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
renderWidgets(placement, width) {
|
|
75
|
+
const rows = [...this.#widgets.values()]
|
|
76
|
+
.filter(widget => widget.placement === placement)
|
|
77
|
+
.flatMap(widget => widget.component.render(width));
|
|
78
|
+
return placement === "aboveEditor" ? ["", ...rows] : rows;
|
|
79
|
+
}
|
|
80
|
+
invalidate() {
|
|
81
|
+
this.#header?.invalidate();
|
|
82
|
+
this.#footer?.invalidate();
|
|
83
|
+
for (const { component } of this.#widgets.values())
|
|
84
|
+
component.invalidate();
|
|
85
|
+
}
|
|
86
|
+
/** Disposes and forgets everything an extension set; working visibility is the extension's own choice and stays. */
|
|
87
|
+
reset() {
|
|
88
|
+
this.#header?.dispose?.();
|
|
89
|
+
this.#footer?.dispose?.();
|
|
90
|
+
for (const { component } of this.#widgets.values())
|
|
91
|
+
component.dispose?.();
|
|
92
|
+
this.#header = null;
|
|
93
|
+
this.#footer = null;
|
|
94
|
+
this.#widgets.clear();
|
|
95
|
+
this.#statuses.clear();
|
|
96
|
+
this.#workingMessage = undefined;
|
|
97
|
+
}
|
|
98
|
+
dispose() {
|
|
99
|
+
this.#header?.dispose?.();
|
|
100
|
+
this.#footer?.dispose?.();
|
|
101
|
+
for (const { component } of this.#widgets.values())
|
|
102
|
+
component.dispose?.();
|
|
103
|
+
this.#widgets.clear();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -12,16 +12,14 @@ export interface HelperPoolOptions {
|
|
|
12
12
|
readonly stop: (child: ChildProcess) => void;
|
|
13
13
|
readonly idleMs?: number;
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Keeps one forked IPC helper ready so a request takes a live child instead of paying fork and module
|
|
17
|
-
* load on its own critical path. The spare stays idle on its channel until it is taken; a spare that
|
|
18
|
-
* exits or idles too long is dropped, and the next request forks cold and warms a replacement afterwards.
|
|
19
|
-
*/
|
|
15
|
+
/** Holds one idle IPC helper; requests take it, and exits, expiry, or use trigger replacement. */
|
|
20
16
|
export declare class HelperPool {
|
|
21
17
|
#private;
|
|
22
18
|
constructor(options: HelperPoolOptions);
|
|
23
19
|
/** Whether a spare is currently held (ready or still starting). */
|
|
24
20
|
get warmed(): boolean;
|
|
21
|
+
/** Whether the held spare has announced that module loading is complete. */
|
|
22
|
+
get ready(): boolean;
|
|
25
23
|
/** Opts the pool in and forks the first spare; from here on `replenish` keeps one ready after each request. */
|
|
26
24
|
warm(): void;
|
|
27
25
|
/** Forks the next spare after a request released its child; a no-op until the owner warmed the pool. A fork failure leaves the pool empty. */
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
/** How long an unused spare helper may idle before it is stopped so a background session holds no extra process. */
|
|
2
2
|
export const HELPER_SPARE_IDLE_MS = 5 * 60_000;
|
|
3
|
-
/**
|
|
4
|
-
* Keeps one forked IPC helper ready so a request takes a live child instead of paying fork and module
|
|
5
|
-
* load on its own critical path. The spare stays idle on its channel until it is taken; a spare that
|
|
6
|
-
* exits or idles too long is dropped, and the next request forks cold and warms a replacement afterwards.
|
|
7
|
-
*/
|
|
3
|
+
/** Holds one idle IPC helper; requests take it, and exits, expiry, or use trigger replacement. */
|
|
8
4
|
export class HelperPool {
|
|
9
5
|
#fork;
|
|
10
6
|
#stop;
|
|
@@ -19,6 +15,8 @@ export class HelperPool {
|
|
|
19
15
|
}
|
|
20
16
|
/** Whether a spare is currently held (ready or still starting). */
|
|
21
17
|
get warmed() { return this.#spare !== undefined; }
|
|
18
|
+
/** Whether the held spare has announced that module loading is complete. */
|
|
19
|
+
get ready() { return this.#spare?.ready === true; }
|
|
22
20
|
/** Opts the pool in and forks the first spare; from here on `replenish` keeps one ready after each request. */
|
|
23
21
|
warm() {
|
|
24
22
|
if (this.#disposed)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { PiShellComponentPort, PiShellEditorPort } from "../../integrations/pi/components/shell-shared-facade.js";
|
|
2
|
+
import { type PiTuiInputSurfaceKind } from "../../integrations/pi/tui-runtime/input-presentation-coordinator.js";
|
|
3
|
+
import type { SessionViewportController } from "./session-viewport-controller.js";
|
|
4
|
+
export interface InputSurfaceSwitchPorts {
|
|
5
|
+
/** Whether keystrokes that cannot change the transcript may repaint the dock alone. */
|
|
6
|
+
readonly dockInputReuse: boolean;
|
|
7
|
+
readonly viewport: Pick<SessionViewportController, "invalidateInputSurface" | "presentationRevision">;
|
|
8
|
+
/** The surface changed; listeners outside the root react. */
|
|
9
|
+
readonly onChanged?: () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Which component receives the dock's input: the prompt editor, or a selector, dialog, or prompt
|
|
13
|
+
* that temporarily replaces it. It also records whether the latest keystroke is safe for a
|
|
14
|
+
* dock-only repaint; that receipt-time evidence never authorizes reuse by itself.
|
|
15
|
+
*/
|
|
16
|
+
export declare class InputSurfaceSwitch {
|
|
17
|
+
#private;
|
|
18
|
+
constructor(editor: PiShellEditorPort, ports: InputSurfaceSwitchPorts);
|
|
19
|
+
get surface(): PiShellComponentPort;
|
|
20
|
+
get coordination(): PiTuiInputSurfaceKind;
|
|
21
|
+
get usesEditor(): boolean;
|
|
22
|
+
get dockInputCandidate(): boolean;
|
|
23
|
+
get dockInputRevision(): number | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Shows `component` in the dock, or the editor for null. Returns false when the surface is
|
|
26
|
+
* unchanged, in which case only its coordination kind is updated.
|
|
27
|
+
*/
|
|
28
|
+
set(component: PiShellComponentPort | null, disposePrevious: boolean, coordination: Exclude<PiTuiInputSurfaceKind, "editor">): boolean;
|
|
29
|
+
handleInput(data: string): void;
|
|
30
|
+
/** Reads and clears the dock-only candidate for one composition. */
|
|
31
|
+
takeDockInputCandidate(): boolean;
|
|
32
|
+
/** Something outside the dock changed, so the latest keystroke no longer qualifies for reuse. */
|
|
33
|
+
clearDockInputCandidate(): void;
|
|
34
|
+
/** Disposes a replacement surface; the editor is disposed by its owner. */
|
|
35
|
+
dispose(): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { classifyPiTuiInput } from "../../integrations/pi/tui-runtime/input-presentation-coordinator.js";
|
|
2
|
+
/**
|
|
3
|
+
* Which component receives the dock's input: the prompt editor, or a selector, dialog, or prompt
|
|
4
|
+
* that temporarily replaces it. It also records whether the latest keystroke is safe for a
|
|
5
|
+
* dock-only repaint; that receipt-time evidence never authorizes reuse by itself.
|
|
6
|
+
*/
|
|
7
|
+
export class InputSurfaceSwitch {
|
|
8
|
+
#editor;
|
|
9
|
+
#ports;
|
|
10
|
+
#surface;
|
|
11
|
+
#coordination = "editor";
|
|
12
|
+
#dockInputCandidate = false;
|
|
13
|
+
// Invariant: receipt-time eligibility is evidence, never authorization for composition-time reuse.
|
|
14
|
+
#dockInputRevision;
|
|
15
|
+
constructor(editor, ports) {
|
|
16
|
+
this.#editor = editor;
|
|
17
|
+
this.#ports = ports;
|
|
18
|
+
this.#surface = editor;
|
|
19
|
+
}
|
|
20
|
+
get surface() {
|
|
21
|
+
return this.#surface;
|
|
22
|
+
}
|
|
23
|
+
get coordination() {
|
|
24
|
+
return this.#coordination;
|
|
25
|
+
}
|
|
26
|
+
get usesEditor() {
|
|
27
|
+
return this.#surface === this.#editor;
|
|
28
|
+
}
|
|
29
|
+
get dockInputCandidate() {
|
|
30
|
+
return this.#dockInputCandidate;
|
|
31
|
+
}
|
|
32
|
+
get dockInputRevision() {
|
|
33
|
+
return this.#dockInputRevision;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Shows `component` in the dock, or the editor for null. Returns false when the surface is
|
|
37
|
+
* unchanged, in which case only its coordination kind is updated.
|
|
38
|
+
*/
|
|
39
|
+
set(component, disposePrevious, coordination) {
|
|
40
|
+
const next = component ?? this.#editor;
|
|
41
|
+
const nextCoordination = next === this.#editor ? "editor" : coordination;
|
|
42
|
+
if (next === this.#surface) {
|
|
43
|
+
this.#coordination = nextCoordination;
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
this.#dockInputCandidate = false;
|
|
47
|
+
this.#ports.viewport.invalidateInputSurface();
|
|
48
|
+
this.#surface.setFocused?.(false);
|
|
49
|
+
if (disposePrevious && this.#surface !== this.#editor)
|
|
50
|
+
this.#surface.dispose?.();
|
|
51
|
+
this.#surface = next;
|
|
52
|
+
this.#coordination = nextCoordination;
|
|
53
|
+
this.#ports.onChanged?.();
|
|
54
|
+
this.#surface.setFocused?.(true);
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
handleInput(data) {
|
|
58
|
+
this.#dockInputCandidate = this.#ports.dockInputReuse && classifyPiTuiInput(data, this.#coordination) === "safe";
|
|
59
|
+
this.#dockInputRevision = this.#dockInputCandidate ? this.#ports.viewport.presentationRevision : undefined;
|
|
60
|
+
try {
|
|
61
|
+
this.#surface.handleInput?.(data);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
this.#dockInputCandidate = false;
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/** Reads and clears the dock-only candidate for one composition. */
|
|
69
|
+
takeDockInputCandidate() {
|
|
70
|
+
const candidate = this.#dockInputCandidate;
|
|
71
|
+
this.#dockInputCandidate = false;
|
|
72
|
+
return candidate;
|
|
73
|
+
}
|
|
74
|
+
/** Something outside the dock changed, so the latest keystroke no longer qualifies for reuse. */
|
|
75
|
+
clearDockInputCandidate() {
|
|
76
|
+
this.#dockInputCandidate = false;
|
|
77
|
+
this.#dockInputRevision = undefined;
|
|
78
|
+
}
|
|
79
|
+
/** Disposes a replacement surface; the editor is disposed by its owner. */
|
|
80
|
+
dispose() {
|
|
81
|
+
this.clearDockInputCandidate();
|
|
82
|
+
if (this.#surface !== this.#editor)
|
|
83
|
+
this.#surface.dispose?.();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { OwnedUiWorkflowInteractionRequest, OwnedUiWorkflowLoginNotification, OwnedUiWorkflowLoginStart } from "../../contracts/owned-ui/index.js";
|
|
2
|
+
import type { ProgramStatusReporter } from "../../integrations/pi/components/upstream/program-status-reporter.js";
|
|
3
|
+
import type { SessionConcern } from "./session-concern.js";
|
|
4
|
+
import type { OwnedUiSessionShellRoot } from "./session-shell-root.js";
|
|
5
|
+
import { type OwnedUiPresenterTerminal } from "./shell-host.js";
|
|
6
|
+
export interface LoginInteractionPorts {
|
|
7
|
+
readonly terminal: Pick<OwnedUiPresenterTerminal, "viewport" | "requestRender">;
|
|
8
|
+
readonly root: Pick<OwnedUiSessionShellRoot, "setInputSurface">;
|
|
9
|
+
readonly programStatus: Pick<ProgramStatusReporter, "setBlocked">;
|
|
10
|
+
/** The blocked-on-authentication state changed; the presenter republishes terminal progress. */
|
|
11
|
+
readonly syncProgress: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The engine's login flow in the dock: one login dialog at a time, the prompts and selections the
|
|
15
|
+
* engine asks through it, and the terminal's blocked-on-authentication status while it is open.
|
|
16
|
+
*/
|
|
17
|
+
export declare class LoginInteraction implements SessionConcern {
|
|
18
|
+
#private;
|
|
19
|
+
constructor(ports: LoginInteractionPorts);
|
|
20
|
+
start(request: OwnedUiWorkflowLoginStart): void;
|
|
21
|
+
/** Answers an engine prompt through the open dialog; null when no login is in progress or it is cancelled. */
|
|
22
|
+
requestInput(request: OwnedUiWorkflowInteractionRequest): Promise<string | null>;
|
|
23
|
+
notify(event: OwnedUiWorkflowLoginNotification): void;
|
|
24
|
+
finish(): void;
|
|
25
|
+
/** A replaced session forgets its dialog; the presenter clears the input surface as part of the same replacement. */
|
|
26
|
+
onSessionReplaced(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { createPiShellExtensionSelector, createPiShellLoginDialog, } from "../../integrations/pi/components/shell-selectors-dialogs.js";
|
|
2
|
+
import { componentRuntime } from "./shell-host.js";
|
|
3
|
+
/**
|
|
4
|
+
* The engine's login flow in the dock: one login dialog at a time, the prompts and selections the
|
|
5
|
+
* engine asks through it, and the terminal's blocked-on-authentication status while it is open.
|
|
6
|
+
*/
|
|
7
|
+
export class LoginInteraction {
|
|
8
|
+
#ports;
|
|
9
|
+
#dialog;
|
|
10
|
+
constructor(ports) {
|
|
11
|
+
this.#ports = ports;
|
|
12
|
+
}
|
|
13
|
+
start(request) {
|
|
14
|
+
this.finish();
|
|
15
|
+
const dialog = createPiShellLoginDialog(componentRuntime(this.#ports.terminal), request.providerId, success => {
|
|
16
|
+
if (!success)
|
|
17
|
+
this.finish();
|
|
18
|
+
}, request.providerName);
|
|
19
|
+
this.#dialog = dialog;
|
|
20
|
+
this.#ports.root.setInputSurface(dialog);
|
|
21
|
+
this.#ports.programStatus.setBlocked("authentication", {
|
|
22
|
+
kind: "auth",
|
|
23
|
+
message: `Log in to ${request.providerName}`,
|
|
24
|
+
});
|
|
25
|
+
this.#ports.syncProgress();
|
|
26
|
+
this.#ports.terminal.requestRender();
|
|
27
|
+
}
|
|
28
|
+
/** Answers an engine prompt through the open dialog; null when no login is in progress or it is cancelled. */
|
|
29
|
+
requestInput(request) {
|
|
30
|
+
const dialog = this.#dialog;
|
|
31
|
+
if (!dialog)
|
|
32
|
+
return Promise.resolve(null);
|
|
33
|
+
if (request.type === "select") {
|
|
34
|
+
return new Promise(resolve => {
|
|
35
|
+
const options = request.options ?? [];
|
|
36
|
+
const labels = options.map(option => option.label);
|
|
37
|
+
const restoreDialog = () => {
|
|
38
|
+
if (this.#dialog === dialog)
|
|
39
|
+
this.#ports.root.setInputSurface(dialog);
|
|
40
|
+
this.#ports.terminal.requestRender();
|
|
41
|
+
};
|
|
42
|
+
const selector = createPiShellExtensionSelector(request.message, labels, label => {
|
|
43
|
+
const id = options.find(option => option.label === label)?.id;
|
|
44
|
+
restoreDialog();
|
|
45
|
+
resolve(id ?? null);
|
|
46
|
+
}, () => {
|
|
47
|
+
restoreDialog();
|
|
48
|
+
resolve(null);
|
|
49
|
+
});
|
|
50
|
+
this.#ports.root.setInputSurface(selector, false);
|
|
51
|
+
this.#ports.terminal.requestRender();
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const response = request.type === "manual-code"
|
|
55
|
+
? dialog.showManualInput(request.message)
|
|
56
|
+
: dialog.showPrompt(request.message, request.placeholder);
|
|
57
|
+
this.#ports.terminal.requestRender();
|
|
58
|
+
return response.then(value => value, () => null);
|
|
59
|
+
}
|
|
60
|
+
notify(event) {
|
|
61
|
+
const dialog = this.#dialog;
|
|
62
|
+
if (!dialog)
|
|
63
|
+
return;
|
|
64
|
+
if (event.type === "auth_url")
|
|
65
|
+
dialog.showAuth(event.url, event.instructions);
|
|
66
|
+
else if (event.type === "device_code") {
|
|
67
|
+
dialog.showDeviceCode(event);
|
|
68
|
+
dialog.showWaiting("Waiting for authentication...");
|
|
69
|
+
}
|
|
70
|
+
else if (event.type === "info")
|
|
71
|
+
dialog.showInfo(event.message, event.links);
|
|
72
|
+
else if (event.type === "waiting")
|
|
73
|
+
dialog.showWaiting(event.message);
|
|
74
|
+
else
|
|
75
|
+
dialog.showProgress(event.message);
|
|
76
|
+
this.#ports.terminal.requestRender();
|
|
77
|
+
}
|
|
78
|
+
finish() {
|
|
79
|
+
if (!this.#dialog)
|
|
80
|
+
return;
|
|
81
|
+
this.#dialog = undefined;
|
|
82
|
+
this.#ports.root.setInputSurface(null);
|
|
83
|
+
this.#ports.programStatus.setBlocked("authentication", undefined);
|
|
84
|
+
this.#ports.syncProgress();
|
|
85
|
+
this.#ports.terminal.requestRender();
|
|
86
|
+
}
|
|
87
|
+
/** A replaced session forgets its dialog; the presenter clears the input surface as part of the same replacement. */
|
|
88
|
+
onSessionReplaced() {
|
|
89
|
+
this.#dialog = undefined;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { OwnedUiCommand, OwnedUiCommandResult, OwnedUiSessionBackend, OwnedUiSessionViewModel, PromptHistoryImageSidecarPort } from "../../contracts/owned-ui/index.js";
|
|
2
|
+
import type { PromptHistoryController } from "./prompt-history-controller.js";
|
|
3
|
+
import type { ResidentTabCoordinator } from "./resident-tab-coordinator.js";
|
|
4
|
+
import type { SessionConcern } from "./session-concern.js";
|
|
5
|
+
import type { OwnedUiSessionShellRoot } from "./session-shell-root.js";
|
|
6
|
+
import type { OwnedUiPresenterTerminal } from "./shell-host.js";
|
|
7
|
+
export interface PromptSubmissionPorts {
|
|
8
|
+
readonly backend: Pick<OwnedUiSessionBackend, "session" | "identity" | "workflows">;
|
|
9
|
+
readonly root: Pick<OwnedUiSessionShellRoot, "editor" | "hasPendingPastes" | "waitForPromptPastes" | "setExtensionWidget" | "prepareHistoryText" | "imageChipAttachmentsFromEditor" | "preparePromptSubmission" | "omitUnsentPromptImages" | "resumeViewportFollowing" | "beginImageSubmissionStatus" | "appendWorkflowResult">;
|
|
10
|
+
readonly terminal: Pick<OwnedUiPresenterTerminal, "requestRender">;
|
|
11
|
+
readonly residentTab: ResidentTabCoordinator;
|
|
12
|
+
readonly cwd: string;
|
|
13
|
+
promptHistory(): PromptHistoryController | null;
|
|
14
|
+
imageSidecar(): PromptHistoryImageSidecarPort | undefined;
|
|
15
|
+
disposed(): boolean;
|
|
16
|
+
correlation(prefix: string): string;
|
|
17
|
+
lifecycle(): OwnedUiSessionViewModel["lifecycle"];
|
|
18
|
+
currentSessionFile(): string | null;
|
|
19
|
+
/** Slash input the presenter routes itself: owned routes, workflows, and skills. */
|
|
20
|
+
slashCommand(text: string): Promise<OwnedUiCommandResult>;
|
|
21
|
+
/** A prompt is about to be submitted; a pending suggestion for the old draft no longer applies. */
|
|
22
|
+
invalidateSuggestions(): void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Turns editor input into engine commands: prompts, steering, follow-ups, and bash, each recorded
|
|
26
|
+
* in history first. It holds a submission whose image pastes are still preparing, journals prompts
|
|
27
|
+
* for resident tabs, and recovers the draft when a submission is rejected.
|
|
28
|
+
*/
|
|
29
|
+
export declare class PromptSubmission implements SessionConcern {
|
|
30
|
+
#private;
|
|
31
|
+
constructor(ports: PromptSubmissionPorts);
|
|
32
|
+
/** True while a submission waits for its image pastes. */
|
|
33
|
+
get waiting(): boolean;
|
|
34
|
+
/** The editor changed; a later recovery never overwrites input typed after its submission. */
|
|
35
|
+
noteEditorChange(): void;
|
|
36
|
+
submit(text: string): Promise<OwnedUiCommandResult>;
|
|
37
|
+
queueFollowUp(draft: string): Promise<OwnedUiCommandResult>;
|
|
38
|
+
cancelWaiting(): void;
|
|
39
|
+
/** Puts waiting submissions and the engine's queued input back into the editor. */
|
|
40
|
+
restoreQueued(): void;
|
|
41
|
+
/** Sends slash text the shell does not own as engine prompt input; history keeps what was typed. */
|
|
42
|
+
sendSlashPrompt(text: string, typed?: string): Promise<OwnedUiCommandResult>;
|
|
43
|
+
/** Executes a command; with a draft, a rejected or failed submission puts the draft back for recovery. */
|
|
44
|
+
execute(command: OwnedUiCommand, draft?: string): Promise<OwnedUiCommandResult>;
|
|
45
|
+
reportError(error?: unknown, message?: string): void;
|
|
46
|
+
onSessionReplaced(): void;
|
|
47
|
+
dispose(): void;
|
|
48
|
+
}
|