From 31b2b17d9bfba57456da82ff0e711eed025facc8 Mon Sep 17 00:00:00 2001 From: OrcaWin Date: Sat, 10 Oct 2026 02:46:27 -0700 Subject: [PATCH] refactor(wsl): move the WSL guest bundle sources out of src/relay (#27174) * refactor(wsl): move the WSL guest bundle sources out of src/relay The WSL hook relay and WSL browser network relay are built from src/relay but are not part of the SSH relay. Move them, and the 46 relay modules the hook relay bundles, to src/wsl-guest so the SSH relay can be deleted on its own. Pure renames; the built bundles are byte-identical. Adds a boundary test so nothing outside src/relay imports it except relay tests. * fix(ci): exempt renamed files' existing lint debt in the changed-lines gate * test(relay): keep the cast suppression on the wrapped line * test(relay): only parse files that mention relay in the import boundary check --------- Co-authored-by: m4air --- .github/workflows/ssh-hostile-hosts.yml | 1 + .github/workflows/ssh-windows-hosts.yml | 1 + config/knip.json | 2 +- .../process-host-direct-import-baseline.txt | 2 +- config/reliability-gates.jsonc | 34 ++++----- config/scripts/build-relay.mjs | 4 +- config/scripts/check-changed-code-quality.mjs | 7 +- .../check-changed-code-quality.test.mjs | 27 +++++++ config/scripts/ci-shard-timings.json | 62 ++++++++-------- config/scripts/node-server-qualification.mjs | 2 +- config/scripts/pr-code-change-scope.mjs | 1 + config/scripts/pr-e2e-gate-contract.test.mjs | 1 + config/scripts/pr-e2e-source-routing.mjs | 4 +- .../scripts/relay-json-payload-benchmark.ts | 2 +- .../scripts/relay-watcher-fault-harness.mjs | 2 +- .../ssh-localhost-e2e-routing.test.mjs | 4 +- .../ssh-relay-import-boundary.test.mjs | 72 +++++++++++++++++++ config/tsconfig.node.json | 1 + config/tsconfig.relay.json | 1 + .../relay-fixture.mjs | 2 +- .../scenario.test.mjs | 2 +- .../manual-compact-hook-stream.test.ts | 2 +- .../agent-hooks/opencode-plugin-settings.ts | 2 +- ...erver-claude-task-wakeup-lifecycle.test.ts | 2 +- .../server-relayed-claude-cancel.test.ts | 2 +- src/main/agent-hooks/server-tmux-wire.test.ts | 2 +- .../agent-hooks/wsl-guest-plugin-install.ts | 2 +- src/main/agent-hooks/wsl-hook-relay-deps.ts | 2 +- .../wsl-hook-relay-guest-install.ts | 2 +- .../wsl-hook-relay-manager.test.ts | 4 +- .../wsl-opencode-install-race.test.ts | 6 +- .../wsl-opencode-settings-lifetime.test.ts | 6 +- .../agent-hooks/wsl-opencode-settings.test.ts | 6 +- .../session-search-scope-entry-points.test.ts | 2 +- .../removal/worktree-archive-hook.ts | 4 +- .../plugins/plugin-host-conformance.test.ts | 2 +- .../ssh-review-draft-context.test.ts | 4 +- ...ay-session-agent-hooks.integration.test.ts | 2 +- src/relay/agent-exec-disposal.test.ts | 8 ++- src/relay/agent-exec-handler-test-harness.ts | 2 +- src/relay/agent-exec-handler.ts | 2 +- ...gent-hook-retired-pane-suppression.test.ts | 4 +- src/relay/ai-vault-handler.test.ts | 2 +- src/relay/ai-vault-handler.ts | 2 +- .../external-automations-handler.test.ts | 2 +- src/relay/external-automations-handler.ts | 2 +- src/relay/fs-file-stream-shutdown.test.ts | 4 +- .../fs-handler-file-range-dispatch.test.ts | 4 +- src/relay/fs-handler-file-range.test.ts | 4 +- src/relay/fs-handler-file-read.ts | 4 +- src/relay/fs-handler-git-fallback.ts | 2 +- src/relay/fs-handler-git-search.ts | 2 +- .../fs-handler-list-files-ignored.test.ts | 2 +- ...fs-handler-list-files-result-limit.test.ts | 2 +- src/relay/fs-handler-list-files.ts | 2 +- src/relay/fs-handler-ripgrep-fallback.test.ts | 2 +- src/relay/fs-handler-stream.test.ts | 4 +- src/relay/fs-handler-utils.ts | 2 +- src/relay/fs-handler.test.ts | 2 +- src/relay/fs-handler.ts | 2 +- .../fs-list-files-cancel.integration.test.ts | 2 +- .../fs-list-files-dispatch-test-harness.ts | 2 +- src/relay/fs-list-files-fallback-chain.ts | 2 +- ...t-files-large-response.integration.test.ts | 4 +- .../fs-markdown-document-listing.test.ts | 2 +- src/relay/fs-search-cancellation.test.ts | 4 +- ...-pty-echo-backpressure.integration.test.ts | 6 +- src/relay/fs-stream-registry.ts | 2 +- .../git-handler-comparison-operations.ts | 2 +- src/relay/git-handler-exec-operations.ts | 2 +- src/relay/git-handler-fetch-operations.ts | 2 +- .../git-handler-object-diff-operations.ts | 2 +- src/relay/git-handler-operation-context.ts | 2 +- src/relay/git-handler-read-operations.ts | 2 +- src/relay/git-handler-registration.ts | 2 +- .../git-handler-stage-worktree-scope.test.ts | 4 +- src/relay/git-handler-sync-operations.ts | 2 +- src/relay/git-handler-test-setup.ts | 2 +- src/relay/git-handler-worktree-operations.ts | 2 +- src/relay/git-handler.ts | 4 +- ...-pty-echo-backpressure.integration.test.ts | 6 +- .../git-response-stream-ownership.test.ts | 4 +- .../git-response-stream-retention.test.ts | 2 +- .../git-response-stream-shutdown.test.ts | 4 +- src/relay/git-response-stream.ts | 4 +- src/relay/git-stdout-stream.ts | 2 +- src/relay/integration.test.ts | 2 +- src/relay/managed-hook-installer.test.ts | 2 +- src/relay/managed-hook-installer.ts | 2 +- .../omp-fresh-launch-environment.test.ts | 4 +- src/relay/opencode-hook-selection.test.ts | 4 +- src/relay/plugin-host-call-handler.ts | 2 +- src/relay/port-scan-handler.test.ts | 2 +- src/relay/port-scan-handler.ts | 2 +- ...-handler-output-drain-differential.test.ts | 2 +- .../pty-handler-output-streaming.test.ts | 4 +- ...ndler-owner-inventory-clone-budget.test.ts | 8 ++- src/relay/pty-handler-shell-recovery.test.ts | 4 +- .../pty-handler-source-publication.test.ts | 4 +- src/relay/pty-handler-spawn-admission.test.ts | 2 +- src/relay/pty-handler-test-harness.ts | 2 +- src/relay/pty-handler.ts | 4 +- src/relay/relay-agent-hook-runtime.ts | 16 ++--- src/relay/relay-bundled-ripgrep.ts | 2 +- src/relay/relay-client-resync-marker.ts | 2 +- src/relay/relay-connect-channel.ts | 4 +- .../relay-filesystem-watch-registry.test.ts | 2 +- src/relay/relay-filesystem-watch-registry.ts | 2 +- src/relay/relay-grace-lifecycle.test.ts | 2 +- src/relay/relay-grace-lifecycle.ts | 2 +- src/relay/relay-handshake-roundtrip.test.ts | 2 +- src/relay/relay-handshake.ts | 2 +- src/relay/relay-orca-cli-channel.ts | 4 +- ...ay-oversized-notification-survival.test.ts | 8 +-- src/relay/relay-primary-channel.ts | 4 +- ...ay-pty-consumer-owner-displacement.test.ts | 4 +- .../relay-pty-publication-admission.test.ts | 4 +- src/relay/relay-pty-source-activation.ts | 2 +- ...relay-pty-source-cancellation-exit.test.ts | 4 +- .../relay-pty-source-exit-publication.test.ts | 2 +- .../relay-pty-source-exit-publication.ts | 2 +- src/relay/relay-pty-source-output.ts | 2 +- .../relay-pty-source-publication.test.ts | 4 +- src/relay/relay-pty-source-publication.ts | 2 +- ...lay-pty-source-recovery-completion.test.ts | 2 +- .../relay-pty-source-recovery-completion.ts | 2 +- ...-pty-source-recovery-interleavings.test.ts | 4 +- .../relay-pty-source-recovery-window.test.ts | 4 +- .../relay-pty-source-restore-retry.test.ts | 4 +- .../relay-pty-source-send-scheduler.test.ts | 2 +- src/relay/relay-pty-source-send-scheduler.ts | 2 +- ...y-pty-source-superseded-activation.test.ts | 4 +- ...reconnect-listener-credential-gate.test.ts | 4 +- .../relay-reconnect-listener-peer-end.test.ts | 4 +- ...econnect-listener-peer-write-error.test.ts | 4 +- src/relay/relay-reconnect-listener.ts | 2 +- src/relay/relay-runtime-services.ts | 4 +- src/relay/relay-stream-ack-window.ts | 2 +- src/relay/relay-watch-root-capacity.test.ts | 2 +- src/relay/relay-watcher-event-emitter.test.ts | 10 +-- src/relay/relay-watcher-event-emitter.ts | 2 +- .../relay-watcher-frame-chunking.test.ts | 4 +- .../relay-watcher-parent-removal.test.ts | 2 +- ...elay-watcher-pending-setup-waiters.test.ts | 2 +- src/relay/relay-watcher-removal-fence.ts | 2 +- src/relay/relay-watcher-setup-wait.ts | 2 +- .../relay-watcher-shared-byte-index.test.ts | 6 +- src/relay/relay-watcher-shutdown.test.ts | 2 +- src/relay/relay-watcher-terminal-notifier.ts | 2 +- src/relay/relay-windows-path-ripgrep.test.ts | 4 +- src/relay/remote-artifact-cli-forwarding.ts | 4 +- src/relay/remote-artifact-cli-input.test.ts | 2 +- src/relay/remote-artifact-cli-input.ts | 2 +- src/relay/session-search-transport.test.ts | 2 +- src/relay/skill-install-handler.test.ts | 2 +- src/relay/skill-install-handler.ts | 4 +- .../ssh-pty-consumer-session-adapter.test.ts | 4 +- src/relay/ssh-pty-consumer-session-adapter.ts | 2 +- src/relay/ssh-pty-open-client-request.ts | 2 +- src/relay/subprocess-test-utils.ts | 2 +- src/relay/windows-port-scan.test.ts | 2 +- src/relay/windows-port-scan.ts | 2 +- src/relay/workspace-session-handler.test.ts | 4 +- src/relay/workspace-session-handler.ts | 2 +- .../workspace-snapshot-publication.test.ts | 6 +- src/relay/workspace-snapshot-publication.ts | 2 +- .../workspace-space-scan-du-capacity.test.ts | 2 +- src/relay/workspace-space-scan.test.ts | 2 +- src/relay/workspace-space-scan.ts | 2 +- src/shared/agent-hook-relay.ts | 6 +- .../agent-hook-cached-pane-status.ts | 0 .../agent-hook-canonical-status.test.ts | 0 .../agent-hook-canonical-status.ts | 0 .../agent-hook-endpoint-coordinates.ts | 0 .../agent-hook-envelope-build.ts | 0 .../agent-hook-envelope-publication.test.ts | 0 .../agent-hook-envelope-publication.ts | 0 .../agent-hook-event-admission.ts | 0 .../agent-hook-integration.test.ts | 0 ...gent-hook-interrupt-reconciliation.test.ts | 0 .../agent-hook-interrupt-reconciliation.ts | 0 .../agent-hook-opencode-tui-identity.test.ts | 0 .../agent-hook-request.ts | 0 .../agent-hook-result-retry-scheduler.ts | 0 ...er-claude-owed-notification-expiry.test.ts | 0 ...k-server-codex-subagent-transcript.test.ts | 0 ...ook-server-codex-turn-interruption.test.ts | 0 .../agent-hook-server-contract.ts | 0 .../agent-hook-server.test.ts | 0 src/{relay => wsl-guest}/agent-hook-server.ts | 0 .../agent-hook-spool-ingest.ts | 0 .../claude-terminal-interrupt-status.ts | 0 .../client-request-aborts.ts | 0 .../dispatcher-bulk-admission.test.ts | 0 .../dispatcher-bulk-failed-admission.test.ts | 0 ...spatcher-bulk-retirement-admission.test.ts | 0 .../dispatcher-bulk-write-test-harness.ts | 0 .../dispatcher-capacity-degradation.test.ts | 0 .../dispatcher-capacity-signals.ts | 0 .../dispatcher-client-close-cause.test.ts | 0 .../dispatcher-client-lifecycle.ts | 0 .../dispatcher-client-state.ts | 0 .../dispatcher-client-writer.test.ts | 0 .../dispatcher-client-writer.ts | 0 .../dispatcher-contract.ts | 0 .../dispatcher-frame-codec.ts | 0 ...dispatcher-frame-guard-regressions.test.ts | 0 .../dispatcher-json-payload.test.ts | 0 .../dispatcher-notification-ownership.test.ts | 0 .../dispatcher-notification-publication.ts | 0 ...cher-per-connection-state-baseline.test.ts | 0 .../dispatcher-producer-capacity.ts | 0 .../dispatcher-producer-transport.ts | 0 .../dispatcher-pty-publication.ts | 0 .../dispatcher-rpc-cancel-id-coercion.test.ts | 0 .../dispatcher-rpc-routing.ts | 0 .../dispatcher-silent-client-reaper.test.ts | 0 .../dispatcher-structured-error.test.ts | 0 .../dispatcher-timeout.test.ts | 0 .../dispatcher-writer-admission.test.ts | 0 .../dispatcher-writer-admission.ts | 0 .../dispatcher-writer-drain-arm.ts | 0 .../dispatcher-writer-lane-scheduler.ts | 0 .../dispatcher-writer-sink.ts | 0 src/{relay => wsl-guest}/dispatcher.test.ts | 0 src/{relay => wsl-guest}/dispatcher.ts | 0 .../filesystem-capacity-error-wire.test.ts | 0 .../legacy-relay-publication-ledger.test.ts | 0 .../legacy-relay-publication-ledger.ts | 0 .../omp-config-root.test.ts | 0 .../omp-status-extension.ts | 0 .../opencode-canonical-config.ts | 0 .../opencode-overlay-mirror.ts | 0 .../opencode-startup-prompt-install.test.ts | 0 .../plugin-overlay-env.test.ts | 0 .../plugin-overlay-env.ts | 0 .../plugin-overlay.test.ts | 0 src/{relay => wsl-guest}/plugin-overlay.ts | 0 .../plugin-source-limit.test.ts | 0 .../plugin-source-limit.ts | 0 .../preflight-handler.test.ts | 0 src/{relay => wsl-guest}/preflight-handler.ts | 0 .../protocol-backpressure.test.ts | 0 .../protocol-handshake.test.ts | 0 .../protocol-json-payload.test.ts | 0 src/{relay => wsl-guest}/protocol.ts | 0 .../relay-agent-presence.test.ts | 0 .../relay-agent-presence.ts | 0 .../relay-command-env.test.ts | 0 src/{relay => wsl-guest}/relay-command-env.ts | 0 .../relay-frame-decoder.ts | 0 .../relay-hot-path-operation-counts.test.ts | 0 .../relay-tmux-hook-owner.ts | 0 .../wsl-agent-hook-relay.test.ts | 0 .../wsl-agent-hook-relay.ts | 0 .../wsl-browser-network-relay.ts | 0 .../wsl-hook-fs-bridge.test.ts | 0 .../wsl-hook-fs-bridge.ts | 0 .../wsl-install-plugins-handler.test.ts | 0 .../wsl-install-plugins-handler.ts | 0 .../release-checkout-tree.ts | 35 ++++++--- .../release-checkout-tree.unit.test.ts | 15 ++++ .../omp-config-root-relay-shell.test.mjs | 4 +- 263 files changed, 443 insertions(+), 301 deletions(-) create mode 100644 config/scripts/ssh-relay-import-boundary.test.mjs rename src/{relay => wsl-guest}/agent-hook-cached-pane-status.ts (100%) rename src/{relay => wsl-guest}/agent-hook-canonical-status.test.ts (100%) rename src/{relay => wsl-guest}/agent-hook-canonical-status.ts (100%) rename src/{relay => wsl-guest}/agent-hook-endpoint-coordinates.ts (100%) rename src/{relay => wsl-guest}/agent-hook-envelope-build.ts (100%) rename src/{relay => wsl-guest}/agent-hook-envelope-publication.test.ts (100%) rename src/{relay => wsl-guest}/agent-hook-envelope-publication.ts (100%) rename src/{relay => wsl-guest}/agent-hook-event-admission.ts (100%) rename src/{relay => wsl-guest}/agent-hook-integration.test.ts (100%) rename src/{relay => wsl-guest}/agent-hook-interrupt-reconciliation.test.ts (100%) rename src/{relay => wsl-guest}/agent-hook-interrupt-reconciliation.ts (100%) rename src/{relay => wsl-guest}/agent-hook-opencode-tui-identity.test.ts (100%) rename src/{relay => wsl-guest}/agent-hook-request.ts (100%) rename src/{relay => wsl-guest}/agent-hook-result-retry-scheduler.ts (100%) rename src/{relay => wsl-guest}/agent-hook-server-claude-owed-notification-expiry.test.ts (100%) rename src/{relay => wsl-guest}/agent-hook-server-codex-subagent-transcript.test.ts (100%) rename src/{relay => wsl-guest}/agent-hook-server-codex-turn-interruption.test.ts (100%) rename src/{relay => wsl-guest}/agent-hook-server-contract.ts (100%) rename src/{relay => wsl-guest}/agent-hook-server.test.ts (100%) rename src/{relay => wsl-guest}/agent-hook-server.ts (100%) rename src/{relay => wsl-guest}/agent-hook-spool-ingest.ts (100%) rename src/{relay => wsl-guest}/claude-terminal-interrupt-status.ts (100%) rename src/{relay => wsl-guest}/client-request-aborts.ts (100%) rename src/{relay => wsl-guest}/dispatcher-bulk-admission.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher-bulk-failed-admission.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher-bulk-retirement-admission.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher-bulk-write-test-harness.ts (100%) rename src/{relay => wsl-guest}/dispatcher-capacity-degradation.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher-capacity-signals.ts (100%) rename src/{relay => wsl-guest}/dispatcher-client-close-cause.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher-client-lifecycle.ts (100%) rename src/{relay => wsl-guest}/dispatcher-client-state.ts (100%) rename src/{relay => wsl-guest}/dispatcher-client-writer.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher-client-writer.ts (100%) rename src/{relay => wsl-guest}/dispatcher-contract.ts (100%) rename src/{relay => wsl-guest}/dispatcher-frame-codec.ts (100%) rename src/{relay => wsl-guest}/dispatcher-frame-guard-regressions.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher-json-payload.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher-notification-ownership.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher-notification-publication.ts (100%) rename src/{relay => wsl-guest}/dispatcher-per-connection-state-baseline.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher-producer-capacity.ts (100%) rename src/{relay => wsl-guest}/dispatcher-producer-transport.ts (100%) rename src/{relay => wsl-guest}/dispatcher-pty-publication.ts (100%) rename src/{relay => wsl-guest}/dispatcher-rpc-cancel-id-coercion.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher-rpc-routing.ts (100%) rename src/{relay => wsl-guest}/dispatcher-silent-client-reaper.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher-structured-error.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher-timeout.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher-writer-admission.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher-writer-admission.ts (100%) rename src/{relay => wsl-guest}/dispatcher-writer-drain-arm.ts (100%) rename src/{relay => wsl-guest}/dispatcher-writer-lane-scheduler.ts (100%) rename src/{relay => wsl-guest}/dispatcher-writer-sink.ts (100%) rename src/{relay => wsl-guest}/dispatcher.test.ts (100%) rename src/{relay => wsl-guest}/dispatcher.ts (100%) rename src/{relay => wsl-guest}/filesystem-capacity-error-wire.test.ts (100%) rename src/{relay => wsl-guest}/legacy-relay-publication-ledger.test.ts (100%) rename src/{relay => wsl-guest}/legacy-relay-publication-ledger.ts (100%) rename src/{relay => wsl-guest}/omp-config-root.test.ts (100%) rename src/{relay => wsl-guest}/omp-status-extension.ts (100%) rename src/{relay => wsl-guest}/opencode-canonical-config.ts (100%) rename src/{relay => wsl-guest}/opencode-overlay-mirror.ts (100%) rename src/{relay => wsl-guest}/opencode-startup-prompt-install.test.ts (100%) rename src/{relay => wsl-guest}/plugin-overlay-env.test.ts (100%) rename src/{relay => wsl-guest}/plugin-overlay-env.ts (100%) rename src/{relay => wsl-guest}/plugin-overlay.test.ts (100%) rename src/{relay => wsl-guest}/plugin-overlay.ts (100%) rename src/{relay => wsl-guest}/plugin-source-limit.test.ts (100%) rename src/{relay => wsl-guest}/plugin-source-limit.ts (100%) rename src/{relay => wsl-guest}/preflight-handler.test.ts (100%) rename src/{relay => wsl-guest}/preflight-handler.ts (100%) rename src/{relay => wsl-guest}/protocol-backpressure.test.ts (100%) rename src/{relay => wsl-guest}/protocol-handshake.test.ts (100%) rename src/{relay => wsl-guest}/protocol-json-payload.test.ts (100%) rename src/{relay => wsl-guest}/protocol.ts (100%) rename src/{relay => wsl-guest}/relay-agent-presence.test.ts (100%) rename src/{relay => wsl-guest}/relay-agent-presence.ts (100%) rename src/{relay => wsl-guest}/relay-command-env.test.ts (100%) rename src/{relay => wsl-guest}/relay-command-env.ts (100%) rename src/{relay => wsl-guest}/relay-frame-decoder.ts (100%) rename src/{relay => wsl-guest}/relay-hot-path-operation-counts.test.ts (100%) rename src/{relay => wsl-guest}/relay-tmux-hook-owner.ts (100%) rename src/{relay => wsl-guest}/wsl-agent-hook-relay.test.ts (100%) rename src/{relay => wsl-guest}/wsl-agent-hook-relay.ts (100%) rename src/{relay => wsl-guest}/wsl-browser-network-relay.ts (100%) rename src/{relay => wsl-guest}/wsl-hook-fs-bridge.test.ts (100%) rename src/{relay => wsl-guest}/wsl-hook-fs-bridge.ts (100%) rename src/{relay => wsl-guest}/wsl-install-plugins-handler.test.ts (100%) rename src/{relay => wsl-guest}/wsl-install-plugins-handler.ts (100%) diff --git a/.github/workflows/ssh-hostile-hosts.yml b/.github/workflows/ssh-hostile-hosts.yml index 4ab295aa26a..fc319e9f976 100644 --- a/.github/workflows/ssh-hostile-hosts.yml +++ b/.github/workflows/ssh-hostile-hosts.yml @@ -17,6 +17,7 @@ on: - 'src/main/ssh/ssh-hostile-host-*' - 'src/main/ssh/sftp-*' - 'src/relay/**' + - 'src/wsl-guest/**' - 'src/shared/node-runtime-pin.ts' - 'src/shared/orcad-artifacts.ts' - 'config/scripts/build-orcad-*.mjs' diff --git a/.github/workflows/ssh-windows-hosts.yml b/.github/workflows/ssh-windows-hosts.yml index b37f58207ab..752f3ff9a2a 100644 --- a/.github/workflows/ssh-windows-hosts.yml +++ b/.github/workflows/ssh-windows-hosts.yml @@ -18,6 +18,7 @@ on: - 'src/main/ssh/ssh-windows-host-*' - 'src/main/ssh/ssh-session-command-audit.ts' - 'src/relay/**' + - 'src/wsl-guest/**' - 'src/packages/process-host/**' - 'pnpm-workspace.yaml' - 'src/shared/node-runtime-pin.ts' diff --git a/config/knip.json b/config/knip.json index 98891b9e687..51212970751 100644 --- a/config/knip.json +++ b/config/knip.json @@ -21,7 +21,7 @@ "src/renderer/src/**/*.worker.ts", "src/cli/index.ts", "src/relay/relay.ts", - "src/relay/wsl-agent-hook-relay.ts", + "src/wsl-guest/wsl-agent-hook-relay.ts", "config/scripts/**/*.{mjs,cjs,js,ts}", "config/build-plugins/**/*.ts", "electron.vite.config.ts", diff --git a/config/process-host-direct-import-baseline.txt b/config/process-host-direct-import-baseline.txt index abbad1d1a47..4b50f154990 100644 --- a/config/process-host-direct-import-baseline.txt +++ b/config/process-host-direct-import-baseline.txt @@ -130,7 +130,6 @@ src/relay/ai-vault-service-spawn.ts src/relay/external-automations-handler.ts src/relay/fs-handler-git-fallback.ts src/relay/fs-handler-list-files.ts -src/relay/preflight-handler.ts src/relay/pty-shell-utils.ts src/relay/subprocess-tree-termination.ts src/relay/workspace-space-scan.ts @@ -140,3 +139,4 @@ src/shared/fish-binary-requirement.ts src/shared/process-table-snapshot-reader.ts src/shared/pty-slave-line-discipline-echo.ts src/shared/shell-process-readiness.ts +src/wsl-guest/preflight-handler.ts diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index aec0fe91af2..db244cabe76 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -337,7 +337,7 @@ "invariant": "An ended tracked task stays pending until its wake-up and finishing turn end; missing wake-ups expire only after 60 idle seconds. Cancellation remains owned by the executing host, duplicate delivery cannot create a fresh completion veto, and fresh native rest can recover a lost finishing Stop.", "oracle": "Replay captured hook ordering through production HTTP entry points and native ready bytes through the actual automation observer. Check local/relay state, cancellation/new-turn fencing, fresh versus retained rest, bounded task/timer ownership, and zero global status reads during indexed runtime waits.", "commands": [ - "ORCA_BACKGROUND_LAUNCH=1 node node_modules/vitest/vitest.mjs run --config config/vitest.config.ts src/main/agent-hooks/server-claude-task-wakeup-lifecycle.test.ts src/main/runtime/tui-idle-claude-task-wakeup.test.ts src/main/runtime/claude-task-wakeup-indexed-read.test.ts src/shared/claude-owed-notification-resource-contract.test.ts src/shared/agent-hook-listener-claude-task-notification.test.ts src/shared/agent-hook-listener-claude-reordered-task-notification.test.ts src/relay/agent-hook-interrupt-reconciliation.test.ts src/main/ssh/ssh-agent-hook-interrupt-reconciliation.test.ts" + "ORCA_BACKGROUND_LAUNCH=1 node node_modules/vitest/vitest.mjs run --config config/vitest.config.ts src/main/agent-hooks/server-claude-task-wakeup-lifecycle.test.ts src/main/runtime/tui-idle-claude-task-wakeup.test.ts src/main/runtime/claude-task-wakeup-indexed-read.test.ts src/shared/claude-owed-notification-resource-contract.test.ts src/shared/agent-hook-listener-claude-task-notification.test.ts src/shared/agent-hook-listener-claude-reordered-task-notification.test.ts src/wsl-guest/agent-hook-interrupt-reconciliation.test.ts src/main/ssh/ssh-agent-hook-interrupt-reconciliation.test.ts" ], "testFiles": [ "src/main/agent-hooks/server-claude-task-wakeup-lifecycle.test.ts", @@ -346,7 +346,7 @@ "src/shared/claude-owed-notification-resource-contract.test.ts", "src/shared/agent-hook-listener-claude-task-notification.test.ts", "src/shared/agent-hook-listener-claude-reordered-task-notification.test.ts", - "src/relay/agent-hook-interrupt-reconciliation.test.ts", + "src/wsl-guest/agent-hook-interrupt-reconciliation.test.ts", "src/main/ssh/ssh-agent-hook-interrupt-reconciliation.test.ts" ], "assertionRefs": [ @@ -376,7 +376,7 @@ "date": "2026-10-06", "runner": "local", "platform": "macos", - "command": "ORCA_BACKGROUND_LAUNCH=1 node node_modules/vitest/vitest.mjs run --config config/vitest.config.ts src/main/agent-hooks/server-claude-task-wakeup-lifecycle.test.ts src/main/runtime/tui-idle-claude-task-wakeup.test.ts src/main/runtime/claude-task-wakeup-indexed-read.test.ts src/shared/claude-owed-notification-resource-contract.test.ts src/shared/agent-hook-listener-claude-task-notification.test.ts src/shared/agent-hook-listener-claude-reordered-task-notification.test.ts src/relay/agent-hook-interrupt-reconciliation.test.ts src/main/ssh/ssh-agent-hook-interrupt-reconciliation.test.ts", + "command": "ORCA_BACKGROUND_LAUNCH=1 node node_modules/vitest/vitest.mjs run --config config/vitest.config.ts src/main/agent-hooks/server-claude-task-wakeup-lifecycle.test.ts src/main/runtime/tui-idle-claude-task-wakeup.test.ts src/main/runtime/claude-task-wakeup-indexed-read.test.ts src/shared/claude-owed-notification-resource-contract.test.ts src/shared/agent-hook-listener-claude-task-notification.test.ts src/shared/agent-hook-listener-claude-reordered-task-notification.test.ts src/wsl-guest/agent-hook-interrupt-reconciliation.test.ts src/main/ssh/ssh-agent-hook-interrupt-reconciliation.test.ts", "result": "passed", "durationSeconds": 8.62, "summary": "Exact stored command with repository Vitest configuration passes 148 tests across eight files including out-of-order launch/end/delivery controls. Includes real HTTP/relay ingress, 12 blank/padded Agent/Bash/Monitor IDs, captured-native-rest automation completion, duplicate/cancellation controls, owner/phase gates, timer/task bounds and indexed reads. Three upstream interrupt suites pass 28 more tests separately." @@ -9838,7 +9838,7 @@ "invariant": "PreCompact is never registered and may never move a pane, because it fires before the compact is validated and an aborted compact emits it alone. Only a manual PostCompact may mark done, and it does so as a session boundary so completion-reactive consumers stay out of it; an automatic PostCompact claims nothing and writes no compact-scoped state, since its turn resumes and emits its own Stop. A completion either CLEARS a row or publishes nothing at all: it never creates a row, so a retired pane cannot be resurrected, and it never restates one it cannot clear, because a restated row loses restoredUnconfirmed and restarts the staleness clock. A manual /compact only completes at an idle prompt, so it retires a subagent that exists ONLY as a disk snapshot; live evidence -- a child observed in this runtime, an unclassifiable running background task, a registered session cron -- still holds the pane at working. A completion requires a valid provider prompt UUID, matches the pane owner by connection and provider session -- except on a restored row, which carries the previous connection and may carry no session at all -- and is applied at most once per compact. Ownership is enforced by the client that owns pane identity; a relay forwards and defers, so a cold relay cache cannot swallow the clearing event. A relay predating this contract forwards its own mapping, so ingest drops automatic envelopes, stamps the boundary on manual ones, carries the summarized turn label onto a promptless completion with or without a trigger, and classifies a trigger-stripped replay by payload state while still enforcing ownership. Kimi and other Claude-compatible vendors remain fail-closed.", "oracle": "Replay the measured Claude compact streams through a harness gated on the real CLAUDE_EVENTS, plus local HTTP, relay, SSH, and persisted-restore transports. Require the successful manual stream to end done with sessionBoundary set, and require the aborted stream (PreCompact alone) to leave both an idle and a working pane exactly as it found them. Drive the restart shape end to end over loopback HTTP from a hydrated row: a pane held only by a snapshot child must reach done with an empty roster, while a pane a runtime child still owns must emit NOTHING and keep its row object identical, so receivedAt and restoredUnconfirmed both survive. Deliver the restored-row cases with the hydrated row still cached at completion time and assert the summarizer published nothing, so the restored-row branch is the branch under test. Require rejection of an automatic completion, a completion with absent prompt UUID, a foreign provider session, a duplicate, and a completion for a pane with no cached row; require an automatic completion to leave the consumed-compact map untouched. Require a relay with a COLD cache to forward the completion while the client still refuses to mint a row it never had. Require ingest to drop legacy automatic envelopes, stamp the boundary on legacy manual ones, carry the summarized turn label onto a promptless completion with and without a trigger, and leave a FINISHED pane finished when a trigger-stripped working replay arrives. Require the consumed-compact map to be empty after each pane-scoped teardown route and to follow a pane move. Assert registration membership, emitted event order, and the authoritative lastStatusByPaneKey snapshot.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/main/claude/compact-status-registration.test.ts src/main/agent-hooks/manual-compact-hook-stream.test.ts src/main/agent-hooks/manual-compact-status-cleanup.test.ts src/shared/agent-hook-listener-claude-turn-state.test.ts src/shared/agent-hook-listener-claude-compatible-vendors.test.ts src/shared/agent-hook-relay.test.ts src/relay/agent-hook-server.test.ts src/main/agent-hooks/server-claude-normalization.test.ts src/main/agent-hooks/server-last-status-write.test.ts src/main/ssh/ssh-relay-session-agent-hooks.integration.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/main/claude/compact-status-registration.test.ts src/main/agent-hooks/manual-compact-hook-stream.test.ts src/main/agent-hooks/manual-compact-status-cleanup.test.ts src/shared/agent-hook-listener-claude-turn-state.test.ts src/shared/agent-hook-listener-claude-compatible-vendors.test.ts src/shared/agent-hook-relay.test.ts src/wsl-guest/agent-hook-server.test.ts src/main/agent-hooks/server-claude-normalization.test.ts src/main/agent-hooks/server-last-status-write.test.ts src/main/ssh/ssh-relay-session-agent-hooks.integration.test.ts --reporter=dot", "Manual Claude Code interactive compact under a PTY: register every hook to a logging script, run one turn then /compact to observe the abort stream, then seven turns and /compact to observe the success stream; compare source, trigger, session_id, and prompt_id across both" ], "testFiles": [ @@ -9848,7 +9848,7 @@ "src/shared/agent-hook-listener-claude-turn-state.test.ts", "src/shared/agent-hook-listener-claude-compatible-vendors.test.ts", "src/shared/agent-hook-relay.test.ts", - "src/relay/agent-hook-server.test.ts", + "src/wsl-guest/agent-hook-server.test.ts", "src/main/agent-hooks/server-claude-normalization.test.ts", "src/main/agent-hooks/server-last-status-write.test.ts", "src/main/ssh/ssh-relay-session-agent-hooks.integration.test.ts" @@ -9896,7 +9896,7 @@ "date": "2026-08-18", "runner": "local", "platform": "macos", - "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/claude/compact-status-registration.test.ts src/main/agent-hooks/manual-compact-hook-stream.test.ts src/main/agent-hooks/manual-compact-status-cleanup.test.ts src/shared/agent-hook-listener-claude-turn-state.test.ts src/shared/agent-hook-listener-claude-compatible-vendors.test.ts src/shared/agent-hook-relay.test.ts src/relay/agent-hook-server.test.ts src/main/agent-hooks/server-claude-normalization.test.ts src/main/agent-hooks/server-last-status-write.test.ts src/main/ssh/ssh-relay-session-agent-hooks.integration.test.ts --reporter=dot", + "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/claude/compact-status-registration.test.ts src/main/agent-hooks/manual-compact-hook-stream.test.ts src/main/agent-hooks/manual-compact-status-cleanup.test.ts src/shared/agent-hook-listener-claude-turn-state.test.ts src/shared/agent-hook-listener-claude-compatible-vendors.test.ts src/shared/agent-hook-relay.test.ts src/wsl-guest/agent-hook-server.test.ts src/main/agent-hooks/server-claude-normalization.test.ts src/main/agent-hooks/server-last-status-write.test.ts src/main/ssh/ssh-relay-session-agent-hooks.integration.test.ts --reporter=dot", "result": "passed", "durationSeconds": 3.28, "summary": "Ten files and 116 tests passed across registration, listener, local HTTP, relay, SSH, persistence, and cleanup. Reverting only the four source files to the merge base first turned 12 of 21 registration-gated tests and 8 of 12 relay/ingest tests red, so the suite observes its own failure rather than passing over unreachable code. Every assertion was additionally mutation-tested: 18 of 18 targeted mutations -- including reaping runtime children as well as snapshot ones, restating a pane live evidence still holds, re-enforcing compact ownership on the relay, and dropping the consumed-compact map from any one teardown route -- are caught." @@ -12799,17 +12799,17 @@ "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty-pending-projection-admissions.test.ts src/main/ipc/ssh-pty-legacy-projection.test.ts src/main/ipc/ssh-pty-model-admission.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime-path-candidate-history.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/orca-runtime-tail-wait-memo.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/providers/ssh-pty-provider.test.ts src/main/providers/ssh-pty-source-delivery-ledger.test.ts src/main/ssh/ssh-pty-retired-source-deliveries.test.ts src/main/ssh/ssh-relay-session.test.ts src/main/ssh/ssh-relay-session-data-delivery.test.ts src/main/ssh/ssh-relay-session-recovery-races.test.ts src/main/ssh/ssh-relay-session-incarnation.test.ts src/main/ssh/ssh-relay-session-reconnect-incarnation.test.ts src/main/ssh/ssh-relay-session-terminal-error.test.ts src/main/ssh/ssh-pty-recovery-retention-budget.test.ts src/relay/protocol-backpressure.test.ts src/relay/pty-source-credit-ledger.test.ts src/relay/pty-source-credit-scheduler.test.ts src/relay/relay-pty-source-publication.test.ts src/relay/ssh-pty-source-credit-adapter.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/main/providers/ssh-pty-provider.test.ts src/main/providers/ssh-pty-source-delivery-ledger.test.ts src/main/ssh/ssh-pty-retired-source-deliveries.test.ts src/main/ssh/ssh-relay-session.test.ts src/main/ssh/ssh-relay-session-data-delivery.test.ts src/main/ssh/ssh-relay-session-recovery-races.test.ts src/main/ssh/ssh-relay-session-incarnation.test.ts src/main/ssh/ssh-relay-session-reconnect-incarnation.test.ts src/main/ssh/ssh-relay-session-terminal-error.test.ts src/main/ssh/ssh-pty-recovery-retention-budget.test.ts src/wsl-guest/protocol-backpressure.test.ts src/relay/pty-source-credit-ledger.test.ts src/relay/pty-source-credit-scheduler.test.ts src/relay/relay-pty-source-publication.test.ts src/relay/ssh-pty-source-credit-adapter.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/ssh-pty-model-admission.test.ts src/main/ipc/ssh-pty-output-model-migration.test.ts src/main/ssh/ssh-relay-session-model-migration.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/relay/git-response-stream-ownership.test.ts src/relay/pty-handler-output-streaming.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/providers/ssh-pty-notification-routing.test.ts src/main/providers/ssh-pty-provider-agent-session-create-operation.test.ts src/main/providers/ssh-pty-provider-exit-race.test.ts src/main/providers/ssh-pty-provider-reattach-incarnation.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/relay/relay-pty-source-recovery-interleavings.test.ts src/relay/relay-pty-source-recovery-completion.test.ts src/relay/relay-pty-source-restore-retry.test.ts --reporter=dot", - "pnpm exec vitest run --config config/vitest.config.ts src/relay/dispatcher.test.ts src/relay/pty-handler-source-publication.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/wsl-guest/dispatcher.test.ts src/relay/pty-handler-source-publication.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/ssh/ssh-relay-session-recovery-races.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/ssh-pty-legacy-projection.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/ssh-pty-remote-source-range-consumers.test.ts src/main/runtime/rpc/terminal-source-range-ledger.test.ts src/main/runtime/rpc/terminal-multiplex-source-range-admission.test.ts --reporter=dot", - "pnpm exec vitest run --config config/vitest.config.ts src/shared/pty-consumer-session.test.ts src/main/ipc/ssh-pty-output-intake.test.ts src/main/ipc/ssh-pty-output-exit-deadline.test.ts src/main/ipc/ssh-pty-remote-source-range-consumers.test.ts src/main/runtime/rpc/terminal-multiplex-source-range-admission.test.ts src/main/ssh/ssh-multiplexer-transport-writer.test.ts src/main/ssh/ssh-channel-multiplexer.test.ts src/main/ssh/ssh-relay-deploy.test.ts src/relay/dispatcher-client-writer.test.ts --reporter=dot", - "pnpm exec vitest run --config config/vitest.config.ts src/shared/pty-consumer-session.test.ts src/main/ipc/ssh-pty-output-intake.test.ts src/main/ipc/ssh-pty-output-generation-guard.test.ts src/main/ipc/ssh-pty-output-exit-deadline.test.ts src/main/ipc/ssh-pty-remote-source-range-consumers.test.ts src/main/runtime/rpc/terminal-multiplex-source-range-admission.test.ts src/main/ssh/ssh-multiplexer-transport-writer.test.ts src/main/ssh/ssh-channel-multiplexer.test.ts src/main/ssh/ssh-channel-multiplexer-backpressure.test.ts src/main/ssh/ssh-relay-deploy.test.ts src/relay/dispatcher-client-writer.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/shared/pty-consumer-session.test.ts src/main/ipc/ssh-pty-output-intake.test.ts src/main/ipc/ssh-pty-output-exit-deadline.test.ts src/main/ipc/ssh-pty-remote-source-range-consumers.test.ts src/main/runtime/rpc/terminal-multiplex-source-range-admission.test.ts src/main/ssh/ssh-multiplexer-transport-writer.test.ts src/main/ssh/ssh-channel-multiplexer.test.ts src/main/ssh/ssh-relay-deploy.test.ts src/wsl-guest/dispatcher-client-writer.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/shared/pty-consumer-session.test.ts src/main/ipc/ssh-pty-output-intake.test.ts src/main/ipc/ssh-pty-output-generation-guard.test.ts src/main/ipc/ssh-pty-output-exit-deadline.test.ts src/main/ipc/ssh-pty-remote-source-range-consumers.test.ts src/main/runtime/rpc/terminal-multiplex-source-range-admission.test.ts src/main/ssh/ssh-multiplexer-transport-writer.test.ts src/main/ssh/ssh-channel-multiplexer.test.ts src/main/ssh/ssh-channel-multiplexer-backpressure.test.ts src/main/ssh/ssh-relay-deploy.test.ts src/wsl-guest/dispatcher-client-writer.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/relay/relay-pty-source-restore-retry.test.ts src/main/ssh/ssh-relay-session-recovery-races.test.ts src/main/runtime/rpc/terminal-source-range-ledger.test.ts src/main/runtime/rpc/terminal-multiplex-source-range-admission.test.ts src/main/ssh/ssh-multiplexer-transport-writer.test.ts src/main/ssh/ssh-channel-multiplexer-backpressure.test.ts src/main/providers/ssh-pty-notification-routing.test.ts src/main/providers/ssh-pty-source-delivery-ledger.test.ts src/main/ssh/ssh-pty-retired-source-deliveries.test.ts src/main/providers/ssh-pty-provider-agent-session-create-operation.test.ts src/main/providers/ssh-pty-provider-exit-race.test.ts src/main/ipc/ssh-pty-output-exit-deadline.test.ts src/main/ipc/ssh-pty-remote-source-range-consumers.test.ts --reporter=dot", "pnpm exec vitest run src/main/providers/ssh-pty-notification-routing.test.ts src/main/providers/ssh-pty-provider-exit-race.test.ts src/main/ssh/ssh-relay-session-data-delivery.test.ts src/main/ssh/ssh-relay-session-recovery-races.test.ts src/main/ssh/ssh-relay-session-reconnect-incarnation.test.ts src/main/ssh/ssh-relay-session-incarnation.test.ts src/main/ssh/ssh-relay-session.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/ssh/ssh-relay-session.test.ts src/main/ssh/ssh-relay-session-data-delivery.test.ts src/main/ssh/ssh-relay-session-reconnect-incarnation.test.ts src/main/ssh/ssh-relay-deploy.test.ts src/relay/ssh-pty-consumer-session-adapter.test.ts src/main/persistence-ssh-targets-and-pane-keys.test.ts --reporter=dot", @@ -12846,7 +12846,7 @@ "src/main/ssh/ssh-relay-session-terminal-error.test.ts", "src/main/ssh/ssh-pty-recovery-retention-budget.test.ts", "src/main/ssh/ssh-pty-retired-source-deliveries.test.ts", - "src/relay/protocol-backpressure.test.ts", + "src/wsl-guest/protocol-backpressure.test.ts", "src/relay/git-response-stream-ownership.test.ts", "src/relay/pty-handler-output-streaming.test.ts", "src/relay/pty-source-credit-ledger.test.ts", @@ -12855,7 +12855,7 @@ "src/relay/relay-pty-source-recovery-interleavings.test.ts", "src/relay/relay-pty-source-recovery-completion.test.ts", "src/relay/relay-pty-source-restore-retry.test.ts", - "src/relay/dispatcher.test.ts", + "src/wsl-guest/dispatcher.test.ts", "src/relay/pty-handler-source-publication.test.ts", "src/relay/ssh-pty-source-credit-adapter.test.ts", "src/shared/pty-consumer-session.test.ts", @@ -12872,7 +12872,7 @@ "src/main/ssh/ssh-channel-multiplexer-backpressure.test.ts", "src/main/ssh/ssh-relay-deploy.test.ts", "src/main/persistence-ssh-targets-and-pane-keys.test.ts", - "src/relay/dispatcher-client-writer.test.ts", + "src/wsl-guest/dispatcher-client-writer.test.ts", "src/main/agent-hooks/wsl-hook-relay-sentinel.test.ts", "tests/e2e/ssh-docker-relay-perf.spec.ts" ], @@ -13029,7 +13029,7 @@ ] }, { - "file": "src/relay/dispatcher.test.ts", + "file": "src/wsl-guest/dispatcher.test.ts", "assertions": [ "a saturated legacy primary remains required backpressure and is never detached as an additional subscriber" ] @@ -13063,7 +13063,7 @@ ] }, { - "file": "src/relay/protocol-backpressure.test.ts", + "file": "src/wsl-guest/protocol-backpressure.test.ts", "assertions": [ "relay decoder accepts one maximum frame plus 1 MiB partial input and rejects one extra byte", "a throwing continuation clears retained input, releases one pause epoch, and publishes one typed ownership error" @@ -13196,7 +13196,7 @@ ] }, { - "file": "src/relay/dispatcher-client-writer.test.ts", + "file": "src/wsl-guest/dispatcher-client-writer.test.ts", "assertions": [ "encoded producer frames stay below high-water-minus-reserve capacity", "one fixed-size filesystem compatibility frame is admitted only on an empty sink", @@ -13250,7 +13250,7 @@ "date": "2026-07-29", "runner": "local", "platform": "macos", - "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/providers/ssh-pty-provider.test.ts src/main/providers/ssh-pty-source-delivery-ledger.test.ts src/main/ssh/ssh-pty-retired-source-deliveries.test.ts src/main/ssh/ssh-relay-session.test.ts src/main/ssh/ssh-relay-session-data-delivery.test.ts src/main/ssh/ssh-relay-session-recovery-races.test.ts src/main/ssh/ssh-relay-session-incarnation.test.ts src/main/ssh/ssh-relay-session-reconnect-incarnation.test.ts src/main/ssh/ssh-relay-session-terminal-error.test.ts src/main/ssh/ssh-pty-recovery-retention-budget.test.ts src/relay/protocol-backpressure.test.ts src/relay/pty-source-credit-ledger.test.ts src/relay/pty-source-credit-scheduler.test.ts src/relay/relay-pty-source-publication.test.ts src/relay/ssh-pty-source-credit-adapter.test.ts --reporter=dot", + "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/providers/ssh-pty-provider.test.ts src/main/providers/ssh-pty-source-delivery-ledger.test.ts src/main/ssh/ssh-pty-retired-source-deliveries.test.ts src/main/ssh/ssh-relay-session.test.ts src/main/ssh/ssh-relay-session-data-delivery.test.ts src/main/ssh/ssh-relay-session-recovery-races.test.ts src/main/ssh/ssh-relay-session-incarnation.test.ts src/main/ssh/ssh-relay-session-reconnect-incarnation.test.ts src/main/ssh/ssh-relay-session-terminal-error.test.ts src/main/ssh/ssh-pty-recovery-retention-budget.test.ts src/wsl-guest/protocol-backpressure.test.ts src/relay/pty-source-credit-ledger.test.ts src/relay/pty-source-credit-scheduler.test.ts src/relay/relay-pty-source-publication.test.ts src/relay/ssh-pty-source-credit-adapter.test.ts --reporter=dot", "result": "passed", "durationSeconds": 2.24, "summary": "Sixteen deterministic SSH relay/session/source/decoder files passed 192 tests, including exit-sealed private recovery, retained stale-transfer cancellation authority, exact private-frame proof watermarks, one retirement record across 10,000 same-PTY token rotations, stale-owner fallback, and scheduler rejection isolation; no live topology was exercised." diff --git a/config/scripts/build-relay.mjs b/config/scripts/build-relay.mjs index 27e5103e76a..fcff37a8254 100644 --- a/config/scripts/build-relay.mjs +++ b/config/scripts/build-relay.mjs @@ -289,8 +289,8 @@ for (const platform of RELAY_BUILD_PLATFORMS) { // so a single platform-independent bundle suffices; it ships inside the // Windows app via the same out/relay extraResources mapping. { - const wslHookEntry = join(ROOT, 'src', 'relay', 'wsl-agent-hook-relay.ts') - const wslBrowserNetworkEntry = join(ROOT, 'src', 'relay', 'wsl-browser-network-relay.ts') + const wslHookEntry = join(ROOT, 'src', 'wsl-guest', 'wsl-agent-hook-relay.ts') + const wslBrowserNetworkEntry = join(ROOT, 'src', 'wsl-guest', 'wsl-browser-network-relay.ts') const outDir = join(OUT_ROOT, 'wsl') mkdirSync(outDir, { recursive: true }) await build({ diff --git a/config/scripts/check-changed-code-quality.mjs b/config/scripts/check-changed-code-quality.mjs index 9b213031aa7..484e558f1c5 100644 --- a/config/scripts/check-changed-code-quality.mjs +++ b/config/scripts/check-changed-code-quality.mjs @@ -232,11 +232,12 @@ export function collectBaseLineBlocks(root, comparisonBase, files = null) { // Why: in a split, the moved code's base text lives in the ORIGINAL file, which is // often deleted or renamed away. Deleted paths never reach the changed-file list // (it filters to ACMRTUB), so read every path the diff touches, deletions included. + // --no-renames: a rename otherwise lists only its new path, which the base lacks. const paths = files ?? - splitNullDelimited(runGit(root, ['diff', '--name-only', '-z', comparisonBase, '--'])).filter( - (file) => SOURCE_FILE_PATTERN.test(file) - ) + splitNullDelimited( + runGit(root, ['diff', '--name-only', '--no-renames', '-z', comparisonBase, '--']) + ).filter((file) => SOURCE_FILE_PATTERN.test(file)) const blocks = [] for (const file of paths) { const result = spawnSync('git', ['show', `${comparisonBase}:${file}`], { diff --git a/config/scripts/check-changed-code-quality.test.mjs b/config/scripts/check-changed-code-quality.test.mjs index 91d6f64d4cf..c87b80689a1 100644 --- a/config/scripts/check-changed-code-quality.test.mjs +++ b/config/scripts/check-changed-code-quality.test.mjs @@ -1,10 +1,12 @@ import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' import path from 'node:path' import { describe, expect, it } from 'vitest' import { runProcessSync } from '@orca/process-host' import { resolveOxlintInvocation } from './oxlint-cli-invocation.mjs' import { OXLINT_SCANS, + collectBaseLineBlocks, diagnosticTouchesAddedLines, isUnloadedPluginDirectiveUnusedWarning, isMovedCode, @@ -124,6 +126,31 @@ describe('moved-code exemption', () => { it('never exempts an empty highlight', () => { expect(isMovedCode(['', ' '], [['a()']])).toBe(false) }) + + it('reads the base text of a file that was renamed away', () => { + const repo = mkdtempSync(path.join(tmpdir(), 'changed-code-quality-rename-')) + try { + const git = (...args) => { + const result = runProcessSync({ + program: 'git', + args: ['-c', 'commit.gpgsign=false', ...args], + cwd: repo + }) + expect(result.code, result.stderr).toBe(0) + return result.stdout.trim() + } + git('init', '--quiet') + writeFileSync(path.join(repo, 'old.ts'), 'const moved = value as Thing\n') + git('add', 'old.ts') + git('-c', 'user.name=t', '-c', 'user.email=t@example.invalid', 'commit', '-qm', 'base') + const base = git('rev-parse', 'HEAD') + git('mv', 'old.ts', 'new.ts') + + expect(collectBaseLineBlocks(repo, base)).toEqual([['const moved = value as Thing']]) + } finally { + rmSync(repo, { recursive: true, force: true }) + } + }) }) describe('unloaded plugin directive unused warning', () => { diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index a9653e55471..ebff3e03a68 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -4697,11 +4697,11 @@ "src/preload/usage-provider-api.test.ts": 47, "src/relay/agent-exec-handler-windows.test.ts": 71, "src/relay/agent-exec-handler.test.ts": 157, - "src/relay/agent-hook-envelope-publication.test.ts": 351, - "src/relay/agent-hook-integration.test.ts": 848, + "src/wsl-guest/agent-hook-envelope-publication.test.ts": 351, + "src/wsl-guest/agent-hook-integration.test.ts": 848, "src/relay/agent-hook-retired-pane-suppression.test.ts": 451, - "src/relay/agent-hook-server-codex-subagent-transcript.test.ts": 1327, - "src/relay/agent-hook-server.test.ts": 1396, + "src/wsl-guest/agent-hook-server-codex-subagent-transcript.test.ts": 1327, + "src/wsl-guest/agent-hook-server.test.ts": 1396, "src/relay/agent-status-store-relay-context.test.ts": 144, "src/relay/ai-vault-handler.test.ts": 689, "src/relay/ai-vault-opencode-reader.test.ts": 405, @@ -4710,19 +4710,19 @@ "src/relay/ai-vault-service-restart-policy.test.ts": 69, "src/relay/ai-vault-service-spawn.test.ts": 54, "src/relay/context.test.ts": 39, - "src/relay/dispatcher-capacity-degradation.test.ts": 194, - "src/relay/dispatcher-client-close-cause.test.ts": 194, - "src/relay/dispatcher-client-writer.test.ts": 92, - "src/relay/dispatcher-frame-guard-regressions.test.ts": 169, - "src/relay/dispatcher-json-payload.test.ts": 122, - "src/relay/dispatcher-notification-ownership.test.ts": 140, - "src/relay/dispatcher-per-connection-state-baseline.test.ts": 146, - "src/relay/dispatcher-rpc-cancel-id-coercion.test.ts": 134, - "src/relay/dispatcher-silent-client-reaper.test.ts": 213, - "src/relay/dispatcher-structured-error.test.ts": 136, - "src/relay/dispatcher-timeout.test.ts": 210, - "src/relay/dispatcher-writer-admission.test.ts": 161, - "src/relay/dispatcher.test.ts": 306, + "src/wsl-guest/dispatcher-capacity-degradation.test.ts": 194, + "src/wsl-guest/dispatcher-client-close-cause.test.ts": 194, + "src/wsl-guest/dispatcher-client-writer.test.ts": 92, + "src/wsl-guest/dispatcher-frame-guard-regressions.test.ts": 169, + "src/wsl-guest/dispatcher-json-payload.test.ts": 122, + "src/wsl-guest/dispatcher-notification-ownership.test.ts": 140, + "src/wsl-guest/dispatcher-per-connection-state-baseline.test.ts": 146, + "src/wsl-guest/dispatcher-rpc-cancel-id-coercion.test.ts": 134, + "src/wsl-guest/dispatcher-silent-client-reaper.test.ts": 213, + "src/wsl-guest/dispatcher-structured-error.test.ts": 136, + "src/wsl-guest/dispatcher-timeout.test.ts": 210, + "src/wsl-guest/dispatcher-writer-admission.test.ts": 161, + "src/wsl-guest/dispatcher.test.ts": 306, "src/relay/external-automation-provider-catalog.test.ts": 59, "src/relay/external-automations-handler-log-path.test.ts": 46, "src/relay/external-automations-handler.test.ts": 77, @@ -4788,20 +4788,20 @@ "src/relay/hermes-run-correlation.test.ts": 44, "src/relay/hermes-run-history.test.ts": 85, "src/relay/integration.test.ts": 1877, - "src/relay/legacy-relay-publication-ledger.test.ts": 36, + "src/wsl-guest/legacy-relay-publication-ledger.test.ts": 36, "src/relay/managed-hook-installer.test.ts": 117, "src/relay/node-pty-binding-survey.test.ts": 246, "src/relay/node-pty-unavailable-diagnosis.test.ts": 185, - "src/relay/omp-config-root.test.ts": 152, + "src/wsl-guest/omp-config-root.test.ts": 152, "src/relay/omp-fresh-launch-environment.test.ts": 600, - "src/relay/plugin-overlay-env.test.ts": 60, - "src/relay/plugin-overlay.test.ts": 164, - "src/relay/plugin-source-limit.test.ts": 41, + "src/wsl-guest/plugin-overlay-env.test.ts": 60, + "src/wsl-guest/plugin-overlay.test.ts": 164, + "src/wsl-guest/plugin-source-limit.test.ts": 41, "src/relay/port-scan-handler.test.ts": 190, - "src/relay/preflight-handler.test.ts": 97, - "src/relay/protocol-backpressure.test.ts": 87, - "src/relay/protocol-handshake.test.ts": 63, - "src/relay/protocol-json-payload.test.ts": 188, + "src/wsl-guest/preflight-handler.test.ts": 97, + "src/wsl-guest/protocol-backpressure.test.ts": 87, + "src/wsl-guest/protocol-handshake.test.ts": 63, + "src/wsl-guest/protocol-json-payload.test.ts": 188, "src/relay/pty-handler-attach-replay.test.ts": 414, "src/relay/pty-handler-dispose-lifecycle.test.ts": 481, "src/relay/pty-handler-grace-timer.test.ts": 346, @@ -4830,14 +4830,14 @@ "src/relay/pty-source-credit-scheduler.test.ts": 106, "src/relay/pty-source-sent-boundaries.test.ts": 181, "src/relay/relay-bundled-ripgrep.test.ts": 151, - "src/relay/relay-command-env.test.ts": 96, + "src/wsl-guest/relay-command-env.test.ts": 96, "src/relay/relay-daemon-fatal-reap.test.ts": 1107, "src/relay/relay-diagnostic-log.test.ts": 62, "src/relay/relay-endpoint-credential-publication.test.ts": 2995, "src/relay/relay-filesystem-watch-registry.test.ts": 344, "src/relay/relay-grace-branch.test.ts": 52, "src/relay/relay-handshake-roundtrip.test.ts": 495, - "src/relay/relay-hot-path-operation-counts.test.ts": 211, + "src/wsl-guest/relay-hot-path-operation-counts.test.ts": 211, "src/relay/relay-launch-options.test.ts": 48, "src/relay/relay-oversized-notification-survival.test.ts": 335, "src/relay/relay-primary-channel.test.ts": 104, @@ -4882,9 +4882,9 @@ "src/relay/workspace-snapshot-publication.test.ts": 126, "src/relay/workspace-space-scan-du-capacity.test.ts": 110, "src/relay/workspace-space-scan.test.ts": 66, - "src/relay/wsl-agent-hook-relay.test.ts": 317, - "src/relay/wsl-hook-fs-bridge.test.ts": 39, - "src/relay/wsl-install-plugins-handler.test.ts": 161, + "src/wsl-guest/wsl-agent-hook-relay.test.ts": 317, + "src/wsl-guest/wsl-hook-fs-bridge.test.ts": 39, + "src/wsl-guest/wsl-install-plugins-handler.test.ts": 161, "src/renderer/src/app-shell/app-command-handlers-tab-rename.test.ts": 1093, "src/renderer/src/app-shell/app-command-handlers-workspace-delete.test.ts": 97, "src/renderer/src/app-shell/app-root-surface-settings.test.tsx": 721, diff --git a/config/scripts/node-server-qualification.mjs b/config/scripts/node-server-qualification.mjs index 2135da349b5..e9cc5f4bd39 100644 --- a/config/scripts/node-server-qualification.mjs +++ b/config/scripts/node-server-qualification.mjs @@ -17,7 +17,7 @@ const BUILD_PREFIXES = [ '.github/actions/prepare-orcad-prebuilds/' ] // A remote target's OS does not identify the client platform that builds its commands. -const CROSS_HOST_PREFIXES = ['src/main/ssh/', 'src/main/providers/', 'src/relay/'] +const CROSS_HOST_PREFIXES = ['src/main/ssh/', 'src/main/providers/', 'src/relay/', 'src/wsl-guest/'] const PLATFORM_PREFIXES = [ 'src/main/persistence/', 'src/main/sqlite/', diff --git a/config/scripts/pr-code-change-scope.mjs b/config/scripts/pr-code-change-scope.mjs index 938e50f6efe..8ef49bdfbd6 100644 --- a/config/scripts/pr-code-change-scope.mjs +++ b/config/scripts/pr-code-change-scope.mjs @@ -250,6 +250,7 @@ const MANAGED_HOOK_PREFIXES = [ 'src/packages/process-host/', 'config/scripts/build-relay', 'src/relay/', + 'src/wsl-guest/', 'src/shared/agent-hook', 'src/main/agent-hooks/' ] diff --git a/config/scripts/pr-e2e-gate-contract.test.mjs b/config/scripts/pr-e2e-gate-contract.test.mjs index 0173a07bc50..0655446c1e7 100644 --- a/config/scripts/pr-e2e-gate-contract.test.mjs +++ b/config/scripts/pr-e2e-gate-contract.test.mjs @@ -86,6 +86,7 @@ describe('PR E2E gate contract', () => { 'src/main/providers/ssh-', 'src/main/ipc/pty', 'src/relay/', + 'src/wsl-guest/', 'src/shared/ssh-', 'src/renderer/src/store/slices/direct-ssh-', 'src/renderer/src/components/terminal-pane/remote-runtime-' diff --git a/config/scripts/pr-e2e-source-routing.mjs b/config/scripts/pr-e2e-source-routing.mjs index cc48e955830..1db0497bb88 100644 --- a/config/scripts/pr-e2e-source-routing.mjs +++ b/config/scripts/pr-e2e-source-routing.mjs @@ -189,7 +189,7 @@ export const PR_E2E_SOURCE_ROUTES = [ specs: ['tests/e2e/ssh-localhost.spec.ts'], matches: (file) => isProductSource(file) && - /^src\/(?:relay\/(?:agent-hook|relay-agent-hook-runtime|plugin-overlay)|main\/(?:agent-hooks\/|ssh\/ssh-relay-session\.ts$)|shared\/agent-hook)/.test( + /^src\/(?:relay\/(?:agent-hook|relay-agent-hook-runtime|plugin-overlay)|wsl-guest\/(?:agent-hook|plugin-overlay)|main\/(?:agent-hooks\/|ssh\/ssh-relay-session\.ts$)|shared\/agent-hook)/.test( file ) }, @@ -256,7 +256,7 @@ export const PR_E2E_SOURCE_ROUTES = [ // admission that decide whether a pane rebinds live in the renderer store. matches: (file) => isProductSource(file) && - /^(?:src\/main\/ssh\/|src\/main\/providers\/ssh-|src\/main\/ipc\/(?:ssh-|pty)|src\/main\/runtime\/(?:public-ssh-state|ssh-file-explorer-chunk-read)\.ts|src\/relay\/|src\/shared\/(?:ssh-|skill-ssh-relay-contract)|src\/renderer\/src\/startup\/(?:ssh-startup-reconnect|startup-ssh-connection-restore)\.ts|src\/renderer\/src\/store\/slices\/(?:ssh|direct-ssh-)|src\/renderer\/src\/components\/terminal-pane\/(?:pty-|ssh-|remote-runtime-|terminal-parked-pty))/.test( + /^(?:src\/main\/ssh\/|src\/main\/providers\/ssh-|src\/main\/ipc\/(?:ssh-|pty)|src\/main\/runtime\/(?:public-ssh-state|ssh-file-explorer-chunk-read)\.ts|src\/relay\/|src\/wsl-guest\/|src\/shared\/(?:ssh-|skill-ssh-relay-contract)|src\/renderer\/src\/startup\/(?:ssh-startup-reconnect|startup-ssh-connection-restore)\.ts|src\/renderer\/src\/store\/slices\/(?:ssh|direct-ssh-)|src\/renderer\/src\/components\/terminal-pane\/(?:pty-|ssh-|remote-runtime-|terminal-parked-pty))/.test( file ) }, diff --git a/config/scripts/relay-json-payload-benchmark.ts b/config/scripts/relay-json-payload-benchmark.ts index 8c05fea0227..79ea8065e78 100644 --- a/config/scripts/relay-json-payload-benchmark.ts +++ b/config/scripts/relay-json-payload-benchmark.ts @@ -8,7 +8,7 @@ import { encodePreparedJsonRpcFrame, prepareJsonRpcPayload, type JsonRpcNotification -} from '../../src/relay/protocol' +} from '../../src/wsl-guest/protocol' type BenchmarkCase = { name: string diff --git a/config/scripts/relay-watcher-fault-harness.mjs b/config/scripts/relay-watcher-fault-harness.mjs index 784abfc4850..1f1f4510afd 100644 --- a/config/scripts/relay-watcher-fault-harness.mjs +++ b/config/scripts/relay-watcher-fault-harness.mjs @@ -65,7 +65,7 @@ function waitForExit(proc) { async function loadProtocol(bundleDir) { const outfile = join(bundleDir, 'relay-protocol.cjs') await build({ - entryPoints: [resolve('src/relay/protocol.ts')], + entryPoints: [resolve('src/wsl-guest/protocol.ts')], bundle: true, platform: 'node', format: 'cjs', diff --git a/config/scripts/ssh-localhost-e2e-routing.test.mjs b/config/scripts/ssh-localhost-e2e-routing.test.mjs index 48335cd969f..be149f95476 100644 --- a/config/scripts/ssh-localhost-e2e-routing.test.mjs +++ b/config/scripts/ssh-localhost-e2e-routing.test.mjs @@ -38,8 +38,8 @@ it('selects the localhost journey for its remote hook authorities', () => { const spec = 'tests/e2e/ssh-localhost.spec.ts' for (const file of [ 'src/relay/relay-agent-hook-runtime.ts', - 'src/relay/agent-hook-server.ts', - 'src/relay/plugin-overlay.ts', + 'src/wsl-guest/agent-hook-server.ts', + 'src/wsl-guest/plugin-overlay.ts', 'src/main/agent-hooks/server.ts', 'src/main/ssh/ssh-relay-session.ts', 'src/shared/agent-hook-relay.ts' diff --git a/config/scripts/ssh-relay-import-boundary.test.mjs b/config/scripts/ssh-relay-import-boundary.test.mjs new file mode 100644 index 00000000000..ad5570ce2f3 --- /dev/null +++ b/config/scripts/ssh-relay-import-boundary.test.mjs @@ -0,0 +1,72 @@ +import { globSync, readFileSync } from 'node:fs' +import path from 'node:path' +import { expect, it } from 'vitest' +import { collectModuleSpecifiers } from './static-module-specifiers.mjs' +import { isTestOnlySourcePath } from './test-only-source-path.mjs' + +const ROOT = path.resolve(import.meta.dirname, '..', '..') +const RELAY_SOURCE = 'src/relay' + +// Why: the SSH relay is being retired; only its own tests may reach into it, and this list only shrinks. +const RELAY_TEST_IMPORTERS = [ + 'src/main/ai-vault-search/session-search-scope-entry-points.test.ts', + 'src/main/ai-vault/antigravity-index-file-admission.test.ts', + 'src/main/ai-vault/remote-session-large-transcripts.test.ts', + 'src/main/git/git-network-safety-real-git.test.ts', + 'src/main/git/source-control/blob-absence-real-git.test.ts', + 'src/main/git/source-control/bulk-pathspec-stdin.test.ts', + 'src/main/git/source-control/staging-discard-index-safety.test.ts', + 'src/main/git/status-branch-compare-real-ref.test.ts', + 'src/main/git/status-branch-line-total-relay-parity.test.ts', + 'src/main/git/status-conflict-overlap.bench.test.ts', + 'src/main/git/worktree-rebase-update-refs-real-git.test.ts', + 'src/main/git/worktree-safety-real-git.test.ts', + 'src/main/ipc/filesystem-quick-open-options.integration.test.ts', + 'src/main/ipc/worktree-push-target-cleanup.test.ts', + 'src/main/ipc/worktree-push-target-reconciliation.test.ts', + 'src/main/ipc/worktrees-ssh-fork-push-target-remote.test.ts', + 'src/main/plugins/plugin-host-conformance.test.ts', + 'src/main/providers/ssh-directory-listing-options.test.ts', + 'src/main/providers/ssh-review-draft-context.test.ts', + 'src/main/providers/terminal-path-existence-batch.integration.test.ts', + 'src/main/runtime/runtime-file-path-existence.test.ts', + 'src/main/runtime/runtime-repository-ref-queries.test.ts', + 'src/main/runtime/tui-idle-name-only-real-pty.integration.test.ts', + 'src/main/shell-wrapper-generated-file-snapshot.test.ts', + 'src/main/ssh/ssh-remote-cli-host-passthrough.test.ts', + 'src/main/zsh-scoped-histfile.live-shell.test.ts', + 'src/main/zsh-wrapper-version-mismatch.live-shell.test.ts', + 'tests/tools/omp-relay-close-lifecycle.test.mjs' +] + +function importsRelay(file, contents) { + // Why: parsing every source file overruns the test timeout on a loaded runner. + if (!contents.includes('relay')) { + return false + } + return collectModuleSpecifiers(file, contents).some((specifier) => { + if (!specifier.startsWith('.')) { + return false + } + const target = path.posix.normalize(path.posix.join(path.posix.dirname(file), specifier)) + return target === RELAY_SOURCE || target.startsWith(`${RELAY_SOURCE}/`) + }) +} + +it('keeps everything outside the SSH relay from importing it', () => { + const importers = globSync( + ['src', 'config', 'tests', 'mobile/src', 'mobile/app', 'mobile/scripts'].map( + (directory) => `${directory}/**/*.{ts,tsx,mts,cts,js,mjs,cjs}` + ), + { + cwd: ROOT, + exclude: [`${RELAY_SOURCE}/**`, '**/node_modules/**', '**/dist/**', '**/out/**'] + } + ) + .map((file) => file.replaceAll('\\', '/')) + .filter((file) => importsRelay(file, readFileSync(path.join(ROOT, file), 'utf8'))) + .sort() + + expect(importers.filter((file) => !isTestOnlySourcePath(file))).toEqual([]) + expect(importers).toEqual(RELAY_TEST_IMPORTERS) +}) diff --git a/config/tsconfig.node.json b/config/tsconfig.node.json index bcdf260737a..1898e9d86a5 100644 --- a/config/tsconfig.node.json +++ b/config/tsconfig.node.json @@ -21,6 +21,7 @@ "../src/shared/**/*", "../src/packages/process-host/src/__fixtures__/**/*", "../src/relay/**/*", + "../src/wsl-guest/**/*", "../src/types/**/*" ], "compilerOptions": { diff --git a/config/tsconfig.relay.json b/config/tsconfig.relay.json index 242069f761c..7951c1ada46 100644 --- a/config/tsconfig.relay.json +++ b/config/tsconfig.relay.json @@ -2,6 +2,7 @@ "extends": "@electron-toolkit/tsconfig/tsconfig.node.json", "include": [ "../src/relay/**/*", + "../src/wsl-guest/**/*", "../src/main/pty/overlay-mirror.ts", "../src/main/pty/shell-startup-env.ts" ], diff --git a/docs/audits/ssh-file-metadata-retention/relay-fixture.mjs b/docs/audits/ssh-file-metadata-retention/relay-fixture.mjs index 2c545e5df89..22ea610a592 100644 --- a/docs/audits/ssh-file-metadata-retention/relay-fixture.mjs +++ b/docs/audits/ssh-file-metadata-retention/relay-fixture.mjs @@ -6,7 +6,7 @@ import { createHash, randomBytes } from 'node:crypto' import { writeFileSync, readFileSync } from 'node:fs' import { SshChannelMultiplexer } from '../../../src/main/ssh/ssh-channel-multiplexer' import { readFileViaStream } from '../../../src/main/ssh/ssh-filesystem-stream-reader' -import { RelayDispatcher } from '../../../src/relay/dispatcher' +import { RelayDispatcher } from '../../../src/wsl-guest/dispatcher' import { RelayStreamRegistry } from '../../../src/relay/fs-stream-registry' import { readRelayFileStreamMetadata } from '../../../src/relay/fs-handler-file-read' diff --git a/docs/audits/ssh-file-metadata-retention/scenario.test.mjs b/docs/audits/ssh-file-metadata-retention/scenario.test.mjs index 5e5c9455200..8af488e48e4 100644 --- a/docs/audits/ssh-file-metadata-retention/scenario.test.mjs +++ b/docs/audits/ssh-file-metadata-retention/scenario.test.mjs @@ -9,7 +9,7 @@ import { STREAM_ACK_WINDOW_CHUNKS, STREAM_CHUNK_SIZE, RelayErrorCode -} from '../../../src/relay/protocol' +} from '../../../src/wsl-guest/protocol' import { candidate, report, diff --git a/src/main/agent-hooks/manual-compact-hook-stream.test.ts b/src/main/agent-hooks/manual-compact-hook-stream.test.ts index 8e1e1a47df8..2d31b2ce252 100644 --- a/src/main/agent-hooks/manual-compact-hook-stream.test.ts +++ b/src/main/agent-hooks/manual-compact-hook-stream.test.ts @@ -3,7 +3,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import { RelayAgentHookServer } from '../../relay/agent-hook-server' +import { RelayAgentHookServer } from '../../wsl-guest/agent-hook-server' import { seedLegacyAgentStatusForTests } from '../../shared/agent-hook-listener/listener-state' import { seedClaudeSubagentRosterFromSnapshots } from '../../shared/agent-hook-listener/providers/claude-roster-state' import type { AgentHookEventPayload } from '../../shared/agent-hook-listener/listener-event' diff --git a/src/main/agent-hooks/opencode-plugin-settings.ts b/src/main/agent-hooks/opencode-plugin-settings.ts index e05f488c6a1..bb22a481fa2 100644 --- a/src/main/agent-hooks/opencode-plugin-settings.ts +++ b/src/main/agent-hooks/opencode-plugin-settings.ts @@ -1,4 +1,4 @@ -import type { PluginSources } from '../../relay/plugin-overlay' +import type { PluginSources } from '../../wsl-guest/plugin-overlay' import { isAgentStatusHooksEnabledForAgent } from '../../shared/agent-status-hooks-setting' import type { ManagedHookDetectionSettings } from './managed-hook-detection-commands' diff --git a/src/main/agent-hooks/server-claude-task-wakeup-lifecycle.test.ts b/src/main/agent-hooks/server-claude-task-wakeup-lifecycle.test.ts index 1ef842aa0d9..76bc5450a4e 100644 --- a/src/main/agent-hooks/server-claude-task-wakeup-lifecycle.test.ts +++ b/src/main/agent-hooks/server-claude-task-wakeup-lifecycle.test.ts @@ -2,7 +2,7 @@ import { readFileSync, mkdtempSync, rmSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { RelayAgentHookServer } from '../../relay/agent-hook-server' +import { RelayAgentHookServer } from '../../wsl-guest/agent-hook-server' import { AgentHookServer, _internals } from './server' import { createRuntimeAutomationRunTerminalObserver } from '../automations/runtime-terminal-run-observer' import { diff --git a/src/main/agent-hooks/server-relayed-claude-cancel.test.ts b/src/main/agent-hooks/server-relayed-claude-cancel.test.ts index 6a30fa4b0f0..7c35e6d5981 100644 --- a/src/main/agent-hooks/server-relayed-claude-cancel.test.ts +++ b/src/main/agent-hooks/server-relayed-claude-cancel.test.ts @@ -6,7 +6,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 { RelayAgentHookServer } from '../../relay/agent-hook-server' +import { RelayAgentHookServer } from '../../wsl-guest/agent-hook-server' import { AgentHookServer, _internals } from './server' import { buildBody, PANE } from './server.test-fixtures' import { hookAt, loadCapture, type CapturedHook } from './claude-cancel-capture.test-fixture' diff --git a/src/main/agent-hooks/server-tmux-wire.test.ts b/src/main/agent-hooks/server-tmux-wire.test.ts index 5037d173adc..7b9ac0d0cf7 100644 --- a/src/main/agent-hooks/server-tmux-wire.test.ts +++ b/src/main/agent-hooks/server-tmux-wire.test.ts @@ -1,7 +1,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { AgentHookServer, _internals } from './server' import { PANE } from './server.test-fixtures' -import { buildRelayHookEnvelope } from '../../relay/agent-hook-envelope-build' +import { buildRelayHookEnvelope } from '../../wsl-guest/agent-hook-envelope-build' vi.mock('../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({}) })) diff --git a/src/main/agent-hooks/wsl-guest-plugin-install.ts b/src/main/agent-hooks/wsl-guest-plugin-install.ts index 40bf43ce024..9a0264e8ba4 100644 --- a/src/main/agent-hooks/wsl-guest-plugin-install.ts +++ b/src/main/agent-hooks/wsl-guest-plugin-install.ts @@ -6,7 +6,7 @@ import type { SshChannelMultiplexer } from '../ssh/ssh-channel-multiplexer' import { AGENT_HOOK_INSTALL_PLUGINS_METHOD } from '../../shared/agent-hook-relay' import { selectOpenCodePluginSources } from './opencode-plugin-settings' import type { ManagedHookDetectionSettings } from './managed-hook-detection-commands' -import type { PluginSources } from '../../relay/plugin-overlay' +import type { PluginSources } from '../../wsl-guest/plugin-overlay' /** Structural, not the deps type itself, so this stays free of the deps module. */ type GuestPluginInstallDeps = { diff --git a/src/main/agent-hooks/wsl-hook-relay-deps.ts b/src/main/agent-hooks/wsl-hook-relay-deps.ts index 0955acda34b..4c4532a9658 100644 --- a/src/main/agent-hooks/wsl-hook-relay-deps.ts +++ b/src/main/agent-hooks/wsl-hook-relay-deps.ts @@ -14,7 +14,7 @@ import { getOpenCode2PluginSource, getOpenCodePluginSource } from '../opencode/h import { getPiAgentStatusExtensionSource } from '../pi/agent-status-extension-source' import { codexHookService } from '../codex/hook-service' import type { AgentHookInstallStatus } from '../../shared/agent-hook-types' -import type { PluginSources } from '../../relay/plugin-overlay' +import type { PluginSources } from '../../wsl-guest/plugin-overlay' import { isWslDistroRunning, resolveWslHookRelayBundle, diff --git a/src/main/agent-hooks/wsl-hook-relay-guest-install.ts b/src/main/agent-hooks/wsl-hook-relay-guest-install.ts index 87e29f2d414..d891fb0427e 100644 --- a/src/main/agent-hooks/wsl-hook-relay-guest-install.ts +++ b/src/main/agent-hooks/wsl-hook-relay-guest-install.ts @@ -9,7 +9,7 @@ import { installWslGuestHooks } from './wsl-hook-fs-adapter' import { REINSTALL_MIN_INTERVAL_MS, type WslHookRelayManagerDeps } from './wsl-hook-relay-deps' import type { SshChannelMultiplexer } from '../ssh/ssh-channel-multiplexer' import { openCodePluginSettingsKey } from './opencode-plugin-settings' -import type { PluginSources } from '../../relay/plugin-overlay' +import type { PluginSources } from '../../wsl-guest/plugin-overlay' /** Structural slice of WslHookRelayManagerDeps — only what an install pass uses. */ type GuestInstallDeps = { diff --git a/src/main/agent-hooks/wsl-hook-relay-manager.test.ts b/src/main/agent-hooks/wsl-hook-relay-manager.test.ts index c4707af0f5a..fc49109c553 100644 --- a/src/main/agent-hooks/wsl-hook-relay-manager.test.ts +++ b/src/main/agent-hooks/wsl-hook-relay-manager.test.ts @@ -7,8 +7,8 @@ import { join } from 'node:path' import type { ChildProcessWithoutNullStreams } from 'node:child_process' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { RelayDispatcher } from '../../relay/dispatcher' -import { registerWslHookFsHandlers } from '../../relay/wsl-hook-fs-bridge' +import { RelayDispatcher } from '../../wsl-guest/dispatcher' +import { registerWslHookFsHandlers } from '../../wsl-guest/wsl-hook-fs-bridge' import { SshChannelMultiplexer, type MultiplexerTransport } from '../ssh/ssh-channel-multiplexer' import { createWslHookSftpAdapter } from './wsl-hook-fs-adapter' import { diff --git a/src/main/agent-hooks/wsl-opencode-install-race.test.ts b/src/main/agent-hooks/wsl-opencode-install-race.test.ts index ccb8e79a445..240feeac6c6 100644 --- a/src/main/agent-hooks/wsl-opencode-install-race.test.ts +++ b/src/main/agent-hooks/wsl-opencode-install-race.test.ts @@ -3,9 +3,9 @@ import { mkdirSync, mkdtempSync, readFileSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import type { TuiAgent } from '../../shared/tui-agent' -import { RelayDispatcher } from '../../relay/dispatcher' -import { PluginOverlayManager } from '../../relay/plugin-overlay' -import { createInstallPluginsHandler } from '../../relay/wsl-install-plugins-handler' +import { RelayDispatcher } from '../../wsl-guest/dispatcher' +import { PluginOverlayManager } from '../../wsl-guest/plugin-overlay' +import { createInstallPluginsHandler } from '../../wsl-guest/wsl-install-plugins-handler' import { SshChannelMultiplexer } from '../ssh/ssh-channel-multiplexer' import { AGENT_HOOK_INSTALL_PLUGINS_METHOD } from '../../shared/agent-hook-relay' import { diff --git a/src/main/agent-hooks/wsl-opencode-settings-lifetime.test.ts b/src/main/agent-hooks/wsl-opencode-settings-lifetime.test.ts index 29cf139ace5..2c04fd5b153 100644 --- a/src/main/agent-hooks/wsl-opencode-settings-lifetime.test.ts +++ b/src/main/agent-hooks/wsl-opencode-settings-lifetime.test.ts @@ -4,9 +4,9 @@ import type { ChildProcessWithoutNullStreams } from 'node:child_process' import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { RelayDispatcher } from '../../relay/dispatcher' -import { PluginOverlayManager } from '../../relay/plugin-overlay' -import { createInstallPluginsHandler } from '../../relay/wsl-install-plugins-handler' +import { RelayDispatcher } from '../../wsl-guest/dispatcher' +import { PluginOverlayManager } from '../../wsl-guest/plugin-overlay' +import { createInstallPluginsHandler } from '../../wsl-guest/wsl-install-plugins-handler' import { WslHookRelayManager } from './wsl-hook-relay-manager' import { REINSTALL_MIN_INTERVAL_MS } from './wsl-hook-relay-deps' import type { MultiplexerTransport } from '../ssh/ssh-channel-multiplexer' diff --git a/src/main/agent-hooks/wsl-opencode-settings.test.ts b/src/main/agent-hooks/wsl-opencode-settings.test.ts index 0e868635ea2..c2a260c6d1f 100644 --- a/src/main/agent-hooks/wsl-opencode-settings.test.ts +++ b/src/main/agent-hooks/wsl-opencode-settings.test.ts @@ -3,9 +3,9 @@ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync import { tmpdir } from 'node:os' import { join } from 'node:path' import type { TuiAgent } from '../../shared/tui-agent' -import { RelayDispatcher } from '../../relay/dispatcher' -import { PluginOverlayManager } from '../../relay/plugin-overlay' -import { createInstallPluginsHandler } from '../../relay/wsl-install-plugins-handler' +import { RelayDispatcher } from '../../wsl-guest/dispatcher' +import { PluginOverlayManager } from '../../wsl-guest/plugin-overlay' +import { createInstallPluginsHandler } from '../../wsl-guest/wsl-install-plugins-handler' import { SshChannelMultiplexer } from '../ssh/ssh-channel-multiplexer' import { AGENT_HOOK_INSTALL_PLUGINS_METHOD } from '../../shared/agent-hook-relay' import { requestGuestOpenCodeOverlayDir } from './wsl-guest-plugin-install' diff --git a/src/main/ai-vault-search/session-search-scope-entry-points.test.ts b/src/main/ai-vault-search/session-search-scope-entry-points.test.ts index 3b470e75138..e921445ef5c 100644 --- a/src/main/ai-vault-search/session-search-scope-entry-points.test.ts +++ b/src/main/ai-vault-search/session-search-scope-entry-points.test.ts @@ -1,7 +1,7 @@ import '../runtime/rpc/unused-default-rpc-methods.test-fixture' import { afterEach, describe, expect, it } from 'vitest' import { AiVaultHandler } from '../../relay/ai-vault-handler' -import type { RelayDispatcher } from '../../relay/dispatcher' +import type { RelayDispatcher } from '../../wsl-guest/dispatcher' import { createSessionSearchClient } from '../../shared/ai-vault-search-client' import { fakeSearchService } from '../../shared/ai-vault-search-test-fixture' import { AI_VAULT_AGENTS } from '../../shared/ai-vault-types' diff --git a/src/main/ipc/worktrees/removal/worktree-archive-hook.ts b/src/main/ipc/worktrees/removal/worktree-archive-hook.ts index 4df6bedd49f..27227ce15fb 100644 --- a/src/main/ipc/worktrees/removal/worktree-archive-hook.ts +++ b/src/main/ipc/worktrees/removal/worktree-archive-hook.ts @@ -17,7 +17,7 @@ import { * * A failed read is answered as "no hook", which is a known limitation rather than a judgement: a * missing `orca.yaml` is indistinguishable from an unreachable one here, because the relay rewrites - * a non-numeric error code to `-32000` (`src/relay/dispatcher-rpc-routing.ts`), so nothing survives + * a non-numeric error code to `-32000` (`src/wsl-guest/dispatcher-rpc-routing.ts`), so nothing survives * to tell ENOENT from a transport failure. Reporting it as unreadable fired on every SSH repo that * simply has no orca.yaml; blocking on it would refuse those deletes outright. Distinguishing the * two needs a provider contract that reports absence as a successful outcome — tracked in #20196. @@ -52,7 +52,7 @@ export async function getArchiveHooksForRemoval( return getEffectiveHooksFromConfig(repo, yamlHooks) } catch (error) { // Indistinguishable from "there is no orca.yaml": the relay rewrites a non-numeric error code - // to -32000 (src/relay/dispatcher-rpc-routing.ts), so nothing survives to tell ENOENT from a + // to -32000 (src/wsl-guest/dispatcher-rpc-routing.ts), so nothing survives to tell ENOENT from a // transport failure. Logged so an operator can see it; not surfaced, because reporting it as // unreadable fired on every SSH repo that simply has none. Distinguishing them needs a provider // contract that returns absence as a successful outcome — #20196. diff --git a/src/main/plugins/plugin-host-conformance.test.ts b/src/main/plugins/plugin-host-conformance.test.ts index bc43dd741de..43ec5c2f227 100644 --- a/src/main/plugins/plugin-host-conformance.test.ts +++ b/src/main/plugins/plugin-host-conformance.test.ts @@ -6,7 +6,7 @@ import { createPluginPanelCallAdmission } from '../../shared/plugins/plugin-panel-call-admission' import type { PluginPanelActionOutcome } from '../../shared/plugins/plugin-panel-bridge' -import type { MethodHandler } from '../../relay/dispatcher' +import type { MethodHandler } from '../../wsl-guest/dispatcher' import { RELAY_PLUGIN_PANEL_HOST_CALL_METHOD, RELAY_PLUGIN_WORKER_HOST_CALL_METHOD, diff --git a/src/main/providers/ssh-review-draft-context.test.ts b/src/main/providers/ssh-review-draft-context.test.ts index 9fb0d7359a1..de542c5c982 100644 --- a/src/main/providers/ssh-review-draft-context.test.ts +++ b/src/main/providers/ssh-review-draft-context.test.ts @@ -4,7 +4,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import { runProcess } from '@orca/process-host' import { ReviewDraftContextError } from '../../shared/review-draft-context-error' import { RelayContext } from '../../relay/context' -import { RelayDispatcher } from '../../relay/dispatcher' +import { RelayDispatcher } from '../../wsl-guest/dispatcher' import { GitHandler } from '../../relay/git-handler' import { createGitTempDir, removeGitTempDir } from '../../relay/git-handler-test-harness' import { gitCommit, gitInit } from '../../relay/git-handler-test-setup' @@ -13,7 +13,7 @@ import { FrameDecoder, MessageType, parseJsonRpcMessage -} from '../../relay/protocol' +} from '../../wsl-guest/protocol' import type { SshChannelMultiplexer } from '../ssh/ssh-channel-multiplexer' import { getPullRequestDraftContext } from '../text-generation/pull-request-context' import { SshGitProvider } from './ssh-git-provider' diff --git a/src/main/ssh/ssh-relay-session-agent-hooks.integration.test.ts b/src/main/ssh/ssh-relay-session-agent-hooks.integration.test.ts index 19dac11ffd1..77b39183f64 100644 --- a/src/main/ssh/ssh-relay-session-agent-hooks.integration.test.ts +++ b/src/main/ssh/ssh-relay-session-agent-hooks.integration.test.ts @@ -5,7 +5,7 @@ import type { SshPortForwardManager } from './ssh-port-forward' import type { SshConnection } from './ssh-connection' import type { MultiplexerTransport } from './ssh-channel-multiplexer' import type { AgentHookRelayEnvelope } from '../../shared/agent-hook-relay' -import { RelayDispatcher } from '../../relay/dispatcher' +import { RelayDispatcher } from '../../wsl-guest/dispatcher' import { AGENT_HOOK_NOTIFICATION_METHOD, AGENT_HOOK_REQUEST_REPLAY_METHOD, diff --git a/src/relay/agent-exec-disposal.test.ts b/src/relay/agent-exec-disposal.test.ts index 9d250e108a3..46a6ff2fca1 100644 --- a/src/relay/agent-exec-disposal.test.ts +++ b/src/relay/agent-exec-disposal.test.ts @@ -7,7 +7,7 @@ import { RelayAgentProcessLifetime } from './relay-agent-process-lifetime' import { createFakeChild, requestContext } from './agent-exec-handler-test-harness' -import type { MethodHandler, RelayDispatcher } from './dispatcher' +import type { MethodHandler, RelayDispatcher } from '../wsl-guest/dispatcher' // Why an untyped mock: the fake child stubs only what AgentExecHandler reads from a ChildProcess. const { spawnMock, loginShellMock } = vi.hoisted(() => ({ @@ -124,8 +124,10 @@ it('kills a child tracked after the fence instead of throwing', async () => { const lifetime = new RelayAgentProcessLifetime() void lifetime.dispose() const child = createFakeChild() - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: track reads only pid, kill and the close/error events the fake emits. - expect(() => lifetime.track(child as unknown as Parameters[0])).not.toThrow() + expect(() => + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: track reads only pid, kill and the close/error events the fake emits. + lifetime.track(child as unknown as Parameters[0]) + ).not.toThrow() if (process.platform !== 'win32') { expect(child.kill).toHaveBeenCalledWith('SIGKILL') } diff --git a/src/relay/agent-exec-handler-test-harness.ts b/src/relay/agent-exec-handler-test-harness.ts index 317a6bd6652..1ee67a33015 100644 --- a/src/relay/agent-exec-handler-test-harness.ts +++ b/src/relay/agent-exec-handler-test-harness.ts @@ -1,6 +1,6 @@ import { EventEmitter } from 'node:events' import { vi } from 'vitest' -import type { MethodHandler, RequestContext } from './dispatcher' +import type { MethodHandler, RequestContext } from '../wsl-guest/dispatcher' import { AgentExecHandler } from './agent-exec-handler' export function withPlatform(platform: NodeJS.Platform, fn: () => T): T { diff --git a/src/relay/agent-exec-handler.ts b/src/relay/agent-exec-handler.ts index d54c2098be1..009a2cd6ddd 100644 --- a/src/relay/agent-exec-handler.ts +++ b/src/relay/agent-exec-handler.ts @@ -3,7 +3,7 @@ import { PromiseSettlementWaiters } from '../shared/promise-settlement-waiters' import { spawn, type ChildProcess } from 'node:child_process' import { existsSync } from 'node:fs' import { delimiter, join } from 'node:path' -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import { applyTerminalGitCredentialPromptGuard } from '../shared/terminal-git-credential-guard' import { mergeGitConfigEnvProtocol } from '../shared/git-credential-prompt-env' import { terminateRelaySubprocessTree } from './subprocess-tree-termination' diff --git a/src/relay/agent-hook-retired-pane-suppression.test.ts b/src/relay/agent-hook-retired-pane-suppression.test.ts index c31825cdee7..f7e00d3281a 100644 --- a/src/relay/agent-hook-retired-pane-suppression.test.ts +++ b/src/relay/agent-hook-retired-pane-suppression.test.ts @@ -2,13 +2,13 @@ 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 { RelayAgentHookServer } from './agent-hook-server' +import { RelayAgentHookServer } from '../wsl-guest/agent-hook-server' import { RelayAgentHookRuntime } from './relay-agent-hook-runtime' import { RetiredPaneSurfaceRegistry } from './retired-pane-surfaces' import type { AgentHookRelayEnvelope } from '../shared/agent-hook-relay' import { makePaneKey } from '../shared/stable-pane-id' import type { PtyHandler, PtySurfaceRetiredListener } from './pty-handler' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import type { ClaudeTerminalEvidence } from '../shared/claude-terminal-interrupt' const LEAF_ID = '11111111-1111-4111-8111-111111111111' diff --git a/src/relay/ai-vault-handler.test.ts b/src/relay/ai-vault-handler.test.ts index 3951b58ea5f..6e62369c45d 100644 --- a/src/relay/ai-vault-handler.test.ts +++ b/src/relay/ai-vault-handler.test.ts @@ -11,7 +11,7 @@ import { getRemoteHostPlatform } from '../main/ssh/ssh-remote-platform' import type { RemoteHostPlatform } from '../main/ssh/ssh-remote-platform' import { scanRemoteAiVaultSessions } from '../main/ai-vault/remote-session-scanner' import { readAiVaultSessionTitlesFromFiles } from '../main/ai-vault/session-title-file-reader' -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import { AiVaultHandler } from './ai-vault-handler' import { createRelayAiVaultFilesystemProvider } from './ai-vault-service-filesystem' import type { RelayAiVaultServiceApi } from './ai-vault-service-client-state' diff --git a/src/relay/ai-vault-handler.ts b/src/relay/ai-vault-handler.ts index 428253349bf..07271f4b268 100644 --- a/src/relay/ai-vault-handler.ts +++ b/src/relay/ai-vault-handler.ts @@ -20,7 +20,7 @@ import { import { getRemoteHostPlatform, type RemoteHostPlatform } from '../main/ssh/ssh-remote-platform' import { parseUnameToRelayPlatform } from '../main/ssh/relay-protocol' import { relayLogLine } from './relay-diagnostic-log' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { AiVaultScanCoordinator } from '../main/ai-vault/ai-vault-scan-coordinator' import type { RelayAiVaultServiceApi } from './ai-vault-service-client-state' diff --git a/src/relay/external-automations-handler.test.ts b/src/relay/external-automations-handler.test.ts index 66209b3e121..887d902cc9a 100644 --- a/src/relay/external-automations-handler.test.ts +++ b/src/relay/external-automations-handler.test.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { ExternalAutomationCommandExecutor } from './external-automation-command-executor' import { ExternalAutomationsHandler } from './external-automations-handler' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' const execFileMock = vi.hoisted(() => vi.fn((...args: unknown[]) => { diff --git a/src/relay/external-automations-handler.ts b/src/relay/external-automations-handler.ts index 6c5d8af98ae..c9805376d95 100644 --- a/src/relay/external-automations-handler.ts +++ b/src/relay/external-automations-handler.ts @@ -1,6 +1,6 @@ import { execFile } from 'node:child_process' import { promisify } from 'node:util' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { ExternalAutomationCommandExecutor, type ExternalAutomationCommandRunner diff --git a/src/relay/fs-file-stream-shutdown.test.ts b/src/relay/fs-file-stream-shutdown.test.ts index c26fb73b2c4..21c839bf828 100644 --- a/src/relay/fs-file-stream-shutdown.test.ts +++ b/src/relay/fs-file-stream-shutdown.test.ts @@ -2,10 +2,10 @@ import { afterEach, beforeEach, expect, it, vi } from 'vitest' import { mkdtemp, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import { readRelayFileStreamMetadata } from './fs-handler-file-read' import { RelayStreamRegistry } from './fs-stream-registry' -import { STREAM_CHUNK_SIZE } from './protocol' +import { STREAM_CHUNK_SIZE } from '../wsl-guest/protocol' let directory: string let filePath: string diff --git a/src/relay/fs-handler-file-range-dispatch.test.ts b/src/relay/fs-handler-file-range-dispatch.test.ts index 5599ef37ad3..3e0ad07ccac 100644 --- a/src/relay/fs-handler-file-range-dispatch.test.ts +++ b/src/relay/fs-handler-file-range-dispatch.test.ts @@ -4,8 +4,8 @@ import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { FsHandler } from './fs-handler' import { RelayContext } from './context' -import { RelayDispatcher } from './dispatcher' -import { encodeJsonRpcFrame, RelayErrorCode } from './protocol' +import { RelayDispatcher } from '../wsl-guest/dispatcher' +import { encodeJsonRpcFrame, RelayErrorCode } from '../wsl-guest/protocol' import { FileRangeReadRequestError, MAX_FILE_RANGE_READ_BYTES } from '../shared/file-range-read' /** Minimal dispatcher: this suite only needs the registered request handlers. diff --git a/src/relay/fs-handler-file-range.test.ts b/src/relay/fs-handler-file-range.test.ts index 0d601b9b9fe..1d1d55f38b9 100644 --- a/src/relay/fs-handler-file-range.test.ts +++ b/src/relay/fs-handler-file-range.test.ts @@ -9,8 +9,8 @@ import { MAX_FILE_RANGE_READ_BYTES, validateFileRangeRequest } from '../shared/file-range-read' -import { HEADER_LENGTH, prepareJsonRpcPayload } from './protocol' -import { DISPATCHER_CONTROL_QUEUE_MAX_BYTES } from './dispatcher-writer-admission' +import { HEADER_LENGTH, prepareJsonRpcPayload } from '../wsl-guest/protocol' +import { DISPATCHER_CONTROL_QUEUE_MAX_BYTES } from '../wsl-guest/dispatcher-writer-admission' let roots: string[] = [] diff --git a/src/relay/fs-handler-file-read.ts b/src/relay/fs-handler-file-read.ts index e0f7fa590a9..ed666328b16 100644 --- a/src/relay/fs-handler-file-read.ts +++ b/src/relay/fs-handler-file-read.ts @@ -1,8 +1,8 @@ import { open, readFile, stat } from 'node:fs/promises' import type { FileHandle } from 'node:fs/promises' import { extname } from 'node:path' -import type { RelayDispatcher, RequestContext } from './dispatcher' -import { STREAM_ACK_WINDOW_CHUNKS, STREAM_CHUNK_SIZE } from './protocol' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' +import { STREAM_ACK_WINDOW_CHUNKS, STREAM_CHUNK_SIZE } from '../wsl-guest/protocol' import type { RelayStreamRegistry } from './fs-stream-registry' import { BINARY_PROBE_BYTES, isBinaryBuffer } from '../shared/binary-buffer' import { diff --git a/src/relay/fs-handler-git-fallback.ts b/src/relay/fs-handler-git-fallback.ts index fd76bda75ef..d666a059900 100644 --- a/src/relay/fs-handler-git-fallback.ts +++ b/src/relay/fs-handler-git-fallback.ts @@ -19,7 +19,7 @@ import { expandQuickOpenGitFileListing, parseQuickOpenGitLsFilesEntry } from '../shared/quick-open-readdir-walk' -import { buildRelayGitEnv } from './relay-command-env' +import { buildRelayGitEnv } from '../wsl-guest/relay-command-env' /** * List files using `git ls-files`. Fallback when rg is not installed. diff --git a/src/relay/fs-handler-git-search.ts b/src/relay/fs-handler-git-search.ts index 27703465b33..07d3d5284d0 100644 --- a/src/relay/fs-handler-git-search.ts +++ b/src/relay/fs-handler-git-search.ts @@ -18,7 +18,7 @@ import { absorbPendingRipgrepSpawnError, killSpawnedRipgrepProcess } from '../shared/ripgrep-process-availability' -import { buildRelayGitEnv } from './relay-command-env' +import { buildRelayGitEnv } from '../wsl-guest/relay-command-env' /** * Text search using `git grep`. Fallback when rg is not installed. diff --git a/src/relay/fs-handler-list-files-ignored.test.ts b/src/relay/fs-handler-list-files-ignored.test.ts index a7f06d62e93..6216fe61c88 100644 --- a/src/relay/fs-handler-list-files-ignored.test.ts +++ b/src/relay/fs-handler-list-files-ignored.test.ts @@ -17,7 +17,7 @@ import { listFilesWithGit } from './fs-handler-git-fallback' import { listFilesWithRg } from './fs-handler-list-files' import { searchWithRg } from './fs-handler-utils' import { RipgrepUnavailableError } from '../shared/ripgrep-process-availability' -import { buildRelayCommandEnv } from './relay-command-env' +import { buildRelayCommandEnv } from '../wsl-guest/relay-command-env' import { configureRelayBundledRipgrep } from './relay-bundled-ripgrep' import { ListFilesScanCoordinator, diff --git a/src/relay/fs-handler-list-files-result-limit.test.ts b/src/relay/fs-handler-list-files-result-limit.test.ts index becf607213f..44320c7aaa5 100644 --- a/src/relay/fs-handler-list-files-result-limit.test.ts +++ b/src/relay/fs-handler-list-files-result-limit.test.ts @@ -21,7 +21,7 @@ vi.mock('@parcel/watcher', () => ({ subscribe: vi.fn() })) import { FsHandler } from './fs-handler' import { RelayContext } from './context' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { QUICK_OPEN_LISTING_MAX_RESULTS } from '../shared/quick-open-listing-limits' type ListFilesHandler = ( diff --git a/src/relay/fs-handler-list-files.ts b/src/relay/fs-handler-list-files.ts index 394ed852187..cafa549a290 100644 --- a/src/relay/fs-handler-list-files.ts +++ b/src/relay/fs-handler-list-files.ts @@ -32,7 +32,7 @@ import { RipgrepUnavailableError } from '../shared/ripgrep-process-availability' import { QuickOpenPathRanker } from '../shared/quick-open-path-search' -import { buildRelayCommandEnv } from './relay-command-env' +import { buildRelayCommandEnv } from '../wsl-guest/relay-command-env' import { pathRipgrepCommand, resolveRelayRipgrepCommand, diff --git a/src/relay/fs-handler-ripgrep-fallback.test.ts b/src/relay/fs-handler-ripgrep-fallback.test.ts index a4d1a1fbaec..0487a237c4d 100644 --- a/src/relay/fs-handler-ripgrep-fallback.test.ts +++ b/src/relay/fs-handler-ripgrep-fallback.test.ts @@ -46,7 +46,7 @@ import { RipgrepUnavailableError } from '../shared/ripgrep-process-availability' import { RelayContext } from './context' import { FsHandler } from './fs-handler' import { runListFilesScan } from './fs-list-files-fallback-chain' -import { buildRelayCommandEnv } from './relay-command-env' +import { buildRelayCommandEnv } from '../wsl-guest/relay-command-env' type FsHandlerInternals = { search(params: Record): Promise diff --git a/src/relay/fs-handler-stream.test.ts b/src/relay/fs-handler-stream.test.ts index 9cbfd687376..480bb36485e 100644 --- a/src/relay/fs-handler-stream.test.ts +++ b/src/relay/fs-handler-stream.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest' import { FsHandler } from './fs-handler' import { RelayContext } from './context' -import type { RelayDispatcher } from './dispatcher' -import { MAX_CONCURRENT_STREAMS, STREAM_CHUNK_SIZE } from './protocol' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' +import { MAX_CONCURRENT_STREAMS, STREAM_CHUNK_SIZE } from '../wsl-guest/protocol' import * as fs from 'node:fs/promises' import * as path from 'node:path' import { mkdtempSync, writeFileSync } from 'node:fs' diff --git a/src/relay/fs-handler-utils.ts b/src/relay/fs-handler-utils.ts index a7d47f63862..3385160b56b 100644 --- a/src/relay/fs-handler-utils.ts +++ b/src/relay/fs-handler-utils.ts @@ -28,7 +28,7 @@ import { ripgrepMissingCwdError, RipgrepUnavailableError } from '../shared/ripgrep-process-availability' -import { buildRelayCommandEnv } from './relay-command-env' +import { buildRelayCommandEnv } from '../wsl-guest/relay-command-env' import { pathRipgrepCommand, resolveRelayRipgrepCommand, diff --git a/src/relay/fs-handler.test.ts b/src/relay/fs-handler.test.ts index 63963016c1b..d86173f4e01 100644 --- a/src/relay/fs-handler.test.ts +++ b/src/relay/fs-handler.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest' import { FsHandler } from './fs-handler' import { MAX_TEXT_FILE_SIZE } from './fs-handler-utils' import { RelayContext } from './context' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import * as fs from 'node:fs/promises' import * as path from 'node:path' import { mkdtempSync, writeFileSync, mkdirSync, symlinkSync } from 'node:fs' diff --git a/src/relay/fs-handler.ts b/src/relay/fs-handler.ts index bcef1a280d9..0e131646c08 100644 --- a/src/relay/fs-handler.ts +++ b/src/relay/fs-handler.ts @@ -6,7 +6,7 @@ import { quickOpenRecentCandidateSet } from '../shared/quick-open-recent-candida import { QUICK_OPEN_SEARCH_VERSION } from '../shared/quick-open-path-search' import { pathsExistOnRelay } from './fs-path-existence' import { tmpdir } from 'node:os' -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import type { RelayContext } from './context' // Why: RelayContext is accepted in the constructor for protocol back-compat // (see docs/relay-fs-allowlist-removal.md), but no longer consulted on FS ops. diff --git a/src/relay/fs-list-files-cancel.integration.test.ts b/src/relay/fs-list-files-cancel.integration.test.ts index f54ebaea369..30933e226fc 100644 --- a/src/relay/fs-list-files-cancel.integration.test.ts +++ b/src/relay/fs-list-files-cancel.integration.test.ts @@ -62,7 +62,7 @@ import { SshChannelMultiplexer, type MultiplexerTransport } from '../main/ssh/ssh-channel-multiplexer' -import { RelayDispatcher } from './dispatcher' +import { RelayDispatcher } from '../wsl-guest/dispatcher' import { RelayContext } from './context' import { FsHandler } from './fs-handler' import { LIST_FILES_SUPERSEDED_MESSAGE } from './fs-list-files-scan-coordinator' diff --git a/src/relay/fs-list-files-dispatch-test-harness.ts b/src/relay/fs-list-files-dispatch-test-harness.ts index de1086f3544..5f05dd83889 100644 --- a/src/relay/fs-list-files-dispatch-test-harness.ts +++ b/src/relay/fs-list-files-dispatch-test-harness.ts @@ -1,6 +1,6 @@ import { SshChannelMultiplexer } from '../main/ssh/ssh-channel-multiplexer' import { RelayContext } from './context' -import { RelayDispatcher } from './dispatcher' +import { RelayDispatcher } from '../wsl-guest/dispatcher' import { FsHandler } from './fs-handler' export function createRelayFileListingRequestHarness() { diff --git a/src/relay/fs-list-files-fallback-chain.ts b/src/relay/fs-list-files-fallback-chain.ts index 1d705591d3a..fbc629f2648 100644 --- a/src/relay/fs-list-files-fallback-chain.ts +++ b/src/relay/fs-list-files-fallback-chain.ts @@ -8,7 +8,7 @@ import { } from '../shared/file-listing-cancellation' import { isQuickOpenReaddirBudgetError } from '../shared/quick-open-readdir-walk' import { buildInstallRgMessage, buildRipgrepRequiredMessage } from '../shared/quick-open-install-rg' -import { buildRelayCommandEnv } from './relay-command-env' +import { buildRelayCommandEnv } from '../wsl-guest/relay-command-env' import { RipgrepUnavailableError } from '../shared/ripgrep-process-availability' import { QuickOpenPathRanker } from '../shared/quick-open-path-search' diff --git a/src/relay/fs-list-files-large-response.integration.test.ts b/src/relay/fs-list-files-large-response.integration.test.ts index 27c7ee7e648..5fb9f935623 100644 --- a/src/relay/fs-list-files-large-response.integration.test.ts +++ b/src/relay/fs-list-files-large-response.integration.test.ts @@ -21,8 +21,8 @@ import { } from '../main/ssh/ssh-channel-multiplexer' import { requestGitStreamable } from '../main/ssh/ssh-git-response-stream-reader' import { RelayContext } from './context' -import { RelayDispatcher } from './dispatcher' -import { DISPATCHER_CONTROL_QUEUE_MAX_BYTES } from './dispatcher-writer-admission' +import { RelayDispatcher } from '../wsl-guest/dispatcher' +import { DISPATCHER_CONTROL_QUEUE_MAX_BYTES } from '../wsl-guest/dispatcher-writer-admission' import { FsHandler } from './fs-handler' import { GitHandler } from './git-handler' import { GitResponseStreamRegistry } from './git-response-stream' diff --git a/src/relay/fs-markdown-document-listing.test.ts b/src/relay/fs-markdown-document-listing.test.ts index e54cc57e9b4..08795cb8cff 100644 --- a/src/relay/fs-markdown-document-listing.test.ts +++ b/src/relay/fs-markdown-document-listing.test.ts @@ -9,7 +9,7 @@ import { listFilesWithRg } from './fs-handler-list-files' import { listRelayMarkdownDocuments } from './fs-markdown-document-listing' import { RelayContext } from './context' import { FsHandler } from './fs-handler' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' it.skipIf(process.platform === 'win32')( 'keeps readable SSH Markdown documents when a child directory is unreadable', diff --git a/src/relay/fs-search-cancellation.test.ts b/src/relay/fs-search-cancellation.test.ts index 91828525502..24e34796425 100644 --- a/src/relay/fs-search-cancellation.test.ts +++ b/src/relay/fs-search-cancellation.test.ts @@ -29,10 +29,10 @@ vi.mock('./relay-bundled-ripgrep', () => ({ import { searchWithRg } from './fs-handler-utils' import { searchWithGitGrep } from './fs-handler-git-fallback' -import { RelayDispatcher } from './dispatcher' +import { RelayDispatcher } from '../wsl-guest/dispatcher' import { FsHandler } from './fs-handler' import { RelayContext } from './context' -import { encodeJsonRpcFrame } from './protocol' +import { encodeJsonRpcFrame } from '../wsl-guest/protocol' function createProcess(spawned = true) { const child = new ChildProcess() diff --git a/src/relay/fs-stream-pty-echo-backpressure.integration.test.ts b/src/relay/fs-stream-pty-echo-backpressure.integration.test.ts index 98d95fd7f8a..a73c888a2c6 100644 --- a/src/relay/fs-stream-pty-echo-backpressure.integration.test.ts +++ b/src/relay/fs-stream-pty-echo-backpressure.integration.test.ts @@ -27,11 +27,11 @@ import { } from '../main/ssh/ssh-channel-multiplexer' import { readFileViaStream } from '../main/ssh/ssh-filesystem-stream-reader' -import { RelayDispatcher } from './dispatcher' -import type { SinkWriteSettlement } from './dispatcher' +import { RelayDispatcher } from '../wsl-guest/dispatcher' +import type { SinkWriteSettlement } from '../wsl-guest/dispatcher' import { RelayContext } from './context' import { FsHandler } from './fs-handler' -import { STREAM_CHUNK_SIZE } from './protocol' +import { STREAM_CHUNK_SIZE } from '../wsl-guest/protocol' // One framed fs.streamChunk: 256KB raw → base64 (4/3) + JSON envelope + header. const FRAMED_CHUNK_BYTES = Math.ceil((STREAM_CHUNK_SIZE * 4) / 3) + 512 diff --git a/src/relay/fs-stream-registry.ts b/src/relay/fs-stream-registry.ts index e0cc395df2d..55e043d328c 100644 --- a/src/relay/fs-stream-registry.ts +++ b/src/relay/fs-stream-registry.ts @@ -1,6 +1,6 @@ import type { FileHandle } from 'node:fs/promises' import { settlesWithin } from './settles-within' -import { MAX_CONCURRENT_STREAMS, RelayErrorCode } from './protocol' +import { MAX_CONCURRENT_STREAMS, RelayErrorCode } from '../wsl-guest/protocol' import { RelayStreamAckWindow } from './relay-stream-ack-window' type StreamEntry = { handle: FileHandle; ack: RelayStreamAckWindow } diff --git a/src/relay/git-handler-comparison-operations.ts b/src/relay/git-handler-comparison-operations.ts index 72428a33d85..fa32bf95981 100644 --- a/src/relay/git-handler-comparison-operations.ts +++ b/src/relay/git-handler-comparison-operations.ts @@ -1,4 +1,4 @@ -import type { RequestContext } from './dispatcher' +import type { RequestContext } from '../wsl-guest/dispatcher' import { GitHandlerOperationContext } from './git-handler-operation-context' import { branchCompare as branchCompareOp } from './git-handler-ops' import { commitCompare as commitCompareOp } from './git-handler-commit-diff-ops' diff --git a/src/relay/git-handler-exec-operations.ts b/src/relay/git-handler-exec-operations.ts index f7d0c320697..cd43ad0c170 100644 --- a/src/relay/git-handler-exec-operations.ts +++ b/src/relay/git-handler-exec-operations.ts @@ -1,4 +1,4 @@ -import type { RequestContext } from './dispatcher' +import type { RequestContext } from '../wsl-guest/dispatcher' import { GitHandlerOperationContext } from './git-handler-operation-context' import { validateGitExecArgs } from './git-handler-ops' import { gitExecMutatesRepository } from '../shared/git-exec-mutation' diff --git a/src/relay/git-handler-fetch-operations.ts b/src/relay/git-handler-fetch-operations.ts index fd13cdc07c2..a2ee8646109 100644 --- a/src/relay/git-handler-fetch-operations.ts +++ b/src/relay/git-handler-fetch-operations.ts @@ -1,4 +1,4 @@ -import type { RequestContext } from './dispatcher' +import type { RequestContext } from '../wsl-guest/dispatcher' import { GitHandlerOperationContext } from './git-handler-operation-context' import { assertValidGitPushTarget } from '../shared/git-push-target-validation' import type { GitPushTarget } from '../shared/worktree/types' diff --git a/src/relay/git-handler-object-diff-operations.ts b/src/relay/git-handler-object-diff-operations.ts index c335deb0c5e..bb668664e9c 100644 --- a/src/relay/git-handler-object-diff-operations.ts +++ b/src/relay/git-handler-object-diff-operations.ts @@ -1,4 +1,4 @@ -import type { RequestContext } from './dispatcher' +import type { RequestContext } from '../wsl-guest/dispatcher' import { GitHandlerOperationContext } from './git-handler-operation-context' import { branchDiffEntries } from './git-handler-ops' import { diff --git a/src/relay/git-handler-operation-context.ts b/src/relay/git-handler-operation-context.ts index 928006f7290..cf79b4a089a 100644 --- a/src/relay/git-handler-operation-context.ts +++ b/src/relay/git-handler-operation-context.ts @@ -1,4 +1,4 @@ -import type { RequestContext } from './dispatcher' +import type { RequestContext } from '../wsl-guest/dispatcher' import type { GitStatusReadLeaseOwner } from '../shared/git-status-read-lease-owner' import type { GitCapabilityCache } from '../shared/git-capability-cache' import type { SubmodulePathsCache } from './git-handler-submodule-ops' diff --git a/src/relay/git-handler-read-operations.ts b/src/relay/git-handler-read-operations.ts index cde06f53996..b031694ec44 100644 --- a/src/relay/git-handler-read-operations.ts +++ b/src/relay/git-handler-read-operations.ts @@ -1,5 +1,5 @@ import * as path from 'node:path' -import type { RequestContext } from './dispatcher' +import type { RequestContext } from '../wsl-guest/dispatcher' import { GitHandlerOperationContext } from './git-handler-operation-context' import { getStatusOp } from './git-handler-status-ops' import { streamRelayGitStdout } from './git-stdout-stream' diff --git a/src/relay/git-handler-registration.ts b/src/relay/git-handler-registration.ts index 69eadd5a888..f492ecf845a 100644 --- a/src/relay/git-handler-registration.ts +++ b/src/relay/git-handler-registration.ts @@ -1,4 +1,4 @@ -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import type { GitHandlerOperationSet } from './git-handler-operation-set' export function registerGitHandlers( diff --git a/src/relay/git-handler-stage-worktree-scope.test.ts b/src/relay/git-handler-stage-worktree-scope.test.ts index 54f92c49461..9a2616ed117 100644 --- a/src/relay/git-handler-stage-worktree-scope.test.ts +++ b/src/relay/git-handler-stage-worktree-scope.test.ts @@ -7,8 +7,8 @@ import { execFileSync } from 'node:child_process' import { GitHandler } from './git-handler' import { RelayContext } from './context' import { DEFAULT_GIT_STATUS_LIMIT } from '../shared/git-status-limit' -import { RelayDispatcher } from './dispatcher' -import type { MethodHandler } from './dispatcher-contract' +import { RelayDispatcher } from '../wsl-guest/dispatcher' +import type { MethodHandler } from '../wsl-guest/dispatcher-contract' import { gitCommit, gitInit } from './git-handler-test-setup' const OVER_CAP = DEFAULT_GIT_STATUS_LIMIT + 50 diff --git a/src/relay/git-handler-sync-operations.ts b/src/relay/git-handler-sync-operations.ts index 9c0922c34df..a05213585db 100644 --- a/src/relay/git-handler-sync-operations.ts +++ b/src/relay/git-handler-sync-operations.ts @@ -1,5 +1,5 @@ import { randomUUID } from 'node:crypto' -import type { RequestContext } from './dispatcher' +import type { RequestContext } from '../wsl-guest/dispatcher' import { GitHandlerOperationContext } from './git-handler-operation-context' import { resolveRelayPushTarget } from './git-handler-push-target' import { normalizeGitErrorMessage, runPullWithDivergenceFallback } from '../shared/git-remote-error' diff --git a/src/relay/git-handler-test-setup.ts b/src/relay/git-handler-test-setup.ts index cbf1247a502..9eba417894b 100644 --- a/src/relay/git-handler-test-setup.ts +++ b/src/relay/git-handler-test-setup.ts @@ -7,7 +7,7 @@ */ import { vi } from 'vitest' import { execFileSync } from 'node:child_process' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' const TEST_GIT_USER_EMAIL = 'test@test.com' const TEST_GIT_USER_NAME = 'Test' diff --git a/src/relay/git-handler-worktree-operations.ts b/src/relay/git-handler-worktree-operations.ts index 80948e5f608..14c19a3802d 100644 --- a/src/relay/git-handler-worktree-operations.ts +++ b/src/relay/git-handler-worktree-operations.ts @@ -1,7 +1,7 @@ import { throwIfSignalAborted } from '../shared/abort-signal-reason' import { annotateWorktreeLocksFromAdmin } from '../shared/git-worktree-admin' import * as path from 'node:path' -import type { RequestContext } from './dispatcher' +import type { RequestContext } from '../wsl-guest/dispatcher' import { expandTilde } from './context' import { GitHandlerOperationContext } from './git-handler-operation-context' import { isUnsupportedWorktreeListZError } from './git-handler-utils' diff --git a/src/relay/git-handler.ts b/src/relay/git-handler.ts index e58b1e4abe4..b2f425548ef 100644 --- a/src/relay/git-handler.ts +++ b/src/relay/git-handler.ts @@ -1,4 +1,4 @@ -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import type { RelayContext } from './context' import { expandTilde } from './context' import { MAX_IN_FLIGHT_PROMISE_DEDUPE_ENTRIES } from '../shared/in-flight-promise-dedupe' @@ -12,7 +12,7 @@ import { import { GitResponseStreamRegistry, maybeStreamRpcResponse } from './git-response-stream' import { clearGitStatusLineStatsCache } from '../shared/git-status-line-stats-cache' import { invalidateGitBranchLineTotalInFlight } from '../shared/git-branch-line-total' -import { buildRelayGitEnv, buildRelayUnattendedGitEnv } from './relay-command-env' +import { buildRelayGitEnv, buildRelayUnattendedGitEnv } from '../wsl-guest/relay-command-env' import { getGitCloneFailureMessage } from '../shared/git-clone-failure-message' import type { GitHandlerCommandOptions, diff --git a/src/relay/git-response-pty-echo-backpressure.integration.test.ts b/src/relay/git-response-pty-echo-backpressure.integration.test.ts index 4f3eee4a87a..cf60f4ab437 100644 --- a/src/relay/git-response-pty-echo-backpressure.integration.test.ts +++ b/src/relay/git-response-pty-echo-backpressure.integration.test.ts @@ -27,11 +27,11 @@ import { } from '../main/ssh/ssh-channel-multiplexer' import { requestGitStreamable } from '../main/ssh/ssh-git-response-stream-reader' -import { RelayDispatcher } from './dispatcher' -import type { SinkWriteSettlement } from './dispatcher' +import { RelayDispatcher } from '../wsl-guest/dispatcher' +import type { SinkWriteSettlement } from '../wsl-guest/dispatcher' import { RelayContext } from './context' import { GitHandler } from './git-handler' -import { GIT_RESPONSE_CHUNK_SIZE } from './protocol' +import { GIT_RESPONSE_CHUNK_SIZE } from '../wsl-guest/protocol' // One framed git.responseChunk: base64 (4/3) + JSON envelope + header slack. const FRAMED_CHUNK_BYTES = Math.ceil((GIT_RESPONSE_CHUNK_SIZE * 4) / 3) + 512 diff --git a/src/relay/git-response-stream-ownership.test.ts b/src/relay/git-response-stream-ownership.test.ts index 66d7ead7935..3e23ae2e7f1 100644 --- a/src/relay/git-response-stream-ownership.test.ts +++ b/src/relay/git-response-stream-ownership.test.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import { GitResponseStreamRegistry } from './git-response-stream' -import { GIT_RESPONSE_CHUNK_SIZE, STREAM_ACK_WINDOW_CHUNKS } from './protocol' +import { GIT_RESPONSE_CHUNK_SIZE, STREAM_ACK_WINDOW_CHUNKS } from '../wsl-guest/protocol' async function flushPump(): Promise { await new Promise((resolve) => setImmediate(resolve)) diff --git a/src/relay/git-response-stream-retention.test.ts b/src/relay/git-response-stream-retention.test.ts index 8c18b45beca..8898eaecdb5 100644 --- a/src/relay/git-response-stream-retention.test.ts +++ b/src/relay/git-response-stream-retention.test.ts @@ -1,6 +1,6 @@ import { createHash } from 'node:crypto' import { afterEach, describe, expect, it, vi } from 'vitest' -import { RelayDispatcher } from './dispatcher' +import { RelayDispatcher } from '../wsl-guest/dispatcher' import { GitResponseStreamRegistry } from './git-response-stream' async function collect(): Promise { diff --git a/src/relay/git-response-stream-shutdown.test.ts b/src/relay/git-response-stream-shutdown.test.ts index b3e14467131..bb05a79f2c0 100644 --- a/src/relay/git-response-stream-shutdown.test.ts +++ b/src/relay/git-response-stream-shutdown.test.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import { GitResponseStreamRegistry } from './git-response-stream' -import { GIT_RESPONSE_CHUNK_SIZE, STREAM_ACK_WINDOW_CHUNKS } from './protocol' +import { GIT_RESPONSE_CHUNK_SIZE, STREAM_ACK_WINDOW_CHUNKS } from '../wsl-guest/protocol' const context: RequestContext = { clientId: 7, isStale: () => false } diff --git a/src/relay/git-response-stream.ts b/src/relay/git-response-stream.ts index 254c140478a..86c0f9f986c 100644 --- a/src/relay/git-response-stream.ts +++ b/src/relay/git-response-stream.ts @@ -13,13 +13,13 @@ // `git.responseAck` can credit the ack window a pump parks on — the other's // streams would stall at STREAM_ACK_WINDOW_CHUNKS forever. See // `relay-runtime-services.ts` for the wiring. -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import { GIT_RESPONSE_CHUNK_SIZE, GIT_RESPONSE_STREAM_THRESHOLD, STREAM_ACK_WINDOW_CHUNKS, type GitResponseStreamMarker -} from './protocol' +} from '../wsl-guest/protocol' import { settlesWithin } from './settles-within' import { RelayStreamAckWindow } from './relay-stream-ack-window' import { errorMessage } from '../shared/error-message' diff --git a/src/relay/git-stdout-stream.ts b/src/relay/git-stdout-stream.ts index 7354544a809..c30cdfb00b0 100644 --- a/src/relay/git-stdout-stream.ts +++ b/src/relay/git-stdout-stream.ts @@ -4,7 +4,7 @@ import { forceTerminateProcessTree } from '@orca/process-host/process-tree-termi import { createChildTerminationReporter } from '@orca/process-host/child-termination-reporter' import { GitCommandTimeoutError, gitCommandTimeoutMs } from '../shared/git-command-timeout' import { expandTilde } from './context' -import { buildRelayGitEnv } from './relay-command-env' +import { buildRelayGitEnv } from '../wsl-guest/relay-command-env' import { acquireRelayGitAdmission } from './git-handler-command-termination' const DEFAULT_RELAY_GIT_STREAM_MAX_BYTES = 10 * 1024 * 1024 diff --git a/src/relay/integration.test.ts b/src/relay/integration.test.ts index f6b7cee2844..8e5cea00501 100644 --- a/src/relay/integration.test.ts +++ b/src/relay/integration.test.ts @@ -19,7 +19,7 @@ import { type MultiplexerTransport } from '../main/ssh/ssh-channel-multiplexer' -import { RelayDispatcher } from './dispatcher' +import { RelayDispatcher } from '../wsl-guest/dispatcher' import { RelayContext } from './context' import { FsHandler } from './fs-handler' import { GitHandler } from './git-handler' diff --git a/src/relay/managed-hook-installer.test.ts b/src/relay/managed-hook-installer.test.ts index aba8f51490d..4f80225e06b 100644 --- a/src/relay/managed-hook-installer.test.ts +++ b/src/relay/managed-hook-installer.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest' import { AGENT_HOOK_INSTALL_MANAGED_HOOKS_METHOD } from '../shared/agent-hook-relay' -import type { MethodHandler, RequestContext } from './dispatcher' +import type { MethodHandler, RequestContext } from '../wsl-guest/dispatcher' import { registerManagedHookInstaller, type ManagedHookRuntime } from './managed-hook-installer' function captureHandler(loadRuntime: () => ManagedHookRuntime): MethodHandler { diff --git a/src/relay/managed-hook-installer.ts b/src/relay/managed-hook-installer.ts index e88089f486a..20c4fde66b8 100644 --- a/src/relay/managed-hook-installer.ts +++ b/src/relay/managed-hook-installer.ts @@ -3,7 +3,7 @@ import { AGENT_HOOK_INSTALL_MANAGED_HOOKS_METHOD, type AgentHookInstallManagedHooksParams } from '../shared/agent-hook-relay' -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import type { AgentHookTarget } from '../shared/agent-hook-types' import { isManagedAgentHookTarget } from '../shared/managed-agent-hook-targets' import { parseClaudeCliVersion } from '../main/claude/claude-hook-event-versions' diff --git a/src/relay/omp-fresh-launch-environment.test.ts b/src/relay/omp-fresh-launch-environment.test.ts index 4765aecbdbd..a3ad51b502c 100644 --- a/src/relay/omp-fresh-launch-environment.test.ts +++ b/src/relay/omp-fresh-launch-environment.test.ts @@ -5,10 +5,10 @@ import { tmpdir } from 'node:os' import type * as NodeOs from 'node:os' import { delimiter, join } from 'node:path' import { afterEach, expect, it, vi } from 'vitest' -import { RelayDispatcher } from './dispatcher' +import { RelayDispatcher } from '../wsl-guest/dispatcher' import { PtyHandler } from './pty-handler' import { RelayAgentHookRuntime } from './relay-agent-hook-runtime' -import { PluginOverlayManager } from './plugin-overlay' +import { PluginOverlayManager } from '../wsl-guest/plugin-overlay' import { withFreshOmpLaunch } from '../shared/omp-fresh-launch' const state = vi.hoisted(() => ({ home: '' })) diff --git a/src/relay/opencode-hook-selection.test.ts b/src/relay/opencode-hook-selection.test.ts index 0650662762c..8fc9c5f4799 100644 --- a/src/relay/opencode-hook-selection.test.ts +++ b/src/relay/opencode-hook-selection.test.ts @@ -5,7 +5,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import { beginPtyHandlerTest, endPtyHandlerTest } from './pty-handler-test-harness' import { RelayAgentHookRuntime } from './relay-agent-hook-runtime' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { AGENT_HOOK_INSTALL_PLUGINS_METHOD } from '../shared/agent-hook-relay' const mocks = vi.hoisted(() => ({ @@ -33,7 +33,7 @@ vi.mock('../main/opencode/opencode-launch-capabilities', () => ({ vi.mock('../main/pty/posix-pty-process-groups', () => ({ forceKillPosixPtyProcessGroups: vi.fn((_pid: number, fallback: () => void) => fallback()) })) -vi.mock('./agent-hook-server', () => ({ +vi.mock('../wsl-guest/agent-hook-server', () => ({ RelayAgentHookServer: class { start = async () => {} stop = () => {} diff --git a/src/relay/plugin-host-call-handler.ts b/src/relay/plugin-host-call-handler.ts index c3f73c53c7b..e4000608f5b 100644 --- a/src/relay/plugin-host-call-handler.ts +++ b/src/relay/plugin-host-call-handler.ts @@ -1,4 +1,4 @@ -import type { MethodHandler, RequestContext } from './dispatcher' +import type { MethodHandler, RequestContext } from '../wsl-guest/dispatcher' import { admitPluginPanelCall, createPluginPanelCallAdmission, diff --git a/src/relay/port-scan-handler.test.ts b/src/relay/port-scan-handler.test.ts index 3300df00bae..45a389b7c94 100644 --- a/src/relay/port-scan-handler.test.ts +++ b/src/relay/port-scan-handler.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { MethodHandler, RequestContext } from './dispatcher' +import type { MethodHandler, RequestContext } from '../wsl-guest/dispatcher' const { readFileMock, readdirMock, readlinkMock } = vi.hoisted(() => ({ readFileMock: vi.fn(), diff --git a/src/relay/port-scan-handler.ts b/src/relay/port-scan-handler.ts index 667f43cacf8..29fdca9a19f 100644 --- a/src/relay/port-scan-handler.ts +++ b/src/relay/port-scan-handler.ts @@ -1,6 +1,6 @@ import { readFile, readdir, readlink } from 'node:fs/promises' import { getProcessOutputFields } from '../shared/process-output-field-scanner' -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import { scanWindowsListeningPorts } from './windows-port-scan' // Keep in sync with src/shared/ssh-types.ts — DetectedPort diff --git a/src/relay/pty-handler-output-drain-differential.test.ts b/src/relay/pty-handler-output-drain-differential.test.ts index d6c7e92470f..3afd9a37d81 100644 --- a/src/relay/pty-handler-output-drain-differential.test.ts +++ b/src/relay/pty-handler-output-drain-differential.test.ts @@ -19,7 +19,7 @@ const { mockPtySpawn, mockPtyInstance } = vi.hoisted(() => ({ vi.mock('node-pty', () => ({ spawn: mockPtySpawn })) import { PtyHandler } from './pty-handler' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' // Mirrors the relay drain constants; kept local so a constant change fails this oracle loudly. const CHUNK_CHARS = 16 * 1024 diff --git a/src/relay/pty-handler-output-streaming.test.ts b/src/relay/pty-handler-output-streaming.test.ts index f9e241e04f0..2d13b5d9b8e 100644 --- a/src/relay/pty-handler-output-streaming.test.ts +++ b/src/relay/pty-handler-output-streaming.test.ts @@ -37,8 +37,8 @@ vi.mock('../main/shell-prompt-readiness-probe', () => ({ })) import { PtyHandler } from './pty-handler' -import { RelayDispatcher } from './dispatcher' -import { encodeJsonRpcFrame } from './protocol' +import { RelayDispatcher } from '../wsl-guest/dispatcher' +import { encodeJsonRpcFrame } from '../wsl-guest/protocol' import type { RelayPtySourcePublication } from './relay-pty-source-publication' import { beginPtyHandlerTest, diff --git a/src/relay/pty-handler-owner-inventory-clone-budget.test.ts b/src/relay/pty-handler-owner-inventory-clone-budget.test.ts index bb283e47992..e76f955e4c0 100644 --- a/src/relay/pty-handler-owner-inventory-clone-budget.test.ts +++ b/src/relay/pty-handler-owner-inventory-clone-budget.test.ts @@ -2,8 +2,12 @@ import './mock-descendant-sweep' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type * as CryptoModule from 'node:crypto' import type * as SnapshotModule from '../shared/process-table-snapshot-reader' -import { RelayDispatcher } from './dispatcher' -import { encodeJsonRpcFrame, parseJsonRpcMessage, type JsonRpcResponse } from './protocol' +import { RelayDispatcher } from '../wsl-guest/dispatcher' +import { + encodeJsonRpcFrame, + parseJsonRpcMessage, + type JsonRpcResponse +} from '../wsl-guest/protocol' import { PtyHandler } from './pty-handler' import { ClaimedAgentPtyOwnerRegistry } from '../shared/claimed-agent-pty-owner' import { diff --git a/src/relay/pty-handler-shell-recovery.test.ts b/src/relay/pty-handler-shell-recovery.test.ts index 54497cd1763..43580756b60 100644 --- a/src/relay/pty-handler-shell-recovery.test.ts +++ b/src/relay/pty-handler-shell-recovery.test.ts @@ -1,8 +1,8 @@ import './mock-descendant-sweep' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { PROCESS_BOUNDARY_GROUND } from '../shared/terminal-mode-reset-profiles' -import { RelayDispatcher, type RelayClientSessionIdentity } from './dispatcher' -import { encodeJsonRpcFrame, MessageType } from './protocol' +import { RelayDispatcher, type RelayClientSessionIdentity } from '../wsl-guest/dispatcher' +import { encodeJsonRpcFrame, MessageType } from '../wsl-guest/protocol' import { PtyHandler } from './pty-handler' import { TEST_PTY_ID_MINT_EPOCH } from './pty-handler-test-harness' import { RelayPtySourcePublication } from './relay-pty-source-publication' diff --git a/src/relay/pty-handler-source-publication.test.ts b/src/relay/pty-handler-source-publication.test.ts index 341931cffb5..d283ea4e5b0 100644 --- a/src/relay/pty-handler-source-publication.test.ts +++ b/src/relay/pty-handler-source-publication.test.ts @@ -5,8 +5,8 @@ import { RelayDispatcher, type RelayClientSessionIdentity, type SinkWriteSettlement -} from './dispatcher' -import { encodeJsonRpcFrame, MessageType } from './protocol' +} from '../wsl-guest/dispatcher' +import { encodeJsonRpcFrame, MessageType } from '../wsl-guest/protocol' import { PtyHandler } from './pty-handler' import { TEST_PTY_ID_MINT_EPOCH, testPtyId } from './pty-handler-test-harness' import { RelayPtySourcePublication } from './relay-pty-source-publication' diff --git a/src/relay/pty-handler-spawn-admission.test.ts b/src/relay/pty-handler-spawn-admission.test.ts index 39ab83503a1..038d944e329 100644 --- a/src/relay/pty-handler-spawn-admission.test.ts +++ b/src/relay/pty-handler-spawn-admission.test.ts @@ -41,7 +41,7 @@ vi.mock('../main/shell-prompt-readiness-probe', () => ({ })) import { MAX_RELAY_PTY_SESSIONS, PtyHandler } from './pty-handler' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { beginPtyHandlerTest, createMockDispatcher, diff --git a/src/relay/pty-handler-test-harness.ts b/src/relay/pty-handler-test-harness.ts index fe6e17c5d9c..b9259a721a6 100644 --- a/src/relay/pty-handler-test-harness.ts +++ b/src/relay/pty-handler-test-harness.ts @@ -2,7 +2,7 @@ import { vi } from 'vitest' import type { Mock } from 'vitest' import * as ptyChildProcessInspection from './pty-child-process-inspection' import { PtyHandler } from './pty-handler' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' export const TEST_PTY_ID_MINT_EPOCH = 'test-mint-epoch' diff --git a/src/relay/pty-handler.ts b/src/relay/pty-handler.ts index 6ccf242ae30..0e6fc386877 100644 --- a/src/relay/pty-handler.ts +++ b/src/relay/pty-handler.ts @@ -12,7 +12,7 @@ import { applyOpenCodePluginSelection, restoreOpenCodeCapabilities } from './opencode-plugin-selection' -import { resolveCommandPathForRelay } from './preflight-handler' +import { resolveCommandPathForRelay } from '../wsl-guest/preflight-handler' import { applyRelayAgentWorkspaceTrust } from './agent-workspace-trust-spawn' import type { IPty } from 'node-pty' import { killWithDescendantSweep } from '../main/pty-descendant-termination' @@ -22,7 +22,7 @@ import { basename, join } from 'node:path' import { randomUUID } from 'node:crypto' import { resolveWindowsGitBashShellPath } from '../main/git-bash' import { isSupportedWindowsShellOverride } from '../shared/windows-terminal-shell' -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import { resolveDefaultShell, resolveProcessCwd, diff --git a/src/relay/relay-agent-hook-runtime.ts b/src/relay/relay-agent-hook-runtime.ts index 8c5a2e66416..69d8097a743 100644 --- a/src/relay/relay-agent-hook-runtime.ts +++ b/src/relay/relay-agent-hook-runtime.ts @@ -1,22 +1,22 @@ import { AGENT_HOOK_INFER_INTERRUPT_METHOD } from '../shared/agent-hook-interrupt-reconciliation' import { homedir } from 'node:os' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import type { PtyEnvAugmenter, PtyHandler } from './pty-handler' -import { RelayAgentHookServer } from './agent-hook-server' -import { endpointDirForRelaySocket } from './agent-hook-endpoint-coordinates' -import { PluginOverlayManager } from './plugin-overlay' -import { installOpenCodePluginInCanonicalConfig } from './opencode-canonical-config' +import { RelayAgentHookServer } from '../wsl-guest/agent-hook-server' +import { endpointDirForRelaySocket } from '../wsl-guest/agent-hook-endpoint-coordinates' +import { PluginOverlayManager } from '../wsl-guest/plugin-overlay' +import { installOpenCodePluginInCanonicalConfig } from '../wsl-guest/opencode-canonical-config' import { AGENT_HOOK_INSTALL_PLUGINS_METHOD, AGENT_HOOK_REQUEST_REPLAY_METHOD } from '../shared/agent-hook-relay' -import { publishAgentHookEnvelope } from './agent-hook-envelope-publication' -import { assertPluginSourceUnderByteCap } from './plugin-source-limit' +import { publishAgentHookEnvelope } from '../wsl-guest/agent-hook-envelope-publication' +import { assertPluginSourceUnderByteCap } from '../wsl-guest/plugin-source-limit' import { resolveOpenCodeSourceConfigDir, resolvePiSourceAgentDir, resolveOmpConfigDirName -} from './plugin-overlay-env' +} from '../wsl-guest/plugin-overlay-env' import { detectExplicitPiAgentKindFromCommand, isPiCompatibleAgentType diff --git a/src/relay/relay-bundled-ripgrep.ts b/src/relay/relay-bundled-ripgrep.ts index 5c2dd89f3be..54cb5e562ca 100644 --- a/src/relay/relay-bundled-ripgrep.ts +++ b/src/relay/relay-bundled-ripgrep.ts @@ -10,7 +10,7 @@ import { isTransientRipgrepSpawnError } from '../shared/ripgrep-process-availability' import { relayLogLine } from './relay-diagnostic-log' -import { buildRelayCommandEnv } from './relay-command-env' +import { buildRelayCommandEnv } from '../wsl-guest/relay-command-env' export const PATH_RIPGREP_COMMAND = 'rg' diff --git a/src/relay/relay-client-resync-marker.ts b/src/relay/relay-client-resync-marker.ts index 4d6353ea59b..5fe6361c09c 100644 --- a/src/relay/relay-client-resync-marker.ts +++ b/src/relay/relay-client-resync-marker.ts @@ -1,4 +1,4 @@ -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' type RetainedMarker = { params: Record; estimatedBytes: number } diff --git a/src/relay/relay-connect-channel.ts b/src/relay/relay-connect-channel.ts index 3bf0b7ae870..6536597339f 100644 --- a/src/relay/relay-connect-channel.ts +++ b/src/relay/relay-connect-channel.ts @@ -1,6 +1,6 @@ import { createConnection } from 'node:net' -import { DispatcherClientWriter } from './dispatcher-client-writer' -import { RELAY_SENTINEL } from './protocol' +import { DispatcherClientWriter } from '../wsl-guest/dispatcher-client-writer' +import { RELAY_SENTINEL } from '../wsl-guest/protocol' import { readLaunchVersion, runConnectHandshake } from './relay-handshake' const CONNECT_TIMEOUT_MS = 5_000 diff --git a/src/relay/relay-filesystem-watch-registry.test.ts b/src/relay/relay-filesystem-watch-registry.test.ts index 8cfde8edfc3..fcf3850157a 100644 --- a/src/relay/relay-filesystem-watch-registry.test.ts +++ b/src/relay/relay-filesystem-watch-registry.test.ts @@ -9,7 +9,7 @@ import type { WatcherProcessHooks, WatcherProcessSubscription } from '../main/ipc/parcel-watcher-process-subscription' -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import { RelayFilesystemWatchRegistry } from './relay-filesystem-watch-registry' import { createRelayWatcherProcessPool } from './relay-watcher-process-pool' diff --git a/src/relay/relay-filesystem-watch-registry.ts b/src/relay/relay-filesystem-watch-registry.ts index c9220f09334..3ec6fb90760 100644 --- a/src/relay/relay-filesystem-watch-registry.ts +++ b/src/relay/relay-filesystem-watch-registry.ts @@ -1,4 +1,4 @@ -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import { MAX_BATCHED_WATCHER_EVENTS } from '../main/ipc/filesystem-watcher-event-batch' import { WATCHER_IGNORE_DIRS, diff --git a/src/relay/relay-grace-lifecycle.test.ts b/src/relay/relay-grace-lifecycle.test.ts index adc1d7ce762..409d6c906d7 100644 --- a/src/relay/relay-grace-lifecycle.test.ts +++ b/src/relay/relay-grace-lifecycle.test.ts @@ -1,5 +1,5 @@ import { afterEach, expect, it, vi } from 'vitest' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import type { PtyHandler } from './pty-handler' import { RelayGraceLifecycle } from './relay-grace-lifecycle' diff --git a/src/relay/relay-grace-lifecycle.ts b/src/relay/relay-grace-lifecycle.ts index 8415b71793c..b38301cce08 100644 --- a/src/relay/relay-grace-lifecycle.ts +++ b/src/relay/relay-grace-lifecycle.ts @@ -6,7 +6,7 @@ import { } from './relay-grace-branch' import { relayLogLine } from './relay-diagnostic-log' import { SSH_RELAY_CONFIGURE_GRACE_TIME_METHOD } from '../shared/ssh-types' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { errorMessage } from '../shared/error-message' type RelayGraceLifecycleOptions = { diff --git a/src/relay/relay-handshake-roundtrip.test.ts b/src/relay/relay-handshake-roundtrip.test.ts index bfc345e8366..fbfecc8b122 100644 --- a/src/relay/relay-handshake-roundtrip.test.ts +++ b/src/relay/relay-handshake-roundtrip.test.ts @@ -16,7 +16,7 @@ import { type DecodedFrame, type HandshakeMessage, MessageType -} from './protocol' +} from '../wsl-guest/protocol' import { relayTestSocketPath } from './relay-test-socket-path' // Why: --connect normally calls process.exit on mismatch / fatal handshake diff --git a/src/relay/relay-handshake.ts b/src/relay/relay-handshake.ts index fb700367509..03b01fa4f4e 100644 --- a/src/relay/relay-handshake.ts +++ b/src/relay/relay-handshake.ts @@ -10,7 +10,7 @@ import { encodeHandshakeFrame, parseHandshakeMessage, type DecodedFrame -} from './protocol' +} from '../wsl-guest/protocol' import { relayLogLine } from './relay-diagnostic-log' import { describeRelayRuntime } from './relay-runtime-identity' diff --git a/src/relay/relay-orca-cli-channel.ts b/src/relay/relay-orca-cli-channel.ts index 1d528c63280..3eec5a9b6cf 100644 --- a/src/relay/relay-orca-cli-channel.ts +++ b/src/relay/relay-orca-cli-channel.ts @@ -1,5 +1,5 @@ import { createConnection } from 'node:net' -import { DispatcherClientWriter } from './dispatcher-client-writer' +import { DispatcherClientWriter } from '../wsl-guest/dispatcher-client-writer' import { pickRemoteCliEnv } from './remote-cli-env' import { shouldReadRemoteCliStdin } from './remote-cli-stdin' import { prepareRemoteArtifactCliInput } from './remote-artifact-cli-input' @@ -14,7 +14,7 @@ import { parseJsonRpcMessage, type DecodedFrame, type JsonRpcResponse -} from './protocol' +} from '../wsl-guest/protocol' import { readLaunchVersion, runConnectHandshake } from './relay-handshake' const CONNECT_TIMEOUT_MS = 5_000 diff --git a/src/relay/relay-oversized-notification-survival.test.ts b/src/relay/relay-oversized-notification-survival.test.ts index 40eb6b62f32..2dae43b4cd0 100644 --- a/src/relay/relay-oversized-notification-survival.test.ts +++ b/src/relay/relay-oversized-notification-survival.test.ts @@ -1,14 +1,14 @@ import { describe, expect, it } from 'vitest' -import { RelayDispatcher } from './dispatcher' -import { relayWriterControlReserve } from './dispatcher-writer-admission' -import { encodeJsonRpcFrame, HEADER_LENGTH, parseJsonRpcMessage } from './protocol' +import { RelayDispatcher } from '../wsl-guest/dispatcher' +import { relayWriterControlReserve } from '../wsl-guest/dispatcher-writer-admission' +import { encodeJsonRpcFrame, HEADER_LENGTH, parseJsonRpcMessage } from '../wsl-guest/protocol' import { AGENT_HOOK_NOTIFICATION_METHOD, type AgentHookRelayEnvelope } from '../shared/agent-hook-relay' import { MAX_BATCHED_WATCHER_EVENTS } from '../main/ipc/filesystem-watcher-event-batch' import { emitRelayWatcherEvents } from './relay-watcher-event-emitter' -import { publishAgentHookEnvelope } from './agent-hook-envelope-publication' +import { publishAgentHookEnvelope } from '../wsl-guest/agent-hook-envelope-publication' import type { WatcherProcessEvent } from '../main/ipc/parcel-watcher-process' import { AGENT_STATUS_ASSISTANT_MESSAGE_MAX_LENGTH, diff --git a/src/relay/relay-primary-channel.ts b/src/relay/relay-primary-channel.ts index e3dbffeae7f..92aab95a555 100644 --- a/src/relay/relay-primary-channel.ts +++ b/src/relay/relay-primary-channel.ts @@ -1,6 +1,6 @@ import { closeSync, openSync } from 'node:fs' -import { RelayDispatcher } from './dispatcher' -import { RELAY_SENTINEL } from './protocol' +import { RelayDispatcher } from '../wsl-guest/dispatcher' +import { RELAY_SENTINEL } from '../wsl-guest/protocol' /** * Why the `\\.\` device prefix and not bare `NUL`: node's fs resolves a relative path diff --git a/src/relay/relay-pty-consumer-owner-displacement.test.ts b/src/relay/relay-pty-consumer-owner-displacement.test.ts index 155abc542f0..81f090f8472 100644 --- a/src/relay/relay-pty-consumer-owner-displacement.test.ts +++ b/src/relay/relay-pty-consumer-owner-displacement.test.ts @@ -3,8 +3,8 @@ import { RelayDispatcher, type RelayClientSessionIdentity, type SinkWriteSettlement -} from './dispatcher' -import { encodeJsonRpcFrame, MessageType } from './protocol' +} from '../wsl-guest/dispatcher' +import { encodeJsonRpcFrame, MessageType } from '../wsl-guest/protocol' import { SshPtyConsumerSessionAdapter } from './ssh-pty-consumer-session-adapter' import { PTY_CONSUMER_OWNER_RECOVERY_PENDING_ERROR, diff --git a/src/relay/relay-pty-publication-admission.test.ts b/src/relay/relay-pty-publication-admission.test.ts index d1cb9551cfe..3be0325e50b 100644 --- a/src/relay/relay-pty-publication-admission.test.ts +++ b/src/relay/relay-pty-publication-admission.test.ts @@ -4,8 +4,8 @@ import { type RelayClientSessionIdentity, type RelayClientSinkOptions, type SinkWriteSettlement -} from './dispatcher' -import { encodeJsonRpcFrame, MessageType } from './protocol' +} from '../wsl-guest/dispatcher' +import { encodeJsonRpcFrame, MessageType } from '../wsl-guest/protocol' import { RelayPtySourcePublication } from './relay-pty-source-publication' import { SshPtyConsumerSessionAdapter } from './ssh-pty-consumer-session-adapter' diff --git a/src/relay/relay-pty-source-activation.ts b/src/relay/relay-pty-source-activation.ts index 3898dda6df1..e8a48d13455 100644 --- a/src/relay/relay-pty-source-activation.ts +++ b/src/relay/relay-pty-source-activation.ts @@ -8,7 +8,7 @@ import type { PtySourceDeliveryIdentity, PtySourceDeliverySnapshot } from '../shared/pty-source-credit-contract' -import type { RequestContext } from './dispatcher' +import type { RequestContext } from '../wsl-guest/dispatcher' import type { RelayPtySourceDeliveryRecord, RelayPtySourceSendScheduler diff --git a/src/relay/relay-pty-source-cancellation-exit.test.ts b/src/relay/relay-pty-source-cancellation-exit.test.ts index 8a1f5d39ebb..d039f98baff 100644 --- a/src/relay/relay-pty-source-cancellation-exit.test.ts +++ b/src/relay/relay-pty-source-cancellation-exit.test.ts @@ -4,8 +4,8 @@ import { RelayDispatcher, type RelayClientSessionIdentity, type SinkWriteSettlement -} from './dispatcher' -import { encodeJsonRpcFrame, MessageType } from './protocol' +} from '../wsl-guest/dispatcher' +import { encodeJsonRpcFrame, MessageType } from '../wsl-guest/protocol' import { RelayPtySourcePublication } from './relay-pty-source-publication' import { SshPtyConsumerSessionAdapter } from './ssh-pty-consumer-session-adapter' diff --git a/src/relay/relay-pty-source-exit-publication.test.ts b/src/relay/relay-pty-source-exit-publication.test.ts index a7820c4aa5f..8e01b4ddfa4 100644 --- a/src/relay/relay-pty-source-exit-publication.test.ts +++ b/src/relay/relay-pty-source-exit-publication.test.ts @@ -3,7 +3,7 @@ import type { PtySourceDeliveryIdentity, PtySourceDeliverySnapshot } from '../shared/pty-source-credit-contract' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { RelayPtySourceLegacyExitIndex, sealAndPublishPtySourceExit, diff --git a/src/relay/relay-pty-source-exit-publication.ts b/src/relay/relay-pty-source-exit-publication.ts index 6257ae25442..55249312299 100644 --- a/src/relay/relay-pty-source-exit-publication.ts +++ b/src/relay/relay-pty-source-exit-publication.ts @@ -1,4 +1,4 @@ -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { onceSinkSettlement, type RelayPtySourceDeliveryRecord, diff --git a/src/relay/relay-pty-source-output.ts b/src/relay/relay-pty-source-output.ts index 0f6ea798a9b..d9302734aeb 100644 --- a/src/relay/relay-pty-source-output.ts +++ b/src/relay/relay-pty-source-output.ts @@ -1,6 +1,6 @@ import { randomUUID } from 'node:crypto' import type { PtySourceDeliveryIdentity } from '../shared/pty-source-credit-contract' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import type { RelayPtySourceDeliveryRecord } from './relay-pty-source-send-scheduler' import type { SshPtyConsumerSessionAdapter } from './ssh-pty-consumer-session-adapter' diff --git a/src/relay/relay-pty-source-publication.test.ts b/src/relay/relay-pty-source-publication.test.ts index af75613debd..6e9150f6a87 100644 --- a/src/relay/relay-pty-source-publication.test.ts +++ b/src/relay/relay-pty-source-publication.test.ts @@ -3,8 +3,8 @@ import { RelayDispatcher, type RelayClientSessionIdentity, type SinkWriteSettlement -} from './dispatcher' -import { encodeJsonRpcFrame, MessageType } from './protocol' +} from '../wsl-guest/dispatcher' +import { encodeJsonRpcFrame, MessageType } from '../wsl-guest/protocol' import { RelayPtySourcePublication } from './relay-pty-source-publication' import { SshPtyConsumerSessionAdapter } from './ssh-pty-consumer-session-adapter' diff --git a/src/relay/relay-pty-source-publication.ts b/src/relay/relay-pty-source-publication.ts index c1959fd24d1..b62a718a086 100644 --- a/src/relay/relay-pty-source-publication.ts +++ b/src/relay/relay-pty-source-publication.ts @@ -22,7 +22,7 @@ import { sealAndPublishTrackedPtySourceExit, type PtyExitParams } from './relay-pty-source-exit-publication' -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import { appendPtySourceOutput, projectPtySourceOutputToLegacy, diff --git a/src/relay/relay-pty-source-recovery-completion.test.ts b/src/relay/relay-pty-source-recovery-completion.test.ts index ba5f8d6787f..d46cd32f09c 100644 --- a/src/relay/relay-pty-source-recovery-completion.test.ts +++ b/src/relay/relay-pty-source-recovery-completion.test.ts @@ -1,5 +1,5 @@ import { expect, it } from 'vitest' -import type { RelayDispatcher, SinkWriteSettlement } from './dispatcher' +import type { RelayDispatcher, SinkWriteSettlement } from '../wsl-guest/dispatcher' import type { SshPtyConsumerSessionAdapter } from './ssh-pty-consumer-session-adapter' import { RelayPtySourceSendScheduler, diff --git a/src/relay/relay-pty-source-recovery-completion.ts b/src/relay/relay-pty-source-recovery-completion.ts index bc4c79e1be6..e5fc2a32f31 100644 --- a/src/relay/relay-pty-source-recovery-completion.ts +++ b/src/relay/relay-pty-source-recovery-completion.ts @@ -1,4 +1,4 @@ -import type { RelayDispatcher, SinkWriteSettlement } from './dispatcher' +import type { RelayDispatcher, SinkWriteSettlement } from '../wsl-guest/dispatcher' import type { RelayPtySourceDeliveryRecord } from './relay-pty-source-send-scheduler' import type { SshPtyConsumerSessionAdapter } from './ssh-pty-consumer-session-adapter' diff --git a/src/relay/relay-pty-source-recovery-interleavings.test.ts b/src/relay/relay-pty-source-recovery-interleavings.test.ts index 0c35b25c1a7..fc7588f507b 100644 --- a/src/relay/relay-pty-source-recovery-interleavings.test.ts +++ b/src/relay/relay-pty-source-recovery-interleavings.test.ts @@ -5,8 +5,8 @@ import { RelayDispatcher, type RelayClientSessionIdentity, type SinkWriteSettlement -} from './dispatcher' -import { encodeJsonRpcFrame, MessageType } from './protocol' +} from '../wsl-guest/dispatcher' +import { encodeJsonRpcFrame, MessageType } from '../wsl-guest/protocol' import { RelayPtySourceCreditLedger } from './pty-source-credit-ledger' import { RelayPtySourcePublication } from './relay-pty-source-publication' import { SshPtyConsumerSessionAdapter } from './ssh-pty-consumer-session-adapter' diff --git a/src/relay/relay-pty-source-recovery-window.test.ts b/src/relay/relay-pty-source-recovery-window.test.ts index 6f3f8186178..361b9056603 100644 --- a/src/relay/relay-pty-source-recovery-window.test.ts +++ b/src/relay/relay-pty-source-recovery-window.test.ts @@ -1,7 +1,7 @@ import { afterEach, expect, it } from 'vitest' -import { RelayDispatcher, type RelayClientSessionIdentity } from './dispatcher' +import { RelayDispatcher, type RelayClientSessionIdentity } from '../wsl-guest/dispatcher' import { boundedPtyRecoveryEnd } from './relay-pty-source-activation' -import { encodeJsonRpcFrame, MessageType } from './protocol' +import { encodeJsonRpcFrame, MessageType } from '../wsl-guest/protocol' import { RelayPtySourcePublication } from './relay-pty-source-publication' import { SshPtyConsumerSessionAdapter } from './ssh-pty-consumer-session-adapter' diff --git a/src/relay/relay-pty-source-restore-retry.test.ts b/src/relay/relay-pty-source-restore-retry.test.ts index 0eaf29d61c0..c22cba9e350 100644 --- a/src/relay/relay-pty-source-restore-retry.test.ts +++ b/src/relay/relay-pty-source-restore-retry.test.ts @@ -3,8 +3,8 @@ import { RelayDispatcher, type RelayClientSessionIdentity, type SinkWriteSettlement -} from './dispatcher' -import { encodeJsonRpcFrame, MessageType } from './protocol' +} from '../wsl-guest/dispatcher' +import { encodeJsonRpcFrame, MessageType } from '../wsl-guest/protocol' import { RelayPtySourcePublication } from './relay-pty-source-publication' import { SshPtyConsumerSessionAdapter } from './ssh-pty-consumer-session-adapter' diff --git a/src/relay/relay-pty-source-send-scheduler.test.ts b/src/relay/relay-pty-source-send-scheduler.test.ts index 7c130be7045..c57f34a11d9 100644 --- a/src/relay/relay-pty-source-send-scheduler.test.ts +++ b/src/relay/relay-pty-source-send-scheduler.test.ts @@ -3,7 +3,7 @@ import type { PtySourceDeliveryIdentity, PtySourceDeliverySnapshot } from '../shared/pty-source-credit-contract' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { RelayPtySourceSendScheduler, type RelayPtySourceDeliveryRecord, diff --git a/src/relay/relay-pty-source-send-scheduler.ts b/src/relay/relay-pty-source-send-scheduler.ts index bbec1a824d3..b687a729127 100644 --- a/src/relay/relay-pty-source-send-scheduler.ts +++ b/src/relay/relay-pty-source-send-scheduler.ts @@ -4,7 +4,7 @@ import type { } from '../shared/pty-source-credit-contract' import type { PtySourceRecoveryCheckpoint } from '../shared/pty-source-recovery-contract' import type { PtySourceReceivingActivation } from '../shared/pty-source-receiving-activation' -import type { RelayDispatcher, SinkWriteSettlement } from './dispatcher' +import type { RelayDispatcher, SinkWriteSettlement } from '../wsl-guest/dispatcher' import { PTY_SOURCE_SCHEDULER_MAX_FRAMES, PTY_SOURCE_SCHEDULER_MAX_SU diff --git a/src/relay/relay-pty-source-superseded-activation.test.ts b/src/relay/relay-pty-source-superseded-activation.test.ts index 759bbbef1f5..c2bc99ad850 100644 --- a/src/relay/relay-pty-source-superseded-activation.test.ts +++ b/src/relay/relay-pty-source-superseded-activation.test.ts @@ -4,8 +4,8 @@ import { type RelayClientSessionIdentity, type RequestContext, type SinkWriteSettlement -} from './dispatcher' -import { encodeJsonRpcFrame, MessageType } from './protocol' +} from '../wsl-guest/dispatcher' +import { encodeJsonRpcFrame, MessageType } from '../wsl-guest/protocol' import { RelayPtySourcePublication } from './relay-pty-source-publication' import { SshPtyConsumerSessionAdapter } from './ssh-pty-consumer-session-adapter' diff --git a/src/relay/relay-reconnect-listener-credential-gate.test.ts b/src/relay/relay-reconnect-listener-credential-gate.test.ts index d9794b9511a..4edb91a6ea5 100644 --- a/src/relay/relay-reconnect-listener-credential-gate.test.ts +++ b/src/relay/relay-reconnect-listener-credential-gate.test.ts @@ -11,8 +11,8 @@ import { FrameDecoder, parseHandshakeMessage, RELAY_VERSION -} from './protocol' -import type { RelayDispatcher } from './dispatcher' +} from '../wsl-guest/protocol' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' const noopCallbacks = { detachPrimaryInput: () => {}, diff --git a/src/relay/relay-reconnect-listener-peer-end.test.ts b/src/relay/relay-reconnect-listener-peer-end.test.ts index f1dddda344a..b1069898279 100644 --- a/src/relay/relay-reconnect-listener-peer-end.test.ts +++ b/src/relay/relay-reconnect-listener-peer-end.test.ts @@ -6,8 +6,8 @@ import { tmpdir } from 'node:os' import * as path from 'node:path' import { RelayReconnectListener } from './relay-reconnect-listener' import { RelaySocketOwnership } from './relay-socket-ownership' -import { encodeHandshakeFrame, FrameDecoder, RELAY_VERSION } from './protocol' -import { RelayDispatcher } from './dispatcher' +import { encodeHandshakeFrame, FrameDecoder, RELAY_VERSION } from '../wsl-guest/protocol' +import { RelayDispatcher } from '../wsl-guest/dispatcher' import type { PtyConsumerCloseCause } from '../shared/pty-consumer-session-contract' describe.skipIf(process.platform === 'win32')('reconnect listener peer end', () => { diff --git a/src/relay/relay-reconnect-listener-peer-write-error.test.ts b/src/relay/relay-reconnect-listener-peer-write-error.test.ts index cd411f03b7e..dd443c9aecf 100644 --- a/src/relay/relay-reconnect-listener-peer-write-error.test.ts +++ b/src/relay/relay-reconnect-listener-peer-write-error.test.ts @@ -6,8 +6,8 @@ import { tmpdir } from 'node:os' import * as path from 'node:path' import { RelayReconnectListener } from './relay-reconnect-listener' import { RelaySocketOwnership } from './relay-socket-ownership' -import { encodeHandshakeFrame, FrameDecoder, RELAY_VERSION } from './protocol' -import { RelayDispatcher } from './dispatcher' +import { encodeHandshakeFrame, FrameDecoder, RELAY_VERSION } from '../wsl-guest/protocol' +import { RelayDispatcher } from '../wsl-guest/dispatcher' import type { PtyConsumerCloseCause } from '../shared/pty-consumer-session-contract' // Why: on Windows named pipes a relay write can fail with EPIPE/ECONNRESET before EOF is read. The diff --git a/src/relay/relay-reconnect-listener.ts b/src/relay/relay-reconnect-listener.ts index 9d7ebb675d3..984ff327264 100644 --- a/src/relay/relay-reconnect-listener.ts +++ b/src/relay/relay-reconnect-listener.ts @@ -1,5 +1,5 @@ import type { Socket } from 'node:net' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { setupDaemonHandshake } from './relay-handshake' import { relayLogLine } from './relay-diagnostic-log' import type { RelaySocketOwnership } from './relay-socket-ownership' diff --git a/src/relay/relay-runtime-services.ts b/src/relay/relay-runtime-services.ts index e19e2e20973..e7306c1a3ca 100644 --- a/src/relay/relay-runtime-services.ts +++ b/src/relay/relay-runtime-services.ts @@ -5,13 +5,13 @@ import { parseUnameToRelayPlatform, RELAY_REMOTE_DIR } from '../main/ssh/relay-p import { DEFAULT_AI_VAULT_SEARCH_SETTINGS } from '../shared/ai-vault-search-settings' import { LOCAL_EXECUTION_HOST_ID } from '../shared/execution-host' import { installInProcessSessionSearchService } from '../main/ai-vault-search/session-search-in-process-service' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { RelayContext, expandTilde } from './context' import { PtyHandler } from './pty-handler' import { FsHandler } from './fs-handler' import { GitHandler } from './git-handler' import { GitResponseStreamRegistry } from './git-response-stream' -import { PreflightHandler } from './preflight-handler' +import { PreflightHandler } from '../wsl-guest/preflight-handler' import { ExternalAutomationsHandler } from './external-automations-handler' import { PortScanHandler } from './port-scan-handler' import { AgentExecHandler } from './agent-exec-handler' diff --git a/src/relay/relay-stream-ack-window.ts b/src/relay/relay-stream-ack-window.ts index de4b1aecda4..7d1f11b7807 100644 --- a/src/relay/relay-stream-ack-window.ts +++ b/src/relay/relay-stream-ack-window.ts @@ -1,4 +1,4 @@ -import { STREAM_ACK_STALL_RECHECK_MS } from './protocol' +import { STREAM_ACK_STALL_RECHECK_MS } from '../wsl-guest/protocol' /** Waiters wake on ack, abort, or a stall recheck so a vanished client cannot strand a pump. */ export class RelayStreamAckWindow { diff --git a/src/relay/relay-watch-root-capacity.test.ts b/src/relay/relay-watch-root-capacity.test.ts index 9e2d5d862a8..8bf03b9ff6b 100644 --- a/src/relay/relay-watch-root-capacity.test.ts +++ b/src/relay/relay-watch-root-capacity.test.ts @@ -4,7 +4,7 @@ import * as path from 'node:path' import { mkdtempSync } from 'node:fs' import { tmpdir } from 'node:os' import { RelayContext } from './context' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { FsHandler } from './fs-handler' import { subscribeWithInProcessWatcher } from '../main/ipc/parcel-watcher-in-process-fallback' import { createMockDispatcher } from './relay-fs-test-dispatcher' diff --git a/src/relay/relay-watcher-event-emitter.test.ts b/src/relay/relay-watcher-event-emitter.test.ts index 82b10e2fdf3..ebddbc26260 100644 --- a/src/relay/relay-watcher-event-emitter.test.ts +++ b/src/relay/relay-watcher-event-emitter.test.ts @@ -1,14 +1,14 @@ import { describe, expect, it, vi } from 'vitest' import type { WatcherProcessEvent } from '../main/ipc/parcel-watcher-process-protocol' -import { RelayDispatcher } from './dispatcher' +import { RelayDispatcher } from '../wsl-guest/dispatcher' import { DISPATCHER_CONTROL_QUEUE_MAX_BYTES, DEFAULT_PRODUCER_QUEUE_MAX_BYTES, DISPATCHER_CONTROL_QUEUE_MAX_FRAMES -} from './dispatcher-writer-admission' -import type { RelayClientSinkOptions, RelayClientWrite } from './dispatcher-writer-sink' -import { LEGACY_CLIENT_RETAINED_BYTES_LOW } from './legacy-relay-publication-ledger' -import { HEADER_LENGTH, parseJsonRpcMessage } from './protocol' +} from '../wsl-guest/dispatcher-writer-admission' +import type { RelayClientSinkOptions, RelayClientWrite } from '../wsl-guest/dispatcher-writer-sink' +import { LEGACY_CLIENT_RETAINED_BYTES_LOW } from '../wsl-guest/legacy-relay-publication-ledger' +import { HEADER_LENGTH, parseJsonRpcMessage } from '../wsl-guest/protocol' import { emitRelayWatcherEvents, emitRelayWatcherOverflow } from './relay-watcher-event-emitter' type WatcherFrameEvent = { kind: string; absolutePath: string; isDirectory?: boolean } diff --git a/src/relay/relay-watcher-event-emitter.ts b/src/relay/relay-watcher-event-emitter.ts index 4baf89535bb..828fd836492 100644 --- a/src/relay/relay-watcher-event-emitter.ts +++ b/src/relay/relay-watcher-event-emitter.ts @@ -1,6 +1,6 @@ import type { WatcherProcessEvent } from '../main/ipc/parcel-watcher-process' import { resolveRuntimePath } from '../shared/cross-platform-path' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { createRelayClientResyncMarkerPublisher, type RelayClientResyncMarkerPublisher diff --git a/src/relay/relay-watcher-frame-chunking.test.ts b/src/relay/relay-watcher-frame-chunking.test.ts index 8b9782972c8..058ca631c75 100644 --- a/src/relay/relay-watcher-frame-chunking.test.ts +++ b/src/relay/relay-watcher-frame-chunking.test.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import { RelayDispatcher, type RelayClientSinkOptions } from './dispatcher' -import { HEADER_LENGTH, encodeJsonRpcFrame, parseJsonRpcMessage } from './protocol' +import { RelayDispatcher, type RelayClientSinkOptions } from '../wsl-guest/dispatcher' +import { HEADER_LENGTH, encodeJsonRpcFrame, parseJsonRpcMessage } from '../wsl-guest/protocol' import type { WatcherProcessEvent } from '../main/ipc/parcel-watcher-process' import { emitRelayWatcherEvents } from './relay-watcher-event-emitter' diff --git a/src/relay/relay-watcher-parent-removal.test.ts b/src/relay/relay-watcher-parent-removal.test.ts index 972513cbc59..e1e36acdb31 100644 --- a/src/relay/relay-watcher-parent-removal.test.ts +++ b/src/relay/relay-watcher-parent-removal.test.ts @@ -3,7 +3,7 @@ import type { WatcherProcessHooks, WatcherProcessSubscription } from '../main/ipc/parcel-watcher-process-subscription' -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import { RelayFilesystemWatchRegistry } from './relay-filesystem-watch-registry' class ParentRemovalPool { diff --git a/src/relay/relay-watcher-pending-setup-waiters.test.ts b/src/relay/relay-watcher-pending-setup-waiters.test.ts index 99ddc6a412d..85a1dbfcd7b 100644 --- a/src/relay/relay-watcher-pending-setup-waiters.test.ts +++ b/src/relay/relay-watcher-pending-setup-waiters.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from 'vitest' import type { WatcherProcessSubscription } from '../main/ipc/parcel-watcher-process-subscription' import type { PromiseSettlementWaiters } from '../shared/promise-settlement-waiters' -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import { RelayFilesystemWatchRegistry } from './relay-filesystem-watch-registry' class PendingSetupPool { diff --git a/src/relay/relay-watcher-removal-fence.ts b/src/relay/relay-watcher-removal-fence.ts index 9b0b62ab780..28859c256ef 100644 --- a/src/relay/relay-watcher-removal-fence.ts +++ b/src/relay/relay-watcher-removal-fence.ts @@ -2,7 +2,7 @@ import type { RelayWatcherTeardownState, RelayWatcherTeardownTracker } from './relay-watcher-teardown-tracker' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { emitRelayWatcherTerminalFailure } from './relay-watcher-terminal-notifier' import { isPathInsideOrEqual } from '../shared/cross-platform-path' import type { RelayWatcherPendingSetup } from './relay-watcher-setup-tracking' diff --git a/src/relay/relay-watcher-setup-wait.ts b/src/relay/relay-watcher-setup-wait.ts index 8502b228cbe..95cc65b38b0 100644 --- a/src/relay/relay-watcher-setup-wait.ts +++ b/src/relay/relay-watcher-setup-wait.ts @@ -1,6 +1,6 @@ import { isWatcherProcessFailure } from '../main/ipc/parcel-watcher-process-failure' import type { PromiseSettlementWaiters } from '../shared/promise-settlement-waiters' -import type { RequestContext } from './dispatcher' +import type { RequestContext } from '../wsl-guest/dispatcher' import type { RelayWatcherTeardownState } from './relay-watcher-teardown-tracker' import { errorMessage } from '../shared/error-message' diff --git a/src/relay/relay-watcher-shared-byte-index.test.ts b/src/relay/relay-watcher-shared-byte-index.test.ts index 418bcc9d7b5..41ed16aaff8 100644 --- a/src/relay/relay-watcher-shared-byte-index.test.ts +++ b/src/relay/relay-watcher-shared-byte-index.test.ts @@ -1,8 +1,8 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import type { WatcherProcessEvent } from '../main/ipc/parcel-watcher-process-protocol' -import { RelayDispatcher } from './dispatcher' -import type { RelayClientSinkOptions, RelayClientWrite } from './dispatcher-writer-sink' -import { encodeJsonRpcFrame } from './protocol' +import { RelayDispatcher } from '../wsl-guest/dispatcher' +import type { RelayClientSinkOptions, RelayClientWrite } from '../wsl-guest/dispatcher-writer-sink' +import { encodeJsonRpcFrame } from '../wsl-guest/protocol' import { emitRelayWatcherEvents } from './relay-watcher-event-emitter' type WatcherPayload = { kind: string; absolutePath: string; isDirectory?: boolean } diff --git a/src/relay/relay-watcher-shutdown.test.ts b/src/relay/relay-watcher-shutdown.test.ts index 530b029fa73..9d92b36d456 100644 --- a/src/relay/relay-watcher-shutdown.test.ts +++ b/src/relay/relay-watcher-shutdown.test.ts @@ -1,7 +1,7 @@ import { expect, it, vi } from 'vitest' import { join } from 'node:path' import { tmpdir } from 'node:os' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { RelayFilesystemWatchRegistry } from './relay-filesystem-watch-registry' function fixture() { diff --git a/src/relay/relay-watcher-terminal-notifier.ts b/src/relay/relay-watcher-terminal-notifier.ts index add044f4460..f5ef6b86f42 100644 --- a/src/relay/relay-watcher-terminal-notifier.ts +++ b/src/relay/relay-watcher-terminal-notifier.ts @@ -1,4 +1,4 @@ -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' type RelayTerminalWatchOwners = { rootPath: string diff --git a/src/relay/relay-windows-path-ripgrep.test.ts b/src/relay/relay-windows-path-ripgrep.test.ts index aa8601fdab5..f27c14200a9 100644 --- a/src/relay/relay-windows-path-ripgrep.test.ts +++ b/src/relay/relay-windows-path-ripgrep.test.ts @@ -10,7 +10,9 @@ import { } from './relay-bundled-ripgrep' // These tests isolate PATH safety; effective-environment coverage lives in the cache suite. -vi.mock('./relay-command-env', () => ({ buildRelayCommandEnv: () => ({ ...process.env }) })) +vi.mock('../wsl-guest/relay-command-env', () => ({ + buildRelayCommandEnv: () => ({ ...process.env }) +})) const originalPlatform = process.platform const originalPath = process.env.PATH diff --git a/src/relay/remote-artifact-cli-forwarding.ts b/src/relay/remote-artifact-cli-forwarding.ts index d08efdb2c22..f82ae8adb82 100644 --- a/src/relay/remote-artifact-cli-forwarding.ts +++ b/src/relay/remote-artifact-cli-forwarding.ts @@ -1,6 +1,6 @@ import type { RemoteArtifactInput } from '../shared/artifact-cli-bridge' -import { DISPATCHER_CONTROL_QUEUE_MAX_BYTES } from './dispatcher-writer-admission' -import { encodeJsonRpcFrame } from './protocol' +import { DISPATCHER_CONTROL_QUEUE_MAX_BYTES } from '../wsl-guest/dispatcher-writer-admission' +import { encodeJsonRpcFrame } from '../wsl-guest/protocol' export type RemoteArtifactCliForwardingParams = { argv: string[] diff --git a/src/relay/remote-artifact-cli-input.test.ts b/src/relay/remote-artifact-cli-input.test.ts index 9de3d6a8ab6..3c7cf102468 100644 --- a/src/relay/remote-artifact-cli-input.test.ts +++ b/src/relay/remote-artifact-cli-input.test.ts @@ -4,7 +4,7 @@ import { join } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' import { ARTIFACT_CLI_MAX_RPC_BYTES } from '../shared/artifacts' import { prepareRemoteArtifactCliInput } from './remote-artifact-cli-input' -import { DISPATCHER_CONTROL_QUEUE_MAX_BYTES } from './dispatcher-writer-admission' +import { DISPATCHER_CONTROL_QUEUE_MAX_BYTES } from '../wsl-guest/dispatcher-writer-admission' import { assertRemoteArtifactCliForwardingFits, remoteArtifactCliForwardingFrameBytes, diff --git a/src/relay/remote-artifact-cli-input.ts b/src/relay/remote-artifact-cli-input.ts index 5b5322081db..56d5ad0329c 100644 --- a/src/relay/remote-artifact-cli-input.ts +++ b/src/relay/remote-artifact-cli-input.ts @@ -2,7 +2,7 @@ import { basename, extname, resolve } from 'node:path' import type { RemoteArtifactInput } from '../shared/artifact-cli-bridge' import { ARTIFACT_CLI_MAX_RPC_BYTES } from '../shared/artifacts' import { readArtifactFileWithinLimit } from '../shared/artifact-file-read' -import { MAX_MESSAGE_SIZE } from './protocol' +import { MAX_MESSAGE_SIZE } from '../wsl-guest/protocol' export type PreparedRemoteArtifactCliInput = { stdin?: string diff --git a/src/relay/session-search-transport.test.ts b/src/relay/session-search-transport.test.ts index 4331c1b7821..04be40876ea 100644 --- a/src/relay/session-search-transport.test.ts +++ b/src/relay/session-search-transport.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it } from 'vitest' -import { RelayDispatcher } from './dispatcher' +import { RelayDispatcher } from '../wsl-guest/dispatcher' import { AiVaultHandler } from './ai-vault-handler' import { SshChannelMultiplexer } from '../main/ssh/ssh-channel-multiplexer' import { createSessionSearchClient } from '../shared/ai-vault-search-client' diff --git a/src/relay/skill-install-handler.test.ts b/src/relay/skill-install-handler.test.ts index d2f19b5a38a..3a46506d093 100644 --- a/src/relay/skill-install-handler.test.ts +++ b/src/relay/skill-install-handler.test.ts @@ -3,7 +3,7 @@ import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import type { MethodHandler, RelayDispatcher } from './dispatcher' +import type { MethodHandler, RelayDispatcher } from '../wsl-guest/dispatcher' import { createSkillPackageArchive } from '../main/skills/skill-package-creation' import { createSkillBundleArchive } from '../main/skills/skill-bundle-creation' import { diff --git a/src/relay/skill-install-handler.ts b/src/relay/skill-install-handler.ts index d79d3d689be..91abf85d1c2 100644 --- a/src/relay/skill-install-handler.ts +++ b/src/relay/skill-install-handler.ts @@ -42,8 +42,8 @@ import { getTuiAgentDetectionProbeCommands, resolveDetectedTuiAgentIds } from '../shared/tui-agent-detection-commands' -import type { RelayDispatcher } from './dispatcher' -import { isCommandOnPathForRelay } from './preflight-handler' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' +import { isCommandOnPathForRelay } from '../wsl-guest/preflight-handler' import type { SkillInstallDestinationAuthority } from '../main/skills/skill-install-destinations' import { previewSharedSkillBundleInstall, diff --git a/src/relay/ssh-pty-consumer-session-adapter.test.ts b/src/relay/ssh-pty-consumer-session-adapter.test.ts index 7c38799b876..87b938c4f83 100644 --- a/src/relay/ssh-pty-consumer-session-adapter.test.ts +++ b/src/relay/ssh-pty-consumer-session-adapter.test.ts @@ -5,8 +5,8 @@ import { PTY_CONSUMER_OWNER_HELD_GRACE_FLOOR_MS, PTY_CONSUMER_OWNER_RECOVERY_PENDING_ERROR } from '../shared/pty-consumer-session' -import { RelayDispatcher, type RelayClientSessionIdentity } from './dispatcher' -import { encodeJsonRpcFrame, MessageType } from './protocol' +import { RelayDispatcher, type RelayClientSessionIdentity } from '../wsl-guest/dispatcher' +import { encodeJsonRpcFrame, MessageType } from '../wsl-guest/protocol' import { SshPtyConsumerSessionAdapter } from './ssh-pty-consumer-session-adapter' const endpointIdentity: RelayClientSessionIdentity = { diff --git a/src/relay/ssh-pty-consumer-session-adapter.ts b/src/relay/ssh-pty-consumer-session-adapter.ts index 906edd47ff8..c5d5fedcae0 100644 --- a/src/relay/ssh-pty-consumer-session-adapter.ts +++ b/src/relay/ssh-pty-consumer-session-adapter.ts @@ -11,7 +11,7 @@ import type { PtySourceSpan, PtySourceTransform } from '../shared/pty-source-credit-contract' -import type { RelayDispatcher, RequestContext } from './dispatcher' +import type { RelayDispatcher, RequestContext } from '../wsl-guest/dispatcher' import type { PtySourceSendReservation } from './pty-source-credit-ledger' import { SshPtySourceCreditAdapter } from './ssh-pty-source-credit-adapter' import { diff --git a/src/relay/ssh-pty-open-client-request.ts b/src/relay/ssh-pty-open-client-request.ts index 48d6d255117..f776cc1a99d 100644 --- a/src/relay/ssh-pty-open-client-request.ts +++ b/src/relay/ssh-pty-open-client-request.ts @@ -1,5 +1,5 @@ import type { PtyConsumerSessionHello } from '../shared/pty-consumer-session' -import type { RelayClientSessionIdentity, RequestContext } from './dispatcher' +import type { RelayClientSessionIdentity, RequestContext } from '../wsl-guest/dispatcher' export type OpenClientParams = PtyConsumerSessionHello & { protocolVersion: number diff --git a/src/relay/subprocess-test-utils.ts b/src/relay/subprocess-test-utils.ts index b721f17968f..db0744d53bc 100644 --- a/src/relay/subprocess-test-utils.ts +++ b/src/relay/subprocess-test-utils.ts @@ -8,7 +8,7 @@ import { type JsonRpcRequest, type JsonRpcResponse, type JsonRpcNotification -} from './protocol' +} from '../wsl-guest/protocol' export type RelayProcess = { proc: ChildProcess diff --git a/src/relay/windows-port-scan.test.ts b/src/relay/windows-port-scan.test.ts index c56cb77fb1c..6626bad5c23 100644 --- a/src/relay/windows-port-scan.test.ts +++ b/src/relay/windows-port-scan.test.ts @@ -5,7 +5,7 @@ vi.mock('@orca/process-host', () => ({ runProcess: (spec: unknown) => runProcessMock(spec) })) -vi.mock('./relay-command-env', () => ({ +vi.mock('../wsl-guest/relay-command-env', () => ({ buildRelayCommandEnv: () => ({ PATH: 'C:\\Windows\\System32' }) })) diff --git a/src/relay/windows-port-scan.ts b/src/relay/windows-port-scan.ts index 3822590629b..30e4f572767 100644 --- a/src/relay/windows-port-scan.ts +++ b/src/relay/windows-port-scan.ts @@ -6,7 +6,7 @@ import { } from '@orca/process-host/windows-system-binary' import { getProcessOutputFields } from '../shared/process-output-field-scanner' import type { DetectedPort } from './port-scan-handler' -import { buildRelayCommandEnv } from './relay-command-env' +import { buildRelayCommandEnv } from '../wsl-guest/relay-command-env' import { relayLogLine } from './relay-diagnostic-log' const SYSTEM_PORTS_TO_EXCLUDE = new Set([22]) diff --git a/src/relay/workspace-session-handler.test.ts b/src/relay/workspace-session-handler.test.ts index 7c3917e9c2a..55be98a2f69 100644 --- a/src/relay/workspace-session-handler.test.ts +++ b/src/relay/workspace-session-handler.test.ts @@ -2,9 +2,9 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it } from 'vitest' -import { RelayDispatcher } from './dispatcher' +import { RelayDispatcher } from '../wsl-guest/dispatcher' import { WorkspaceSessionHandler } from './workspace-session-handler' -import { encodeJsonRpcFrame, MessageType, type JsonRpcRequest } from './protocol' +import { encodeJsonRpcFrame, MessageType, type JsonRpcRequest } from '../wsl-guest/protocol' function decodeJsonFrames(written: Buffer[]): unknown[] { return written diff --git a/src/relay/workspace-session-handler.ts b/src/relay/workspace-session-handler.ts index f9b3ef2e507..aa5e4448d59 100644 --- a/src/relay/workspace-session-handler.ts +++ b/src/relay/workspace-session-handler.ts @@ -1,7 +1,7 @@ import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs' import { homedir } from 'node:os' import { dirname, join } from 'node:path' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { publishWorkspaceSnapshotChange } from './workspace-snapshot-publication' type RemoteWorkspaceSnapshot = { diff --git a/src/relay/workspace-snapshot-publication.test.ts b/src/relay/workspace-snapshot-publication.test.ts index 804a13f452b..8f422a2f946 100644 --- a/src/relay/workspace-snapshot-publication.test.ts +++ b/src/relay/workspace-snapshot-publication.test.ts @@ -2,9 +2,9 @@ import { mkdtempSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it } from 'vitest' -import { RelayDispatcher } from './dispatcher' -import { relayWriterControlReserve } from './dispatcher-writer-admission' -import { encodeJsonRpcFrame, MessageType, type JsonRpcRequest } from './protocol' +import { RelayDispatcher } from '../wsl-guest/dispatcher' +import { relayWriterControlReserve } from '../wsl-guest/dispatcher-writer-admission' +import { encodeJsonRpcFrame, MessageType, type JsonRpcRequest } from '../wsl-guest/protocol' import { WorkspaceSessionHandler } from './workspace-session-handler' import { REMOTE_WORKSPACE_CHANGED_NOTIFICATION, diff --git a/src/relay/workspace-snapshot-publication.ts b/src/relay/workspace-snapshot-publication.ts index 3a621cb1172..f951b01141d 100644 --- a/src/relay/workspace-snapshot-publication.ts +++ b/src/relay/workspace-snapshot-publication.ts @@ -2,7 +2,7 @@ import { REMOTE_WORKSPACE_CHANGED_NOTIFICATION, REMOTE_WORKSPACE_STALE_NOTIFICATION } from '../shared/remote-workspace-types' -import type { RelayDispatcher } from './dispatcher' +import type { RelayDispatcher } from '../wsl-guest/dispatcher' import { createRelayClientResyncMarkerPublisher, type RelayClientResyncMarkerPublisher diff --git a/src/relay/workspace-space-scan-du-capacity.test.ts b/src/relay/workspace-space-scan-du-capacity.test.ts index 28e3edfc91f..179fa37cfc5 100644 --- a/src/relay/workspace-space-scan-du-capacity.test.ts +++ b/src/relay/workspace-space-scan-du-capacity.test.ts @@ -4,7 +4,7 @@ import { join } from 'node:path' import type * as NodeProcess from 'node:process' import { afterEach, describe, expect, it, vi } from 'vitest' import type * as WorkspaceSpaceScanBudgetModule from '../shared/workspace-space-scan-budget' -import type { RequestContext } from './dispatcher' +import type { RequestContext } from '../wsl-guest/dispatcher' const { execFileMock, budgetState } = vi.hoisted(() => ({ execFileMock: vi.fn(), diff --git a/src/relay/workspace-space-scan.test.ts b/src/relay/workspace-space-scan.test.ts index b3eee339249..afa01b32973 100644 --- a/src/relay/workspace-space-scan.test.ts +++ b/src/relay/workspace-space-scan.test.ts @@ -4,7 +4,7 @@ import { join } from 'node:path' import type * as NodeProcess from 'node:process' import { afterEach, describe, expect, it, vi } from 'vitest' import type * as WorkspaceSpaceScanBudgetModule from '../shared/workspace-space-scan-budget' -import type { RequestContext } from './dispatcher' +import type { RequestContext } from '../wsl-guest/dispatcher' vi.mock('node:process', async () => { const actual = await vi.importActual('node:process') diff --git a/src/relay/workspace-space-scan.ts b/src/relay/workspace-space-scan.ts index 73a68454833..ef020ab0f04 100644 --- a/src/relay/workspace-space-scan.ts +++ b/src/relay/workspace-space-scan.ts @@ -19,7 +19,7 @@ import { createWorkspaceSpaceScanBudget, WorkspaceSpaceScanCapacityError } from '../shared/workspace-space-scan-budget' -import type { RequestContext } from './dispatcher' +import type { RequestContext } from '../wsl-guest/dispatcher' const RELAY_FS_CONCURRENCY = 48 const DU_TIMEOUT_MS = 120_000 diff --git a/src/shared/agent-hook-relay.ts b/src/shared/agent-hook-relay.ts index 0eac4ec6f6c..9439a91646b 100644 --- a/src/shared/agent-hook-relay.ts +++ b/src/shared/agent-hook-relay.ts @@ -1,11 +1,11 @@ import type { AgentProcessPresence } from './agent-process-presence' // Why: defines the wire shape carried by the JSON-RPC `agent.hook` notification -// the relay sends to Orca. Consumed by `src/relay/agent-hook-server.ts` (which +// the relay sends to Orca. Consumed by `src/wsl-guest/agent-hook-server.ts` (which // produces it after the shared listener parses an HTTP POST) and by // `src/main/agent-hooks/server.ts` (which ingests it via `ingestRemote`). // // Lives in `shared/` because the relay deliberately has no Electron dependency -// (cf. `src/relay/protocol.ts` header). `agent-hook-types.ts` is reserved for +// (cf. `src/wsl-guest/protocol.ts` header). `agent-hook-types.ts` is reserved for // the renderer-bound IPC + installer contract; this module is the wire envelope // between Orca's main process and the remote relay. // @@ -149,7 +149,7 @@ export type AgentHookUnavailableEnvelope = { export const AGENT_HOOK_NOTIFICATION_METHOD = 'agent.hook' as const /** Identifies optional payload fields the relay dropped to fit an oversized frame - * (see `src/relay/agent-hook-envelope-publication.ts`), so `ingestRemote` can tell + * (see `src/wsl-guest/agent-hook-envelope-publication.ts`), so `ingestRemote` can tell * "shed in transit" from "the agent cleared it"; rosters include their digest. */ export const AGENT_HOOK_SHED_FIELDS_KEY = 'shedFields' as const const AGENT_HOOK_SHED_SUBAGENTS_DIGEST_PREFIX = 'subagents:sha256:' diff --git a/src/relay/agent-hook-cached-pane-status.ts b/src/wsl-guest/agent-hook-cached-pane-status.ts similarity index 100% rename from src/relay/agent-hook-cached-pane-status.ts rename to src/wsl-guest/agent-hook-cached-pane-status.ts diff --git a/src/relay/agent-hook-canonical-status.test.ts b/src/wsl-guest/agent-hook-canonical-status.test.ts similarity index 100% rename from src/relay/agent-hook-canonical-status.test.ts rename to src/wsl-guest/agent-hook-canonical-status.test.ts diff --git a/src/relay/agent-hook-canonical-status.ts b/src/wsl-guest/agent-hook-canonical-status.ts similarity index 100% rename from src/relay/agent-hook-canonical-status.ts rename to src/wsl-guest/agent-hook-canonical-status.ts diff --git a/src/relay/agent-hook-endpoint-coordinates.ts b/src/wsl-guest/agent-hook-endpoint-coordinates.ts similarity index 100% rename from src/relay/agent-hook-endpoint-coordinates.ts rename to src/wsl-guest/agent-hook-endpoint-coordinates.ts diff --git a/src/relay/agent-hook-envelope-build.ts b/src/wsl-guest/agent-hook-envelope-build.ts similarity index 100% rename from src/relay/agent-hook-envelope-build.ts rename to src/wsl-guest/agent-hook-envelope-build.ts diff --git a/src/relay/agent-hook-envelope-publication.test.ts b/src/wsl-guest/agent-hook-envelope-publication.test.ts similarity index 100% rename from src/relay/agent-hook-envelope-publication.test.ts rename to src/wsl-guest/agent-hook-envelope-publication.test.ts diff --git a/src/relay/agent-hook-envelope-publication.ts b/src/wsl-guest/agent-hook-envelope-publication.ts similarity index 100% rename from src/relay/agent-hook-envelope-publication.ts rename to src/wsl-guest/agent-hook-envelope-publication.ts diff --git a/src/relay/agent-hook-event-admission.ts b/src/wsl-guest/agent-hook-event-admission.ts similarity index 100% rename from src/relay/agent-hook-event-admission.ts rename to src/wsl-guest/agent-hook-event-admission.ts diff --git a/src/relay/agent-hook-integration.test.ts b/src/wsl-guest/agent-hook-integration.test.ts similarity index 100% rename from src/relay/agent-hook-integration.test.ts rename to src/wsl-guest/agent-hook-integration.test.ts diff --git a/src/relay/agent-hook-interrupt-reconciliation.test.ts b/src/wsl-guest/agent-hook-interrupt-reconciliation.test.ts similarity index 100% rename from src/relay/agent-hook-interrupt-reconciliation.test.ts rename to src/wsl-guest/agent-hook-interrupt-reconciliation.test.ts diff --git a/src/relay/agent-hook-interrupt-reconciliation.ts b/src/wsl-guest/agent-hook-interrupt-reconciliation.ts similarity index 100% rename from src/relay/agent-hook-interrupt-reconciliation.ts rename to src/wsl-guest/agent-hook-interrupt-reconciliation.ts diff --git a/src/relay/agent-hook-opencode-tui-identity.test.ts b/src/wsl-guest/agent-hook-opencode-tui-identity.test.ts similarity index 100% rename from src/relay/agent-hook-opencode-tui-identity.test.ts rename to src/wsl-guest/agent-hook-opencode-tui-identity.test.ts diff --git a/src/relay/agent-hook-request.ts b/src/wsl-guest/agent-hook-request.ts similarity index 100% rename from src/relay/agent-hook-request.ts rename to src/wsl-guest/agent-hook-request.ts diff --git a/src/relay/agent-hook-result-retry-scheduler.ts b/src/wsl-guest/agent-hook-result-retry-scheduler.ts similarity index 100% rename from src/relay/agent-hook-result-retry-scheduler.ts rename to src/wsl-guest/agent-hook-result-retry-scheduler.ts diff --git a/src/relay/agent-hook-server-claude-owed-notification-expiry.test.ts b/src/wsl-guest/agent-hook-server-claude-owed-notification-expiry.test.ts similarity index 100% rename from src/relay/agent-hook-server-claude-owed-notification-expiry.test.ts rename to src/wsl-guest/agent-hook-server-claude-owed-notification-expiry.test.ts diff --git a/src/relay/agent-hook-server-codex-subagent-transcript.test.ts b/src/wsl-guest/agent-hook-server-codex-subagent-transcript.test.ts similarity index 100% rename from src/relay/agent-hook-server-codex-subagent-transcript.test.ts rename to src/wsl-guest/agent-hook-server-codex-subagent-transcript.test.ts diff --git a/src/relay/agent-hook-server-codex-turn-interruption.test.ts b/src/wsl-guest/agent-hook-server-codex-turn-interruption.test.ts similarity index 100% rename from src/relay/agent-hook-server-codex-turn-interruption.test.ts rename to src/wsl-guest/agent-hook-server-codex-turn-interruption.test.ts diff --git a/src/relay/agent-hook-server-contract.ts b/src/wsl-guest/agent-hook-server-contract.ts similarity index 100% rename from src/relay/agent-hook-server-contract.ts rename to src/wsl-guest/agent-hook-server-contract.ts diff --git a/src/relay/agent-hook-server.test.ts b/src/wsl-guest/agent-hook-server.test.ts similarity index 100% rename from src/relay/agent-hook-server.test.ts rename to src/wsl-guest/agent-hook-server.test.ts diff --git a/src/relay/agent-hook-server.ts b/src/wsl-guest/agent-hook-server.ts similarity index 100% rename from src/relay/agent-hook-server.ts rename to src/wsl-guest/agent-hook-server.ts diff --git a/src/relay/agent-hook-spool-ingest.ts b/src/wsl-guest/agent-hook-spool-ingest.ts similarity index 100% rename from src/relay/agent-hook-spool-ingest.ts rename to src/wsl-guest/agent-hook-spool-ingest.ts diff --git a/src/relay/claude-terminal-interrupt-status.ts b/src/wsl-guest/claude-terminal-interrupt-status.ts similarity index 100% rename from src/relay/claude-terminal-interrupt-status.ts rename to src/wsl-guest/claude-terminal-interrupt-status.ts diff --git a/src/relay/client-request-aborts.ts b/src/wsl-guest/client-request-aborts.ts similarity index 100% rename from src/relay/client-request-aborts.ts rename to src/wsl-guest/client-request-aborts.ts diff --git a/src/relay/dispatcher-bulk-admission.test.ts b/src/wsl-guest/dispatcher-bulk-admission.test.ts similarity index 100% rename from src/relay/dispatcher-bulk-admission.test.ts rename to src/wsl-guest/dispatcher-bulk-admission.test.ts diff --git a/src/relay/dispatcher-bulk-failed-admission.test.ts b/src/wsl-guest/dispatcher-bulk-failed-admission.test.ts similarity index 100% rename from src/relay/dispatcher-bulk-failed-admission.test.ts rename to src/wsl-guest/dispatcher-bulk-failed-admission.test.ts diff --git a/src/relay/dispatcher-bulk-retirement-admission.test.ts b/src/wsl-guest/dispatcher-bulk-retirement-admission.test.ts similarity index 100% rename from src/relay/dispatcher-bulk-retirement-admission.test.ts rename to src/wsl-guest/dispatcher-bulk-retirement-admission.test.ts diff --git a/src/relay/dispatcher-bulk-write-test-harness.ts b/src/wsl-guest/dispatcher-bulk-write-test-harness.ts similarity index 100% rename from src/relay/dispatcher-bulk-write-test-harness.ts rename to src/wsl-guest/dispatcher-bulk-write-test-harness.ts diff --git a/src/relay/dispatcher-capacity-degradation.test.ts b/src/wsl-guest/dispatcher-capacity-degradation.test.ts similarity index 100% rename from src/relay/dispatcher-capacity-degradation.test.ts rename to src/wsl-guest/dispatcher-capacity-degradation.test.ts diff --git a/src/relay/dispatcher-capacity-signals.ts b/src/wsl-guest/dispatcher-capacity-signals.ts similarity index 100% rename from src/relay/dispatcher-capacity-signals.ts rename to src/wsl-guest/dispatcher-capacity-signals.ts diff --git a/src/relay/dispatcher-client-close-cause.test.ts b/src/wsl-guest/dispatcher-client-close-cause.test.ts similarity index 100% rename from src/relay/dispatcher-client-close-cause.test.ts rename to src/wsl-guest/dispatcher-client-close-cause.test.ts diff --git a/src/relay/dispatcher-client-lifecycle.ts b/src/wsl-guest/dispatcher-client-lifecycle.ts similarity index 100% rename from src/relay/dispatcher-client-lifecycle.ts rename to src/wsl-guest/dispatcher-client-lifecycle.ts diff --git a/src/relay/dispatcher-client-state.ts b/src/wsl-guest/dispatcher-client-state.ts similarity index 100% rename from src/relay/dispatcher-client-state.ts rename to src/wsl-guest/dispatcher-client-state.ts diff --git a/src/relay/dispatcher-client-writer.test.ts b/src/wsl-guest/dispatcher-client-writer.test.ts similarity index 100% rename from src/relay/dispatcher-client-writer.test.ts rename to src/wsl-guest/dispatcher-client-writer.test.ts diff --git a/src/relay/dispatcher-client-writer.ts b/src/wsl-guest/dispatcher-client-writer.ts similarity index 100% rename from src/relay/dispatcher-client-writer.ts rename to src/wsl-guest/dispatcher-client-writer.ts diff --git a/src/relay/dispatcher-contract.ts b/src/wsl-guest/dispatcher-contract.ts similarity index 100% rename from src/relay/dispatcher-contract.ts rename to src/wsl-guest/dispatcher-contract.ts diff --git a/src/relay/dispatcher-frame-codec.ts b/src/wsl-guest/dispatcher-frame-codec.ts similarity index 100% rename from src/relay/dispatcher-frame-codec.ts rename to src/wsl-guest/dispatcher-frame-codec.ts diff --git a/src/relay/dispatcher-frame-guard-regressions.test.ts b/src/wsl-guest/dispatcher-frame-guard-regressions.test.ts similarity index 100% rename from src/relay/dispatcher-frame-guard-regressions.test.ts rename to src/wsl-guest/dispatcher-frame-guard-regressions.test.ts diff --git a/src/relay/dispatcher-json-payload.test.ts b/src/wsl-guest/dispatcher-json-payload.test.ts similarity index 100% rename from src/relay/dispatcher-json-payload.test.ts rename to src/wsl-guest/dispatcher-json-payload.test.ts diff --git a/src/relay/dispatcher-notification-ownership.test.ts b/src/wsl-guest/dispatcher-notification-ownership.test.ts similarity index 100% rename from src/relay/dispatcher-notification-ownership.test.ts rename to src/wsl-guest/dispatcher-notification-ownership.test.ts diff --git a/src/relay/dispatcher-notification-publication.ts b/src/wsl-guest/dispatcher-notification-publication.ts similarity index 100% rename from src/relay/dispatcher-notification-publication.ts rename to src/wsl-guest/dispatcher-notification-publication.ts diff --git a/src/relay/dispatcher-per-connection-state-baseline.test.ts b/src/wsl-guest/dispatcher-per-connection-state-baseline.test.ts similarity index 100% rename from src/relay/dispatcher-per-connection-state-baseline.test.ts rename to src/wsl-guest/dispatcher-per-connection-state-baseline.test.ts diff --git a/src/relay/dispatcher-producer-capacity.ts b/src/wsl-guest/dispatcher-producer-capacity.ts similarity index 100% rename from src/relay/dispatcher-producer-capacity.ts rename to src/wsl-guest/dispatcher-producer-capacity.ts diff --git a/src/relay/dispatcher-producer-transport.ts b/src/wsl-guest/dispatcher-producer-transport.ts similarity index 100% rename from src/relay/dispatcher-producer-transport.ts rename to src/wsl-guest/dispatcher-producer-transport.ts diff --git a/src/relay/dispatcher-pty-publication.ts b/src/wsl-guest/dispatcher-pty-publication.ts similarity index 100% rename from src/relay/dispatcher-pty-publication.ts rename to src/wsl-guest/dispatcher-pty-publication.ts diff --git a/src/relay/dispatcher-rpc-cancel-id-coercion.test.ts b/src/wsl-guest/dispatcher-rpc-cancel-id-coercion.test.ts similarity index 100% rename from src/relay/dispatcher-rpc-cancel-id-coercion.test.ts rename to src/wsl-guest/dispatcher-rpc-cancel-id-coercion.test.ts diff --git a/src/relay/dispatcher-rpc-routing.ts b/src/wsl-guest/dispatcher-rpc-routing.ts similarity index 100% rename from src/relay/dispatcher-rpc-routing.ts rename to src/wsl-guest/dispatcher-rpc-routing.ts diff --git a/src/relay/dispatcher-silent-client-reaper.test.ts b/src/wsl-guest/dispatcher-silent-client-reaper.test.ts similarity index 100% rename from src/relay/dispatcher-silent-client-reaper.test.ts rename to src/wsl-guest/dispatcher-silent-client-reaper.test.ts diff --git a/src/relay/dispatcher-structured-error.test.ts b/src/wsl-guest/dispatcher-structured-error.test.ts similarity index 100% rename from src/relay/dispatcher-structured-error.test.ts rename to src/wsl-guest/dispatcher-structured-error.test.ts diff --git a/src/relay/dispatcher-timeout.test.ts b/src/wsl-guest/dispatcher-timeout.test.ts similarity index 100% rename from src/relay/dispatcher-timeout.test.ts rename to src/wsl-guest/dispatcher-timeout.test.ts diff --git a/src/relay/dispatcher-writer-admission.test.ts b/src/wsl-guest/dispatcher-writer-admission.test.ts similarity index 100% rename from src/relay/dispatcher-writer-admission.test.ts rename to src/wsl-guest/dispatcher-writer-admission.test.ts diff --git a/src/relay/dispatcher-writer-admission.ts b/src/wsl-guest/dispatcher-writer-admission.ts similarity index 100% rename from src/relay/dispatcher-writer-admission.ts rename to src/wsl-guest/dispatcher-writer-admission.ts diff --git a/src/relay/dispatcher-writer-drain-arm.ts b/src/wsl-guest/dispatcher-writer-drain-arm.ts similarity index 100% rename from src/relay/dispatcher-writer-drain-arm.ts rename to src/wsl-guest/dispatcher-writer-drain-arm.ts diff --git a/src/relay/dispatcher-writer-lane-scheduler.ts b/src/wsl-guest/dispatcher-writer-lane-scheduler.ts similarity index 100% rename from src/relay/dispatcher-writer-lane-scheduler.ts rename to src/wsl-guest/dispatcher-writer-lane-scheduler.ts diff --git a/src/relay/dispatcher-writer-sink.ts b/src/wsl-guest/dispatcher-writer-sink.ts similarity index 100% rename from src/relay/dispatcher-writer-sink.ts rename to src/wsl-guest/dispatcher-writer-sink.ts diff --git a/src/relay/dispatcher.test.ts b/src/wsl-guest/dispatcher.test.ts similarity index 100% rename from src/relay/dispatcher.test.ts rename to src/wsl-guest/dispatcher.test.ts diff --git a/src/relay/dispatcher.ts b/src/wsl-guest/dispatcher.ts similarity index 100% rename from src/relay/dispatcher.ts rename to src/wsl-guest/dispatcher.ts diff --git a/src/relay/filesystem-capacity-error-wire.test.ts b/src/wsl-guest/filesystem-capacity-error-wire.test.ts similarity index 100% rename from src/relay/filesystem-capacity-error-wire.test.ts rename to src/wsl-guest/filesystem-capacity-error-wire.test.ts diff --git a/src/relay/legacy-relay-publication-ledger.test.ts b/src/wsl-guest/legacy-relay-publication-ledger.test.ts similarity index 100% rename from src/relay/legacy-relay-publication-ledger.test.ts rename to src/wsl-guest/legacy-relay-publication-ledger.test.ts diff --git a/src/relay/legacy-relay-publication-ledger.ts b/src/wsl-guest/legacy-relay-publication-ledger.ts similarity index 100% rename from src/relay/legacy-relay-publication-ledger.ts rename to src/wsl-guest/legacy-relay-publication-ledger.ts diff --git a/src/relay/omp-config-root.test.ts b/src/wsl-guest/omp-config-root.test.ts similarity index 100% rename from src/relay/omp-config-root.test.ts rename to src/wsl-guest/omp-config-root.test.ts diff --git a/src/relay/omp-status-extension.ts b/src/wsl-guest/omp-status-extension.ts similarity index 100% rename from src/relay/omp-status-extension.ts rename to src/wsl-guest/omp-status-extension.ts diff --git a/src/relay/opencode-canonical-config.ts b/src/wsl-guest/opencode-canonical-config.ts similarity index 100% rename from src/relay/opencode-canonical-config.ts rename to src/wsl-guest/opencode-canonical-config.ts diff --git a/src/relay/opencode-overlay-mirror.ts b/src/wsl-guest/opencode-overlay-mirror.ts similarity index 100% rename from src/relay/opencode-overlay-mirror.ts rename to src/wsl-guest/opencode-overlay-mirror.ts diff --git a/src/relay/opencode-startup-prompt-install.test.ts b/src/wsl-guest/opencode-startup-prompt-install.test.ts similarity index 100% rename from src/relay/opencode-startup-prompt-install.test.ts rename to src/wsl-guest/opencode-startup-prompt-install.test.ts diff --git a/src/relay/plugin-overlay-env.test.ts b/src/wsl-guest/plugin-overlay-env.test.ts similarity index 100% rename from src/relay/plugin-overlay-env.test.ts rename to src/wsl-guest/plugin-overlay-env.test.ts diff --git a/src/relay/plugin-overlay-env.ts b/src/wsl-guest/plugin-overlay-env.ts similarity index 100% rename from src/relay/plugin-overlay-env.ts rename to src/wsl-guest/plugin-overlay-env.ts diff --git a/src/relay/plugin-overlay.test.ts b/src/wsl-guest/plugin-overlay.test.ts similarity index 100% rename from src/relay/plugin-overlay.test.ts rename to src/wsl-guest/plugin-overlay.test.ts diff --git a/src/relay/plugin-overlay.ts b/src/wsl-guest/plugin-overlay.ts similarity index 100% rename from src/relay/plugin-overlay.ts rename to src/wsl-guest/plugin-overlay.ts diff --git a/src/relay/plugin-source-limit.test.ts b/src/wsl-guest/plugin-source-limit.test.ts similarity index 100% rename from src/relay/plugin-source-limit.test.ts rename to src/wsl-guest/plugin-source-limit.test.ts diff --git a/src/relay/plugin-source-limit.ts b/src/wsl-guest/plugin-source-limit.ts similarity index 100% rename from src/relay/plugin-source-limit.ts rename to src/wsl-guest/plugin-source-limit.ts diff --git a/src/relay/preflight-handler.test.ts b/src/wsl-guest/preflight-handler.test.ts similarity index 100% rename from src/relay/preflight-handler.test.ts rename to src/wsl-guest/preflight-handler.test.ts diff --git a/src/relay/preflight-handler.ts b/src/wsl-guest/preflight-handler.ts similarity index 100% rename from src/relay/preflight-handler.ts rename to src/wsl-guest/preflight-handler.ts diff --git a/src/relay/protocol-backpressure.test.ts b/src/wsl-guest/protocol-backpressure.test.ts similarity index 100% rename from src/relay/protocol-backpressure.test.ts rename to src/wsl-guest/protocol-backpressure.test.ts diff --git a/src/relay/protocol-handshake.test.ts b/src/wsl-guest/protocol-handshake.test.ts similarity index 100% rename from src/relay/protocol-handshake.test.ts rename to src/wsl-guest/protocol-handshake.test.ts diff --git a/src/relay/protocol-json-payload.test.ts b/src/wsl-guest/protocol-json-payload.test.ts similarity index 100% rename from src/relay/protocol-json-payload.test.ts rename to src/wsl-guest/protocol-json-payload.test.ts diff --git a/src/relay/protocol.ts b/src/wsl-guest/protocol.ts similarity index 100% rename from src/relay/protocol.ts rename to src/wsl-guest/protocol.ts diff --git a/src/relay/relay-agent-presence.test.ts b/src/wsl-guest/relay-agent-presence.test.ts similarity index 100% rename from src/relay/relay-agent-presence.test.ts rename to src/wsl-guest/relay-agent-presence.test.ts diff --git a/src/relay/relay-agent-presence.ts b/src/wsl-guest/relay-agent-presence.ts similarity index 100% rename from src/relay/relay-agent-presence.ts rename to src/wsl-guest/relay-agent-presence.ts diff --git a/src/relay/relay-command-env.test.ts b/src/wsl-guest/relay-command-env.test.ts similarity index 100% rename from src/relay/relay-command-env.test.ts rename to src/wsl-guest/relay-command-env.test.ts diff --git a/src/relay/relay-command-env.ts b/src/wsl-guest/relay-command-env.ts similarity index 100% rename from src/relay/relay-command-env.ts rename to src/wsl-guest/relay-command-env.ts diff --git a/src/relay/relay-frame-decoder.ts b/src/wsl-guest/relay-frame-decoder.ts similarity index 100% rename from src/relay/relay-frame-decoder.ts rename to src/wsl-guest/relay-frame-decoder.ts diff --git a/src/relay/relay-hot-path-operation-counts.test.ts b/src/wsl-guest/relay-hot-path-operation-counts.test.ts similarity index 100% rename from src/relay/relay-hot-path-operation-counts.test.ts rename to src/wsl-guest/relay-hot-path-operation-counts.test.ts diff --git a/src/relay/relay-tmux-hook-owner.ts b/src/wsl-guest/relay-tmux-hook-owner.ts similarity index 100% rename from src/relay/relay-tmux-hook-owner.ts rename to src/wsl-guest/relay-tmux-hook-owner.ts diff --git a/src/relay/wsl-agent-hook-relay.test.ts b/src/wsl-guest/wsl-agent-hook-relay.test.ts similarity index 100% rename from src/relay/wsl-agent-hook-relay.test.ts rename to src/wsl-guest/wsl-agent-hook-relay.test.ts diff --git a/src/relay/wsl-agent-hook-relay.ts b/src/wsl-guest/wsl-agent-hook-relay.ts similarity index 100% rename from src/relay/wsl-agent-hook-relay.ts rename to src/wsl-guest/wsl-agent-hook-relay.ts diff --git a/src/relay/wsl-browser-network-relay.ts b/src/wsl-guest/wsl-browser-network-relay.ts similarity index 100% rename from src/relay/wsl-browser-network-relay.ts rename to src/wsl-guest/wsl-browser-network-relay.ts diff --git a/src/relay/wsl-hook-fs-bridge.test.ts b/src/wsl-guest/wsl-hook-fs-bridge.test.ts similarity index 100% rename from src/relay/wsl-hook-fs-bridge.test.ts rename to src/wsl-guest/wsl-hook-fs-bridge.test.ts diff --git a/src/relay/wsl-hook-fs-bridge.ts b/src/wsl-guest/wsl-hook-fs-bridge.ts similarity index 100% rename from src/relay/wsl-hook-fs-bridge.ts rename to src/wsl-guest/wsl-hook-fs-bridge.ts diff --git a/src/relay/wsl-install-plugins-handler.test.ts b/src/wsl-guest/wsl-install-plugins-handler.test.ts similarity index 100% rename from src/relay/wsl-install-plugins-handler.test.ts rename to src/wsl-guest/wsl-install-plugins-handler.test.ts diff --git a/src/relay/wsl-install-plugins-handler.ts b/src/wsl-guest/wsl-install-plugins-handler.ts similarity index 100% rename from src/relay/wsl-install-plugins-handler.ts rename to src/wsl-guest/wsl-install-plugins-handler.ts diff --git a/tests/e2e/cross-version-wire/release-checkout-tree.ts b/tests/e2e/cross-version-wire/release-checkout-tree.ts index bfda5598cdd..f2f046ea9ff 100644 --- a/tests/e2e/cross-version-wire/release-checkout-tree.ts +++ b/tests/e2e/cross-version-wire/release-checkout-tree.ts @@ -25,6 +25,8 @@ const ARCHIVE_PATHS = [ 'src/types', 'mobile/src/worktree/agent-row-display.ts' ] +// Why optional: only releases from the move onward have it, and `git archive` refuses a missing pathspec. +const OPTIONAL_ARCHIVE_PATHS = ['src/wsl-guest'] const WORKSPACE_POLICY = 'pnpm-workspace.yaml' @@ -187,23 +189,32 @@ function workspacePatternRoot(pattern: string): string { return segments.join('/') } +async function listReleasePaths( + repoRoot: string, + commit: string, + paths: string[], + deadline: number +): Promise { + return ( + await runCheckoutProcess( + repoRoot, + 'git', + ['ls-tree', '-z', '--name-only', commit, '--', ...paths], + deadline + ) + ) + .split('\0') + .filter(Boolean) +} + /** The release's workspace policy and declared package directories; none before workspaces. */ async function releaseWorkspaceArchivePaths( repoRoot: string, commit: string, deadline: number ): Promise { - const listed = async (paths: string[]): Promise => - ( - await runCheckoutProcess( - repoRoot, - 'git', - ['ls-tree', '-z', '--name-only', commit, '--', ...paths], - deadline - ) - ) - .split('\0') - .filter(Boolean) + const listed = (paths: string[]): Promise => + listReleasePaths(repoRoot, commit, paths, deadline) if ((await listed([WORKSPACE_POLICY])).length === 0) { return [] } @@ -235,6 +246,7 @@ export async function extractReleaseCheckoutTree( const archive = join(staging, '.release-checkout.tar') const deadline = Date.now() + CHECKOUT_PROCESS_TIMEOUT_MS const workspacePaths = await releaseWorkspaceArchivePaths(repoRoot, commit, deadline) + const optionalPaths = await listReleasePaths(repoRoot, commit, OPTIONAL_ARCHIVE_PATHS, deadline) try { await runCheckoutProcess( repoRoot, @@ -246,6 +258,7 @@ export async function extractReleaseCheckoutTree( commit, '--', ...ARCHIVE_PATHS, + ...optionalPaths, ...workspacePaths ], deadline 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 0d24c093978..e79ea9be8ab 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 @@ -202,5 +202,20 @@ describe('release checkout workspace packages', () => { expect(readFileSync(join(staging, 'src/main/old.ts'), 'utf8')).toBe(source) expect(existsSync(join(staging, 'pnpm-workspace.yaml'))).toBe(false) + expect(existsSync(join(staging, 'src/wsl-guest'))).toBe(false) + }) + + it('extracts the WSL guest sources a release relay imports when the release has them', async () => { + const source = "export { RELAY_SENTINEL } from '../wsl-guest/protocol'\n" + const { repo, commit } = commitRelease({ + 'src/relay/relay.ts': source, + 'src/wsl-guest/protocol.ts': "export const RELAY_SENTINEL = 'sentinel'\n" + }) + const staging = temporaryDirectory('orca-cross-version-release-staging-') + + await extractReleaseCheckoutTree(repo, staging, commit) + + expect(readFileSync(join(staging, 'src/relay/relay.ts'), 'utf8')).toBe(source) + expect(existsSync(join(staging, 'src/wsl-guest/protocol.ts'))).toBe(true) }) }) diff --git a/tests/tools/omp-config-root-relay-shell.test.mjs b/tests/tools/omp-config-root-relay-shell.test.mjs index 423443e98ca..7c9fb8cb7cf 100644 --- a/tests/tools/omp-config-root-relay-shell.test.mjs +++ b/tests/tools/omp-config-root-relay-shell.test.mjs @@ -4,8 +4,8 @@ import { delimiter, join } from 'node:path' import { afterEach, expect, it, vi } from 'vitest' import { runProcess } from '@orca/process-host' import { resetLoginShellEnvironmentCacheForTests } from '../../src/main/startup/login-shell-environment' -import { PluginOverlayManager } from '../../src/relay/plugin-overlay' -import { resolveOmpConfigDirName } from '../../src/relay/plugin-overlay-env' +import { PluginOverlayManager } from '../../src/wsl-guest/plugin-overlay' +import { resolveOmpConfigDirName } from '../../src/wsl-guest/plugin-overlay-env' import { __resetShellStartupEnvCache } from '../../src/main/pty/shell-startup-env' const fixture = { home: '', shell: '' } const shells = ['bash', 'zsh', 'fish'].map((name) => {