From 2c02cf86adb4b126bd31f62bba6ef7e41d4528a9 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 18 Oct 2026 06:51:09 -0700 Subject: [PATCH] refactor(ssh): group system-ssh transport, ssh config and remote exec into ssh/{system-transport,config,remote-exec}/ git mv plus import, vi.mock and path-literal rewrites; one e2e route regex follows the moved dynamic-forward process. --- .../process-host-direct-import-baseline.txt | 10 ++-- config/reliability-gates.jsonc | 14 ++--- config/scripts/ci-shard-timings.json | 54 +++++++++---------- .../scripts/pr-e2e-route-contracts.test.mjs | 2 +- config/scripts/pr-e2e-source-routing.mjs | 2 +- .../active-view-persistence-boundary.test.ts | 2 +- .../wsl-hook-relay-sentinel.test.ts | 2 +- .../agent-hooks/wsl-hook-relay-sentinel.ts | 2 +- .../automation-worker-durability.test.ts | 2 +- .../ssh-browser-network-execution-route.ts | 2 +- .../github-enterprise-repository.test.ts | 2 +- ...repository-identity.ssh-host-alias.test.ts | 2 +- .../github-ssh-host-alias-resolution.ts | 2 +- .../orca-profiles-switch-persistence.test.ts | 2 +- .../pty/pane/pane-owner-replacement.test.ts | 2 +- ...-shutdown-checkpoint-sleep-records.test.ts | 2 +- src/main/ipc/session-window-view-save.test.ts | 2 +- .../ipc/settings-delayed-response.test.ts | 2 +- src/main/ipc/shell.ts | 2 +- src/main/ipc/ssh-app-shutdown.test.ts | 2 +- .../ssh-connect-decision-cancellation.test.ts | 2 +- src/main/ipc/ssh-credential-cancel.test.ts | 2 +- .../ipc/ssh-disconnect-cancellation.test.ts | 2 +- .../ipc/ssh-handler-reregistration.test.ts | 2 +- src/main/ipc/ssh-host-user-disconnect.test.ts | 2 +- src/main/ipc/ssh-sign-in-requirement.test.ts | 2 +- .../ipc/ssh-state-broadcast-fanout.test.ts | 2 +- src/main/ipc/ssh-target-crud-handlers.ts | 2 +- src/main/ipc/ssh-target-registry.test.ts | 2 +- src/main/ipc/ssh.test.ts | 2 +- .../orcad-activation-crash-recovery.test.ts | 6 +-- .../orcad-activation-fence-generation.test.ts | 6 +-- .../orcad-activation-fence-scope.ts | 2 +- .../orcad-activation-host-test-harness.ts | 2 +- .../activation/orcad-activation-lock.ts | 2 +- .../orcad-activation-record-store.ts | 2 +- .../orcad-activation-transaction.test.ts | 6 +-- .../orcad-activation-transaction.ts | 2 +- .../host-state/orcad-machine-claim-command.ts | 2 +- .../host-state/orcad-machine-home.test.ts | 6 +-- .../host-state/orcad-machine-home.ts | 2 +- .../orcad-state-mutation-exec.test.ts | 2 +- .../host-state/orcad-state-mutation-exec.ts | 5 +- .../orcad-state-mutation-timeout.test.ts | 6 +-- .../install/orcad-remote-context.ts | 2 +- .../install/orcad-remote-decommission.test.ts | 6 +-- .../install/orcad-remote-gc.test.ts | 6 +-- .../managed-server/install/orcad-remote-gc.ts | 7 ++- .../orcad-remote-install-termination.test.ts | 6 +-- .../install/orcad-remote-install.ts | 5 +- .../install/orcad-remote-launch.ts | 2 +- .../orcad-remote-lifecycle-windows.test.ts | 6 +-- .../install/orcad-remote-log-tail.test.ts | 4 +- .../install/orcad-remote-log-tail.ts | 2 +- ...remote-node-runtime-promotion-lock.test.ts | 6 +-- ...remote-node-runtime-recorded-probe.test.ts | 6 +-- ...rcad-remote-node-runtime-slow-hash.test.ts | 6 +-- .../orcad-remote-node-runtime-windows.test.ts | 6 +-- .../install/orcad-remote-node-runtime.ts | 5 +- .../install/orcad-remote-preflight.ts | 2 +- .../install/orcad-remote-primitives.test.ts | 6 +-- .../install/orcad-remote-record-file.ts | 2 +- .../install/orcad-remote-rollback.test.ts | 6 +-- .../orcad-remote-runtime-control.test.ts | 6 +-- .../install/orcad-remote-runtime-control.ts | 5 +- .../orcad-remote-windows-commands.test.ts | 6 +-- .../orcad-remote-windows-decommission.test.ts | 6 +-- .../install/orcad-remote-windows-node.ts | 7 ++- ...emote-install-gc-claim-termination.test.ts | 6 +-- .../install/remote-install-gc-claim.ts | 4 +- .../remote-install-gc-listing.test-fixture.ts | 2 +- .../remote-install-gc-termination.test.ts | 6 +-- .../install/remote-install-gc-tombstone.ts | 5 +- .../install/remote-install-gc.ts | 6 +-- .../remote-install-lock-termination.test.ts | 6 +-- .../install/remote-install-lock.test.ts | 6 +-- .../install/remote-install-lock.ts | 4 +- .../install/remote-install-transfers.ts | 2 +- .../remote-node-runtime-store-gc.test.ts | 6 +-- .../install/remote-node-runtime-store-gc.ts | 5 +- .../remote-node-runtime-store-inventory.ts | 2 +- ...de-runtime-store-lock-host-release.test.ts | 6 +-- .../install/remote-node-runtime-store-lock.ts | 6 +-- .../remote-node-runtime-store-windows.test.ts | 6 +-- .../remote-node-runtime-store-windows.ts | 2 +- ...mote-versioned-install-termination.test.ts | 6 +-- .../install/remote-versioned-install.test.ts | 9 ++-- .../install/remote-versioned-install.ts | 6 +-- .../lifecycle/orcad-decommission-stop.ts | 2 +- .../lifecycle/orcad-managed-remote-stop.ts | 2 +- .../orcad-managed-tunnel-bridge-port.test.ts | 4 +- .../orcad-managed-tunnel-transport.ts | 2 +- .../lifecycle/orcad-managed-wake.test.ts | 6 +-- .../lifecycle/orcad-rollback-transition.ts | 2 +- .../lifecycle/orcad-runtime-target.test.ts | 6 +-- .../lifecycle/orcad-stdio-bridge-script.ts | 2 +- .../profile-active-transfer-worker.test.ts | 2 +- .../profile-active-transfer.test.ts | 2 +- ...untime-daemon-adoption.integration.test.ts | 6 +-- .../persistence-async-write-syscalls.test.ts | 2 +- ...stence-automation-extra-agent-args.test.ts | 2 +- src/main/persistence-automations.test.ts | 2 +- ...ence-clipboard-selection-migration.test.ts | 2 +- ...ence-cohort-and-identity-migration.test.ts | 2 +- ...sistence-deregistered-repo-residue.test.ts | 2 +- ...ersistence-floating-terminal-trust.test.ts | 2 +- ...sistence-flush-and-save-scheduling.test.ts | 2 +- ...istence-folder-scan-project-groups.test.ts | 2 +- ...persistence-folder-workspace-notes.test.ts | 2 +- ...sistence-host-partitioned-sessions.test.ts | 2 +- src/main/persistence-initial-load.test.ts | 2 +- ...nce-invalid-workspace-layout-purge.test.ts | 2 +- ...ersistence-layout-binding-recovery.test.ts | 2 +- ...persistence-load-repair-durability.test.ts | 2 +- ...rsistence-loading-store-extraction.test.ts | 2 +- ...sistence-loading-store-write-risks.test.ts | 2 +- ...sistence-native-chat-tab-view-mode.test.ts | 2 +- ...ersistence-pane-identity-migration.test.ts | 2 +- ...tence-protected-secret-fail-closed.test.ts | 2 +- ...stence-protected-secret-write-race.test.ts | 2 +- .../persistence-proxy-secret-recovery.test.ts | 2 +- ...istence-pty-binding-reconciliation.test.ts | 2 +- ...persistence-remote-session-startup.test.ts | 2 +- src/main/persistence-repo-lifecycle.test.ts | 2 +- .../persistence-settings-ui-defaults.test.ts | 2 +- src/main/persistence-settings-update.test.ts | 2 +- src/main/persistence-single-serialize.test.ts | 2 +- ...stence-source-control-ai-migration.test.ts | 2 +- ...persistence-split-pane-incarnation.test.ts | 2 +- ...e-ssh-remote-cli-control-migration.test.ts | 2 +- ...ence-ssh-remote-pty-binding-replay.test.ts | 2 +- .../persistence-ssh-remote-pty-leases.test.ts | 2 +- ...sistence-ssh-targets-and-pane-keys.test.ts | 2 +- ...ence-terminal-option-key-migration.test.ts | 2 +- src/main/persistence-ui-state.test.ts | 2 +- src/main/persistence-update-repo.test.ts | 2 +- ...tence-workspace-session-scrollback.test.ts | 2 +- ...sistence-workspace-status-workflow.test.ts | 2 +- ...rsistence-worktree-card-properties.test.ts | 2 +- ...sistence-worktree-deletion-fencing.test.ts | 2 +- ...tence-worktree-lineage-and-backups.test.ts | 2 +- ...orktree-meta-and-folder-workspaces.test.ts | 2 +- .../persistence-worktree-visibility.test.ts | 2 +- .../profile-state-checkpoints.test.ts | 2 +- .../profile-state-direct-flush.test.ts | 2 +- .../profile-state-durable-writes.test.ts | 2 +- .../profile-state-import-lifetime.test.ts | 2 +- ...le-state-maintenance-compatibility.test.ts | 2 +- ...rofile-state-maintenance-contracts.test.ts | 2 +- .../profile-state-settings-writes.test.ts | 2 +- .../profile-state-sqlite-authority.test.ts | 2 +- .../profile-state-store-backups.test.ts | 2 +- ...rofile-state-temp-cleanup-lifetime.test.ts | 2 +- .../profile-state-update-quit.test.ts | 2 +- .../pty-binding-placement-inertness.test.ts | 2 +- .../pty-reattach-failure-routing.test.ts | 2 +- ...retirement-publication-during-read.test.ts | 2 +- .../pty-spawn-exit-durability.test.ts | 2 +- .../pty-spawn-handle-publication.test.ts | 2 +- .../pty-spawn-replacement-durability.test.ts | 2 +- .../pty-spawn-restore-durability.test.ts | 2 +- .../terminal-close-async-durability.test.ts | 2 +- .../profile-state-cutover-fixture.test.ts | 2 +- .../profile-state-authority-bootstrap.test.ts | 2 +- .../profile-state-authority-marker.test.ts | 2 +- ...e-state-bootstrap-publication-race.test.ts | 2 +- ...ile-state-database-rollback-export.test.ts | 2 +- .../profile-state-fragment-validation.test.ts | 2 +- ...-state-json-compatibility-recovery.test.ts | 2 +- .../profile-state-live-store-factory.test.ts | 2 +- ...le-state-recovery-crash-boundaries.test.ts | 2 +- .../profile-state-startup-authority.test.ts | 2 +- .../profile-state-startup-secrets.test.ts | 2 +- .../profile-state-startup-snapshot.test.ts | 2 +- .../profile-state-store-factory.test.ts | 2 +- .../profile-state-worker-authority.test.ts | 2 +- .../duplicate-pty-pane-repair.test.ts | 2 +- .../editor-tab-layout-apply.test.ts | 2 +- .../open-in-new-group-layout-apply.test.ts | 2 +- .../terminal-late-bind-layout-rules.test.ts | 2 +- .../terminal-layout-apply.test.ts | 2 +- .../terminal-layout-create.test.ts | 2 +- ...rminal-layout-default-tabs-applied.test.ts | 2 +- .../terminal-layout-pane-ops.test.ts | 2 +- .../terminal-layout-sleep-wake.test.ts | 2 +- .../terminal-owner-report-only.test.ts | 2 +- ...rminal-pane-admission-layout-owner.test.ts | 2 +- .../terminal-sleep-quit-resume.test.ts | 2 +- .../terminal-stale-pane-tree-client.test.ts | 2 +- .../terminal-topology-model.test.ts | 2 +- .../quit-path-durable-write-blocking.test.ts | 2 +- ...remote-layout-snapshot-persistence.test.ts | 2 +- ...t-agent-launch-settings-durability.test.ts | 2 +- ...headless-browser-group-persistence.test.ts | 2 +- .../ssh-config-alias-claim.test.ts | 0 .../{ => config}/ssh-config-alias-claim.ts | 2 +- .../ssh-config-host-picker.test.ts | 2 +- .../{ => config}/ssh-config-host-picker.ts | 6 +-- .../ssh-config-include-expander.ts | 0 .../ssh-config-loader-regression.test.ts | 0 .../{ => config}/ssh-config-loader.test.ts | 0 .../ssh-config-parser-host-patterns.test.ts | 0 .../{ => config}/ssh-config-parser.test.ts | 0 .../ssh/{ => config}/ssh-config-parser.ts | 2 +- .../{ => config}/ssh-config-path-expansion.ts | 0 .../{ => config}/ssh-config-resolver.test.ts | 0 .../ssh-g-config-resolution.test.ts | 0 .../{ => config}/ssh-g-config-resolution.ts | 0 .../ssh-known-hosts-source.test.ts | 0 .../{ => config}/ssh-known-hosts-source.ts | 0 .../ssh/{ => config}/ssh-known-hosts.test.ts | 0 src/main/ssh/{ => config}/ssh-known-hosts.ts | 0 .../{ => config}/vscode-ssh-authority.test.ts | 2 +- .../ssh/{ => config}/vscode-ssh-authority.ts | 4 +- .../legacy-relay-endpoints.test.ts | 4 +- .../legacy-relay/legacy-relay-endpoints.ts | 4 +- .../ssh-host-relay-endpoint-census.test.ts | 4 +- .../ssh-host-relay-endpoint-census.ts | 4 +- .../ssh-host-relay-terminals-on-connect.ts | 2 +- .../ssh-host-relay-windows-census.test.ts | 4 +- .../ssh-host-relay-windows-census.ts | 4 +- .../ssh-host-relay-windows-inventory.ts | 2 +- .../ssh-relay-endpoint-incumbent.test.ts | 4 +- .../ssh-relay-endpoint-incumbent.ts | 2 +- .../ssh-relay-endpoint-runtime.ts | 2 +- .../ssh-relay-incumbent-process.test.ts | 4 +- .../ssh-relay-sentinel-copy-budget.test.ts | 2 +- .../legacy-relay/ssh-relay-sentinel.test.ts | 2 +- .../ssh/legacy-relay/ssh-relay-sentinel.ts | 2 +- .../ssh/orcad-candidate-launch-verdict.ts | 2 +- src/main/ssh/orcad-deployment-target.test.ts | 6 +-- src/main/ssh/orcad-deployment-target.ts | 2 +- ...cad-exited-own-fence-mutation-race.test.ts | 4 +- src/main/ssh/orcad-exited-own-fence.test.ts | 6 +-- .../ssh/orcad-exited-own-install-lock.test.ts | 6 +-- .../ssh/orcad-exited-own-lock-windows.test.ts | 4 +- .../orcad-fence-lost-classification.test.ts | 5 +- src/main/ssh/orcad-gc-transaction-pins.ts | 2 +- src/main/ssh/orcad-incumbent-recovery.ts | 2 +- src/main/ssh/orcad-installed-activation.ts | 2 +- ...-migration-terminal-gate-host-wide.test.ts | 4 +- src/main/ssh/orcad-remote-deploy.test.ts | 6 +-- .../ssh/orcad-remote-node-runtime-report.ts | 2 +- .../port-forwarding/ssh-port-forward.test.ts | 2 +- .../system-ssh-port-forward-provider.ts | 4 +- src/main/ssh/relay-bundle-paths.ts | 2 +- .../remote-exec-closed-stdin.test.ts | 2 +- .../remote-exec-command.test.ts | 0 .../{ => remote-exec}/remote-exec-command.ts | 10 ++-- .../remote-exec-input.test.ts | 4 +- .../remote-frame-protocol.test.ts | 2 +- .../remote-frame-protocol.ts | 2 +- ...te-host-answered-failure-producers.test.ts | 22 ++++---- .../remote-host-answered-failure.test.ts | 4 +- .../remote-host-answered-failure.ts | 4 +- .../ssh/{ => remote-exec}/remote-host-exec.ts | 4 +- src/main/ssh/ssh-agent-identity-filter.ts | 2 +- src/main/ssh/ssh-auth-resolution.ts | 6 +-- ...h-channel-multiplexer-backpressure.test.ts | 2 +- ...annel-multiplexer-saturation-wedge.test.ts | 6 ++- src/main/ssh/ssh-channel-multiplexer.test.ts | 2 +- src/main/ssh/ssh-channel-multiplexer.ts | 2 +- .../ssh/ssh-connection-auth-fallback.test.ts | 16 +++--- .../ssh/ssh-connection-channel-error.test.ts | 14 ++--- .../ssh/ssh-connection-channel-open.test.ts | 14 ++--- .../ssh/ssh-connection-direct-startup.test.ts | 16 +++--- .../ssh/ssh-connection-file-transfer.test.ts | 23 ++++---- src/main/ssh/ssh-connection-file-transfers.ts | 9 ++-- .../ssh/ssh-connection-github-probe.test.ts | 16 +++--- .../ssh-connection-gssapi-fallback.test.ts | 16 +++--- ...h-connection-host-key-store-wiring.test.ts | 4 +- ...h-connection-host-key-verification.test.ts | 14 ++--- .../ssh-connection-manager-registry.test.ts | 14 ++--- ...h-connection-manager-sign-in-reuse.test.ts | 14 ++--- ...onnection-reconnect-handshake-loss.test.ts | 14 ++--- .../ssh-connection-reconnect-ladder.test.ts | 16 +++--- .../ssh/ssh-connection-sftp-namespace.test.ts | 26 +++++---- ...h-connection-store-orcad-ownership.test.ts | 2 +- src/main/ssh/ssh-connection-store.test.ts | 2 +- src/main/ssh/ssh-connection-store.ts | 2 +- .../ssh-connection-system-transport.test.ts | 18 +++---- src/main/ssh/ssh-connection-test-fixtures.ts | 2 +- src/main/ssh/ssh-connection-test-harness.ts | 14 ++--- src/main/ssh/ssh-connection-utils.test.ts | 2 +- src/main/ssh/ssh-connection-utils.ts | 4 +- .../ssh/ssh-connection-wake-retry.test.ts | 16 +++--- src/main/ssh/ssh-connection.test.ts | 14 ++--- src/main/ssh/ssh-connection.ts | 10 ++-- src/main/ssh/ssh-control-socket.ts | 2 +- ...credential-prompt-login-grace-wire.test.ts | 6 +-- src/main/ssh/ssh-exec-rc-stdout-noise.test.ts | 2 +- .../ssh/ssh-exec-stdin-file-transfer.test.ts | 2 +- src/main/ssh/ssh-exec-stdin-file-transfer.ts | 6 +-- src/main/ssh/ssh-host-key-decision.ts | 2 +- src/main/ssh/ssh-host-key-store.ts | 2 +- src/main/ssh/ssh-host-key-verifier.test.ts | 2 +- src/main/ssh/ssh-host-key-verifier.ts | 2 +- .../ssh/ssh-keyboard-interactive-wire.test.ts | 6 +-- .../ssh-multi-factor-authentication.test.ts | 2 +- .../ssh/ssh-multi-key-authentication.test.ts | 4 +- src/main/ssh/ssh-proxy-command.ts | 4 +- .../ssh/ssh-remote-node-install-guidance.ts | 2 +- .../ssh/ssh-remote-node-resolution.test.ts | 4 +- src/main/ssh/ssh-remote-node-resolution.ts | 2 +- .../ssh/ssh-remote-platform-detection.test.ts | 6 +-- src/main/ssh/ssh-remote-platform-detection.ts | 4 +- src/main/ssh/ssh-remote-platform.ts | 2 +- ...-remote-windows-command-line-limit.test.ts | 2 +- .../ssh/ssh-security-key-identity.test.ts | 2 +- .../ssh-system-transport.integration.test.ts | 2 +- src/main/ssh/ssh-transport-selection.ts | 8 +-- .../{ => system-transport}/system-ssh-args.ts | 4 +- .../system-ssh-binary.test.ts | 0 .../system-ssh-binary.ts | 0 .../system-ssh-command.ts | 4 +- ...system-ssh-dynamic-forward-process.test.ts | 0 .../system-ssh-dynamic-forward-process.ts | 2 +- .../system-ssh-file-binary-transfer.ts | 10 ++-- .../system-ssh-file-transfer.ts | 14 +++-- .../system-ssh-forward-process.test.ts | 2 +- .../system-ssh-forward-process.ts | 2 +- .../system-ssh-operation-lifecycle.ts | 0 .../system-ssh-operations.test.ts | 6 +-- .../system-ssh-orphaned-forward.test.ts | 0 .../system-ssh-orphaned-forward.ts | 6 +-- .../system-ssh-sftp-args.test.ts | 0 .../system-ssh-sftp-args.ts | 0 .../system-ssh-sftp-path.test.ts | 0 .../system-ssh-sftp-path.ts | 2 +- .../system-ssh-sftp-transfer.ts | 2 +- .../system-ssh-upload-plan-budget.test.ts | 2 +- .../system-ssh-windows-file-write.ts | 6 +-- .../system-ssh-windows-upload.test.ts | 4 +- ...tem-ssh-windows-write-capabilities.test.ts | 2 +- .../system-ssh-windows-write-capabilities.ts | 4 +- .../system-ssh-windows-write-strategy.ts | 2 +- .../headless-serve-ssh-registration.test.ts | 2 +- .../worktree-removal-close-records.test.ts | 2 +- ...-removal-session-partition-fencing.test.ts | 2 +- src/main/wsl/wsl-command-loop.test.ts | 2 +- src/main/wsl/wsl-directory-upload.ts | 7 ++- src/main/wsl/wsl-guest-process-identity.ts | 2 +- src/main/wsl/wsl-host-ssh-orcad-conflict.ts | 2 +- src/main/wsl/wsl-orcad-deploy.test.ts | 2 +- src/main/wsl/wsl-orcad-deploy.ts | 2 +- .../wsl-orcad-host-transport-loops.test.ts | 2 +- src/main/wsl/wsl-orcad-host-transport.test.ts | 2 +- .../wsl/wsl-orcad-real-distro-lane.test.ts | 2 +- src/wsl-guest/protocol-json-payload.test.ts | 2 +- src/wsl-guest/protocol.ts | 2 +- .../released-relay-transport.ts | 2 +- ...nch-settings-hook-bookkeeping.unit.test.ts | 2 +- 352 files changed, 692 insertions(+), 637 deletions(-) rename src/main/ssh/{ => config}/ssh-config-alias-claim.test.ts (100%) rename src/main/ssh/{ => config}/ssh-config-alias-claim.ts (98%) rename src/main/ssh/{ => config}/ssh-config-host-picker.test.ts (98%) rename src/main/ssh/{ => config}/ssh-config-host-picker.ts (97%) rename src/main/ssh/{ => config}/ssh-config-include-expander.ts (100%) rename src/main/ssh/{ => config}/ssh-config-loader-regression.test.ts (100%) rename src/main/ssh/{ => config}/ssh-config-loader.test.ts (100%) rename src/main/ssh/{ => config}/ssh-config-parser-host-patterns.test.ts (100%) rename src/main/ssh/{ => config}/ssh-config-parser.test.ts (100%) rename src/main/ssh/{ => config}/ssh-config-parser.ts (99%) rename src/main/ssh/{ => config}/ssh-config-path-expansion.ts (100%) rename src/main/ssh/{ => config}/ssh-config-resolver.test.ts (100%) rename src/main/ssh/{ => config}/ssh-g-config-resolution.test.ts (100%) rename src/main/ssh/{ => config}/ssh-g-config-resolution.ts (100%) rename src/main/ssh/{ => config}/ssh-known-hosts-source.test.ts (100%) rename src/main/ssh/{ => config}/ssh-known-hosts-source.ts (100%) rename src/main/ssh/{ => config}/ssh-known-hosts.test.ts (100%) rename src/main/ssh/{ => config}/ssh-known-hosts.ts (100%) rename src/main/ssh/{ => config}/vscode-ssh-authority.test.ts (97%) rename src/main/ssh/{ => config}/vscode-ssh-authority.ts (90%) rename src/main/ssh/{ => remote-exec}/remote-exec-closed-stdin.test.ts (95%) rename src/main/ssh/{ => remote-exec}/remote-exec-command.test.ts (100%) rename src/main/ssh/{ => remote-exec}/remote-exec-command.ts (96%) rename src/main/ssh/{ => remote-exec}/remote-exec-input.test.ts (91%) rename src/main/ssh/{ => remote-exec}/remote-frame-protocol.test.ts (99%) rename src/main/ssh/{ => remote-exec}/remote-frame-protocol.ts (98%) rename src/main/ssh/{ => remote-exec}/remote-host-answered-failure-producers.test.ts (90%) rename src/main/ssh/{ => remote-exec}/remote-host-answered-failure.test.ts (94%) rename src/main/ssh/{ => remote-exec}/remote-host-answered-failure.ts (92%) rename src/main/ssh/{ => remote-exec}/remote-host-exec.ts (74%) rename src/main/ssh/{ => system-transport}/system-ssh-args.ts (99%) rename src/main/ssh/{ => system-transport}/system-ssh-binary.test.ts (100%) rename src/main/ssh/{ => system-transport}/system-ssh-binary.ts (100%) rename src/main/ssh/{ => system-transport}/system-ssh-command.ts (98%) rename src/main/ssh/{ => system-transport}/system-ssh-dynamic-forward-process.test.ts (100%) rename src/main/ssh/{ => system-transport}/system-ssh-dynamic-forward-process.ts (98%) rename src/main/ssh/{ => system-transport}/system-ssh-file-binary-transfer.ts (96%) rename src/main/ssh/{ => system-transport}/system-ssh-file-transfer.ts (96%) rename src/main/ssh/{ => system-transport}/system-ssh-forward-process.test.ts (99%) rename src/main/ssh/{ => system-transport}/system-ssh-forward-process.ts (99%) rename src/main/ssh/{ => system-transport}/system-ssh-operation-lifecycle.ts (100%) rename src/main/ssh/{ => system-transport}/system-ssh-operations.test.ts (99%) rename src/main/ssh/{ => system-transport}/system-ssh-orphaned-forward.test.ts (100%) rename src/main/ssh/{ => system-transport}/system-ssh-orphaned-forward.ts (96%) rename src/main/ssh/{ => system-transport}/system-ssh-sftp-args.test.ts (100%) rename src/main/ssh/{ => system-transport}/system-ssh-sftp-args.ts (100%) rename src/main/ssh/{ => system-transport}/system-ssh-sftp-path.test.ts (100%) rename src/main/ssh/{ => system-transport}/system-ssh-sftp-path.ts (96%) rename src/main/ssh/{ => system-transport}/system-ssh-sftp-transfer.ts (99%) rename src/main/ssh/{ => system-transport}/system-ssh-upload-plan-budget.test.ts (96%) rename src/main/ssh/{ => system-transport}/system-ssh-windows-file-write.ts (97%) rename src/main/ssh/{ => system-transport}/system-ssh-windows-upload.test.ts (99%) rename src/main/ssh/{ => system-transport}/system-ssh-windows-write-capabilities.test.ts (98%) rename src/main/ssh/{ => system-transport}/system-ssh-windows-write-capabilities.ts (94%) rename src/main/ssh/{ => system-transport}/system-ssh-windows-write-strategy.ts (99%) diff --git a/config/process-host-direct-import-baseline.txt b/config/process-host-direct-import-baseline.txt index e76e1eb7b151..80709a6a6d54 100644 --- a/config/process-host-direct-import-baseline.txt +++ b/config/process-host-direct-import-baseline.txt @@ -102,11 +102,11 @@ src/main/runtime/windows-mobile-firewall.ts src/main/skills/skill-update-run.ts src/main/ssh/ssh-connection.ts src/main/ssh/ssh-proxy-command.ts -src/main/ssh/system-ssh-command.ts -src/main/ssh/system-ssh-dynamic-forward-process.ts -src/main/ssh/system-ssh-file-transfer.ts -src/main/ssh/system-ssh-forward-process.ts -src/main/ssh/system-ssh-operation-lifecycle.ts +src/main/ssh/system-transport/system-ssh-command.ts +src/main/ssh/system-transport/system-ssh-dynamic-forward-process.ts +src/main/ssh/system-transport/system-ssh-file-transfer.ts +src/main/ssh/system-transport/system-ssh-forward-process.ts +src/main/ssh/system-transport/system-ssh-operation-lifecycle.ts src/main/startup/ensure-virtual-display.ts src/main/windows-process-tree-kill.ts src/main/zsh-startup-hook-pty-harness.ts diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index 0575434081e3..f343f7292f57 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -6349,7 +6349,7 @@ "pnpm exec vitest run --config config/vitest.config.ts src/shared/browser-client-host-protocol.test.ts src/main/browser/browser-client-host-attach-request.test.ts src/main/browser/browser-client-network-route-registry.test.ts src/main/browser/paired-runtime-browser-client-host-composition.test.ts src/main/browser/paired-runtime-browser-client-host.test.ts src/main/browser/paired-runtime-browser-client-host-reconnect.test.ts src/main/browser/paired-runtime-browser-host-lease.test.ts src/main/browser/paired-runtime-browser-host-lease-reconnect.test.ts src/main/browser/browser-host-lease-reconnect-delay.test.ts src/main/browser/paired-runtime-browser-network-route.test.ts src/main/runtime/browser-host/browser-host-command-ledger.test.ts src/main/runtime/browser-host/browser-host-command-ledger-capacity.test.ts src/main/runtime/browser-host/browser-host-lease-placement-retirement.test.ts src/main/runtime/browser-host/browser-host-lease-registry.test.ts src/main/runtime/runtime-rpc-browser-host-admission.test.ts src/main/runtime/rpc/methods/browser-client-host.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/browser-client-network-route-registry.test.ts src/main/browser/paired-runtime-browser-client-host-composition.test.ts src/main/browser/paired-runtime-browser-client-host-registry.test.ts src/main/browser/paired-runtime-browser-client-host-runtime.test.ts src/main/browser/browser-client-page-command-executor.test.ts src/main/browser/browser-session-startup.test.ts src/main/ipc/runtime-environments-subscription-teardown.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser-host/browser-host-command-ledger.test.ts src/main/runtime/browser-host/browser-host-command-ledger-capacity.test.ts src/main/runtime/browser-host/browser-host-lease-registry.test.ts src/main/runtime/rpc/methods/browser-client-host.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser-host/browser-host-lease-registry.test.ts src/main/browser/browser-network-deferred-socket.test.ts src/main/browser/browser-network-execution-route.test.ts src/main/browser/paired-runtime-browser-network-route.test.ts src/main/runtime/rpc/methods/browser-network-tunnel.test.ts src/main/browser/ssh-browser-network-execution-route.test.ts src/main/browser/system-ssh-socks-client-socket.test.ts src/main/ssh/system-ssh-dynamic-forward-process.test.ts src/shared/browser-client-host-protocol.test.ts src/main/ssh/system-ssh-forward-process.test.ts src/main/ssh/system-ssh-operations.test.ts src/main/ssh/port-forwarding/ssh-port-forward.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser-host/browser-host-lease-registry.test.ts src/main/browser/browser-network-deferred-socket.test.ts src/main/browser/browser-network-execution-route.test.ts src/main/browser/paired-runtime-browser-network-route.test.ts src/main/runtime/rpc/methods/browser-network-tunnel.test.ts src/main/browser/ssh-browser-network-execution-route.test.ts src/main/browser/system-ssh-socks-client-socket.test.ts src/main/ssh/system-transport/system-ssh-dynamic-forward-process.test.ts src/shared/browser-client-host-protocol.test.ts src/main/ssh/system-transport/system-ssh-forward-process.test.ts src/main/ssh/system-transport/system-ssh-operations.test.ts src/main/ssh/port-forwarding/ssh-port-forward.test.ts", "ORCA_RUN_DOCKER_SSH_BROWSER_E2E=1 pnpm exec vitest run --config config/vitest.config.ts tests/e2e/ssh-browser-network-execution-route.docker.unit.test.ts", "ORCA_RUN_DOCKER_SSH_BROWSER_E2E=1 node_modules/.bin/vitest run --config config/vitest.config.ts tests/e2e/ssh-browser-network-execution-route.docker.unit.test.ts" ], @@ -6405,7 +6405,7 @@ "src/main/browser/paired-runtime-browser-network-route.test.ts", "src/main/browser/ssh-browser-network-execution-route.test.ts", "src/main/browser/system-ssh-socks-client-socket.test.ts", - "src/main/ssh/system-ssh-dynamic-forward-process.test.ts", + "src/main/ssh/system-transport/system-ssh-dynamic-forward-process.test.ts", "src/main/ssh/port-forwarding/ssh-port-forward.test.ts", "src/main/browser/remote-browser-socks-server.test.ts", "src/main/runtime/runtime-binary-message-router.test.ts", @@ -6889,7 +6889,7 @@ ] }, { - "file": "src/main/ssh/system-ssh-dynamic-forward-process.test.ts", + "file": "src/main/ssh/system-transport/system-ssh-dynamic-forward-process.test.ts", "assertions": [ "system SSH uses BatchMode=yes, disables ControlMaster, and positions one dynamic forward before the destination", "authority invalidation cancels an in-progress SSH launch and destroys its active readiness probe immediately" @@ -18736,13 +18736,13 @@ "invariant": "For one connected SSH authority, a renderer snapshot may update Forwarded or Detected state only if no newer push for that target and stream arrived after the snapshot began. Active tunnels and persisted intent remain authoritative through scan refresh and reconnect until explicit removal or a real connection-lifecycle transition.", "oracle": "Hold empty initial Forwarded and Detected snapshot promises, publish live events, release the snapshots, and require each target and stream to preserve only its own newer push while applying unaffected snapshots. Reject one target's Detected snapshot and require its Forwarded snapshot plus later targets to hydrate independently. Begin another target with partial connected authority and require its snapshots to hydrate after same-watermark authority reconciliation. In headed Electron, hold an authoritative empty Forwarded snapshot across renderer reload, add a forward through the Ports panel, release and confirm the wrapped main handler resumed, then complete a later renderer-to-main listPortForwards round trip as the ordered hydration-continuation barrier. Before checking the Forwarded row, require main inventory, persisted intent, HTTP, remote process identity, and close warnings to prove the tunnel remained authoritative. Then forward two real Docker listeners, refresh detection, force an in-place relay-channel reconnect, perform a full transport reconnect, reject a bound local-port collision, remove one row, and require all signals to agree.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/hooks/useIpcEvents-agent-status-ssh-authority.test.ts src/main/ssh/port-forwarding/ssh-port-forward.test.ts src/main/ssh/system-ssh-forward-process.test.ts src/main/ipc/ssh.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/hooks/useIpcEvents-agent-status-ssh-authority.test.ts src/main/ssh/port-forwarding/ssh-port-forward.test.ts src/main/ssh/system-transport/system-ssh-forward-process.test.ts src/main/ipc/ssh.test.ts --reporter=dot", "pnpm exec electron-vite build --mode e2e" ], "testFiles": [ "src/renderer/src/hooks/useIpcEvents-agent-status-ssh-authority.test.ts", "src/main/ssh/port-forwarding/ssh-port-forward.test.ts", - "src/main/ssh/system-ssh-forward-process.test.ts", + "src/main/ssh/system-transport/system-ssh-forward-process.test.ts", "src/main/ipc/ssh.test.ts" ], "assertionRefs": [ @@ -18755,7 +18755,7 @@ "assertions": ["lists forwards filtered by connectionId", "removes a forward by id"] }, { - "file": "src/main/ssh/system-ssh-forward-process.test.ts", + "file": "src/main/ssh/system-transport/system-ssh-forward-process.test.ts", "assertions": [ "does not spawn ssh when the requested local forward port is already in use", "sends SIGTERM then SIGKILL when the process does not exit", @@ -18775,7 +18775,7 @@ "date": "2026-07-30", "runner": "local", "platform": "macos", - "command": "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/hooks/useIpcEvents-agent-status-ssh-authority.test.ts src/main/ssh/port-forwarding/ssh-port-forward.test.ts src/main/ssh/system-ssh-forward-process.test.ts src/main/ipc/ssh.test.ts --reporter=dot", + "command": "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/hooks/useIpcEvents-agent-status-ssh-authority.test.ts src/main/ssh/port-forwarding/ssh-port-forward.test.ts src/main/ssh/system-transport/system-ssh-forward-process.test.ts src/main/ipc/ssh.test.ts --reporter=dot", "result": "passed", "durationSeconds": 6.77, "summary": "Six renderer, main-process, and barrier lifecycle files passed with 215 tests, including deterministic stale-snapshot, rejected-stream, partial-authority, and single-capture isolation plus existing collision, delayed-exit, reconnect, persistence, re-registration, and unrelated-forward contracts." diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index 64ecfee2c1e5..dee8bb06ee32 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -5685,7 +5685,7 @@ "src/main/ssh/pinned-runtime-host-target.test.ts": 51, "src/main/ssh/relay-bundle-paths.test.ts": 32, "src/main/ssh/relay-install-artifacts.test.ts": 37, - "src/main/ssh/remote-frame-protocol.test.ts": 113, + "src/main/ssh/remote-exec/remote-frame-protocol.test.ts": 113, "src/main/managed-server/install/remote-install-gc-termination.test.ts": 187, "src/main/managed-server/install/remote-install-model.test.ts": 184, "src/main/managed-server/install/remote-node-runtime-store-gc.test.ts": 1625, @@ -5704,13 +5704,13 @@ "src/main/ssh/ssh-channel-multiplexer-saturation-wedge.test.ts": 61, "src/main/ssh/ssh-channel-multiplexer-settlement.test.ts": 37, "src/main/ssh/ssh-channel-multiplexer.test.ts": 120, - "src/main/ssh/ssh-config-alias-claim.test.ts": 58, - "src/main/ssh/ssh-config-host-picker.test.ts": 223, - "src/main/ssh/ssh-config-loader-regression.test.ts": 132, - "src/main/ssh/ssh-config-loader.test.ts": 114, - "src/main/ssh/ssh-config-parser-host-patterns.test.ts": 49, - "src/main/ssh/ssh-config-parser.test.ts": 331, - "src/main/ssh/ssh-config-resolver.test.ts": 40, + "src/main/ssh/config/ssh-config-alias-claim.test.ts": 58, + "src/main/ssh/config/ssh-config-host-picker.test.ts": 223, + "src/main/ssh/config/ssh-config-loader-regression.test.ts": 132, + "src/main/ssh/config/ssh-config-loader.test.ts": 114, + "src/main/ssh/config/ssh-config-parser-host-patterns.test.ts": 49, + "src/main/ssh/config/ssh-config-parser.test.ts": 331, + "src/main/ssh/config/ssh-config-resolver.test.ts": 40, "src/main/ssh/ssh-connect-attempt-cancellation.test.ts": 85, "src/main/ssh/ssh-connection-attribution.test.ts": 34, "src/main/ssh/ssh-connection-auth-fallback.test.ts": 269, @@ -5741,7 +5741,7 @@ "src/main/ssh/ssh-exec-rc-stdout-noise.test.ts": 260, "src/main/ssh/ssh-exec-stdin-file-transfer.test.ts": 334, "src/main/ssh/ssh-file-transfer-abort.test.ts": 77, - "src/main/ssh/ssh-g-config-resolution.test.ts": 128, + "src/main/ssh/config/ssh-g-config-resolution.test.ts": 128, "src/main/ssh/ssh-host-key-decision.test.ts": 67, "src/main/ssh/ssh-host-key-store.test.ts": 207, "src/main/ssh/ssh-host-key-verifier.test.ts": 77, @@ -5760,8 +5760,8 @@ "src/main/ssh/hostile-host-test-support/ssh-hostile-hosts.docker.test.ts": 574, "src/main/ssh/ssh-keyboard-interactive-wire.test.ts": 261, "src/main/ssh/ssh-keyboard-interactive.test.ts": 41, - "src/main/ssh/ssh-known-hosts-source.test.ts": 106, - "src/main/ssh/ssh-known-hosts.test.ts": 89, + "src/main/ssh/config/ssh-known-hosts-source.test.ts": 106, + "src/main/ssh/config/ssh-known-hosts.test.ts": 89, "src/main/ssh/ssh-multi-factor-authentication.test.ts": 109, "src/main/ssh/ssh-multi-key-authentication.test.ts": 87, "src/main/ssh/ssh-multiplexer-transport-writer.test.ts": 75, @@ -5773,16 +5773,16 @@ "src/main/ssh/ssh-quit-abort-upload.test.ts": 252, "src/main/ssh/ssh-reconnect-error-classification.test.ts": 98, "src/main/ssh/ssh-reconnect-ladder.test.ts": 75, - "src/main/ssh/remote-host-answered-failure-producers.test.ts": 321, + "src/main/ssh/remote-exec/remote-host-answered-failure-producers.test.ts": 321, "src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent-shell.integration.test.ts": 1326, "src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent.test.ts": 100, "src/main/ssh/legacy-relay/ssh-relay-endpoint-pty-count.test.ts": 90, "src/main/ssh/legacy-relay/ssh-relay-endpoint-runtime.test.ts": 69, - "src/main/ssh/remote-exec-closed-stdin.test.ts": 89, - "src/main/ssh/remote-exec-command.test.ts": 130, - "src/main/ssh/remote-exec-input.test.ts": 92, + "src/main/ssh/remote-exec/remote-exec-closed-stdin.test.ts": 89, + "src/main/ssh/remote-exec/remote-exec-command.test.ts": 130, + "src/main/ssh/remote-exec/remote-exec-input.test.ts": 92, "src/main/managed-server/install/remote-install-gc-claim-termination.test.ts": 249, - "src/main/ssh/remote-host-answered-failure.test.ts": 101, + "src/main/ssh/remote-exec/remote-host-answered-failure.test.ts": 101, "src/main/ssh/legacy-relay/ssh-relay-incumbent-process.test.ts": 5329, "src/main/managed-server/install/remote-install-lock-exited-owner.test.ts": 380, "src/main/managed-server/install/remote-install-lock-termination.test.ts": 276, @@ -5802,7 +5802,7 @@ "src/main/ssh/ssh-request-outcome-verdict.test.ts": 37, "src/main/ssh/ssh-security-key-identity.test.ts": 147, "src/main/ssh/ssh-session-limit-error.test.ts": 27, - "src/main/ssh/system-ssh-operations.test.ts": 275, + "src/main/ssh/system-transport/system-ssh-operations.test.ts": 275, "src/main/ssh/ssh-system-transport.integration.test.ts": 277, "src/main/ssh/ssh-target-id-migration.test.ts": 46, "src/main/ssh/ssh-target-orcad-claims.test.ts": 306, @@ -5812,16 +5812,16 @@ "src/main/ssh/ssh-tcp-forwarding-probe.test.ts": 810, "src/main/ssh/ssh-windows-host-cells.test.ts": 39, "src/main/ssh/port-forwarding/ssh2-port-forward-listen.test.ts": 30, - "src/main/ssh/system-ssh-binary.test.ts": 35, - "src/main/ssh/system-ssh-dynamic-forward-process.test.ts": 240, - "src/main/ssh/system-ssh-forward-process.test.ts": 251, - "src/main/ssh/system-ssh-orphaned-forward.test.ts": 86, - "src/main/ssh/system-ssh-sftp-args.test.ts": 44, - "src/main/ssh/system-ssh-sftp-path.test.ts": 38, - "src/main/ssh/system-ssh-upload-plan-budget.test.ts": 336, - "src/main/ssh/system-ssh-windows-upload.test.ts": 343, - "src/main/ssh/system-ssh-windows-write-capabilities.test.ts": 35, - "src/main/ssh/vscode-ssh-authority.test.ts": 48, + "src/main/ssh/system-transport/system-ssh-binary.test.ts": 35, + "src/main/ssh/system-transport/system-ssh-dynamic-forward-process.test.ts": 240, + "src/main/ssh/system-transport/system-ssh-forward-process.test.ts": 251, + "src/main/ssh/system-transport/system-ssh-orphaned-forward.test.ts": 86, + "src/main/ssh/system-transport/system-ssh-sftp-args.test.ts": 44, + "src/main/ssh/system-transport/system-ssh-sftp-path.test.ts": 38, + "src/main/ssh/system-transport/system-ssh-upload-plan-budget.test.ts": 336, + "src/main/ssh/system-transport/system-ssh-windows-upload.test.ts": 343, + "src/main/ssh/system-transport/system-ssh-windows-write-capabilities.test.ts": 35, + "src/main/ssh/config/vscode-ssh-authority.test.ts": 48, "src/main/star-nag/service-direct-star.test.ts": 323, "src/main/star-nag/service-force-show-races.test.ts": 322, "src/main/star-nag/service-outcome-telemetry.test.ts": 354, diff --git a/config/scripts/pr-e2e-route-contracts.test.mjs b/config/scripts/pr-e2e-route-contracts.test.mjs index 5bfed39aca87..af525da7c2e3 100644 --- a/config/scripts/pr-e2e-route-contracts.test.mjs +++ b/config/scripts/pr-e2e-route-contracts.test.mjs @@ -288,7 +288,7 @@ describe('ssh-browser-e2e-routing', () => { 'src/main/browser/browser-network-deferred-socket.ts', 'src/main/browser/browser-network-execution-route.ts', 'src/main/browser/system-ssh-socks-client-socket.ts', - 'src/main/ssh/system-ssh-dynamic-forward-process.ts', + 'src/main/ssh/system-transport/system-ssh-dynamic-forward-process.ts', 'tests/e2e/helpers/docker-ssh-host-target.ts', 'tests/e2e/helpers/docker-ssh-host-image.ts' ]) { diff --git a/config/scripts/pr-e2e-source-routing.mjs b/config/scripts/pr-e2e-source-routing.mjs index 46f6f0265aeb..44105317e0f4 100644 --- a/config/scripts/pr-e2e-source-routing.mjs +++ b/config/scripts/pr-e2e-source-routing.mjs @@ -276,7 +276,7 @@ export const PR_E2E_SOURCE_ROUTES = [ file === 'tests/e2e/ssh-browser-network-execution-route.docker.unit.test.ts' || /^tests\/e2e\/helpers\/docker-ssh-host-(?:image|target)\.ts$/.test(file) || (isProductSource(file) && - /^src\/main\/(?:browser\/(?:ssh-browser-network-execution-route|browser-network-deferred-socket|browser-network-execution-route|system-ssh-socks-client-socket)|ssh\/system-ssh-dynamic-forward-process)\.ts$/.test( + /^src\/main\/(?:browser\/(?:ssh-browser-network-execution-route|browser-network-deferred-socket|browser-network-execution-route|system-ssh-socks-client-socket)|ssh\/system-transport\/system-ssh-dynamic-forward-process)\.ts$/.test( file )) }, diff --git a/src/main/active-view-persistence-boundary.test.ts b/src/main/active-view-persistence-boundary.test.ts index 54112b2b08f1..a951cb361000 100644 --- a/src/main/active-view-persistence-boundary.test.ts +++ b/src/main/active-view-persistence-boundary.test.ts @@ -22,7 +22,7 @@ vi.mock('electron', () => ({ vi.mock('./telemetry/client', () => ({ track: vi.fn() })) vi.mock('./telemetry/cohort-classifier', () => ({ getCohortAtEmit: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/agent-hooks/wsl-hook-relay-sentinel.test.ts b/src/main/agent-hooks/wsl-hook-relay-sentinel.test.ts index 613352b29e76..5503704b86b7 100644 --- a/src/main/agent-hooks/wsl-hook-relay-sentinel.test.ts +++ b/src/main/agent-hooks/wsl-hook-relay-sentinel.test.ts @@ -5,7 +5,7 @@ import { EventEmitter } from 'node:events' import type { ChildProcessWithoutNullStreams } from 'node:child_process' import { afterEach, describe, expect, it, vi } from 'vitest' -import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from '../ssh/remote-frame-protocol' +import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from '../ssh/remote-exec/remote-frame-protocol' import { MAX_STARTUP_BUFFER_BYTES, waitForWslRelaySentinel, diff --git a/src/main/agent-hooks/wsl-hook-relay-sentinel.ts b/src/main/agent-hooks/wsl-hook-relay-sentinel.ts index 47b50eaacfd0..eb392f1b524c 100644 --- a/src/main/agent-hooks/wsl-hook-relay-sentinel.ts +++ b/src/main/agent-hooks/wsl-hook-relay-sentinel.ts @@ -4,7 +4,7 @@ // ChildProcess instead of a ClientChannel. import type { ChildProcessWithoutNullStreams } from 'node:child_process' -import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from '../ssh/remote-frame-protocol' +import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from '../ssh/remote-exec/remote-frame-protocol' import type { MultiplexerTransport } from '../ssh/ssh-channel-multiplexer' export const MAX_STARTUP_BUFFER_BYTES = 64 * 1024 diff --git a/src/main/automations/automation-worker-durability.test.ts b/src/main/automations/automation-worker-durability.test.ts index 22d13899e3b6..1cd77cd8518c 100644 --- a/src/main/automations/automation-worker-durability.test.ts +++ b/src/main/automations/automation-worker-durability.test.ts @@ -10,7 +10,7 @@ vi.mock('../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../ssh/ssh-config-parser', () => ({ +vi.mock('../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/browser/ssh-browser-network-execution-route.ts b/src/main/browser/ssh-browser-network-execution-route.ts index cadf3597c446..96abc6952bdc 100644 --- a/src/main/browser/ssh-browser-network-execution-route.ts +++ b/src/main/browser/ssh-browser-network-execution-route.ts @@ -5,7 +5,7 @@ import type { Client as SshClient } from 'ssh2' import { startSystemSshDynamicForwardProcess, type SystemSshDynamicForwardProcess -} from '../ssh/system-ssh-dynamic-forward-process' +} from '../ssh/system-transport/system-ssh-dynamic-forward-process' import { BrowserNetworkDeferredSocket } from './browser-network-deferred-socket' import { browserNetworkExecutionHostKey, diff --git a/src/main/github/github-enterprise-repository.test.ts b/src/main/github/github-enterprise-repository.test.ts index d6db52e01b96..1d0be8313406 100644 --- a/src/main/github/github-enterprise-repository.test.ts +++ b/src/main/github/github-enterprise-repository.test.ts @@ -16,7 +16,7 @@ vi.mock('../git/runner', () => ({ gitExecFileAsync: gitExecFileAsyncMock })) -vi.mock('../ssh/ssh-g-config-resolution', () => ({ +vi.mock('../ssh/config/ssh-g-config-resolution', () => ({ resolveWithSshG: resolveWithSshGMock })) diff --git a/src/main/github/github-repository-identity.ssh-host-alias.test.ts b/src/main/github/github-repository-identity.ssh-host-alias.test.ts index 5b718e397abe..cbc8cb995235 100644 --- a/src/main/github/github-repository-identity.ssh-host-alias.test.ts +++ b/src/main/github/github-repository-identity.ssh-host-alias.test.ts @@ -23,7 +23,7 @@ vi.mock('./local-git-config-signature', () => ({ readLocalGitConfigSignature: readLocalGitConfigSignatureMock })) -vi.mock('../ssh/ssh-g-config-resolution', () => ({ +vi.mock('../ssh/config/ssh-g-config-resolution', () => ({ resolveWithSshG: resolveWithSshGMock })) diff --git a/src/main/github/github-ssh-host-alias-resolution.ts b/src/main/github/github-ssh-host-alias-resolution.ts index 8decd2ec8d09..8aa033a6b4d1 100644 --- a/src/main/github/github-ssh-host-alias-resolution.ts +++ b/src/main/github/github-ssh-host-alias-resolution.ts @@ -1,7 +1,7 @@ import type { GitHubOwnerRepo } from '../../shared/github/pull-request-types' import { commandExecFileAsync } from '../git/runner' import { parseWslPath } from '../wsl' -import { resolveWithSshG } from '../ssh/ssh-g-config-resolution' +import { resolveWithSshG } from '../ssh/config/ssh-g-config-resolution' import { gitHubSshConfigHostAlias, parseGitHubOwnerRepo, diff --git a/src/main/ipc/orca-profiles-switch-persistence.test.ts b/src/main/ipc/orca-profiles-switch-persistence.test.ts index 6365291fd21d..2ec29383d0b9 100644 --- a/src/main/ipc/orca-profiles-switch-persistence.test.ts +++ b/src/main/ipc/orca-profiles-switch-persistence.test.ts @@ -30,7 +30,7 @@ vi.mock('../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../ssh/ssh-config-parser', () => ({ +vi.mock('../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/ipc/pty/pane/pane-owner-replacement.test.ts b/src/main/ipc/pty/pane/pane-owner-replacement.test.ts index 07ba7d410e36..714f0c095eca 100644 --- a/src/main/ipc/pty/pane/pane-owner-replacement.test.ts +++ b/src/main/ipc/pty/pane/pane-owner-replacement.test.ts @@ -7,7 +7,7 @@ vi.mock('../../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../../ssh/ssh-config-parser', () => ({ +vi.mock('../../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/ipc/renderer-shutdown-checkpoint-sleep-records.test.ts b/src/main/ipc/renderer-shutdown-checkpoint-sleep-records.test.ts index d5121cc5f83e..eb9370efcd53 100644 --- a/src/main/ipc/renderer-shutdown-checkpoint-sleep-records.test.ts +++ b/src/main/ipc/renderer-shutdown-checkpoint-sleep-records.test.ts @@ -37,7 +37,7 @@ vi.mock('electron', () => ({ })) vi.mock('../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../telemetry/cohort-classifier', () => ({ getCohortAtEmit: vi.fn().mockReturnValue({}) })) -vi.mock('../ssh/ssh-config-parser', () => ({ +vi.mock('../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/ipc/session-window-view-save.test.ts b/src/main/ipc/session-window-view-save.test.ts index 8508d7d5ba5e..3d5e2784c1e4 100644 --- a/src/main/ipc/session-window-view-save.test.ts +++ b/src/main/ipc/session-window-view-save.test.ts @@ -30,7 +30,7 @@ vi.mock('electron', () => ({ })) vi.mock('../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../telemetry/cohort-classifier', () => ({ getCohortAtEmit: vi.fn().mockReturnValue({}) })) -vi.mock('../ssh/ssh-config-parser', () => ({ +vi.mock('../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/ipc/settings-delayed-response.test.ts b/src/main/ipc/settings-delayed-response.test.ts index 3b0d5b2ecd5a..ff162527dad9 100644 --- a/src/main/ipc/settings-delayed-response.test.ts +++ b/src/main/ipc/settings-delayed-response.test.ts @@ -28,7 +28,7 @@ vi.mock('../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../ssh/ssh-config-parser', () => ({ +vi.mock('../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/ipc/shell.ts b/src/main/ipc/shell.ts index 409ff6488579..2591055ae183 100644 --- a/src/main/ipc/shell.ts +++ b/src/main/ipc/shell.ts @@ -16,7 +16,7 @@ import { resolveExternalEditorLaunchSpec, resolveVsCodeRemoteSshLaunchSpec } from '../external-editor-launch' -import { resolveVsCodeSshAuthority } from '../ssh/vscode-ssh-authority' +import { resolveVsCodeSshAuthority } from '../ssh/config/vscode-ssh-authority' import { toSshExecutionHostId } from '../../shared/execution-host' import { isLocallyOwned, diff --git a/src/main/ipc/ssh-app-shutdown.test.ts b/src/main/ipc/ssh-app-shutdown.test.ts index a299063c4b38..cb887bbac1cb 100644 --- a/src/main/ipc/ssh-app-shutdown.test.ts +++ b/src/main/ipc/ssh-app-shutdown.test.ts @@ -5,7 +5,7 @@ const mocks = await vi.hoisted(async () => { return createSshIpcMocks() }) -vi.mock('../ssh/ssh-config-host-picker', () => mocks.sshConfigHostPicker) +vi.mock('../ssh/config/ssh-config-host-picker', () => mocks.sshConfigHostPicker) vi.mock('electron', () => mocks.electron) vi.mock('../ssh/ssh-connection-store', () => mocks.sshConnectionStore) vi.mock('./ssh-host-server-connect', () => mocks.hostServerConnect) diff --git a/src/main/ipc/ssh-connect-decision-cancellation.test.ts b/src/main/ipc/ssh-connect-decision-cancellation.test.ts index 2685189af841..fb406cec1c04 100644 --- a/src/main/ipc/ssh-connect-decision-cancellation.test.ts +++ b/src/main/ipc/ssh-connect-decision-cancellation.test.ts @@ -5,7 +5,7 @@ const mocks = await vi.hoisted(async () => { return createSshIpcMocks() }) -vi.mock('../ssh/ssh-config-host-picker', () => mocks.sshConfigHostPicker) +vi.mock('../ssh/config/ssh-config-host-picker', () => mocks.sshConfigHostPicker) vi.mock('electron', () => mocks.electron) vi.mock('../ssh/ssh-connection-store', () => mocks.sshConnectionStore) vi.mock('./ssh-host-server-connect', () => mocks.hostServerConnect) diff --git a/src/main/ipc/ssh-credential-cancel.test.ts b/src/main/ipc/ssh-credential-cancel.test.ts index 5a7766956bdf..f318ba954e23 100644 --- a/src/main/ipc/ssh-credential-cancel.test.ts +++ b/src/main/ipc/ssh-credential-cancel.test.ts @@ -5,7 +5,7 @@ const mocks = await vi.hoisted(async () => { return createSshIpcMocks() }) -vi.mock('../ssh/ssh-config-host-picker', () => mocks.sshConfigHostPicker) +vi.mock('../ssh/config/ssh-config-host-picker', () => mocks.sshConfigHostPicker) vi.mock('electron', () => mocks.electron) vi.mock('../ssh/ssh-connection-store', () => mocks.sshConnectionStore) vi.mock('./ssh-host-server-connect', () => mocks.hostServerConnect) diff --git a/src/main/ipc/ssh-disconnect-cancellation.test.ts b/src/main/ipc/ssh-disconnect-cancellation.test.ts index 13587401ebb9..403a55b28341 100644 --- a/src/main/ipc/ssh-disconnect-cancellation.test.ts +++ b/src/main/ipc/ssh-disconnect-cancellation.test.ts @@ -5,7 +5,7 @@ const mocks = await vi.hoisted(async () => { return createSshIpcMocks() }) -vi.mock('../ssh/ssh-config-host-picker', () => mocks.sshConfigHostPicker) +vi.mock('../ssh/config/ssh-config-host-picker', () => mocks.sshConfigHostPicker) vi.mock('electron', () => mocks.electron) vi.mock('../ssh/ssh-connection-store', () => mocks.sshConnectionStore) vi.mock('./ssh-host-server-connect', () => mocks.hostServerConnect) diff --git a/src/main/ipc/ssh-handler-reregistration.test.ts b/src/main/ipc/ssh-handler-reregistration.test.ts index fc9a83dbb825..fb8f5c27aead 100644 --- a/src/main/ipc/ssh-handler-reregistration.test.ts +++ b/src/main/ipc/ssh-handler-reregistration.test.ts @@ -5,7 +5,7 @@ const mocks = await vi.hoisted(async () => { return createSshIpcMocks() }) -vi.mock('../ssh/ssh-config-host-picker', () => mocks.sshConfigHostPicker) +vi.mock('../ssh/config/ssh-config-host-picker', () => mocks.sshConfigHostPicker) vi.mock('electron', () => mocks.electron) vi.mock('../ssh/ssh-connection-store', () => mocks.sshConnectionStore) vi.mock('./ssh-host-server-connect', () => mocks.hostServerConnect) diff --git a/src/main/ipc/ssh-host-user-disconnect.test.ts b/src/main/ipc/ssh-host-user-disconnect.test.ts index 0b98be00fb41..fe055533d03e 100644 --- a/src/main/ipc/ssh-host-user-disconnect.test.ts +++ b/src/main/ipc/ssh-host-user-disconnect.test.ts @@ -9,7 +9,7 @@ const runtime = vi.hoisted(() => { return { environments, activate: vi.fn(), getStatusOwner: vi.fn(), invalidate: vi.fn() } }) -vi.mock('../ssh/ssh-config-host-picker', () => mocks.sshConfigHostPicker) +vi.mock('../ssh/config/ssh-config-host-picker', () => mocks.sshConfigHostPicker) vi.mock('electron', () => mocks.electron) vi.mock('../ssh/ssh-connection-store', () => mocks.sshConnectionStore) vi.mock('./ssh-host-server-connect', () => mocks.hostServerConnect) diff --git a/src/main/ipc/ssh-sign-in-requirement.test.ts b/src/main/ipc/ssh-sign-in-requirement.test.ts index a8d0c6ae65a9..6b7a672c3a72 100644 --- a/src/main/ipc/ssh-sign-in-requirement.test.ts +++ b/src/main/ipc/ssh-sign-in-requirement.test.ts @@ -5,7 +5,7 @@ const mocks = await vi.hoisted(async () => { return createSshIpcMocks() }) -vi.mock('../ssh/ssh-config-host-picker', () => mocks.sshConfigHostPicker) +vi.mock('../ssh/config/ssh-config-host-picker', () => mocks.sshConfigHostPicker) vi.mock('electron', () => mocks.electron) vi.mock('../ssh/ssh-connection-store', () => mocks.sshConnectionStore) vi.mock('./ssh-host-server-connect', () => mocks.hostServerConnect) diff --git a/src/main/ipc/ssh-state-broadcast-fanout.test.ts b/src/main/ipc/ssh-state-broadcast-fanout.test.ts index 8e1fa64bb1f8..8859f63230c2 100644 --- a/src/main/ipc/ssh-state-broadcast-fanout.test.ts +++ b/src/main/ipc/ssh-state-broadcast-fanout.test.ts @@ -5,7 +5,7 @@ const mocks = await vi.hoisted(async () => { return createSshIpcMocks() }) -vi.mock('../ssh/ssh-config-host-picker', () => mocks.sshConfigHostPicker) +vi.mock('../ssh/config/ssh-config-host-picker', () => mocks.sshConfigHostPicker) vi.mock('electron', () => mocks.electron) vi.mock('../ssh/ssh-connection-store', () => mocks.sshConnectionStore) vi.mock('./ssh-host-server-connect', () => mocks.hostServerConnect) diff --git a/src/main/ipc/ssh-target-crud-handlers.ts b/src/main/ipc/ssh-target-crud-handlers.ts index ab5ea2d2cdb1..abd803fe872d 100644 --- a/src/main/ipc/ssh-target-crud-handlers.ts +++ b/src/main/ipc/ssh-target-crud-handlers.ts @@ -10,7 +10,7 @@ import type { import { listUserSshConfigHostSummaries, resolveUserSshConfigHost -} from '../ssh/ssh-config-host-picker' +} from '../ssh/config/ssh-config-host-picker' import { getManagedOrcadFenceEnvironmentId } from '../../shared/managed-orcad-ssh-owner' import { closeOrcadManagedTunnel } from '../managed-server/lifecycle/orcad-managed-tunnel' import { rotateSshProviderAuthority } from '../ssh/ssh-provider-authority' diff --git a/src/main/ipc/ssh-target-registry.test.ts b/src/main/ipc/ssh-target-registry.test.ts index e4444a3dcc03..d56d6807bd9e 100644 --- a/src/main/ipc/ssh-target-registry.test.ts +++ b/src/main/ipc/ssh-target-registry.test.ts @@ -5,7 +5,7 @@ const mocks = await vi.hoisted(async () => { return createSshIpcMocks() }) -vi.mock('../ssh/ssh-config-host-picker', () => mocks.sshConfigHostPicker) +vi.mock('../ssh/config/ssh-config-host-picker', () => mocks.sshConfigHostPicker) vi.mock('electron', () => mocks.electron) vi.mock('../ssh/ssh-connection-store', () => mocks.sshConnectionStore) vi.mock('./ssh-host-server-connect', () => mocks.hostServerConnect) diff --git a/src/main/ipc/ssh.test.ts b/src/main/ipc/ssh.test.ts index 96ab716211d2..b261a9283550 100644 --- a/src/main/ipc/ssh.test.ts +++ b/src/main/ipc/ssh.test.ts @@ -5,7 +5,7 @@ const mocks = await vi.hoisted(async () => { return createSshIpcMocks() }) -vi.mock('../ssh/ssh-config-host-picker', () => mocks.sshConfigHostPicker) +vi.mock('../ssh/config/ssh-config-host-picker', () => mocks.sshConfigHostPicker) vi.mock('electron', () => mocks.electron) vi.mock('../ssh/ssh-connection-store', () => mocks.sshConnectionStore) vi.mock('./ssh-host-server-connect', () => mocks.hostServerConnect) diff --git a/src/main/managed-server/activation/orcad-activation-crash-recovery.test.ts b/src/main/managed-server/activation/orcad-activation-crash-recovery.test.ts index f3fa0e0d6b53..4edbef24b431 100644 --- a/src/main/managed-server/activation/orcad-activation-crash-recovery.test.ts +++ b/src/main/managed-server/activation/orcad-activation-crash-recovery.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import type * as RecordFile from '../install/orcad-remote-record-file' import type * as InstallLock from '../install/remote-install-lock' import type * as VersionedInstall from '../install/remote-versioned-install' @@ -11,7 +11,7 @@ vi.mock('node:crypto', async (importOriginal) => { return { ...actual, randomUUID: () => uuid.fixed ?? actual.randomUUID() } }) -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -38,7 +38,7 @@ vi.mock('../../ssh/orcad-local-build-hash', () => ({ computeLocalOrcadBuildHash: () => 'abc123def4567890' })) -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { acquireInstallLock } from '../install/remote-install-lock' import { writeAtomicOrcadRemoteRecord } from '../install/orcad-remote-record-file' import { deployOrcad } from '../../ssh/orcad-remote-deploy' diff --git a/src/main/managed-server/activation/orcad-activation-fence-generation.test.ts b/src/main/managed-server/activation/orcad-activation-fence-generation.test.ts index 4517d8c43a54..66664d53f74a 100644 --- a/src/main/managed-server/activation/orcad-activation-fence-generation.test.ts +++ b/src/main/managed-server/activation/orcad-activation-fence-generation.test.ts @@ -11,18 +11,18 @@ import { import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' // Every remote command runs in a real local shell, so the host-side checks are the real ones. const shell = vi.hoisted((): { env: NodeJS.ProcessEnv | undefined } => ({ env: undefined })) -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => { +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => { const { runProcess } = await import('@orca/process-host') return { ...(await importOriginal()), execCommand: async (_conn: unknown, command: string) => { const result = await runProcess({ program: '/bin/sh', args: ['-c', command], env: shell.env }) if (result.code !== 0) { - const { sshCommandExitError } = await import('../../ssh/remote-exec-command') + const { sshCommandExitError } = await import('../../ssh/remote-exec/remote-exec-command') throw sshCommandExitError(command, result.code ?? 1, result.stdout) } return result.stdout diff --git a/src/main/managed-server/activation/orcad-activation-fence-scope.ts b/src/main/managed-server/activation/orcad-activation-fence-scope.ts index 13504db08348..910b4c6adbdb 100644 --- a/src/main/managed-server/activation/orcad-activation-fence-scope.ts +++ b/src/main/managed-server/activation/orcad-activation-fence-scope.ts @@ -9,7 +9,7 @@ */ import { AsyncLocalStorage } from 'node:async_hooks' import { shellEscape } from '../../ssh/ssh-connection-utils' -import { isSshCommandExitError } from '../../ssh/remote-exec-command' +import { isSshCommandExitError } from '../../ssh/remote-exec/remote-exec-command' export const ORCAD_FENCE_OWNER_FILENAME = '.orca-fence-owner' export const ORCAD_FENCE_LOST_MARKER = '__ORCAD_FENCE_LOST__' diff --git a/src/main/managed-server/activation/orcad-activation-host-test-harness.ts b/src/main/managed-server/activation/orcad-activation-host-test-harness.ts index 08aa143edee3..0373e798c55e 100644 --- a/src/main/managed-server/activation/orcad-activation-host-test-harness.ts +++ b/src/main/managed-server/activation/orcad-activation-host-test-harness.ts @@ -10,7 +10,7 @@ import { type OrcadActivationRecord } from './orcad-activation-record' import { isSnapshotCaptureCommand } from '../../ssh/orcad-snapshot-capture-command' -import { sshCommandExitError } from '../../ssh/remote-exec-command' +import { sshCommandExitError } from '../../ssh/remote-exec/remote-exec-command' export const OLD = '0.1.0+aa01' export const NEW = '0.2.0+bb01' diff --git a/src/main/managed-server/activation/orcad-activation-lock.ts b/src/main/managed-server/activation/orcad-activation-lock.ts index 7300e3f9299e..7be50609818a 100644 --- a/src/main/managed-server/activation/orcad-activation-lock.ts +++ b/src/main/managed-server/activation/orcad-activation-lock.ts @@ -12,7 +12,7 @@ import { withoutAbortSignal, type OrcadRemoteExecTarget } from '../install/orcad-remote-runtime-control' -import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec/remote-exec-command' import { acquireInstallLock, RemoteInstallLockBusyError } from '../install/remote-install-lock' import { orphanInstallLockCommand, diff --git a/src/main/managed-server/activation/orcad-activation-record-store.ts b/src/main/managed-server/activation/orcad-activation-record-store.ts index 693820b9f4e3..9879b89c3eff 100644 --- a/src/main/managed-server/activation/orcad-activation-record-store.ts +++ b/src/main/managed-server/activation/orcad-activation-record-store.ts @@ -6,7 +6,7 @@ * activated" would deploy over a live install and lose its rollback target. */ import type { OrcadHostTransport } from '../../ssh/orcad-host-transport' -import { RELAY_REMOTE_DIR } from '../../ssh/remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../../ssh/remote-exec/remote-frame-protocol' import { ORCAD_ACTIVATION_FILENAME, emptyOrcadActivationRecord, diff --git a/src/main/managed-server/activation/orcad-activation-transaction.test.ts b/src/main/managed-server/activation/orcad-activation-transaction.test.ts index b51e187acaef..e75b55103efb 100644 --- a/src/main/managed-server/activation/orcad-activation-transaction.test.ts +++ b/src/main/managed-server/activation/orcad-activation-transaction.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import type * as InstallLock from '../install/remote-install-lock' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn().mockResolvedValue('') })) @@ -11,7 +11,7 @@ vi.mock('../install/remote-install-lock', async (importOriginal) => ({ acquireInstallLock: vi.fn().mockResolvedValue(undefined) })) -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { acquireInstallLock, RemoteInstallLockBusyError } from '../install/remote-install-lock' import { parseOrcadActivationTransaction, diff --git a/src/main/managed-server/activation/orcad-activation-transaction.ts b/src/main/managed-server/activation/orcad-activation-transaction.ts index 2de8fd077b3c..0e7ba2f36cfc 100644 --- a/src/main/managed-server/activation/orcad-activation-transaction.ts +++ b/src/main/managed-server/activation/orcad-activation-transaction.ts @@ -25,7 +25,7 @@ import { } from '../lifecycle/orcad-decommission-transaction' import { errorMessage } from '../../../shared/error-message' import { RELAY_INSTALL_LOCK_NAME } from '../../../shared/relay-install-lock-name' -import { RELAY_REMOTE_DIR } from '../../ssh/remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../../ssh/remote-exec/remote-frame-protocol' import { joinRemotePath, type RemoteHostPlatform } from '../../ssh/ssh-remote-platform' export const ORCAD_ACTIVATION_TRANSACTION_FILENAME = 'transaction.json' diff --git a/src/main/managed-server/host-state/orcad-machine-claim-command.ts b/src/main/managed-server/host-state/orcad-machine-claim-command.ts index ad8c6e60dc91..6c6058f4a5b8 100644 --- a/src/main/managed-server/host-state/orcad-machine-claim-command.ts +++ b/src/main/managed-server/host-state/orcad-machine-claim-command.ts @@ -1,6 +1,6 @@ import { randomUUID } from 'node:crypto' import { shellEscape } from '../../ssh/ssh-connection-utils' -import { RELAY_REMOTE_DIR } from '../../ssh/remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../../ssh/remote-exec/remote-frame-protocol' import { ORCAD_MACHINE_CLAIM_FILENAME, ORCAD_MACHINE_CLAIM_SCHEMA_VERSION diff --git a/src/main/managed-server/host-state/orcad-machine-home.test.ts b/src/main/managed-server/host-state/orcad-machine-home.test.ts index e728ffb65055..1d55ce1ae95a 100644 --- a/src/main/managed-server/host-state/orcad-machine-home.test.ts +++ b/src/main/managed-server/host-state/orcad-machine-home.test.ts @@ -12,7 +12,7 @@ import { import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import type { OrcadMachineHomeProbe } from './orcad-machine-home' import type { OrcadHostTransport } from '../../ssh/orcad-host-transport' import type { RemoteHostPlatform } from '../../ssh/ssh-remote-platform' @@ -21,7 +21,7 @@ import type { RemoteHostPlatform } from '../../ssh/ssh-remote-platform' const shell = vi.hoisted((): { env: NodeJS.ProcessEnv | undefined } => ({ env: undefined })) -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => { +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => { const { runProcess } = await import('@orca/process-host') return { ...(await importOriginal()), @@ -32,7 +32,7 @@ vi.mock('../../ssh/remote-exec-command', async (importOriginal) => { env: conn.env ?? shell.env }) if (result.code !== 0) { - const { sshCommandExitError } = await import('../../ssh/remote-exec-command') + const { sshCommandExitError } = await import('../../ssh/remote-exec/remote-exec-command') throw sshCommandExitError(command, result.code ?? 1, result.stdout) } return result.stdout diff --git a/src/main/managed-server/host-state/orcad-machine-home.ts b/src/main/managed-server/host-state/orcad-machine-home.ts index 7ca9beb35626..1404fd542210 100644 --- a/src/main/managed-server/host-state/orcad-machine-home.ts +++ b/src/main/managed-server/host-state/orcad-machine-home.ts @@ -12,7 +12,7 @@ */ import { createHash } from 'node:crypto' import { shellEscape } from '../../ssh/ssh-connection-utils' -import { RELAY_REMOTE_DIR } from '../../ssh/remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../../ssh/remote-exec/remote-frame-protocol' import { ORCAD_ACTIVATION_FILENAME } from '../activation/orcad-activation-record' import { parseDarwinPlatformUuid } from '../../persistence/profile-state/profile-state-access-identity' import { diff --git a/src/main/managed-server/host-state/orcad-state-mutation-exec.test.ts b/src/main/managed-server/host-state/orcad-state-mutation-exec.test.ts index fde1f054db0a..6865d6d08a7e 100644 --- a/src/main/managed-server/host-state/orcad-state-mutation-exec.test.ts +++ b/src/main/managed-server/host-state/orcad-state-mutation-exec.test.ts @@ -7,7 +7,7 @@ import { execOrcadStateMutationOr } from './orcad-state-mutation-exec' import { execOrcadRemoteOr } from '../install/orcad-remote-runtime-control' -import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec/remote-exec-command' import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' import type { OrcadHostTransport } from '../../ssh/orcad-host-transport' diff --git a/src/main/managed-server/host-state/orcad-state-mutation-exec.ts b/src/main/managed-server/host-state/orcad-state-mutation-exec.ts index 69dc25e495d3..86cd33909f38 100644 --- a/src/main/managed-server/host-state/orcad-state-mutation-exec.ts +++ b/src/main/managed-server/host-state/orcad-state-mutation-exec.ts @@ -12,7 +12,10 @@ import { ORCAD_STATE_MUTATION_DEADLINE } from './orcad-state-snapshot-members' import type { OrcadRemoteExecTarget } from '../install/orcad-remote-runtime-control' -import { execCommand, isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { + execCommand, + isUnconfirmedSshCommandTermination +} from '../../ssh/remote-exec/remote-exec-command' import { isOrcadFenceLost, OrcadFenceLostError } from '../activation/orcad-activation-fence-scope' // Longer than the host's own deadline, so the host kills the work before the client gives up. diff --git a/src/main/managed-server/host-state/orcad-state-mutation-timeout.test.ts b/src/main/managed-server/host-state/orcad-state-mutation-timeout.test.ts index 8e883245041c..9af2a8287664 100644 --- a/src/main/managed-server/host-state/orcad-state-mutation-timeout.test.ts +++ b/src/main/managed-server/host-state/orcad-state-mutation-timeout.test.ts @@ -5,12 +5,12 @@ * command shape) runs beside it, as the two restores did on a real host. */ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import type * as RecordFile from '../install/orcad-remote-record-file' import type * as InstallLock from '../install/remote-install-lock' import type * as VersionedInstall from '../install/remote-versioned-install' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -39,7 +39,7 @@ import { execCommand, SSH_EXEC_TIMEOUT_CODE, isUnconfirmedSshCommandTermination -} from '../../ssh/remote-exec-command' +} from '../../ssh/remote-exec/remote-exec-command' import { acquireInstallLock } from '../install/remote-install-lock' import { writeAtomicOrcadRemoteRecord } from '../install/orcad-remote-record-file' import { deployOrcad } from '../../ssh/orcad-remote-deploy' diff --git a/src/main/managed-server/install/orcad-remote-context.ts b/src/main/managed-server/install/orcad-remote-context.ts index 07401dba139e..9d5b318de482 100644 --- a/src/main/managed-server/install/orcad-remote-context.ts +++ b/src/main/managed-server/install/orcad-remote-context.ts @@ -23,7 +23,7 @@ import { orcadMachineClaimCommand } from '../host-state/orcad-machine-claim-comm import { execOrcadRemote, type OrcadRemoteExecTarget } from './orcad-remote-runtime-control' import { readRemoteHomeCommand } from '../../ssh/ssh-remote-commands' import { shellEscape } from '../../ssh/ssh-connection-utils' -import { RELAY_REMOTE_DIR } from '../../ssh/remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../../ssh/remote-exec/remote-frame-protocol' import { isWindowsRemoteHost, joinRemotePath, diff --git a/src/main/managed-server/install/orcad-remote-decommission.test.ts b/src/main/managed-server/install/orcad-remote-decommission.test.ts index a6419c4bdd86..873b24cd9f74 100644 --- a/src/main/managed-server/install/orcad-remote-decommission.test.ts +++ b/src/main/managed-server/install/orcad-remote-decommission.test.ts @@ -1,9 +1,9 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import type * as RecordFile from './orcad-remote-record-file' import type * as InstallLock from './remote-install-lock' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -17,7 +17,7 @@ vi.mock('./orcad-remote-record-file', async (importOriginal) => ({ writeAtomicOrcadRemoteRecord: vi.fn() })) -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { acquireInstallLock } from './remote-install-lock' import { writeAtomicOrcadRemoteRecord } from './orcad-remote-record-file' import { decommissionRemoteOrcad } from './orcad-remote-decommission' diff --git a/src/main/managed-server/install/orcad-remote-gc.test.ts b/src/main/managed-server/install/orcad-remote-gc.test.ts index 372b548a3285..4be62080738c 100644 --- a/src/main/managed-server/install/orcad-remote-gc.test.ts +++ b/src/main/managed-server/install/orcad-remote-gc.test.ts @@ -1,7 +1,7 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -21,7 +21,7 @@ vi.mock('./remote-install-lock', () => ({ isRelayInstallLockStale: vi.fn().mockResolvedValue(false) })) -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { gcOldOrcadVersions } from './orcad-remote-gc' import { emptyOrcadActivationRecord } from '../activation/orcad-activation-record' import { serializeOrcadActivationTransaction } from '../activation/orcad-activation-transaction' diff --git a/src/main/managed-server/install/orcad-remote-gc.ts b/src/main/managed-server/install/orcad-remote-gc.ts index e9a66f8f4043..7bf3eafcec57 100644 --- a/src/main/managed-server/install/orcad-remote-gc.ts +++ b/src/main/managed-server/install/orcad-remote-gc.ts @@ -14,7 +14,10 @@ * pinned too, and an unreadable journal skips the pass entirely. */ import type { OrcadHostTransport } from '../../ssh/orcad-host-transport' -import { execCommand, isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { + execCommand, + isUnconfirmedSshCommandTermination +} from '../../ssh/remote-exec/remote-exec-command' import { ORCAD_INSTALL_MODEL } from './remote-install-model' import { gcOldRemoteInstallVersions } from './remote-install-gc' import { @@ -33,7 +36,7 @@ import { joinRemotePath, type RemoteHostPlatform } from '../../ssh/ssh-remote-platform' -import { RELAY_REMOTE_DIR } from '../../ssh/remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../../ssh/remote-exec/remote-frame-protocol' import { orcadWindowsHomeOpCommand } from './orcad-remote-windows-node' import { ORCAD_WINDOWS_LIVENESS_MANY_MARKER } from '../host-state/orcad-windows-host-script' diff --git a/src/main/managed-server/install/orcad-remote-install-termination.test.ts b/src/main/managed-server/install/orcad-remote-install-termination.test.ts index 127a0298ee4a..99ad8ccd9ff8 100644 --- a/src/main/managed-server/install/orcad-remote-install-termination.test.ts +++ b/src/main/managed-server/install/orcad-remote-install-termination.test.ts @@ -1,7 +1,7 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -18,7 +18,7 @@ vi.mock('./orcad-remote-node-runtime', () => ({ })) import type { OrcadHostTransport } from '../../ssh/orcad-host-transport' -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { uploadRelayDirectory, writeRelayFile } from './remote-install-transfers' import { installOrcadBundle } from './orcad-remote-install' import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' diff --git a/src/main/managed-server/install/orcad-remote-install.ts b/src/main/managed-server/install/orcad-remote-install.ts index 59372409cab2..260e2c45ad46 100644 --- a/src/main/managed-server/install/orcad-remote-install.ts +++ b/src/main/managed-server/install/orcad-remote-install.ts @@ -4,7 +4,10 @@ import { orcadAgentBrowserNativeName } from '../../../shared/orcad-agent-browser import type { NodeRuntimeTarget } from '../../../shared/node-runtime-pin' import { ensureRemoteOrcadNodeRuntime } from './orcad-remote-node-runtime' import { recordedRemoteNodeRuntimeProbeCommand } from './orcad-remote-node-runtime-recorded-probe' -import { execCommand, isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { + execCommand, + isUnconfirmedSshCommandTermination +} from '../../ssh/remote-exec/remote-exec-command' import { shellEscape } from '../../ssh/ssh-connection-utils' import type { OrcadHostTransport } from '../../ssh/orcad-host-transport' import { joinRemotePath, type RemoteHostPlatform } from '../../ssh/ssh-remote-platform' diff --git a/src/main/managed-server/install/orcad-remote-launch.ts b/src/main/managed-server/install/orcad-remote-launch.ts index 38726eb80776..e20ffdbdfef0 100644 --- a/src/main/managed-server/install/orcad-remote-launch.ts +++ b/src/main/managed-server/install/orcad-remote-launch.ts @@ -25,7 +25,7 @@ import { remoteDirname, type RemoteHostPlatform } from '../../ssh/ssh-remote-platform' -import { RELAY_REMOTE_DIR } from '../../ssh/remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../../ssh/remote-exec/remote-frame-protocol' import { ORCAD_WSL_HOST_ENV } from '../../ipc/wsl-guest-windows-drive-path' import { assertPosixOrcadHost as assertPosixHost, diff --git a/src/main/managed-server/install/orcad-remote-lifecycle-windows.test.ts b/src/main/managed-server/install/orcad-remote-lifecycle-windows.test.ts index bb7a72827c88..ce516ffbde5d 100644 --- a/src/main/managed-server/install/orcad-remote-lifecycle-windows.test.ts +++ b/src/main/managed-server/install/orcad-remote-lifecycle-windows.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import type * as TerminalBarrier from '../lifecycle/orcad-rollback-terminal-barrier' /** * The deploy and rollback drivers end to end against a Windows host whose every host op is answered by a @@ -7,7 +7,7 @@ import type * as TerminalBarrier from '../lifecycle/orcad-rollback-terminal-barr import { beforeEach, describe, expect, it, vi } from 'vitest' import type * as RecordFile from './orcad-remote-record-file' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -50,7 +50,7 @@ vi.mock('./remote-versioned-install', async (importOriginal) => ({ abandonInstall: vi.fn().mockResolvedValue(undefined) })) -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { deployOrcad, type OrcadDeployOptions } from '../../ssh/orcad-remote-deploy' import { rollbackOrcad } from './orcad-remote-rollback' import { emptyOrcadActivationRecord } from '../activation/orcad-activation-record' diff --git a/src/main/managed-server/install/orcad-remote-log-tail.test.ts b/src/main/managed-server/install/orcad-remote-log-tail.test.ts index 04aaa6406911..7827d56999b4 100644 --- a/src/main/managed-server/install/orcad-remote-log-tail.test.ts +++ b/src/main/managed-server/install/orcad-remote-log-tail.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' @@ -15,7 +15,7 @@ import { ORCAD_WINDOWS_HOST_SCRIPT } from '../host-state/orcad-windows-host-scri import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' const execCommand = vi.hoisted(() => vi.fn()) -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand })) diff --git a/src/main/managed-server/install/orcad-remote-log-tail.ts b/src/main/managed-server/install/orcad-remote-log-tail.ts index b06882659ad9..e4b4d336af8e 100644 --- a/src/main/managed-server/install/orcad-remote-log-tail.ts +++ b/src/main/managed-server/install/orcad-remote-log-tail.ts @@ -6,7 +6,7 @@ import { redactString } from '../../observability/redactor' import { shellEscape } from '../../ssh/ssh-connection-utils' import { ORCAD_LOG_FILENAME } from './orcad-remote-host-support' -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { isWindowsRemoteHost, joinRemotePath, diff --git a/src/main/managed-server/install/orcad-remote-node-runtime-promotion-lock.test.ts b/src/main/managed-server/install/orcad-remote-node-runtime-promotion-lock.test.ts index 014bbfc9713b..dccfcdffdc5b 100644 --- a/src/main/managed-server/install/orcad-remote-node-runtime-promotion-lock.test.ts +++ b/src/main/managed-server/install/orcad-remote-node-runtime-promotion-lock.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' @@ -13,10 +13,10 @@ import { REMOTE_NODE_RUNTIME_READY } from '../../ssh/orcad-remote-node-runtime-report' import { RUNTIME_STORE_LOCK_NAME } from './remote-node-runtime-store-lock' -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) diff --git a/src/main/managed-server/install/orcad-remote-node-runtime-recorded-probe.test.ts b/src/main/managed-server/install/orcad-remote-node-runtime-recorded-probe.test.ts index be196c52d08b..8462ec5fd6ca 100644 --- a/src/main/managed-server/install/orcad-remote-node-runtime-recorded-probe.test.ts +++ b/src/main/managed-server/install/orcad-remote-node-runtime-recorded-probe.test.ts @@ -28,11 +28,11 @@ import { recordedRemoteNodeRuntimeProbeCommand, REMOTE_NODE_RUNTIME_HASHED_STAT_FILENAME } from './orcad-remote-node-runtime-recorded-probe' -import { execCommand } from '../../ssh/remote-exec-command' -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) diff --git a/src/main/managed-server/install/orcad-remote-node-runtime-slow-hash.test.ts b/src/main/managed-server/install/orcad-remote-node-runtime-slow-hash.test.ts index 19a97fcda204..132de1faee2d 100644 --- a/src/main/managed-server/install/orcad-remote-node-runtime-slow-hash.test.ts +++ b/src/main/managed-server/install/orcad-remote-node-runtime-slow-hash.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' @@ -16,11 +16,11 @@ import { REMOTE_NODE_RUNTIME_VERIFIED_MARKER } from '../../ssh/orcad-remote-node-runtime-report' import { RUNTIME_STORE_LOCK_NAME, withRuntimeStoreLock } from './remote-node-runtime-store-lock' -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { uploadRelayDirectory } from './remote-install-transfers' import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) diff --git a/src/main/managed-server/install/orcad-remote-node-runtime-windows.test.ts b/src/main/managed-server/install/orcad-remote-node-runtime-windows.test.ts index 2ececda46fc8..afa80f46cfb7 100644 --- a/src/main/managed-server/install/orcad-remote-node-runtime-windows.test.ts +++ b/src/main/managed-server/install/orcad-remote-node-runtime-windows.test.ts @@ -1,9 +1,9 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import path from 'node:path' import { beforeEach, describe, expect, it, vi } from 'vitest' import { NODE_RUNTIME_ASSETS, NODE_RUNTIME_PIN } from '../../../shared/node-runtime-pin' import type { OrcadHostTransport } from '../../ssh/orcad-host-transport' -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { uploadRelayDirectory } from './remote-install-transfers' import { ensureRemoteOrcadNodeRuntime, @@ -25,7 +25,7 @@ import { import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' import { decodeRemotePowerShellScript } from '../../ssh/ssh-remote-powershell' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) diff --git a/src/main/managed-server/install/orcad-remote-node-runtime.ts b/src/main/managed-server/install/orcad-remote-node-runtime.ts index 62cebf3276df..b06cbf5a818e 100644 --- a/src/main/managed-server/install/orcad-remote-node-runtime.ts +++ b/src/main/managed-server/install/orcad-remote-node-runtime.ts @@ -24,7 +24,10 @@ import { } from '../../../shared/orcad-artifacts' import type { OrcadHostTransport } from '../../ssh/orcad-host-transport' import { shellEscape } from '../../ssh/ssh-connection-utils' -import { execCommand, isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { + execCommand, + isUnconfirmedSshCommandTermination +} from '../../ssh/remote-exec/remote-exec-command' import { uploadRelayDirectory } from './remote-install-transfers' import { isWindowsRemoteHost, diff --git a/src/main/managed-server/install/orcad-remote-preflight.ts b/src/main/managed-server/install/orcad-remote-preflight.ts index 9be9ffa4d487..2386779569cc 100644 --- a/src/main/managed-server/install/orcad-remote-preflight.ts +++ b/src/main/managed-server/install/orcad-remote-preflight.ts @@ -15,7 +15,7 @@ import { import { readWindowsOrcadSlotEntry } from './orcad-remote-launch-windows' import { ORCAD_WINDOWS_RUNTIME_MARKER } from '../host-state/orcad-windows-host-script' import { orcadNodeSlotRuntimeCommand, selectOrcadSlotEntryCommand } from './orcad-remote-runtime' -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { shellEscape } from '../../ssh/ssh-connection-utils' import { isWindowsRemoteHost, diff --git a/src/main/managed-server/install/orcad-remote-primitives.test.ts b/src/main/managed-server/install/orcad-remote-primitives.test.ts index 4ff84ffd914b..071534b41f36 100644 --- a/src/main/managed-server/install/orcad-remote-primitives.test.ts +++ b/src/main/managed-server/install/orcad-remote-primitives.test.ts @@ -1,7 +1,7 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn(), isUnconfirmedSshCommandTermination: (error: unknown) => @@ -13,7 +13,7 @@ vi.mock('../host-state/orcad-windows-host-preparation', () => ({ prepareWindowsOrcadHost: vi.fn() })) -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { detectRemoteHostPlatform } from '../../ssh/ssh-remote-platform-detection' import { prepareWindowsOrcadHost } from '../host-state/orcad-windows-host-preparation' import { resolveOrcadRemoteContext } from './orcad-remote-context' diff --git a/src/main/managed-server/install/orcad-remote-record-file.ts b/src/main/managed-server/install/orcad-remote-record-file.ts index fca3bdd6626a..35c61db49246 100644 --- a/src/main/managed-server/install/orcad-remote-record-file.ts +++ b/src/main/managed-server/install/orcad-remote-record-file.ts @@ -8,7 +8,7 @@ import { randomUUID } from 'node:crypto' import { shellEscape } from '../../ssh/ssh-connection-utils' import { removeRemoteFileCommand } from '../../ssh/ssh-remote-commands' import { execOrcadRemote, type OrcadRemoteExecTarget } from './orcad-remote-runtime-control' -import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec/remote-exec-command' import { isWindowsRemoteHost } from '../../ssh/ssh-remote-platform' import { orcadRemoteBaseDir, diff --git a/src/main/managed-server/install/orcad-remote-rollback.test.ts b/src/main/managed-server/install/orcad-remote-rollback.test.ts index 071de4d2cef7..19a5fbd4a1d5 100644 --- a/src/main/managed-server/install/orcad-remote-rollback.test.ts +++ b/src/main/managed-server/install/orcad-remote-rollback.test.ts @@ -1,10 +1,10 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' import type * as RecordFile from './orcad-remote-record-file' import type * as InstallLock from './remote-install-lock' import type * as TerminalBarrier from '../lifecycle/orcad-rollback-terminal-barrier' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -52,7 +52,7 @@ vi.mock('../lifecycle/orcad-rollback-terminal-barrier', async (importOriginal) = } })) -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { writeAtomicOrcadRemoteRecord } from './orcad-remote-record-file' import { rollbackOrcad, type OrcadRollbackOptions } from './orcad-remote-rollback' import { diff --git a/src/main/managed-server/install/orcad-remote-runtime-control.test.ts b/src/main/managed-server/install/orcad-remote-runtime-control.test.ts index e288f917e547..69623e1d6e39 100644 --- a/src/main/managed-server/install/orcad-remote-runtime-control.test.ts +++ b/src/main/managed-server/install/orcad-remote-runtime-control.test.ts @@ -1,14 +1,14 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn(), isUnconfirmedSshCommandTermination: (error: unknown) => error instanceof Error && error.message === 'unconfirmed' })) -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { launchOrcadAndAwaitReadiness } from './orcad-remote-runtime-control' import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' import type { OrcadLaunchSpec } from './orcad-remote-launch' diff --git a/src/main/managed-server/install/orcad-remote-runtime-control.ts b/src/main/managed-server/install/orcad-remote-runtime-control.ts index 14a0ad1250d5..3435312090da 100644 --- a/src/main/managed-server/install/orcad-remote-runtime-control.ts +++ b/src/main/managed-server/install/orcad-remote-runtime-control.ts @@ -20,7 +20,10 @@ import { } from './orcad-remote-readiness-wait' import type { OrcadHostTransport } from '../../ssh/orcad-host-transport' import { errorMessage } from '../../../shared/error-message' -import { execCommand, isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { + execCommand, + isUnconfirmedSshCommandTermination +} from '../../ssh/remote-exec/remote-exec-command' import { currentOrcadFence, isOrcadFenceLost, diff --git a/src/main/managed-server/install/orcad-remote-windows-commands.test.ts b/src/main/managed-server/install/orcad-remote-windows-commands.test.ts index 6b2508303ce2..fe705520f0de 100644 --- a/src/main/managed-server/install/orcad-remote-windows-commands.test.ts +++ b/src/main/managed-server/install/orcad-remote-windows-commands.test.ts @@ -1,12 +1,12 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import type { OrcadHostTransport } from '../../ssh/orcad-host-transport' import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' import { orcadLivenessProbeCommand, type OrcadLaunchSpec } from './orcad-remote-launch' diff --git a/src/main/managed-server/install/orcad-remote-windows-decommission.test.ts b/src/main/managed-server/install/orcad-remote-windows-decommission.test.ts index 75ed326fd34f..de2ec5635b3f 100644 --- a/src/main/managed-server/install/orcad-remote-windows-decommission.test.ts +++ b/src/main/managed-server/install/orcad-remote-windows-decommission.test.ts @@ -3,12 +3,12 @@ * a staged managed request run by the slot's node.exe, and GC screens every candidate in one * node.exe instead of one per version dir. */ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' import type * as RecordFile from './orcad-remote-record-file' import type * as InstallLock from './remote-install-lock' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -25,7 +25,7 @@ vi.mock('./remote-install-gc', async (importOriginal) => ({ gcOldRemoteInstallVersions: vi.fn().mockResolvedValue(undefined) })) -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { writeAtomicOrcadRemoteRecord } from './orcad-remote-record-file' import { gcOldRemoteInstallVersions } from './remote-install-gc' import { decommissionRemoteOrcad } from './orcad-remote-decommission' diff --git a/src/main/managed-server/install/orcad-remote-windows-node.ts b/src/main/managed-server/install/orcad-remote-windows-node.ts index 5451b82be6fc..fc6c8d837b67 100644 --- a/src/main/managed-server/install/orcad-remote-windows-node.ts +++ b/src/main/managed-server/install/orcad-remote-windows-node.ts @@ -19,8 +19,11 @@ import { import { pinnedNodeRuntimeAsset, type NodeRuntimeTarget } from '../../../shared/node-runtime-pin' import { randomUUID } from 'node:crypto' import type { OrcadHostTransport } from '../../ssh/orcad-host-transport' -import { execCommand, isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' -import { RELAY_REMOTE_DIR } from '../../ssh/remote-frame-protocol' +import { + execCommand, + isUnconfirmedSshCommandTermination +} from '../../ssh/remote-exec/remote-exec-command' +import { RELAY_REMOTE_DIR } from '../../ssh/remote-exec/remote-frame-protocol' import { joinRemotePath, remoteDirname, diff --git a/src/main/managed-server/install/remote-install-gc-claim-termination.test.ts b/src/main/managed-server/install/remote-install-gc-claim-termination.test.ts index 0aed0bccfffa..360c3cae0a01 100644 --- a/src/main/managed-server/install/remote-install-gc-claim-termination.test.ts +++ b/src/main/managed-server/install/remote-install-gc-claim-termination.test.ts @@ -1,13 +1,13 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) import type { SshConnection } from '../../ssh/ssh-connection' -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { isRelayGcClaimOwned, releaseRelayGcClaim, diff --git a/src/main/managed-server/install/remote-install-gc-claim.ts b/src/main/managed-server/install/remote-install-gc-claim.ts index 1199022abb43..d51bcd71a5ec 100644 --- a/src/main/managed-server/install/remote-install-gc-claim.ts +++ b/src/main/managed-server/install/remote-install-gc-claim.ts @@ -1,8 +1,8 @@ import { randomUUID } from 'node:crypto' import type { RemoteInstallTransport } from './remote-install-transport' import { shellEscape } from '../../ssh/ssh-connection-utils' -import { execHostCommand } from '../../ssh/remote-host-exec' -import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { execHostCommand } from '../../ssh/remote-exec/remote-host-exec' +import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec/remote-exec-command' import { probeInstallLockExistsCommand, tryCreateInstallLockCommand, diff --git a/src/main/managed-server/install/remote-install-gc-listing.test-fixture.ts b/src/main/managed-server/install/remote-install-gc-listing.test-fixture.ts index 3be335b0219d..e5b4c070463d 100644 --- a/src/main/managed-server/install/remote-install-gc-listing.test-fixture.ts +++ b/src/main/managed-server/install/remote-install-gc-listing.test-fixture.ts @@ -7,7 +7,7 @@ import type { ClientChannel } from 'ssh2' import { runProcess, spawnProcess } from '@orca/process-host' import type { SshConnection } from '../../ssh/ssh-connection' import { shellEscape } from '../../ssh/ssh-connection-utils' -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' export const SSH_EXEC_OUTPUT_CAP_CHARS = 1024 * 1024 diff --git a/src/main/managed-server/install/remote-install-gc-termination.test.ts b/src/main/managed-server/install/remote-install-gc-termination.test.ts index 2f7d762b7ac6..d4e8fca9eca1 100644 --- a/src/main/managed-server/install/remote-install-gc-termination.test.ts +++ b/src/main/managed-server/install/remote-install-gc-termination.test.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -9,7 +9,7 @@ vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ import type { SshConnection } from '../../ssh/ssh-connection' import { gcOldRemoteInstallVersions } from './remote-install-gc' import { ORCAD_INSTALL_MODEL } from './remote-install-model' -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: all connection access is replaced by execCommand's mock. diff --git a/src/main/managed-server/install/remote-install-gc-tombstone.ts b/src/main/managed-server/install/remote-install-gc-tombstone.ts index ee85cadc04a7..0723209099c3 100644 --- a/src/main/managed-server/install/remote-install-gc-tombstone.ts +++ b/src/main/managed-server/install/remote-install-gc-tombstone.ts @@ -1,5 +1,8 @@ import type { RemoteInstallTransport } from './remote-install-transport' -import { execCommand, isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { + execCommand, + isUnconfirmedSshCommandTermination +} from '../../ssh/remote-exec/remote-exec-command' import { remoteInstallGcTombstoneRegex, type RemoteInstallModel } from './remote-install-model' import { removeRemoteTreeCommand } from '../../ssh/ssh-remote-commands' import { diff --git a/src/main/managed-server/install/remote-install-gc.ts b/src/main/managed-server/install/remote-install-gc.ts index e82b276ba5a8..68e7bef5bba1 100644 --- a/src/main/managed-server/install/remote-install-gc.ts +++ b/src/main/managed-server/install/remote-install-gc.ts @@ -6,8 +6,8 @@ * until the relay-era upgrade window closes. */ import type { RemoteInstallTransport } from './remote-install-transport' -import { RELAY_REMOTE_DIR } from '../../ssh/remote-frame-protocol' -import { execHostCommand } from '../../ssh/remote-host-exec' +import { RELAY_REMOTE_DIR } from '../../ssh/remote-exec/remote-frame-protocol' +import { execHostCommand } from '../../ssh/remote-exec/remote-host-exec' import { probeInstallLockExistsCommand } from './remote-install-lock-commands' import { isRelayInstallLockStale, RELAY_INSTALL_LOCK_NAME } from './remote-install-lock' import { @@ -34,7 +34,7 @@ import { remoteBasename, type RemoteHostPlatform } from '../../ssh/ssh-remote-platform' -import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec/remote-exec-command' const DEFAULT_REMOTE_HOST = getRemoteHostPlatform('linux-x64') diff --git a/src/main/managed-server/install/remote-install-lock-termination.test.ts b/src/main/managed-server/install/remote-install-lock-termination.test.ts index 9c36a5a67dbd..5b090d53c830 100644 --- a/src/main/managed-server/install/remote-install-lock-termination.test.ts +++ b/src/main/managed-server/install/remote-install-lock-termination.test.ts @@ -1,13 +1,13 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) import type { SshConnection } from '../../ssh/ssh-connection' -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { acquireInstallLock, isRelayInstallLockStale } from './remote-install-lock' import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' diff --git a/src/main/managed-server/install/remote-install-lock.test.ts b/src/main/managed-server/install/remote-install-lock.test.ts index f0e977714b0c..69bad2258e45 100644 --- a/src/main/managed-server/install/remote-install-lock.test.ts +++ b/src/main/managed-server/install/remote-install-lock.test.ts @@ -1,8 +1,8 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { afterEach, describe, expect, it, vi } from 'vitest' import type { SshConnection } from '../../ssh/ssh-connection' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn(), isUnconfirmedSshCommandTermination: (error: unknown) => @@ -15,7 +15,7 @@ vi.mock('./remote-install-gc-claim', () => ({ waitForRelayGcClaimRelease: vi.fn().mockResolvedValue(undefined) })) -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { acquireInstallLock, RemoteInstallLockBusyError } from './remote-install-lock' import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' diff --git a/src/main/managed-server/install/remote-install-lock.ts b/src/main/managed-server/install/remote-install-lock.ts index 99919c6b521b..f70258d2b780 100644 --- a/src/main/managed-server/install/remote-install-lock.ts +++ b/src/main/managed-server/install/remote-install-lock.ts @@ -1,7 +1,7 @@ import type { RemoteInstallTransport } from './remote-install-transport' -import { execHostCommand } from '../../ssh/remote-host-exec' +import { execHostCommand } from '../../ssh/remote-exec/remote-host-exec' import { RELAY_DEPLOY_TIMEOUT_MS } from './remote-deploy-timing' -import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec/remote-exec-command' import { isRelayGcClaimed, waitForRelayGcClaimRelease } from './remote-install-gc-claim' import { acquireInstallLockParentCommand, diff --git a/src/main/managed-server/install/remote-install-transfers.ts b/src/main/managed-server/install/remote-install-transfers.ts index 4c1db6143216..b03a1b691bb1 100644 --- a/src/main/managed-server/install/remote-install-transfers.ts +++ b/src/main/managed-server/install/remote-install-transfers.ts @@ -8,7 +8,7 @@ import { uploadDirectoryViaExecStdin, writeStringViaExecStdin } from '../../ssh/ssh-exec-stdin-file-transfer' -import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec/remote-exec-command' import { describeSandboxedSftpFailure, isSandboxedSftpNamespaceError diff --git a/src/main/managed-server/install/remote-node-runtime-store-gc.test.ts b/src/main/managed-server/install/remote-node-runtime-store-gc.test.ts index 15836a505f53..75151b5e56c2 100644 --- a/src/main/managed-server/install/remote-node-runtime-store-gc.test.ts +++ b/src/main/managed-server/install/remote-node-runtime-store-gc.test.ts @@ -13,9 +13,9 @@ import { once } from 'node:events' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -34,7 +34,7 @@ import { runtimeStoreInventoryCommand, type RuntimeStoreInventory } from './remote-node-runtime-store-inventory' -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: all connection access is replaced by execCommand's mock. diff --git a/src/main/managed-server/install/remote-node-runtime-store-gc.ts b/src/main/managed-server/install/remote-node-runtime-store-gc.ts index 5dea21421d98..f1725ffb30a5 100644 --- a/src/main/managed-server/install/remote-node-runtime-store-gc.ts +++ b/src/main/managed-server/install/remote-node-runtime-store-gc.ts @@ -28,7 +28,10 @@ import { tryWithRuntimeStoreLock } from './remote-node-runtime-store-lock' import { shellEscape } from '../../ssh/ssh-connection-utils' -import { execCommand, isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { + execCommand, + isUnconfirmedSshCommandTermination +} from '../../ssh/remote-exec/remote-exec-command' import { INSTALL_LOCK_STALE_MS } from './remote-install-lock' import { moveRemoteTreeCommand, diff --git a/src/main/managed-server/install/remote-node-runtime-store-inventory.ts b/src/main/managed-server/install/remote-node-runtime-store-inventory.ts index c98d21acdf09..c3c0ad47688a 100644 --- a/src/main/managed-server/install/remote-node-runtime-store-inventory.ts +++ b/src/main/managed-server/install/remote-node-runtime-store-inventory.ts @@ -8,7 +8,7 @@ import { ORCAD_RUNTIMES_DIRNAME } from '../../../shared/orcad-artifacts' import { shellEscape } from '../../ssh/ssh-connection-utils' -import { RELAY_REMOTE_DIR } from '../../ssh/remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../../ssh/remote-exec/remote-frame-protocol' import { joinRemotePath, type RemoteHostPlatform } from '../../ssh/ssh-remote-platform' /** A version dir names a runtime it needs with an empty file of this prefix + sha (design D5). */ diff --git a/src/main/managed-server/install/remote-node-runtime-store-lock-host-release.test.ts b/src/main/managed-server/install/remote-node-runtime-store-lock-host-release.test.ts index 724f1444003f..db6b24c1154b 100644 --- a/src/main/managed-server/install/remote-node-runtime-store-lock-host-release.test.ts +++ b/src/main/managed-server/install/remote-node-runtime-store-lock-host-release.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { existsSync, mkdtempSync, readFileSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' @@ -10,11 +10,11 @@ import { RUNTIME_STORE_LOCK_OWNER_FILENAME, withRuntimeStoreLock } from './remote-node-runtime-store-lock' -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { tryCreateInstallLockCommand } from './remote-install-lock-commands' import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) diff --git a/src/main/managed-server/install/remote-node-runtime-store-lock.ts b/src/main/managed-server/install/remote-node-runtime-store-lock.ts index f51ae6359ae5..81beda6dc43d 100644 --- a/src/main/managed-server/install/remote-node-runtime-store-lock.ts +++ b/src/main/managed-server/install/remote-node-runtime-store-lock.ts @@ -7,15 +7,15 @@ import { randomUUID } from 'node:crypto' import { ORCAD_RUNTIMES_DIRNAME } from '../../../shared/orcad-artifacts' import type { RemoteInstallTransport } from './remote-install-transport' import { shellEscape } from '../../ssh/ssh-connection-utils' -import { execHostCommand } from '../../ssh/remote-host-exec' -import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { execHostCommand } from '../../ssh/remote-exec/remote-host-exec' +import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec/remote-exec-command' import { acquireInstallLock, INSTALL_LOCK_STALE_SECONDS } from './remote-install-lock' import { tryCreateInstallLockCommand, tryStealInstallLockCommand, type InstallLockOwnerFile } from './remote-install-lock-commands' -import { RELAY_REMOTE_DIR } from '../../ssh/remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../../ssh/remote-exec/remote-frame-protocol' import { removeRemoteTreeCommand } from '../../ssh/ssh-remote-commands' import { isWindowsRemoteHost, diff --git a/src/main/managed-server/install/remote-node-runtime-store-windows.test.ts b/src/main/managed-server/install/remote-node-runtime-store-windows.test.ts index 91c8a8b992d9..a289137657b4 100644 --- a/src/main/managed-server/install/remote-node-runtime-store-windows.test.ts +++ b/src/main/managed-server/install/remote-node-runtime-store-windows.test.ts @@ -3,9 +3,9 @@ import { copyFileSync, mkdirSync, mkdtempSync, utimesSync, writeFileSync } from import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -18,7 +18,7 @@ import { windowsRuntimeStoreInventoryCommand, windowsSweepStaleRuntimeStagesCommand } from './remote-node-runtime-store-windows' -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' import { decodeRemotePowerShellScript } from '../../ssh/ssh-remote-powershell' import { removeTreeSync } from '../../../shared/windows-transient-lock-removal' diff --git a/src/main/managed-server/install/remote-node-runtime-store-windows.ts b/src/main/managed-server/install/remote-node-runtime-store-windows.ts index 42428f5342fe..3dbd48cd8984 100644 --- a/src/main/managed-server/install/remote-node-runtime-store-windows.ts +++ b/src/main/managed-server/install/remote-node-runtime-store-windows.ts @@ -22,7 +22,7 @@ import { RUNTIME_STORE_TOMBSTONE_PREFIX, runtimeStoreInventoryCommand } from './remote-node-runtime-store-inventory' -import { RELAY_REMOTE_DIR } from '../../ssh/remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../../ssh/remote-exec/remote-frame-protocol' import { isWindowsRemoteHost, joinRemotePath, diff --git a/src/main/managed-server/install/remote-versioned-install-termination.test.ts b/src/main/managed-server/install/remote-versioned-install-termination.test.ts index e602a752e42a..9b22a3fb098e 100644 --- a/src/main/managed-server/install/remote-versioned-install-termination.test.ts +++ b/src/main/managed-server/install/remote-versioned-install-termination.test.ts @@ -1,14 +1,14 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) import type { SshConnection } from '../../ssh/ssh-connection' import { REMOTE_INSTALL_MODELS } from './remote-install-model' -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { abandonInstall, finalizeInstall, diff --git a/src/main/managed-server/install/remote-versioned-install.test.ts b/src/main/managed-server/install/remote-versioned-install.test.ts index eb977dfa72a3..0fff3cda2345 100644 --- a/src/main/managed-server/install/remote-versioned-install.test.ts +++ b/src/main/managed-server/install/remote-versioned-install.test.ts @@ -1,12 +1,12 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' vi.mock('fs', () => ({ existsSync: vi.fn(), readFileSync: vi.fn() })) -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -24,7 +24,10 @@ import { } from './remote-versioned-install' import { gcOldRemoteInstallVersions } from './remote-install-gc' import { ORCAD_INSTALL_MODEL } from './remote-install-model' -import { isUnconfirmedSshCommandTermination, execCommand } from '../../ssh/remote-exec-command' +import { + isUnconfirmedSshCommandTermination, + execCommand +} from '../../ssh/remote-exec/remote-exec-command' import { acquireInstallLock } from './remote-install-lock' import { isRelayGcClaimed, diff --git a/src/main/managed-server/install/remote-versioned-install.ts b/src/main/managed-server/install/remote-versioned-install.ts index 7a69c6f22cbd..b4a8dd594fb1 100644 --- a/src/main/managed-server/install/remote-versioned-install.ts +++ b/src/main/managed-server/install/remote-versioned-install.ts @@ -5,10 +5,10 @@ import { join } from 'node:path' import { existsSync, readFileSync } from 'node:fs' import type { RemoteInstallTransport } from './remote-install-transport' -import { execHostCommand } from '../../ssh/remote-host-exec' -import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { execHostCommand } from '../../ssh/remote-exec/remote-host-exec' +import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec/remote-exec-command' import { RELAY_INSTALL_LOCK_NAME } from './remote-install-lock' -import { RELAY_REMOTE_DIR } from '../../ssh/remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../../ssh/remote-exec/remote-frame-protocol' import { remoteInstallDirName, type RemoteInstallModel } from './remote-install-model' import { probeRemoteInstallCompleteCommand, diff --git a/src/main/managed-server/lifecycle/orcad-decommission-stop.ts b/src/main/managed-server/lifecycle/orcad-decommission-stop.ts index 2d482f6c87f1..644fb6124e8f 100644 --- a/src/main/managed-server/lifecycle/orcad-decommission-stop.ts +++ b/src/main/managed-server/lifecycle/orcad-decommission-stop.ts @@ -5,7 +5,7 @@ * lost answer is `unverifiable`, never exit; cancelling is how a stop that did not finish is * withdrawn, and only an orcad-confirmed cancellation lets the fence go. */ -import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec/remote-exec-command' import { cancelRemoteOrcadManagedStop, completeRemoteOrcadManagedStop diff --git a/src/main/managed-server/lifecycle/orcad-managed-remote-stop.ts b/src/main/managed-server/lifecycle/orcad-managed-remote-stop.ts index f85f406f7466..70d58af0952a 100644 --- a/src/main/managed-server/lifecycle/orcad-managed-remote-stop.ts +++ b/src/main/managed-server/lifecycle/orcad-managed-remote-stop.ts @@ -16,7 +16,7 @@ import { execOrcadRemote } from '../install/orcad-remote-runtime-control' import { readBoundedOrcadRemoteRecord } from '../install/orcad-remote-record-file' import { orcadSlotDir, type OrcadSlotOptions } from '../../ssh/orcad-recovery-slot' import { isWindowsRemoteHost, joinRemotePath } from '../../ssh/ssh-remote-platform' -import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec/remote-exec-command' import { orcadWindowsNodeCommandLine, orcadWindowsSlotOpCommand, diff --git a/src/main/managed-server/lifecycle/orcad-managed-tunnel-bridge-port.test.ts b/src/main/managed-server/lifecycle/orcad-managed-tunnel-bridge-port.test.ts index d00c8d4a2985..50135d4a903a 100644 --- a/src/main/managed-server/lifecycle/orcad-managed-tunnel-bridge-port.test.ts +++ b/src/main/managed-server/lifecycle/orcad-managed-tunnel-bridge-port.test.ts @@ -1,12 +1,12 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import type { SshConnection } from '../../ssh/ssh-connection' import type { PortForwardStartOptions } from '../../ssh/port-forwarding/ssh-port-forward-provider' -import type * as ForwardProcess from '../../ssh/system-ssh-forward-process' +import type * as ForwardProcess from '../../ssh/system-transport/system-ssh-forward-process' const { reserveLocalForwardPort } = vi.hoisted(() => ({ reserveLocalForwardPort: vi.fn(async (port: number, _orphanArgs?: readonly string[]) => port) })) -vi.mock('../../ssh/system-ssh-forward-process', async (importOriginal) => ({ +vi.mock('../../ssh/system-transport/system-ssh-forward-process', async (importOriginal) => ({ ...(await importOriginal()), reserveLocalForwardPort })) diff --git a/src/main/managed-server/lifecycle/orcad-managed-tunnel-transport.ts b/src/main/managed-server/lifecycle/orcad-managed-tunnel-transport.ts index 833f5204bda6..fa7d15d2f2d7 100644 --- a/src/main/managed-server/lifecycle/orcad-managed-tunnel-transport.ts +++ b/src/main/managed-server/lifecycle/orcad-managed-tunnel-transport.ts @@ -23,7 +23,7 @@ import { import { buildSystemSshPortForwardArgs, reserveLocalForwardPort -} from '../../ssh/system-ssh-forward-process' +} from '../../ssh/system-transport/system-ssh-forward-process' type OrcadManagedTunnelTransportDependencies = { forwards: SshPortForwardProvider[] diff --git a/src/main/managed-server/lifecycle/orcad-managed-wake.test.ts b/src/main/managed-server/lifecycle/orcad-managed-wake.test.ts index 43035d1c8bce..6854a5dfea54 100644 --- a/src/main/managed-server/lifecycle/orcad-managed-wake.test.ts +++ b/src/main/managed-server/lifecycle/orcad-managed-wake.test.ts @@ -1,8 +1,8 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import type * as InstallLock from '../install/remote-install-lock' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -12,7 +12,7 @@ vi.mock('../install/remote-install-lock', async (importOriginal) => ({ acquireInstallLock: vi.fn() })) -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { acquireInstallLock, RemoteInstallLockBusyError } from '../install/remote-install-lock' import { wakeStoppedManagedOrcad } from './orcad-managed-wake' import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' diff --git a/src/main/managed-server/lifecycle/orcad-rollback-transition.ts b/src/main/managed-server/lifecycle/orcad-rollback-transition.ts index e0961fd9cce4..0a33e31152b3 100644 --- a/src/main/managed-server/lifecycle/orcad-rollback-transition.ts +++ b/src/main/managed-server/lifecycle/orcad-rollback-transition.ts @@ -2,7 +2,7 @@ import { orcadRemoteBaseDir } from '../install/orcad-remote-windows-node' import { randomUUID } from 'node:crypto' import type { OrcadRollbackOptions, OrcadRollbackResult } from '../install/orcad-remote-rollback' -import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec-command' +import { isUnconfirmedSshCommandTermination } from '../../ssh/remote-exec/remote-exec-command' import { withRolledBackVersion } from '../activation/orcad-activation-record' import { writeOrcadActivationRecord } from '../activation/orcad-activation-record-store' import { launchAndJudgeOrcadSlot } from '../../ssh/orcad-candidate-launch-verdict' diff --git a/src/main/managed-server/lifecycle/orcad-runtime-target.test.ts b/src/main/managed-server/lifecycle/orcad-runtime-target.test.ts index e95579e78e8f..780e936f4aef 100644 --- a/src/main/managed-server/lifecycle/orcad-runtime-target.test.ts +++ b/src/main/managed-server/lifecycle/orcad-runtime-target.test.ts @@ -1,12 +1,12 @@ -import type * as ExecCommandModule from '../../ssh/remote-exec-command' +import type * as ExecCommandModule from '../../ssh/remote-exec/remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' import { resolveOrcadRuntimeTarget } from './orcad-runtime-target' import { SshConnection } from '../../ssh/ssh-connection' import { createCallbacks, createTarget } from '../../ssh/ssh-connection-test-fixtures' -import { execCommand } from '../../ssh/remote-exec-command' +import { execCommand } from '../../ssh/remote-exec/remote-exec-command' import { getRemoteHostPlatform } from '../../ssh/ssh-remote-platform' -vi.mock('../../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) diff --git a/src/main/managed-server/lifecycle/orcad-stdio-bridge-script.ts b/src/main/managed-server/lifecycle/orcad-stdio-bridge-script.ts index 9c8ceb28a801..5e6baa259a34 100644 --- a/src/main/managed-server/lifecycle/orcad-stdio-bridge-script.ts +++ b/src/main/managed-server/lifecycle/orcad-stdio-bridge-script.ts @@ -14,7 +14,7 @@ import { ORCAD_RUNTIMES_DIRNAME } from '../../../shared/orcad-artifacts' import { shellEscape } from '../../ssh/ssh-connection-utils' -import { RELAY_REMOTE_DIR } from '../../ssh/remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../../ssh/remote-exec/remote-frame-protocol' import { ORCAD_MACHINE_HOMES_DIRNAME } from '../host-state/orcad-machine-home' export type OrcadStdioBridgeMode = 'raw' | 'base64' diff --git a/src/main/orca-profiles/profile-active-transfer-worker.test.ts b/src/main/orca-profiles/profile-active-transfer-worker.test.ts index 2e19eaf73f0b..fef3884a54c5 100644 --- a/src/main/orca-profiles/profile-active-transfer-worker.test.ts +++ b/src/main/orca-profiles/profile-active-transfer-worker.test.ts @@ -18,7 +18,7 @@ vi.mock('../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../ssh/ssh-config-parser', () => ({ +vi.mock('../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/orca-profiles/profile-active-transfer.test.ts b/src/main/orca-profiles/profile-active-transfer.test.ts index 0cfd80d7eefb..c1b1328a3ffa 100644 --- a/src/main/orca-profiles/profile-active-transfer.test.ts +++ b/src/main/orca-profiles/profile-active-transfer.test.ts @@ -30,7 +30,7 @@ vi.mock('../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../telemetry/cohort-classifier', () => ({ getCohortAtEmit: vi.fn(() => ({ nth_repo_added: 2 })) })) -vi.mock('../ssh/ssh-config-parser', () => ({ +vi.mock('../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(() => ({ hosts: [] })), sshConfigHostsToTargets: vi.fn(() => []) })) diff --git a/src/main/orcad/orcad-cross-runtime-daemon-adoption.integration.test.ts b/src/main/orcad/orcad-cross-runtime-daemon-adoption.integration.test.ts index 8ff8858a1cf9..afdb5efc29c3 100644 --- a/src/main/orcad/orcad-cross-runtime-daemon-adoption.integration.test.ts +++ b/src/main/orcad/orcad-cross-runtime-daemon-adoption.integration.test.ts @@ -4,7 +4,7 @@ * are installed side by side as `~/.orca-remote/orcad-/`, launched and stopped with * the client's own deploy commands, and share one data root. */ -import type * as ExecCommandModule from '../ssh/remote-exec-command' +import type * as ExecCommandModule from '../ssh/remote-exec/remote-exec-command' import { build } from 'esbuild' import { copyFileSync, @@ -58,7 +58,7 @@ import { parseOrcadStopOutcome, stopOrcadCommand } from '../managed-server/install/orcad-remote-process-control' -import { RELAY_REMOTE_DIR } from '../ssh/remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../ssh/remote-exec/remote-frame-protocol' import { getRemoteHostPlatform } from '../ssh/ssh-remote-platform' import { skipForMissingInputs, @@ -68,7 +68,7 @@ import { // GC runs its real commands, against this machine instead of an SSH host. const { execMock } = vi.hoisted(() => ({ execMock: vi.fn() })) -vi.mock('../ssh/remote-exec-command', async (importOriginal) => ({ +vi.mock('../ssh/remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: execMock })) diff --git a/src/main/persistence-async-write-syscalls.test.ts b/src/main/persistence-async-write-syscalls.test.ts index e70218edb7f6..eea5515762f3 100644 --- a/src/main/persistence-async-write-syscalls.test.ts +++ b/src/main/persistence-async-write-syscalls.test.ts @@ -64,7 +64,7 @@ vi.mock('node:fs/promises', async (importOriginal) => { }) vi.mock('./telemetry/client', () => ({ track: vi.fn() })) vi.mock('./telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence-automation-extra-agent-args.test.ts b/src/main/persistence-automation-extra-agent-args.test.ts index c64fc3ec9b0d..19b374531614 100644 --- a/src/main/persistence-automation-extra-agent-args.test.ts +++ b/src/main/persistence-automation-extra-agent-args.test.ts @@ -10,7 +10,7 @@ import { rmSync, mkdtempSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/persistence-automations.test.ts b/src/main/persistence-automations.test.ts index fcd61b77ec39..7b9b985159ad 100644 --- a/src/main/persistence-automations.test.ts +++ b/src/main/persistence-automations.test.ts @@ -19,7 +19,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-clipboard-selection-migration.test.ts b/src/main/persistence-clipboard-selection-migration.test.ts index 552aa10b6f76..8bdd5d190e01 100644 --- a/src/main/persistence-clipboard-selection-migration.test.ts +++ b/src/main/persistence-clipboard-selection-migration.test.ts @@ -17,7 +17,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-cohort-and-identity-migration.test.ts b/src/main/persistence-cohort-and-identity-migration.test.ts index 02afa7e3da57..ca40d13e34f9 100644 --- a/src/main/persistence-cohort-and-identity-migration.test.ts +++ b/src/main/persistence-cohort-and-identity-migration.test.ts @@ -24,7 +24,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-deregistered-repo-residue.test.ts b/src/main/persistence-deregistered-repo-residue.test.ts index b519b04cad82..e2d74ffa42d0 100644 --- a/src/main/persistence-deregistered-repo-residue.test.ts +++ b/src/main/persistence-deregistered-repo-residue.test.ts @@ -18,7 +18,7 @@ import { composeWorktreeHostIdentity } from '../shared/worktree/host-qualified-i import { folderWorkspaceKey, worktreeWorkspaceKey } from '../shared/workspace-scope' import type { PersistedState } from '../shared/persisted-state-types' -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/persistence-floating-terminal-trust.test.ts b/src/main/persistence-floating-terminal-trust.test.ts index 49ea6457e6da..b4fefc2b392c 100644 --- a/src/main/persistence-floating-terminal-trust.test.ts +++ b/src/main/persistence-floating-terminal-trust.test.ts @@ -18,7 +18,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-flush-and-save-scheduling.test.ts b/src/main/persistence-flush-and-save-scheduling.test.ts index dbe4ce8262f1..782459df025f 100644 --- a/src/main/persistence-flush-and-save-scheduling.test.ts +++ b/src/main/persistence-flush-and-save-scheduling.test.ts @@ -29,7 +29,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-folder-scan-project-groups.test.ts b/src/main/persistence-folder-scan-project-groups.test.ts index d217c39529af..55cc9b088e9e 100644 --- a/src/main/persistence-folder-scan-project-groups.test.ts +++ b/src/main/persistence-folder-scan-project-groups.test.ts @@ -29,7 +29,7 @@ vi.mock('electron', () => ({ } })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(() => ({ hosts: [] })), sshConfigHostsToTargets: vi.fn(() => []) })) diff --git a/src/main/persistence-folder-workspace-notes.test.ts b/src/main/persistence-folder-workspace-notes.test.ts index 43abe5b74125..0031a6a571ce 100644 --- a/src/main/persistence-folder-workspace-notes.test.ts +++ b/src/main/persistence-folder-workspace-notes.test.ts @@ -19,7 +19,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-host-partitioned-sessions.test.ts b/src/main/persistence-host-partitioned-sessions.test.ts index 1314d8e2ff58..887a20a2a378 100644 --- a/src/main/persistence-host-partitioned-sessions.test.ts +++ b/src/main/persistence-host-partitioned-sessions.test.ts @@ -26,7 +26,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-initial-load.test.ts b/src/main/persistence-initial-load.test.ts index a539d5efa193..ee663d302a2e 100644 --- a/src/main/persistence-initial-load.test.ts +++ b/src/main/persistence-initial-load.test.ts @@ -32,7 +32,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-invalid-workspace-layout-purge.test.ts b/src/main/persistence-invalid-workspace-layout-purge.test.ts index 9912753499a4..84403e351134 100644 --- a/src/main/persistence-invalid-workspace-layout-purge.test.ts +++ b/src/main/persistence-invalid-workspace-layout-purge.test.ts @@ -24,7 +24,7 @@ import { WorkspaceLayoutStream } from './runtime/workspace-layout-stream' import { windowViewSaveForMain } from './persistence/window-save-view' vi.mock('../shared/layout-owner-switch', () => ({ ORCA_LAYOUT_OWNER_IS_MAIN: true })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/persistence-layout-binding-recovery.test.ts b/src/main/persistence-layout-binding-recovery.test.ts index ef903b820bd2..261da79955b1 100644 --- a/src/main/persistence-layout-binding-recovery.test.ts +++ b/src/main/persistence-layout-binding-recovery.test.ts @@ -24,7 +24,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-load-repair-durability.test.ts b/src/main/persistence-load-repair-durability.test.ts index 5cb2bbe8f4f1..5b8ad6033373 100644 --- a/src/main/persistence-load-repair-durability.test.ts +++ b/src/main/persistence-load-repair-durability.test.ts @@ -23,7 +23,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-loading-store-extraction.test.ts b/src/main/persistence-loading-store-extraction.test.ts index 3acec0d56a47..8a07ccf6084c 100644 --- a/src/main/persistence-loading-store-extraction.test.ts +++ b/src/main/persistence-loading-store-extraction.test.ts @@ -48,7 +48,7 @@ vi.mock('electron', () => ({ vi.mock('./telemetry/client', () => ({ track: trackMock })) vi.mock('./telemetry/cohort-classifier', () => ({ getCohortAtEmit: getCohortAtEmitMock })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(() => ({ hosts: [] })), sshConfigHostsToTargets: vi.fn(() => []) })) diff --git a/src/main/persistence-loading-store-write-risks.test.ts b/src/main/persistence-loading-store-write-risks.test.ts index 11b463c631d0..4ad78d87c5b3 100644 --- a/src/main/persistence-loading-store-write-risks.test.ts +++ b/src/main/persistence-loading-store-write-risks.test.ts @@ -4,7 +4,7 @@ import { maintenanceBarrier } from './persistence/loading-store/profile-state-maintenance-fixture' -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/persistence-native-chat-tab-view-mode.test.ts b/src/main/persistence-native-chat-tab-view-mode.test.ts index 96de2f21f678..04b5774fb583 100644 --- a/src/main/persistence-native-chat-tab-view-mode.test.ts +++ b/src/main/persistence-native-chat-tab-view-mode.test.ts @@ -16,7 +16,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-pane-identity-migration.test.ts b/src/main/persistence-pane-identity-migration.test.ts index c39a93636a39..882cd8fa2e81 100644 --- a/src/main/persistence-pane-identity-migration.test.ts +++ b/src/main/persistence-pane-identity-migration.test.ts @@ -25,7 +25,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-protected-secret-fail-closed.test.ts b/src/main/persistence-protected-secret-fail-closed.test.ts index 2fd8404a3af1..01117d763484 100644 --- a/src/main/persistence-protected-secret-fail-closed.test.ts +++ b/src/main/persistence-protected-secret-fail-closed.test.ts @@ -19,7 +19,7 @@ const cipherState = { decryptionThrows: false } -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/persistence-protected-secret-write-race.test.ts b/src/main/persistence-protected-secret-write-race.test.ts index 8388a3ba1deb..d352ad11114f 100644 --- a/src/main/persistence-protected-secret-write-race.test.ts +++ b/src/main/persistence-protected-secret-write-race.test.ts @@ -6,7 +6,7 @@ import { } from './persistence/loading-store/profile-state-maintenance-fixture' import { Store } from './persistence/loading-store/store' -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/persistence-proxy-secret-recovery.test.ts b/src/main/persistence-proxy-secret-recovery.test.ts index 842aa015baca..2d9e949b2098 100644 --- a/src/main/persistence-proxy-secret-recovery.test.ts +++ b/src/main/persistence-proxy-secret-recovery.test.ts @@ -19,7 +19,7 @@ import { installFakeAppEnvironment } from '../../config/scripts/vitest-host-port const testState = { dir: '' } -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/persistence-pty-binding-reconciliation.test.ts b/src/main/persistence-pty-binding-reconciliation.test.ts index c4fbf61f07b4..364960a1c5a7 100644 --- a/src/main/persistence-pty-binding-reconciliation.test.ts +++ b/src/main/persistence-pty-binding-reconciliation.test.ts @@ -19,7 +19,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-remote-session-startup.test.ts b/src/main/persistence-remote-session-startup.test.ts index 0a27afc8d054..91328732cd37 100644 --- a/src/main/persistence-remote-session-startup.test.ts +++ b/src/main/persistence-remote-session-startup.test.ts @@ -6,7 +6,7 @@ import { tmpdir } from 'node:os' import { getDefaultWorkspaceSession } from '../shared/constants' import type { BrowserPage, BrowserWorkspace } from '../shared/browser-workspace-types' -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/persistence-repo-lifecycle.test.ts b/src/main/persistence-repo-lifecycle.test.ts index e954cd05c20c..4187db59eecb 100644 --- a/src/main/persistence-repo-lifecycle.test.ts +++ b/src/main/persistence-repo-lifecycle.test.ts @@ -36,7 +36,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-settings-ui-defaults.test.ts b/src/main/persistence-settings-ui-defaults.test.ts index 3e75cc7d021d..ac4ab6ed1048 100644 --- a/src/main/persistence-settings-ui-defaults.test.ts +++ b/src/main/persistence-settings-ui-defaults.test.ts @@ -21,7 +21,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-settings-update.test.ts b/src/main/persistence-settings-update.test.ts index aced61e0ac40..b1978ed4eadb 100644 --- a/src/main/persistence-settings-update.test.ts +++ b/src/main/persistence-settings-update.test.ts @@ -27,7 +27,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-single-serialize.test.ts b/src/main/persistence-single-serialize.test.ts index 72967bc50cad..d5c36011c249 100644 --- a/src/main/persistence-single-serialize.test.ts +++ b/src/main/persistence-single-serialize.test.ts @@ -17,7 +17,7 @@ import { installFakeAppEnvironment } from '../../config/scripts/vitest-host-port const testState = { dir: '' } -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/persistence-source-control-ai-migration.test.ts b/src/main/persistence-source-control-ai-migration.test.ts index f3969da6ef0c..f478c136ebff 100644 --- a/src/main/persistence-source-control-ai-migration.test.ts +++ b/src/main/persistence-source-control-ai-migration.test.ts @@ -21,7 +21,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-split-pane-incarnation.test.ts b/src/main/persistence-split-pane-incarnation.test.ts index b628c28384bb..9be1133cb665 100644 --- a/src/main/persistence-split-pane-incarnation.test.ts +++ b/src/main/persistence-split-pane-incarnation.test.ts @@ -21,7 +21,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-ssh-remote-cli-control-migration.test.ts b/src/main/persistence-ssh-remote-cli-control-migration.test.ts index 02d6fbbabafa..fa9f75a443dd 100644 --- a/src/main/persistence-ssh-remote-cli-control-migration.test.ts +++ b/src/main/persistence-ssh-remote-cli-control-migration.test.ts @@ -13,7 +13,7 @@ import type { SshTarget } from '../shared/ssh-types' import { isRemoteCliControlAllowed } from '../shared/ssh-remote-cli-control' import { SshConnectionStore } from './ssh/ssh-connection-store' -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/persistence-ssh-remote-pty-binding-replay.test.ts b/src/main/persistence-ssh-remote-pty-binding-replay.test.ts index 83608e1c9d2f..0f94df1b178e 100644 --- a/src/main/persistence-ssh-remote-pty-binding-replay.test.ts +++ b/src/main/persistence-ssh-remote-pty-binding-replay.test.ts @@ -18,7 +18,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-ssh-remote-pty-leases.test.ts b/src/main/persistence-ssh-remote-pty-leases.test.ts index 32f419359a56..d74f55ca3e4e 100644 --- a/src/main/persistence-ssh-remote-pty-leases.test.ts +++ b/src/main/persistence-ssh-remote-pty-leases.test.ts @@ -20,7 +20,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-ssh-targets-and-pane-keys.test.ts b/src/main/persistence-ssh-targets-and-pane-keys.test.ts index 6cfb5332a8ed..9b9d30bdff14 100644 --- a/src/main/persistence-ssh-targets-and-pane-keys.test.ts +++ b/src/main/persistence-ssh-targets-and-pane-keys.test.ts @@ -23,7 +23,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-terminal-option-key-migration.test.ts b/src/main/persistence-terminal-option-key-migration.test.ts index 9d1711783229..152808fb467c 100644 --- a/src/main/persistence-terminal-option-key-migration.test.ts +++ b/src/main/persistence-terminal-option-key-migration.test.ts @@ -18,7 +18,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-ui-state.test.ts b/src/main/persistence-ui-state.test.ts index 8320854cb24b..436d5f424973 100644 --- a/src/main/persistence-ui-state.test.ts +++ b/src/main/persistence-ui-state.test.ts @@ -24,7 +24,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-update-repo.test.ts b/src/main/persistence-update-repo.test.ts index cebcf5f6b14d..fe8096bcb91f 100644 --- a/src/main/persistence-update-repo.test.ts +++ b/src/main/persistence-update-repo.test.ts @@ -30,7 +30,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-workspace-session-scrollback.test.ts b/src/main/persistence-workspace-session-scrollback.test.ts index 8afd69d70b07..873e82615bb5 100644 --- a/src/main/persistence-workspace-session-scrollback.test.ts +++ b/src/main/persistence-workspace-session-scrollback.test.ts @@ -32,7 +32,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-workspace-status-workflow.test.ts b/src/main/persistence-workspace-status-workflow.test.ts index 1804d04dc410..f4a328b6f8c1 100644 --- a/src/main/persistence-workspace-status-workflow.test.ts +++ b/src/main/persistence-workspace-status-workflow.test.ts @@ -24,7 +24,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-worktree-card-properties.test.ts b/src/main/persistence-worktree-card-properties.test.ts index 555ae14caf7a..5fb262aea849 100644 --- a/src/main/persistence-worktree-card-properties.test.ts +++ b/src/main/persistence-worktree-card-properties.test.ts @@ -10,7 +10,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-worktree-deletion-fencing.test.ts b/src/main/persistence-worktree-deletion-fencing.test.ts index 10cb684027bd..496ba1af89c8 100644 --- a/src/main/persistence-worktree-deletion-fencing.test.ts +++ b/src/main/persistence-worktree-deletion-fencing.test.ts @@ -18,7 +18,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-worktree-lineage-and-backups.test.ts b/src/main/persistence-worktree-lineage-and-backups.test.ts index a9890f661644..270c700d4492 100644 --- a/src/main/persistence-worktree-lineage-and-backups.test.ts +++ b/src/main/persistence-worktree-lineage-and-backups.test.ts @@ -27,7 +27,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-worktree-meta-and-folder-workspaces.test.ts b/src/main/persistence-worktree-meta-and-folder-workspaces.test.ts index 632e4ebf25a4..d7f17f6ecb0d 100644 --- a/src/main/persistence-worktree-meta-and-folder-workspaces.test.ts +++ b/src/main/persistence-worktree-meta-and-folder-workspaces.test.ts @@ -21,7 +21,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence-worktree-visibility.test.ts b/src/main/persistence-worktree-visibility.test.ts index ab593396b72b..600a76effb2f 100644 --- a/src/main/persistence-worktree-visibility.test.ts +++ b/src/main/persistence-worktree-visibility.test.ts @@ -19,7 +19,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/persistence/loading-store/profile-state-checkpoints.test.ts b/src/main/persistence/loading-store/profile-state-checkpoints.test.ts index 6ee7e7c7c8d4..6900ca939342 100644 --- a/src/main/persistence/loading-store/profile-state-checkpoints.test.ts +++ b/src/main/persistence/loading-store/profile-state-checkpoints.test.ts @@ -15,7 +15,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/profile-state-direct-flush.test.ts b/src/main/persistence/loading-store/profile-state-direct-flush.test.ts index 7b8b77259f4a..a000e04dface 100644 --- a/src/main/persistence/loading-store/profile-state-direct-flush.test.ts +++ b/src/main/persistence/loading-store/profile-state-direct-flush.test.ts @@ -29,7 +29,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/profile-state-durable-writes.test.ts b/src/main/persistence/loading-store/profile-state-durable-writes.test.ts index 829d2eb403ad..b70c92dd79ea 100644 --- a/src/main/persistence/loading-store/profile-state-durable-writes.test.ts +++ b/src/main/persistence/loading-store/profile-state-durable-writes.test.ts @@ -13,7 +13,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/profile-state-import-lifetime.test.ts b/src/main/persistence/loading-store/profile-state-import-lifetime.test.ts index dd201c81cd3b..7cc2376d4c1b 100644 --- a/src/main/persistence/loading-store/profile-state-import-lifetime.test.ts +++ b/src/main/persistence/loading-store/profile-state-import-lifetime.test.ts @@ -18,7 +18,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/profile-state-maintenance-compatibility.test.ts b/src/main/persistence/loading-store/profile-state-maintenance-compatibility.test.ts index c56e1a23eafd..42e6b6150aed 100644 --- a/src/main/persistence/loading-store/profile-state-maintenance-compatibility.test.ts +++ b/src/main/persistence/loading-store/profile-state-maintenance-compatibility.test.ts @@ -7,7 +7,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/profile-state-maintenance-contracts.test.ts b/src/main/persistence/loading-store/profile-state-maintenance-contracts.test.ts index d3b4ad1b58ae..23a329b99ab0 100644 --- a/src/main/persistence/loading-store/profile-state-maintenance-contracts.test.ts +++ b/src/main/persistence/loading-store/profile-state-maintenance-contracts.test.ts @@ -10,7 +10,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/profile-state-settings-writes.test.ts b/src/main/persistence/loading-store/profile-state-settings-writes.test.ts index 7ab1bf071883..3feaeea91608 100644 --- a/src/main/persistence/loading-store/profile-state-settings-writes.test.ts +++ b/src/main/persistence/loading-store/profile-state-settings-writes.test.ts @@ -15,7 +15,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/profile-state-sqlite-authority.test.ts b/src/main/persistence/loading-store/profile-state-sqlite-authority.test.ts index b693bb640ac6..829337efe4c0 100644 --- a/src/main/persistence/loading-store/profile-state-sqlite-authority.test.ts +++ b/src/main/persistence/loading-store/profile-state-sqlite-authority.test.ts @@ -48,7 +48,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: vi.fn(() => ({ nth_repo_added: 2 })) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(() => ({ hosts: [] })), sshConfigHostsToTargets: vi.fn(() => []) })) diff --git a/src/main/persistence/loading-store/profile-state-store-backups.test.ts b/src/main/persistence/loading-store/profile-state-store-backups.test.ts index d91a813099fd..6da24ee87442 100644 --- a/src/main/persistence/loading-store/profile-state-store-backups.test.ts +++ b/src/main/persistence/loading-store/profile-state-store-backups.test.ts @@ -32,7 +32,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/profile-state-temp-cleanup-lifetime.test.ts b/src/main/persistence/loading-store/profile-state-temp-cleanup-lifetime.test.ts index 2cbdd1c59ff4..006d64efa395 100644 --- a/src/main/persistence/loading-store/profile-state-temp-cleanup-lifetime.test.ts +++ b/src/main/persistence/loading-store/profile-state-temp-cleanup-lifetime.test.ts @@ -15,7 +15,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/profile-state-update-quit.test.ts b/src/main/persistence/loading-store/profile-state-update-quit.test.ts index 088d10eeee49..1563ddb78285 100644 --- a/src/main/persistence/loading-store/profile-state-update-quit.test.ts +++ b/src/main/persistence/loading-store/profile-state-update-quit.test.ts @@ -7,7 +7,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/pty-binding-placement-inertness.test.ts b/src/main/persistence/loading-store/pty-binding-placement-inertness.test.ts index 95007aaa380f..1ca2e60f7c92 100644 --- a/src/main/persistence/loading-store/pty-binding-placement-inertness.test.ts +++ b/src/main/persistence/loading-store/pty-binding-placement-inertness.test.ts @@ -26,7 +26,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/pty-reattach-failure-routing.test.ts b/src/main/persistence/loading-store/pty-reattach-failure-routing.test.ts index 244f0a6336df..dfe3217a1dcb 100644 --- a/src/main/persistence/loading-store/pty-reattach-failure-routing.test.ts +++ b/src/main/persistence/loading-store/pty-reattach-failure-routing.test.ts @@ -13,7 +13,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/pty-retirement-publication-during-read.test.ts b/src/main/persistence/loading-store/pty-retirement-publication-during-read.test.ts index 34b6e742804e..e646672e71d7 100644 --- a/src/main/persistence/loading-store/pty-retirement-publication-during-read.test.ts +++ b/src/main/persistence/loading-store/pty-retirement-publication-during-read.test.ts @@ -7,7 +7,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/pty-spawn-exit-durability.test.ts b/src/main/persistence/loading-store/pty-spawn-exit-durability.test.ts index 427152b3d1e5..afaf6023ad20 100644 --- a/src/main/persistence/loading-store/pty-spawn-exit-durability.test.ts +++ b/src/main/persistence/loading-store/pty-spawn-exit-durability.test.ts @@ -23,7 +23,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/pty-spawn-handle-publication.test.ts b/src/main/persistence/loading-store/pty-spawn-handle-publication.test.ts index e8cad7828eec..1ae7cdadd782 100644 --- a/src/main/persistence/loading-store/pty-spawn-handle-publication.test.ts +++ b/src/main/persistence/loading-store/pty-spawn-handle-publication.test.ts @@ -11,7 +11,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/pty-spawn-replacement-durability.test.ts b/src/main/persistence/loading-store/pty-spawn-replacement-durability.test.ts index 75f154074e27..ae5ee3a66c50 100644 --- a/src/main/persistence/loading-store/pty-spawn-replacement-durability.test.ts +++ b/src/main/persistence/loading-store/pty-spawn-replacement-durability.test.ts @@ -16,7 +16,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/pty-spawn-restore-durability.test.ts b/src/main/persistence/loading-store/pty-spawn-restore-durability.test.ts index 032dc60bce50..b3b7c0df7568 100644 --- a/src/main/persistence/loading-store/pty-spawn-restore-durability.test.ts +++ b/src/main/persistence/loading-store/pty-spawn-restore-durability.test.ts @@ -12,7 +12,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/loading-store/terminal-close-async-durability.test.ts b/src/main/persistence/loading-store/terminal-close-async-durability.test.ts index 090d2340932a..7cd83816a6f1 100644 --- a/src/main/persistence/loading-store/terminal-close-async-durability.test.ts +++ b/src/main/persistence/loading-store/terminal-close-async-durability.test.ts @@ -7,7 +7,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/profile-state-cutover-fixture.test.ts b/src/main/persistence/profile-state-cutover-fixture.test.ts index 311c15ae450f..7bb24fe99e17 100644 --- a/src/main/persistence/profile-state-cutover-fixture.test.ts +++ b/src/main/persistence/profile-state-cutover-fixture.test.ts @@ -40,7 +40,7 @@ vi.mock('electron', () => ({ vi.mock('../telemetry/client', () => ({ track: trackMock })) vi.mock('../telemetry/cohort-classifier', () => ({ getCohortAtEmit: getCohortAtEmitMock })) -vi.mock('../ssh/ssh-config-parser', () => ({ +vi.mock('../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(() => ({ hosts: [] })), sshConfigHostsToTargets: vi.fn(() => []) })) diff --git a/src/main/persistence/profile-state/profile-state-authority-bootstrap.test.ts b/src/main/persistence/profile-state/profile-state-authority-bootstrap.test.ts index 21c13c3808f5..d83fa5981c0f 100644 --- a/src/main/persistence/profile-state/profile-state-authority-bootstrap.test.ts +++ b/src/main/persistence/profile-state/profile-state-authority-bootstrap.test.ts @@ -45,7 +45,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: vi.fn(() => ({ nth_repo_added: 2 })) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(() => ({ hosts: [] })), sshConfigHostsToTargets: vi.fn(() => []) })) diff --git a/src/main/persistence/profile-state/profile-state-authority-marker.test.ts b/src/main/persistence/profile-state/profile-state-authority-marker.test.ts index 93650a198fc0..33a84c71c259 100644 --- a/src/main/persistence/profile-state/profile-state-authority-marker.test.ts +++ b/src/main/persistence/profile-state/profile-state-authority-marker.test.ts @@ -23,7 +23,7 @@ vi.mock('../../telemetry/client', () => ({ track: () => {} })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/profile-state/profile-state-bootstrap-publication-race.test.ts b/src/main/persistence/profile-state/profile-state-bootstrap-publication-race.test.ts index b93b05b1b317..ece6f9b707ee 100644 --- a/src/main/persistence/profile-state/profile-state-bootstrap-publication-race.test.ts +++ b/src/main/persistence/profile-state/profile-state-bootstrap-publication-race.test.ts @@ -14,7 +14,7 @@ vi.mock('../../telemetry/client', () => ({ track: () => {} })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/profile-state/profile-state-database-rollback-export.test.ts b/src/main/persistence/profile-state/profile-state-database-rollback-export.test.ts index d5a2faaed72d..8ca6e7ebf420 100644 --- a/src/main/persistence/profile-state/profile-state-database-rollback-export.test.ts +++ b/src/main/persistence/profile-state/profile-state-database-rollback-export.test.ts @@ -35,7 +35,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/profile-state/profile-state-fragment-validation.test.ts b/src/main/persistence/profile-state/profile-state-fragment-validation.test.ts index 1fcb85eb108c..3702b4acc1f7 100644 --- a/src/main/persistence/profile-state/profile-state-fragment-validation.test.ts +++ b/src/main/persistence/profile-state/profile-state-fragment-validation.test.ts @@ -18,7 +18,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/profile-state/profile-state-json-compatibility-recovery.test.ts b/src/main/persistence/profile-state/profile-state-json-compatibility-recovery.test.ts index 5bd76ab842be..915a10153209 100644 --- a/src/main/persistence/profile-state/profile-state-json-compatibility-recovery.test.ts +++ b/src/main/persistence/profile-state/profile-state-json-compatibility-recovery.test.ts @@ -28,7 +28,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/profile-state/profile-state-live-store-factory.test.ts b/src/main/persistence/profile-state/profile-state-live-store-factory.test.ts index e7be8ee4185b..99ab80890a4a 100644 --- a/src/main/persistence/profile-state/profile-state-live-store-factory.test.ts +++ b/src/main/persistence/profile-state/profile-state-live-store-factory.test.ts @@ -17,7 +17,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/profile-state/profile-state-recovery-crash-boundaries.test.ts b/src/main/persistence/profile-state/profile-state-recovery-crash-boundaries.test.ts index 65fd09bcbb58..ef731b131095 100644 --- a/src/main/persistence/profile-state/profile-state-recovery-crash-boundaries.test.ts +++ b/src/main/persistence/profile-state/profile-state-recovery-crash-boundaries.test.ts @@ -54,7 +54,7 @@ vi.mock('../../telemetry/client', () => ({ track: () => {} })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/profile-state/profile-state-startup-authority.test.ts b/src/main/persistence/profile-state/profile-state-startup-authority.test.ts index 04f955c066e3..615c15b40e51 100644 --- a/src/main/persistence/profile-state/profile-state-startup-authority.test.ts +++ b/src/main/persistence/profile-state/profile-state-startup-authority.test.ts @@ -65,7 +65,7 @@ vi.mock('../../telemetry/client', () => ({ track: () => {} })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/profile-state/profile-state-startup-secrets.test.ts b/src/main/persistence/profile-state/profile-state-startup-secrets.test.ts index f37cb9820364..f3ab2832cd91 100644 --- a/src/main/persistence/profile-state/profile-state-startup-secrets.test.ts +++ b/src/main/persistence/profile-state/profile-state-startup-secrets.test.ts @@ -30,7 +30,7 @@ vi.mock('../../telemetry/client', () => ({ track: () => {} })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/profile-state/profile-state-startup-snapshot.test.ts b/src/main/persistence/profile-state/profile-state-startup-snapshot.test.ts index e53c425465dd..84401b47d28b 100644 --- a/src/main/persistence/profile-state/profile-state-startup-snapshot.test.ts +++ b/src/main/persistence/profile-state/profile-state-startup-snapshot.test.ts @@ -33,7 +33,7 @@ vi.mock('../../telemetry/client', () => ({ track: () => {} })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/profile-state/profile-state-store-factory.test.ts b/src/main/persistence/profile-state/profile-state-store-factory.test.ts index d22fe0496c1b..234005c0002a 100644 --- a/src/main/persistence/profile-state/profile-state-store-factory.test.ts +++ b/src/main/persistence/profile-state/profile-state-store-factory.test.ts @@ -45,7 +45,7 @@ vi.mock('../../telemetry/client', () => ({ track: () => {} })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/profile-state/profile-state-worker-authority.test.ts b/src/main/persistence/profile-state/profile-state-worker-authority.test.ts index cc42f3505815..60f3b09c580a 100644 --- a/src/main/persistence/profile-state/profile-state-worker-authority.test.ts +++ b/src/main/persistence/profile-state/profile-state-worker-authority.test.ts @@ -11,7 +11,7 @@ vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/terminal-topology/duplicate-pty-pane-repair.test.ts b/src/main/persistence/terminal-topology/duplicate-pty-pane-repair.test.ts index 4ede4b1e57b5..c7eef2733abf 100644 --- a/src/main/persistence/terminal-topology/duplicate-pty-pane-repair.test.ts +++ b/src/main/persistence/terminal-topology/duplicate-pty-pane-repair.test.ts @@ -19,7 +19,7 @@ import { } from './terminal-topology-profile-fixture' vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/terminal-topology/editor-tab-layout-apply.test.ts b/src/main/persistence/terminal-topology/editor-tab-layout-apply.test.ts index 8252c343d188..b61ef3b725ff 100644 --- a/src/main/persistence/terminal-topology/editor-tab-layout-apply.test.ts +++ b/src/main/persistence/terminal-topology/editor-tab-layout-apply.test.ts @@ -16,7 +16,7 @@ import { } from './terminal-topology-profile-fixture' vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/terminal-topology/open-in-new-group-layout-apply.test.ts b/src/main/persistence/terminal-topology/open-in-new-group-layout-apply.test.ts index 67f8d6346536..c4b8ec07eda8 100644 --- a/src/main/persistence/terminal-topology/open-in-new-group-layout-apply.test.ts +++ b/src/main/persistence/terminal-topology/open-in-new-group-layout-apply.test.ts @@ -14,7 +14,7 @@ import { } from './terminal-topology-profile-fixture' vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/terminal-topology/terminal-late-bind-layout-rules.test.ts b/src/main/persistence/terminal-topology/terminal-late-bind-layout-rules.test.ts index 54af1c9101a0..67372b9c1614 100644 --- a/src/main/persistence/terminal-topology/terminal-late-bind-layout-rules.test.ts +++ b/src/main/persistence/terminal-topology/terminal-late-bind-layout-rules.test.ts @@ -15,7 +15,7 @@ import { WindowSession, withoutLeaf } from './terminal-topology-window-session-f import { checkWorkspaceLayoutRules } from '../../../shared/workspace-layout/workspace-layout-rules' vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/terminal-topology/terminal-layout-apply.test.ts b/src/main/persistence/terminal-topology/terminal-layout-apply.test.ts index 5c3f9906fdd6..96570d2fa439 100644 --- a/src/main/persistence/terminal-topology/terminal-layout-apply.test.ts +++ b/src/main/persistence/terminal-topology/terminal-layout-apply.test.ts @@ -14,7 +14,7 @@ import { } from './terminal-topology-profile-fixture' vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/terminal-topology/terminal-layout-create.test.ts b/src/main/persistence/terminal-topology/terminal-layout-create.test.ts index f96d38e11cde..fc20ba6de033 100644 --- a/src/main/persistence/terminal-topology/terminal-layout-create.test.ts +++ b/src/main/persistence/terminal-topology/terminal-layout-create.test.ts @@ -15,7 +15,7 @@ import { } from './terminal-topology-profile-fixture' vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/terminal-topology/terminal-layout-default-tabs-applied.test.ts b/src/main/persistence/terminal-topology/terminal-layout-default-tabs-applied.test.ts index 22a0b04071d9..7fa2708af82d 100644 --- a/src/main/persistence/terminal-topology/terminal-layout-default-tabs-applied.test.ts +++ b/src/main/persistence/terminal-topology/terminal-layout-default-tabs-applied.test.ts @@ -11,7 +11,7 @@ import { } from './terminal-topology-profile-fixture' vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/terminal-topology/terminal-layout-pane-ops.test.ts b/src/main/persistence/terminal-topology/terminal-layout-pane-ops.test.ts index acc556a0a455..f1015fbae72c 100644 --- a/src/main/persistence/terminal-topology/terminal-layout-pane-ops.test.ts +++ b/src/main/persistence/terminal-topology/terminal-layout-pane-ops.test.ts @@ -19,7 +19,7 @@ import { } from './terminal-topology-profile-fixture' vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/terminal-topology/terminal-layout-sleep-wake.test.ts b/src/main/persistence/terminal-topology/terminal-layout-sleep-wake.test.ts index 6d91d7b078ae..a13dd0f93e96 100644 --- a/src/main/persistence/terminal-topology/terminal-layout-sleep-wake.test.ts +++ b/src/main/persistence/terminal-topology/terminal-layout-sleep-wake.test.ts @@ -14,7 +14,7 @@ import { } from './terminal-topology-profile-fixture' vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/terminal-topology/terminal-owner-report-only.test.ts b/src/main/persistence/terminal-topology/terminal-owner-report-only.test.ts index 9a304756392d..06dba1ac1897 100644 --- a/src/main/persistence/terminal-topology/terminal-owner-report-only.test.ts +++ b/src/main/persistence/terminal-topology/terminal-owner-report-only.test.ts @@ -14,7 +14,7 @@ import { ProfileStateSqliteAuthority } from '../profile-state/profile-state-sqli import type * as OwnerInvariants from '../../../shared/workspace-layout/terminal-owner-invariants' vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/terminal-topology/terminal-pane-admission-layout-owner.test.ts b/src/main/persistence/terminal-topology/terminal-pane-admission-layout-owner.test.ts index cfaec407e8aa..4f435be8102d 100644 --- a/src/main/persistence/terminal-topology/terminal-pane-admission-layout-owner.test.ts +++ b/src/main/persistence/terminal-topology/terminal-pane-admission-layout-owner.test.ts @@ -13,7 +13,7 @@ import { vi.mock('../../../shared/layout-owner-switch', () => ({ ORCA_LAYOUT_OWNER_IS_MAIN: true })) vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/terminal-topology/terminal-sleep-quit-resume.test.ts b/src/main/persistence/terminal-topology/terminal-sleep-quit-resume.test.ts index ba1b9dc63323..b83a7af59282 100644 --- a/src/main/persistence/terminal-topology/terminal-sleep-quit-resume.test.ts +++ b/src/main/persistence/terminal-topology/terminal-sleep-quit-resume.test.ts @@ -14,7 +14,7 @@ import { } from './terminal-topology-profile-fixture' vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/terminal-topology/terminal-stale-pane-tree-client.test.ts b/src/main/persistence/terminal-topology/terminal-stale-pane-tree-client.test.ts index e3e7f9b6db22..55eac763f0b9 100644 --- a/src/main/persistence/terminal-topology/terminal-stale-pane-tree-client.test.ts +++ b/src/main/persistence/terminal-topology/terminal-stale-pane-tree-client.test.ts @@ -19,7 +19,7 @@ import { leafIds, WindowSession } from './terminal-topology-window-session-fixtu import { checkWorkspaceLayoutRules } from '../../../shared/workspace-layout/workspace-layout-rules' vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/persistence/terminal-topology/terminal-topology-model.test.ts b/src/main/persistence/terminal-topology/terminal-topology-model.test.ts index f68b7595dbb8..9437c582aa7d 100644 --- a/src/main/persistence/terminal-topology/terminal-topology-model.test.ts +++ b/src/main/persistence/terminal-topology/terminal-topology-model.test.ts @@ -29,7 +29,7 @@ import { } from './terminal-topology-profile-fixture' vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/quit-path-durable-write-blocking.test.ts b/src/main/quit-path-durable-write-blocking.test.ts index 11bea685c7e0..95eef5037347 100644 --- a/src/main/quit-path-durable-write-blocking.test.ts +++ b/src/main/quit-path-durable-write-blocking.test.ts @@ -89,7 +89,7 @@ vi.mock('node:fs/promises', async (importOriginal) => { return { ...patched, default: patched } }) -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/remote-layout-snapshot/remote-layout-snapshot-persistence.test.ts b/src/main/remote-layout-snapshot/remote-layout-snapshot-persistence.test.ts index 06d9d0536da6..9b80228c4c37 100644 --- a/src/main/remote-layout-snapshot/remote-layout-snapshot-persistence.test.ts +++ b/src/main/remote-layout-snapshot/remote-layout-snapshot-persistence.test.ts @@ -22,7 +22,7 @@ vi.mock('electron', () => ({ BrowserWindow: { getAllWindows: () => [] } })) vi.mock('../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../ssh/ssh-config-parser', () => ({ +vi.mock('../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/runtime/runtime-client-agent-launch-settings-durability.test.ts b/src/main/runtime/runtime-client-agent-launch-settings-durability.test.ts index f14c23cc8b33..46c1c4e45aa4 100644 --- a/src/main/runtime/runtime-client-agent-launch-settings-durability.test.ts +++ b/src/main/runtime/runtime-client-agent-launch-settings-durability.test.ts @@ -10,7 +10,7 @@ vi.mock('../telemetry/client', () => ({ track: vi.fn() })) vi.mock('../telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../ssh/ssh-config-parser', () => ({ +vi.mock('../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/runtime/session-tabs/headless-browser-group-persistence.test.ts b/src/main/runtime/session-tabs/headless-browser-group-persistence.test.ts index 9c29dd4e8f5e..f2f4af77de46 100644 --- a/src/main/runtime/session-tabs/headless-browser-group-persistence.test.ts +++ b/src/main/runtime/session-tabs/headless-browser-group-persistence.test.ts @@ -13,7 +13,7 @@ import { OrcaRuntimeService } from '../orca-runtime' import { getRuntimeBrowserPageRegistry } from '../runtime-browser-page-registry' vi.mock('../../telemetry/client', () => ({ track: vi.fn() })) -vi.mock('../../ssh/ssh-config-parser', () => ({ +vi.mock('../../ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] })) diff --git a/src/main/ssh/ssh-config-alias-claim.test.ts b/src/main/ssh/config/ssh-config-alias-claim.test.ts similarity index 100% rename from src/main/ssh/ssh-config-alias-claim.test.ts rename to src/main/ssh/config/ssh-config-alias-claim.test.ts diff --git a/src/main/ssh/ssh-config-alias-claim.ts b/src/main/ssh/config/ssh-config-alias-claim.ts similarity index 98% rename from src/main/ssh/ssh-config-alias-claim.ts rename to src/main/ssh/config/ssh-config-alias-claim.ts index 11da6543e453..cc95edbbb3f6 100644 --- a/src/main/ssh/ssh-config-alias-claim.ts +++ b/src/main/ssh/config/ssh-config-alias-claim.ts @@ -1,7 +1,7 @@ import { existsSync, statSync } from 'node:fs' import { homedir } from 'node:os' import { join } from 'node:path' -import { normalizeSshConfigAlias } from '../../shared/ssh-config-alias' +import { normalizeSshConfigAlias } from '../../../shared/ssh-config-alias' import { expandSshConfigIncludes } from './ssh-config-include-expander' import { parseSshConfigAliasClaims, type SshConfigAliasClaims } from './ssh-config-parser' diff --git a/src/main/ssh/ssh-config-host-picker.test.ts b/src/main/ssh/config/ssh-config-host-picker.test.ts similarity index 98% rename from src/main/ssh/ssh-config-host-picker.test.ts rename to src/main/ssh/config/ssh-config-host-picker.test.ts index 783eef679cae..e2307be2cd85 100644 --- a/src/main/ssh/ssh-config-host-picker.test.ts +++ b/src/main/ssh/config/ssh-config-host-picker.test.ts @@ -8,7 +8,7 @@ vi.mock('./ssh-config-parser', async (importOriginal) => ({ loadUserSshConfig: loadUserSshConfigMock })) -import { SSH_CONFIG_HOST_RESULT_LIMIT } from '../../shared/ssh-types' +import { SSH_CONFIG_HOST_RESULT_LIMIT } from '../../../shared/ssh-types' import { invalidateUserSshConfigHostCache, listUserSshConfigHostSummaries, diff --git a/src/main/ssh/ssh-config-host-picker.ts b/src/main/ssh/config/ssh-config-host-picker.ts similarity index 97% rename from src/main/ssh/ssh-config-host-picker.ts rename to src/main/ssh/config/ssh-config-host-picker.ts index d1870ad1b69b..bbd0370da93b 100644 --- a/src/main/ssh/ssh-config-host-picker.ts +++ b/src/main/ssh/config/ssh-config-host-picker.ts @@ -3,9 +3,9 @@ import type { SshConfigHostResolution, SshConfigHostSummary, SshTarget -} from '../../shared/ssh-types' -import { SSH_CONFIG_HOST_RESULT_LIMIT } from '../../shared/ssh-types' -import { normalizeSshConfigAlias } from '../../shared/ssh-config-alias' +} from '../../../shared/ssh-types' +import { SSH_CONFIG_HOST_RESULT_LIMIT } from '../../../shared/ssh-types' +import { normalizeSshConfigAlias } from '../../../shared/ssh-config-alias' import { loadUserSshConfig, type SshConfigHost } from './ssh-config-parser' import { resolveWithSshG, type SshResolvedConfig } from './ssh-g-config-resolution' diff --git a/src/main/ssh/ssh-config-include-expander.ts b/src/main/ssh/config/ssh-config-include-expander.ts similarity index 100% rename from src/main/ssh/ssh-config-include-expander.ts rename to src/main/ssh/config/ssh-config-include-expander.ts diff --git a/src/main/ssh/ssh-config-loader-regression.test.ts b/src/main/ssh/config/ssh-config-loader-regression.test.ts similarity index 100% rename from src/main/ssh/ssh-config-loader-regression.test.ts rename to src/main/ssh/config/ssh-config-loader-regression.test.ts diff --git a/src/main/ssh/ssh-config-loader.test.ts b/src/main/ssh/config/ssh-config-loader.test.ts similarity index 100% rename from src/main/ssh/ssh-config-loader.test.ts rename to src/main/ssh/config/ssh-config-loader.test.ts diff --git a/src/main/ssh/ssh-config-parser-host-patterns.test.ts b/src/main/ssh/config/ssh-config-parser-host-patterns.test.ts similarity index 100% rename from src/main/ssh/ssh-config-parser-host-patterns.test.ts rename to src/main/ssh/config/ssh-config-parser-host-patterns.test.ts diff --git a/src/main/ssh/ssh-config-parser.test.ts b/src/main/ssh/config/ssh-config-parser.test.ts similarity index 100% rename from src/main/ssh/ssh-config-parser.test.ts rename to src/main/ssh/config/ssh-config-parser.test.ts diff --git a/src/main/ssh/ssh-config-parser.ts b/src/main/ssh/config/ssh-config-parser.ts similarity index 99% rename from src/main/ssh/ssh-config-parser.ts rename to src/main/ssh/config/ssh-config-parser.ts index 53575749255b..e009e1083c3d 100644 --- a/src/main/ssh/ssh-config-parser.ts +++ b/src/main/ssh/config/ssh-config-parser.ts @@ -1,7 +1,7 @@ import { existsSync } from 'node:fs' import { join } from 'node:path' import { homedir } from 'node:os' -import type { SshTarget } from '../../shared/ssh-types' +import type { SshTarget } from '../../../shared/ssh-types' import { expandSshConfigIncludes } from './ssh-config-include-expander' import { resolveSshConfigHomePath } from './ssh-config-path-expansion' diff --git a/src/main/ssh/ssh-config-path-expansion.ts b/src/main/ssh/config/ssh-config-path-expansion.ts similarity index 100% rename from src/main/ssh/ssh-config-path-expansion.ts rename to src/main/ssh/config/ssh-config-path-expansion.ts diff --git a/src/main/ssh/ssh-config-resolver.test.ts b/src/main/ssh/config/ssh-config-resolver.test.ts similarity index 100% rename from src/main/ssh/ssh-config-resolver.test.ts rename to src/main/ssh/config/ssh-config-resolver.test.ts diff --git a/src/main/ssh/ssh-g-config-resolution.test.ts b/src/main/ssh/config/ssh-g-config-resolution.test.ts similarity index 100% rename from src/main/ssh/ssh-g-config-resolution.test.ts rename to src/main/ssh/config/ssh-g-config-resolution.test.ts diff --git a/src/main/ssh/ssh-g-config-resolution.ts b/src/main/ssh/config/ssh-g-config-resolution.ts similarity index 100% rename from src/main/ssh/ssh-g-config-resolution.ts rename to src/main/ssh/config/ssh-g-config-resolution.ts diff --git a/src/main/ssh/ssh-known-hosts-source.test.ts b/src/main/ssh/config/ssh-known-hosts-source.test.ts similarity index 100% rename from src/main/ssh/ssh-known-hosts-source.test.ts rename to src/main/ssh/config/ssh-known-hosts-source.test.ts diff --git a/src/main/ssh/ssh-known-hosts-source.ts b/src/main/ssh/config/ssh-known-hosts-source.ts similarity index 100% rename from src/main/ssh/ssh-known-hosts-source.ts rename to src/main/ssh/config/ssh-known-hosts-source.ts diff --git a/src/main/ssh/ssh-known-hosts.test.ts b/src/main/ssh/config/ssh-known-hosts.test.ts similarity index 100% rename from src/main/ssh/ssh-known-hosts.test.ts rename to src/main/ssh/config/ssh-known-hosts.test.ts diff --git a/src/main/ssh/ssh-known-hosts.ts b/src/main/ssh/config/ssh-known-hosts.ts similarity index 100% rename from src/main/ssh/ssh-known-hosts.ts rename to src/main/ssh/config/ssh-known-hosts.ts diff --git a/src/main/ssh/vscode-ssh-authority.test.ts b/src/main/ssh/config/vscode-ssh-authority.test.ts similarity index 97% rename from src/main/ssh/vscode-ssh-authority.test.ts rename to src/main/ssh/config/vscode-ssh-authority.test.ts index 2816c1bc4bfd..fb8558935b27 100644 --- a/src/main/ssh/vscode-ssh-authority.test.ts +++ b/src/main/ssh/config/vscode-ssh-authority.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { SshTarget } from '../../shared/ssh-types' +import type { SshTarget } from '../../../shared/ssh-types' import { resolveVsCodeSshAuthority } from './vscode-ssh-authority' function createTarget(overrides: Partial = {}): SshTarget { diff --git a/src/main/ssh/vscode-ssh-authority.ts b/src/main/ssh/config/vscode-ssh-authority.ts similarity index 90% rename from src/main/ssh/vscode-ssh-authority.ts rename to src/main/ssh/config/vscode-ssh-authority.ts index 055baac65d41..7ab79de5d5ae 100644 --- a/src/main/ssh/vscode-ssh-authority.ts +++ b/src/main/ssh/config/vscode-ssh-authority.ts @@ -1,5 +1,5 @@ -import type { SshTarget } from '../../shared/ssh-types' -import { isOpenSshConfigBackedTarget } from './system-ssh-args' +import type { SshTarget } from '../../../shared/ssh-types' +import { isOpenSshConfigBackedTarget } from '../system-transport/system-ssh-args' export type VsCodeSshAuthorityResult = | { ok: true; authority: string } diff --git a/src/main/ssh/legacy-relay/legacy-relay-endpoints.test.ts b/src/main/ssh/legacy-relay/legacy-relay-endpoints.test.ts index cde6602e4a58..da27f56ae562 100644 --- a/src/main/ssh/legacy-relay/legacy-relay-endpoints.test.ts +++ b/src/main/ssh/legacy-relay/legacy-relay-endpoints.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from '../remote-exec-command' +import type * as ExecCommandModule from '../remote-exec/remote-exec-command' import { describe, expect, it, vi } from 'vitest' import type { SshConnection } from '../ssh-connection' import { relaySocketNameForInstanceId } from './ssh-relay-instance-id' @@ -6,7 +6,7 @@ import { windowsRelayPipePathsForSocketName } from './ssh-relay-endpoints' import { getRemoteHostPlatform, joinRemotePath } from '../ssh-remote-platform' const { execCommand } = vi.hoisted(() => ({ execCommand: vi.fn() })) -vi.mock('../remote-exec-command', async (importOriginal) => ({ +vi.mock('../remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand })) diff --git a/src/main/ssh/legacy-relay/legacy-relay-endpoints.ts b/src/main/ssh/legacy-relay/legacy-relay-endpoints.ts index 0b4cca1e7076..a254b5397ac4 100644 --- a/src/main/ssh/legacy-relay/legacy-relay-endpoints.ts +++ b/src/main/ssh/legacy-relay/legacy-relay-endpoints.ts @@ -7,9 +7,9 @@ */ import type { SshConnection } from '../ssh-connection' import { shellEscape } from '../ssh-connection-utils' -import { RELAY_REMOTE_DIR } from '../remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../remote-exec/remote-frame-protocol' import { SHORT_RELAY_SOCKET_DIR_PREFIX } from '../relay-socket-path-limit' -import { execCommand } from '../remote-exec-command' +import { execCommand } from '../remote-exec/remote-exec-command' import { readRelayDaemonRuntimes } from './ssh-relay-endpoint-runtime' import { relaySocketNameForInstanceId } from './ssh-relay-instance-id' import { readRemoteHomeCommand } from '../ssh-remote-commands' diff --git a/src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.test.ts b/src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.test.ts index 8bbe785e4a23..b9a1092b0ab4 100644 --- a/src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.test.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from '../remote-exec-command' +import type * as ExecCommandModule from '../remote-exec/remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' import type { SshConnection } from '../ssh-connection' import { @@ -13,7 +13,7 @@ const { execCommand, probeRelayEndpointIncumbent, countRelayEndpointPtys } = vi. countRelayEndpointPtys: vi.fn() })) -vi.mock('../remote-exec-command', async (importOriginal) => ({ +vi.mock('../remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand })) diff --git a/src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.ts b/src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.ts index 956bdae87263..9ffc15310f79 100644 --- a/src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.ts @@ -8,9 +8,9 @@ */ import type { SshConnection } from '../ssh-connection' import { shellEscape } from '../ssh-connection-utils' -import { RELAY_REMOTE_DIR } from '../remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../remote-exec/remote-frame-protocol' import { SHORT_RELAY_SOCKET_DIR_PREFIX } from '../relay-socket-path-limit' -import { execCommand } from '../remote-exec-command' +import { execCommand } from '../remote-exec/remote-exec-command' import { isReapableRelayHusk, probeRelayEndpointIncumbent, diff --git a/src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.ts b/src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.ts index 3a7018aa1574..cc0bc9a476cd 100644 --- a/src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.ts @@ -10,7 +10,7 @@ import { } from './ssh-host-relay-endpoint-census' import type { SshConnection } from '../ssh-connection' import { censusWindowsHostRelays, windowsCensusNodePath } from './ssh-host-relay-windows-census' -import { execCommand } from '../remote-exec-command' +import { execCommand } from '../remote-exec/remote-exec-command' import { readRemoteHomeCommand } from '../ssh-remote-commands' import { resolveRemoteNodePath } from '../ssh-remote-node-resolution' import { detectRemoteHostPlatform } from '../ssh-remote-platform-detection' diff --git a/src/main/ssh/legacy-relay/ssh-host-relay-windows-census.test.ts b/src/main/ssh/legacy-relay/ssh-host-relay-windows-census.test.ts index f27958da3044..fe1070a75a47 100644 --- a/src/main/ssh/legacy-relay/ssh-host-relay-windows-census.test.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-windows-census.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from '../remote-exec-command' +import type * as ExecCommandModule from '../remote-exec/remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' import type { SshConnection } from '../ssh-connection' import { relaySocketNameForInstanceId } from './ssh-relay-instance-id' @@ -10,7 +10,7 @@ const { execCommand, countRelayPtysOverBridge } = vi.hoisted(() => ({ countRelayPtysOverBridge: vi.fn() })) -vi.mock('../remote-exec-command', async (importOriginal) => ({ +vi.mock('../remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand })) diff --git a/src/main/ssh/legacy-relay/ssh-host-relay-windows-census.ts b/src/main/ssh/legacy-relay/ssh-host-relay-windows-census.ts index e040936255fc..62a19f6b8a06 100644 --- a/src/main/ssh/legacy-relay/ssh-host-relay-windows-census.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-windows-census.ts @@ -9,7 +9,7 @@ * convert under it. */ import type { SshConnection } from '../ssh-connection' -import { RELAY_REMOTE_DIR } from '../remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../remote-exec/remote-frame-protocol' import { RELAY_INSTALL_MODEL } from '../../managed-server/install/remote-install-model' import type { HostRelayEndpointCensus } from './ssh-host-relay-endpoint-census' import { @@ -19,7 +19,7 @@ import { windowsRelayInventoryCommand } from './ssh-host-relay-windows-inventory' import { countRelayPtysOverBridge } from './ssh-relay-endpoint-pty-count' -import { execCommand } from '../remote-exec-command' +import { execCommand } from '../remote-exec/remote-exec-command' import { relaySocketNameForInstanceId } from './ssh-relay-instance-id' import { windowsRelayConnectCommand } from './ssh-relay-windows-launch-command' import { listRemoteInstallBaseDirsCommand } from '../ssh-remote-commands' diff --git a/src/main/ssh/legacy-relay/ssh-host-relay-windows-inventory.ts b/src/main/ssh/legacy-relay/ssh-host-relay-windows-inventory.ts index fc349aa2112a..96783de6e340 100644 --- a/src/main/ssh/legacy-relay/ssh-host-relay-windows-inventory.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-windows-inventory.ts @@ -7,7 +7,7 @@ * names every relay pipe on the machine, and each instance leaves a credential file (and its pipe * marker) in its version directory, which maps a listed pipe back to the instance that serves it. */ -import { RELAY_REMOTE_DIR } from '../remote-frame-protocol' +import { RELAY_REMOTE_DIR } from '../remote-exec/remote-frame-protocol' import { commandWithNodePath } from '../ssh-remote-commands' import { quotePowerShellLiteral as powerShellLiteral, diff --git a/src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent.test.ts b/src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent.test.ts index 57b6390d88eb..28bc400f21d9 100644 --- a/src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent.test.ts +++ b/src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent.test.ts @@ -1,9 +1,9 @@ -import type * as ExecCommandModule from '../remote-exec-command' +import type * as ExecCommandModule from '../remote-exec/remote-exec-command' import { describe, expect, it, vi } from 'vitest' import { RELAY_LSOF_PROBE_JS } from '@orca/process-host/posix-lsof-probe' const execCommand = vi.fn() -vi.mock('../remote-exec-command', async (importOriginal) => ({ +vi.mock('../remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: (...args: unknown[]) => execCommand(...args), isUnconfirmedSshCommandTermination: (error: unknown) => diff --git a/src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent.ts b/src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent.ts index da960c4d976a..e28d0f492b03 100644 --- a/src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent.ts +++ b/src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent.ts @@ -28,7 +28,7 @@ import { RELAY_UNRECOGNIZED_CHILD_COUNT_VAR, relayDaemonChildCensusShell } from '../relay-daemon-service-children' -import { execCommand, isUnconfirmedSshCommandTermination } from '../remote-exec-command' +import { execCommand, isUnconfirmedSshCommandTermination } from '../remote-exec/remote-exec-command' import { isWindowsRemoteHost, type RemoteHostPlatform } from '../ssh-remote-platform' import { filesystemTypeIsLocalDisk } from '../../orcad/orcad-data-root-locality' diff --git a/src/main/ssh/legacy-relay/ssh-relay-endpoint-runtime.ts b/src/main/ssh/legacy-relay/ssh-relay-endpoint-runtime.ts index e0ed047265f2..844c97724ca3 100644 --- a/src/main/ssh/legacy-relay/ssh-relay-endpoint-runtime.ts +++ b/src/main/ssh/legacy-relay/ssh-relay-endpoint-runtime.ts @@ -7,7 +7,7 @@ * host with no PATH Node from reading every relay as unverifiable. */ import type { SshConnection } from '../ssh-connection' -import { execCommand } from '../remote-exec-command' +import { execCommand } from '../remote-exec/remote-exec-command' const RELAY_DAEMON_MARKER = ' relay.js --detached ' diff --git a/src/main/ssh/legacy-relay/ssh-relay-incumbent-process.test.ts b/src/main/ssh/legacy-relay/ssh-relay-incumbent-process.test.ts index 5626c4d6dee4..d5f3370f30d4 100644 --- a/src/main/ssh/legacy-relay/ssh-relay-incumbent-process.test.ts +++ b/src/main/ssh/legacy-relay/ssh-relay-incumbent-process.test.ts @@ -1,11 +1,11 @@ -import type * as ExecCommandModule from '../remote-exec-command' +import type * as ExecCommandModule from '../remote-exec/remote-exec-command' import { mkdtempSync, writeFileSync, rmSync, readFileSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' import { createServer } from 'node:net' import { describe, expect, it, vi } from 'vitest' import { runProcess } from '@orca/process-host' -vi.mock('../remote-exec-command', async (importOriginal) => ({ +vi.mock('../remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) diff --git a/src/main/ssh/legacy-relay/ssh-relay-sentinel-copy-budget.test.ts b/src/main/ssh/legacy-relay/ssh-relay-sentinel-copy-budget.test.ts index 23348b6e13df..0723b17c76b8 100644 --- a/src/main/ssh/legacy-relay/ssh-relay-sentinel-copy-budget.test.ts +++ b/src/main/ssh/legacy-relay/ssh-relay-sentinel-copy-budget.test.ts @@ -1,7 +1,7 @@ import { EventEmitter } from 'node:events' import type { ClientChannel } from 'ssh2' import { expect, it, vi } from 'vitest' -import { RELAY_SENTINEL } from '../remote-frame-protocol' +import { RELAY_SENTINEL } from '../remote-exec/remote-frame-protocol' import { waitForSentinel } from './ssh-relay-sentinel' it.each([1, 256])('copies each startup prefix once across %i chunks', async (chunks) => { diff --git a/src/main/ssh/legacy-relay/ssh-relay-sentinel.test.ts b/src/main/ssh/legacy-relay/ssh-relay-sentinel.test.ts index fffdbe49d850..f724401c2290 100644 --- a/src/main/ssh/legacy-relay/ssh-relay-sentinel.test.ts +++ b/src/main/ssh/legacy-relay/ssh-relay-sentinel.test.ts @@ -2,7 +2,7 @@ import { EventEmitter } from 'node:events' import { describe, expect, it, vi } from 'vitest' import type { ClientChannel } from 'ssh2' import { waitForSentinel } from './ssh-relay-sentinel' -import { RELAY_SENTINEL } from '../remote-frame-protocol' +import { RELAY_SENTINEL } from '../remote-exec/remote-frame-protocol' import { RelayVersionMismatchError, RELAY_EXIT_CODE_VERSION_MISMATCH diff --git a/src/main/ssh/legacy-relay/ssh-relay-sentinel.ts b/src/main/ssh/legacy-relay/ssh-relay-sentinel.ts index 7a63d862f474..8d5ef3969c26 100644 --- a/src/main/ssh/legacy-relay/ssh-relay-sentinel.ts +++ b/src/main/ssh/legacy-relay/ssh-relay-sentinel.ts @@ -1,6 +1,6 @@ import type { ClientChannel } from 'ssh2' import { createSshOperationAbortError } from '../ssh-connection-utils' -import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from '../remote-frame-protocol' +import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from '../remote-exec/remote-frame-protocol' import type { MultiplexerTransport } from '../ssh-channel-multiplexer' import { buildRelayHandshakeRefusalError } from './ssh-relay-handshake-mismatch' diff --git a/src/main/ssh/orcad-candidate-launch-verdict.ts b/src/main/ssh/orcad-candidate-launch-verdict.ts index d0ee5b2d32fe..831f1a685aa7 100644 --- a/src/main/ssh/orcad-candidate-launch-verdict.ts +++ b/src/main/ssh/orcad-candidate-launch-verdict.ts @@ -8,7 +8,7 @@ import { launchOrcadAndAwaitReadiness, type OrcadRemoteExecTarget } from '../managed-server/install/orcad-remote-runtime-control' -import { isUnconfirmedSshCommandTermination } from './remote-exec-command' +import { isUnconfirmedSshCommandTermination } from './remote-exec/remote-exec-command' type CandidateLaunchTarget = Parameters[0] & OrcadRemoteExecTarget & { diff --git a/src/main/ssh/orcad-deployment-target.test.ts b/src/main/ssh/orcad-deployment-target.test.ts index 9fbc6a94b61e..0f3cad13d735 100644 --- a/src/main/ssh/orcad-deployment-target.test.ts +++ b/src/main/ssh/orcad-deployment-target.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from './remote-exec-command' +import type * as ExecCommandModule from './remote-exec/remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' import { parseGlibcVersion, @@ -7,10 +7,10 @@ import { } from './orcad-deployment-target' import { SshConnection } from './ssh-connection' import { createCallbacks, createTarget } from './ssh-connection-test-fixtures' -import { execCommand } from './remote-exec-command' +import { execCommand } from './remote-exec/remote-exec-command' import { getRemoteHostPlatform } from './ssh-remote-platform' -vi.mock('./remote-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) diff --git a/src/main/ssh/orcad-deployment-target.ts b/src/main/ssh/orcad-deployment-target.ts index 66349e65ba61..c516a6511bd8 100644 --- a/src/main/ssh/orcad-deployment-target.ts +++ b/src/main/ssh/orcad-deployment-target.ts @@ -7,7 +7,7 @@ import { } from '../../shared/node-runtime-pin' import { ORCAD_SERVER_TARGET_FILENAME } from '../../shared/orcad-artifacts' import type { RemoteInstallTransport } from '../managed-server/install/remote-install-transport' -import { execCommand } from './remote-exec-command' +import { execCommand } from './remote-exec/remote-exec-command' import type { RemoteHostPlatform } from './ssh-remote-platform' /** The host answered the libc probe, but with nothing this client recognises. */ diff --git a/src/main/ssh/orcad-exited-own-fence-mutation-race.test.ts b/src/main/ssh/orcad-exited-own-fence-mutation-race.test.ts index a726bea6e02f..dbc2a47acde2 100644 --- a/src/main/ssh/orcad-exited-own-fence-mutation-race.test.ts +++ b/src/main/ssh/orcad-exited-own-fence-mutation-race.test.ts @@ -11,10 +11,10 @@ import { hostname, tmpdir, uptime } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' import { runProcess, spawnProcess } from '@orca/process-host' -import type * as ExecCommandModule from './remote-exec-command' +import type * as ExecCommandModule from './remote-exec/remote-exec-command' // The proof's remote commands run in a real local shell. -vi.mock('./remote-exec-command', async (importOriginal) => { +vi.mock('./remote-exec/remote-exec-command', async (importOriginal) => { const { runProcess: run } = await import('@orca/process-host') return { ...(await importOriginal()), diff --git a/src/main/ssh/orcad-exited-own-fence.test.ts b/src/main/ssh/orcad-exited-own-fence.test.ts index 084db7fe9f6f..a5425af61e02 100644 --- a/src/main/ssh/orcad-exited-own-fence.test.ts +++ b/src/main/ssh/orcad-exited-own-fence.test.ts @@ -11,13 +11,13 @@ import { import { hostname, tmpdir, uptime } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from './remote-exec-command' +import type * as ExecCommandModule from './remote-exec/remote-exec-command' // Every remote command runs in a real local shell, so the host-side checks are the real ones. const shell = vi.hoisted((): { env: NodeJS.ProcessEnv | undefined } => ({ env: undefined })) -vi.mock('./remote-exec-command', async (importOriginal) => { +vi.mock('./remote-exec/remote-exec-command', async (importOriginal) => { const { runProcess } = await import('@orca/process-host') - const { sshCommandExitError } = await import('./remote-exec-command') + const { sshCommandExitError } = await import('./remote-exec/remote-exec-command') return { ...(await importOriginal()), execCommand: async (_conn: unknown, command: string) => { diff --git a/src/main/ssh/orcad-exited-own-install-lock.test.ts b/src/main/ssh/orcad-exited-own-install-lock.test.ts index 4adf3070a884..4da144676c9b 100644 --- a/src/main/ssh/orcad-exited-own-install-lock.test.ts +++ b/src/main/ssh/orcad-exited-own-install-lock.test.ts @@ -11,12 +11,12 @@ import { import { hostname, tmpdir, uptime } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from './remote-exec-command' +import type * as ExecCommandModule from './remote-exec/remote-exec-command' // Every remote command runs in a real local shell, so the host-side checks are the real ones. -vi.mock('./remote-exec-command', async (importOriginal) => { +vi.mock('./remote-exec/remote-exec-command', async (importOriginal) => { const { runProcess } = await import('@orca/process-host') - const { sshCommandExitError } = await import('./remote-exec-command') + const { sshCommandExitError } = await import('./remote-exec/remote-exec-command') return { ...(await importOriginal()), execCommand: async (_conn: unknown, command: string) => { diff --git a/src/main/ssh/orcad-exited-own-lock-windows.test.ts b/src/main/ssh/orcad-exited-own-lock-windows.test.ts index ecf397a066af..0aa79ce53fbb 100644 --- a/src/main/ssh/orcad-exited-own-lock-windows.test.ts +++ b/src/main/ssh/orcad-exited-own-lock-windows.test.ts @@ -2,14 +2,14 @@ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { hostname, tmpdir, uptime } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from './remote-exec-command' +import type * as ExecCommandModule from './remote-exec/remote-exec-command' // The host script's own checks are covered against the real script; here only the client's part. const remote = vi.hoisted((): { commands: string[]; reply: string } => ({ commands: [], reply: '' })) -vi.mock('./remote-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: async (_conn: unknown, command: string) => { remote.commands.push(command) diff --git a/src/main/ssh/orcad-fence-lost-classification.test.ts b/src/main/ssh/orcad-fence-lost-classification.test.ts index 9566e9c2ed1c..73b8207ef96d 100644 --- a/src/main/ssh/orcad-fence-lost-classification.test.ts +++ b/src/main/ssh/orcad-fence-lost-classification.test.ts @@ -13,7 +13,10 @@ import { posixOrcadFenceGuard, runWithOrcadFence } from '../managed-server/activation/orcad-activation-fence-scope' -import { isUnconfirmedSshCommandTermination, sshCommandExitError } from './remote-exec-command' +import { + isUnconfirmedSshCommandTermination, + sshCommandExitError +} from './remote-exec/remote-exec-command' import { getRemoteHostPlatform } from './ssh-remote-platform' import type { OrcadHostTransport } from './orcad-host-transport' diff --git a/src/main/ssh/orcad-gc-transaction-pins.ts b/src/main/ssh/orcad-gc-transaction-pins.ts index 590d77711bc5..d9a1a669e830 100644 --- a/src/main/ssh/orcad-gc-transaction-pins.ts +++ b/src/main/ssh/orcad-gc-transaction-pins.ts @@ -9,7 +9,7 @@ import { orcadInstallDirNames } from '../managed-server/activation/orcad-activat import type { OrcadActivationTransaction } from '../managed-server/activation/orcad-activation-transaction' import { readOrcadActivationTransaction } from '../managed-server/activation/orcad-activation-transaction-store' import { orcadActivationFenceExists } from '../managed-server/activation/orcad-activation-lock' -import { isUnconfirmedSshCommandTermination } from './remote-exec-command' +import { isUnconfirmedSshCommandTermination } from './remote-exec/remote-exec-command' import type { OrcadRemoteExecTarget } from '../managed-server/install/orcad-remote-runtime-control' export type OrcadGcTransactionPins = { state: 'pinned'; dirNames: string[] } | { state: 'keep-all' } diff --git a/src/main/ssh/orcad-incumbent-recovery.ts b/src/main/ssh/orcad-incumbent-recovery.ts index fee46eb917cc..7f3abc80c536 100644 --- a/src/main/ssh/orcad-incumbent-recovery.ts +++ b/src/main/ssh/orcad-incumbent-recovery.ts @@ -9,7 +9,7 @@ import { execOrcadStateMutation } from '../managed-server/host-state/orcad-state-mutation-exec' import { orcadRemoteBaseDir } from '../managed-server/install/orcad-remote-windows-node' import type { ServeReadiness } from '../server/serve-readiness' -import { RELAY_REMOTE_DIR } from './remote-frame-protocol' +import { RELAY_REMOTE_DIR } from './remote-exec/remote-frame-protocol' import { ORCAD_STATE_SNAPSHOT_DIR } from '../managed-server/activation/orcad-activation-record' import type { OrcadSnapshotVerdict } from '../managed-server/activation/orcad-activation-transaction' import { diff --git a/src/main/ssh/orcad-installed-activation.ts b/src/main/ssh/orcad-installed-activation.ts index 50030c363b7a..ea1ad29cd53f 100644 --- a/src/main/ssh/orcad-installed-activation.ts +++ b/src/main/ssh/orcad-installed-activation.ts @@ -8,7 +8,7 @@ import { orcadRemoteBaseDir } from '../managed-server/install/orcad-remote-windows-node' import { randomUUID } from 'node:crypto' import type { OrcadDeployOptions, OrcadDeployResult } from './orcad-remote-deploy' -import { isUnconfirmedSshCommandTermination } from './remote-exec-command' +import { isUnconfirmedSshCommandTermination } from './remote-exec/remote-exec-command' import { withActivatedVersion, type OrcadActivationRecord, diff --git a/src/main/ssh/orcad-migration-terminal-gate-host-wide.test.ts b/src/main/ssh/orcad-migration-terminal-gate-host-wide.test.ts index 9a48749ec598..ea7dd74d8148 100644 --- a/src/main/ssh/orcad-migration-terminal-gate-host-wide.test.ts +++ b/src/main/ssh/orcad-migration-terminal-gate-host-wide.test.ts @@ -1,7 +1,7 @@ // Astra pass 4 §2: desktop A leases nothing, but desktop B's live shell, under another target id on // the same account, must never read as exited. COMPAT(legacy-relay-bridge): the host converts anyway // and leaves B's relay alone, so the census reads `bridged` with nothing of A's to serve. -import type * as ExecCommandModule from './remote-exec-command' +import type * as ExecCommandModule from './remote-exec/remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' import type { SshConnection } from './ssh-connection' import { relaySocketNameForInstanceId } from './legacy-relay/ssh-relay-instance-id' @@ -20,7 +20,7 @@ const { countRelayPtysOverBridge: vi.fn() })) -vi.mock('./remote-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand })) diff --git a/src/main/ssh/orcad-remote-deploy.test.ts b/src/main/ssh/orcad-remote-deploy.test.ts index 0d53cf98aa10..b9531315686f 100644 --- a/src/main/ssh/orcad-remote-deploy.test.ts +++ b/src/main/ssh/orcad-remote-deploy.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from './remote-exec-command' +import type * as ExecCommandModule from './remote-exec/remote-exec-command' import { chmodSync, mkdirSync, mkdtempSync, rmSync, statSync, writeFileSync } from 'node:fs' import type * as RecordFile from '../managed-server/install/orcad-remote-record-file' import { tmpdir } from 'node:os' @@ -6,7 +6,7 @@ import { dirname, join } from 'node:path' import { beforeEach, describe, expect, it, vi } from 'vitest' import { runProcess } from '@orca/process-host' -vi.mock('./remote-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -32,7 +32,7 @@ vi.mock('./orcad-local-build-hash', () => ({ computeLocalOrcadBuildHash: () => 'abc123def4567890' })) -import { execCommand } from './remote-exec-command' +import { execCommand } from './remote-exec/remote-exec-command' import { acquireInstallLock, isRelayInstallLockStale diff --git a/src/main/ssh/orcad-remote-node-runtime-report.ts b/src/main/ssh/orcad-remote-node-runtime-report.ts index 0fd882db0ddb..50179a750ddb 100644 --- a/src/main/ssh/orcad-remote-node-runtime-report.ts +++ b/src/main/ssh/orcad-remote-node-runtime-report.ts @@ -1,5 +1,5 @@ /** What the host-side runtime-store scripts print, shared by the POSIX and Windows installers. */ -import { RelayHostAnsweredError } from './remote-host-answered-failure' +import { RelayHostAnsweredError } from './remote-exec/remote-host-answered-failure' export const REMOTE_NODE_RUNTIME_READY = 'ORCA_NODE_RUNTIME_READY' export const REMOTE_NODE_RUNTIME_MISSING = 'ORCA_NODE_RUNTIME_MISSING' diff --git a/src/main/ssh/port-forwarding/ssh-port-forward.test.ts b/src/main/ssh/port-forwarding/ssh-port-forward.test.ts index 4489ff049035..fa4c5651f235 100644 --- a/src/main/ssh/port-forwarding/ssh-port-forward.test.ts +++ b/src/main/ssh/port-forwarding/ssh-port-forward.test.ts @@ -7,7 +7,7 @@ const { startSystemSshPortForwardProcessMock } = vi.hoisted(() => ({ startSystemSshPortForwardProcessMock: vi.fn() })) -vi.mock('../system-ssh-forward-process', async (importOriginal) => { +vi.mock('../system-transport/system-ssh-forward-process', async (importOriginal) => { const actual = (await importOriginal()) as Record return { ...actual, diff --git a/src/main/ssh/port-forwarding/system-ssh-port-forward-provider.ts b/src/main/ssh/port-forwarding/system-ssh-port-forward-provider.ts index 03df12434c0a..16ef43052fae 100644 --- a/src/main/ssh/port-forwarding/system-ssh-port-forward-provider.ts +++ b/src/main/ssh/port-forwarding/system-ssh-port-forward-provider.ts @@ -1,9 +1,9 @@ import type { SshConnection } from '../ssh-connection' -import type { SystemSshBuildArgsOptions } from '../system-ssh-args' +import type { SystemSshBuildArgsOptions } from '../system-transport/system-ssh-args' import { startSystemSshPortForwardProcess, systemSshForwardError -} from '../system-ssh-forward-process' +} from '../system-transport/system-ssh-forward-process' import type { ForwardChannelOpenFailure, PortForwardStartOptions, diff --git a/src/main/ssh/relay-bundle-paths.ts b/src/main/ssh/relay-bundle-paths.ts index c43ef6541bbf..ac97aa344105 100644 --- a/src/main/ssh/relay-bundle-paths.ts +++ b/src/main/ssh/relay-bundle-paths.ts @@ -1,6 +1,6 @@ import { join } from 'node:path' import { getAppEnvironment } from '../../shared/app-environment' -import type { RelayPlatform } from './remote-frame-protocol' +import type { RelayPlatform } from './remote-exec/remote-frame-protocol' function currentAppPath(): string | undefined { try { diff --git a/src/main/ssh/remote-exec-closed-stdin.test.ts b/src/main/ssh/remote-exec/remote-exec-closed-stdin.test.ts similarity index 95% rename from src/main/ssh/remote-exec-closed-stdin.test.ts rename to src/main/ssh/remote-exec/remote-exec-closed-stdin.test.ts index 7e3883633ed7..596bd0420a32 100644 --- a/src/main/ssh/remote-exec-closed-stdin.test.ts +++ b/src/main/ssh/remote-exec/remote-exec-closed-stdin.test.ts @@ -1,6 +1,6 @@ import { Duplex, PassThrough, Readable } from 'node:stream' import { describe, expect, it, vi } from 'vitest' -import type { RemoteCommandChannel } from '../managed-server/install/remote-install-transport' +import type { RemoteCommandChannel } from '../../managed-server/install/remote-install-transport' import { execCommand } from './remote-exec-command' function answering(output: string): RemoteCommandChannel { diff --git a/src/main/ssh/remote-exec-command.test.ts b/src/main/ssh/remote-exec/remote-exec-command.test.ts similarity index 100% rename from src/main/ssh/remote-exec-command.test.ts rename to src/main/ssh/remote-exec/remote-exec-command.test.ts diff --git a/src/main/ssh/remote-exec-command.ts b/src/main/ssh/remote-exec/remote-exec-command.ts similarity index 96% rename from src/main/ssh/remote-exec-command.ts rename to src/main/ssh/remote-exec/remote-exec-command.ts index 691885ac6ca8..5b5b51d3723a 100644 --- a/src/main/ssh/remote-exec-command.ts +++ b/src/main/ssh/remote-exec/remote-exec-command.ts @@ -2,14 +2,14 @@ import type { Readable } from 'node:stream' import type { RemoteCommandChannel, RemoteInstallTransport -} from '../managed-server/install/remote-install-transport' -import { createSshOperationAbortError, type SshExecOptions } from './ssh-connection-utils' +} from '../../managed-server/install/remote-install-transport' +import { createSshOperationAbortError, type SshExecOptions } from '../ssh-connection-utils' import { redactRelayInstallMarkerError, redactRelayInstallMarkerTokens -} from '../managed-server/install/remote-install-marker' -import type { SystemSshCommandChannel } from './system-ssh-command' -import { buildPosixStdoutFence } from '../../shared/posix-stdout-fence' +} from '../../managed-server/install/remote-install-marker' +import type { SystemSshCommandChannel } from '../system-transport/system-ssh-command' +import { buildPosixStdoutFence } from '../../../shared/posix-stdout-fence' const EXEC_TIMEOUT_MS = 30_000 const COMMAND_CLOSE_GRACE_MS = 5_000 diff --git a/src/main/ssh/remote-exec-input.test.ts b/src/main/ssh/remote-exec/remote-exec-input.test.ts similarity index 91% rename from src/main/ssh/remote-exec-input.test.ts rename to src/main/ssh/remote-exec/remote-exec-input.test.ts index b6fbe50f0dab..03618e5e01c2 100644 --- a/src/main/ssh/remote-exec-input.test.ts +++ b/src/main/ssh/remote-exec/remote-exec-input.test.ts @@ -5,8 +5,8 @@ import { execCommand } from './remote-exec-command' const { spawnMock } = vi.hoisted(() => ({ spawnMock: vi.fn() })) vi.mock('node:child_process', () => ({ spawn: spawnMock })) -vi.mock('./system-ssh-binary', () => ({ findSystemSsh: () => '/usr/bin/ssh' })) -import { spawnSystemSshCommand } from './system-ssh-command' +vi.mock('../system-transport/system-ssh-binary', () => ({ findSystemSsh: () => '/usr/bin/ssh' })) +import { spawnSystemSshCommand } from '../system-transport/system-ssh-command' function fakeSshProcess() { const proc = Object.assign(new EventEmitter(), { diff --git a/src/main/ssh/remote-frame-protocol.test.ts b/src/main/ssh/remote-exec/remote-frame-protocol.test.ts similarity index 99% rename from src/main/ssh/remote-frame-protocol.test.ts rename to src/main/ssh/remote-exec/remote-frame-protocol.test.ts index 52a4e1ff5dc4..268931d9655d 100644 --- a/src/main/ssh/remote-frame-protocol.test.ts +++ b/src/main/ssh/remote-exec/remote-frame-protocol.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { HEADER_LENGTH, FrameDecoder, type DecodedFrame } from '../../shared/relay-frame-decoder' +import { HEADER_LENGTH, FrameDecoder, type DecodedFrame } from '../../../shared/relay-frame-decoder' import { MessageType, encodeFrame, diff --git a/src/main/ssh/remote-frame-protocol.ts b/src/main/ssh/remote-exec/remote-frame-protocol.ts similarity index 98% rename from src/main/ssh/remote-frame-protocol.ts rename to src/main/ssh/remote-exec/remote-frame-protocol.ts index e27348db7b0f..235ba06b7b2f 100644 --- a/src/main/ssh/remote-frame-protocol.ts +++ b/src/main/ssh/remote-exec/remote-frame-protocol.ts @@ -2,7 +2,7 @@ // 13-byte framing header matching VS Code's PersistentProtocol wire format. // See design-ssh-support.md § JSON-RPC Protocol Specification. -import { HEADER_LENGTH, MAX_MESSAGE_SIZE } from '../../shared/relay-frame-decoder' +import { HEADER_LENGTH, MAX_MESSAGE_SIZE } from '../../../shared/relay-frame-decoder' export const RELAY_VERSION = '0.1.0' export const RELAY_SENTINEL = `ORCA-RELAY v${RELAY_VERSION} READY\n` export const RELAY_SENTINEL_TIMEOUT_MS = 10_000 diff --git a/src/main/ssh/remote-host-answered-failure-producers.test.ts b/src/main/ssh/remote-exec/remote-host-answered-failure-producers.test.ts similarity index 90% rename from src/main/ssh/remote-host-answered-failure-producers.test.ts rename to src/main/ssh/remote-exec/remote-host-answered-failure-producers.test.ts index 09b1f8edacb2..d1845fbaf31e 100644 --- a/src/main/ssh/remote-host-answered-failure-producers.test.ts +++ b/src/main/ssh/remote-exec/remote-host-answered-failure-producers.test.ts @@ -7,28 +7,30 @@ import { chmod, mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { NODE_RUNTIME_PIN } from '../../shared/node-runtime-pin' -import type { SshTarget } from '../../shared/ssh-types' +import { NODE_RUNTIME_PIN } from '../../../shared/node-runtime-pin' +import type { SshTarget } from '../../../shared/ssh-types' import { runProcess, runProcessSync } from '@orca/process-host' import { REMOTE_NODE_RUNTIME_READY, REMOTE_NODE_RUNTIME_VERIFIED_MARKER, RemoteNodeRuntimeSelfTestError, assertRemoteNodeRuntimePromoted -} from './orcad-remote-node-runtime-report' -import { remoteNodeRuntimePresentCommand } from '../managed-server/install/orcad-remote-node-runtime' +} from '../orcad-remote-node-runtime-report' +import { remoteNodeRuntimePresentCommand } from '../../managed-server/install/orcad-remote-node-runtime' import { isAnsweredHostFailure } from './remote-host-answered-failure' -import { getRemoteHostPlatform } from './ssh-remote-platform' -import { findSystemSsh } from './system-ssh-binary' -import { uploadDirectoryViaSystemSsh } from './system-ssh-file-transfer' -import { runSftpBatch } from './system-ssh-sftp-transfer' +import { getRemoteHostPlatform } from '../ssh-remote-platform' +import { findSystemSsh } from '../system-transport/system-ssh-binary' +import { uploadDirectoryViaSystemSsh } from '../system-transport/system-ssh-file-transfer' +import { runSftpBatch } from '../system-transport/system-ssh-sftp-transfer' vi.mock('@orca/process-host', async (importOriginal) => ({ ...(await importOriginal>()), runProcess: vi.fn() })) -vi.mock('./system-ssh-args', () => ({ buildSshArgs: () => ['--', 'host'] })) -vi.mock('./system-ssh-binary', () => ({ findSystemSsh: vi.fn(() => '/usr/bin/ssh') })) +vi.mock('../system-transport/system-ssh-args', () => ({ buildSshArgs: () => ['--', 'host'] })) +vi.mock('../system-transport/system-ssh-binary', () => ({ + findSystemSsh: vi.fn(() => '/usr/bin/ssh') +})) const posix = process.platform !== 'win32' // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: ssh args are mocked, so the target is never read. diff --git a/src/main/ssh/remote-host-answered-failure.test.ts b/src/main/ssh/remote-exec/remote-host-answered-failure.test.ts similarity index 94% rename from src/main/ssh/remote-host-answered-failure.test.ts rename to src/main/ssh/remote-exec/remote-host-answered-failure.test.ts index 125303285240..84ea9a577009 100644 --- a/src/main/ssh/remote-host-answered-failure.test.ts +++ b/src/main/ssh/remote-exec/remote-host-answered-failure.test.ts @@ -2,10 +2,10 @@ import { describe, expect, it } from 'vitest' import { RemoteNodeRuntimeSecurityModifiedError, RemoteNodeRuntimeSelfTestError -} from './orcad-remote-node-runtime-report' +} from '../orcad-remote-node-runtime-report' import { isAnsweredHostFailure, RelayHostAnsweredError } from './remote-host-answered-failure' import { SSH_EXEC_TIMEOUT_CODE } from './remote-exec-command' -import { SystemSshCommandExitError } from './system-ssh-operation-lifecycle' +import { SystemSshCommandExitError } from '../system-transport/system-ssh-operation-lifecycle' const exitError = (code: number, message: string): Error => Object.assign(new Error(message), { exitCode: code, stdout: '' }) diff --git a/src/main/ssh/remote-host-answered-failure.ts b/src/main/ssh/remote-exec/remote-host-answered-failure.ts similarity index 92% rename from src/main/ssh/remote-host-answered-failure.ts rename to src/main/ssh/remote-exec/remote-host-answered-failure.ts index 119820c73637..1177fc6035de 100644 --- a/src/main/ssh/remote-host-answered-failure.ts +++ b/src/main/ssh/remote-exec/remote-host-answered-failure.ts @@ -4,11 +4,11 @@ * so the connect fails retryably and never launches a second relay beside one that may be running. */ import { isSshCommandExitError } from './remote-exec-command' -import { isSshSessionLimitError } from './ssh-session-limit-error' +import { isSshSessionLimitError } from '../ssh-session-limit-error' import { isHostAnsweredSystemSshExit, SystemSshCommandExitError -} from './system-ssh-operation-lifecycle' +} from '../system-transport/system-ssh-operation-lifecycle' /** SFTP statuses the server sent about the request itself; NO_CONNECTION/CONNECTION_LOST are transport. */ const ANSWERED_SFTP_STATUSES: ReadonlySet = new Set([1, 2, 3, 4, 5, 8]) diff --git a/src/main/ssh/remote-host-exec.ts b/src/main/ssh/remote-exec/remote-host-exec.ts similarity index 74% rename from src/main/ssh/remote-host-exec.ts rename to src/main/ssh/remote-exec/remote-host-exec.ts index f480111fc5fe..83dfa23326a3 100644 --- a/src/main/ssh/remote-host-exec.ts +++ b/src/main/ssh/remote-exec/remote-host-exec.ts @@ -1,6 +1,6 @@ -import type { RemoteInstallTransport } from '../managed-server/install/remote-install-transport' +import type { RemoteInstallTransport } from '../../managed-server/install/remote-install-transport' import { execCommand } from './remote-exec-command' -import type { RemoteHostPlatform } from './ssh-remote-platform' +import type { RemoteHostPlatform } from '../ssh-remote-platform' export function execHostCommand( conn: RemoteInstallTransport, diff --git a/src/main/ssh/ssh-agent-identity-filter.ts b/src/main/ssh/ssh-agent-identity-filter.ts index 35a3c0a77219..e2fb48a6595e 100644 --- a/src/main/ssh/ssh-agent-identity-filter.ts +++ b/src/main/ssh/ssh-agent-identity-filter.ts @@ -9,7 +9,7 @@ import { type SignCallback, type SigningRequestOptions } from 'ssh2' -import { resolveSshConfigHomePath } from './ssh-config-path-expansion' +import { resolveSshConfigHomePath } from './config/ssh-config-path-expansion' type AgentPublicKey = ParsedKey | Buffer | string | PublicKeyEntry diff --git a/src/main/ssh/ssh-auth-resolution.ts b/src/main/ssh/ssh-auth-resolution.ts index 86b4bb3dc441..d1ab583803f3 100644 --- a/src/main/ssh/ssh-auth-resolution.ts +++ b/src/main/ssh/ssh-auth-resolution.ts @@ -1,10 +1,10 @@ import { existsSync, readFileSync } from 'node:fs' import { utils, type BaseAgent, type ParsedKey } from 'ssh2' import type { SshTarget } from '../../shared/ssh-types' -import type { SshResolvedConfig } from './ssh-g-config-resolution' +import type { SshResolvedConfig } from './config/ssh-g-config-resolution' import { createIdentityFilteredAgent } from './ssh-agent-identity-filter' -import { resolveSshConfigHomePath } from './ssh-config-path-expansion' -import { isOpenSshConfigBackedTarget } from './system-ssh-args' +import { resolveSshConfigHomePath } from './config/ssh-config-path-expansion' +import { isOpenSshConfigBackedTarget } from './system-transport/system-ssh-args' // Why: ssh2 only tries keys that are explicitly provided. Users with keys in // standard locations (e.g. ~/.ssh/id_ed25519) but no SSH agent running would diff --git a/src/main/ssh/ssh-channel-multiplexer-backpressure.test.ts b/src/main/ssh/ssh-channel-multiplexer-backpressure.test.ts index 1ff817c43f89..e893fa079d97 100644 --- a/src/main/ssh/ssh-channel-multiplexer-backpressure.test.ts +++ b/src/main/ssh/ssh-channel-multiplexer-backpressure.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { SshChannelMultiplexer, type MultiplexerTransport } from './ssh-channel-multiplexer' -import { encodeFrame, encodeKeepAliveFrame, MessageType } from './remote-frame-protocol' +import { encodeFrame, encodeKeepAliveFrame, MessageType } from './remote-exec/remote-frame-protocol' import { HEADER_LENGTH } from '../../shared/relay-frame-decoder' type MockTransport = MultiplexerTransport & { diff --git a/src/main/ssh/ssh-channel-multiplexer-saturation-wedge.test.ts b/src/main/ssh/ssh-channel-multiplexer-saturation-wedge.test.ts index 2c92c28d91e9..be31ddfbc636 100644 --- a/src/main/ssh/ssh-channel-multiplexer-saturation-wedge.test.ts +++ b/src/main/ssh/ssh-channel-multiplexer-saturation-wedge.test.ts @@ -1,5 +1,9 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { encodeKeepAliveFrame, KEEPALIVE_SEND_MS, TIMEOUT_MS } from './remote-frame-protocol' +import { + encodeKeepAliveFrame, + KEEPALIVE_SEND_MS, + TIMEOUT_MS +} from './remote-exec/remote-frame-protocol' import { SshChannelMultiplexer, type MultiplexerTransport } from './ssh-channel-multiplexer' type WedgedTransport = MultiplexerTransport & { writes: Buffer[]; feed: (chunk: Buffer) => void } diff --git a/src/main/ssh/ssh-channel-multiplexer.test.ts b/src/main/ssh/ssh-channel-multiplexer.test.ts index 3f4e058791de..5a2d82ef8d65 100644 --- a/src/main/ssh/ssh-channel-multiplexer.test.ts +++ b/src/main/ssh/ssh-channel-multiplexer.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest' import { SshChannelMultiplexer, type MultiplexerTransport } from './ssh-channel-multiplexer' -import { encodeFrame, MessageType, encodeKeepAliveFrame } from './remote-frame-protocol' +import { encodeFrame, MessageType, encodeKeepAliveFrame } from './remote-exec/remote-frame-protocol' import { HEADER_LENGTH } from '../../shared/relay-frame-decoder' function createMockTransport(): MultiplexerTransport & { diff --git a/src/main/ssh/ssh-channel-multiplexer.ts b/src/main/ssh/ssh-channel-multiplexer.ts index 12bf62c27812..e9b2f93d5b13 100644 --- a/src/main/ssh/ssh-channel-multiplexer.ts +++ b/src/main/ssh/ssh-channel-multiplexer.ts @@ -12,7 +12,7 @@ import { type JsonRpcRequest, type JsonRpcResponse, type JsonRpcNotification -} from './remote-frame-protocol' +} from './remote-exec/remote-frame-protocol' import { SshMultiplexerTransportWriter, type MultiplexerTransport, diff --git a/src/main/ssh/ssh-connection-auth-fallback.test.ts b/src/main/ssh/ssh-connection-auth-fallback.test.ts index 4fdd70fb4c59..ffccecf5f26d 100644 --- a/src/main/ssh/ssh-connection-auth-fallback.test.ts +++ b/src/main/ssh/ssh-connection-auth-fallback.test.ts @@ -16,24 +16,24 @@ import { walkInitialAuthLadder } from './ssh-connection-test-fixtures' import { SshConnection } from './ssh-connection' -import { resolveWithSshG } from './ssh-g-config-resolution' +import { resolveWithSshG } from './config/ssh-g-config-resolution' vi.mock('ssh2', async () => (await import('./ssh-connection-test-harness')).createSsh2Module()) -vi.mock('./system-ssh-binary', async () => +vi.mock('./system-transport/system-ssh-binary', async () => (await import('./ssh-connection-test-harness')).createSystemSshBinaryModule() ) -vi.mock('./system-ssh-args', async (importOriginal) => +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshArgsMocks(await importOriginal()) ) -vi.mock('./system-ssh-command', async (importOriginal) => +vi.mock('./system-transport/system-ssh-command', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshCommandMocks(await importOriginal()) ) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileBinaryTransferMocks( await importOriginal() ) ) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileTransferMocks( await importOriginal() ) @@ -41,10 +41,10 @@ vi.mock('./system-ssh-file-transfer', async (importOriginal) => vi.mock('./ssh-control-socket', async () => (await import('./ssh-connection-test-harness')).createControlSocketModule() ) -vi.mock('./ssh-config-parser', async () => +vi.mock('./config/ssh-config-parser', async () => (await import('./ssh-connection-test-harness')).createSshConfigParserModule() ) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSshGConfigResolutionMocks( await importOriginal() ) diff --git a/src/main/ssh/ssh-connection-channel-error.test.ts b/src/main/ssh/ssh-connection-channel-error.test.ts index 5d7420200340..717c60119445 100644 --- a/src/main/ssh/ssh-connection-channel-error.test.ts +++ b/src/main/ssh/ssh-connection-channel-error.test.ts @@ -6,21 +6,21 @@ import { resetSshConnectionMocks, ssh2Mock } from './ssh-connection-test-harness import * as sshClientMock from './__tests__/ssh-connection-test-client' vi.mock('ssh2', async () => (await import('./ssh-connection-test-harness')).createSsh2Module()) -vi.mock('./system-ssh-binary', async () => +vi.mock('./system-transport/system-ssh-binary', async () => (await import('./ssh-connection-test-harness')).createSystemSshBinaryModule() ) -vi.mock('./system-ssh-args', async (importOriginal) => +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshArgsMocks(await importOriginal()) ) -vi.mock('./system-ssh-command', async (importOriginal) => +vi.mock('./system-transport/system-ssh-command', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshCommandMocks(await importOriginal()) ) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileBinaryTransferMocks( await importOriginal() ) ) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileTransferMocks( await importOriginal() ) @@ -28,10 +28,10 @@ vi.mock('./system-ssh-file-transfer', async (importOriginal) => vi.mock('./ssh-control-socket', async () => (await import('./ssh-connection-test-harness')).createControlSocketModule() ) -vi.mock('./ssh-config-parser', async () => +vi.mock('./config/ssh-config-parser', async () => (await import('./ssh-connection-test-harness')).createSshConfigParserModule() ) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSshGConfigResolutionMocks( await importOriginal() ) diff --git a/src/main/ssh/ssh-connection-channel-open.test.ts b/src/main/ssh/ssh-connection-channel-open.test.ts index 6ae28e10e72b..999dd9744e96 100644 --- a/src/main/ssh/ssh-connection-channel-open.test.ts +++ b/src/main/ssh/ssh-connection-channel-open.test.ts @@ -11,21 +11,21 @@ import { createCallbacks, createTarget } from './ssh-connection-test-fixtures' import { SshConnection } from './ssh-connection' vi.mock('ssh2', async () => (await import('./ssh-connection-test-harness')).createSsh2Module()) -vi.mock('./system-ssh-binary', async () => +vi.mock('./system-transport/system-ssh-binary', async () => (await import('./ssh-connection-test-harness')).createSystemSshBinaryModule() ) -vi.mock('./system-ssh-args', async (importOriginal) => +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshArgsMocks(await importOriginal()) ) -vi.mock('./system-ssh-command', async (importOriginal) => +vi.mock('./system-transport/system-ssh-command', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshCommandMocks(await importOriginal()) ) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileBinaryTransferMocks( await importOriginal() ) ) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileTransferMocks( await importOriginal() ) @@ -33,10 +33,10 @@ vi.mock('./system-ssh-file-transfer', async (importOriginal) => vi.mock('./ssh-control-socket', async () => (await import('./ssh-connection-test-harness')).createControlSocketModule() ) -vi.mock('./ssh-config-parser', async () => +vi.mock('./config/ssh-config-parser', async () => (await import('./ssh-connection-test-harness')).createSshConfigParserModule() ) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSshGConfigResolutionMocks( await importOriginal() ) diff --git a/src/main/ssh/ssh-connection-direct-startup.test.ts b/src/main/ssh/ssh-connection-direct-startup.test.ts index 10b7731374c1..761184083e88 100644 --- a/src/main/ssh/ssh-connection-direct-startup.test.ts +++ b/src/main/ssh/ssh-connection-direct-startup.test.ts @@ -4,24 +4,24 @@ import { resetSshConnectionMocks, spawnSystemSshCommandMock } from './ssh-connec import { createCallbacks, createResolvedConfig, createTarget } from './ssh-connection-test-fixtures' import type { createSystemCommandChannel } from './ssh-connection-test-fixtures' import { SshConnection } from './ssh-connection' -import { resolveWithSshG } from './ssh-g-config-resolution' +import { resolveWithSshG } from './config/ssh-g-config-resolution' vi.mock('ssh2', async () => (await import('./ssh-connection-test-harness')).createSsh2Module()) -vi.mock('./system-ssh-binary', async () => +vi.mock('./system-transport/system-ssh-binary', async () => (await import('./ssh-connection-test-harness')).createSystemSshBinaryModule() ) -vi.mock('./system-ssh-args', async (importOriginal) => +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshArgsMocks(await importOriginal()) ) -vi.mock('./system-ssh-command', async (importOriginal) => +vi.mock('./system-transport/system-ssh-command', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshCommandMocks(await importOriginal()) ) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileBinaryTransferMocks( await importOriginal() ) ) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileTransferMocks( await importOriginal() ) @@ -29,10 +29,10 @@ vi.mock('./system-ssh-file-transfer', async (importOriginal) => vi.mock('./ssh-control-socket', async () => (await import('./ssh-connection-test-harness')).createControlSocketModule() ) -vi.mock('./ssh-config-parser', async () => +vi.mock('./config/ssh-config-parser', async () => (await import('./ssh-connection-test-harness')).createSshConfigParserModule() ) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSshGConfigResolutionMocks( await importOriginal() ) diff --git a/src/main/ssh/ssh-connection-file-transfer.test.ts b/src/main/ssh/ssh-connection-file-transfer.test.ts index 3b176ccb1251..48a43b733014 100644 --- a/src/main/ssh/ssh-connection-file-transfer.test.ts +++ b/src/main/ssh/ssh-connection-file-transfer.test.ts @@ -2,31 +2,34 @@ import { describe, expect, it, vi, beforeEach } from 'vitest' import { resetSshConnectionMocks } from './ssh-connection-test-harness' import { createCallbacks, createResolvedConfig, createTarget } from './ssh-connection-test-fixtures' import { SshConnection } from './ssh-connection' -import { resolveWithSshG } from './ssh-g-config-resolution' +import { resolveWithSshG } from './config/ssh-g-config-resolution' import { downloadFileViaSystemSsh, uploadFileViaSystemSsh, writeBufferViaSystemSsh -} from './system-ssh-file-binary-transfer' -import { uploadDirectoryViaSystemSsh, writeFileViaSystemSsh } from './system-ssh-file-transfer' +} from './system-transport/system-ssh-file-binary-transfer' +import { + uploadDirectoryViaSystemSsh, + writeFileViaSystemSsh +} from './system-transport/system-ssh-file-transfer' import { getRemoteHostPlatform } from './ssh-remote-platform' vi.mock('ssh2', async () => (await import('./ssh-connection-test-harness')).createSsh2Module()) -vi.mock('./system-ssh-binary', async () => +vi.mock('./system-transport/system-ssh-binary', async () => (await import('./ssh-connection-test-harness')).createSystemSshBinaryModule() ) -vi.mock('./system-ssh-args', async (importOriginal) => +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshArgsMocks(await importOriginal()) ) -vi.mock('./system-ssh-command', async (importOriginal) => +vi.mock('./system-transport/system-ssh-command', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshCommandMocks(await importOriginal()) ) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileBinaryTransferMocks( await importOriginal() ) ) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileTransferMocks( await importOriginal() ) @@ -34,10 +37,10 @@ vi.mock('./system-ssh-file-transfer', async (importOriginal) => vi.mock('./ssh-control-socket', async () => (await import('./ssh-connection-test-harness')).createControlSocketModule() ) -vi.mock('./ssh-config-parser', async () => +vi.mock('./config/ssh-config-parser', async () => (await import('./ssh-connection-test-harness')).createSshConfigParserModule() ) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSshGConfigResolutionMocks( await importOriginal() ) diff --git a/src/main/ssh/ssh-connection-file-transfers.ts b/src/main/ssh/ssh-connection-file-transfers.ts index c15a0880586f..930d7303dfac 100644 --- a/src/main/ssh/ssh-connection-file-transfers.ts +++ b/src/main/ssh/ssh-connection-file-transfers.ts @@ -14,9 +14,12 @@ import { downloadFileViaSystemSsh, uploadFileViaSystemSsh, writeBufferViaSystemSsh -} from './system-ssh-file-binary-transfer' -import { uploadDirectoryViaSystemSsh, writeFileViaSystemSsh } from './system-ssh-file-transfer' -import type { SystemSshBuildArgsOptions } from './system-ssh-args' +} from './system-transport/system-ssh-file-binary-transfer' +import { + uploadDirectoryViaSystemSsh, + writeFileViaSystemSsh +} from './system-transport/system-ssh-file-transfer' +import type { SystemSshBuildArgsOptions } from './system-transport/system-ssh-args' export type SshRemoteFileOptions = { hostPlatform?: RemoteHostPlatform diff --git a/src/main/ssh/ssh-connection-github-probe.test.ts b/src/main/ssh/ssh-connection-github-probe.test.ts index e825fc28a28b..43519f474d5d 100644 --- a/src/main/ssh/ssh-connection-github-probe.test.ts +++ b/src/main/ssh/ssh-connection-github-probe.test.ts @@ -7,24 +7,24 @@ import { createTarget } from './ssh-connection-test-fixtures' import { SshConnection } from './ssh-connection' -import { resolveWithSshG } from './ssh-g-config-resolution' +import { resolveWithSshG } from './config/ssh-g-config-resolution' vi.mock('ssh2', async () => (await import('./ssh-connection-test-harness')).createSsh2Module()) -vi.mock('./system-ssh-binary', async () => +vi.mock('./system-transport/system-ssh-binary', async () => (await import('./ssh-connection-test-harness')).createSystemSshBinaryModule() ) -vi.mock('./system-ssh-args', async (importOriginal) => +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshArgsMocks(await importOriginal()) ) -vi.mock('./system-ssh-command', async (importOriginal) => +vi.mock('./system-transport/system-ssh-command', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshCommandMocks(await importOriginal()) ) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileBinaryTransferMocks( await importOriginal() ) ) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileTransferMocks( await importOriginal() ) @@ -32,10 +32,10 @@ vi.mock('./system-ssh-file-transfer', async (importOriginal) => vi.mock('./ssh-control-socket', async () => (await import('./ssh-connection-test-harness')).createControlSocketModule() ) -vi.mock('./ssh-config-parser', async () => +vi.mock('./config/ssh-config-parser', async () => (await import('./ssh-connection-test-harness')).createSshConfigParserModule() ) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSshGConfigResolutionMocks( await importOriginal() ) diff --git a/src/main/ssh/ssh-connection-gssapi-fallback.test.ts b/src/main/ssh/ssh-connection-gssapi-fallback.test.ts index 41a6e67fff04..46ad95b91457 100644 --- a/src/main/ssh/ssh-connection-gssapi-fallback.test.ts +++ b/src/main/ssh/ssh-connection-gssapi-fallback.test.ts @@ -17,24 +17,24 @@ import { createTarget } from './ssh-connection-test-fixtures' import { SshConnection } from './ssh-connection' -import { resolveWithSshG } from './ssh-g-config-resolution' +import { resolveWithSshG } from './config/ssh-g-config-resolution' vi.mock('ssh2', async () => (await import('./ssh-connection-test-harness')).createSsh2Module()) -vi.mock('./system-ssh-binary', async () => +vi.mock('./system-transport/system-ssh-binary', async () => (await import('./ssh-connection-test-harness')).createSystemSshBinaryModule() ) -vi.mock('./system-ssh-args', async (importOriginal) => +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshArgsMocks(await importOriginal()) ) -vi.mock('./system-ssh-command', async (importOriginal) => +vi.mock('./system-transport/system-ssh-command', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshCommandMocks(await importOriginal()) ) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileBinaryTransferMocks( await importOriginal() ) ) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileTransferMocks( await importOriginal() ) @@ -42,10 +42,10 @@ vi.mock('./system-ssh-file-transfer', async (importOriginal) => vi.mock('./ssh-control-socket', async () => (await import('./ssh-connection-test-harness')).createControlSocketModule() ) -vi.mock('./ssh-config-parser', async () => +vi.mock('./config/ssh-config-parser', async () => (await import('./ssh-connection-test-harness')).createSshConfigParserModule() ) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSshGConfigResolutionMocks( await importOriginal() ) diff --git a/src/main/ssh/ssh-connection-host-key-store-wiring.test.ts b/src/main/ssh/ssh-connection-host-key-store-wiring.test.ts index 5b3a834337fa..456aefa212c1 100644 --- a/src/main/ssh/ssh-connection-host-key-store-wiring.test.ts +++ b/src/main/ssh/ssh-connection-host-key-store-wiring.test.ts @@ -15,7 +15,7 @@ import { chmodSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:f import { tmpdir } from 'node:os' import { join } from 'node:path' // Type-only, so it is erased before vi.mock's hoisted factory runs. -import type * as SshGConfigResolution from './ssh-g-config-resolution' +import type * as SshGConfigResolution from './config/ssh-g-config-resolution' import type * as Ssh2 from 'ssh2' const VALID_ED25519_HOST_KEY = Buffer.from( @@ -76,7 +76,7 @@ vi.mock('ssh2', async (importOriginal) => { } }) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => ({ +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => ({ ...(await importOriginal()), resolveWithSshG: vi.fn(async () => null) })) diff --git a/src/main/ssh/ssh-connection-host-key-verification.test.ts b/src/main/ssh/ssh-connection-host-key-verification.test.ts index f8f82745d5f2..1e862f68b9b8 100644 --- a/src/main/ssh/ssh-connection-host-key-verification.test.ts +++ b/src/main/ssh/ssh-connection-host-key-verification.test.ts @@ -7,21 +7,21 @@ import { createCallbacks, createTarget } from './ssh-connection-test-fixtures' import { SshConnection } from './ssh-connection' vi.mock('ssh2', async () => (await import('./ssh-connection-test-harness')).createSsh2Module()) -vi.mock('./system-ssh-binary', async () => +vi.mock('./system-transport/system-ssh-binary', async () => (await import('./ssh-connection-test-harness')).createSystemSshBinaryModule() ) -vi.mock('./system-ssh-args', async (importOriginal) => +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshArgsMocks(await importOriginal()) ) -vi.mock('./system-ssh-command', async (importOriginal) => +vi.mock('./system-transport/system-ssh-command', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshCommandMocks(await importOriginal()) ) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileBinaryTransferMocks( await importOriginal() ) ) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileTransferMocks( await importOriginal() ) @@ -29,10 +29,10 @@ vi.mock('./system-ssh-file-transfer', async (importOriginal) => vi.mock('./ssh-control-socket', async () => (await import('./ssh-connection-test-harness')).createControlSocketModule() ) -vi.mock('./ssh-config-parser', async () => +vi.mock('./config/ssh-config-parser', async () => (await import('./ssh-connection-test-harness')).createSshConfigParserModule() ) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSshGConfigResolutionMocks( await importOriginal() ) diff --git a/src/main/ssh/ssh-connection-manager-registry.test.ts b/src/main/ssh/ssh-connection-manager-registry.test.ts index 5352a1ba8906..215e0f874199 100644 --- a/src/main/ssh/ssh-connection-manager-registry.test.ts +++ b/src/main/ssh/ssh-connection-manager-registry.test.ts @@ -4,21 +4,21 @@ import { createCallbacks, createTarget } from './ssh-connection-test-fixtures' import { SshConnectionManager } from './ssh-connection-manager' vi.mock('ssh2', async () => (await import('./ssh-connection-test-harness')).createSsh2Module()) -vi.mock('./system-ssh-binary', async () => +vi.mock('./system-transport/system-ssh-binary', async () => (await import('./ssh-connection-test-harness')).createSystemSshBinaryModule() ) -vi.mock('./system-ssh-args', async (importOriginal) => +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshArgsMocks(await importOriginal()) ) -vi.mock('./system-ssh-command', async (importOriginal) => +vi.mock('./system-transport/system-ssh-command', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshCommandMocks(await importOriginal()) ) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileBinaryTransferMocks( await importOriginal() ) ) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileTransferMocks( await importOriginal() ) @@ -26,10 +26,10 @@ vi.mock('./system-ssh-file-transfer', async (importOriginal) => vi.mock('./ssh-control-socket', async () => (await import('./ssh-connection-test-harness')).createControlSocketModule() ) -vi.mock('./ssh-config-parser', async () => +vi.mock('./config/ssh-config-parser', async () => (await import('./ssh-connection-test-harness')).createSshConfigParserModule() ) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSshGConfigResolutionMocks( await importOriginal() ) diff --git a/src/main/ssh/ssh-connection-manager-sign-in-reuse.test.ts b/src/main/ssh/ssh-connection-manager-sign-in-reuse.test.ts index 80fdc1a5b28e..8614611ace35 100644 --- a/src/main/ssh/ssh-connection-manager-sign-in-reuse.test.ts +++ b/src/main/ssh/ssh-connection-manager-sign-in-reuse.test.ts @@ -14,21 +14,21 @@ import { } from './ssh-credential-decline' vi.mock('ssh2', async () => (await import('./ssh-connection-test-harness')).createSsh2Module()) -vi.mock('./system-ssh-binary', async () => +vi.mock('./system-transport/system-ssh-binary', async () => (await import('./ssh-connection-test-harness')).createSystemSshBinaryModule() ) -vi.mock('./system-ssh-args', async (importOriginal) => +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshArgsMocks(await importOriginal()) ) -vi.mock('./system-ssh-command', async (importOriginal) => +vi.mock('./system-transport/system-ssh-command', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshCommandMocks(await importOriginal()) ) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileBinaryTransferMocks( await importOriginal() ) ) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileTransferMocks( await importOriginal() ) @@ -36,10 +36,10 @@ vi.mock('./system-ssh-file-transfer', async (importOriginal) => vi.mock('./ssh-control-socket', async () => (await import('./ssh-connection-test-harness')).createControlSocketModule() ) -vi.mock('./ssh-config-parser', async () => +vi.mock('./config/ssh-config-parser', async () => (await import('./ssh-connection-test-harness')).createSshConfigParserModule() ) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSshGConfigResolutionMocks( await importOriginal() ) diff --git a/src/main/ssh/ssh-connection-reconnect-handshake-loss.test.ts b/src/main/ssh/ssh-connection-reconnect-handshake-loss.test.ts index 1477c08f6508..8118b0d91f63 100644 --- a/src/main/ssh/ssh-connection-reconnect-handshake-loss.test.ts +++ b/src/main/ssh/ssh-connection-reconnect-handshake-loss.test.ts @@ -12,21 +12,21 @@ import { SshConnection } from './ssh-connection' import { CONNECT_TIMEOUT_MS, RECONNECT_BACKOFF_MS } from './ssh-connection-utils' vi.mock('ssh2', async () => (await import('./ssh-connection-test-harness')).createSsh2Module()) -vi.mock('./system-ssh-binary', async () => +vi.mock('./system-transport/system-ssh-binary', async () => (await import('./ssh-connection-test-harness')).createSystemSshBinaryModule() ) -vi.mock('./system-ssh-args', async (importOriginal) => +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshArgsMocks(await importOriginal()) ) -vi.mock('./system-ssh-command', async (importOriginal) => +vi.mock('./system-transport/system-ssh-command', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshCommandMocks(await importOriginal()) ) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileBinaryTransferMocks( await importOriginal() ) ) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileTransferMocks( await importOriginal() ) @@ -34,10 +34,10 @@ vi.mock('./system-ssh-file-transfer', async (importOriginal) => vi.mock('./ssh-control-socket', async () => (await import('./ssh-connection-test-harness')).createControlSocketModule() ) -vi.mock('./ssh-config-parser', async () => +vi.mock('./config/ssh-config-parser', async () => (await import('./ssh-connection-test-harness')).createSshConfigParserModule() ) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSshGConfigResolutionMocks( await importOriginal() ) diff --git a/src/main/ssh/ssh-connection-reconnect-ladder.test.ts b/src/main/ssh/ssh-connection-reconnect-ladder.test.ts index 53acff12fd45..28acfbd4c25f 100644 --- a/src/main/ssh/ssh-connection-reconnect-ladder.test.ts +++ b/src/main/ssh/ssh-connection-reconnect-ladder.test.ts @@ -17,26 +17,26 @@ import { createTarget } from './ssh-connection-test-fixtures' import { SshConnection } from './ssh-connection' -import { resolveWithSshG } from './ssh-g-config-resolution' +import { resolveWithSshG } from './config/ssh-g-config-resolution' import { CONNECT_TIMEOUT_MS, RECONNECT_BACKOFF_MS } from './ssh-connection-utils' import { MIN_SSH_RELAY_GRACE_PERIOD_SECONDS } from '../../shared/ssh-types' vi.mock('ssh2', async () => (await import('./ssh-connection-test-harness')).createSsh2Module()) -vi.mock('./system-ssh-binary', async () => +vi.mock('./system-transport/system-ssh-binary', async () => (await import('./ssh-connection-test-harness')).createSystemSshBinaryModule() ) -vi.mock('./system-ssh-args', async (importOriginal) => +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshArgsMocks(await importOriginal()) ) -vi.mock('./system-ssh-command', async (importOriginal) => +vi.mock('./system-transport/system-ssh-command', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshCommandMocks(await importOriginal()) ) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileBinaryTransferMocks( await importOriginal() ) ) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileTransferMocks( await importOriginal() ) @@ -44,10 +44,10 @@ vi.mock('./system-ssh-file-transfer', async (importOriginal) => vi.mock('./ssh-control-socket', async () => (await import('./ssh-connection-test-harness')).createControlSocketModule() ) -vi.mock('./ssh-config-parser', async () => +vi.mock('./config/ssh-config-parser', async () => (await import('./ssh-connection-test-harness')).createSshConfigParserModule() ) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSshGConfigResolutionMocks( await importOriginal() ) diff --git a/src/main/ssh/ssh-connection-sftp-namespace.test.ts b/src/main/ssh/ssh-connection-sftp-namespace.test.ts index 59b48c3e50f6..ea2fa10dace1 100644 --- a/src/main/ssh/ssh-connection-sftp-namespace.test.ts +++ b/src/main/ssh/ssh-connection-sftp-namespace.test.ts @@ -7,10 +7,10 @@ import { mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type * as SystemSshArgs from './system-ssh-args' -import type * as SystemSshFileBinaryTransfer from './system-ssh-file-binary-transfer' -import type * as SystemSshFileTransfer from './system-ssh-file-transfer' -import type * as SshGConfigResolution from './ssh-g-config-resolution' +import type * as SystemSshArgs from './system-transport/system-ssh-args' +import type * as SystemSshFileBinaryTransfer from './system-transport/system-ssh-file-binary-transfer' +import type * as SystemSshFileTransfer from './system-transport/system-ssh-file-transfer' +import type * as SshGConfigResolution from './config/ssh-g-config-resolution' vi.mock('ssh2', () => ({ BaseAgent: class {}, @@ -19,25 +19,28 @@ vi.mock('ssh2', () => ({ utils: { parseKey: vi.fn() } })) -vi.mock('./system-ssh-args', async (importOriginal) => ({ +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => ({ ...(await importOriginal()), getOrcaControlSocketPath: vi.fn().mockReturnValue(null) })) -vi.mock('./system-ssh-command', () => ({ spawnSystemSsh: vi.fn(), spawnSystemSshCommand: vi.fn() })) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => ({ +vi.mock('./system-transport/system-ssh-command', () => ({ + spawnSystemSsh: vi.fn(), + spawnSystemSshCommand: vi.fn() +})) +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => ({ ...(await importOriginal()), downloadFileViaSystemSsh: vi.fn().mockResolvedValue(undefined), uploadFileViaSystemSsh: vi.fn().mockResolvedValue(undefined), writeBufferViaSystemSsh: vi.fn().mockResolvedValue(undefined) })) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => ({ +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => ({ ...(await importOriginal()), uploadDirectoryViaSystemSsh: vi.fn().mockResolvedValue(undefined), writeFileViaSystemSsh: vi.fn().mockResolvedValue(undefined) })) vi.mock('./ssh-control-socket', () => ({ removeControlSocketPath: vi.fn() })) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => ({ +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => ({ ...(await importOriginal()), resolveWithSshG: vi.fn().mockResolvedValue(null) })) @@ -46,7 +49,10 @@ import { SshConnection } from './ssh-connection' import type { SftpNamespacePathMapping } from './sftp-namespace-resolution' import { getRemoteHostPlatform } from './ssh-remote-platform' import { isSshSessionLimitError } from './ssh-session-limit-error' -import { uploadDirectoryViaSystemSsh, writeFileViaSystemSsh } from './system-ssh-file-transfer' +import { + uploadDirectoryViaSystemSsh, + writeFileViaSystemSsh +} from './system-transport/system-ssh-file-transfer' import type { SshTarget } from '../../shared/ssh-types' const SHELL_HOME = '/var/services/homes/alice' diff --git a/src/main/ssh/ssh-connection-store-orcad-ownership.test.ts b/src/main/ssh/ssh-connection-store-orcad-ownership.test.ts index 0b5dfd0d8b78..9d306eb8e30d 100644 --- a/src/main/ssh/ssh-connection-store-orcad-ownership.test.ts +++ b/src/main/ssh/ssh-connection-store-orcad-ownership.test.ts @@ -12,7 +12,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh-config-parser', () => ({ +vi.mock('./config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/ssh/ssh-connection-store.test.ts b/src/main/ssh/ssh-connection-store.test.ts index 03b7dd54fc9e..9507e993e301 100644 --- a/src/main/ssh/ssh-connection-store.test.ts +++ b/src/main/ssh/ssh-connection-store.test.ts @@ -8,7 +8,7 @@ const { loadUserSshConfigMock, sshConfigHostsToTargetsMock } = vi.hoisted(() => sshConfigHostsToTargetsMock: vi.fn() })) -vi.mock('./ssh-config-parser', () => ({ +vi.mock('./config/ssh-config-parser', () => ({ loadUserSshConfig: loadUserSshConfigMock, sshConfigHostsToTargets: sshConfigHostsToTargetsMock })) diff --git a/src/main/ssh/ssh-connection-store.ts b/src/main/ssh/ssh-connection-store.ts index e2b6ba745506..e032d1928a5a 100644 --- a/src/main/ssh/ssh-connection-store.ts +++ b/src/main/ssh/ssh-connection-store.ts @@ -2,7 +2,7 @@ import type { Store } from '../persistence' import type { SshRepoReadoption, SshTarget } from '../../shared/ssh-types' import { RUNTIME_OWNED_SSH_TARGET_ID_PREFIX } from '../../shared/execution-host' import { normalizeSshConfigAlias } from '../../shared/ssh-config-alias' -import { loadUserSshConfig, sshConfigHostsToTargets } from './ssh-config-parser' +import { loadUserSshConfig, sshConfigHostsToTargets } from './config/ssh-config-parser' import { SshTargetOrcadClaims } from './ssh-target-orcad-claims' import { buildRemovedSshTargetTombstone, diff --git a/src/main/ssh/ssh-connection-system-transport.test.ts b/src/main/ssh/ssh-connection-system-transport.test.ts index 461a541d39f3..b8c1f3e370ba 100644 --- a/src/main/ssh/ssh-connection-system-transport.test.ts +++ b/src/main/ssh/ssh-connection-system-transport.test.ts @@ -21,8 +21,8 @@ import { } from './ssh-connection-test-fixtures' import { SshConnection } from './ssh-connection' import { shouldUseSystemSshTransport } from './ssh-transport-selection' -import { resolveWithSshG } from './ssh-g-config-resolution' -import { writeFileViaSystemSsh } from './system-ssh-file-transfer' +import { resolveWithSshG } from './config/ssh-g-config-resolution' +import { writeFileViaSystemSsh } from './system-transport/system-ssh-file-transfer' import { CONNECT_TIMEOUT_MS } from './ssh-connection-utils' import type { SshTarget } from '../../shared/ssh-types' import { @@ -31,21 +31,21 @@ import { } from './ssh-security-key-identity.test-fixture' vi.mock('ssh2', async () => (await import('./ssh-connection-test-harness')).createSsh2Module()) -vi.mock('./system-ssh-binary', async () => +vi.mock('./system-transport/system-ssh-binary', async () => (await import('./ssh-connection-test-harness')).createSystemSshBinaryModule() ) -vi.mock('./system-ssh-args', async (importOriginal) => +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshArgsMocks(await importOriginal()) ) -vi.mock('./system-ssh-command', async (importOriginal) => +vi.mock('./system-transport/system-ssh-command', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshCommandMocks(await importOriginal()) ) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileBinaryTransferMocks( await importOriginal() ) ) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileTransferMocks( await importOriginal() ) @@ -53,10 +53,10 @@ vi.mock('./system-ssh-file-transfer', async (importOriginal) => vi.mock('./ssh-control-socket', async () => (await import('./ssh-connection-test-harness')).createControlSocketModule() ) -vi.mock('./ssh-config-parser', async () => +vi.mock('./config/ssh-config-parser', async () => (await import('./ssh-connection-test-harness')).createSshConfigParserModule() ) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSshGConfigResolutionMocks( await importOriginal() ) diff --git a/src/main/ssh/ssh-connection-test-fixtures.ts b/src/main/ssh/ssh-connection-test-fixtures.ts index 45de1425340f..5c8b9c568c63 100644 --- a/src/main/ssh/ssh-connection-test-fixtures.ts +++ b/src/main/ssh/ssh-connection-test-fixtures.ts @@ -3,7 +3,7 @@ import { vi } from 'vitest' import type { Mock } from 'vitest' import type { AnyAuthMethod, AuthenticationType } from 'ssh2' import type { SshConnectionCallbacks } from './ssh-connection-utils' -import type { SshResolvedConfig } from './ssh-g-config-resolution' +import type { SshResolvedConfig } from './config/ssh-g-config-resolution' import type { SshTarget } from '../../shared/ssh-types' export function createTarget(overrides?: Partial): SshTarget { diff --git a/src/main/ssh/ssh-connection-test-harness.ts b/src/main/ssh/ssh-connection-test-harness.ts index 1ad441fd11df..633dbb5b57bb 100644 --- a/src/main/ssh/ssh-connection-test-harness.ts +++ b/src/main/ssh/ssh-connection-test-harness.ts @@ -2,14 +2,14 @@ import { vi } from 'vitest' import { createSystemCommandChannel, createSystemSshProcess } from './ssh-connection-test-fixtures' import type { SshConnection } from './ssh-connection' import type { MockSystemCommandChannel, MockSystemSshProcess } from './ssh-connection-test-fixtures' -import type { SshResolvedConfig } from './ssh-g-config-resolution' -import type { SystemSshBuildArgsOptions } from './system-ssh-args' +import type { SshResolvedConfig } from './config/ssh-g-config-resolution' +import type { SystemSshBuildArgsOptions } from './system-transport/system-ssh-args' import type { SshTarget } from '../../shared/ssh-types' -import type * as SystemSshArgs from './system-ssh-args' -import type * as SystemSshCommand from './system-ssh-command' -import type * as SystemSshFileBinaryTransfer from './system-ssh-file-binary-transfer' -import type * as SystemSshFileTransfer from './system-ssh-file-transfer' -import type * as SshGConfigResolution from './ssh-g-config-resolution' +import type * as SystemSshArgs from './system-transport/system-ssh-args' +import type * as SystemSshCommand from './system-transport/system-ssh-command' +import type * as SystemSshFileBinaryTransfer from './system-transport/system-ssh-file-binary-transfer' +import type * as SystemSshFileTransfer from './system-transport/system-ssh-file-transfer' +import type * as SshGConfigResolution from './config/ssh-g-config-resolution' import { resetSsh2ClientState, ssh2Mock } from './__tests__/ssh-connection-test-client' export { clientInstances, diff --git a/src/main/ssh/ssh-connection-utils.test.ts b/src/main/ssh/ssh-connection-utils.test.ts index bd1ea5fbf7ed..9edbb5331a19 100644 --- a/src/main/ssh/ssh-connection-utils.test.ts +++ b/src/main/ssh/ssh-connection-utils.test.ts @@ -32,7 +32,7 @@ import { findDefaultKeyFile, resolveAgentSocket } from './ssh-auth-resolution' import { resolveEffectiveProxy } from './ssh-proxy-command' import { walkInitialAuthLadder } from './ssh-connection-test-fixtures' import type { SshTarget } from '../../shared/ssh-types' -import type { SshResolvedConfig } from './ssh-g-config-resolution' +import type { SshResolvedConfig } from './config/ssh-g-config-resolution' // ── isTransientError ───────────────────────────────────────────────── diff --git a/src/main/ssh/ssh-connection-utils.ts b/src/main/ssh/ssh-connection-utils.ts index 8a95b54c57c3..6598fee3c656 100644 --- a/src/main/ssh/ssh-connection-utils.ts +++ b/src/main/ssh/ssh-connection-utils.ts @@ -1,6 +1,6 @@ import type { ConnectConfig } from 'ssh2' import type { SshTarget, SshConnectionState } from '../../shared/ssh-types' -import type { SshResolvedConfig } from './ssh-g-config-resolution' +import type { SshResolvedConfig } from './config/ssh-g-config-resolution' import { findEncryptedPrivateKeyPath, isUnencryptedPrivateKey, @@ -10,7 +10,7 @@ import { resolveUnencryptedExplicitPrivateKeys } from './ssh-auth-resolution' import { configurePrivateKeyAuthentication } from './ssh-private-key-authentication' -import { isOpenSshConfigBackedTarget } from './system-ssh-args' +import { isOpenSshConfigBackedTarget } from './system-transport/system-ssh-args' export type SshCredentialKind = 'passphrase' | 'password' | 'keyboard-interactive' diff --git a/src/main/ssh/ssh-connection-wake-retry.test.ts b/src/main/ssh/ssh-connection-wake-retry.test.ts index afcc34d74d2a..d431fd9c7d1f 100644 --- a/src/main/ssh/ssh-connection-wake-retry.test.ts +++ b/src/main/ssh/ssh-connection-wake-retry.test.ts @@ -16,27 +16,27 @@ import { createTarget } from './ssh-connection-test-fixtures' import { SshConnection } from './ssh-connection' -import { resolveWithSshG } from './ssh-g-config-resolution' +import { resolveWithSshG } from './config/ssh-g-config-resolution' import { SshConnectionManager } from './ssh-connection-manager' import { RECONNECT_BACKOFF_MS } from './ssh-connection-utils' import { recordSshUserDisconnected, resetSshUserDisconnectsForTests } from './ssh-user-disconnect' vi.mock('ssh2', async () => (await import('./ssh-connection-test-harness')).createSsh2Module()) -vi.mock('./system-ssh-binary', async () => +vi.mock('./system-transport/system-ssh-binary', async () => (await import('./ssh-connection-test-harness')).createSystemSshBinaryModule() ) -vi.mock('./system-ssh-args', async (importOriginal) => +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshArgsMocks(await importOriginal()) ) -vi.mock('./system-ssh-command', async (importOriginal) => +vi.mock('./system-transport/system-ssh-command', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshCommandMocks(await importOriginal()) ) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileBinaryTransferMocks( await importOriginal() ) ) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileTransferMocks( await importOriginal() ) @@ -44,10 +44,10 @@ vi.mock('./system-ssh-file-transfer', async (importOriginal) => vi.mock('./ssh-control-socket', async () => (await import('./ssh-connection-test-harness')).createControlSocketModule() ) -vi.mock('./ssh-config-parser', async () => +vi.mock('./config/ssh-config-parser', async () => (await import('./ssh-connection-test-harness')).createSshConfigParserModule() ) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSshGConfigResolutionMocks( await importOriginal() ) diff --git a/src/main/ssh/ssh-connection.test.ts b/src/main/ssh/ssh-connection.test.ts index 1239f45c1823..41c2d6cf03b0 100644 --- a/src/main/ssh/ssh-connection.test.ts +++ b/src/main/ssh/ssh-connection.test.ts @@ -12,21 +12,21 @@ import { createCallbacks, createTarget } from './ssh-connection-test-fixtures' import { SshConnection } from './ssh-connection' vi.mock('ssh2', async () => (await import('./ssh-connection-test-harness')).createSsh2Module()) -vi.mock('./system-ssh-binary', async () => +vi.mock('./system-transport/system-ssh-binary', async () => (await import('./ssh-connection-test-harness')).createSystemSshBinaryModule() ) -vi.mock('./system-ssh-args', async (importOriginal) => +vi.mock('./system-transport/system-ssh-args', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshArgsMocks(await importOriginal()) ) -vi.mock('./system-ssh-command', async (importOriginal) => +vi.mock('./system-transport/system-ssh-command', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshCommandMocks(await importOriginal()) ) -vi.mock('./system-ssh-file-binary-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-binary-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileBinaryTransferMocks( await importOriginal() ) ) -vi.mock('./system-ssh-file-transfer', async (importOriginal) => +vi.mock('./system-transport/system-ssh-file-transfer', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSystemSshFileTransferMocks( await importOriginal() ) @@ -34,10 +34,10 @@ vi.mock('./system-ssh-file-transfer', async (importOriginal) => vi.mock('./ssh-control-socket', async () => (await import('./ssh-connection-test-harness')).createControlSocketModule() ) -vi.mock('./ssh-config-parser', async () => +vi.mock('./config/ssh-config-parser', async () => (await import('./ssh-connection-test-harness')).createSshConfigParserModule() ) -vi.mock('./ssh-g-config-resolution', async (importOriginal) => +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => (await import('./ssh-connection-test-harness')).withSshGConfigResolutionMocks( await importOriginal() ) diff --git a/src/main/ssh/ssh-connection.ts b/src/main/ssh/ssh-connection.ts index d17ca46b8edd..1d638dcfdefc 100644 --- a/src/main/ssh/ssh-connection.ts +++ b/src/main/ssh/ssh-connection.ts @@ -25,8 +25,8 @@ import { getOrcaControlSocketPath, isOpenSshConfigBackedTarget, type SystemSshBuildArgsOptions -} from './system-ssh-args' -import { spawnSystemSshCommand } from './system-ssh-command' +} from './system-transport/system-ssh-args' +import { spawnSystemSshCommand } from './system-transport/system-ssh-command' import { removeControlSocketPath } from './ssh-control-socket' import { INITIAL_RETRY_ATTEMPTS, @@ -61,7 +61,7 @@ import { siteConfigMayRestrictHostKeys, sshGArgsForHost, type SshResolvedConfig -} from './ssh-g-config-resolution' +} from './config/ssh-g-config-resolution' import { boundSshHostKeyStoreFile, loadTrustedHostKeys, @@ -73,7 +73,7 @@ import { loadKnownHostsEvidence, resolveKnownHostsFiles, resolveKnownHostsLookupHost -} from './ssh-known-hosts-source' +} from './config/ssh-known-hosts-source' import { createCancelledConnectAttemptError, isCancelledConnectAttemptError @@ -83,7 +83,7 @@ import { isTransientReconnectError } from './ssh-reconnect-error-classification' import { SshReconnectLadder } from './ssh-reconnect-ladder' -import { mayUserSshConfigClaimAlias } from './ssh-config-alias-claim' +import { mayUserSshConfigClaimAlias } from './config/ssh-config-alias-claim' import { didDeferKeyboardInteractive, didOfferKeyboardInteractive, diff --git a/src/main/ssh/ssh-control-socket.ts b/src/main/ssh/ssh-control-socket.ts index 4020a9459f8e..78cd1b490b0f 100644 --- a/src/main/ssh/ssh-control-socket.ts +++ b/src/main/ssh/ssh-control-socket.ts @@ -3,7 +3,7 @@ import { lstatSync, mkdirSync, rmSync } from 'node:fs' import { tmpdir } from 'node:os' import { isAbsolute, join as pathJoin } from 'node:path' import type { SshTarget } from '../../shared/ssh-types' -import type { SshResolvedConfig } from './ssh-g-config-resolution' +import type { SshResolvedConfig } from './config/ssh-g-config-resolution' export type SystemSshResolvedConfig = Pick< SshResolvedConfig, diff --git a/src/main/ssh/ssh-credential-prompt-login-grace-wire.test.ts b/src/main/ssh/ssh-credential-prompt-login-grace-wire.test.ts index 7a6dfff5ba91..0bcc8c197ceb 100644 --- a/src/main/ssh/ssh-credential-prompt-login-grace-wire.test.ts +++ b/src/main/ssh/ssh-credential-prompt-login-grace-wire.test.ts @@ -7,10 +7,10 @@ import { SshConnection } from './ssh-connection' import { INITIAL_RETRY_DELAY_MS } from './ssh-connection-utils' import { createCallbacks, createResolvedConfig, createTarget } from './ssh-connection-test-fixtures' import { initSshHostKeyStoreFile } from './ssh-host-key-store' -import { resolveWithSshG } from './ssh-g-config-resolution' -import type * as SshGConfigResolution from './ssh-g-config-resolution' +import { resolveWithSshG } from './config/ssh-g-config-resolution' +import type * as SshGConfigResolution from './config/ssh-g-config-resolution' -vi.mock('./ssh-g-config-resolution', async (importOriginal) => ({ +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => ({ ...(await importOriginal()), resolveWithSshG: vi.fn() })) diff --git a/src/main/ssh/ssh-exec-rc-stdout-noise.test.ts b/src/main/ssh/ssh-exec-rc-stdout-noise.test.ts index c7af6197b92d..f7e00bf66c4f 100644 --- a/src/main/ssh/ssh-exec-rc-stdout-noise.test.ts +++ b/src/main/ssh/ssh-exec-rc-stdout-noise.test.ts @@ -7,7 +7,7 @@ import { PassThrough } from 'node:stream' import { describe, expect, it, vi } from 'vitest' import { runProcess } from '@orca/process-host' import { wrapRemoteCommandForPosixShell, type SshExecOptions } from './ssh-connection-utils' -import { execCommand, isSshCommandExitError } from './remote-exec-command' +import { execCommand, isSshCommandExitError } from './remote-exec/remote-exec-command' import { readRemoteHomeCommand } from './ssh-remote-commands' import type { SshConnection } from './ssh-connection' import { tryResolveViaLoginShell } from './ssh-remote-node-resolution' diff --git a/src/main/ssh/ssh-exec-stdin-file-transfer.test.ts b/src/main/ssh/ssh-exec-stdin-file-transfer.test.ts index efd6d01d9cbb..1720c386aa88 100644 --- a/src/main/ssh/ssh-exec-stdin-file-transfer.test.ts +++ b/src/main/ssh/ssh-exec-stdin-file-transfer.test.ts @@ -24,7 +24,7 @@ import { writeStringViaExecStdin } from './ssh-exec-stdin-file-transfer' import { getRemoteHostPlatform } from './ssh-remote-platform' -import { makePosixWriteFileCommand } from './system-ssh-file-binary-transfer' +import { makePosixWriteFileCommand } from './system-transport/system-ssh-file-binary-transfer' const directories: string[] = [] afterEach(() => { diff --git a/src/main/ssh/ssh-exec-stdin-file-transfer.ts b/src/main/ssh/ssh-exec-stdin-file-transfer.ts index 4bbadd5ad449..d9d750353c40 100644 --- a/src/main/ssh/ssh-exec-stdin-file-transfer.ts +++ b/src/main/ssh/ssh-exec-stdin-file-transfer.ts @@ -13,11 +13,11 @@ import { posix } from 'node:path' import { Readable } from 'node:stream' import type { RemoteInstallTransport } from '../managed-server/install/remote-install-transport' import { shellEscape } from './ssh-connection-utils' -import { execCommand } from './remote-exec-command' +import { execCommand } from './remote-exec/remote-exec-command' import { RELAY_DEPLOY_TIMEOUT_MS } from '../managed-server/install/remote-deploy-timing' import type { RemoteHostPlatform } from './ssh-remote-platform' -import { makePosixWriteFileCommand } from './system-ssh-file-binary-transfer' -import { collectLocalUploadPlan } from './system-ssh-file-transfer' +import { makePosixWriteFileCommand } from './system-transport/system-ssh-file-binary-transfer' +import { collectLocalUploadPlan } from './system-transport/system-ssh-file-transfer' export const EXEC_STDIN_WRITE_DONE = 'ORCA_EXEC_STDIN_WRITE_DONE' diff --git a/src/main/ssh/ssh-host-key-decision.ts b/src/main/ssh/ssh-host-key-decision.ts index a42f04632692..02707dcade9a 100644 --- a/src/main/ssh/ssh-host-key-decision.ts +++ b/src/main/ssh/ssh-host-key-decision.ts @@ -5,7 +5,7 @@ * rather than importing its sources so a test states its own trust state instead of writing files. * See docs/reference/ssh-host-key-verification.md. */ -import type { KnownHostsOutcome } from './ssh-known-hosts' +import type { KnownHostsOutcome } from './config/ssh-known-hosts' /** Phase 1 ships no dialog; `prompt` is reserved for Phase 2 and never produced today. */ export type HostKeyAction = 'accept' | 'accept-and-remember' | 'reject' | 'prompt' diff --git a/src/main/ssh/ssh-host-key-store.ts b/src/main/ssh/ssh-host-key-store.ts index d764084eb174..a29f009967b3 100644 --- a/src/main/ssh/ssh-host-key-store.ts +++ b/src/main/ssh/ssh-host-key-store.ts @@ -13,7 +13,7 @@ import { readHostKeyType, type KnownHostsOutcome, type KnownHostsQuery -} from './ssh-known-hosts' +} from './config/ssh-known-hosts' const STORE_FILE_NAME = 'ssh-host-keys.json' const STORE_VERSION = 1 diff --git a/src/main/ssh/ssh-host-key-verifier.test.ts b/src/main/ssh/ssh-host-key-verifier.test.ts index 3edb812ec3dc..01cb2a622964 100644 --- a/src/main/ssh/ssh-host-key-verifier.test.ts +++ b/src/main/ssh/ssh-host-key-verifier.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { parseKnownHosts } from './ssh-known-hosts' +import { parseKnownHosts } from './config/ssh-known-hosts' import { createHostKeyVerifier, DEFAULT_SERVER_HOST_KEY_ALGORITHMS, diff --git a/src/main/ssh/ssh-host-key-verifier.ts b/src/main/ssh/ssh-host-key-verifier.ts index ab1b01aa05d3..65da407ee840 100644 --- a/src/main/ssh/ssh-host-key-verifier.ts +++ b/src/main/ssh/ssh-host-key-verifier.ts @@ -14,7 +14,7 @@ import { readHostKeyType, type KnownHostsEntry, type KnownHostsOutcome -} from './ssh-known-hosts' +} from './config/ssh-known-hosts' import { decideHostKey, type HostKeyDecision } from './ssh-host-key-decision' export type TrustedHostKeyLookup = (query: { diff --git a/src/main/ssh/ssh-keyboard-interactive-wire.test.ts b/src/main/ssh/ssh-keyboard-interactive-wire.test.ts index 77f74e90c9cd..494503ec137f 100644 --- a/src/main/ssh/ssh-keyboard-interactive-wire.test.ts +++ b/src/main/ssh/ssh-keyboard-interactive-wire.test.ts @@ -6,10 +6,10 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { SshConnection } from './ssh-connection' import { createCallbacks, createResolvedConfig, createTarget } from './ssh-connection-test-fixtures' import { initSshHostKeyStoreFile } from './ssh-host-key-store' -import { resolveWithSshG } from './ssh-g-config-resolution' -import type * as SshGConfigResolution from './ssh-g-config-resolution' +import { resolveWithSshG } from './config/ssh-g-config-resolution' +import type * as SshGConfigResolution from './config/ssh-g-config-resolution' -vi.mock('./ssh-g-config-resolution', async (importOriginal) => ({ +vi.mock('./config/ssh-g-config-resolution', async (importOriginal) => ({ ...(await importOriginal()), resolveWithSshG: vi.fn() })) diff --git a/src/main/ssh/ssh-multi-factor-authentication.test.ts b/src/main/ssh/ssh-multi-factor-authentication.test.ts index 694ee8b21dc0..cab4c2d4c954 100644 --- a/src/main/ssh/ssh-multi-factor-authentication.test.ts +++ b/src/main/ssh/ssh-multi-factor-authentication.test.ts @@ -18,7 +18,7 @@ import { } from 'ssh2' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { SshTarget } from '../../shared/ssh-types' -import type { SshResolvedConfig } from './ssh-g-config-resolution' +import type { SshResolvedConfig } from './config/ssh-g-config-resolution' import { buildConnectConfig, type BuildConnectConfigOptions } from './ssh-connection-utils' vi.mock('node:os', async (importOriginal) => { diff --git a/src/main/ssh/ssh-multi-key-authentication.test.ts b/src/main/ssh/ssh-multi-key-authentication.test.ts index 7badbfb5cd24..afa3e2b07c17 100644 --- a/src/main/ssh/ssh-multi-key-authentication.test.ts +++ b/src/main/ssh/ssh-multi-key-authentication.test.ts @@ -24,10 +24,10 @@ vi.mock('fs', () => ({ import { buildConnectConfig } from './ssh-connection-utils' import { getPassphrasePrivateKeyPath } from './ssh-private-key-authentication' -import { buildSshArgs } from './system-ssh-args' +import { buildSshArgs } from './system-transport/system-ssh-args' import { walkInitialAuthLadder } from './ssh-connection-test-fixtures' import type { SshTarget } from '../../shared/ssh-types' -import type { SshResolvedConfig } from './ssh-g-config-resolution' +import type { SshResolvedConfig } from './config/ssh-g-config-resolution' function makeTarget(overrides: Partial = {}): SshTarget { return { diff --git a/src/main/ssh/ssh-proxy-command.ts b/src/main/ssh/ssh-proxy-command.ts index a597ab5b55a0..8b60a1ad5c75 100644 --- a/src/main/ssh/ssh-proxy-command.ts +++ b/src/main/ssh/ssh-proxy-command.ts @@ -3,9 +3,9 @@ import { spawnProcess } from '@orca/process-host' import { Duplex } from 'node:stream' import type { Socket as NetSocket } from 'node:net' import type { SshTarget } from '../../shared/ssh-types' -import type { SshResolvedConfig } from './ssh-g-config-resolution' +import type { SshResolvedConfig } from './config/ssh-g-config-resolution' import { shellEscape } from './ssh-connection-utils' -import { isOpenSshConfigBackedTarget } from './system-ssh-args' +import { isOpenSshConfigBackedTarget } from './system-transport/system-ssh-args' // Why: ProxyJump and jumpHost are syntactic sugar for ProxyCommand. // OpenSSH internally converts `ProxyJump bastion` to diff --git a/src/main/ssh/ssh-remote-node-install-guidance.ts b/src/main/ssh/ssh-remote-node-install-guidance.ts index af8b1bba92c0..5e08bdc1842c 100644 --- a/src/main/ssh/ssh-remote-node-install-guidance.ts +++ b/src/main/ssh/ssh-remote-node-install-guidance.ts @@ -1,6 +1,6 @@ import type { SshConnection } from './ssh-connection' import { createSshOperationAbortError } from './ssh-connection-utils' -import { execCommand } from './remote-exec-command' +import { execCommand } from './remote-exec/remote-exec-command' import { isSshSessionLimitError } from './ssh-session-limit-error' export type RemoteNodeResolutionOptions = { diff --git a/src/main/ssh/ssh-remote-node-resolution.test.ts b/src/main/ssh/ssh-remote-node-resolution.test.ts index 8a01050dbedf..7375c7722992 100644 --- a/src/main/ssh/ssh-remote-node-resolution.test.ts +++ b/src/main/ssh/ssh-remote-node-resolution.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from './remote-exec-command' +import type * as ExecCommandModule from './remote-exec/remote-exec-command' import { execFileSync } from 'node:child_process' import { chmodSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' import os from 'node:os' @@ -9,7 +9,7 @@ import { getRemoteHostPlatform } from './ssh-remote-platform' const execCommandMock = vi.hoisted(() => vi.fn()) -vi.mock('./remote-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: execCommandMock })) diff --git a/src/main/ssh/ssh-remote-node-resolution.ts b/src/main/ssh/ssh-remote-node-resolution.ts index ef58f2004d30..05ff680e6f35 100644 --- a/src/main/ssh/ssh-remote-node-resolution.ts +++ b/src/main/ssh/ssh-remote-node-resolution.ts @@ -7,7 +7,7 @@ import { buildPosixNodeInstallGuidance, type RemoteNodeResolutionOptions } from './ssh-remote-node-install-guidance' -import { execCommand, isSshCommandExitError } from './remote-exec-command' +import { execCommand, isSshCommandExitError } from './remote-exec/remote-exec-command' import { buildPosixNodeToolchainProbe, buildWindowsNodeToolchainProbe, diff --git a/src/main/ssh/ssh-remote-platform-detection.test.ts b/src/main/ssh/ssh-remote-platform-detection.test.ts index a7b3445e609e..07e91aa58b6f 100644 --- a/src/main/ssh/ssh-remote-platform-detection.test.ts +++ b/src/main/ssh/ssh-remote-platform-detection.test.ts @@ -1,11 +1,11 @@ -import type * as ExecCommandModule from './remote-exec-command' +import type * as ExecCommandModule from './remote-exec/remote-exec-command' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { SshConnection } from './ssh-connection' -import { SSH_EXEC_TIMEOUT_CODE } from './remote-exec-command' +import { SSH_EXEC_TIMEOUT_CODE } from './remote-exec/remote-exec-command' const execCommandMock = vi.hoisted(() => vi.fn()) -vi.mock('./remote-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: execCommandMock })) diff --git a/src/main/ssh/ssh-remote-platform-detection.ts b/src/main/ssh/ssh-remote-platform-detection.ts index 09cc9f0d6237..dd20d20fad8d 100644 --- a/src/main/ssh/ssh-remote-platform-detection.ts +++ b/src/main/ssh/ssh-remote-platform-detection.ts @@ -3,12 +3,12 @@ import { getProcessOutputFields, iterateProcessOutputLines } from '../../shared/process-output-field-scanner' -import { parseUnameToRelayPlatform, type RelayPlatform } from './remote-frame-protocol' +import { parseUnameToRelayPlatform, type RelayPlatform } from './remote-exec/remote-frame-protocol' import { execCommand, isSshExecTimeout, isUnconfirmedSshCommandTermination -} from './remote-exec-command' +} from './remote-exec/remote-exec-command' import { isSshSessionLimitError } from './ssh-session-limit-error' import { getRemoteHostPlatform, type RemoteHostPlatform } from './ssh-remote-platform' import { powerShellCommand } from './ssh-remote-powershell' diff --git a/src/main/ssh/ssh-remote-platform.ts b/src/main/ssh/ssh-remote-platform.ts index 1fcd9ede6d74..1b8925519006 100644 --- a/src/main/ssh/ssh-remote-platform.ts +++ b/src/main/ssh/ssh-remote-platform.ts @@ -1,4 +1,4 @@ -import type { RelayPlatform } from './remote-frame-protocol' +import type { RelayPlatform } from './remote-exec/remote-frame-protocol' export type RemotePathFlavor = 'posix' | 'windows' export type RemoteCommandDialect = 'posix' | 'powershell' diff --git a/src/main/ssh/ssh-remote-windows-command-line-limit.test.ts b/src/main/ssh/ssh-remote-windows-command-line-limit.test.ts index 0db271c18bef..adc186e1f8c3 100644 --- a/src/main/ssh/ssh-remote-windows-command-line-limit.test.ts +++ b/src/main/ssh/ssh-remote-windows-command-line-limit.test.ts @@ -7,7 +7,7 @@ import { decodeRemotePowerShellScript, powerShellCommand } from './ssh-remote-po import { makeWindowsPublishStagedFileCommand, makeWindowsWriteFileCommand -} from './system-ssh-windows-file-write' +} from './system-transport/system-ssh-windows-file-write' const windows = getRemoteHostPlatform('win32-x64') // Why: sshd runs an exec request through its DefaultShell, which is cmd.exe on a diff --git a/src/main/ssh/ssh-security-key-identity.test.ts b/src/main/ssh/ssh-security-key-identity.test.ts index a16f5d2d96d9..026a12d91419 100644 --- a/src/main/ssh/ssh-security-key-identity.test.ts +++ b/src/main/ssh/ssh-security-key-identity.test.ts @@ -15,7 +15,7 @@ import { requiresSystemSshForSecurityKey } from './ssh-transport-selection' const { findSystemSshMock } = vi.hoisted(() => ({ findSystemSshMock: vi.fn() })) -vi.mock('./system-ssh-binary', () => ({ findSystemSsh: findSystemSshMock })) +vi.mock('./system-transport/system-ssh-binary', () => ({ findSystemSsh: findSystemSshMock })) vi.mock('node:os', async (importOriginal) => { const actual = await importOriginal<{ homedir: () => string }>() diff --git a/src/main/ssh/ssh-system-transport.integration.test.ts b/src/main/ssh/ssh-system-transport.integration.test.ts index 81d1daa64399..2df57ba5094a 100644 --- a/src/main/ssh/ssh-system-transport.integration.test.ts +++ b/src/main/ssh/ssh-system-transport.integration.test.ts @@ -7,7 +7,7 @@ vi.mock('electron', () => ({ })) import { SshConnection } from './ssh-connection' -import { uploadDirectoryViaSystemSsh } from './system-ssh-file-transfer' +import { uploadDirectoryViaSystemSsh } from './system-transport/system-ssh-file-transfer' import type { SshTarget } from '../../shared/ssh-types' import { relayArtifactFilenames } from './relay-install-artifacts' diff --git a/src/main/ssh/ssh-transport-selection.ts b/src/main/ssh/ssh-transport-selection.ts index ffa311eb4d66..8434dedc4c88 100644 --- a/src/main/ssh/ssh-transport-selection.ts +++ b/src/main/ssh/ssh-transport-selection.ts @@ -1,16 +1,16 @@ import { constants } from 'node:fs' import { open, stat } from 'node:fs/promises' import type { SshTarget } from '../../shared/ssh-types' -import type { SshResolvedConfig } from './ssh-g-config-resolution' +import type { SshResolvedConfig } from './config/ssh-g-config-resolution' import { listDefaultIdentityFilePaths, resolveIdentityFilePaths } from './ssh-auth-resolution' -import { resolveSshConfigHomePath } from './ssh-config-path-expansion' +import { resolveSshConfigHomePath } from './config/ssh-config-path-expansion' import { MAX_SSH_IDENTITY_FILE_BYTES, isOpenSshSecurityKeyPrivateKey, isOpenSshSecurityKeyPublicKey } from './ssh-security-key-identity' -import { isOpenSshConfigBackedTarget } from './system-ssh-args' -import { findSystemSsh } from './system-ssh-binary' +import { isOpenSshConfigBackedTarget } from './system-transport/system-ssh-args' +import { findSystemSsh } from './system-transport/system-ssh-binary' type TransportResolvedConfig = Pick< SshResolvedConfig, diff --git a/src/main/ssh/system-ssh-args.ts b/src/main/ssh/system-transport/system-ssh-args.ts similarity index 99% rename from src/main/ssh/system-ssh-args.ts rename to src/main/ssh/system-transport/system-ssh-args.ts index 6cf77af4b101..e2134681fa78 100644 --- a/src/main/ssh/system-ssh-args.ts +++ b/src/main/ssh/system-transport/system-ssh-args.ts @@ -1,5 +1,5 @@ -import type { SshTarget } from '../../shared/ssh-types' -import { getControlSocketPath, type SystemSshResolvedConfig } from './ssh-control-socket' +import type { SshTarget } from '../../../shared/ssh-types' +import { getControlSocketPath, type SystemSshResolvedConfig } from '../ssh-control-socket' export type SystemSshBuildArgsOptions = { configFile?: string diff --git a/src/main/ssh/system-ssh-binary.test.ts b/src/main/ssh/system-transport/system-ssh-binary.test.ts similarity index 100% rename from src/main/ssh/system-ssh-binary.test.ts rename to src/main/ssh/system-transport/system-ssh-binary.test.ts diff --git a/src/main/ssh/system-ssh-binary.ts b/src/main/ssh/system-transport/system-ssh-binary.ts similarity index 100% rename from src/main/ssh/system-ssh-binary.ts rename to src/main/ssh/system-transport/system-ssh-binary.ts diff --git a/src/main/ssh/system-ssh-command.ts b/src/main/ssh/system-transport/system-ssh-command.ts similarity index 98% rename from src/main/ssh/system-ssh-command.ts rename to src/main/ssh/system-transport/system-ssh-command.ts index 15f099a5f881..f75931588a0f 100644 --- a/src/main/ssh/system-ssh-command.ts +++ b/src/main/ssh/system-transport/system-ssh-command.ts @@ -1,8 +1,8 @@ import { spawn, type ChildProcess } from 'node:child_process' import { Duplex } from 'node:stream' import type { ClientChannel } from 'ssh2' -import type { SshTarget } from '../../shared/ssh-types' -import { wrapRemoteCommandForPosixShell, type SshExecOptions } from './ssh-connection-utils' +import type { SshTarget } from '../../../shared/ssh-types' +import { wrapRemoteCommandForPosixShell, type SshExecOptions } from '../ssh-connection-utils' import { buildSshArgs, type SystemSshBuildArgsOptions } from './system-ssh-args' import { findSystemSsh } from './system-ssh-binary' diff --git a/src/main/ssh/system-ssh-dynamic-forward-process.test.ts b/src/main/ssh/system-transport/system-ssh-dynamic-forward-process.test.ts similarity index 100% rename from src/main/ssh/system-ssh-dynamic-forward-process.test.ts rename to src/main/ssh/system-transport/system-ssh-dynamic-forward-process.test.ts diff --git a/src/main/ssh/system-ssh-dynamic-forward-process.ts b/src/main/ssh/system-transport/system-ssh-dynamic-forward-process.ts similarity index 98% rename from src/main/ssh/system-ssh-dynamic-forward-process.ts rename to src/main/ssh/system-transport/system-ssh-dynamic-forward-process.ts index e036dacd9270..07cc7d1f101d 100644 --- a/src/main/ssh/system-ssh-dynamic-forward-process.ts +++ b/src/main/ssh/system-transport/system-ssh-dynamic-forward-process.ts @@ -1,6 +1,6 @@ import { spawn, type ChildProcess } from 'node:child_process' import { connect, createServer, type AddressInfo, type Socket } from 'node:net' -import type { SshTarget } from '../../shared/ssh-types' +import type { SshTarget } from '../../../shared/ssh-types' import { buildSshArgs, type SystemSshBuildArgsOptions } from './system-ssh-args' import { findSystemSsh } from './system-ssh-binary' import { waitForSystemSshForwardStop } from './system-ssh-forward-process' diff --git a/src/main/ssh/system-ssh-file-binary-transfer.ts b/src/main/ssh/system-transport/system-ssh-file-binary-transfer.ts similarity index 96% rename from src/main/ssh/system-ssh-file-binary-transfer.ts rename to src/main/ssh/system-transport/system-ssh-file-binary-transfer.ts index 8ab036563c9f..e7ce97f0bf3b 100644 --- a/src/main/ssh/system-ssh-file-binary-transfer.ts +++ b/src/main/ssh/system-transport/system-ssh-file-binary-transfer.ts @@ -4,16 +4,16 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import type { Writable } from 'node:stream' import { pipeline } from 'node:stream/promises' -import type { SshTarget } from '../../shared/ssh-types' -import { shellEscape } from './ssh-connection-utils' +import type { SshTarget } from '../../../shared/ssh-types' +import { shellEscape } from '../ssh-connection-utils' import { getSystemSshBuildArgsFromOperationOptions, type SystemSshBuildArgsOptions } from './system-ssh-args' import { spawnSystemSshCommand } from './system-ssh-command' -import { isWindowsRemoteHost, type RemoteHostPlatform } from './ssh-remote-platform' -import { powerShellCommand } from './ssh-remote-powershell' -import { quotePowerShellLiteral as powerShellLiteral } from '../../shared/powershell-native-argument' +import { isWindowsRemoteHost, type RemoteHostPlatform } from '../ssh-remote-platform' +import { powerShellCommand } from '../ssh-remote-powershell' +import { quotePowerShellLiteral as powerShellLiteral } from '../../../shared/powershell-native-argument' import { awaitWithSystemSshAbort, throwIfAborted, diff --git a/src/main/ssh/system-ssh-file-transfer.ts b/src/main/ssh/system-transport/system-ssh-file-transfer.ts similarity index 96% rename from src/main/ssh/system-ssh-file-transfer.ts rename to src/main/ssh/system-transport/system-ssh-file-transfer.ts index 377435440fe0..4c6ea1e16e23 100644 --- a/src/main/ssh/system-ssh-file-transfer.ts +++ b/src/main/ssh/system-transport/system-ssh-file-transfer.ts @@ -1,10 +1,10 @@ -import { DirectoryTransferBudget } from './ssh-directory-transfer-budget' +import { DirectoryTransferBudget } from '../ssh-directory-transfer-budget' import { spawn, type ChildProcess } from 'node:child_process' import { lstat, opendir } from 'node:fs/promises' import { join as pathJoin } from 'node:path' import { pipeline } from 'node:stream/promises' -import type { SshTarget } from '../../shared/ssh-types' -import { shellEscape, wrapRemoteCommandForPosixShell } from './ssh-connection-utils' +import type { SshTarget } from '../../../shared/ssh-types' +import { shellEscape, wrapRemoteCommandForPosixShell } from '../ssh-connection-utils' import { findSystemSsh } from './system-ssh-binary' import { buildSshArgs, @@ -12,8 +12,12 @@ import { type SystemSshBuildArgsOptions } from './system-ssh-args' import { spawnSystemSshCommand } from './system-ssh-command' -import { isWindowsRemoteHost, joinRemotePath, type RemoteHostPlatform } from './ssh-remote-platform' -import { powerShellCommand } from './ssh-remote-powershell' +import { + isWindowsRemoteHost, + joinRemotePath, + type RemoteHostPlatform +} from '../ssh-remote-platform' +import { powerShellCommand } from '../ssh-remote-powershell' import { awaitWithSystemSshAbort, killProcess, diff --git a/src/main/ssh/system-ssh-forward-process.test.ts b/src/main/ssh/system-transport/system-ssh-forward-process.test.ts similarity index 99% rename from src/main/ssh/system-ssh-forward-process.test.ts rename to src/main/ssh/system-transport/system-ssh-forward-process.test.ts index cefc09915db1..05c4b299e2dd 100644 --- a/src/main/ssh/system-ssh-forward-process.test.ts +++ b/src/main/ssh/system-transport/system-ssh-forward-process.test.ts @@ -43,7 +43,7 @@ import { waitForSystemSshForwardStartup, waitForSystemSshForwardStop } from './system-ssh-forward-process' -import type { SshTarget } from '../../shared/ssh-types' +import type { SshTarget } from '../../../shared/ssh-types' const SYSTEM_SSH_PATH = process.platform === 'win32' ? 'C:\\Windows\\System32\\OpenSSH\\ssh.exe' : '/usr/bin/ssh' diff --git a/src/main/ssh/system-ssh-forward-process.ts b/src/main/ssh/system-transport/system-ssh-forward-process.ts similarity index 99% rename from src/main/ssh/system-ssh-forward-process.ts rename to src/main/ssh/system-transport/system-ssh-forward-process.ts index a79a1086947d..964d81da3a1c 100644 --- a/src/main/ssh/system-ssh-forward-process.ts +++ b/src/main/ssh/system-transport/system-ssh-forward-process.ts @@ -3,7 +3,7 @@ import { connect, createServer } from 'node:net' import { buildSshArgs, type SystemSshBuildArgsOptions } from './system-ssh-args' import { findSystemSsh } from './system-ssh-binary' import { stopOrphanedOrcaSshForward } from './system-ssh-orphaned-forward' -import type { SshTarget } from '../../shared/ssh-types' +import type { SshTarget } from '../../../shared/ssh-types' export const SYSTEM_SSH_FORWARD_STARTUP_GRACE_MS = 750 export const SYSTEM_SSH_FORWARD_LISTENER_PROBE_INTERVAL_MS = 50 diff --git a/src/main/ssh/system-ssh-operation-lifecycle.ts b/src/main/ssh/system-transport/system-ssh-operation-lifecycle.ts similarity index 100% rename from src/main/ssh/system-ssh-operation-lifecycle.ts rename to src/main/ssh/system-transport/system-ssh-operation-lifecycle.ts diff --git a/src/main/ssh/system-ssh-operations.test.ts b/src/main/ssh/system-transport/system-ssh-operations.test.ts similarity index 99% rename from src/main/ssh/system-ssh-operations.test.ts rename to src/main/ssh/system-transport/system-ssh-operations.test.ts index 5f3347509ff1..59f58d971b12 100644 --- a/src/main/ssh/system-ssh-operations.test.ts +++ b/src/main/ssh/system-transport/system-ssh-operations.test.ts @@ -30,9 +30,9 @@ import { } from './system-ssh-file-binary-transfer' import { spawnSystemSsh, spawnSystemSshCommand } from './system-ssh-command' import { uploadDirectoryViaSystemSsh, writeFileViaSystemSsh } from './system-ssh-file-transfer' -import { getRemoteHostPlatform } from './ssh-remote-platform' -import type { SshTarget } from '../../shared/ssh-types' -import type { SystemSshResolvedConfig } from './ssh-control-socket' +import { getRemoteHostPlatform } from '../ssh-remote-platform' +import type { SshTarget } from '../../../shared/ssh-types' +import type { SystemSshResolvedConfig } from '../ssh-control-socket' const SYSTEM_SSH_PATH = process.platform === 'win32' ? 'C:\\Windows\\System32\\OpenSSH\\ssh.exe' : '/usr/bin/ssh' diff --git a/src/main/ssh/system-ssh-orphaned-forward.test.ts b/src/main/ssh/system-transport/system-ssh-orphaned-forward.test.ts similarity index 100% rename from src/main/ssh/system-ssh-orphaned-forward.test.ts rename to src/main/ssh/system-transport/system-ssh-orphaned-forward.test.ts diff --git a/src/main/ssh/system-ssh-orphaned-forward.ts b/src/main/ssh/system-transport/system-ssh-orphaned-forward.ts similarity index 96% rename from src/main/ssh/system-ssh-orphaned-forward.ts rename to src/main/ssh/system-transport/system-ssh-orphaned-forward.ts index 237d68905fea..2fa75291dc8b 100644 --- a/src/main/ssh/system-ssh-orphaned-forward.ts +++ b/src/main/ssh/system-transport/system-ssh-orphaned-forward.ts @@ -5,12 +5,12 @@ * Orca would spawn for this same forward and host, and whose parent is gone, qualifies: a user's * own ssh and a live Orca's tunnel never match. */ -import { getFreshShellForegroundSnapshot } from '../../shared/process-table-snapshot-reader' -import { readWindowsProcessTableFresh } from '../windows/windows-process-table' +import { getFreshShellForegroundSnapshot } from '../../../shared/process-table-snapshot-reader' +import { readWindowsProcessTableFresh } from '../../windows/windows-process-table' import { PROCESS_START_TIME_TOLERANCE_MS, readProcessStartTimeMs -} from '../runtime/agent-session-process-identity-probe' +} from '../../runtime/agent-session-process-identity-probe' export type SshForwardProcessRow = { pid: number diff --git a/src/main/ssh/system-ssh-sftp-args.test.ts b/src/main/ssh/system-transport/system-ssh-sftp-args.test.ts similarity index 100% rename from src/main/ssh/system-ssh-sftp-args.test.ts rename to src/main/ssh/system-transport/system-ssh-sftp-args.test.ts diff --git a/src/main/ssh/system-ssh-sftp-args.ts b/src/main/ssh/system-transport/system-ssh-sftp-args.ts similarity index 100% rename from src/main/ssh/system-ssh-sftp-args.ts rename to src/main/ssh/system-transport/system-ssh-sftp-args.ts diff --git a/src/main/ssh/system-ssh-sftp-path.test.ts b/src/main/ssh/system-transport/system-ssh-sftp-path.test.ts similarity index 100% rename from src/main/ssh/system-ssh-sftp-path.test.ts rename to src/main/ssh/system-transport/system-ssh-sftp-path.test.ts diff --git a/src/main/ssh/system-ssh-sftp-path.ts b/src/main/ssh/system-transport/system-ssh-sftp-path.ts similarity index 96% rename from src/main/ssh/system-ssh-sftp-path.ts rename to src/main/ssh/system-transport/system-ssh-sftp-path.ts index 2b5bfe53f026..dcc4fdb36e66 100644 --- a/src/main/ssh/system-ssh-sftp-path.ts +++ b/src/main/ssh/system-transport/system-ssh-sftp-path.ts @@ -1,4 +1,4 @@ -import { normalizeWindowsRemotePath } from './ssh-remote-platform' +import { normalizeWindowsRemotePath } from '../ssh-remote-platform' /** * A path this transfer cannot express to sftp. Callers treat it as "use another transport", never diff --git a/src/main/ssh/system-ssh-sftp-transfer.ts b/src/main/ssh/system-transport/system-ssh-sftp-transfer.ts similarity index 99% rename from src/main/ssh/system-ssh-sftp-transfer.ts rename to src/main/ssh/system-transport/system-ssh-sftp-transfer.ts index e0a0a1bc4240..058254481a91 100644 --- a/src/main/ssh/system-ssh-sftp-transfer.ts +++ b/src/main/ssh/system-transport/system-ssh-sftp-transfer.ts @@ -1,6 +1,6 @@ import { accessSync, constants, existsSync, statSync } from 'node:fs' import { posix, win32 } from 'node:path' -import type { SshTarget } from '../../shared/ssh-types' +import type { SshTarget } from '../../../shared/ssh-types' import { buildSshArgs, type SystemSshBuildArgsOptions } from './system-ssh-args' import { findSystemSsh } from './system-ssh-binary' import { diff --git a/src/main/ssh/system-ssh-upload-plan-budget.test.ts b/src/main/ssh/system-transport/system-ssh-upload-plan-budget.test.ts similarity index 96% rename from src/main/ssh/system-ssh-upload-plan-budget.test.ts rename to src/main/ssh/system-transport/system-ssh-upload-plan-budget.test.ts index d623c036992f..4e95b78fab6a 100644 --- a/src/main/ssh/system-ssh-upload-plan-budget.test.ts +++ b/src/main/ssh/system-transport/system-ssh-upload-plan-budget.test.ts @@ -7,7 +7,7 @@ vi.mock('node:fs/promises', async (load) => ({ lstat: stats })) import { collectLocalUploadPlan } from './system-ssh-file-transfer' -import { getRemoteHostPlatform } from './ssh-remote-platform' +import { getRemoteHostPlatform } from '../ssh-remote-platform' it('stops the upload producer at its retained-plan ceiling before any transfer starts', async () => { let visited = 0 diff --git a/src/main/ssh/system-ssh-windows-file-write.ts b/src/main/ssh/system-transport/system-ssh-windows-file-write.ts similarity index 97% rename from src/main/ssh/system-ssh-windows-file-write.ts rename to src/main/ssh/system-transport/system-ssh-windows-file-write.ts index 5efc788aa777..2d56a23ea986 100644 --- a/src/main/ssh/system-ssh-windows-file-write.ts +++ b/src/main/ssh/system-transport/system-ssh-windows-file-write.ts @@ -1,7 +1,7 @@ import { randomBytes } from 'node:crypto' -import { powerShellCommand } from './ssh-remote-powershell' -import { quotePowerShellLiteral as powerShellLiteral } from '../../shared/powershell-native-argument' -import { normalizeWindowsRemotePath } from './ssh-remote-platform' +import { powerShellCommand } from '../ssh-remote-powershell' +import { quotePowerShellLiteral as powerShellLiteral } from '../../../shared/powershell-native-argument' +import { normalizeWindowsRemotePath } from '../ssh-remote-platform' /** * Suffix marking the path a Windows write lands on before it is published by rename. diff --git a/src/main/ssh/system-ssh-windows-upload.test.ts b/src/main/ssh/system-transport/system-ssh-windows-upload.test.ts similarity index 99% rename from src/main/ssh/system-ssh-windows-upload.test.ts rename to src/main/ssh/system-transport/system-ssh-windows-upload.test.ts index 967923aefb76..2f3acdd21018 100644 --- a/src/main/ssh/system-ssh-windows-upload.test.ts +++ b/src/main/ssh/system-transport/system-ssh-windows-upload.test.ts @@ -47,7 +47,7 @@ import { uploadFileViaSystemSsh, writeBufferViaSystemSsh } from './system-ssh-fi import { WINDOWS_STAGED_WRITE_SUFFIX } from './system-ssh-windows-file-write' import { waitForChannelClose } from './system-ssh-operation-lifecycle' import * as windowsFileWrite from './system-ssh-windows-file-write' -import { getRemoteHostPlatform } from './ssh-remote-platform' +import { getRemoteHostPlatform } from '../ssh-remote-platform' import { clearWindowsRemoteWriteCapabilitiesForTests, getWindowsRemoteWriteCapabilities @@ -58,7 +58,7 @@ import { WINDOWS_STDIN_WRITE_TIMEOUT_MS, writeWindowsRemoteFile } from './system-ssh-windows-write-strategy' -import type { SshTarget } from '../../shared/ssh-types' +import type { SshTarget } from '../../../shared/ssh-types' type FakeChannel = EventEmitter & { stdin: Writable diff --git a/src/main/ssh/system-ssh-windows-write-capabilities.test.ts b/src/main/ssh/system-transport/system-ssh-windows-write-capabilities.test.ts similarity index 98% rename from src/main/ssh/system-ssh-windows-write-capabilities.test.ts rename to src/main/ssh/system-transport/system-ssh-windows-write-capabilities.test.ts index 7926341a1410..b424389e7674 100644 --- a/src/main/ssh/system-ssh-windows-write-capabilities.test.ts +++ b/src/main/ssh/system-transport/system-ssh-windows-write-capabilities.test.ts @@ -4,7 +4,7 @@ * re-probed once per file, and two targets pointing at one machine learn the same fact twice. */ import { afterEach, describe, expect, it } from 'vitest' -import type { SshTarget } from '../../shared/ssh-types' +import type { SshTarget } from '../../../shared/ssh-types' import { clearWindowsRemoteWriteCapabilitiesForTests, getWindowsRemoteWriteCapabilities, diff --git a/src/main/ssh/system-ssh-windows-write-capabilities.ts b/src/main/ssh/system-transport/system-ssh-windows-write-capabilities.ts similarity index 94% rename from src/main/ssh/system-ssh-windows-write-capabilities.ts rename to src/main/ssh/system-transport/system-ssh-windows-write-capabilities.ts index 902818a4158d..cb37d2567fd9 100644 --- a/src/main/ssh/system-ssh-windows-write-capabilities.ts +++ b/src/main/ssh/system-transport/system-ssh-windows-write-capabilities.ts @@ -1,5 +1,5 @@ -import type { SshTarget } from '../../shared/ssh-types' -import { CapabilityProbeCache } from '../../shared/capability-probe-cache' +import type { SshTarget } from '../../../shared/ssh-types' +import { CapabilityProbeCache } from '../../../shared/capability-probe-cache' /** * Whether a Windows host can take a file write over the sftp subsystem, and whether it has a diff --git a/src/main/ssh/system-ssh-windows-write-strategy.ts b/src/main/ssh/system-transport/system-ssh-windows-write-strategy.ts similarity index 99% rename from src/main/ssh/system-ssh-windows-write-strategy.ts rename to src/main/ssh/system-transport/system-ssh-windows-write-strategy.ts index e8016db313ce..8c1b69622a7f 100644 --- a/src/main/ssh/system-ssh-windows-write-strategy.ts +++ b/src/main/ssh/system-transport/system-ssh-windows-write-strategy.ts @@ -1,4 +1,4 @@ -import type { SshTarget } from '../../shared/ssh-types' +import type { SshTarget } from '../../../shared/ssh-types' import { getSystemSshBuildArgsFromOperationOptions } from './system-ssh-args' import { spawnSystemSshCommand } from './system-ssh-command' import { diff --git a/src/main/startup/headless-serve-ssh-registration.test.ts b/src/main/startup/headless-serve-ssh-registration.test.ts index 785cec01c6cc..567498b94e59 100644 --- a/src/main/startup/headless-serve-ssh-registration.test.ts +++ b/src/main/startup/headless-serve-ssh-registration.test.ts @@ -5,7 +5,7 @@ const mocks = await vi.hoisted(async () => { return createSshIpcMocks() }) -vi.mock('../ssh/ssh-config-host-picker', () => mocks.sshConfigHostPicker) +vi.mock('../ssh/config/ssh-config-host-picker', () => mocks.sshConfigHostPicker) vi.mock('electron', () => mocks.electron) vi.mock('../ssh/ssh-connection-store', () => mocks.sshConnectionStore) vi.mock('../ipc/ssh-host-server-connect', () => mocks.hostServerConnect) diff --git a/src/main/worktree-removal-close-records.test.ts b/src/main/worktree-removal-close-records.test.ts index cfad31f4d20b..7762fb79b9ff 100644 --- a/src/main/worktree-removal-close-records.test.ts +++ b/src/main/worktree-removal-close-records.test.ts @@ -20,7 +20,7 @@ import { let hasCreatedStoreInCase = false -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/worktree-removal-session-partition-fencing.test.ts b/src/main/worktree-removal-session-partition-fencing.test.ts index 8a5f1dad8a45..dd04d427f8e2 100644 --- a/src/main/worktree-removal-session-partition-fencing.test.ts +++ b/src/main/worktree-removal-session-partition-fencing.test.ts @@ -15,7 +15,7 @@ import { toRuntimeExecutionHostId } from '../shared/execution-host' let hasCreatedStoreInCase = false -vi.mock('./ssh/ssh-config-parser', () => ({ +vi.mock('./ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: vi.fn(), sshConfigHostsToTargets: vi.fn() })) diff --git a/src/main/wsl/wsl-command-loop.test.ts b/src/main/wsl/wsl-command-loop.test.ts index 8bcc120eebbb..c4972575d560 100644 --- a/src/main/wsl/wsl-command-loop.test.ts +++ b/src/main/wsl/wsl-command-loop.test.ts @@ -4,7 +4,7 @@ import { join } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' import { spawnProcess } from '@orca/process-host' import type { PipedChildProcess } from '@orca/process-host/process-spec' -import { execCommand } from '../ssh/remote-exec-command' +import { execCommand } from '../ssh/remote-exec/remote-exec-command' import { WSL_COMMAND_LOOP_ARGV0, WSL_COMMAND_LOOP_SCRIPT } from './wsl-command-loop' import { createWslCommandLoopPool, type WslCommandLoopPool } from './wsl-command-loop-pool' diff --git a/src/main/wsl/wsl-directory-upload.ts b/src/main/wsl/wsl-directory-upload.ts index c262551a0efe..f8829e9c46ad 100644 --- a/src/main/wsl/wsl-directory-upload.ts +++ b/src/main/wsl/wsl-directory-upload.ts @@ -11,10 +11,13 @@ import { Readable } from 'node:stream' import { parseWslUncPath, toLinuxPath } from '../../shared/wsl-paths' import type { RemoteInstallTransport } from '../managed-server/install/remote-install-transport' import { shellEscape } from '../ssh/ssh-connection-utils' -import { execCommand } from '../ssh/remote-exec-command' +import { execCommand } from '../ssh/remote-exec/remote-exec-command' import { RELAY_DEPLOY_TIMEOUT_MS } from '../managed-server/install/remote-deploy-timing' import { getRemoteHostPlatform } from '../ssh/ssh-remote-platform' -import { collectLocalUploadPlan, type LocalUploadPlan } from '../ssh/system-ssh-file-transfer' +import { + collectLocalUploadPlan, + type LocalUploadPlan +} from '../ssh/system-transport/system-ssh-file-transfer' import { buildUstarEntryHeader, USTAR_BLOCK_BYTES, ustarPaddingBytes } from '../ustar-entry-header' export const WSL_GUEST_SOURCE_UNAVAILABLE = 'ORCA_WSL_GUEST_SOURCE_UNAVAILABLE' diff --git a/src/main/wsl/wsl-guest-process-identity.ts b/src/main/wsl/wsl-guest-process-identity.ts index 728f2b407dc2..f4c9b8c18ac5 100644 --- a/src/main/wsl/wsl-guest-process-identity.ts +++ b/src/main/wsl/wsl-guest-process-identity.ts @@ -5,7 +5,7 @@ * a wall-clock start time would then mistake a live process for a new one, or the reverse. */ import type { OrcadHostTransport } from '../ssh/orcad-host-transport' -import { execCommand } from '../ssh/remote-exec-command' +import { execCommand } from '../ssh/remote-exec/remote-exec-command' export type WslGuestIdentity = { /** `:`; a distro restart (or a VM restart) changes it. */ diff --git a/src/main/wsl/wsl-host-ssh-orcad-conflict.ts b/src/main/wsl/wsl-host-ssh-orcad-conflict.ts index 6598f9d825f5..e8ac3e95269e 100644 --- a/src/main/wsl/wsl-host-ssh-orcad-conflict.ts +++ b/src/main/wsl/wsl-host-ssh-orcad-conflict.ts @@ -18,7 +18,7 @@ import { type KnownRuntimeEnvironment } from '../../shared/runtime-environments' import type { OrcadHostTransport } from '../ssh/orcad-host-transport' -import { execCommand } from '../ssh/remote-exec-command' +import { execCommand } from '../ssh/remote-exec/remote-exec-command' // Prints only the public half; the private key never leaves the distro. const READ_PUBLIC_KEY = `sed -n 's/.*"publicKeyB64"[[:space:]]*:[[:space:]]*"\\([A-Za-z0-9+/=]*\\)".*/\\1/p' "$HOME/.orca/${E2EE_KEYPAIR_FILENAME}" 2>/dev/null | head -n 1` diff --git a/src/main/wsl/wsl-orcad-deploy.test.ts b/src/main/wsl/wsl-orcad-deploy.test.ts index 45d330ee6344..a91741d61b0d 100644 --- a/src/main/wsl/wsl-orcad-deploy.test.ts +++ b/src/main/wsl/wsl-orcad-deploy.test.ts @@ -33,7 +33,7 @@ vi.mock('./wsl-orcad-instance-adoption', () => ({ adoptUnrecordedWslOrcad: mocks vi.mock('../../shared/app-environment', () => ({ getAppEnvironment: () => ({ getVersion: () => '1.5.0', getPath: () => '/user-data' }) })) -vi.mock('../ssh/remote-exec-command', () => ({ execCommand: mocks.exec })) +vi.mock('../ssh/remote-exec/remote-exec-command', () => ({ execCommand: mocks.exec })) vi.mock('../managed-server/install/orcad-remote-context', () => ({ resolveOrcadRemoteContext: mocks.resolveContext })) diff --git a/src/main/wsl/wsl-orcad-deploy.ts b/src/main/wsl/wsl-orcad-deploy.ts index 4e18115ec89c..f68200f0f1b4 100644 --- a/src/main/wsl/wsl-orcad-deploy.ts +++ b/src/main/wsl/wsl-orcad-deploy.ts @@ -28,7 +28,7 @@ import { resolveOrcadRemoteContext } from '../managed-server/install/orcad-remot import { deployOrcad } from '../ssh/orcad-remote-deploy' import { ORCAD_PID_FILENAME } from '../managed-server/install/orcad-remote-host-support' import { shellEscape } from '../ssh/ssh-connection-utils' -import { execCommand } from '../ssh/remote-exec-command' +import { execCommand } from '../ssh/remote-exec/remote-exec-command' import { joinRemotePath } from '../ssh/ssh-remote-platform' import { readLocalFullVersion } from '../managed-server/install/remote-versioned-install' import { createWslDistroHolder, type WslDistroHolder } from './wsl-distro-holder' diff --git a/src/main/wsl/wsl-orcad-host-transport-loops.test.ts b/src/main/wsl/wsl-orcad-host-transport-loops.test.ts index 8b2a2262e1f2..df91578ffe3e 100644 --- a/src/main/wsl/wsl-orcad-host-transport-loops.test.ts +++ b/src/main/wsl/wsl-orcad-host-transport-loops.test.ts @@ -2,7 +2,7 @@ import { Readable } from 'node:stream' import { afterEach, describe, expect, it } from 'vitest' import { spawnProcess } from '@orca/process-host' import type { PipedChildProcess, PipedProcessSpec } from '@orca/process-host/process-spec' -import { execCommand } from '../ssh/remote-exec-command' +import { execCommand } from '../ssh/remote-exec/remote-exec-command' import { createWslOrcadHostTransport, type WslOrcadHostTransport } from './wsl-orcad-host-transport' const posix = process.platform !== 'win32' diff --git a/src/main/wsl/wsl-orcad-host-transport.test.ts b/src/main/wsl/wsl-orcad-host-transport.test.ts index 2392667bbf60..a31be8deb1bc 100644 --- a/src/main/wsl/wsl-orcad-host-transport.test.ts +++ b/src/main/wsl/wsl-orcad-host-transport.test.ts @@ -3,7 +3,7 @@ import { EventEmitter } from 'node:events' import { PassThrough, Readable } from 'node:stream' import { describe, expect, it, vi } from 'vitest' import type { PipedChildProcess, PipedProcessSpec } from '@orca/process-host/process-spec' -import { execCommand } from '../ssh/remote-exec-command' +import { execCommand } from '../ssh/remote-exec/remote-exec-command' import { isWslOrcadHostTarget } from '../ssh/orcad-host-transport' import { createWslOrcadHostTransport } from './wsl-orcad-host-transport' diff --git a/src/main/wsl/wsl-orcad-real-distro-lane.test.ts b/src/main/wsl/wsl-orcad-real-distro-lane.test.ts index d5f7afe501bb..a2028e911bfb 100644 --- a/src/main/wsl/wsl-orcad-real-distro-lane.test.ts +++ b/src/main/wsl/wsl-orcad-real-distro-lane.test.ts @@ -30,7 +30,7 @@ import { ORCAD_TEMPLATE_MANIFEST_FILENAME } from '../../shared/orcad-artifacts' import { requestOrcadTerminalCensus } from '../ssh/orcad-terminal-census-client' -import { execCommand } from '../ssh/remote-exec-command' +import { execCommand } from '../ssh/remote-exec/remote-exec-command' import { readConfirmedRunningWslDistros } from '../wsl-background-distro-gate' import { readWindowsProcessTableFresh } from '../windows/windows-process-table' import { resolveWslInteropSpawnCwd } from '../wsl-interop-spawn-directory' diff --git a/src/wsl-guest/protocol-json-payload.test.ts b/src/wsl-guest/protocol-json-payload.test.ts index c634b94e0fde..a8c09e667a55 100644 --- a/src/wsl-guest/protocol-json-payload.test.ts +++ b/src/wsl-guest/protocol-json-payload.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import * as mainProtocol from '../main/ssh/remote-frame-protocol' +import * as mainProtocol from '../main/ssh/remote-exec/remote-frame-protocol' import { HEADER_LENGTH, MAX_MESSAGE_SIZE, diff --git a/src/wsl-guest/protocol.ts b/src/wsl-guest/protocol.ts index b65723f45b8c..72f0606ebd90 100644 --- a/src/wsl-guest/protocol.ts +++ b/src/wsl-guest/protocol.ts @@ -1,4 +1,4 @@ -// Self-contained relay protocol — mirrors src/main/ssh/remote-frame-protocol.ts +// Self-contained relay protocol — mirrors src/main/ssh/remote-exec/remote-frame-protocol.ts // but has no Electron dependencies. Deployed standalone to remote hosts. import { diff --git a/tests/e2e/cross-version-wire/released-relay-transport.ts b/tests/e2e/cross-version-wire/released-relay-transport.ts index fff3c01f32cb..805d807f8f32 100644 --- a/tests/e2e/cross-version-wire/released-relay-transport.ts +++ b/tests/e2e/cross-version-wire/released-relay-transport.ts @@ -8,7 +8,7 @@ import { SshChannelMultiplexer, type MultiplexerTransport } from '../../../src/main/ssh/ssh-channel-multiplexer' -import { RELAY_SENTINEL } from '../../../src/main/ssh/remote-frame-protocol' +import { RELAY_SENTINEL } from '../../../src/main/ssh/remote-exec/remote-frame-protocol' const SENTINEL = Buffer.from(RELAY_SENTINEL, 'utf-8') const OWNER_HELD_DISCONNECTED = -32045 diff --git a/tests/e2e/host-agent-launch-settings-hook-bookkeeping.unit.test.ts b/tests/e2e/host-agent-launch-settings-hook-bookkeeping.unit.test.ts index 590d9936c469..fc0a40407f1d 100644 --- a/tests/e2e/host-agent-launch-settings-hook-bookkeeping.unit.test.ts +++ b/tests/e2e/host-agent-launch-settings-hook-bookkeeping.unit.test.ts @@ -17,7 +17,7 @@ vi.mock('../../src/main/telemetry/client', () => ({ track: vi.fn() })) vi.mock('../../src/main/telemetry/cohort-classifier', () => ({ getCohortAtEmit: () => ({ nth_repo_added: 2 }) })) -vi.mock('../../src/main/ssh/ssh-config-parser', () => ({ +vi.mock('../../src/main/ssh/config/ssh-config-parser', () => ({ loadUserSshConfig: () => ({ hosts: [] }), sshConfigHostsToTargets: () => [] }))