@timurproko/a1 0.2.7-dev.1245 → 0.2.7-dev.1252
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 +11 -36
- package/bin/cli.js +2 -17
- package/bin/ui.js +7 -48
- package/dist/app/session-shell/exit-notice.d.ts +2 -2
- package/dist/app/session-shell/exit-notice.js +10 -10
- package/dist/app/session-shell/prompt-submission.d.ts +2 -4
- package/dist/app/session-shell/prompt-submission.js +3 -23
- package/dist/app/session-shell/response-copy-transport.js +1 -2
- package/dist/app/session-shell/session-lifecycle.d.ts +1 -2
- package/dist/app/session-shell/session-lifecycle.js +2 -4
- package/dist/app/session-shell/session-shell-root.d.ts +0 -31
- package/dist/app/session-shell/session-shell-root.js +3 -4
- package/dist/app/session-shell/session-shell.js +6 -47
- package/dist/app/session-shell/session-viewport-controller.js +3 -6
- package/dist/app/session-shell/shell-host.js +2 -18
- package/dist/app/session-shell/transcript-document.d.ts +1 -2
- package/dist/app/session-shell/transcript-document.js +3 -28
- package/dist/app/session-shell/workflow-output.js +1 -1
- package/dist/app/session-shell/workflow-router.d.ts +1 -3
- package/dist/app/session-shell/workflow-router.js +1 -4
- package/dist/cli/dispatch.d.ts +1 -11
- package/dist/cli/dispatch.js +5 -92
- package/dist/cli/session-context.js +5 -7
- package/dist/cli/uninstall.d.ts +1 -5
- package/dist/cli/uninstall.js +6 -35
- package/dist/cli/version-stats.js +4 -7
- package/dist/composition/owned-settings.d.ts +0 -1
- package/dist/composition/owned-settings.js +0 -1
- package/dist/composition/owned-ui.d.ts +2 -24
- package/dist/composition/owned-ui.js +11 -87
- package/dist/composition/release-update-observation.d.ts +4 -4
- package/dist/composition/release-update-observation.js +17 -47
- package/dist/composition/session-backend.d.ts +0 -1
- package/dist/composition/session-runtime-registry.d.ts +3 -3
- package/dist/composition/settings-route-host.d.ts +0 -7
- package/dist/composition/settings-route-host.js +4 -10
- package/dist/composition/startup-route.d.ts +0 -1
- package/dist/composition/startup-route.js +0 -1
- package/dist/contracts/owned-ui/index.d.ts +1 -1
- package/dist/contracts/owned-ui/model.d.ts +0 -3
- package/dist/contracts/owned-ui/session-workflows.d.ts +1 -4
- package/dist/features/launch/development-launch.js +0 -1
- package/dist/features/launch/index.d.ts +1 -1
- package/dist/features/launch/intent.d.ts +1 -3
- package/dist/features/launch/intent.js +2 -4
- package/dist/features/launch/session-context.d.ts +2 -2
- package/dist/features/owned-ui/reference-screen-app.d.ts +0 -2
- package/dist/features/owned-ui/reference-screen-app.js +2 -9
- package/dist/features/owned-ui/settings-app.d.ts +0 -6
- package/dist/features/owned-ui/settings-app.js +5 -36
- package/dist/foundation/launch-context/index.d.ts +0 -12
- package/dist/foundation/launch-context/index.js +0 -26
- package/dist/foundation/lifecycle/claim-gate.d.ts +8 -0
- package/dist/foundation/lifecycle/claim-gate.js +37 -0
- package/dist/foundation/lifecycle/index.d.ts +5 -9
- package/dist/foundation/lifecycle/index.js +3 -4
- package/dist/foundation/lifecycle/model.d.ts +2 -59
- package/dist/foundation/lifecycle/model.js +0 -35
- package/dist/foundation/lifecycle/paths.d.ts +0 -24
- package/dist/foundation/lifecycle/paths.js +0 -40
- package/dist/foundation/lifecycle/process-liveness.d.ts +8 -0
- package/dist/foundation/lifecycle/process-liveness.js +18 -0
- package/dist/foundation/lifecycle/session-claim-lock.d.ts +1 -1
- package/dist/foundation/lifecycle/session-claim-lock.js +2 -2
- package/dist/foundation/lifecycle/session-repository-context.d.ts +6 -6
- package/dist/foundation/lifecycle/session-repository-context.js +2 -3
- package/dist/foundation/release/automatic-update.d.ts +1 -3
- package/dist/foundation/release/automatic-update.js +9 -30
- package/dist/foundation/release/bootstrap.d.ts +2 -25
- package/dist/foundation/release/bootstrap.js +33 -344
- package/dist/foundation/release/cohort-state.d.ts +21 -46
- package/dist/foundation/release/cohort-state.js +30 -62
- package/dist/foundation/release/dependency-certification.d.ts +1 -1
- package/dist/foundation/release/index.d.ts +10 -17
- package/dist/foundation/release/index.js +7 -11
- package/dist/foundation/release/latest-release.d.ts +1 -2
- package/dist/foundation/release/latest-release.js +1 -2
- package/dist/foundation/release/process-liveness.d.ts +2 -0
- package/dist/foundation/release/process-liveness.js +12 -0
- package/dist/foundation/release/release-gc.d.ts +12 -9
- package/dist/foundation/release/release-gc.js +34 -98
- package/dist/foundation/release/release-store.d.ts +2 -2
- package/dist/foundation/release/release-store.js +2 -2
- package/dist/foundation/release/restart-certification.js +1 -1
- package/dist/foundation/release/update-activation.d.ts +2 -9
- package/dist/foundation/release/update-activation.js +28 -43
- package/dist/foundation/release/update-execution-lease.js +1 -1
- package/dist/foundation/release/update-launch.d.ts +0 -2
- package/dist/foundation/release/update-launch.js +0 -7
- package/dist/foundation/release/update-recovery.js +1 -1
- package/dist/foundation/release/update-transaction.d.ts +1 -1
- package/dist/foundation/release/update-transaction.js +5 -2
- package/dist/foundation/release/update.d.ts +2 -10
- package/dist/foundation/release/update.js +23 -200
- package/dist/foundation/session-writer-lock/index.d.ts +14 -6
- package/dist/foundation/session-writer-lock/index.js +48 -103
- package/dist/foundation/startup/startup-runtime.d.ts +1 -1
- package/dist/foundation/terminal-cleanup/exit-notice.d.ts +6 -0
- package/dist/foundation/terminal-cleanup/exit-notice.js +36 -0
- package/dist/foundation/terminal-cleanup/index.d.ts +2 -1
- package/dist/foundation/terminal-cleanup/index.js +2 -1
- package/dist/foundation/terminal-cleanup/terminal-reset.d.ts +0 -5
- package/dist/foundation/terminal-cleanup/terminal-reset.js +0 -5
- package/dist/integrations/pi/components/index.d.ts +1 -1
- package/dist/integrations/pi/components/index.js +1 -1
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +1 -4
- package/dist/integrations/pi/components/shell-footer-status.d.ts +1 -1
- package/dist/integrations/pi/components/shell-footer-status.js +2 -2
- package/dist/integrations/pi/components/shell-hotkey-sections.js +1 -1
- package/dist/integrations/pi/components/shell-presenters-info.d.ts +2 -5
- package/dist/integrations/pi/components/shell-presenters-info.js +4 -18
- package/dist/integrations/pi/components/shell-presenters-transcript.d.ts +1 -1
- package/dist/integrations/pi/components/shell-presenters-transcript.js +1 -1
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +0 -2
- package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +2 -5
- package/dist/integrations/pi/components/submitted-prompt-adapter.js +2 -16
- package/dist/integrations/pi/components/upstream/components/session-footer.d.ts +1 -2
- package/dist/integrations/pi/components/upstream/components/session-footer.js +6 -8
- package/dist/integrations/pi/engine/adapter.d.ts +0 -1
- package/dist/integrations/pi/engine/adapter.js +1 -16
- package/dist/integrations/pi/engine/compaction-progress.js +13 -5
- package/dist/integrations/pi/engine/diagnostics-state.d.ts +0 -1
- package/dist/integrations/pi/engine/diagnostics-state.js +0 -14
- package/dist/integrations/pi/engine/prompt-suggestions.d.ts +0 -1
- package/dist/integrations/pi/engine/prompt-suggestions.js +0 -40
- package/dist/integrations/pi/engine/session-runtime.js +0 -2
- package/dist/integrations/pi/engine/workflow-runner.js +1 -1
- package/dist/integrations/pi/tui-runtime/adapter.d.ts +2 -2
- package/dist/integrations/pi/tui-runtime/adapter.js +2 -2
- package/dist/product-identity.d.ts +4 -6
- package/dist/product-identity.js +6 -11
- package/dist/product-identity.json +1 -40
- package/dist/runtime-payload-inventory.json +0 -3
- package/dist/ui/components/index.d.ts +2 -2
- package/dist/ui/components/index.js +1 -1
- package/dist/ui/components/submitted-prompt.d.ts +3 -13
- package/dist/ui/components/submitted-prompt.js +8 -41
- package/dist/ui/components/transcript-viewport.d.ts +1 -3
- package/dist/ui/components/transcript-viewport.js +1 -4
- package/dist/ui/settings/declarations.d.ts +3 -97
- package/dist/ui/settings/declarations.js +3 -78
- package/dist/ui/settings/migrations.js +18 -2
- package/docs/architecture/boundaries.md +22 -39
- package/docs/architecture/code-documentation.md +2 -2
- package/docs/architecture/internal-naming.md +9 -17
- package/docs/architecture/project-structure.md +30 -29
- package/docs/architecture/resource-and-data-policy.md +16 -31
- package/docs/architecture/toolchain.md +14 -19
- package/docs/architecture/ui-reference-provenance.md +2 -2
- package/docs/ci-release-runbook.md +6 -4
- package/docs/features/launch-profiles.md +11 -17
- package/docs/features/prompt-history.md +10 -11
- package/docs/local-worktree-cleanup.md +32 -1
- package/docs/manual-owned-ui-checkpoint.md +0 -1
- package/docs/openspec-archive-automation.md +11 -3
- package/docs/validation.md +5 -9
- package/docs/worktree-link-recovery.md +6 -6
- package/package.json +7 -19
- package/bin/guardian.js +0 -42
- package/bin/supervisor.js +0 -7
- package/bin/tab-launch-context.d.ts +0 -27
- package/bin/tab-launch-context.js +0 -94
- package/dist/app/session-shell/resident-tab-coordinator.d.ts +0 -38
- package/dist/app/session-shell/resident-tab-coordinator.js +0 -77
- package/dist/cli/tabs-request.d.ts +0 -7
- package/dist/cli/tabs-request.js +0 -1
- package/dist/cli/tabs.d.ts +0 -14
- package/dist/cli/tabs.js +0 -151
- package/dist/composition/resident-tab-bridge.d.ts +0 -41
- package/dist/composition/resident-tab-bridge.js +0 -209
- package/dist/composition/utility-tab.d.ts +0 -28
- package/dist/composition/utility-tab.js +0 -244
- package/dist/features/owned-ui/plus-menu-dialog.d.ts +0 -28
- package/dist/features/owned-ui/plus-menu-dialog.js +0 -89
- package/dist/features/resident-tab/auto-name.d.ts +0 -11
- package/dist/features/resident-tab/auto-name.js +0 -44
- package/dist/features/resident-tab/index.d.ts +0 -5
- package/dist/features/resident-tab/index.js +0 -7
- package/dist/features/resident-tab/shortcut-bindings-file.d.ts +0 -8
- package/dist/features/resident-tab/shortcut-bindings-file.js +0 -40
- package/dist/features/resident-tab/shortcut-declarations.d.ts +0 -13
- package/dist/features/resident-tab/shortcut-declarations.js +0 -26
- package/dist/features/resident-tab/shortcut-projection.d.ts +0 -29
- package/dist/features/resident-tab/shortcut-projection.js +0 -64
- package/dist/features/resident-tab/status-deriver.d.ts +0 -10
- package/dist/features/resident-tab/status-deriver.js +0 -12
- package/dist/foundation/launch-guardian/exit-watcher.d.ts +0 -14
- package/dist/foundation/launch-guardian/exit-watcher.js +0 -103
- package/dist/foundation/launch-guardian/index.d.ts +0 -2
- package/dist/foundation/launch-guardian/index.js +0 -1
- package/dist/foundation/launch-guardian/main.d.ts +0 -39
- package/dist/foundation/launch-guardian/main.js +0 -232
- package/dist/foundation/lifecycle/commands.d.ts +0 -40
- package/dist/foundation/lifecycle/commands.js +0 -1
- package/dist/foundation/lifecycle/launch-instance.d.ts +0 -46
- package/dist/foundation/lifecycle/launch-instance.js +0 -134
- package/dist/foundation/lifecycle/native-claim-gate.d.ts +0 -5
- package/dist/foundation/lifecycle/native-claim-gate.js +0 -41
- package/dist/foundation/lifecycle/supervisor-startup.d.ts +0 -30
- package/dist/foundation/lifecycle/supervisor-startup.js +0 -106
- package/dist/foundation/process-containment/addon-containment.d.ts +0 -20
- package/dist/foundation/process-containment/addon-containment.js +0 -139
- package/dist/foundation/process-containment/addon-process-inspector.d.ts +0 -11
- package/dist/foundation/process-containment/addon-process-inspector.js +0 -36
- package/dist/foundation/process-containment/addon.d.ts +0 -47
- package/dist/foundation/process-containment/addon.js +0 -57
- package/dist/foundation/process-containment/artifact.d.ts +0 -1
- package/dist/foundation/process-containment/artifact.js +0 -35
- package/dist/foundation/process-containment/contracts.d.ts +0 -33
- package/dist/foundation/process-containment/contracts.js +0 -35
- package/dist/foundation/process-containment/index.d.ts +0 -9
- package/dist/foundation/process-containment/index.js +0 -7
- package/dist/foundation/process-containment/linux-process-inspector.d.ts +0 -7
- package/dist/foundation/process-containment/linux-process-inspector.js +0 -27
- package/dist/foundation/process-containment/native-process-inspector.d.ts +0 -4
- package/dist/foundation/process-containment/native-process-inspector.js +0 -21
- package/dist/foundation/protocol/client.d.ts +0 -18
- package/dist/foundation/protocol/client.js +0 -130
- package/dist/foundation/protocol/index.d.ts +0 -3
- package/dist/foundation/protocol/index.js +0 -2
- package/dist/foundation/protocol/messages.d.ts +0 -90
- package/dist/foundation/protocol/messages.js +0 -100
- package/dist/foundation/release/cohort-selection.d.ts +0 -33
- package/dist/foundation/release/cohort-selection.js +0 -67
- package/dist/foundation/release/endpoint-lock.d.ts +0 -2
- package/dist/foundation/release/endpoint-lock.js +0 -37
- package/dist/foundation/release/endpoint-recovery.d.ts +0 -10
- package/dist/foundation/release/endpoint-recovery.js +0 -45
- package/dist/foundation/release/endpoints.d.ts +0 -32
- package/dist/foundation/release/endpoints.js +0 -152
- package/dist/foundation/release/prepared-update-activation.d.ts +0 -3
- package/dist/foundation/release/prepared-update-activation.js +0 -27
- package/dist/foundation/release/process-cleanup.d.ts +0 -14
- package/dist/foundation/release/process-cleanup.js +0 -76
- package/dist/foundation/release/supervisor-identity.d.ts +0 -15
- package/dist/foundation/release/supervisor-identity.js +0 -63
- package/dist/foundation/resident-tabs/boot-identity.d.ts +0 -6
- package/dist/foundation/resident-tabs/boot-identity.js +0 -16
- package/dist/foundation/resident-tabs/bounded-host-command.d.ts +0 -20
- package/dist/foundation/resident-tabs/bounded-host-command.js +0 -62
- package/dist/foundation/resident-tabs/bridge-client.d.ts +0 -73
- package/dist/foundation/resident-tabs/bridge-client.js +0 -327
- package/dist/foundation/resident-tabs/continuity.d.ts +0 -12
- package/dist/foundation/resident-tabs/continuity.js +0 -63
- package/dist/foundation/resident-tabs/doctor.d.ts +0 -28
- package/dist/foundation/resident-tabs/doctor.js +0 -166
- package/dist/foundation/resident-tabs/draft-checkpoint.d.ts +0 -27
- package/dist/foundation/resident-tabs/draft-checkpoint.js +0 -145
- package/dist/foundation/resident-tabs/ensure-terminal-host.d.ts +0 -36
- package/dist/foundation/resident-tabs/ensure-terminal-host.js +0 -151
- package/dist/foundation/resident-tabs/fault-injection.d.ts +0 -8
- package/dist/foundation/resident-tabs/fault-injection.js +0 -26
- package/dist/foundation/resident-tabs/fixture-control.d.ts +0 -7
- package/dist/foundation/resident-tabs/fixture-control.js +0 -35
- package/dist/foundation/resident-tabs/host-entry.d.ts +0 -1
- package/dist/foundation/resident-tabs/host-entry.js +0 -17
- package/dist/foundation/resident-tabs/index.d.ts +0 -15
- package/dist/foundation/resident-tabs/index.js +0 -10
- package/dist/foundation/resident-tabs/maintenance.d.ts +0 -39
- package/dist/foundation/resident-tabs/maintenance.js +0 -75
- package/dist/foundation/resident-tabs/progress-observation-schema.d.ts +0 -34
- package/dist/foundation/resident-tabs/progress-observation-schema.js +0 -1
- package/dist/foundation/resident-tabs/progress-observation.d.ts +0 -4
- package/dist/foundation/resident-tabs/progress-observation.js +0 -150
- package/dist/foundation/resident-tabs/prompt-journal.d.ts +0 -63
- package/dist/foundation/resident-tabs/prompt-journal.js +0 -213
- package/dist/foundation/resident-tabs/protocol.d.ts +0 -12
- package/dist/foundation/resident-tabs/protocol.js +0 -195
- package/dist/foundation/resident-tabs/recovery.d.ts +0 -26
- package/dist/foundation/resident-tabs/recovery.js +0 -205
- package/dist/foundation/resident-tabs/release-holds.d.ts +0 -28
- package/dist/foundation/resident-tabs/release-holds.js +0 -78
- package/dist/foundation/resident-tabs/routes.d.ts +0 -5
- package/dist/foundation/resident-tabs/routes.js +0 -5
- package/dist/foundation/resident-tabs/routing.d.ts +0 -11
- package/dist/foundation/resident-tabs/routing.js +0 -10
- package/dist/foundation/resident-tabs/runtime-control.d.ts +0 -38
- package/dist/foundation/resident-tabs/runtime-control.js +0 -74
- package/dist/foundation/resident-tabs/session-sync.d.ts +0 -14
- package/dist/foundation/resident-tabs/session-sync.js +0 -37
- package/dist/foundation/resident-tabs/settings.d.ts +0 -16
- package/dist/foundation/resident-tabs/settings.js +0 -60
- package/dist/foundation/resident-tabs/terminal-host-artifact.d.ts +0 -14
- package/dist/foundation/resident-tabs/terminal-host-artifact.js +0 -78
- package/dist/foundation/resident-tabs/zip-archive.d.ts +0 -9
- package/dist/foundation/resident-tabs/zip-archive.js +0 -56
- package/dist/foundation/storage/control-store.d.ts +0 -20
- package/dist/foundation/storage/control-store.js +0 -331
- package/dist/foundation/storage/index.d.ts +0 -1
- package/dist/foundation/storage/index.js +0 -1
- package/dist/foundation/supervision/index.d.ts +0 -3
- package/dist/foundation/supervision/index.js +0 -3
- package/dist/foundation/supervision/main.d.ts +0 -1
- package/dist/foundation/supervision/main.js +0 -86
- package/dist/foundation/supervision/paths.d.ts +0 -1
- package/dist/foundation/supervision/paths.js +0 -1
- package/dist/foundation/supervision/server.d.ts +0 -46
- package/dist/foundation/supervision/server.js +0 -606
- package/dist/integrations/pi/engine/offline-settings-port.d.ts +0 -23
- package/dist/integrations/pi/engine/offline-settings-port.js +0 -54
- package/dist/native/darwin-arm64/manifest.json +0 -23
- package/dist/native/darwin-arm64/process-guardian.node +0 -0
- package/dist/native/darwin-arm64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -10500
- package/dist/native/darwin-arm64/terminal-host.manifest.json +0 -46
- package/dist/native/darwin-arm64/terminal-host.node +0 -0
- package/dist/native/darwin-x64/manifest.json +0 -23
- package/dist/native/darwin-x64/process-guardian.node +0 -0
- package/dist/native/darwin-x64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -10737
- package/dist/native/darwin-x64/terminal-host.manifest.json +0 -46
- package/dist/native/darwin-x64/terminal-host.node +0 -0
- package/dist/native/linux-x64/manifest.json +0 -23
- package/dist/native/linux-x64/process-guardian.node +0 -0
- package/dist/native/linux-x64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -11226
- package/dist/native/linux-x64/terminal-host.manifest.json +0 -46
- package/dist/native/linux-x64/terminal-host.node +0 -0
- package/dist/native/win32-x64/manifest.json +0 -23
- package/dist/native/win32-x64/process-guardian.node +0 -0
- package/dist/native/win32-x64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -10757
- package/dist/native/win32-x64/terminal-host.manifest.json +0 -46
- package/dist/native/win32-x64/terminal-host.node +0 -0
- package/docs/architecture/evidence/resident-tabs/linux-x64.md +0 -37
- package/docs/architecture/evidence/resident-tabs/macos-arm64.md +0 -36
- package/docs/architecture/evidence/resident-tabs/macos-x64.md +0 -35
- package/docs/architecture/evidence/resident-tabs/windows-x64.md +0 -36
- package/docs/architecture/evidence/terminal-host-spike/manual-one-pane-terminal-host.md +0 -70
- package/docs/architecture/evidence/terminal-host-spike/manual-two-by-two-basic-terminal-host.md +0 -32
- package/docs/architecture/evidence/terminal-host-spike/milestone-baseline.json +0 -115
- package/docs/architecture/evidence/terminal-host-spike/owned-ui-foundation-prerequisite.json +0 -48
- package/docs/architecture/evidence/terminal-host-spike/terminal-host-provenance.json +0 -125
- package/docs/architecture/evidence/terminal-host-spike/terminal-host-task-5-1.json +0 -56
- package/docs/architecture/evidence/terminal-host-spike/terminal-host-task-5-3.json +0 -174
- package/docs/architecture/evidence/terminal-host-spike/terminal-spike-acceptance-record.json +0 -18
- package/docs/architecture/native-fixture-isolation.md +0 -23
- package/docs/architecture/process-guardian-provenance.md +0 -36
- package/docs/architecture/resident-tabs-requirements.md +0 -18
- package/docs/architecture/resident-tabs.md +0 -668
- package/docs/architecture/terminal-host-proof-gate.md +0 -34
- package/docs/architecture/terminal-host-provenance.md +0 -81
- package/docs/architecture/terminal-host-spike-evidence.md +0 -39
- package/docs/launch-recovery.md +0 -23
- package/docs/manual-launch-instance-acceptance.md +0 -43
- package/docs/manual-resident-tabs-acceptance.md +0 -51
|
@@ -5,7 +5,6 @@ import { PromptHistoryController } from "./prompt-history-controller.js";
|
|
|
5
5
|
import { SessionDialogCoordinator } from "./dialog-coordinator.js";
|
|
6
6
|
import { LoginInteraction } from "./login-interaction.js";
|
|
7
7
|
import { PromptSubmission } from "./prompt-submission.js";
|
|
8
|
-
import { ResidentTabCoordinator } from "./resident-tab-coordinator.js";
|
|
9
8
|
import { SessionConcerns } from "./session-concern.js";
|
|
10
9
|
import { composeExitText, SessionStopLatch } from "./session-lifecycle.js";
|
|
11
10
|
import { openWorkflowSelector } from "./workflow-router.js";
|
|
@@ -28,15 +27,6 @@ import { writeSystemClipboardText, } from "./system-clipboard.js";
|
|
|
28
27
|
import { OwnedUiSessionShellRoot, shellResourceEntries, } from "./session-shell-root.js";
|
|
29
28
|
// Invariant: a disposed shell leaves the engine a host that holds no reference back to it.
|
|
30
29
|
const DETACHED_WORKFLOW_INTERACTION = { prompt: async () => null, notify() { } };
|
|
31
|
-
// Invariant: the resume mode belongs to the presenter instance, not the persisted session or profile.
|
|
32
|
-
const SOLO_RESUME_HINTS = new WeakSet();
|
|
33
|
-
/** Resident Agents refuse the commands their tab bar serves instead, naming where they live. */
|
|
34
|
-
const RESIDENT_UTILITY_TAB_REFUSALS = Object.freeze({
|
|
35
|
-
settings: "Settings is available from the global Settings tab.",
|
|
36
|
-
// Platform: macOS labels Alt `Option`.
|
|
37
|
-
changelog: `The changelog opens as its own tab from the command palette (${process.platform === "darwin" ? "Option" : "Alt"}+/).`,
|
|
38
|
-
name: "Rename the session by renaming its tab (F2).",
|
|
39
|
-
});
|
|
40
30
|
export { OwnedUiSessionShellRoot, } from "./session-shell-root.js";
|
|
41
31
|
export { OwnedUiTerminalHost, sessionTerminalHostOptions } from "./shell-host.js";
|
|
42
32
|
export { formatSessionResumeCommand, quoteCommandArgument } from "./session-lifecycle.js";
|
|
@@ -51,7 +41,6 @@ export class OwnedUiSessionPresenter {
|
|
|
51
41
|
root;
|
|
52
42
|
#host;
|
|
53
43
|
#terminal;
|
|
54
|
-
#resident;
|
|
55
44
|
#submission;
|
|
56
45
|
#login;
|
|
57
46
|
#concerns;
|
|
@@ -112,8 +101,6 @@ export class OwnedUiSessionPresenter {
|
|
|
112
101
|
this.#sessionBindingGeneration = this.backend.identity.sessionBindingGeneration;
|
|
113
102
|
this.#suggestionModelKey = suggestionModelKey(this.backend.session.view());
|
|
114
103
|
this.#customViewport = sessionLayout === "custom-viewport";
|
|
115
|
-
if (options.presentation?.soloResumeHint)
|
|
116
|
-
SOLO_RESUME_HINTS.add(this);
|
|
117
104
|
this.#inputCoordination = inputPresentation?.coordination !== false;
|
|
118
105
|
this.#host = host;
|
|
119
106
|
this.#terminal = host.connect(this);
|
|
@@ -133,7 +120,7 @@ export class OwnedUiSessionPresenter {
|
|
|
133
120
|
...(sharedClipboard === undefined ? {} : { pool: sharedClipboard.copy }),
|
|
134
121
|
...(terminal === undefined && clipboard === undefined ? {} : { destination: "terminal" }),
|
|
135
122
|
...(clipboard?.writeText === undefined ? {} : { writeText: (text, signal) => clipboard.writeText(text, signal) }),
|
|
136
|
-
// Invariant: the owned host is the route contract.
|
|
123
|
+
// Invariant: the owned host is the route contract. Pseudoterminal children must not infer
|
|
137
124
|
// clipboard reachability from Node's view of stdout, and inactive presenters are fenced here.
|
|
138
125
|
terminal: { submit: async (control, signal) => {
|
|
139
126
|
if (signal.aborted || this.#disposed || !this.#terminal.running || !this.#terminal.attached)
|
|
@@ -180,8 +167,6 @@ export class OwnedUiSessionPresenter {
|
|
|
180
167
|
replacementSurfaceActive: !this.root.usesDefaultInputSurface(),
|
|
181
168
|
}),
|
|
182
169
|
enableDockInputReuse: inputPresentation?.viewportReuse !== false,
|
|
183
|
-
footerSessionName: options.engine.residentTab === undefined,
|
|
184
|
-
hideUtilityTabCommands: options.engine.residentTab !== undefined,
|
|
185
170
|
persistentHistory: this.#customViewport && promptHistory !== undefined,
|
|
186
171
|
...(promptHistory === undefined ? {} : { historyEditor: promptHistory.editor }),
|
|
187
172
|
onSubmit: text => { void this.submit(text).catch(() => this.#submission.reportError()); },
|
|
@@ -201,7 +186,6 @@ export class OwnedUiSessionPresenter {
|
|
|
201
186
|
onDequeue: () => this.restoreQueuedInput(),
|
|
202
187
|
onEditorChange: text => {
|
|
203
188
|
this.#submission.noteEditorChange();
|
|
204
|
-
this.#resident.checkpoint(text);
|
|
205
189
|
promptSuggestionController?.abortPending();
|
|
206
190
|
if (text.length === 0) {
|
|
207
191
|
// Concurrency: the editor synchronizes deletion-owned autocomplete after onChange.
|
|
@@ -263,8 +247,6 @@ export class OwnedUiSessionPresenter {
|
|
|
263
247
|
// Invariant: the presenter owns its root (theme subscription and helper clients) and disposes it once the
|
|
264
248
|
// terminal no longer renders it.
|
|
265
249
|
constructed.push(() => this.root.dispose());
|
|
266
|
-
this.#resident = new ResidentTabCoordinator(options.engine.residentTab, { root: this.root });
|
|
267
|
-
constructed.push(() => this.#resident.dispose());
|
|
268
250
|
const startupRoute = options.engine.startupRoute;
|
|
269
251
|
this.#dialogs = new SessionDialogCoordinator({
|
|
270
252
|
terminal: this.#terminal,
|
|
@@ -272,7 +254,6 @@ export class OwnedUiSessionPresenter {
|
|
|
272
254
|
routeHost: routeHost ?? null,
|
|
273
255
|
disposed: () => this.#disposed,
|
|
274
256
|
exit: () => { void this.shutdown(); },
|
|
275
|
-
routeClosed: route => this.#resident.closeOwnedRoute(route),
|
|
276
257
|
...(startupRoute === undefined ? {} : { startupRoute }),
|
|
277
258
|
});
|
|
278
259
|
constructed.push(() => this.#dialogs.dispose());
|
|
@@ -283,7 +264,6 @@ export class OwnedUiSessionPresenter {
|
|
|
283
264
|
syncProgress: () => this.#syncTerminalProgress(this.view()),
|
|
284
265
|
});
|
|
285
266
|
this.#submission = this.#createSubmission(cwd);
|
|
286
|
-
this.#resident.restoreInput(options.history?.imageSidecar);
|
|
287
267
|
this.#reloadPresentation = reloadPresentation;
|
|
288
268
|
const presentationInterval = streamPresentationOptions?.intervalMs ?? STREAM_PRESENTATION_INTERVAL_MS;
|
|
289
269
|
this.#streamPresentation = streamPresentationOptions?.scheduler === undefined
|
|
@@ -378,7 +358,6 @@ export class OwnedUiSessionPresenter {
|
|
|
378
358
|
this.#stop.settleAfter(() => this.dispose());
|
|
379
359
|
return;
|
|
380
360
|
}
|
|
381
|
-
this.#resident.observeLifecycle(event);
|
|
382
361
|
// Performance: a streamed chunk names one block, and touching only that block is what keeps the
|
|
383
362
|
// cost of a chunk the same in a long session as in a new one. Everything else
|
|
384
363
|
// resynchronizes the view, which is cheap next to re-reading the transcript.
|
|
@@ -841,21 +820,13 @@ export class OwnedUiSessionPresenter {
|
|
|
841
820
|
}
|
|
842
821
|
shutdown() {
|
|
843
822
|
this.#shutdownPromise ??= this.#shutdown().finally(() => {
|
|
844
|
-
// Invariant: a
|
|
823
|
+
// Invariant: a failed quit is retryable; ordinary shutdown has disposed the shell already.
|
|
845
824
|
if (!this.#disposed)
|
|
846
825
|
this.#shutdownPromise = undefined;
|
|
847
826
|
});
|
|
848
827
|
return this.#shutdownPromise;
|
|
849
828
|
}
|
|
850
829
|
async #shutdown() {
|
|
851
|
-
const detached = await this.#resident.detach();
|
|
852
|
-
if (detached === true)
|
|
853
|
-
return { outcome: "completed", diagnostic: null };
|
|
854
|
-
if (detached !== undefined) {
|
|
855
|
-
this.root.appendWorkflowStatus(detached);
|
|
856
|
-
this.#terminal.requestRender();
|
|
857
|
-
return rejected("resident tab detach is unavailable");
|
|
858
|
-
}
|
|
859
830
|
try {
|
|
860
831
|
const quit = this.backend.workflows.executeWorkflow({ command: "quit", argument: "" });
|
|
861
832
|
// Invariant: a slow or hung engine quit never holds the terminal past the cleanup deadline. The
|
|
@@ -906,7 +877,7 @@ export class OwnedUiSessionPresenter {
|
|
|
906
877
|
return { outcome: "completed", diagnostic: null };
|
|
907
878
|
}
|
|
908
879
|
}
|
|
909
|
-
const selected = openWorkflowSelector(request, this
|
|
880
|
+
const selected = openWorkflowSelector(request, this);
|
|
910
881
|
if (selected !== undefined)
|
|
911
882
|
return selected;
|
|
912
883
|
if (request.command === "reload") {
|
|
@@ -1089,7 +1060,6 @@ export class OwnedUiSessionPresenter {
|
|
|
1089
1060
|
customViewport: this.#customViewport,
|
|
1090
1061
|
exitMode: this.backend.identity.disposed ? this.#fullscreenExitOutput : this.backend.settings.snapshot().fullscreenExitOutput,
|
|
1091
1062
|
resume: this.backend.identity.currentSessionResumeMetadata(),
|
|
1092
|
-
soloResumeHint: SOLO_RESUME_HINTS.has(this),
|
|
1093
1063
|
transcript: () => this.root.exitTranscript(terminal.columns),
|
|
1094
1064
|
});
|
|
1095
1065
|
});
|
|
@@ -1110,8 +1080,6 @@ export class OwnedUiSessionPresenter {
|
|
|
1110
1080
|
}
|
|
1111
1081
|
await historyCleanup.catch(() => false); // Security: background durability outcomes never enter terminal output.
|
|
1112
1082
|
await boundedCleanup(() => pasteCleanup).catch(error => settled.push(error));
|
|
1113
|
-
await boundedCleanup(() => this.#resident.gracefulStop(this.#currentSessionFile()))
|
|
1114
|
-
.catch(error => settled.push(error));
|
|
1115
1083
|
await boundedCleanup(() => this.backend.extensions.unbindExtensionUi()).catch(error => settled.push(error));
|
|
1116
1084
|
return settled;
|
|
1117
1085
|
};
|
|
@@ -1166,7 +1134,6 @@ export class OwnedUiSessionPresenter {
|
|
|
1166
1134
|
backend: this.backend,
|
|
1167
1135
|
root: this.root,
|
|
1168
1136
|
terminal: this.#terminal,
|
|
1169
|
-
residentTab: this.#resident,
|
|
1170
1137
|
cwd,
|
|
1171
1138
|
promptHistory: () => this.#promptHistory,
|
|
1172
1139
|
imageSidecar: () => this.#historyBinding?.imageSidecar,
|
|
@@ -1195,7 +1162,6 @@ export class OwnedUiSessionPresenter {
|
|
|
1195
1162
|
{ onSessionReplaced: () => this.root.setInputSurface(null) },
|
|
1196
1163
|
{ onSessionReplaced: () => this.root.resetExtensionUi() },
|
|
1197
1164
|
{ onSessionReplaced: () => this.root.resetWorkflowPresentation() },
|
|
1198
|
-
this.#resident,
|
|
1199
1165
|
]);
|
|
1200
1166
|
}
|
|
1201
1167
|
// Invariant: delivery recovery does not replace a store; conversation or live scope changes can.
|
|
@@ -1293,8 +1259,8 @@ export class OwnedUiSessionPresenter {
|
|
|
1293
1259
|
openOwnedRoute(route) {
|
|
1294
1260
|
if (this.#disposed)
|
|
1295
1261
|
return;
|
|
1296
|
-
// Invariant: a route requested before the runtime runs
|
|
1297
|
-
//
|
|
1262
|
+
// Invariant: a route requested before the runtime runs is retained, latest wins, and presented
|
|
1263
|
+
// through the startup-route path once started.
|
|
1298
1264
|
if (!this.#terminal.running) {
|
|
1299
1265
|
this.#dialogs.retainStartupRoute(route);
|
|
1300
1266
|
return;
|
|
@@ -1305,17 +1271,13 @@ export class OwnedUiSessionPresenter {
|
|
|
1305
1271
|
}
|
|
1306
1272
|
}
|
|
1307
1273
|
hotkeysPresentation() {
|
|
1308
|
-
|
|
1309
|
-
return this.#resident.active ? { ...presentation, residentTabs: true } : presentation;
|
|
1274
|
+
return this.root.hotkeysPresentation();
|
|
1310
1275
|
}
|
|
1311
1276
|
async #slashCommand(text) {
|
|
1312
1277
|
const body = text.slice(1).trim();
|
|
1313
1278
|
const separator = body.search(/\s/);
|
|
1314
1279
|
const name = separator < 0 ? body : body.slice(0, separator);
|
|
1315
1280
|
const argument = separator < 0 ? "" : body.slice(separator + 1).trimStart();
|
|
1316
|
-
const utilityTab = this.#resident.active ? RESIDENT_UTILITY_TAB_REFUSALS[name] : undefined;
|
|
1317
|
-
if (utilityTab !== undefined)
|
|
1318
|
-
return rejected(utilityTab);
|
|
1319
1281
|
if (this.#dialogs.claimsRoute(name))
|
|
1320
1282
|
return this.#dialogs.openRoute(name);
|
|
1321
1283
|
if (this.#isWorkflowRoute(name))
|
|
@@ -1447,9 +1409,6 @@ function copyCharacters(snapshot) {
|
|
|
1447
1409
|
}
|
|
1448
1410
|
return hasContent ? count : undefined;
|
|
1449
1411
|
}
|
|
1450
|
-
function rejected(diagnostic) {
|
|
1451
|
-
return { outcome: "rejected", diagnostic };
|
|
1452
|
-
}
|
|
1453
1412
|
function workflowAdapterResult(result) {
|
|
1454
1413
|
if (result.outcome === "completed")
|
|
1455
1414
|
return { outcome: "completed", diagnostic: null };
|
|
@@ -22,7 +22,6 @@ export class SessionViewportController {
|
|
|
22
22
|
#pasteDiagnosticRequest = 0;
|
|
23
23
|
#viewport = new TranscriptViewport();
|
|
24
24
|
#config = {
|
|
25
|
-
timeFormat: "8:00 PM",
|
|
26
25
|
scrollbarAppearance: "auto",
|
|
27
26
|
scrollbarStyle: "thin",
|
|
28
27
|
scrollbarSpeed: "normal",
|
|
@@ -171,11 +170,9 @@ export class SessionViewportController {
|
|
|
171
170
|
}
|
|
172
171
|
/** Returns true when document wrapping may have changed. */
|
|
173
172
|
setConfig(config) {
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
this.#config = normalized;
|
|
178
|
-
this.#viewport.setConfig(normalized);
|
|
173
|
+
const layoutChanged = config.scrollbarAppearance !== this.#config.scrollbarAppearance;
|
|
174
|
+
this.#config = config;
|
|
175
|
+
this.#viewport.setConfig(config);
|
|
179
176
|
this.#requestRender();
|
|
180
177
|
return layoutChanged;
|
|
181
178
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { MOUSE_TRACKING_OFF, MOUSE_TRACKING_ON, parseMouseInput } from "../../ui/components/mouse.js";
|
|
2
2
|
import { readVisibleHyperlinks } from "../../ui/components/visible-hyperlinks.js";
|
|
3
3
|
import { piCanvasBackgroundAnsi } from "../../integrations/pi/components/theme.js";
|
|
4
|
-
import { residentFixtureControl } from "../../foundation/resident-tabs/fixture-control.js";
|
|
5
|
-
import { residentProgressObserver } from "../../foundation/resident-tabs/progress-observation.js";
|
|
6
4
|
import { DamageAwareTerminalAdapter, } from "../../integrations/pi/tui-runtime/damage-aware-terminal.js";
|
|
7
5
|
import { PiTuiRuntimeAdapter, legacyKeyInput } from "../../integrations/pi/tui-runtime/adapter.js";
|
|
8
6
|
import { classifyPiTuiInput } from "../../integrations/pi/tui-runtime/input-presentation-coordinator.js";
|
|
@@ -57,8 +55,6 @@ export class OwnedUiTerminalHost {
|
|
|
57
55
|
this.#customViewport = options.layout === "custom-viewport";
|
|
58
56
|
this.#quitOutro = options.quitOutro;
|
|
59
57
|
const input = options.input;
|
|
60
|
-
const fixtureControl = residentFixtureControl();
|
|
61
|
-
const progressObserver = residentProgressObserver();
|
|
62
58
|
let damageTerminal;
|
|
63
59
|
const surface = {
|
|
64
60
|
render: width => this.#active?.render(width) ?? [],
|
|
@@ -84,13 +80,6 @@ export class OwnedUiTerminalHost {
|
|
|
84
80
|
inspectHyperlinks: readVisibleHyperlinks,
|
|
85
81
|
onResize: () => this.#active?.noteImmediatePresentation(),
|
|
86
82
|
onHyperlinkCleanupRequired: () => this.runtime?.requestRender(true),
|
|
87
|
-
...(fixtureControl === null ? {} : {
|
|
88
|
-
allowWrite: () => !fixtureControl.stopped("child-render-write"),
|
|
89
|
-
writeChunks: data => fixtureControl.fragmentChildWrite(data),
|
|
90
|
-
}),
|
|
91
|
-
...(progressObserver === null ? {} : {
|
|
92
|
-
onWrite: ({ bytes, fragments, transaction, frameId, cause }) => progressObserver.childRenderWrite(bytes, fragments, transaction, frameId, cause),
|
|
93
|
-
}),
|
|
94
83
|
});
|
|
95
84
|
return damageTerminal;
|
|
96
85
|
},
|
|
@@ -102,12 +91,9 @@ export class OwnedUiTerminalHost {
|
|
|
102
91
|
},
|
|
103
92
|
}),
|
|
104
93
|
} : { layoutRoot: pinnedLayoutRoot(this.#delegatingLayoutParts()) }),
|
|
105
|
-
...(input?.onEvent === undefined
|
|
94
|
+
...(input?.onEvent === undefined ? {} : {
|
|
106
95
|
inputDiagnostics: {
|
|
107
|
-
onEvent:
|
|
108
|
-
input?.onEvent?.(event);
|
|
109
|
-
progressObserver?.inputPhase?.(event.phase, event.revision);
|
|
110
|
-
},
|
|
96
|
+
onEvent: input.onEvent,
|
|
111
97
|
...(input?.now === undefined ? {} : { now: input.now }),
|
|
112
98
|
},
|
|
113
99
|
}),
|
|
@@ -168,8 +154,6 @@ export class OwnedUiTerminalHost {
|
|
|
168
154
|
active() {
|
|
169
155
|
return this.#active;
|
|
170
156
|
}
|
|
171
|
-
// Invariant: resident tab visibility never gates rendering here; a hidden tab keeps painting into its
|
|
172
|
-
// resident terminal, and the native holder alone withholds inactive surfaces from attach clients.
|
|
173
157
|
requestRender(from, force = false) {
|
|
174
158
|
if (from === this.#active)
|
|
175
159
|
this.runtime.requestRender(force);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OwnedUiSessionViewModel
|
|
1
|
+
import type { OwnedUiSessionViewModel } from "../../contracts/owned-ui/index.js";
|
|
2
2
|
import type { TranscriptPromptAnchor } from "../../ui/components/transcript-viewport.js";
|
|
3
3
|
import type { PiShellTranscriptComponentPort } from "../../integrations/pi/components/shell-shared-facade.js";
|
|
4
4
|
type TranscriptBlock = OwnedUiSessionViewModel["transcript"][number];
|
|
@@ -22,7 +22,6 @@ export interface TranscriptDocumentChrome {
|
|
|
22
22
|
/** An extension header may animate, so a document under one is never cached. */
|
|
23
23
|
hasExtensionHeader(): boolean;
|
|
24
24
|
thinkingVisible(): boolean;
|
|
25
|
-
timeFormat(): OwnedUiViewportSettings["timeFormat"];
|
|
26
25
|
}
|
|
27
26
|
export interface TranscriptDocumentOptions {
|
|
28
27
|
readonly customViewport: boolean;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { acceptsTranscriptUpdate } from "../../contracts/owned-ui/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import { nativeHyperlinkStyle, overlaySpan } from "../../ui/components/spans.js";
|
|
4
|
-
import { displayWidth } from "../../ui/components/text.js";
|
|
2
|
+
import { nativeHyperlinkStyle } from "../../ui/components/spans.js";
|
|
5
3
|
import { createPiShellChangelog, createPiShellCollapsedChangelog, renderPiShellPackageUpdateNotice, renderPiShellReleaseUpdateNotice, } from "../../integrations/pi/components/shell-presenters-info.js";
|
|
6
|
-
import { isPiPromptStyleCompaction,
|
|
4
|
+
import { isPiPromptStyleCompaction, renderPiShellStartupDiagnostic, renderPiShellTranscriptBlock, } from "../../integrations/pi/components/shell-presenters-transcript.js";
|
|
7
5
|
import { piTheme } from "../../integrations/pi/components/upstream/theme/theme.js";
|
|
8
6
|
const LAYOUT_ONLY = new Set(["editor-padding", "diagnostics", "workflow-status", "extension-header"]);
|
|
9
7
|
const WORKFLOW_STATUS_PREFIX = "workflow-status-";
|
|
@@ -213,13 +211,11 @@ export class TranscriptDocument {
|
|
|
213
211
|
}
|
|
214
212
|
rows.push(...blockRows);
|
|
215
213
|
if (promptLike && blockRows[0] !== undefined) {
|
|
216
|
-
const source = pinnedPromptSource(block, blockRows[0], blockWidth, chrome.timeFormat());
|
|
217
214
|
promptAnchors.push({
|
|
218
215
|
id: block.id,
|
|
219
216
|
firstRow,
|
|
220
217
|
lastRow: Math.max(firstRow, rows.length - 1),
|
|
221
|
-
sourceRow:
|
|
222
|
-
copySuffixWidth: source.copySuffixWidth,
|
|
218
|
+
sourceRow: blockRows[0],
|
|
223
219
|
prominentSourceRow: blockRows[0],
|
|
224
220
|
});
|
|
225
221
|
}
|
|
@@ -343,24 +339,3 @@ function sanitizeExitTranscriptRow(row) {
|
|
|
343
339
|
export function nativeTranscriptLinkColor(text, target) {
|
|
344
340
|
return piTheme().fg(/^file:/iu.test(target) ? "accent" : "mdLink", text);
|
|
345
341
|
}
|
|
346
|
-
/** Preserve the stable metadata-grey foreground for every pinned timestamp state. */
|
|
347
|
-
function pinnedPromptSource(block, sourceRow, width, timeFormat) {
|
|
348
|
-
const unchanged = { row: sourceRow, copySuffixWidth: 0 };
|
|
349
|
-
if (typeof block.payload !== "object" || block.payload === null)
|
|
350
|
-
return unchanged;
|
|
351
|
-
const value = block.payload.timestamp;
|
|
352
|
-
if (typeof value !== "number" || !Number.isFinite(value))
|
|
353
|
-
return unchanged;
|
|
354
|
-
const format = timeFormat ?? "8:00 PM";
|
|
355
|
-
const timestamp = formatSubmittedPromptTime(value, format);
|
|
356
|
-
if (timestamp === null || submittedPromptLayout(width, value, format).timestamp === null)
|
|
357
|
-
return unchanged;
|
|
358
|
-
const rowWidth = displayWidth(sourceRow);
|
|
359
|
-
const timestampWidth = displayWidth(timestamp);
|
|
360
|
-
if (rowWidth < timestampWidth)
|
|
361
|
-
return unchanged;
|
|
362
|
-
return {
|
|
363
|
-
row: overlaySpan(sourceRow, rowWidth - timestampWidth, rowWidth, paintPiSubmittedPromptTimestamp(timestamp)),
|
|
364
|
-
copySuffixWidth: timestampWidth,
|
|
365
|
-
};
|
|
366
|
-
}
|
|
@@ -115,7 +115,7 @@ export class WorkflowOutput {
|
|
|
115
115
|
if (result.command === "hotkeys") {
|
|
116
116
|
this.#lastStatusId = undefined;
|
|
117
117
|
const presentation = this.#ports.hotkeysPresentation();
|
|
118
|
-
const hotkeys = createPiShellHotkeys(presentation.bindings, presentation.getShortcuts, presentation.profile
|
|
118
|
+
const hotkeys = createPiShellHotkeys(presentation.bindings, presentation.getShortcuts, presentation.profile);
|
|
119
119
|
this.#appendAnchored(width => hotkeys.render(width), () => hotkeys.dispose?.());
|
|
120
120
|
return true;
|
|
121
121
|
}
|
|
@@ -20,6 +20,4 @@ export interface WorkflowSelectors {
|
|
|
20
20
|
* has opened, or undefined when the request goes to the engine. The decision itself is synchronous,
|
|
21
21
|
* so a request that goes to the engine reaches it in the same turn.
|
|
22
22
|
*/
|
|
23
|
-
export declare function openWorkflowSelector(request: OwnedUiWorkflowRequest, selectors: WorkflowSelectors
|
|
24
|
-
readonly residentTab: boolean;
|
|
25
|
-
}): OwnedUiCommandResult | Promise<OwnedUiCommandResult> | undefined;
|
|
23
|
+
export declare function openWorkflowSelector(request: OwnedUiWorkflowRequest, selectors: WorkflowSelectors): OwnedUiCommandResult | Promise<OwnedUiCommandResult> | undefined;
|
|
@@ -26,13 +26,10 @@ const SELECTOR_ROUTES = [
|
|
|
26
26
|
* has opened, or undefined when the request goes to the engine. The decision itself is synchronous,
|
|
27
27
|
* so a request that goes to the engine reaches it in the same turn.
|
|
28
28
|
*/
|
|
29
|
-
export function openWorkflowSelector(request, selectors
|
|
29
|
+
export function openWorkflowSelector(request, selectors) {
|
|
30
30
|
const route = SELECTOR_ROUTES.find(candidate => candidate.command === request.command && candidate.pending(request));
|
|
31
31
|
if (route === undefined)
|
|
32
32
|
return undefined;
|
|
33
|
-
if (route.command === "settings" && options.residentTab) {
|
|
34
|
-
return { outcome: "rejected", diagnostic: "Settings is available from the global Settings tab." };
|
|
35
|
-
}
|
|
36
33
|
const completed = { outcome: "completed", diagnostic: null };
|
|
37
34
|
const opened = route.open(selectors, request);
|
|
38
35
|
return opened instanceof Promise ? opened.then(() => completed) : completed;
|
package/dist/cli/dispatch.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { type InteractiveLaunchIntent, type
|
|
1
|
+
import { type InteractiveLaunchIntent, type LaunchProfileId, type SessionSelection } from "../features/launch/index.js";
|
|
2
2
|
import type { CliCapabilities } from "./capabilities.js";
|
|
3
3
|
import type { PackageCommandRequest } from "./packages.js";
|
|
4
4
|
import type { SessionContextRequest } from "./session-context.js";
|
|
5
|
-
import type { TabsRequest } from "./tabs-request.js";
|
|
6
5
|
import { type PackageCliVerb, type PackageCommandNamespace, type PackageSyntaxDiagnostic } from "./package-messages.js";
|
|
7
6
|
export type UpdateChannel = "stable" | "next";
|
|
8
7
|
export interface CliHandlers {
|
|
@@ -11,7 +10,6 @@ export interface CliHandlers {
|
|
|
11
10
|
readonly update: (channel: UpdateChannel, target?: string) => Promise<number>;
|
|
12
11
|
readonly packages: (request: PackageCommandRequest) => Promise<number>;
|
|
13
12
|
readonly sessionContext: (request: SessionContextRequest) => Promise<number>;
|
|
14
|
-
readonly tabs: (request: TabsRequest) => Promise<number>;
|
|
15
13
|
/** Removes A1 from the machine; absent in hosts that cannot uninstall. */
|
|
16
14
|
readonly uninstall?: (request: {
|
|
17
15
|
readonly yes: boolean;
|
|
@@ -24,8 +22,6 @@ export interface CliOutput {
|
|
|
24
22
|
}
|
|
25
23
|
export declare function cliUsage(capabilities: CliCapabilities): string;
|
|
26
24
|
export declare function cliHelp(capabilities: CliCapabilities): string;
|
|
27
|
-
/** Focused help for the resident-tab maintenance forms; printing it contacts no host. */
|
|
28
|
-
export declare function tabsHelp(): string;
|
|
29
25
|
export declare function dispatchCli(arguments_: readonly string[], handlers: CliHandlers, output: CliOutput, capabilities: CliCapabilities): Promise<number>;
|
|
30
26
|
export type CliCommand = {
|
|
31
27
|
readonly kind: "noop";
|
|
@@ -42,7 +38,6 @@ export type CliCommand = {
|
|
|
42
38
|
} | {
|
|
43
39
|
readonly kind: "launch";
|
|
44
40
|
readonly profileId: LaunchProfileId;
|
|
45
|
-
readonly launchMode: InteractiveLaunchMode;
|
|
46
41
|
readonly sessionSelection?: SessionSelection;
|
|
47
42
|
} | {
|
|
48
43
|
readonly kind: "version";
|
|
@@ -56,11 +51,6 @@ export type CliCommand = {
|
|
|
56
51
|
} | {
|
|
57
52
|
readonly kind: "session-context";
|
|
58
53
|
readonly request: SessionContextRequest;
|
|
59
|
-
} | {
|
|
60
|
-
readonly kind: "tabs";
|
|
61
|
-
readonly request: TabsRequest;
|
|
62
|
-
} | {
|
|
63
|
-
readonly kind: "tabs-help";
|
|
64
54
|
} | {
|
|
65
55
|
readonly kind: "uninstall";
|
|
66
56
|
readonly request: {
|
package/dist/cli/dispatch.js
CHANGED
|
@@ -6,9 +6,6 @@ export function cliUsage(capabilities) {
|
|
|
6
6
|
"",
|
|
7
7
|
"--session <path|id>",
|
|
8
8
|
"--session-dir <dir> --session <path|id>",
|
|
9
|
-
"solo",
|
|
10
|
-
"solo --session <path|id>",
|
|
11
|
-
"solo --session-dir <dir> --session <path|id>",
|
|
12
9
|
...(capabilities.developmentComparison ? ["pi"] : []),
|
|
13
10
|
"help",
|
|
14
11
|
"version",
|
|
@@ -26,10 +23,6 @@ export function cliUsage(capabilities) {
|
|
|
26
23
|
"session worktrees",
|
|
27
24
|
"session link-worktree <path>",
|
|
28
25
|
"session unlink-worktree",
|
|
29
|
-
"tabs",
|
|
30
|
-
"tabs stop <id>|--all",
|
|
31
|
-
"tabs host status|stop",
|
|
32
|
-
"tabs doctor",
|
|
33
26
|
]);
|
|
34
27
|
}
|
|
35
28
|
export function cliHelp(capabilities) {
|
|
@@ -39,9 +32,6 @@ export function cliHelp(capabilities) {
|
|
|
39
32
|
` ${command}`,
|
|
40
33
|
` ${command} --session <path|id>`,
|
|
41
34
|
` ${command} --session-dir <dir> --session <path|id>`,
|
|
42
|
-
` ${command} solo`,
|
|
43
|
-
` ${command} solo --session <path|id>`,
|
|
44
|
-
` ${command} solo --session-dir <dir> --session <path|id>`,
|
|
45
35
|
...(capabilities.developmentComparison ? [` ${command} pi`] : []),
|
|
46
36
|
` ${command} help`,
|
|
47
37
|
` ${command} version`,
|
|
@@ -66,32 +56,9 @@ export function cliHelp(capabilities) {
|
|
|
66
56
|
` ${command} session link-worktree <path>`,
|
|
67
57
|
` ${command} session unlink-worktree`,
|
|
68
58
|
"",
|
|
69
|
-
"Tabs:",
|
|
70
|
-
` ${command} tabs`,
|
|
71
|
-
` ${command} tabs stop <id>|--all`,
|
|
72
|
-
` ${command} tabs host status|stop`,
|
|
73
|
-
` ${command} tabs doctor`,
|
|
74
|
-
"",
|
|
75
59
|
].join("\n");
|
|
76
60
|
}
|
|
77
|
-
|
|
78
|
-
export function tabsHelp() {
|
|
79
|
-
const command = PRODUCT_TEXT.commandName;
|
|
80
|
-
return [
|
|
81
|
-
"Resident tabs:",
|
|
82
|
-
` ${command} tabs List running tabs`,
|
|
83
|
-
` ${command} tabs stop <id> Stop one tab; its session stays resumable`,
|
|
84
|
-
` ${command} tabs stop --all Stop every tab and keep the host`,
|
|
85
|
-
` ${command} tabs host status Show host identity, limits, and health counters`,
|
|
86
|
-
` ${command} tabs host stop Stop every tab and the host`,
|
|
87
|
-
` ${command} tabs doctor Write a redacted diagnostic bundle`,
|
|
88
|
-
"",
|
|
89
|
-
"Options:",
|
|
90
|
-
" --json Print the versioned machine-readable report",
|
|
91
|
-
"",
|
|
92
|
-
].join("\n");
|
|
93
|
-
}
|
|
94
|
-
const PROFILE_WORDS = new Set(["pi", "solo"]);
|
|
61
|
+
const PROFILE_WORDS = new Set(["pi"]);
|
|
95
62
|
export async function dispatchCli(arguments_, handlers, output, capabilities) {
|
|
96
63
|
const command = parseCliCommand(arguments_, capabilities);
|
|
97
64
|
if (command.kind === "noop")
|
|
@@ -113,31 +80,25 @@ export async function dispatchCli(arguments_, handlers, output, capabilities) {
|
|
|
113
80
|
return 2;
|
|
114
81
|
}
|
|
115
82
|
if (command.kind === "launch")
|
|
116
|
-
return await handlers.launch(interactiveLaunchIntent(command.profileId, command.sessionSelection
|
|
83
|
+
return await handlers.launch(interactiveLaunchIntent(command.profileId, command.sessionSelection));
|
|
117
84
|
if (command.kind === "version")
|
|
118
85
|
return await handlers.version();
|
|
119
86
|
if (command.kind === "packages")
|
|
120
87
|
return await handlers.packages(command.request);
|
|
121
88
|
if (command.kind === "session-context")
|
|
122
89
|
return await handlers.sessionContext(command.request);
|
|
123
|
-
if (command.kind === "tabs-help") {
|
|
124
|
-
output.stdout(tabsHelp());
|
|
125
|
-
return 0;
|
|
126
|
-
}
|
|
127
|
-
if (command.kind === "tabs")
|
|
128
|
-
return await handlers.tabs(command.request);
|
|
129
90
|
if (command.kind === "uninstall")
|
|
130
91
|
return handlers.uninstall ? await handlers.uninstall(command.request) : 2;
|
|
131
92
|
return await handlers.update(command.channel, command.target);
|
|
132
93
|
}
|
|
133
94
|
export function parseCliCommand(arguments_, capabilities) {
|
|
134
95
|
if (arguments_.length === 0)
|
|
135
|
-
return { kind: "launch", profileId: "a1"
|
|
96
|
+
return { kind: "launch", profileId: "a1" };
|
|
136
97
|
const [command, ...rest] = arguments_;
|
|
137
98
|
if (command === "--session" || command === "--session-dir") {
|
|
138
99
|
try {
|
|
139
100
|
const sessionSelection = parseSessionSelection(arguments_);
|
|
140
|
-
return { kind: "launch", profileId: "a1",
|
|
101
|
+
return { kind: "launch", profileId: "a1", ...(sessionSelection === undefined ? {} : { sessionSelection }) };
|
|
141
102
|
}
|
|
142
103
|
catch (error) {
|
|
143
104
|
return { kind: "error", message: PRODUCT_TEXT.diagnostic(`could not parse session launch: ${error instanceof Error ? error.message : String(error)}`) };
|
|
@@ -158,66 +119,18 @@ export function parseCliCommand(arguments_, capabilities) {
|
|
|
158
119
|
if (command === "pi") {
|
|
159
120
|
if (rest.length > 0)
|
|
160
121
|
return parsePackageCommand(rest, "pi");
|
|
161
|
-
return capabilities.developmentComparison ? { kind: "launch", profileId: "pi"
|
|
162
|
-
}
|
|
163
|
-
if (command === "solo") {
|
|
164
|
-
if (rest.length === 0)
|
|
165
|
-
return { kind: "launch", profileId: "a1", launchMode: "solo" };
|
|
166
|
-
try {
|
|
167
|
-
const sessionSelection = parseSessionSelection(rest);
|
|
168
|
-
return { kind: "launch", profileId: "a1", launchMode: "solo", ...(sessionSelection === undefined ? {} : { sessionSelection }) };
|
|
169
|
-
}
|
|
170
|
-
catch (error) {
|
|
171
|
-
return { kind: "error", message: PRODUCT_TEXT.diagnostic(`could not parse solo session launch: ${error instanceof Error ? error.message : String(error)}`) };
|
|
172
|
-
}
|
|
122
|
+
return capabilities.developmentComparison ? { kind: "launch", profileId: "pi" } : { kind: "noop" };
|
|
173
123
|
}
|
|
174
124
|
if (command === "update")
|
|
175
125
|
return parseUpdate(rest, capabilities.runningChannel ?? "stable");
|
|
176
126
|
if (command === "session")
|
|
177
127
|
return parseSessionContext(rest);
|
|
178
|
-
if (command === "tabs")
|
|
179
|
-
return parseTabs(rest);
|
|
180
128
|
if (command?.startsWith("update:"))
|
|
181
129
|
return { kind: "noop" };
|
|
182
130
|
// Rationale: unsupported and reserved command spaces are deliberately quiet. Help is
|
|
183
131
|
// explicit, and a typo must never start an interactive or maintenance path.
|
|
184
132
|
return { kind: "noop" };
|
|
185
133
|
}
|
|
186
|
-
/** Parses `a1 tabs` before any I/O; a malformed form fails with one line and contacts no host. */
|
|
187
|
-
function parseTabs(rest) {
|
|
188
|
-
if (rest.some(value => value === "--help" || value === "-h"))
|
|
189
|
-
return { kind: "tabs-help" };
|
|
190
|
-
const json = rest.includes("--json");
|
|
191
|
-
const words = rest.filter(value => value !== "--json");
|
|
192
|
-
const fail = (detail) => ({ kind: "error", message: PRODUCT_TEXT.diagnostic(`could not parse tabs: ${detail}`) });
|
|
193
|
-
const [action, value, extra] = words;
|
|
194
|
-
if (action === undefined)
|
|
195
|
-
return { kind: "tabs", request: { action: "list", json } };
|
|
196
|
-
if (action === "stop") {
|
|
197
|
-
if (value === undefined)
|
|
198
|
-
return fail("stop requires a tab id or --all.");
|
|
199
|
-
if (extra !== undefined)
|
|
200
|
-
return fail("stop accepts one tab id or --all.");
|
|
201
|
-
if (value === "--all")
|
|
202
|
-
return { kind: "tabs", request: { action: "stop-all", json } };
|
|
203
|
-
if (value.startsWith("-"))
|
|
204
|
-
return fail(`unknown option ${value}.`);
|
|
205
|
-
return { kind: "tabs", request: { action: "stop", tabId: value, json } };
|
|
206
|
-
}
|
|
207
|
-
if (action === "host") {
|
|
208
|
-
if (extra !== undefined || (value !== "status" && value !== "stop"))
|
|
209
|
-
return fail("host accepts status or stop.");
|
|
210
|
-
return { kind: "tabs", request: { action: value === "status" ? "host-status" : "host-stop", json } };
|
|
211
|
-
}
|
|
212
|
-
if (action === "doctor") {
|
|
213
|
-
if (value !== undefined)
|
|
214
|
-
return fail("doctor does not accept arguments.");
|
|
215
|
-
return { kind: "tabs", request: { action: "doctor", json } };
|
|
216
|
-
}
|
|
217
|
-
if (action.startsWith("-"))
|
|
218
|
-
return fail(`unknown option ${action}.`);
|
|
219
|
-
return fail(`unknown subcommand ${action}; use list, stop, host, or doctor.`);
|
|
220
|
-
}
|
|
221
134
|
function parseSessionContext(rest) {
|
|
222
135
|
const [action, value, extra] = rest;
|
|
223
136
|
if (action === "link-worktree") {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PRIMARY_SESSION_AGENT_ID, updateSessionRepositoryContext, } from "../features/launch/index.js";
|
|
2
|
+
import { inspectLiveProcess } from "../foundation/lifecycle/index.js";
|
|
2
3
|
import { PRODUCT_IDENTITY, PRODUCT_TEXT } from "../product-identity.js";
|
|
3
4
|
/** Apply repository context only when invoked by an exact live A1 shell-tool runtime. */
|
|
4
5
|
export async function runSessionContextCommand(request, options = {}) {
|
|
@@ -11,9 +12,7 @@ export async function runSessionContextCommand(request, options = {}) {
|
|
|
11
12
|
return 2;
|
|
12
13
|
}
|
|
13
14
|
try {
|
|
14
|
-
|
|
15
|
-
throw Object.assign(new Error("native process identity inspection is unavailable"), { code: "process-inspection-unavailable" });
|
|
16
|
-
const outcome = await updateSessionRepositoryContext({ sessionId: identity.sessionId, sessionFile: identity.sessionFile }, request, { runtimeId: identity.runtimeId, inspectProcess: options.inspectProcess });
|
|
15
|
+
const outcome = await updateSessionRepositoryContext({ sessionId: identity.sessionId, sessionFile: identity.sessionFile }, request, { runtimeId: identity.runtimeId, inspectProcess: options.inspectProcess ?? inspectLiveProcess });
|
|
17
16
|
if (outcome.kind === "unlinked")
|
|
18
17
|
stdout("Session worktree context cleared.\n");
|
|
19
18
|
if (outcome.kind === "linked")
|
|
@@ -42,16 +41,15 @@ function readIdentity(environment) {
|
|
|
42
41
|
return null;
|
|
43
42
|
return { sessionId, sessionFile, runtimeId };
|
|
44
43
|
}
|
|
45
|
-
/** Known coordination failures must not expose
|
|
44
|
+
/** Known coordination failures must not expose internal paths or another session's identity. */
|
|
46
45
|
function recoveryDetail(code) {
|
|
47
46
|
const details = {
|
|
48
47
|
"worktree-claim-busy": "another mutation is still running; runtime registration retries automatically, so retry this link shortly",
|
|
49
48
|
"worktree-legacy-recovery-required": "an older-format worktree lock requires safe recovery; stop all older A1 processes, move only session-worktree-claims/mutation.lock to a backup while stopped, then start the updated A1; keep all sessions and worktree claims",
|
|
50
|
-
"worktree-coordination-unavailable": "
|
|
49
|
+
"worktree-coordination-unavailable": "worktree coordination is unavailable; repair or update this A1 installation, then retry",
|
|
51
50
|
"worktree-coordination-io": "worktree coordination could not access its files; check A1 data-directory permissions and filesystem availability, then retry",
|
|
52
51
|
"worktree-coordination-boundary": "unexpected worktree coordination entry; retain it for inspection, and do not delete the claim store",
|
|
53
|
-
"
|
|
54
|
-
"session-runtime-unverifiable": "runtime identity could not be verified; check native process inspection and retry; no ownership was overridden",
|
|
52
|
+
"session-runtime-unverifiable": "runtime identity could not be verified; retry; no ownership was overridden",
|
|
55
53
|
"session-runtime-unavailable": "this session has not registered yet; updated A1 retries registration automatically; retry shortly and follow any specific coordination error if it persists",
|
|
56
54
|
"session-runtime-stopped": "this shell belongs to a stopped runtime; resume in a running A1 session before linking",
|
|
57
55
|
"worktree-active-in-another-session": "another live agent owns this worktree; use a different worktree or wait for its owner to release it",
|