diff --git a/.github/workflows/ssh-hostile-hosts.yml b/.github/workflows/ssh-hostile-hosts.yml index 052ce65f9e3..b504deb8c18 100644 --- a/.github/workflows/ssh-hostile-hosts.yml +++ b/.github/workflows/ssh-hostile-hosts.yml @@ -9,14 +9,13 @@ on: pull_request: types: [opened, synchronize, reopened, ready_for_review, converted_to_draft] paths: - # The managed deploy still runs on these relay-named install and runtime primitives. - - 'src/main/ssh/ssh-relay-*' + # The managed deploy runs on these remote install and runtime primitives. + - 'src/main/ssh/remote-*' - 'src/main/ssh/*runtime*' - 'src/main/ssh/orcad-*' - 'src/main/orcad/orcad-artifact-materializer.ts' - 'src/main/orcad/orcad-host-unavailable.ts' - 'src/main/node-runtime/**' - - 'src/main/ssh/remote-install-*' - 'src/main/ssh/ssh-remote-*' - 'src/main/ssh/ssh-hostile-host-*' - 'src/main/ssh/sftp-*' diff --git a/.github/workflows/ssh-windows-hosts.yml b/.github/workflows/ssh-windows-hosts.yml index 1caf370d4a2..ea3b7750662 100644 --- a/.github/workflows/ssh-windows-hosts.yml +++ b/.github/workflows/ssh-windows-hosts.yml @@ -8,13 +8,12 @@ on: pull_request: types: [opened, synchronize, reopened, ready_for_review, converted_to_draft] paths: - - 'src/main/ssh/ssh-relay-*' + - 'src/main/ssh/remote-*' - 'src/main/ssh/*runtime*' - 'src/main/ssh/orcad-*' - 'src/main/orcad/orcad-artifact-materializer.ts' - 'src/main/orcad/orcad-host-unavailable.ts' - 'src/main/node-runtime/**' - - 'src/main/ssh/remote-install-*' - 'src/main/ssh/ssh-remote-*' - 'src/main/ssh/ssh-hostile-host-*' - 'src/main/ssh/ssh-windows-host-*' diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index 51878065b1b..fa0e016c314 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -5581,10 +5581,10 @@ "src/main/sqlite/sync-database.test.ts": 877, "src/main/ssh-expired-lease-pane-readoption.test.ts": 1555, "src/main/ssh-reattach-pane-cardinality.test.ts": 1274, - "src/main/ssh/legacy-relay-bridge/legacy-relay-bridge-teardown.test.ts": 326, - "src/main/ssh/legacy-relay-bridge/legacy-relay-client.test.ts": 196, - "src/main/ssh/legacy-relay-bridge/legacy-relay-endpoints.test.ts": 173, - "src/main/ssh/legacy-relay-bridge/legacy-relay-target-bridge.test.ts": 74, + "src/main/ssh/legacy-relay/legacy-relay-bridge-teardown.test.ts": 326, + "src/main/ssh/legacy-relay/legacy-relay-client.test.ts": 196, + "src/main/ssh/legacy-relay/legacy-relay-endpoints.test.ts": 173, + "src/main/ssh/legacy-relay/legacy-relay-target-bridge.test.ts": 74, "src/main/ssh/managed-server-fence-recheck.test.ts": 484, "src/main/ssh/orcad-activation-crash-recovery.test.ts": 1032, "src/main/ssh/orcad-activation-fence-generation.test.ts": 826, @@ -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/relay-protocol.test.ts": 113, + "src/main/ssh/remote-frame-protocol.test.ts": 113, "src/main/ssh/remote-install-gc-termination.test.ts": 187, "src/main/ssh/remote-install-model.test.ts": 184, "src/main/ssh/remote-node-runtime-store-gc.test.ts": 1625, @@ -5746,11 +5746,11 @@ "src/main/ssh/ssh-host-key-store.test.ts": 207, "src/main/ssh/ssh-host-key-verifier.test.ts": 77, "src/main/ssh/ssh-host-platform-memo.test.ts": 51, - "src/main/ssh/ssh-host-relay-census-for-target.test.ts": 43, - "src/main/ssh/ssh-host-relay-endpoint-census.test.ts": 133, - "src/main/ssh/ssh-host-relay-terminals-on-connect.test.ts": 272, - "src/main/ssh/ssh-host-relay-windows-census.test.ts": 247, - "src/main/ssh/ssh-host-relay-windows-inventory.test.ts": 201, + "src/main/ssh/legacy-relay/ssh-host-relay-census-for-target.test.ts": 43, + "src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.test.ts": 133, + "src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.test.ts": 272, + "src/main/ssh/legacy-relay/ssh-host-relay-windows-census.test.ts": 247, + "src/main/ssh/legacy-relay/ssh-host-relay-windows-inventory.test.ts": 201, "src/main/ssh/ssh-host-server-on-connect-stopped-elsewhere.test.ts": 865, "src/main/ssh/ssh-host-server-on-connect-telemetry.test.ts": 597, "src/main/ssh/ssh-host-server-on-connect.test.ts": 553, @@ -5773,25 +5773,25 @@ "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/ssh-relay-answered-failure-producers.test.ts": 321, - "src/main/ssh/ssh-relay-endpoint-incumbent-shell.integration.test.ts": 1326, - "src/main/ssh/ssh-relay-endpoint-incumbent.test.ts": 100, - "src/main/ssh/ssh-relay-endpoint-pty-count.test.ts": 90, - "src/main/ssh/ssh-relay-endpoint-runtime.test.ts": 69, - "src/main/ssh/ssh-relay-exec-closed-stdin.test.ts": 89, - "src/main/ssh/ssh-relay-exec-command.test.ts": 130, - "src/main/ssh/ssh-relay-exec-input.test.ts": 92, - "src/main/ssh/ssh-relay-gc-claim-termination.test.ts": 249, - "src/main/ssh/ssh-relay-host-answered-failure.test.ts": 101, - "src/main/ssh/ssh-relay-incumbent-process.test.ts": 5329, - "src/main/ssh/ssh-relay-install-lock-exited-owner.test.ts": 380, - "src/main/ssh/ssh-relay-install-lock-termination.test.ts": 276, - "src/main/ssh/ssh-relay-install-lock.test.ts": 157, - "src/main/ssh/ssh-relay-install-noisy-sftp-wire.test.ts": 299, - "src/main/ssh/ssh-relay-install-transfers-exec-fallback.test.ts": 101, - "src/main/ssh/ssh-relay-sentinel-copy-budget.test.ts": 114, - "src/main/ssh/ssh-relay-sentinel.test.ts": 400, - "src/main/ssh/ssh-relay-versioned-install-termination.test.ts": 236, + "src/main/ssh/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-install-gc-claim-termination.test.ts": 249, + "src/main/ssh/remote-host-answered-failure.test.ts": 101, + "src/main/ssh/legacy-relay/ssh-relay-incumbent-process.test.ts": 5329, + "src/main/ssh/remote-install-lock-exited-owner.test.ts": 380, + "src/main/ssh/remote-install-lock-termination.test.ts": 276, + "src/main/ssh/remote-install-lock.test.ts": 157, + "src/main/ssh/remote-install-noisy-sftp-wire.test.ts": 299, + "src/main/ssh/remote-install-transfers-exec-fallback.test.ts": 101, + "src/main/ssh/legacy-relay/ssh-relay-sentinel-copy-budget.test.ts": 114, + "src/main/ssh/legacy-relay/ssh-relay-sentinel.test.ts": 400, + "src/main/ssh/remote-versioned-install-termination.test.ts": 236, "src/main/ssh/ssh-remote-commands.test.ts": 8588, "src/main/ssh/ssh-remote-node-resolution.test.ts": 317, "src/main/ssh/ssh-remote-node-toolchain-probe.test.ts": 133, diff --git a/config/scripts/pr-code-change-scope.mjs b/config/scripts/pr-code-change-scope.mjs index f7d7c338251..2f772be3cae 100644 --- a/config/scripts/pr-code-change-scope.mjs +++ b/config/scripts/pr-code-change-scope.mjs @@ -186,7 +186,7 @@ function changesMobileWebApp(changedFiles) { const CROSS_VERSION_WIRE_PREFIXES = [ 'tests/e2e/cross-version-wire/', // COMPAT(legacy-relay-bridge): the bridge is proven against a real 1.4.224 relay here. - 'src/main/ssh/legacy-relay-bridge/', + 'src/main/ssh/legacy-relay/', 'config/scripts/stable-release-tags', // The R1 daemon protocol crossing gate runs in this job. 'config/scripts/daemon-protocol-facts', diff --git a/config/scripts/pr-e2e-source-routing.mjs b/config/scripts/pr-e2e-source-routing.mjs index 30cf5fe7866..17f02649a84 100644 --- a/config/scripts/pr-e2e-source-routing.mjs +++ b/config/scripts/pr-e2e-source-routing.mjs @@ -132,7 +132,7 @@ export const PR_E2E_SOURCE_ROUTES = [ file )) }, - // COMPAT(legacy-relay-bridge): revisit 2027-01-15 with src/main/ssh/legacy-relay-bridge/. + // COMPAT(legacy-relay-bridge): revisit 2027-01-15 with src/main/ssh/legacy-relay/. { id: 'ssh.orcad-legacy-relay-bridge', specs: ['tests/e2e/ssh-orcad-legacy-relay-bridge.spec.ts'], @@ -142,7 +142,7 @@ export const PR_E2E_SOURCE_ROUTES = [ file ) || (isProductSource(file) && - /(?:legacy-relay-bridge|orcad-migration-terminal-gate|ssh-host-relay-terminals-on-connect)/.test( + /(?:legacy-relay(?:-bridge|\/)|orcad-migration-terminal-gate|ssh-host-relay-terminals-on-connect)/.test( file )) }, diff --git a/config/scripts/vitest-node-runtime-files.mjs b/config/scripts/vitest-node-runtime-files.mjs index 77314a0658c..39c9245df40 100644 --- a/config/scripts/vitest-node-runtime-files.mjs +++ b/config/scripts/vitest-node-runtime-files.mjs @@ -5,7 +5,7 @@ export const NODE_RUNTIME_INCLUDE = [ 'config/scripts/vitest-sqlite-runtime-boundary.test.ts', 'config/scripts/cloud-security-history-workflow.test.mjs', 'config/scripts/skill-recipe-shell.test.mjs', - 'src/main/ssh/ssh-relay-endpoint-incumbent-shell.integration.test.ts', + 'src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent-shell.integration.test.ts', 'src/main/ssh/ssh-remote-commands.test.ts', 'src/packages/process-host/src/run-process.test.ts', 'tests/e2e/cursor-quota-transport.unit.test.ts', diff --git a/config/scripts/vitest-sqlite-runtime-files.mjs b/config/scripts/vitest-sqlite-runtime-files.mjs index 588ac80eadc..fdb3f6de94d 100644 --- a/config/scripts/vitest-sqlite-runtime-files.mjs +++ b/config/scripts/vitest-sqlite-runtime-files.mjs @@ -285,9 +285,9 @@ export const SQLITE_RUNTIME_INCLUDE = [ 'src/main/runtime/structured-foreground-command-strip.test.ts', 'src/main/ssh-expired-lease-pane-readoption.test.ts', 'src/main/ssh-reattach-pane-cardinality.test.ts', - 'src/main/ssh/legacy-relay-bridge/legacy-relay-cli-call-limits.test.ts', - 'src/main/ssh/legacy-relay-bridge/legacy-relay-cli-legacy-records.test.ts', - 'src/main/ssh/legacy-relay-bridge/legacy-relay-cli-server.test.ts', + 'src/main/ssh/legacy-relay/legacy-relay-cli-call-limits.test.ts', + 'src/main/ssh/legacy-relay/legacy-relay-cli-legacy-records.test.ts', + 'src/main/ssh/legacy-relay/legacy-relay-cli-server.test.ts', 'src/main/ssh/orcad-migration-cutover-coordinator.test.ts', 'src/main/ssh/orcad-migration-delta-move.test.ts', 'src/main/ssh/orcad-migration-delta-snapshot.test.ts', 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 d23d59288b4..613352b29e7 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/relay-protocol' +import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from '../ssh/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 41e6ebe9683..47b50eaacfd 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/relay-protocol' +import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from '../ssh/remote-frame-protocol' import type { MultiplexerTransport } from '../ssh/ssh-channel-multiplexer' export const MAX_STARTUP_BUFFER_BYTES = 64 * 1024 diff --git a/src/main/ipc/orcad-delta-move-handlers.ts b/src/main/ipc/orcad-delta-move-handlers.ts index fa9abfb85db..123e5134cc3 100644 --- a/src/main/ipc/orcad-delta-move-handlers.ts +++ b/src/main/ipc/orcad-delta-move-handlers.ts @@ -9,7 +9,7 @@ import { requireManagedOrcadInfrastructure } from '../ssh/orcad-managed-runtime- import { ensureOrcadManagedTunnel } from '../ssh/orcad-managed-tunnel' import { keepOrcadServerVersion, runOrcadDeltaMove } from '../ssh/orcad-migration-delta-move' import { planOrcadDeltaMove } from '../ssh/orcad-migration-delta-plan' -import { censusHostRelayTerminalsFor } from '../ssh/ssh-host-relay-census-for-target' +import { censusHostRelayTerminalsFor } from '../ssh/legacy-relay/ssh-host-relay-census-for-target' import { orcadMigrationDestinationFor } from '../ssh/orcad-runtime-conversion-wiring' import { requiredString } from './orcad-runtime-lifecycle-handlers' import { publishResolvedChangedHostStatus } from './runtime-environment-managed-tunnel' diff --git a/src/main/ipc/pty/runtime/kill-legacy-relay-bridged.test.ts b/src/main/ipc/pty/runtime/kill-legacy-relay-bridged.test.ts index aae166cacc4..d12b65e5395 100644 --- a/src/main/ipc/pty/runtime/kill-legacy-relay-bridged.test.ts +++ b/src/main/ipc/pty/runtime/kill-legacy-relay-bridged.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from 'vitest' import { toAppSshPtyId } from '../../../../shared/ssh-pty-id' import type { SshRemotePtyLease } from '../../../../shared/ssh-types' -import { installLegacyRelayBridge } from '../../../ssh/legacy-relay-bridge/legacy-relay-bridge-registry' +import { installLegacyRelayBridge } from '../../../ssh/legacy-relay/legacy-relay-bridge-registry' import type { PtyRuntimeControllerDeps } from './controller-deps' import { killPtyFromRuntimeController } from './kill' diff --git a/src/main/ipc/pty/runtime/kill.ts b/src/main/ipc/pty/runtime/kill.ts index 2f66f4a4aea..5c281e35fcf 100644 --- a/src/main/ipc/pty/runtime/kill.ts +++ b/src/main/ipc/pty/runtime/kill.ts @@ -12,7 +12,7 @@ import { errorMessage } from '../../../../shared/error-message' import { closeLegacyRelayPane, isLegacyRelayBridgedPty -} from '../../../ssh/legacy-relay-bridge/legacy-relay-bridge-registry' +} from '../../../ssh/legacy-relay/legacy-relay-bridge-registry' // Bounds the wait for an observed exit to reach the runtime record when the caller set no deadline. const OBSERVED_EXIT_RECORD_WAIT_MS = 10_000 diff --git a/src/main/ipc/ssh-connect-decision-cancellation.test.ts b/src/main/ipc/ssh-connect-decision-cancellation.test.ts index 8a07874807e..7f8d2a791a1 100644 --- a/src/main/ipc/ssh-connect-decision-cancellation.test.ts +++ b/src/main/ipc/ssh-connect-decision-cancellation.test.ts @@ -13,14 +13,11 @@ vi.mock('../ssh/ssh-connection-manager', () => mocks.sshConnectionManager) vi.mock('../ssh/ssh-channel-multiplexer', () => mocks.sshChannelMultiplexer) vi.mock('../ssh/ssh-port-forward', () => mocks.sshPortForward) vi.mock('../ssh/ssh-port-scanner', () => mocks.sshPortScanner) -vi.mock( - import('../ssh/legacy-relay-bridge/legacy-relay-bridge-registry'), - async (importOriginal) => ({ - ...(await importOriginal()), - startLegacyRelayBridge: vi.fn(async () => {}), - stopLegacyRelayBridge: vi.fn() - }) -) +vi.mock(import('../ssh/legacy-relay/legacy-relay-bridge-registry'), async (importOriginal) => ({ + ...(await importOriginal()), + startLegacyRelayBridge: vi.fn(async () => {}), + stopLegacyRelayBridge: vi.fn() +})) import type { SshTarget } from '../../shared/ssh-types' import type { SshConnection } from '../ssh/ssh-connection' @@ -35,7 +32,7 @@ import { import { startLegacyRelayBridge, stopLegacyRelayBridge -} from '../ssh/legacy-relay-bridge/legacy-relay-bridge-registry' +} from '../ssh/legacy-relay/legacy-relay-bridge-registry' import { createSshIpcHarness } from './ssh-ipc-test-harness' const { mockSshStore, mockConnectionManager } = mocks diff --git a/src/main/ipc/ssh-connect-flow.ts b/src/main/ipc/ssh-connect-flow.ts index fec364318d6..289f9ae478b 100644 --- a/src/main/ipc/ssh-connect-flow.ts +++ b/src/main/ipc/ssh-connect-flow.ts @@ -24,7 +24,7 @@ import { import { connectionManager } from './ssh-ipc-context' import { abandonDecisionTransport } from './ssh-session-teardown' import { awaitTargetLifecycle } from './ssh-target-lifecycle-queue' -import { startLegacyRelayBridge } from '../ssh/legacy-relay-bridge/legacy-relay-bridge-registry' +import { startLegacyRelayBridge } from '../ssh/legacy-relay/legacy-relay-bridge-registry' import { clearSshCredentialDeclined } from '../ssh/ssh-credential-decline' import { createSshUserDisconnectedError, isSshUserDisconnected } from '../ssh/ssh-user-disconnect' import { diff --git a/src/main/ipc/ssh-host-server-on-connect-wiring.ts b/src/main/ipc/ssh-host-server-on-connect-wiring.ts index 9cd80484d3f..65835a7150b 100644 --- a/src/main/ipc/ssh-host-server-on-connect-wiring.ts +++ b/src/main/ipc/ssh-host-server-on-connect-wiring.ts @@ -23,9 +23,9 @@ import type { HostServerOnConnectDeps } from '../ssh/ssh-host-server-on-connect' import { censusSshHostRelaysBeforeSession, relayTerminalsOnConnect -} from '../ssh/ssh-host-relay-terminals-on-connect' +} from '../ssh/legacy-relay/ssh-host-relay-terminals-on-connect' import { requireManagedOrcadInfrastructure } from '../ssh/orcad-managed-runtime-context' -import { censusHostRelayTerminalsFor } from '../ssh/ssh-host-relay-census-for-target' +import { censusHostRelayTerminalsFor } from '../ssh/legacy-relay/ssh-host-relay-census-for-target' import { setSshHostServerStatus } from '../ssh/ssh-host-server-status' import { trackSshHostServerEvent } from '../ssh/ssh-host-server-telemetry' import { knownSshHostPlatform } from '../ssh/ssh-host-platform-memo' @@ -35,7 +35,7 @@ import { releaseUnreachableOrcadSetup } from '../ssh/orcad-unreachable-setup-rel import { getCurrentMainWindow } from './ssh-ipc-context' import { broadcastSshState } from './ssh-renderer-broadcast' import { connectInFlight } from './ssh-connect-attempt-registry' -import { startLegacyRelayBridge } from '../ssh/legacy-relay-bridge/legacy-relay-bridge-registry' +import { startLegacyRelayBridge } from '../ssh/legacy-relay/legacy-relay-bridge-registry' export function hostServerOnConnectDeps(userDataPath: string): HostServerOnConnectDeps { const registry = getSshTargetRegistryStore()! diff --git a/src/main/ipc/ssh-session-teardown.ts b/src/main/ipc/ssh-session-teardown.ts index 8931b38c164..26b8e67cffa 100644 --- a/src/main/ipc/ssh-session-teardown.ts +++ b/src/main/ipc/ssh-session-teardown.ts @@ -13,7 +13,7 @@ import { errorMessage } from '../../shared/error-message' import { forgetLegacyRelayTarget, stopLegacyRelayBridge -} from '../ssh/legacy-relay-bridge/legacy-relay-bridge-registry' +} from '../ssh/legacy-relay/legacy-relay-bridge-registry' export async function disconnectRegisteredSshTarget(targetId: string): Promise { invalidateConnectAttempt(targetId) diff --git a/src/main/ipc/ssh.ts b/src/main/ipc/ssh.ts index ff80652a03d..6c6e4eeeb0d 100644 --- a/src/main/ipc/ssh.ts +++ b/src/main/ipc/ssh.ts @@ -56,7 +56,7 @@ import { disposeOrcadManagedTunnels } from '../ssh/orcad-managed-tunnel' import { reconcileManagedOrcadSshTargets } from '../ssh/orcad-retained-source' import { installOrcadMigrationScrollbackRetention } from '../ssh/orcad-migration-scrollback-retention-wiring' import { getAppEnvironment } from '../../shared/app-environment' -import { registerLegacyRelayBridgeIpc } from '../ssh/legacy-relay-bridge/legacy-relay-bridge-ipc' +import { registerLegacyRelayBridgeIpc } from '../ssh/legacy-relay/legacy-relay-bridge-ipc' import { disposeDesktopBrowserBridge, installDesktopBrowserBridge 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 e5e338ba61c..213667c0fe1 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/ssh-relay-exec-command' +import type * as ExecCommandModule from '../ssh/remote-exec-command' import { build } from 'esbuild' import { copyFileSync, @@ -46,7 +46,7 @@ import { gcOldOrcadVersions } from '../ssh/orcad-remote-gc' import { ORCAD_PID_FILENAME, ORCAD_READINESS_FILENAME } from '../ssh/orcad-remote-host-support' import { orcadLaunchCommand, parseOrcadReadinessOutput } from '../ssh/orcad-remote-launch' import { parseOrcadStopOutcome, stopOrcadCommand } from '../ssh/orcad-remote-process-control' -import { RELAY_REMOTE_DIR } from '../ssh/relay-protocol' +import { RELAY_REMOTE_DIR } from '../ssh/remote-frame-protocol' import { getRemoteHostPlatform } from '../ssh/ssh-remote-platform' import { skipForMissingInputs, @@ -56,7 +56,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/ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('../ssh/remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: execMock })) diff --git a/src/main/ssh/legacy-relay-bridge/README.md b/src/main/ssh/legacy-relay/README.md similarity index 100% rename from src/main/ssh/legacy-relay-bridge/README.md rename to src/main/ssh/legacy-relay/README.md diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-bridge-ipc.ts b/src/main/ssh/legacy-relay/legacy-relay-bridge-ipc.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-bridge-ipc.ts rename to src/main/ssh/legacy-relay/legacy-relay-bridge-ipc.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-bridge-leases.ts b/src/main/ssh/legacy-relay/legacy-relay-bridge-leases.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-bridge-leases.ts rename to src/main/ssh/legacy-relay/legacy-relay-bridge-leases.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-bridge-registry.ts b/src/main/ssh/legacy-relay/legacy-relay-bridge-registry.ts similarity index 98% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-bridge-registry.ts rename to src/main/ssh/legacy-relay/legacy-relay-bridge-registry.ts index 7245a8c7fa5..67a213f886c 100644 --- a/src/main/ssh/legacy-relay-bridge/legacy-relay-bridge-registry.ts +++ b/src/main/ssh/legacy-relay/legacy-relay-bridge-registry.ts @@ -11,8 +11,8 @@ import type { import { parseAppSshPtyId } from '../../../shared/ssh-pty-id' import type { SshRemotePtyLease } from '../../../shared/ssh-types' import type { SshConnection } from '../ssh-connection' -import { waitForSentinel } from '../ssh-relay-sentinel' -import { probeRelayEndpointIncumbent } from '../ssh-relay-endpoint-incumbent' +import { waitForSentinel } from './ssh-relay-sentinel' +import { probeRelayEndpointIncumbent } from './ssh-relay-endpoint-incumbent' import { isWindowsRemoteHost } from '../ssh-remote-platform' import type { OrcaRuntimeService } from '../../runtime/orca-runtime' import { LegacyRelayClient } from './legacy-relay-client' diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-bridge-teardown.test.ts b/src/main/ssh/legacy-relay/legacy-relay-bridge-teardown.test.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-bridge-teardown.test.ts rename to src/main/ssh/legacy-relay/legacy-relay-bridge-teardown.test.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-bridge-timers.ts b/src/main/ssh/legacy-relay/legacy-relay-bridge-timers.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-bridge-timers.ts rename to src/main/ssh/legacy-relay/legacy-relay-bridge-timers.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-cli-args.ts b/src/main/ssh/legacy-relay/legacy-relay-cli-args.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-cli-args.ts rename to src/main/ssh/legacy-relay/legacy-relay-cli-args.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-cli-call-limits.test.ts b/src/main/ssh/legacy-relay/legacy-relay-cli-call-limits.test.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-cli-call-limits.test.ts rename to src/main/ssh/legacy-relay/legacy-relay-cli-call-limits.test.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-cli-call-limits.ts b/src/main/ssh/legacy-relay/legacy-relay-cli-call-limits.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-cli-call-limits.ts rename to src/main/ssh/legacy-relay/legacy-relay-cli-call-limits.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-cli-caller.ts b/src/main/ssh/legacy-relay/legacy-relay-cli-caller.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-cli-caller.ts rename to src/main/ssh/legacy-relay/legacy-relay-cli-caller.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-cli-legacy-records.test.ts b/src/main/ssh/legacy-relay/legacy-relay-cli-legacy-records.test.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-cli-legacy-records.test.ts rename to src/main/ssh/legacy-relay/legacy-relay-cli-legacy-records.test.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-cli-output.ts b/src/main/ssh/legacy-relay/legacy-relay-cli-output.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-cli-output.ts rename to src/main/ssh/legacy-relay/legacy-relay-cli-output.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-cli-server.test.ts b/src/main/ssh/legacy-relay/legacy-relay-cli-server.test.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-cli-server.test.ts rename to src/main/ssh/legacy-relay/legacy-relay-cli-server.test.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-cli-server.ts b/src/main/ssh/legacy-relay/legacy-relay-cli-server.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-cli-server.ts rename to src/main/ssh/legacy-relay/legacy-relay-cli-server.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-client.test.ts b/src/main/ssh/legacy-relay/legacy-relay-client.test.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-client.test.ts rename to src/main/ssh/legacy-relay/legacy-relay-client.test.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-client.ts b/src/main/ssh/legacy-relay/legacy-relay-client.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-client.ts rename to src/main/ssh/legacy-relay/legacy-relay-client.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-daily-activity.test.ts b/src/main/ssh/legacy-relay/legacy-relay-daily-activity.test.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-daily-activity.test.ts rename to src/main/ssh/legacy-relay/legacy-relay-daily-activity.test.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-daily-activity.ts b/src/main/ssh/legacy-relay/legacy-relay-daily-activity.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-daily-activity.ts rename to src/main/ssh/legacy-relay/legacy-relay-daily-activity.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-endpoints.test.ts b/src/main/ssh/legacy-relay/legacy-relay-endpoints.test.ts similarity index 90% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-endpoints.test.ts rename to src/main/ssh/legacy-relay/legacy-relay-endpoints.test.ts index e039dfc38dc..cde6602e4a5 100644 --- a/src/main/ssh/legacy-relay-bridge/legacy-relay-endpoints.test.ts +++ b/src/main/ssh/legacy-relay/legacy-relay-endpoints.test.ts @@ -1,26 +1,26 @@ -import type * as ExecCommandModule from '../ssh-relay-exec-command' +import type * as ExecCommandModule from '../remote-exec-command' import { describe, expect, it, vi } from 'vitest' import type { SshConnection } from '../ssh-connection' -import { relaySocketNameForInstanceId } from '../ssh-relay-instance-id' -import { windowsRelayPipePathsForSocketName } from '../ssh-relay-endpoints' +import { relaySocketNameForInstanceId } from './ssh-relay-instance-id' +import { windowsRelayPipePathsForSocketName } from './ssh-relay-endpoints' import { getRemoteHostPlatform, joinRemotePath } from '../ssh-remote-platform' const { execCommand } = vi.hoisted(() => ({ execCommand: vi.fn() })) -vi.mock('../ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('../remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand })) vi.mock('../ssh-remote-platform-detection', () => ({ detectRemoteHostPlatform: async () => getRemoteHostPlatform('win32-x64') })) -vi.mock('../ssh-host-relay-windows-census', () => ({ +vi.mock('./ssh-host-relay-windows-census', () => ({ windowsCensusNodePath: async () => 'C:\\node\\node.exe' })) -vi.mock('../ssh-host-relay-windows-inventory', async (importOriginal) => ({ +vi.mock('./ssh-host-relay-windows-inventory', async (importOriginal) => ({ ...(await importOriginal>()), windowsRelayInventoryCommand: () => 'INVENTORY' })) -vi.mock('../ssh-relay-windows-launch-command', () => ({ +vi.mock('./ssh-relay-windows-launch-command', () => ({ windowsRelayConnectCommand: (_h: unknown, _n: string, _d: string, pipe: string) => `BRIDGE ${pipe}` })) diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-endpoints.ts b/src/main/ssh/legacy-relay/legacy-relay-endpoints.ts similarity index 93% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-endpoints.ts rename to src/main/ssh/legacy-relay/legacy-relay-endpoints.ts index 97d2681677e..0b4cca1e707 100644 --- a/src/main/ssh/legacy-relay-bridge/legacy-relay-endpoints.ts +++ b/src/main/ssh/legacy-relay/legacy-relay-endpoints.ts @@ -7,11 +7,11 @@ */ import type { SshConnection } from '../ssh-connection' import { shellEscape } from '../ssh-connection-utils' -import { RELAY_REMOTE_DIR } from '../relay-protocol' +import { RELAY_REMOTE_DIR } from '../remote-frame-protocol' import { SHORT_RELAY_SOCKET_DIR_PREFIX } from '../relay-socket-path-limit' -import { execCommand } from '../ssh-relay-exec-command' -import { readRelayDaemonRuntimes } from '../ssh-relay-endpoint-runtime' -import { relaySocketNameForInstanceId } from '../ssh-relay-instance-id' +import { execCommand } from '../remote-exec-command' +import { readRelayDaemonRuntimes } from './ssh-relay-endpoint-runtime' +import { relaySocketNameForInstanceId } from './ssh-relay-instance-id' import { readRemoteHomeCommand } from '../ssh-remote-commands' import { resolveRemoteNodePath } from '../ssh-remote-node-resolution' import { detectRemoteHostPlatform } from '../ssh-remote-platform-detection' @@ -24,9 +24,9 @@ import { import { parseWindowsRelayInventory, windowsRelayInventoryCommand -} from '../ssh-host-relay-windows-inventory' -import { windowsCensusNodePath } from '../ssh-host-relay-windows-census' -import { windowsRelayConnectCommand } from '../ssh-relay-windows-launch-command' +} from './ssh-host-relay-windows-inventory' +import { windowsCensusNodePath } from './ssh-host-relay-windows-census' +import { windowsRelayConnectCommand } from './ssh-relay-windows-launch-command' const MAX_ENDPOINTS = 32 diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-hidden-output.test.ts b/src/main/ssh/legacy-relay/legacy-relay-hidden-output.test.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-hidden-output.test.ts rename to src/main/ssh/legacy-relay/legacy-relay-hidden-output.test.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-hidden-output.ts b/src/main/ssh/legacy-relay/legacy-relay-hidden-output.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-hidden-output.ts rename to src/main/ssh/legacy-relay/legacy-relay-hidden-output.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-output-salvage.ts b/src/main/ssh/legacy-relay/legacy-relay-output-salvage.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-output-salvage.ts rename to src/main/ssh/legacy-relay/legacy-relay-output-salvage.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-pane-stops.ts b/src/main/ssh/legacy-relay/legacy-relay-pane-stops.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-pane-stops.ts rename to src/main/ssh/legacy-relay/legacy-relay-pane-stops.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-target-bridge.test.ts b/src/main/ssh/legacy-relay/legacy-relay-target-bridge.test.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-target-bridge.test.ts rename to src/main/ssh/legacy-relay/legacy-relay-target-bridge.test.ts diff --git a/src/main/ssh/legacy-relay-bridge/legacy-relay-target-bridge.ts b/src/main/ssh/legacy-relay/legacy-relay-target-bridge.ts similarity index 100% rename from src/main/ssh/legacy-relay-bridge/legacy-relay-target-bridge.ts rename to src/main/ssh/legacy-relay/legacy-relay-target-bridge.ts diff --git a/src/main/ssh/ssh-host-relay-census-for-target.test.ts b/src/main/ssh/legacy-relay/ssh-host-relay-census-for-target.test.ts similarity index 93% rename from src/main/ssh/ssh-host-relay-census-for-target.test.ts rename to src/main/ssh/legacy-relay/ssh-host-relay-census-for-target.test.ts index f60e8ac4943..1a2af733778 100644 --- a/src/main/ssh/ssh-host-relay-census-for-target.test.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-census-for-target.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { SshConnection } from './ssh-connection' -import type { SshTarget } from '../../shared/ssh-types' +import type { SshConnection } from '../ssh-connection' +import type { SshTarget } from '../../../shared/ssh-types' const mocks = vi.hoisted(() => ({ connect: vi.fn(), @@ -8,7 +8,7 @@ const mocks = vi.hoisted(() => ({ disconnectConnection: vi.fn(async () => undefined), census: vi.fn() })) -vi.mock('./orcad-managed-runtime-context', () => ({ +vi.mock('../orcad-managed-runtime-context', () => ({ requireManagedOrcadInfrastructure: () => ({ connectionManager: { connect: mocks.connect, @@ -23,7 +23,7 @@ vi.mock('./ssh-host-relay-terminals-on-connect', () => ({ })) const { censusHostRelayTerminalsFor } = await import('./ssh-host-relay-census-for-target') -const attribution = await import('./ssh-connection-attribution') +const attribution = await import('../ssh-connection-attribution') const target: SshTarget = { id: 'ssh-1', label: 'Box', host: 'box', port: 22, username: 'me' } // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: attribution keys on identity only. diff --git a/src/main/ssh/ssh-host-relay-census-for-target.ts b/src/main/ssh/legacy-relay/ssh-host-relay-census-for-target.ts similarity index 87% rename from src/main/ssh/ssh-host-relay-census-for-target.ts rename to src/main/ssh/legacy-relay/ssh-host-relay-census-for-target.ts index a8bd0a78ba6..d16f425b783 100644 --- a/src/main/ssh/ssh-host-relay-census-for-target.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-census-for-target.ts @@ -1,12 +1,12 @@ -import type { SshTarget } from '../../shared/ssh-types' -import type { CensusHostRelayTerminals } from './orcad-migration-terminal-gate' -import { requireManagedOrcadInfrastructure } from './orcad-managed-runtime-context' +import type { SshTarget } from '../../../shared/ssh-types' +import type { CensusHostRelayTerminals } from '../orcad-migration-terminal-gate' +import { requireManagedOrcadInfrastructure } from '../orcad-managed-runtime-context' import { beginSshHostCensus, currentSshOwner, isSshConnectionSolelyOwnedBy, runAttributedToSshOwner -} from './ssh-connection-attribution' +} from '../ssh-connection-attribution' import { censusSshHostRelaysBeforeSession, hostTerminalProofFromCensus diff --git a/src/main/ssh/ssh-host-relay-endpoint-census.test.ts b/src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.test.ts similarity index 97% rename from src/main/ssh/ssh-host-relay-endpoint-census.test.ts rename to src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.test.ts index e157eb0ef5b..8bbe785e4a2 100644 --- a/src/main/ssh/ssh-host-relay-endpoint-census.test.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.test.ts @@ -1,11 +1,11 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from '../remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { SshConnection } from './ssh-connection' +import type { SshConnection } from '../ssh-connection' import { parseRelayEndpointIncumbentProbe, type RelayEndpointIncumbent } from './ssh-relay-endpoint-incumbent' -import { getRemoteHostPlatform } from './ssh-remote-platform' +import { getRemoteHostPlatform } from '../ssh-remote-platform' const { execCommand, probeRelayEndpointIncumbent, countRelayEndpointPtys } = vi.hoisted(() => ({ execCommand: vi.fn(), @@ -13,7 +13,7 @@ const { execCommand, probeRelayEndpointIncumbent, countRelayEndpointPtys } = vi. countRelayEndpointPtys: vi.fn() })) -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('../remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand })) diff --git a/src/main/ssh/ssh-host-relay-endpoint-census.ts b/src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.ts similarity index 93% rename from src/main/ssh/ssh-host-relay-endpoint-census.ts rename to src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.ts index e76e7d836c4..956bdae8726 100644 --- a/src/main/ssh/ssh-host-relay-endpoint-census.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.ts @@ -6,11 +6,11 @@ * Loss of contact is never evidence of exit (docs/reference/ssh-execution-boundary.md): a listing * that failed, ran out of room, or an endpoint the probe could not classify is `unverifiable`. */ -import type { SshConnection } from './ssh-connection' -import { shellEscape } from './ssh-connection-utils' -import { RELAY_REMOTE_DIR } from './relay-protocol' -import { SHORT_RELAY_SOCKET_DIR_PREFIX } from './relay-socket-path-limit' -import { execCommand } from './ssh-relay-exec-command' +import type { SshConnection } from '../ssh-connection' +import { shellEscape } from '../ssh-connection-utils' +import { RELAY_REMOTE_DIR } from '../remote-frame-protocol' +import { SHORT_RELAY_SOCKET_DIR_PREFIX } from '../relay-socket-path-limit' +import { execCommand } from '../remote-exec-command' import { isReapableRelayHusk, probeRelayEndpointIncumbent, @@ -18,7 +18,7 @@ import { } from './ssh-relay-endpoint-incumbent' import { countRelayEndpointPtys } from './ssh-relay-endpoint-pty-count' import { readRelayDaemonRuntimes } from './ssh-relay-endpoint-runtime' -import { isWindowsRemoteHost, type RemoteHostPlatform } from './ssh-remote-platform' +import { isWindowsRemoteHost, type RemoteHostPlatform } from '../ssh-remote-platform' /** `unenumerable`: Windows named pipes cannot be listed, so the caller keeps today's path. */ export type HostRelayEndpointVerdict = 'none' | 'idle' | 'live' | 'unverifiable' | 'unenumerable' diff --git a/src/main/ssh/ssh-host-relay-terminals-on-connect.test.ts b/src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.test.ts similarity index 97% rename from src/main/ssh/ssh-host-relay-terminals-on-connect.test.ts rename to src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.test.ts index 34090bf2d69..327bb603df9 100644 --- a/src/main/ssh/ssh-host-relay-terminals-on-connect.test.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import type { SshRemotePtyLease } from '../../shared/ssh-types' +import type { SshRemotePtyLease } from '../../../shared/ssh-types' import type { HostRelayEndpointCensus } from './ssh-host-relay-endpoint-census' import { relayTerminalsOnConnect } from './ssh-host-relay-terminals-on-connect' diff --git a/src/main/ssh/ssh-host-relay-terminals-on-connect.ts b/src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.ts similarity index 82% rename from src/main/ssh/ssh-host-relay-terminals-on-connect.ts rename to src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.ts index 4627fea67a1..3a7018aa157 100644 --- a/src/main/ssh/ssh-host-relay-terminals-on-connect.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.ts @@ -2,24 +2,28 @@ * The connect path's terminal verdict for a host that may convert to a managed server. The host's * own relay endpoints decide, so terminals another desktop opened there still block. */ -import type { Store } from '../persistence' -import type { HostServerTerminalVerdict } from './ssh-host-server-on-connect' +import type { Store } from '../../persistence' +import type { HostServerTerminalVerdict } from '../ssh-host-server-on-connect' import { censusHostRelayEndpoints, type HostRelayEndpointCensus } from './ssh-host-relay-endpoint-census' -import type { SshConnection } from './ssh-connection' +import type { SshConnection } from '../ssh-connection' import { censusWindowsHostRelays, windowsCensusNodePath } from './ssh-host-relay-windows-census' -import { execCommand } from './ssh-relay-exec-command' -import { readRemoteHomeCommand } from './ssh-remote-commands' -import { resolveRemoteNodePath } from './ssh-remote-node-resolution' -import { detectRemoteHostPlatform } from './ssh-remote-platform-detection' -import { isWindowsRemoteHost, normalizeRemoteHome, validateRemoteHome } from './ssh-remote-platform' +import { execCommand } from '../remote-exec-command' +import { readRemoteHomeCommand } from '../ssh-remote-commands' +import { resolveRemoteNodePath } from '../ssh-remote-node-resolution' +import { detectRemoteHostPlatform } from '../ssh-remote-platform-detection' +import { + isWindowsRemoteHost, + normalizeRemoteHome, + validateRemoteHome +} from '../ssh-remote-platform' import { assessOrcadMigrationTerminals, terminalsRunElsewhere, type HostRelayTerminalProof -} from './orcad-migration-terminal-gate' +} from '../orcad-migration-terminal-gate' export async function relayTerminalsOnConnect(args: { store: Pick diff --git a/src/main/ssh/ssh-host-relay-windows-census.test.ts b/src/main/ssh/legacy-relay/ssh-host-relay-windows-census.test.ts similarity index 95% rename from src/main/ssh/ssh-host-relay-windows-census.test.ts rename to src/main/ssh/legacy-relay/ssh-host-relay-windows-census.test.ts index 321838afb6f..f27958da304 100644 --- a/src/main/ssh/ssh-host-relay-windows-census.test.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-windows-census.test.ts @@ -1,21 +1,21 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from '../remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { SshConnection } from './ssh-connection' +import type { SshConnection } from '../ssh-connection' import { relaySocketNameForInstanceId } from './ssh-relay-instance-id' import { windowsRelayPipePathsForSocketName } from './ssh-relay-endpoints' -import { getRemoteHostPlatform, joinRemotePath } from './ssh-remote-platform' +import { getRemoteHostPlatform, joinRemotePath } from '../ssh-remote-platform' const { execCommand, countRelayPtysOverBridge } = vi.hoisted(() => ({ execCommand: vi.fn(), countRelayPtysOverBridge: vi.fn() })) -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('../remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand })) vi.mock('./ssh-relay-endpoint-pty-count', () => ({ countRelayPtysOverBridge })) -vi.mock('./ssh-remote-commands', async (importOriginal) => ({ +vi.mock('../ssh-remote-commands', async (importOriginal) => ({ ...(await importOriginal>()), listRemoteInstallBaseDirsCommand: () => 'LIST' })) diff --git a/src/main/ssh/ssh-host-relay-windows-census.ts b/src/main/ssh/legacy-relay/ssh-host-relay-windows-census.ts similarity index 86% rename from src/main/ssh/ssh-host-relay-windows-census.ts rename to src/main/ssh/legacy-relay/ssh-host-relay-windows-census.ts index 4cf4a92f80d..5f9b5630c68 100644 --- a/src/main/ssh/ssh-host-relay-windows-census.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-windows-census.ts @@ -8,9 +8,9 @@ * failed or a live pipe that cannot be asked: a shell no lease here knows must never let the host * convert under it. */ -import type { SshConnection } from './ssh-connection' -import { RELAY_REMOTE_DIR } from './relay-protocol' -import { RELAY_INSTALL_MODEL } from './remote-install-model' +import type { SshConnection } from '../ssh-connection' +import { RELAY_REMOTE_DIR } from '../remote-frame-protocol' +import { RELAY_INSTALL_MODEL } from '../remote-install-model' import type { HostRelayEndpointCensus } from './ssh-host-relay-endpoint-census' import { windowsPipesNotRunHere, @@ -19,16 +19,16 @@ import { windowsRelayInventoryCommand } from './ssh-host-relay-windows-inventory' import { countRelayPtysOverBridge } from './ssh-relay-endpoint-pty-count' -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from '../remote-exec-command' import { relaySocketNameForInstanceId } from './ssh-relay-instance-id' import { windowsRelayConnectCommand } from './ssh-relay-windows-launch-command' -import { listRemoteInstallBaseDirsCommand } from './ssh-remote-commands' -import { joinRemotePath, type RemoteHostPlatform } from './ssh-remote-platform' -import { isNodeRuntimeTarget } from '../../shared/node-runtime-pin' -import { orcadNodeRuntimeExecutable } from '../../shared/orcad-artifacts' -import { nodeRuntimeStoreDir, remoteNodeRuntimePresentCommand } from './orcad-remote-node-runtime' -import { REMOTE_NODE_RUNTIME_READY } from './orcad-remote-node-runtime-report' -import { resolveRemoteNodePath } from './ssh-remote-node-resolution' +import { listRemoteInstallBaseDirsCommand } from '../ssh-remote-commands' +import { joinRemotePath, type RemoteHostPlatform } from '../ssh-remote-platform' +import { isNodeRuntimeTarget } from '../../../shared/node-runtime-pin' +import { orcadNodeRuntimeExecutable } from '../../../shared/orcad-artifacts' +import { nodeRuntimeStoreDir, remoteNodeRuntimePresentCommand } from '../orcad-remote-node-runtime' +import { REMOTE_NODE_RUNTIME_READY } from '../orcad-remote-node-runtime-report' +import { resolveRemoteNodePath } from '../ssh-remote-node-resolution' const MAX_CENSUS_PIPES = 32 diff --git a/src/main/ssh/ssh-host-relay-windows-inventory.test.ts b/src/main/ssh/legacy-relay/ssh-host-relay-windows-inventory.test.ts similarity index 97% rename from src/main/ssh/ssh-host-relay-windows-inventory.test.ts rename to src/main/ssh/legacy-relay/ssh-host-relay-windows-inventory.test.ts index dffd745648b..886ce936cc1 100644 --- a/src/main/ssh/ssh-host-relay-windows-inventory.test.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-windows-inventory.test.ts @@ -12,7 +12,7 @@ import { } from './ssh-host-relay-windows-inventory' import { relaySocketNameForInstanceId } from './ssh-relay-instance-id' import { windowsRelayPipePathsForSocketName } from './ssh-relay-endpoints' -import { getRemoteHostPlatform, joinRemotePath } from './ssh-remote-platform' +import { getRemoteHostPlatform, joinRemotePath } from '../ssh-remote-platform' const host = getRemoteHostPlatform('win32-x64') const HOME = 'C:\\Users\\dev' diff --git a/src/main/ssh/ssh-host-relay-windows-inventory.ts b/src/main/ssh/legacy-relay/ssh-host-relay-windows-inventory.ts similarity index 96% rename from src/main/ssh/ssh-host-relay-windows-inventory.ts rename to src/main/ssh/legacy-relay/ssh-host-relay-windows-inventory.ts index c83cd01405e..84fd0e853e5 100644 --- a/src/main/ssh/ssh-host-relay-windows-inventory.ts +++ b/src/main/ssh/legacy-relay/ssh-host-relay-windows-inventory.ts @@ -7,15 +7,15 @@ * 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 './relay-protocol' -import { commandWithNodePath } from './ssh-remote-commands' +import { RELAY_REMOTE_DIR } from '../remote-frame-protocol' +import { commandWithNodePath } from '../ssh-remote-commands' import { quotePowerShellLiteral as powerShellLiteral, quotePowerShellNativeArgument as powerShellNativeArg -} from '../../shared/powershell-native-argument' +} from '../../../shared/powershell-native-argument' import { windowsRelayPipePathsForSocketName } from './ssh-relay-endpoints' -import { RELAY_INSTALL_MODEL, remoteInstallVersionDirRegex } from './remote-install-model' -import { joinRemotePath, type RemoteHostPlatform } from './ssh-remote-platform' +import { RELAY_INSTALL_MODEL, remoteInstallVersionDirRegex } from '../remote-install-model' +import { joinRemotePath, type RemoteHostPlatform } from '../ssh-remote-platform' /** The instance that serves a pipe: its version directory and the credential its bridge presents. */ export type WindowsRelayPipeOwner = { dir: string; credentialFile: string } diff --git a/src/main/ssh/ssh-host-relay-windows-pipe-access.test.ts b/src/main/ssh/legacy-relay/ssh-host-relay-windows-pipe-access.test.ts similarity index 100% rename from src/main/ssh/ssh-host-relay-windows-pipe-access.test.ts rename to src/main/ssh/legacy-relay/ssh-host-relay-windows-pipe-access.test.ts diff --git a/src/main/ssh/ssh-relay-credential-mismatch-error.ts b/src/main/ssh/legacy-relay/ssh-relay-credential-mismatch-error.ts similarity index 100% rename from src/main/ssh/ssh-relay-credential-mismatch-error.ts rename to src/main/ssh/legacy-relay/ssh-relay-credential-mismatch-error.ts diff --git a/src/main/ssh/ssh-relay-endpoint-incumbent-shell.integration.test.ts b/src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent-shell.integration.test.ts similarity index 98% rename from src/main/ssh/ssh-relay-endpoint-incumbent-shell.integration.test.ts rename to src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent-shell.integration.test.ts index 9d5006c8803..79cadff4ecd 100644 --- a/src/main/ssh/ssh-relay-endpoint-incumbent-shell.integration.test.ts +++ b/src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent-shell.integration.test.ts @@ -14,7 +14,7 @@ import { relayEndpointIncumbentProbeCommand, type RelayEndpointIncumbent } from './ssh-relay-endpoint-incumbent' -import { RELAY_DAEMON_SERVICE_ENTRY_FILENAMES } from './relay-install-artifacts' +import { RELAY_DAEMON_SERVICE_ENTRY_FILENAMES } from '../relay-install-artifacts' const posixOnly = process.platform === 'win32' ? describe.skip : describe diff --git a/src/main/ssh/ssh-relay-endpoint-incumbent.test.ts b/src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent.test.ts similarity index 97% rename from src/main/ssh/ssh-relay-endpoint-incumbent.test.ts rename to src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent.test.ts index 51ec210eb67..57b6390d88e 100644 --- a/src/main/ssh/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 './ssh-relay-exec-command' +import type * as ExecCommandModule from '../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('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('../remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: (...args: unknown[]) => execCommand(...args), isUnconfirmedSshCommandTermination: (error: unknown) => @@ -16,8 +16,8 @@ import { probeRelayEndpointIncumbent, relayEndpointIncumbentProbeCommand } from './ssh-relay-endpoint-incumbent' -import type { SshConnection } from './ssh-connection' -import { getRemoteHostPlatform } from './ssh-remote-platform' +import type { SshConnection } from '../ssh-connection' +import { getRemoteHostPlatform } from '../ssh-remote-platform' // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: The mocked execCommand never dereferences the connection; the Windows path returns before using it. const connection = {} as SshConnection diff --git a/src/main/ssh/ssh-relay-endpoint-incumbent.ts b/src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent.ts similarity index 97% rename from src/main/ssh/ssh-relay-endpoint-incumbent.ts rename to src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent.ts index 3db989cce8d..da960c4d976 100644 --- a/src/main/ssh/ssh-relay-endpoint-incumbent.ts +++ b/src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent.ts @@ -21,16 +21,16 @@ * kernel may hold it, and this machine's connect and `lsof` cannot see that machine. */ import { RELAY_LSOF_PROBE_JS } from '@orca/process-host/posix-lsof-probe' -import type { SshConnection } from './ssh-connection' -import { shellEscape } from './ssh-connection-utils' +import type { SshConnection } from '../ssh-connection' +import { shellEscape } from '../ssh-connection-utils' import { RELAY_CHILD_COUNT_VAR, RELAY_UNRECOGNIZED_CHILD_COUNT_VAR, relayDaemonChildCensusShell -} from './relay-daemon-service-children' -import { execCommand, isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' -import { isWindowsRemoteHost, type RemoteHostPlatform } from './ssh-remote-platform' -import { filesystemTypeIsLocalDisk } from '../orcad/orcad-data-root-locality' +} from '../relay-daemon-service-children' +import { execCommand, isUnconfirmedSshCommandTermination } from '../remote-exec-command' +import { isWindowsRemoteHost, type RemoteHostPlatform } from '../ssh-remote-platform' +import { filesystemTypeIsLocalDisk } from '../../orcad/orcad-data-root-locality' type RelayEndpointVerdict = 'live' | 'unverifiable' | 'exited' diff --git a/src/main/ssh/ssh-relay-endpoint-pty-count.test.ts b/src/main/ssh/legacy-relay/ssh-relay-endpoint-pty-count.test.ts similarity index 96% rename from src/main/ssh/ssh-relay-endpoint-pty-count.test.ts rename to src/main/ssh/legacy-relay/ssh-relay-endpoint-pty-count.test.ts index a19b3d39038..9d48babd73b 100644 --- a/src/main/ssh/ssh-relay-endpoint-pty-count.test.ts +++ b/src/main/ssh/legacy-relay/ssh-relay-endpoint-pty-count.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { SshConnection } from './ssh-connection' +import type { SshConnection } from '../ssh-connection' const { waitForSentinel, request, dispose } = vi.hoisted(() => ({ waitForSentinel: vi.fn(), @@ -8,7 +8,7 @@ const { waitForSentinel, request, dispose } = vi.hoisted(() => ({ })) vi.mock('./ssh-relay-sentinel', () => ({ waitForSentinel })) -vi.mock('./ssh-channel-multiplexer', () => ({ +vi.mock('../ssh-channel-multiplexer', () => ({ SshChannelMultiplexer: class { request = request dispose = dispose diff --git a/src/main/ssh/ssh-relay-endpoint-pty-count.ts b/src/main/ssh/legacy-relay/ssh-relay-endpoint-pty-count.ts similarity index 91% rename from src/main/ssh/ssh-relay-endpoint-pty-count.ts rename to src/main/ssh/legacy-relay/ssh-relay-endpoint-pty-count.ts index 01e162b6891..374a89d61e8 100644 --- a/src/main/ssh/ssh-relay-endpoint-pty-count.ts +++ b/src/main/ssh/legacy-relay/ssh-relay-endpoint-pty-count.ts @@ -6,10 +6,10 @@ * itself knows: its own `relay.js --connect` presents its own build hash, so any client reaches it, * and `pty.listProcesses` needs no PTY owner role, so asking never takes over another desktop's. */ -import type { SshConnection } from './ssh-connection' -import { SshChannelMultiplexer } from './ssh-channel-multiplexer' -import { shellEscape } from './ssh-connection-utils' -import { SHORT_RELAY_SOCKET_DIR_PREFIX } from './relay-socket-path-limit' +import type { SshConnection } from '../ssh-connection' +import { SshChannelMultiplexer } from '../ssh-channel-multiplexer' +import { shellEscape } from '../ssh-connection-utils' +import { SHORT_RELAY_SOCKET_DIR_PREFIX } from '../relay-socket-path-limit' import { waitForSentinel } from './ssh-relay-sentinel' const RELAY_PTY_COUNT_TIMEOUT_MS = 10_000 diff --git a/src/main/ssh/ssh-relay-endpoint-runtime.test.ts b/src/main/ssh/legacy-relay/ssh-relay-endpoint-runtime.test.ts similarity index 100% rename from src/main/ssh/ssh-relay-endpoint-runtime.test.ts rename to src/main/ssh/legacy-relay/ssh-relay-endpoint-runtime.test.ts diff --git a/src/main/ssh/ssh-relay-endpoint-runtime.ts b/src/main/ssh/legacy-relay/ssh-relay-endpoint-runtime.ts similarity index 94% rename from src/main/ssh/ssh-relay-endpoint-runtime.ts rename to src/main/ssh/legacy-relay/ssh-relay-endpoint-runtime.ts index 257e7a1ed6b..e0ed047265f 100644 --- a/src/main/ssh/ssh-relay-endpoint-runtime.ts +++ b/src/main/ssh/legacy-relay/ssh-relay-endpoint-runtime.ts @@ -6,8 +6,8 @@ * relay resolved. Asking that relay, or probing its socket, with the same runtime is what keeps a * host with no PATH Node from reading every relay as unverifiable. */ -import type { SshConnection } from './ssh-connection' -import { execCommand } from './ssh-relay-exec-command' +import type { SshConnection } from '../ssh-connection' +import { execCommand } from '../remote-exec-command' const RELAY_DAEMON_MARKER = ' relay.js --detached ' diff --git a/src/main/ssh/ssh-relay-endpoints.ts b/src/main/ssh/legacy-relay/ssh-relay-endpoints.ts similarity index 87% rename from src/main/ssh/ssh-relay-endpoints.ts rename to src/main/ssh/legacy-relay/ssh-relay-endpoints.ts index e653cb4d5c2..6efd5d5bf34 100644 --- a/src/main/ssh/ssh-relay-endpoints.ts +++ b/src/main/ssh/legacy-relay/ssh-relay-endpoints.ts @@ -1,5 +1,9 @@ import { createHash } from 'node:crypto' -import { isWindowsRemoteHost, joinRemotePath, type RemoteHostPlatform } from './ssh-remote-platform' +import { + isWindowsRemoteHost, + joinRemotePath, + type RemoteHostPlatform +} from '../ssh-remote-platform' function relayEndpointForHost( hostPlatform: RemoteHostPlatform, diff --git a/src/main/ssh/ssh-relay-handshake-mismatch.ts b/src/main/ssh/legacy-relay/ssh-relay-handshake-mismatch.ts similarity index 100% rename from src/main/ssh/ssh-relay-handshake-mismatch.ts rename to src/main/ssh/legacy-relay/ssh-relay-handshake-mismatch.ts diff --git a/src/main/ssh/ssh-relay-incumbent-process.test.ts b/src/main/ssh/legacy-relay/ssh-relay-incumbent-process.test.ts similarity index 97% rename from src/main/ssh/ssh-relay-incumbent-process.test.ts rename to src/main/ssh/legacy-relay/ssh-relay-incumbent-process.test.ts index d1a8e223631..5626c4d6dee 100644 --- a/src/main/ssh/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 './ssh-relay-exec-command' +import type * as ExecCommandModule from '../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('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('../remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) diff --git a/src/main/ssh/ssh-relay-instance-id.ts b/src/main/ssh/legacy-relay/ssh-relay-instance-id.ts similarity index 100% rename from src/main/ssh/ssh-relay-instance-id.ts rename to src/main/ssh/legacy-relay/ssh-relay-instance-id.ts diff --git a/src/main/ssh/ssh-relay-sentinel-copy-budget.test.ts b/src/main/ssh/legacy-relay/ssh-relay-sentinel-copy-budget.test.ts similarity index 97% rename from src/main/ssh/ssh-relay-sentinel-copy-budget.test.ts rename to src/main/ssh/legacy-relay/ssh-relay-sentinel-copy-budget.test.ts index fdc02b3568d..23348b6e13d 100644 --- a/src/main/ssh/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 './relay-protocol' +import { RELAY_SENTINEL } from '../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/ssh-relay-sentinel.test.ts b/src/main/ssh/legacy-relay/ssh-relay-sentinel.test.ts similarity index 99% rename from src/main/ssh/ssh-relay-sentinel.test.ts rename to src/main/ssh/legacy-relay/ssh-relay-sentinel.test.ts index 4bd267a3e34..fffdbe49d85 100644 --- a/src/main/ssh/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 './relay-protocol' +import { RELAY_SENTINEL } from '../remote-frame-protocol' import { RelayVersionMismatchError, RELAY_EXIT_CODE_VERSION_MISMATCH diff --git a/src/main/ssh/ssh-relay-sentinel.ts b/src/main/ssh/legacy-relay/ssh-relay-sentinel.ts similarity index 97% rename from src/main/ssh/ssh-relay-sentinel.ts rename to src/main/ssh/legacy-relay/ssh-relay-sentinel.ts index 4a6916de7ef..7a63d862f47 100644 --- a/src/main/ssh/ssh-relay-sentinel.ts +++ b/src/main/ssh/legacy-relay/ssh-relay-sentinel.ts @@ -1,7 +1,7 @@ import type { ClientChannel } from 'ssh2' -import { createSshOperationAbortError } from './ssh-connection-utils' -import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from './relay-protocol' -import type { MultiplexerTransport } from './ssh-channel-multiplexer' +import { createSshOperationAbortError } from '../ssh-connection-utils' +import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from '../remote-frame-protocol' +import type { MultiplexerTransport } from '../ssh-channel-multiplexer' import { buildRelayHandshakeRefusalError } from './ssh-relay-handshake-mismatch' const MAX_RELAY_STARTUP_BUFFER_BYTES = 64 * 1024 diff --git a/src/main/ssh/ssh-relay-version-mismatch-error.ts b/src/main/ssh/legacy-relay/ssh-relay-version-mismatch-error.ts similarity index 100% rename from src/main/ssh/ssh-relay-version-mismatch-error.ts rename to src/main/ssh/legacy-relay/ssh-relay-version-mismatch-error.ts diff --git a/src/main/ssh/ssh-relay-windows-launch-command.ts b/src/main/ssh/legacy-relay/ssh-relay-windows-launch-command.ts similarity index 77% rename from src/main/ssh/ssh-relay-windows-launch-command.ts rename to src/main/ssh/legacy-relay/ssh-relay-windows-launch-command.ts index 517204c0d1c..1e657c1bf5d 100644 --- a/src/main/ssh/ssh-relay-windows-launch-command.ts +++ b/src/main/ssh/legacy-relay/ssh-relay-windows-launch-command.ts @@ -1,7 +1,7 @@ /** How the host census reaches a running Windows relay through its own bridge. */ -import { commandWithNodePath } from './ssh-remote-commands' -import type { RemoteHostPlatform } from './ssh-remote-platform' -import { quotePowerShellLiteral as powerShellLiteral } from '../../shared/powershell-native-argument' +import { commandWithNodePath } from '../ssh-remote-commands' +import type { RemoteHostPlatform } from '../ssh-remote-platform' +import { quotePowerShellLiteral as powerShellLiteral } from '../../../shared/powershell-native-argument' export function windowsRelayConnectCommand( hostPlatform: RemoteHostPlatform, diff --git a/src/main/ssh/orcad-activation-crash-recovery.test.ts b/src/main/ssh/orcad-activation-crash-recovery.test.ts index 72c64e1da97..807d3e1e772 100644 --- a/src/main/ssh/orcad-activation-crash-recovery.test.ts +++ b/src/main/ssh/orcad-activation-crash-recovery.test.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import type * as RecordFile from './orcad-remote-record-file' -import type * as InstallLock from './ssh-relay-install-lock' +import type * as InstallLock from './remote-install-lock' import type * as VersionedInstall from './remote-versioned-install' import type * as Crypto from 'node:crypto' @@ -11,14 +11,14 @@ vi.mock('node:crypto', async (importOriginal) => { return { ...actual, randomUUID: () => uuid.fixed ?? actual.randomUUID() } }) -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) vi.mock('./ssh-connection-utils', () => ({ shellEscape: (s: string) => `'${s}'` })) -vi.mock('./ssh-relay-install-lock', async (importOriginal) => ({ +vi.mock('./remote-install-lock', async (importOriginal) => ({ ...(await importOriginal()), acquireInstallLock: vi.fn() })) @@ -38,8 +38,8 @@ vi.mock('./orcad-local-build-hash', () => ({ computeLocalOrcadBuildHash: () => 'abc123def4567890' })) -import { execCommand } from './ssh-relay-exec-command' -import { acquireInstallLock } from './ssh-relay-install-lock' +import { execCommand } from './remote-exec-command' +import { acquireInstallLock } from './remote-install-lock' import { writeAtomicOrcadRemoteRecord } from './orcad-remote-record-file' import { deployOrcad } from './orcad-remote-deploy' import { rollbackOrcad } from './orcad-remote-rollback' @@ -110,9 +110,8 @@ beforeEach(() => { vi.mocked(execCommand).mockImplementation(async (_conn, command) => host.exec(command)) vi.mocked(acquireInstallLock).mockImplementation(async (_conn, dir, _host, options) => { if (!host.acquireFence(options)) { - const { RemoteInstallLockBusyError } = await vi.importActual( - './ssh-relay-install-lock' - ) + const { RemoteInstallLockBusyError } = + await vi.importActual('./remote-install-lock') throw new RemoteInstallLockBusyError(dir, 0) } }) @@ -364,9 +363,8 @@ describe('recovery refusals keep the fence', () => { host.crashAt = null const journal = host.journal expect(journal).not.toBeNull() - const { RemoteInstallLockBusyError } = await vi.importActual( - './ssh-relay-install-lock' - ) + const { RemoteInstallLockBusyError } = + await vi.importActual('./remote-install-lock') vi.mocked(acquireInstallLock).mockRejectedValueOnce(new RemoteInstallLockBusyError('/l', 0)) expect(await recoverInterruptedOrcadActivation({ ...slot })).toMatchObject({ outcome: 'pending' diff --git a/src/main/ssh/orcad-activation-fence-generation.test.ts b/src/main/ssh/orcad-activation-fence-generation.test.ts index 192de60060e..441efdce519 100644 --- a/src/main/ssh/orcad-activation-fence-generation.test.ts +++ b/src/main/ssh/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-relay-exec-command' +import type * as ExecCommandModule from './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-relay-exec-command', async (importOriginal) => { +vi.mock('./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-relay-exec-command') + const { sshCommandExitError } = await import('./remote-exec-command') throw sshCommandExitError(command, result.code ?? 1, result.stdout) } return result.stdout diff --git a/src/main/ssh/orcad-activation-fence-hold.test.ts b/src/main/ssh/orcad-activation-fence-hold.test.ts index 06576724bf9..b52cb058227 100644 --- a/src/main/ssh/orcad-activation-fence-hold.test.ts +++ b/src/main/ssh/orcad-activation-fence-hold.test.ts @@ -6,7 +6,7 @@ const mocks = vi.hoisted(() => ({ fence: vi.fn(), takeover: vi.fn() })) -vi.mock('./ssh-relay-install-lock', () => ({ +vi.mock('./remote-install-lock', () => ({ isRelayInstallLockStale: mocks.stale, RELAY_INSTALL_LOCK_NAME: '.install-lock' })) diff --git a/src/main/ssh/orcad-activation-fence-hold.ts b/src/main/ssh/orcad-activation-fence-hold.ts index 784df75e68e..ce7f9bff231 100644 --- a/src/main/ssh/orcad-activation-fence-hold.ts +++ b/src/main/ssh/orcad-activation-fence-hold.ts @@ -11,7 +11,7 @@ import { } from './orcad-activation-lock' import { readOrcadActivationTransaction } from './orcad-activation-transaction-store' import { orcadActivationFenceLockDir } from './orcad-activation-transaction' -import { isRelayInstallLockStale } from './ssh-relay-install-lock' +import { isRelayInstallLockStale } from './remote-install-lock' import { findExitedOwnLockToken } from './orcad-exited-own-lock' import { orcadRemoteBaseDir } from './orcad-remote-windows-node' diff --git a/src/main/ssh/orcad-activation-fence-scope.ts b/src/main/ssh/orcad-activation-fence-scope.ts index fae162592fe..7f3915cd387 100644 --- a/src/main/ssh/orcad-activation-fence-scope.ts +++ b/src/main/ssh/orcad-activation-fence-scope.ts @@ -9,7 +9,7 @@ */ import { AsyncLocalStorage } from 'node:async_hooks' import { shellEscape } from './ssh-connection-utils' -import { isSshCommandExitError } from './ssh-relay-exec-command' +import { isSshCommandExitError } from './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/ssh/orcad-activation-host-test-harness.ts b/src/main/ssh/orcad-activation-host-test-harness.ts index 7d909bbf91a..02219159913 100644 --- a/src/main/ssh/orcad-activation-host-test-harness.ts +++ b/src/main/ssh/orcad-activation-host-test-harness.ts @@ -10,7 +10,7 @@ import { type OrcadActivationRecord } from './orcad-activation-record' import { isSnapshotCaptureCommand } from './orcad-snapshot-capture-command' -import { sshCommandExitError } from './ssh-relay-exec-command' +import { sshCommandExitError } from './remote-exec-command' export const OLD = '0.1.0+aa01' export const NEW = '0.2.0+bb01' diff --git a/src/main/ssh/orcad-activation-lock.ts b/src/main/ssh/orcad-activation-lock.ts index 216a4ebf15e..a05f068ab8e 100644 --- a/src/main/ssh/orcad-activation-lock.ts +++ b/src/main/ssh/orcad-activation-lock.ts @@ -12,12 +12,12 @@ import { withoutAbortSignal, type OrcadRemoteExecTarget } from './orcad-remote-runtime-control' -import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' -import { acquireInstallLock, RemoteInstallLockBusyError } from './ssh-relay-install-lock' +import { isUnconfirmedSshCommandTermination } from './remote-exec-command' +import { acquireInstallLock, RemoteInstallLockBusyError } from './remote-install-lock' import { orphanInstallLockCommand, probeInstallLockExistsCommand -} from './ssh-relay-install-lock-commands' +} from './remote-install-lock-commands' import { shellEscape } from './ssh-connection-utils' import { ORCAD_FENCE_OWNER_FILENAME, diff --git a/src/main/ssh/orcad-activation-record-store.ts b/src/main/ssh/orcad-activation-record-store.ts index 6ffc4dfad14..62df0f1bf1b 100644 --- a/src/main/ssh/orcad-activation-record-store.ts +++ b/src/main/ssh/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 './orcad-host-transport' -import { RELAY_REMOTE_DIR } from './relay-protocol' +import { RELAY_REMOTE_DIR } from './remote-frame-protocol' import { ORCAD_ACTIVATION_FILENAME, emptyOrcadActivationRecord, diff --git a/src/main/ssh/orcad-activation-recovery.ts b/src/main/ssh/orcad-activation-recovery.ts index ea760af5f78..8e89d33740e 100644 --- a/src/main/ssh/orcad-activation-recovery.ts +++ b/src/main/ssh/orcad-activation-recovery.ts @@ -17,7 +17,7 @@ import { orcadActivationFenceExists, withStaleOrcadActivationRecoveryLock } from './orcad-activation-lock' -import { RemoteInstallLockBusyError } from './ssh-relay-install-lock' +import { RemoteInstallLockBusyError } from './remote-install-lock' import { ensureOrcadSlotServing, resolveOrcadSlotIdentity } from './orcad-recovery-slot' import { reconcileOrcadDecommission } from './orcad-decommission-recovery' import { diff --git a/src/main/ssh/orcad-activation-transaction.test.ts b/src/main/ssh/orcad-activation-transaction.test.ts index 4e5446107ce..751b311f925 100644 --- a/src/main/ssh/orcad-activation-transaction.test.ts +++ b/src/main/ssh/orcad-activation-transaction.test.ts @@ -1,18 +1,18 @@ import { describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from './ssh-relay-exec-command' -import type * as InstallLock from './ssh-relay-install-lock' +import type * as ExecCommandModule from './remote-exec-command' +import type * as InstallLock from './remote-install-lock' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn().mockResolvedValue('') })) -vi.mock('./ssh-relay-install-lock', async (importOriginal) => ({ +vi.mock('./remote-install-lock', async (importOriginal) => ({ ...(await importOriginal()), acquireInstallLock: vi.fn().mockResolvedValue(undefined) })) -import { execCommand } from './ssh-relay-exec-command' -import { acquireInstallLock, RemoteInstallLockBusyError } from './ssh-relay-install-lock' +import { execCommand } from './remote-exec-command' +import { acquireInstallLock, RemoteInstallLockBusyError } from './remote-install-lock' import { parseOrcadActivationTransaction, planOrcadTransactionRecovery, diff --git a/src/main/ssh/orcad-activation-transaction.ts b/src/main/ssh/orcad-activation-transaction.ts index 4ac70a4f063..84dd8be2e5c 100644 --- a/src/main/ssh/orcad-activation-transaction.ts +++ b/src/main/ssh/orcad-activation-transaction.ts @@ -25,7 +25,7 @@ import { } from './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 './relay-protocol' +import { RELAY_REMOTE_DIR } from './remote-frame-protocol' import { joinRemotePath, type RemoteHostPlatform } from './ssh-remote-platform' export const ORCAD_ACTIVATION_TRANSACTION_FILENAME = 'transaction.json' diff --git a/src/main/ssh/orcad-candidate-launch-verdict.ts b/src/main/ssh/orcad-candidate-launch-verdict.ts index 9a50691a544..986dfd81493 100644 --- a/src/main/ssh/orcad-candidate-launch-verdict.ts +++ b/src/main/ssh/orcad-candidate-launch-verdict.ts @@ -5,7 +5,7 @@ import { launchOrcadAndAwaitReadiness, type OrcadRemoteExecTarget } from './orcad-remote-runtime-control' -import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' +import { isUnconfirmedSshCommandTermination } from './remote-exec-command' type CandidateLaunchTarget = Parameters[0] & OrcadRemoteExecTarget & { diff --git a/src/main/ssh/orcad-decommission-stop.ts b/src/main/ssh/orcad-decommission-stop.ts index ff1f0613762..24745570ed3 100644 --- a/src/main/ssh/orcad-decommission-stop.ts +++ b/src/main/ssh/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-relay-exec-command' +import { isUnconfirmedSshCommandTermination } from './remote-exec-command' import { cancelRemoteOrcadManagedStop, completeRemoteOrcadManagedStop diff --git a/src/main/ssh/orcad-deployment-target.test.ts b/src/main/ssh/orcad-deployment-target.test.ts index cfe60b88bb0..9fbc6a94b61 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 './ssh-relay-exec-command' +import type * as ExecCommandModule from './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 './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' import { getRemoteHostPlatform } from './ssh-remote-platform' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./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 1aa2c874c82..9a9f677307f 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 './remote-install-transport' -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './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 e55f5f3d7ac..c579c74794a 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 './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' // The proof's remote commands run in a real local shell. -vi.mock('./ssh-relay-exec-command', async (importOriginal) => { +vi.mock('./remote-exec-command', async (importOriginal) => { const { runProcess: run } = await import('@orca/process-host') return { ...(await importOriginal()), @@ -26,7 +26,7 @@ vi.mock('./ssh-relay-exec-command', async (importOriginal) => { const { exitedOwnLockProof } = await import('./orcad-exited-own-lock') const { initOrcadHeldFenceTokenFile, ORCAD_HELD_FENCE_TOKENS_FILE_NAME } = await import('./orcad-held-fence-tokens') -const { tryStealInstallLockCommand } = await import('./ssh-relay-install-lock-commands') +const { tryStealInstallLockCommand } = await import('./remote-install-lock-commands') const { serializedStateMutationCommand } = await import('./orcad-state-snapshot') const { ORCAD_FENCE_LOST_EXIT, ORCAD_FENCE_LOST_MARKER } = await import('./orcad-activation-fence-scope') diff --git a/src/main/ssh/orcad-exited-own-fence.test.ts b/src/main/ssh/orcad-exited-own-fence.test.ts index e994de9bf2d..13771c31418 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 './ssh-relay-exec-command' +import type * as ExecCommandModule from './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-relay-exec-command', async (importOriginal) => { +vi.mock('./remote-exec-command', async (importOriginal) => { const { runProcess } = await import('@orca/process-host') - const { sshCommandExitError } = await import('./ssh-relay-exec-command') + const { sshCommandExitError } = await import('./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 8edda4acfb1..5c6f2893aef 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 './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' // Every remote command runs in a real local shell, so the host-side checks are the real ones. -vi.mock('./ssh-relay-exec-command', async (importOriginal) => { +vi.mock('./remote-exec-command', async (importOriginal) => { const { runProcess } = await import('@orca/process-host') - const { sshCommandExitError } = await import('./ssh-relay-exec-command') + const { sshCommandExitError } = await import('./remote-exec-command') return { ...(await importOriginal()), execCommand: async (_conn: unknown, command: string) => { @@ -29,7 +29,7 @@ vi.mock('./ssh-relay-exec-command', async (importOriginal) => { } }) -const { acquireInstallLock, RemoteInstallLockBusyError } = await import('./ssh-relay-install-lock') +const { acquireInstallLock, RemoteInstallLockBusyError } = await import('./remote-install-lock') const { exitedOwnLockProof } = await import('./orcad-exited-own-lock') const { initOrcadHeldFenceTokenFile, ORCAD_HELD_FENCE_TOKENS_FILE_NAME } = await import('./orcad-held-fence-tokens') 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 e61da3dc3d2..ecf397a066a 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 './ssh-relay-exec-command' +import type * as ExecCommandModule from './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('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: async (_conn: unknown, command: string) => { remote.commands.push(command) diff --git a/src/main/ssh/orcad-exited-own-lock.ts b/src/main/ssh/orcad-exited-own-lock.ts index d491c7c4ab3..30c26725617 100644 --- a/src/main/ssh/orcad-exited-own-lock.ts +++ b/src/main/ssh/orcad-exited-own-lock.ts @@ -27,7 +27,7 @@ import { } from './orcad-state-snapshot-members' import { CMD_EXE_COMMAND_LINE_MAX_CHARS } from '../providers/windows-shell-args' import { shellEscape } from './ssh-connection-utils' -import type { InstallLockExitedOwnerProof } from './ssh-relay-install-lock' +import type { InstallLockExitedOwnerProof } from './remote-install-lock' import { isWindowsRemoteHost, joinRemotePath } from './ssh-remote-platform' // Keeps the Windows command line short; an older token left out only waits out the stale window. diff --git a/src/main/ssh/orcad-fence-lost-classification.test.ts b/src/main/ssh/orcad-fence-lost-classification.test.ts index 9ac3765bd58..de7c71293bd 100644 --- a/src/main/ssh/orcad-fence-lost-classification.test.ts +++ b/src/main/ssh/orcad-fence-lost-classification.test.ts @@ -10,7 +10,7 @@ import { posixOrcadFenceGuard, runWithOrcadFence } from './orcad-activation-fence-scope' -import { isUnconfirmedSshCommandTermination, sshCommandExitError } from './ssh-relay-exec-command' +import { isUnconfirmedSshCommandTermination, sshCommandExitError } from './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 9d9100bc4c3..cb9e802c397 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 './orcad-activation-record' import type { OrcadActivationTransaction } from './orcad-activation-transaction' import { readOrcadActivationTransaction } from './orcad-activation-transaction-store' import { orcadActivationFenceExists } from './orcad-activation-lock' -import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' +import { isUnconfirmedSshCommandTermination } from './remote-exec-command' import type { OrcadRemoteExecTarget } from './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 ea8e4709f2f..f550a585622 100644 --- a/src/main/ssh/orcad-incumbent-recovery.ts +++ b/src/main/ssh/orcad-incumbent-recovery.ts @@ -9,7 +9,7 @@ import { execOrcadStateMutation } from './orcad-state-mutation-exec' import { orcadRemoteBaseDir } from './orcad-remote-windows-node' import type { ServeReadiness } from '../server/serve-readiness' -import { RELAY_REMOTE_DIR } from './relay-protocol' +import { RELAY_REMOTE_DIR } from './remote-frame-protocol' import { ORCAD_STATE_SNAPSHOT_DIR } from './orcad-activation-record' import type { OrcadSnapshotVerdict } from './orcad-activation-transaction' import { diff --git a/src/main/ssh/orcad-installed-activation.ts b/src/main/ssh/orcad-installed-activation.ts index 4c09862fdb7..ff372de3db7 100644 --- a/src/main/ssh/orcad-installed-activation.ts +++ b/src/main/ssh/orcad-installed-activation.ts @@ -8,7 +8,7 @@ import { orcadRemoteBaseDir } from './orcad-remote-windows-node' import { randomUUID } from 'node:crypto' import type { OrcadDeployOptions, OrcadDeployResult } from './orcad-remote-deploy' -import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' +import { isUnconfirmedSshCommandTermination } from './remote-exec-command' import { withActivatedVersion, type OrcadActivationRecord, diff --git a/src/main/ssh/orcad-machine-claim-command.ts b/src/main/ssh/orcad-machine-claim-command.ts index 73c69fbe230..a29f5140a56 100644 --- a/src/main/ssh/orcad-machine-claim-command.ts +++ b/src/main/ssh/orcad-machine-claim-command.ts @@ -1,6 +1,6 @@ import { randomUUID } from 'node:crypto' import { shellEscape } from './ssh-connection-utils' -import { RELAY_REMOTE_DIR } from './relay-protocol' +import { RELAY_REMOTE_DIR } from './remote-frame-protocol' import { ORCAD_MACHINE_CLAIM_FILENAME, ORCAD_MACHINE_CLAIM_SCHEMA_VERSION diff --git a/src/main/ssh/orcad-machine-home.test.ts b/src/main/ssh/orcad-machine-home.test.ts index 79c8b843edd..1a552877e72 100644 --- a/src/main/ssh/orcad-machine-home.test.ts +++ b/src/main/ssh/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-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import type { OrcadMachineHomeProbe } from './orcad-machine-home' import type { OrcadHostTransport } from './orcad-host-transport' import type { RemoteHostPlatform } from './ssh-remote-platform' @@ -21,7 +21,7 @@ import type { RemoteHostPlatform } from './ssh-remote-platform' const shell = vi.hoisted((): { env: NodeJS.ProcessEnv | undefined } => ({ env: undefined })) -vi.mock('./ssh-relay-exec-command', async (importOriginal) => { +vi.mock('./remote-exec-command', async (importOriginal) => { const { runProcess } = await import('@orca/process-host') return { ...(await importOriginal()), @@ -32,7 +32,7 @@ vi.mock('./ssh-relay-exec-command', async (importOriginal) => { env: conn.env ?? shell.env }) if (result.code !== 0) { - const { sshCommandExitError } = await import('./ssh-relay-exec-command') + const { sshCommandExitError } = await import('./remote-exec-command') throw sshCommandExitError(command, result.code ?? 1, result.stdout) } return result.stdout diff --git a/src/main/ssh/orcad-machine-home.ts b/src/main/ssh/orcad-machine-home.ts index b22b47f47a2..1cd5142f8f1 100644 --- a/src/main/ssh/orcad-machine-home.ts +++ b/src/main/ssh/orcad-machine-home.ts @@ -12,7 +12,7 @@ */ import { createHash } from 'node:crypto' import { shellEscape } from './ssh-connection-utils' -import { RELAY_REMOTE_DIR } from './relay-protocol' +import { RELAY_REMOTE_DIR } from './remote-frame-protocol' import { ORCAD_ACTIVATION_FILENAME } from './orcad-activation-record' import { parseDarwinPlatformUuid } from '../persistence/profile-state/profile-state-access-identity' import { diff --git a/src/main/ssh/orcad-managed-remote-stop.ts b/src/main/ssh/orcad-managed-remote-stop.ts index 87c639d01fb..cadc891a5e7 100644 --- a/src/main/ssh/orcad-managed-remote-stop.ts +++ b/src/main/ssh/orcad-managed-remote-stop.ts @@ -16,7 +16,7 @@ import { execOrcadRemote } from './orcad-remote-runtime-control' import { readBoundedOrcadRemoteRecord } from './orcad-remote-record-file' import { orcadSlotDir, type OrcadSlotOptions } from './orcad-recovery-slot' import { isWindowsRemoteHost, joinRemotePath } from './ssh-remote-platform' -import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' +import { isUnconfirmedSshCommandTermination } from './remote-exec-command' import { orcadWindowsNodeCommandLine, orcadWindowsSlotOpCommand, diff --git a/src/main/ssh/orcad-managed-wake.test.ts b/src/main/ssh/orcad-managed-wake.test.ts index 7db4e9ece8c..d01c5e34c1b 100644 --- a/src/main/ssh/orcad-managed-wake.test.ts +++ b/src/main/ssh/orcad-managed-wake.test.ts @@ -1,19 +1,19 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from './ssh-relay-exec-command' -import type * as InstallLock from './ssh-relay-install-lock' +import type * as ExecCommandModule from './remote-exec-command' +import type * as InstallLock from './remote-install-lock' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) vi.mock('./ssh-connection-utils', () => ({ shellEscape: (s: string) => `'${s}'` })) -vi.mock('./ssh-relay-install-lock', async (importOriginal) => ({ +vi.mock('./remote-install-lock', async (importOriginal) => ({ ...(await importOriginal()), acquireInstallLock: vi.fn() })) -import { execCommand } from './ssh-relay-exec-command' -import { acquireInstallLock, RemoteInstallLockBusyError } from './ssh-relay-install-lock' +import { execCommand } from './remote-exec-command' +import { acquireInstallLock, RemoteInstallLockBusyError } from './remote-install-lock' import { wakeStoppedManagedOrcad } from './orcad-managed-wake' import { getRemoteHostPlatform } from './ssh-remote-platform' import type { OrcadHostTransport } from './orcad-host-transport' 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 86816361e3c..9a48749ec59 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,11 +1,11 @@ // 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 './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' import type { SshConnection } from './ssh-connection' -import { relaySocketNameForInstanceId } from './ssh-relay-instance-id' -import { windowsRelayPipePathsForSocketName } from './ssh-relay-endpoints' +import { relaySocketNameForInstanceId } from './legacy-relay/ssh-relay-instance-id' +import { windowsRelayPipePathsForSocketName } from './legacy-relay/ssh-relay-endpoints' import { getRemoteHostPlatform, joinRemotePath } from './ssh-remote-platform' const { @@ -20,37 +20,39 @@ const { countRelayPtysOverBridge: vi.fn() })) -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand })) -vi.mock('./ssh-relay-endpoint-incumbent', async (importOriginal) => ({ +vi.mock('./legacy-relay/ssh-relay-endpoint-incumbent', async (importOriginal) => ({ ...(await importOriginal>()), probeRelayEndpointIncumbent })) -vi.mock('./ssh-relay-endpoint-pty-count', () => ({ +vi.mock('./legacy-relay/ssh-relay-endpoint-pty-count', () => ({ countRelayEndpointPtys, countRelayPtysOverBridge })) -vi.mock('./ssh-relay-endpoint-runtime', () => ({ readRelayDaemonRuntimes: async () => new Map() })) +vi.mock('./legacy-relay/ssh-relay-endpoint-runtime', () => ({ + readRelayDaemonRuntimes: async () => new Map() +})) vi.mock('./ssh-remote-commands', async (importOriginal) => ({ ...(await importOriginal>()), listRemoteInstallBaseDirsCommand: () => 'LIST' })) -vi.mock('./ssh-host-relay-windows-inventory', async (importOriginal) => ({ +vi.mock('./legacy-relay/ssh-host-relay-windows-inventory', async (importOriginal) => ({ ...(await importOriginal>()), windowsRelayInventoryCommand: () => 'INVENTORY', windowsPipeAccessCommand: () => 'ACCESS' })) -vi.mock('./ssh-relay-windows-launch-command', () => ({ +vi.mock('./legacy-relay/ssh-relay-windows-launch-command', () => ({ windowsRelayConnectCommand: (_h: unknown, _n: string, _d: string, pipe: string) => `BRIDGE ${pipe}` })) import { assessOrcadMigrationTerminals } from './orcad-migration-terminal-gate' -import { censusHostRelayEndpoints } from './ssh-host-relay-endpoint-census' -import { censusWindowsHostRelays } from './ssh-host-relay-windows-census' -import { hostTerminalProofFromCensus } from './ssh-host-relay-terminals-on-connect' +import { censusHostRelayEndpoints } from './legacy-relay/ssh-host-relay-endpoint-census' +import { censusWindowsHostRelays } from './legacy-relay/ssh-host-relay-windows-census' +import { hostTerminalProofFromCensus } from './legacy-relay/ssh-host-relay-terminals-on-connect' // The censuses only hand the connection to the mocked exec, probe and bridge. const conn: SshConnection = Object.create(null) diff --git a/src/main/ssh/orcad-migration-terminal-gate.ts b/src/main/ssh/orcad-migration-terminal-gate.ts index 78f5fa56c65..c2f979868d2 100644 --- a/src/main/ssh/orcad-migration-terminal-gate.ts +++ b/src/main/ssh/orcad-migration-terminal-gate.ts @@ -11,7 +11,7 @@ export type OrcadMigrationTerminalVerdict = | { verdict: 'exited'; provenPtyIds: string[] } /** * COMPAT(legacy-relay-bridge, revisit 2027-01-15): relay terminals may still run, and the host - * converts anyway. Converting stops nothing; src/main/ssh/legacy-relay-bridge/ keeps serving + * converts anyway. Converting stops nothing; src/main/ssh/legacy-relay/ keeps serving * these leases' panes from the old relay until each terminal exits. */ | { diff --git a/src/main/ssh/orcad-remote-context.ts b/src/main/ssh/orcad-remote-context.ts index 20ed0908965..ea99255fb23 100644 --- a/src/main/ssh/orcad-remote-context.ts +++ b/src/main/ssh/orcad-remote-context.ts @@ -23,7 +23,7 @@ import { orcadMachineClaimCommand } from './orcad-machine-claim-command' import { execOrcadRemote, type OrcadRemoteExecTarget } from './orcad-remote-runtime-control' import { readRemoteHomeCommand } from './ssh-remote-commands' import { shellEscape } from './ssh-connection-utils' -import { RELAY_REMOTE_DIR } from './relay-protocol' +import { RELAY_REMOTE_DIR } from './remote-frame-protocol' import { isWindowsRemoteHost, joinRemotePath, diff --git a/src/main/ssh/orcad-remote-decommission.test.ts b/src/main/ssh/orcad-remote-decommission.test.ts index 469a4e8d2ff..92a573f8238 100644 --- a/src/main/ssh/orcad-remote-decommission.test.ts +++ b/src/main/ssh/orcad-remote-decommission.test.ts @@ -1,14 +1,14 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import type * as RecordFile from './orcad-remote-record-file' -import type * as InstallLock from './ssh-relay-install-lock' +import type * as InstallLock from './remote-install-lock' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) vi.mock('./ssh-connection-utils', () => ({ shellEscape: (s: string) => `'${s}'` })) -vi.mock('./ssh-relay-install-lock', async (importOriginal) => ({ +vi.mock('./remote-install-lock', async (importOriginal) => ({ ...(await importOriginal()), acquireInstallLock: vi.fn() })) @@ -17,8 +17,8 @@ vi.mock('./orcad-remote-record-file', async (importOriginal) => ({ writeAtomicOrcadRemoteRecord: vi.fn() })) -import { execCommand } from './ssh-relay-exec-command' -import { acquireInstallLock } from './ssh-relay-install-lock' +import { execCommand } from './remote-exec-command' +import { acquireInstallLock } from './remote-install-lock' import { writeAtomicOrcadRemoteRecord } from './orcad-remote-record-file' import { decommissionRemoteOrcad } from './orcad-remote-decommission' import { recoverInterruptedOrcadActivation } from './orcad-activation-recovery' diff --git a/src/main/ssh/orcad-remote-deploy.test.ts b/src/main/ssh/orcad-remote-deploy.test.ts index 6723de518ca..0fdfd61c70b 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 './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { chmodSync, mkdirSync, mkdtempSync, rmSync, statSync, writeFileSync } from 'node:fs' import type * as RecordFile from './orcad-remote-record-file' import { tmpdir } from 'node:os' @@ -6,18 +6,18 @@ import { dirname, join } from 'node:path' import { beforeEach, describe, expect, it, vi } from 'vitest' import { runProcess } from '@orca/process-host' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) vi.mock('./ssh-connection-utils', () => ({ shellEscape: (s: string) => `'${s}'` })) -vi.mock('./ssh-relay-install-lock', () => ({ +vi.mock('./remote-install-lock', () => ({ acquireInstallLock: vi.fn().mockResolvedValue(undefined), isRelayInstallLockStale: vi.fn().mockResolvedValue(false), RemoteInstallLockBusyError: class extends Error {}, RELAY_INSTALL_LOCK_NAME: '.install-lock' })) -vi.mock('./ssh-relay-install-transfers', () => ({ +vi.mock('./remote-install-transfers', () => ({ uploadRelayDirectory: vi.fn().mockResolvedValue(undefined), writeRelayFile: vi.fn().mockResolvedValue(undefined) })) @@ -32,9 +32,9 @@ vi.mock('./orcad-local-build-hash', () => ({ computeLocalOrcadBuildHash: () => 'abc123def4567890' })) -import { execCommand } from './ssh-relay-exec-command' -import { acquireInstallLock, isRelayInstallLockStale } from './ssh-relay-install-lock' -import { uploadRelayDirectory } from './ssh-relay-install-transfers' +import { execCommand } from './remote-exec-command' +import { acquireInstallLock, isRelayInstallLockStale } from './remote-install-lock' +import { uploadRelayDirectory } from './remote-install-transfers' import { writeAtomicOrcadRemoteRecord } from './orcad-remote-record-file' import { deployOrcad, type OrcadDeployOptions } from './orcad-remote-deploy' import { installOrcadBundle } from './orcad-remote-install' diff --git a/src/main/ssh/orcad-remote-gc.test.ts b/src/main/ssh/orcad-remote-gc.test.ts index 654b6fcecb2..a2475a57e43 100644 --- a/src/main/ssh/orcad-remote-gc.test.ts +++ b/src/main/ssh/orcad-remote-gc.test.ts @@ -1,12 +1,12 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) vi.mock('./ssh-connection-utils', () => ({ shellEscape: (s: string) => `'${s}'` })) -vi.mock('./ssh-relay-gc-claim', () => ({ +vi.mock('./remote-install-gc-claim', () => ({ isRelayGcClaimOwned: vi.fn().mockResolvedValue(true), releaseRelayGcClaimWithRetry: vi.fn().mockResolvedValue('released'), tryAcquireRelayGcClaim: vi.fn().mockResolvedValue('token') @@ -14,14 +14,14 @@ vi.mock('./ssh-relay-gc-claim', () => ({ vi.mock('./remote-install-gc-tombstone', () => ({ cleanupRemoteInstallGcTombstones: vi.fn().mockResolvedValue(undefined) })) -vi.mock('./ssh-relay-install-lock', () => ({ +vi.mock('./remote-install-lock', () => ({ RELAY_INSTALL_LOCK_NAME: '.install-lock', INSTALL_LOCK_STALE_MS: 20 * 60_000, INSTALL_LOCK_STALE_SECONDS: 20 * 60, isRelayInstallLockStale: vi.fn().mockResolvedValue(false) })) -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' import { gcOldOrcadVersions } from './orcad-remote-gc' import { emptyOrcadActivationRecord } from './orcad-activation-record' import { serializeOrcadActivationTransaction } from './orcad-activation-transaction' diff --git a/src/main/ssh/orcad-remote-gc.ts b/src/main/ssh/orcad-remote-gc.ts index 0d6cd9068e7..7f3132e6af7 100644 --- a/src/main/ssh/orcad-remote-gc.ts +++ b/src/main/ssh/orcad-remote-gc.ts @@ -14,7 +14,7 @@ * pinned too, and an unreadable journal skips the pass entirely. */ import type { OrcadHostTransport } from './orcad-host-transport' -import { execCommand, isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' +import { execCommand, isUnconfirmedSshCommandTermination } from './remote-exec-command' import { ORCAD_INSTALL_MODEL } from './remote-install-model' import { gcOldRemoteInstallVersions } from './remote-install-gc' import { orcadGcPinnedDirNames, type OrcadActivationRecord } from './orcad-activation-record' @@ -26,7 +26,7 @@ import { import { gcRemoteNodeRuntimeStore } from './remote-node-runtime-store-gc' import { readOrcadGcTransactionPins } from './orcad-gc-transaction-pins' import { isWindowsRemoteHost, joinRemotePath, type RemoteHostPlatform } from './ssh-remote-platform' -import { RELAY_REMOTE_DIR } from './relay-protocol' +import { RELAY_REMOTE_DIR } from './remote-frame-protocol' import { orcadWindowsHomeOpCommand } from './orcad-remote-windows-node' import { ORCAD_WINDOWS_LIVENESS_MANY_MARKER } from './orcad-windows-host-script' diff --git a/src/main/ssh/orcad-remote-install-termination.test.ts b/src/main/ssh/orcad-remote-install-termination.test.ts index ce84152b15b..845c3d8408c 100644 --- a/src/main/ssh/orcad-remote-install-termination.test.ts +++ b/src/main/ssh/orcad-remote-install-termination.test.ts @@ -1,15 +1,15 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) -vi.mock('./ssh-relay-install-lock', () => ({ +vi.mock('./remote-install-lock', () => ({ acquireInstallLock: vi.fn().mockResolvedValue(undefined), RELAY_INSTALL_LOCK_NAME: '.install-lock' })) -vi.mock('./ssh-relay-install-transfers', () => ({ +vi.mock('./remote-install-transfers', () => ({ uploadRelayDirectory: vi.fn(), writeRelayFile: vi.fn() })) @@ -18,12 +18,12 @@ vi.mock('./orcad-remote-node-runtime', () => ({ })) import type { OrcadHostTransport } from './orcad-host-transport' -import { execCommand } from './ssh-relay-exec-command' -import { uploadRelayDirectory, writeRelayFile } from './ssh-relay-install-transfers' +import { execCommand } from './remote-exec-command' +import { uploadRelayDirectory, writeRelayFile } from './remote-install-transfers' import { installOrcadBundle } from './orcad-remote-install' import { getRemoteHostPlatform } from './ssh-remote-platform' import { decodeRemotePowerShellScript } from './ssh-remote-powershell' -import { acquireInstallLock } from './ssh-relay-install-lock' +import { acquireInstallLock } from './remote-install-lock' import { initOrcadHeldFenceTokenFile, ORCAD_HELD_FENCE_TOKENS_FILE_NAME diff --git a/src/main/ssh/orcad-remote-install.ts b/src/main/ssh/orcad-remote-install.ts index ac02dfba5bd..fec878a0f1f 100644 --- a/src/main/ssh/orcad-remote-install.ts +++ b/src/main/ssh/orcad-remote-install.ts @@ -4,17 +4,17 @@ import { orcadAgentBrowserNativeName } from '../../shared/orcad-agent-browser-na 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-relay-exec-command' +import { execCommand, isUnconfirmedSshCommandTermination } from './remote-exec-command' import { shellEscape } from './ssh-connection-utils' import type { OrcadHostTransport } from './orcad-host-transport' import { joinRemotePath, type RemoteHostPlatform } from './ssh-remote-platform' import { ORCAD_INSTALL_MODEL } from './remote-install-model' -import { acquireInstallLock } from './ssh-relay-install-lock' +import { acquireInstallLock } from './remote-install-lock' import { ORCAD_FENCE_OWNER_FILENAME } from './orcad-activation-fence-scope' import { forgetHeldOrcadFence, rememberHeldOrcadFence } from './orcad-held-fence-tokens' import { exitedOwnLockProof } from './orcad-exited-own-lock' import { orcadWindowsBaseDir } from './orcad-remote-windows-node' -import { uploadRelayDirectory, writeRelayFile } from './ssh-relay-install-transfers' +import { uploadRelayDirectory, writeRelayFile } from './remote-install-transfers' import { abandonInstall, finalizeInstall, diff --git a/src/main/ssh/orcad-remote-launch.ts b/src/main/ssh/orcad-remote-launch.ts index c388d9d3214..e24f3658ee0 100644 --- a/src/main/ssh/orcad-remote-launch.ts +++ b/src/main/ssh/orcad-remote-launch.ts @@ -22,7 +22,7 @@ import { remoteDirname, type RemoteHostPlatform } from './ssh-remote-platform' -import { RELAY_REMOTE_DIR } from './relay-protocol' +import { RELAY_REMOTE_DIR } from './remote-frame-protocol' import { ORCAD_WSL_HOST_ENV } from '../ipc/wsl-guest-windows-drive-path' import { assertPosixOrcadHost as assertPosixHost, diff --git a/src/main/ssh/orcad-remote-lifecycle-windows.test.ts b/src/main/ssh/orcad-remote-lifecycle-windows.test.ts index 6c82fc093ad..37dde091cde 100644 --- a/src/main/ssh/orcad-remote-lifecycle-windows.test.ts +++ b/src/main/ssh/orcad-remote-lifecycle-windows.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import type * as TerminalBarrier from './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,15 +7,15 @@ import type * as TerminalBarrier from './orcad-rollback-terminal-barrier' import { beforeEach, describe, expect, it, vi } from 'vitest' import type * as RecordFile from './orcad-remote-record-file' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) -vi.mock('./ssh-relay-install-lock', () => ({ +vi.mock('./remote-install-lock', () => ({ acquireInstallLock: vi.fn().mockResolvedValue(undefined), RELAY_INSTALL_LOCK_NAME: '.install-lock' })) -vi.mock('./ssh-relay-install-transfers', () => ({ +vi.mock('./remote-install-transfers', () => ({ uploadRelayDirectory: vi.fn().mockResolvedValue(undefined), writeRelayFile: vi.fn().mockResolvedValue(undefined) })) @@ -50,7 +50,7 @@ vi.mock('./remote-versioned-install', async (importOriginal) => ({ abandonInstall: vi.fn().mockResolvedValue(undefined) })) -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' import { deployOrcad, type OrcadDeployOptions } from './orcad-remote-deploy' import { rollbackOrcad } from './orcad-remote-rollback' import { emptyOrcadActivationRecord } from './orcad-activation-record' diff --git a/src/main/ssh/orcad-remote-log-tail.test.ts b/src/main/ssh/orcad-remote-log-tail.test.ts index c7ce7155870..9db84999cbd 100644 --- a/src/main/ssh/orcad-remote-log-tail.test.ts +++ b/src/main/ssh/orcad-remote-log-tail.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './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 './orcad-windows-host-script' import { getRemoteHostPlatform } from './ssh-remote-platform' const execCommand = vi.hoisted(() => vi.fn()) -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand })) diff --git a/src/main/ssh/orcad-remote-log-tail.ts b/src/main/ssh/orcad-remote-log-tail.ts index 1329231a2cb..4a9569e6883 100644 --- a/src/main/ssh/orcad-remote-log-tail.ts +++ b/src/main/ssh/orcad-remote-log-tail.ts @@ -6,7 +6,7 @@ import { redactString } from '../observability/redactor' import { shellEscape } from './ssh-connection-utils' import { ORCAD_LOG_FILENAME } from './orcad-remote-host-support' -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' import { isWindowsRemoteHost, joinRemotePath, type RemoteHostPlatform } from './ssh-remote-platform' import { orcadWindowsSlotOpCommand, diff --git a/src/main/ssh/orcad-remote-node-runtime-promotion-lock.test.ts b/src/main/ssh/orcad-remote-node-runtime-promotion-lock.test.ts index de48d9516c2..6fcd43efd31 100644 --- a/src/main/ssh/orcad-remote-node-runtime-promotion-lock.test.ts +++ b/src/main/ssh/orcad-remote-node-runtime-promotion-lock.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' @@ -13,14 +13,14 @@ import { REMOTE_NODE_RUNTIME_READY } from './orcad-remote-node-runtime-report' import { RUNTIME_STORE_LOCK_NAME } from './remote-node-runtime-store-lock' -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' import { getRemoteHostPlatform } from './ssh-remote-platform' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) -vi.mock('./ssh-relay-install-transfers', () => ({ uploadRelayDirectory: vi.fn(async () => {}) })) +vi.mock('./remote-install-transfers', () => ({ uploadRelayDirectory: vi.fn(async () => {}) })) // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: every remote call goes through the mocked execCommand. const conn = {} as OrcadHostTransport diff --git a/src/main/ssh/orcad-remote-node-runtime-recorded-probe.test.ts b/src/main/ssh/orcad-remote-node-runtime-recorded-probe.test.ts index f6cb4ffab08..726fc3e4fd7 100644 --- a/src/main/ssh/orcad-remote-node-runtime-recorded-probe.test.ts +++ b/src/main/ssh/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-relay-exec-command' -import type * as ExecCommandModule from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { getRemoteHostPlatform } from './ssh-remote-platform' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) diff --git a/src/main/ssh/orcad-remote-node-runtime-report.ts b/src/main/ssh/orcad-remote-node-runtime-report.ts index 6e4e75eb7be..0fd882db0dd 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 './ssh-relay-host-answered-failure' +import { RelayHostAnsweredError } from './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/orcad-remote-node-runtime-slow-hash.test.ts b/src/main/ssh/orcad-remote-node-runtime-slow-hash.test.ts index 97489253b87..874d7a190d1 100644 --- a/src/main/ssh/orcad-remote-node-runtime-slow-hash.test.ts +++ b/src/main/ssh/orcad-remote-node-runtime-slow-hash.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' @@ -16,15 +16,15 @@ import { REMOTE_NODE_RUNTIME_VERIFIED_MARKER } from './orcad-remote-node-runtime-report' import { RUNTIME_STORE_LOCK_NAME, withRuntimeStoreLock } from './remote-node-runtime-store-lock' -import { execCommand } from './ssh-relay-exec-command' -import { uploadRelayDirectory } from './ssh-relay-install-transfers' +import { execCommand } from './remote-exec-command' +import { uploadRelayDirectory } from './remote-install-transfers' import { getRemoteHostPlatform } from './ssh-remote-platform' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) -vi.mock('./ssh-relay-install-transfers', () => ({ uploadRelayDirectory: vi.fn() })) +vi.mock('./remote-install-transfers', () => ({ uploadRelayDirectory: vi.fn() })) // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: every remote call goes through the mocked execCommand, which runs it in a local shell. const conn = {} as OrcadHostTransport diff --git a/src/main/ssh/orcad-remote-node-runtime-windows.test.ts b/src/main/ssh/orcad-remote-node-runtime-windows.test.ts index 08af5915ba7..cec4cbac54c 100644 --- a/src/main/ssh/orcad-remote-node-runtime-windows.test.ts +++ b/src/main/ssh/orcad-remote-node-runtime-windows.test.ts @@ -1,10 +1,10 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './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 './orcad-host-transport' -import { execCommand } from './ssh-relay-exec-command' -import { uploadRelayDirectory } from './ssh-relay-install-transfers' +import { execCommand } from './remote-exec-command' +import { uploadRelayDirectory } from './remote-install-transfers' import { ensureRemoteOrcadNodeRuntime, NODE_RUNTIME_PROMOTE_TIMEOUT_MS, @@ -25,11 +25,11 @@ import { import { getRemoteHostPlatform } from './ssh-remote-platform' import { decodeRemotePowerShellScript } from './ssh-remote-powershell' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) -vi.mock('./ssh-relay-install-transfers', () => ({ uploadRelayDirectory: vi.fn() })) +vi.mock('./remote-install-transfers', () => ({ uploadRelayDirectory: vi.fn() })) const host = getRemoteHostPlatform('win32-x64') const target = 'win32-x64' diff --git a/src/main/ssh/orcad-remote-node-runtime.ts b/src/main/ssh/orcad-remote-node-runtime.ts index 7ec73659897..0bc8e769576 100644 --- a/src/main/ssh/orcad-remote-node-runtime.ts +++ b/src/main/ssh/orcad-remote-node-runtime.ts @@ -24,8 +24,8 @@ import { } from '../../shared/orcad-artifacts' import type { OrcadHostTransport } from './orcad-host-transport' import { shellEscape } from './ssh-connection-utils' -import { execCommand, isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' -import { uploadRelayDirectory } from './ssh-relay-install-transfers' +import { execCommand, isUnconfirmedSshCommandTermination } from './remote-exec-command' +import { uploadRelayDirectory } from './remote-install-transfers' import { isWindowsRemoteHost, joinRemotePath, diff --git a/src/main/ssh/orcad-remote-preflight.ts b/src/main/ssh/orcad-remote-preflight.ts index a62dad47334..1b0a82adde0 100644 --- a/src/main/ssh/orcad-remote-preflight.ts +++ b/src/main/ssh/orcad-remote-preflight.ts @@ -15,7 +15,7 @@ import { import { readWindowsOrcadSlotEntry } from './orcad-remote-launch-windows' import { ORCAD_WINDOWS_RUNTIME_MARKER } from './orcad-windows-host-script' import { orcadNodeSlotRuntimeCommand, selectOrcadSlotEntryCommand } from './orcad-remote-runtime' -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' import { shellEscape } from './ssh-connection-utils' import { isWindowsRemoteHost, joinRemotePath, type RemoteHostPlatform } from './ssh-remote-platform' import type { OrcadHostTransport } from './orcad-host-transport' diff --git a/src/main/ssh/orcad-remote-primitives.test.ts b/src/main/ssh/orcad-remote-primitives.test.ts index a0412bfcefe..19050482b3d 100644 --- a/src/main/ssh/orcad-remote-primitives.test.ts +++ b/src/main/ssh/orcad-remote-primitives.test.ts @@ -1,7 +1,7 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn(), isUnconfirmedSshCommandTermination: (error: unknown) => @@ -11,7 +11,7 @@ vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ vi.mock('./ssh-remote-platform-detection', () => ({ detectRemoteHostPlatform: vi.fn() })) vi.mock('./orcad-windows-host-preparation', () => ({ prepareWindowsOrcadHost: vi.fn() })) -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' import { detectRemoteHostPlatform } from './ssh-remote-platform-detection' import { prepareWindowsOrcadHost } from './orcad-windows-host-preparation' import { resolveOrcadRemoteContext } from './orcad-remote-context' diff --git a/src/main/ssh/orcad-remote-record-file.ts b/src/main/ssh/orcad-remote-record-file.ts index caaf8c14c16..9cae66d293a 100644 --- a/src/main/ssh/orcad-remote-record-file.ts +++ b/src/main/ssh/orcad-remote-record-file.ts @@ -8,7 +8,7 @@ import { randomUUID } from 'node:crypto' import { shellEscape } from './ssh-connection-utils' import { removeRemoteFileCommand } from './ssh-remote-commands' import { execOrcadRemote, type OrcadRemoteExecTarget } from './orcad-remote-runtime-control' -import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' +import { isUnconfirmedSshCommandTermination } from './remote-exec-command' import { isWindowsRemoteHost } from './ssh-remote-platform' import { orcadRemoteBaseDir, diff --git a/src/main/ssh/orcad-remote-rollback.test.ts b/src/main/ssh/orcad-remote-rollback.test.ts index b9662fb3c52..f8ab1821a8f 100644 --- a/src/main/ssh/orcad-remote-rollback.test.ts +++ b/src/main/ssh/orcad-remote-rollback.test.ts @@ -1,19 +1,19 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './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 './ssh-relay-install-lock' +import type * as InstallLock from './remote-install-lock' import type * as TerminalBarrier from './orcad-rollback-terminal-barrier' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) vi.mock('./ssh-connection-utils', () => ({ shellEscape: (s: string) => `'${s}'` })) -vi.mock('./ssh-relay-install-transfers', () => ({ +vi.mock('./remote-install-transfers', () => ({ writeRelayFile: vi.fn().mockResolvedValue(undefined), uploadRelayDirectory: vi.fn().mockResolvedValue(undefined) })) -vi.mock('./ssh-relay-install-lock', async (importOriginal) => ({ +vi.mock('./remote-install-lock', async (importOriginal) => ({ ...(await importOriginal()), acquireInstallLock: vi.fn().mockResolvedValue(undefined) })) @@ -52,7 +52,7 @@ vi.mock('./orcad-rollback-terminal-barrier', async (importOriginal) => ({ } })) -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' import { writeAtomicOrcadRemoteRecord } from './orcad-remote-record-file' import { rollbackOrcad, type OrcadRollbackOptions } from './orcad-remote-rollback' import { emptyOrcadActivationRecord, type OrcadActivationRecord } from './orcad-activation-record' diff --git a/src/main/ssh/orcad-remote-runtime-control.test.ts b/src/main/ssh/orcad-remote-runtime-control.test.ts index 1afebadc505..b2f47f75cb9 100644 --- a/src/main/ssh/orcad-remote-runtime-control.test.ts +++ b/src/main/ssh/orcad-remote-runtime-control.test.ts @@ -1,14 +1,14 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn(), isUnconfirmedSshCommandTermination: (error: unknown) => error instanceof Error && error.message === 'unconfirmed' })) -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' import { launchOrcadAndAwaitReadiness } from './orcad-remote-runtime-control' import { getRemoteHostPlatform } from './ssh-remote-platform' import type { OrcadLaunchSpec } from './orcad-remote-launch' diff --git a/src/main/ssh/orcad-remote-runtime-control.ts b/src/main/ssh/orcad-remote-runtime-control.ts index 6a69de34bbc..258c0faed73 100644 --- a/src/main/ssh/orcad-remote-runtime-control.ts +++ b/src/main/ssh/orcad-remote-runtime-control.ts @@ -20,7 +20,7 @@ import { } from './orcad-remote-readiness-wait' import type { OrcadHostTransport } from './orcad-host-transport' import { errorMessage } from '../../shared/error-message' -import { execCommand, isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' +import { execCommand, isUnconfirmedSshCommandTermination } from './remote-exec-command' import { currentOrcadFence, isOrcadFenceLost, diff --git a/src/main/ssh/orcad-remote-windows-commands.test.ts b/src/main/ssh/orcad-remote-windows-commands.test.ts index c24d43e44e4..87a323bddfa 100644 --- a/src/main/ssh/orcad-remote-windows-commands.test.ts +++ b/src/main/ssh/orcad-remote-windows-commands.test.ts @@ -1,12 +1,12 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' import type { OrcadHostTransport } from './orcad-host-transport' import { getRemoteHostPlatform } from './ssh-remote-platform' import { orcadLivenessProbeCommand, type OrcadLaunchSpec } from './orcad-remote-launch' diff --git a/src/main/ssh/orcad-remote-windows-decommission.test.ts b/src/main/ssh/orcad-remote-windows-decommission.test.ts index 51f4e69064e..b7a0ad8c44b 100644 --- a/src/main/ssh/orcad-remote-windows-decommission.test.ts +++ b/src/main/ssh/orcad-remote-windows-decommission.test.ts @@ -3,16 +3,16 @@ * 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-relay-exec-command' +import type * as ExecCommandModule from './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 './ssh-relay-install-lock' +import type * as InstallLock from './remote-install-lock' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) -vi.mock('./ssh-relay-install-lock', async (importOriginal) => ({ +vi.mock('./remote-install-lock', async (importOriginal) => ({ ...(await importOriginal()), acquireInstallLock: vi.fn().mockResolvedValue(undefined) })) @@ -25,7 +25,7 @@ vi.mock('./remote-install-gc', async (importOriginal) => ({ gcOldRemoteInstallVersions: vi.fn().mockResolvedValue(undefined) })) -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './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/ssh/orcad-remote-windows-node.ts b/src/main/ssh/orcad-remote-windows-node.ts index e0f3f2ad704..336cc6f5967 100644 --- a/src/main/ssh/orcad-remote-windows-node.ts +++ b/src/main/ssh/orcad-remote-windows-node.ts @@ -19,8 +19,8 @@ import { import { pinnedNodeRuntimeAsset, type NodeRuntimeTarget } from '../../shared/node-runtime-pin' import { randomUUID } from 'node:crypto' import type { OrcadHostTransport } from './orcad-host-transport' -import { execCommand, isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' -import { RELAY_REMOTE_DIR } from './relay-protocol' +import { execCommand, isUnconfirmedSshCommandTermination } from './remote-exec-command' +import { RELAY_REMOTE_DIR } from './remote-frame-protocol' import { joinRemotePath, remoteDirname, type RemoteHostPlatform } from './ssh-remote-platform' import { quotePowerShellLiteral as powerShellLiteral } from '../../shared/powershell-native-argument' import { ORCAD_WINDOWS_COMMAND_LINE_UNSAFE_CODE } from '../orcad/orcad-host-unavailable' diff --git a/src/main/ssh/orcad-retained-fence-takeover.test.ts b/src/main/ssh/orcad-retained-fence-takeover.test.ts index d3fe57670dd..36df40569f9 100644 --- a/src/main/ssh/orcad-retained-fence-takeover.test.ts +++ b/src/main/ssh/orcad-retained-fence-takeover.test.ts @@ -7,8 +7,8 @@ import { orphanInstallLockCommand, tryCreateInstallLockCommand, tryStealInstallLockCommand -} from './ssh-relay-install-lock-commands' -import { INSTALL_LOCK_STALE_SECONDS } from './ssh-relay-install-lock' +} from './remote-install-lock-commands' +import { INSTALL_LOCK_STALE_SECONDS } from './remote-install-lock' import { getRemoteHostPlatform } from './ssh-remote-platform' const host = getRemoteHostPlatform(process.platform === 'darwin' ? 'darwin-arm64' : 'linux-x64') diff --git a/src/main/ssh/orcad-rollback-transition.ts b/src/main/ssh/orcad-rollback-transition.ts index 7e59c2ddfe5..cdbd1d9140d 100644 --- a/src/main/ssh/orcad-rollback-transition.ts +++ b/src/main/ssh/orcad-rollback-transition.ts @@ -2,7 +2,7 @@ import { orcadRemoteBaseDir } from './orcad-remote-windows-node' import { randomUUID } from 'node:crypto' import type { OrcadRollbackOptions, OrcadRollbackResult } from './orcad-remote-rollback' -import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' +import { isUnconfirmedSshCommandTermination } from './remote-exec-command' import { withRolledBackVersion } from './orcad-activation-record' import { writeOrcadActivationRecord } from './orcad-activation-record-store' import { launchAndJudgeOrcadSlot } from './orcad-candidate-launch-verdict' diff --git a/src/main/ssh/orcad-runtime-conversion-wiring.ts b/src/main/ssh/orcad-runtime-conversion-wiring.ts index 47aa7419b8f..055373aa0dd 100644 --- a/src/main/ssh/orcad-runtime-conversion-wiring.ts +++ b/src/main/ssh/orcad-runtime-conversion-wiring.ts @@ -14,7 +14,7 @@ import { stageRemoteOrcadMigrationCatalog, stageRemoteOrcadMigrationSnapshotChunk } from './orcad-migration-catalog-client' -import { censusHostRelayTerminalsFor } from './ssh-host-relay-census-for-target' +import { censusHostRelayTerminalsFor } from './legacy-relay/ssh-host-relay-census-for-target' import type { OrcadManagedConversionArgs } from './orcad-runtime-conversion' import type { OrcadServerRepository } from './orcad-migration-repository-link' import { diff --git a/src/main/ssh/orcad-runtime-decommission.ts b/src/main/ssh/orcad-runtime-decommission.ts index 25d2e619ae4..115654f0c55 100644 --- a/src/main/ssh/orcad-runtime-decommission.ts +++ b/src/main/ssh/orcad-runtime-decommission.ts @@ -29,7 +29,7 @@ import { removeOrcadMigrationJournalsForDestination } from './orcad-migration-cu import { decommissionRemoteOrcad } from './orcad-remote-decommission' import { withManagedOrcadLifecycle } from './orcad-runtime-maintenance' import { collectManagedTerminalCensus } from './orcad-terminal-census-client' -import { RemoteInstallLockBusyError } from './ssh-relay-install-lock' +import { RemoteInstallLockBusyError } from './remote-install-lock' export type ManagedOrcadStopPolicy = { isActiveEnvironment: (environmentId: string) => boolean diff --git a/src/main/ssh/orcad-runtime-target.test.ts b/src/main/ssh/orcad-runtime-target.test.ts index 94ce9f3e73a..f2353532860 100644 --- a/src/main/ssh/orcad-runtime-target.test.ts +++ b/src/main/ssh/orcad-runtime-target.test.ts @@ -1,12 +1,12 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' import { resolveOrcadRuntimeTarget } from './orcad-runtime-target' import { SshConnection } from './ssh-connection' import { createCallbacks, createTarget } from './ssh-connection-test-fixtures' -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' import { getRemoteHostPlatform } from './ssh-remote-platform' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) diff --git a/src/main/ssh/orcad-state-mutation-exec.test.ts b/src/main/ssh/orcad-state-mutation-exec.test.ts index c872ae11613..fb503ec4877 100644 --- a/src/main/ssh/orcad-state-mutation-exec.test.ts +++ b/src/main/ssh/orcad-state-mutation-exec.test.ts @@ -7,7 +7,7 @@ import { execOrcadStateMutationOr } from './orcad-state-mutation-exec' import { execOrcadRemoteOr } from './orcad-remote-runtime-control' -import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' +import { isUnconfirmedSshCommandTermination } from './remote-exec-command' import { getRemoteHostPlatform } from './ssh-remote-platform' import type { OrcadHostTransport } from './orcad-host-transport' diff --git a/src/main/ssh/orcad-state-mutation-exec.ts b/src/main/ssh/orcad-state-mutation-exec.ts index 7a74bb1798e..e9b1a1143ce 100644 --- a/src/main/ssh/orcad-state-mutation-exec.ts +++ b/src/main/ssh/orcad-state-mutation-exec.ts @@ -12,7 +12,7 @@ import { ORCAD_STATE_MUTATION_DEADLINE } from './orcad-state-snapshot-members' import type { OrcadRemoteExecTarget } from './orcad-remote-runtime-control' -import { execCommand, isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' +import { execCommand, isUnconfirmedSshCommandTermination } from './remote-exec-command' import { isOrcadFenceLost, OrcadFenceLostError } from './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/ssh/orcad-state-mutation-fence-heartbeat.test.ts b/src/main/ssh/orcad-state-mutation-fence-heartbeat.test.ts index fdc44d078a7..7804f4e33d5 100644 --- a/src/main/ssh/orcad-state-mutation-fence-heartbeat.test.ts +++ b/src/main/ssh/orcad-state-mutation-fence-heartbeat.test.ts @@ -19,7 +19,7 @@ import { RELAY_INSTALL_LOCK_NAME } from '../../shared/relay-install-lock-name' import { ORCAD_ACTIVATION_TRANSACTION_DIRNAME } from './orcad-activation-transaction' import { serializedStateMutationCommand } from './orcad-state-snapshot' import { ORCAD_FENCE_OWNER_FILENAME } from './orcad-activation-fence-scope' -import { tryStealInstallLockCommand } from './ssh-relay-install-lock-commands' +import { tryStealInstallLockCommand } from './remote-install-lock-commands' import { getRemoteHostPlatform } from './ssh-remote-platform' const posix = getRemoteHostPlatform('linux-x64') diff --git a/src/main/ssh/orcad-state-mutation-timeout.test.ts b/src/main/ssh/orcad-state-mutation-timeout.test.ts index e9000e56b67..991831858f3 100644 --- a/src/main/ssh/orcad-state-mutation-timeout.test.ts +++ b/src/main/ssh/orcad-state-mutation-timeout.test.ts @@ -5,17 +5,17 @@ * 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-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import type * as RecordFile from './orcad-remote-record-file' -import type * as InstallLock from './ssh-relay-install-lock' +import type * as InstallLock from './remote-install-lock' import type * as VersionedInstall from './remote-versioned-install' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) vi.mock('./ssh-connection-utils', () => ({ shellEscape: (s: string) => `'${s}'` })) -vi.mock('./ssh-relay-install-lock', async (importOriginal) => ({ +vi.mock('./remote-install-lock', async (importOriginal) => ({ ...(await importOriginal()), acquireInstallLock: vi.fn() })) @@ -37,8 +37,8 @@ import { execCommand, SSH_EXEC_TIMEOUT_CODE, isUnconfirmedSshCommandTermination -} from './ssh-relay-exec-command' -import { acquireInstallLock } from './ssh-relay-install-lock' +} from './remote-exec-command' +import { acquireInstallLock } from './remote-install-lock' import { writeAtomicOrcadRemoteRecord } from './orcad-remote-record-file' import { deployOrcad } from './orcad-remote-deploy' import { rollbackOrcad } from './orcad-remote-rollback' @@ -127,9 +127,8 @@ beforeEach(() => { vi.mocked(execCommand).mockImplementation(async (_conn, command) => exec(command)) vi.mocked(acquireInstallLock).mockImplementation(async (_conn, dir, _host, options) => { if (!host.acquireFence(options)) { - const { RemoteInstallLockBusyError } = await vi.importActual( - './ssh-relay-install-lock' - ) + const { RemoteInstallLockBusyError } = + await vi.importActual('./remote-install-lock') throw new RemoteInstallLockBusyError(dir, 0) } }) diff --git a/src/main/ssh/orcad-stdio-bridge-script.ts b/src/main/ssh/orcad-stdio-bridge-script.ts index 0aa3e69a76e..42138b5d1a2 100644 --- a/src/main/ssh/orcad-stdio-bridge-script.ts +++ b/src/main/ssh/orcad-stdio-bridge-script.ts @@ -14,7 +14,7 @@ import { ORCAD_RUNTIMES_DIRNAME } from '../../shared/orcad-artifacts' import { shellEscape } from './ssh-connection-utils' -import { RELAY_REMOTE_DIR } from './relay-protocol' +import { RELAY_REMOTE_DIR } from './remote-frame-protocol' import { ORCAD_MACHINE_HOMES_DIRNAME } from './orcad-machine-home' export type OrcadStdioBridgeMode = 'raw' | 'base64' diff --git a/src/main/ssh/relay-bundle-paths.ts b/src/main/ssh/relay-bundle-paths.ts index d859c4df2c1..c43ef6541bb 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 './relay-protocol' +import type { RelayPlatform } from './remote-frame-protocol' function currentAppPath(): string | undefined { try { diff --git a/src/main/ssh/ssh-relay-deploy-timing.ts b/src/main/ssh/remote-deploy-timing.ts similarity index 100% rename from src/main/ssh/ssh-relay-deploy-timing.ts rename to src/main/ssh/remote-deploy-timing.ts diff --git a/src/main/ssh/ssh-relay-exec-closed-stdin.test.ts b/src/main/ssh/remote-exec-closed-stdin.test.ts similarity index 97% rename from src/main/ssh/ssh-relay-exec-closed-stdin.test.ts rename to src/main/ssh/remote-exec-closed-stdin.test.ts index b2b7ee77668..3f010d4dff4 100644 --- a/src/main/ssh/ssh-relay-exec-closed-stdin.test.ts +++ b/src/main/ssh/remote-exec-closed-stdin.test.ts @@ -1,7 +1,7 @@ import { Duplex, PassThrough, Readable } from 'node:stream' import { describe, expect, it, vi } from 'vitest' import type { RemoteCommandChannel } from './remote-install-transport' -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' function answering(output: string): RemoteCommandChannel { const channel = new Duplex({ diff --git a/src/main/ssh/ssh-relay-exec-command.test.ts b/src/main/ssh/remote-exec-command.test.ts similarity index 99% rename from src/main/ssh/ssh-relay-exec-command.test.ts rename to src/main/ssh/remote-exec-command.test.ts index f4cfebe464f..cf10d7bd80e 100644 --- a/src/main/ssh/ssh-relay-exec-command.test.ts +++ b/src/main/ssh/remote-exec-command.test.ts @@ -1,7 +1,7 @@ import { EventEmitter } from 'node:events' import { describe, expect, it, vi } from 'vitest' import type { ClientChannel } from 'ssh2' -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' type MockChannel = ClientChannel & { stdin: EventEmitter & { write: ReturnType } diff --git a/src/main/ssh/ssh-relay-exec-command.ts b/src/main/ssh/remote-exec-command.ts similarity index 99% rename from src/main/ssh/ssh-relay-exec-command.ts rename to src/main/ssh/remote-exec-command.ts index 56c17332854..1410f1ac4b2 100644 --- a/src/main/ssh/ssh-relay-exec-command.ts +++ b/src/main/ssh/remote-exec-command.ts @@ -4,7 +4,7 @@ import { createSshOperationAbortError, type SshExecOptions } from './ssh-connect import { redactRelayInstallMarkerError, redactRelayInstallMarkerTokens -} from './ssh-relay-install-marker' +} from './remote-install-marker' import type { SystemSshCommandChannel } from './system-ssh-command' import { buildPosixStdoutFence } from '../../shared/posix-stdout-fence' diff --git a/src/main/ssh/ssh-relay-exec-input.test.ts b/src/main/ssh/remote-exec-input.test.ts similarity index 97% rename from src/main/ssh/ssh-relay-exec-input.test.ts rename to src/main/ssh/remote-exec-input.test.ts index c5b6ffdeeb1..b6fbe50f0da 100644 --- a/src/main/ssh/ssh-relay-exec-input.test.ts +++ b/src/main/ssh/remote-exec-input.test.ts @@ -1,7 +1,7 @@ import { EventEmitter } from 'node:events' import { PassThrough, Readable } from 'node:stream' import { describe, expect, it, vi } from 'vitest' -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' const { spawnMock } = vi.hoisted(() => ({ spawnMock: vi.fn() })) vi.mock('node:child_process', () => ({ spawn: spawnMock })) diff --git a/src/main/ssh/relay-protocol.test.ts b/src/main/ssh/remote-frame-protocol.test.ts similarity index 99% rename from src/main/ssh/relay-protocol.test.ts rename to src/main/ssh/remote-frame-protocol.test.ts index bf695fb24e1..52a4e1ff5dc 100644 --- a/src/main/ssh/relay-protocol.test.ts +++ b/src/main/ssh/remote-frame-protocol.test.ts @@ -8,7 +8,7 @@ import { parseJsonRpcMessage, parseUnameToRelayPlatform, type JsonRpcRequest -} from './relay-protocol' +} from './remote-frame-protocol' describe('frame encoding', () => { it('encodes a frame with 13-byte header', () => { diff --git a/src/main/ssh/relay-protocol.ts b/src/main/ssh/remote-frame-protocol.ts similarity index 100% rename from src/main/ssh/relay-protocol.ts rename to src/main/ssh/remote-frame-protocol.ts diff --git a/src/main/ssh/ssh-relay-answered-failure-producers.test.ts b/src/main/ssh/remote-host-answered-failure-producers.test.ts similarity index 99% rename from src/main/ssh/ssh-relay-answered-failure-producers.test.ts rename to src/main/ssh/remote-host-answered-failure-producers.test.ts index 306e5f0cd78..a674c8836a1 100644 --- a/src/main/ssh/ssh-relay-answered-failure-producers.test.ts +++ b/src/main/ssh/remote-host-answered-failure-producers.test.ts @@ -17,7 +17,7 @@ import { assertRemoteNodeRuntimePromoted } from './orcad-remote-node-runtime-report' import { remoteNodeRuntimePresentCommand } from './orcad-remote-node-runtime' -import { isAnsweredHostFailure } from './ssh-relay-host-answered-failure' +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' diff --git a/src/main/ssh/ssh-relay-host-answered-failure.test.ts b/src/main/ssh/remote-host-answered-failure.test.ts similarity index 95% rename from src/main/ssh/ssh-relay-host-answered-failure.test.ts rename to src/main/ssh/remote-host-answered-failure.test.ts index f2622ee944a..12530328524 100644 --- a/src/main/ssh/ssh-relay-host-answered-failure.test.ts +++ b/src/main/ssh/remote-host-answered-failure.test.ts @@ -3,8 +3,8 @@ import { RemoteNodeRuntimeSecurityModifiedError, RemoteNodeRuntimeSelfTestError } from './orcad-remote-node-runtime-report' -import { isAnsweredHostFailure, RelayHostAnsweredError } from './ssh-relay-host-answered-failure' -import { SSH_EXEC_TIMEOUT_CODE } from './ssh-relay-exec-command' +import { isAnsweredHostFailure, RelayHostAnsweredError } from './remote-host-answered-failure' +import { SSH_EXEC_TIMEOUT_CODE } from './remote-exec-command' import { SystemSshCommandExitError } from './system-ssh-operation-lifecycle' const exitError = (code: number, message: string): Error => diff --git a/src/main/ssh/ssh-relay-host-answered-failure.ts b/src/main/ssh/remote-host-answered-failure.ts similarity index 96% rename from src/main/ssh/ssh-relay-host-answered-failure.ts rename to src/main/ssh/remote-host-answered-failure.ts index 1bfd575a69f..119820c7363 100644 --- a/src/main/ssh/ssh-relay-host-answered-failure.ts +++ b/src/main/ssh/remote-host-answered-failure.ts @@ -3,7 +3,7 @@ * verdict on that rung, so the ladder steps down; an unanswered one says nothing about the host, * so the connect fails retryably and never launches a second relay beside one that may be running. */ -import { isSshCommandExitError } from './ssh-relay-exec-command' +import { isSshCommandExitError } from './remote-exec-command' import { isSshSessionLimitError } from './ssh-session-limit-error' import { isHostAnsweredSystemSshExit, diff --git a/src/main/ssh/ssh-relay-host-exec.ts b/src/main/ssh/remote-host-exec.ts similarity index 91% rename from src/main/ssh/ssh-relay-host-exec.ts rename to src/main/ssh/remote-host-exec.ts index 96545521a28..1db277ec55c 100644 --- a/src/main/ssh/ssh-relay-host-exec.ts +++ b/src/main/ssh/remote-host-exec.ts @@ -1,5 +1,5 @@ import type { RemoteInstallTransport } from './remote-install-transport' -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' import type { RemoteHostPlatform } from './ssh-remote-platform' export function execHostCommand( diff --git a/src/main/ssh/ssh-relay-gc-claim-termination.test.ts b/src/main/ssh/remote-install-gc-claim-termination.test.ts similarity index 97% rename from src/main/ssh/ssh-relay-gc-claim-termination.test.ts rename to src/main/ssh/remote-install-gc-claim-termination.test.ts index 7e23d980f21..16332adc9f4 100644 --- a/src/main/ssh/ssh-relay-gc-claim-termination.test.ts +++ b/src/main/ssh/remote-install-gc-claim-termination.test.ts @@ -1,20 +1,20 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) import type { SshConnection } from './ssh-connection' -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' import { isRelayGcClaimOwned, releaseRelayGcClaim, releaseRelayGcClaimWithRetry, tryAcquireRelayGcClaim, waitForRelayGcClaimRelease -} from './ssh-relay-gc-claim' +} from './remote-install-gc-claim' import { getRemoteHostPlatform } from './ssh-remote-platform' // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: The mocked execCommand never reads the connection. diff --git a/src/main/ssh/ssh-relay-gc-claim.ts b/src/main/ssh/remote-install-gc-claim.ts similarity index 97% rename from src/main/ssh/ssh-relay-gc-claim.ts rename to src/main/ssh/remote-install-gc-claim.ts index aa71589c7f5..fb1ef66abd2 100644 --- a/src/main/ssh/ssh-relay-gc-claim.ts +++ b/src/main/ssh/remote-install-gc-claim.ts @@ -1,13 +1,13 @@ import { randomUUID } from 'node:crypto' import type { RemoteInstallTransport } from './remote-install-transport' import { shellEscape } from './ssh-connection-utils' -import { execHostCommand } from './ssh-relay-host-exec' -import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' +import { execHostCommand } from './remote-host-exec' +import { isUnconfirmedSshCommandTermination } from './remote-exec-command' import { probeInstallLockExistsCommand, tryCreateInstallLockCommand, tryStealInstallLockCommand -} from './ssh-relay-install-lock-commands' +} from './remote-install-lock-commands' import { removeRemoteTreeCommand } from './ssh-remote-commands' import { powerShellCommand } from './ssh-remote-powershell' import { quotePowerShellLiteral as powerShellLiteral } from '../../shared/powershell-native-argument' diff --git a/src/main/ssh/ssh-relay-gc-listing.test-fixture.ts b/src/main/ssh/remote-install-gc-listing.test-fixture.ts similarity index 98% rename from src/main/ssh/ssh-relay-gc-listing.test-fixture.ts rename to src/main/ssh/remote-install-gc-listing.test-fixture.ts index 9ec49d96667..86dd95b0b91 100644 --- a/src/main/ssh/ssh-relay-gc-listing.test-fixture.ts +++ b/src/main/ssh/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-connection' import { shellEscape } from './ssh-connection-utils' -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' export const SSH_EXEC_OUTPUT_CAP_CHARS = 1024 * 1024 diff --git a/src/main/ssh/remote-install-gc-termination.test.ts b/src/main/ssh/remote-install-gc-termination.test.ts index e1be22505f6..3e1d4f06442 100644 --- a/src/main/ssh/remote-install-gc-termination.test.ts +++ b/src/main/ssh/remote-install-gc-termination.test.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -9,7 +9,7 @@ vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ import type { SshConnection } from './ssh-connection' import { gcOldRemoteInstallVersions } from './remote-install-gc' import { ORCAD_INSTALL_MODEL } from './remote-install-model' -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' import { getRemoteHostPlatform } from './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/ssh/remote-install-gc-tombstone.ts b/src/main/ssh/remote-install-gc-tombstone.ts index 7e37c1c2d72..46ae86a48ff 100644 --- a/src/main/ssh/remote-install-gc-tombstone.ts +++ b/src/main/ssh/remote-install-gc-tombstone.ts @@ -1,5 +1,5 @@ import type { RemoteInstallTransport } from './remote-install-transport' -import { execCommand, isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' +import { execCommand, isUnconfirmedSshCommandTermination } from './remote-exec-command' import { remoteInstallGcTombstoneRegex, type RemoteInstallModel } from './remote-install-model' import { removeRemoteTreeCommand } from './ssh-remote-commands' import { diff --git a/src/main/ssh/remote-install-gc.ts b/src/main/ssh/remote-install-gc.ts index 0bfa0e4acfd..4c2a4fe13df 100644 --- a/src/main/ssh/remote-install-gc.ts +++ b/src/main/ssh/remote-install-gc.ts @@ -6,10 +6,10 @@ * until the relay-era upgrade window closes. */ import type { RemoteInstallTransport } from './remote-install-transport' -import { RELAY_REMOTE_DIR } from './relay-protocol' -import { execHostCommand } from './ssh-relay-host-exec' -import { probeInstallLockExistsCommand } from './ssh-relay-install-lock-commands' -import { isRelayInstallLockStale, RELAY_INSTALL_LOCK_NAME } from './ssh-relay-install-lock' +import { RELAY_REMOTE_DIR } from './remote-frame-protocol' +import { execHostCommand } from './remote-host-exec' +import { probeInstallLockExistsCommand } from './remote-install-lock-commands' +import { isRelayInstallLockStale, RELAY_INSTALL_LOCK_NAME } from './remote-install-lock' import { remoteInstallGcPermits, remoteInstallVersionDirRegex, @@ -19,7 +19,7 @@ import { isRelayGcClaimOwned, releaseRelayGcClaimWithRetry, tryAcquireRelayGcClaim -} from './ssh-relay-gc-claim' +} from './remote-install-gc-claim' import { cleanupRemoteInstallGcTombstones } from './remote-install-gc-tombstone' import { listRemoteInstallBaseDirsCommand, @@ -34,7 +34,7 @@ import { remoteBasename, type RemoteHostPlatform } from './ssh-remote-platform' -import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' +import { isUnconfirmedSshCommandTermination } from './remote-exec-command' const DEFAULT_REMOTE_HOST = getRemoteHostPlatform('linux-x64') diff --git a/src/main/ssh/ssh-relay-install-lock-commands.ts b/src/main/ssh/remote-install-lock-commands.ts similarity index 99% rename from src/main/ssh/ssh-relay-install-lock-commands.ts rename to src/main/ssh/remote-install-lock-commands.ts index cd8501e05b5..09b040da8c8 100644 --- a/src/main/ssh/ssh-relay-install-lock-commands.ts +++ b/src/main/ssh/remote-install-lock-commands.ts @@ -2,7 +2,7 @@ import { shellEscape } from './ssh-connection-utils' import { powerShellCommand } from './ssh-remote-powershell' import { quotePowerShellLiteral as powerShellLiteral } from '../../shared/powershell-native-argument' import { isWindowsRemoteHost, type RemoteHostPlatform } from './ssh-remote-platform' -import * as exitedOwnerSteal from './ssh-relay-install-lock-exited-owner' +import * as exitedOwnerSteal from './remote-install-lock-exited-owner' const INSTALL_LOCK_BOOT_ID_NAME = '.boot-id' diff --git a/src/main/ssh/ssh-relay-install-lock-exited-owner.test.ts b/src/main/ssh/remote-install-lock-exited-owner.test.ts similarity index 98% rename from src/main/ssh/ssh-relay-install-lock-exited-owner.test.ts rename to src/main/ssh/remote-install-lock-exited-owner.test.ts index 21e04314e69..09eb728584a 100644 --- a/src/main/ssh/ssh-relay-install-lock-exited-owner.test.ts +++ b/src/main/ssh/remote-install-lock-exited-owner.test.ts @@ -12,7 +12,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' import { runProcess } from '@orca/process-host' -import { tryStealInstallLockCommand } from './ssh-relay-install-lock-commands' +import { tryStealInstallLockCommand } from './remote-install-lock-commands' import { decodeRemotePowerShellScript } from './ssh-remote-powershell' import { getRemoteHostPlatform, type RemoteHostPlatform } from './ssh-remote-platform' diff --git a/src/main/ssh/ssh-relay-install-lock-exited-owner.ts b/src/main/ssh/remote-install-lock-exited-owner.ts similarity index 98% rename from src/main/ssh/ssh-relay-install-lock-exited-owner.ts rename to src/main/ssh/remote-install-lock-exited-owner.ts index 4a425c3ad97..a6a35ede0c1 100644 --- a/src/main/ssh/ssh-relay-install-lock-exited-owner.ts +++ b/src/main/ssh/remote-install-lock-exited-owner.ts @@ -3,7 +3,7 @@ * claim, `*ClaimCheck` inside it, and `*Release` where the claim is cleaned up. */ import { shellEscape } from './ssh-connection-utils' -import type { InstallLockOwnerFile } from './ssh-relay-install-lock-commands' +import type { InstallLockOwnerFile } from './remote-install-lock-commands' import { quotePowerShellLiteral as powerShellLiteral } from '../../shared/powershell-native-argument' import { posixStateMutationGroupRecord, diff --git a/src/main/ssh/ssh-relay-install-lock-termination.test.ts b/src/main/ssh/remote-install-lock-termination.test.ts similarity index 94% rename from src/main/ssh/ssh-relay-install-lock-termination.test.ts rename to src/main/ssh/remote-install-lock-termination.test.ts index 01f1b45ff45..640c9203110 100644 --- a/src/main/ssh/ssh-relay-install-lock-termination.test.ts +++ b/src/main/ssh/remote-install-lock-termination.test.ts @@ -1,14 +1,14 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) import type { SshConnection } from './ssh-connection' -import { execCommand } from './ssh-relay-exec-command' -import { acquireInstallLock, isRelayInstallLockStale } from './ssh-relay-install-lock' +import { execCommand } from './remote-exec-command' +import { acquireInstallLock, isRelayInstallLockStale } from './remote-install-lock' import { getRemoteHostPlatform } from './ssh-remote-platform' // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: The mocked execCommand never reads the connection. diff --git a/src/main/ssh/ssh-relay-install-lock.test.ts b/src/main/ssh/remote-install-lock.test.ts similarity index 92% rename from src/main/ssh/ssh-relay-install-lock.test.ts rename to src/main/ssh/remote-install-lock.test.ts index b5ed1ad729f..bd2ae912f71 100644 --- a/src/main/ssh/ssh-relay-install-lock.test.ts +++ b/src/main/ssh/remote-install-lock.test.ts @@ -1,8 +1,8 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { afterEach, describe, expect, it, vi } from 'vitest' import type { SshConnection } from './ssh-connection' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn(), isUnconfirmedSshCommandTermination: (error: unknown) => @@ -10,13 +10,13 @@ vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ (error as Error & { sshChannelCloseConfirmed?: boolean }).sshChannelCloseConfirmed === false })) -vi.mock('./ssh-relay-gc-claim', () => ({ +vi.mock('./remote-install-gc-claim', () => ({ isRelayGcClaimed: vi.fn().mockResolvedValue(false), waitForRelayGcClaimRelease: vi.fn().mockResolvedValue(undefined) })) -import { execCommand } from './ssh-relay-exec-command' -import { acquireInstallLock, RemoteInstallLockBusyError } from './ssh-relay-install-lock' +import { execCommand } from './remote-exec-command' +import { acquireInstallLock, RemoteInstallLockBusyError } from './remote-install-lock' import { getRemoteHostPlatform } from './ssh-remote-platform' describe('acquireInstallLock', () => { diff --git a/src/main/ssh/ssh-relay-install-lock.ts b/src/main/ssh/remote-install-lock.ts similarity index 96% rename from src/main/ssh/ssh-relay-install-lock.ts rename to src/main/ssh/remote-install-lock.ts index 2878ae37353..d340c2a3877 100644 --- a/src/main/ssh/ssh-relay-install-lock.ts +++ b/src/main/ssh/remote-install-lock.ts @@ -1,16 +1,16 @@ import type { RemoteInstallTransport } from './remote-install-transport' -import { execHostCommand } from './ssh-relay-host-exec' -import { RELAY_DEPLOY_TIMEOUT_MS } from './ssh-relay-deploy-timing' -import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' -import { isRelayGcClaimed, waitForRelayGcClaimRelease } from './ssh-relay-gc-claim' +import { execHostCommand } from './remote-host-exec' +import { RELAY_DEPLOY_TIMEOUT_MS } from './remote-deploy-timing' +import { isUnconfirmedSshCommandTermination } from './remote-exec-command' +import { isRelayGcClaimed, waitForRelayGcClaimRelease } from './remote-install-gc-claim' import { acquireInstallLockParentCommand, lockAgeSecondsCommand, tryCreateInstallLockCommand, tryStealInstallLockCommand, type InstallLockOwnerFile -} from './ssh-relay-install-lock-commands' -import type { InstallLockExitedOwner } from './ssh-relay-install-lock-exited-owner' +} from './remote-install-lock-commands' +import type { InstallLockExitedOwner } from './remote-install-lock-exited-owner' import { getRemoteHostPlatform, joinRemotePath, diff --git a/src/main/ssh/ssh-relay-install-marker.ts b/src/main/ssh/remote-install-marker.ts similarity index 100% rename from src/main/ssh/ssh-relay-install-marker.ts rename to src/main/ssh/remote-install-marker.ts diff --git a/src/main/ssh/ssh-relay-install-noisy-sftp-wire.test.ts b/src/main/ssh/remote-install-noisy-sftp-wire.test.ts similarity index 98% rename from src/main/ssh/ssh-relay-install-noisy-sftp-wire.test.ts rename to src/main/ssh/remote-install-noisy-sftp-wire.test.ts index b0d93ee0e9a..9a21135f5cf 100644 --- a/src/main/ssh/ssh-relay-install-noisy-sftp-wire.test.ts +++ b/src/main/ssh/remote-install-noisy-sftp-wire.test.ts @@ -6,7 +6,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { SshTarget } from '../../shared/ssh-types' import { spawnProcess } from '@orca/process-host' import { SshConnection } from './ssh-connection' -import { uploadRelayDirectory, writeRelayFile } from './ssh-relay-install-transfers' +import { uploadRelayDirectory, writeRelayFile } from './remote-install-transfers' import { getRemoteHostPlatform } from './ssh-remote-platform' type NoisyHost = { port: number; subsystems: number; execs: number; close: () => Promise } diff --git a/src/main/ssh/ssh-relay-install-transfers-exec-fallback.test.ts b/src/main/ssh/remote-install-transfers-exec-fallback.test.ts similarity index 99% rename from src/main/ssh/ssh-relay-install-transfers-exec-fallback.test.ts rename to src/main/ssh/remote-install-transfers-exec-fallback.test.ts index 642163e8aa3..c77bef2907a 100644 --- a/src/main/ssh/ssh-relay-install-transfers-exec-fallback.test.ts +++ b/src/main/ssh/remote-install-transfers-exec-fallback.test.ts @@ -9,7 +9,7 @@ import { classifySftpFailureForExecFallback, uploadRelayDirectory, writeRelayFile -} from './ssh-relay-install-transfers' +} from './remote-install-transfers' import { getRemoteHostPlatform } from './ssh-remote-platform' import { tagSftpHandshakeCorruption } from './sftp-handshake-corruption' diff --git a/src/main/ssh/ssh-relay-install-transfers.ts b/src/main/ssh/remote-install-transfers.ts similarity index 98% rename from src/main/ssh/ssh-relay-install-transfers.ts rename to src/main/ssh/remote-install-transfers.ts index 8202e9bcb27..6085e327b11 100644 --- a/src/main/ssh/ssh-relay-install-transfers.ts +++ b/src/main/ssh/remote-install-transfers.ts @@ -8,7 +8,7 @@ import { uploadDirectoryViaExecStdin, writeStringViaExecStdin } from './ssh-exec-stdin-file-transfer' -import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' +import { isUnconfirmedSshCommandTermination } from './remote-exec-command' import { describeSandboxedSftpFailure, isSandboxedSftpNamespaceError diff --git a/src/main/ssh/remote-node-runtime-store-gc.test.ts b/src/main/ssh/remote-node-runtime-store-gc.test.ts index d200871a582..4c3dde22112 100644 --- a/src/main/ssh/remote-node-runtime-store-gc.test.ts +++ b/src/main/ssh/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-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./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-relay-exec-command' +import { execCommand } from './remote-exec-command' import { getRemoteHostPlatform } from './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/ssh/remote-node-runtime-store-gc.ts b/src/main/ssh/remote-node-runtime-store-gc.ts index c4056f67102..864354338a0 100644 --- a/src/main/ssh/remote-node-runtime-store-gc.ts +++ b/src/main/ssh/remote-node-runtime-store-gc.ts @@ -28,8 +28,8 @@ import { tryWithRuntimeStoreLock } from './remote-node-runtime-store-lock' import { shellEscape } from './ssh-connection-utils' -import { execCommand, isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' -import { INSTALL_LOCK_STALE_MS } from './ssh-relay-install-lock' +import { execCommand, isUnconfirmedSshCommandTermination } from './remote-exec-command' +import { INSTALL_LOCK_STALE_MS } from './remote-install-lock' import { moveRemoteTreeCommand, removeRemoteTreeCommand, diff --git a/src/main/ssh/remote-node-runtime-store-inventory.ts b/src/main/ssh/remote-node-runtime-store-inventory.ts index 2c62dd4bb2a..f39f68b6551 100644 --- a/src/main/ssh/remote-node-runtime-store-inventory.ts +++ b/src/main/ssh/remote-node-runtime-store-inventory.ts @@ -8,7 +8,7 @@ import { ORCAD_RUNTIMES_DIRNAME } from '../../shared/orcad-artifacts' import { shellEscape } from './ssh-connection-utils' -import { RELAY_REMOTE_DIR } from './relay-protocol' +import { RELAY_REMOTE_DIR } from './remote-frame-protocol' import { joinRemotePath, type RemoteHostPlatform } from './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/ssh/remote-node-runtime-store-lock-host-release.test.ts b/src/main/ssh/remote-node-runtime-store-lock-host-release.test.ts index a9ca83613aa..25986d76ff1 100644 --- a/src/main/ssh/remote-node-runtime-store-lock-host-release.test.ts +++ b/src/main/ssh/remote-node-runtime-store-lock-host-release.test.ts @@ -1,4 +1,4 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './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-relay-exec-command' -import { tryCreateInstallLockCommand } from './ssh-relay-install-lock-commands' +import { execCommand } from './remote-exec-command' +import { tryCreateInstallLockCommand } from './remote-install-lock-commands' import { getRemoteHostPlatform } from './ssh-remote-platform' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) diff --git a/src/main/ssh/remote-node-runtime-store-lock.ts b/src/main/ssh/remote-node-runtime-store-lock.ts index 67adb031a25..902690a511f 100644 --- a/src/main/ssh/remote-node-runtime-store-lock.ts +++ b/src/main/ssh/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-connection-utils' -import { execHostCommand } from './ssh-relay-host-exec' -import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' -import { acquireInstallLock, INSTALL_LOCK_STALE_SECONDS } from './ssh-relay-install-lock' +import { execHostCommand } from './remote-host-exec' +import { isUnconfirmedSshCommandTermination } from './remote-exec-command' +import { acquireInstallLock, INSTALL_LOCK_STALE_SECONDS } from './remote-install-lock' import { tryCreateInstallLockCommand, tryStealInstallLockCommand, type InstallLockOwnerFile -} from './ssh-relay-install-lock-commands' -import { RELAY_REMOTE_DIR } from './relay-protocol' +} from './remote-install-lock-commands' +import { RELAY_REMOTE_DIR } from './remote-frame-protocol' import { removeRemoteTreeCommand } from './ssh-remote-commands' import { isWindowsRemoteHost, joinRemotePath, type RemoteHostPlatform } from './ssh-remote-platform' diff --git a/src/main/ssh/remote-node-runtime-store-windows.test.ts b/src/main/ssh/remote-node-runtime-store-windows.test.ts index d73cbd54b97..2d80fe18ae5 100644 --- a/src/main/ssh/remote-node-runtime-store-windows.test.ts +++ b/src/main/ssh/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-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./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-relay-exec-command' +import { execCommand } from './remote-exec-command' import { getRemoteHostPlatform } from './ssh-remote-platform' import { decodeRemotePowerShellScript } from './ssh-remote-powershell' import { removeTreeSync } from '../../shared/windows-transient-lock-removal' diff --git a/src/main/ssh/remote-node-runtime-store-windows.ts b/src/main/ssh/remote-node-runtime-store-windows.ts index f4efd09a543..1d512113345 100644 --- a/src/main/ssh/remote-node-runtime-store-windows.ts +++ b/src/main/ssh/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 './relay-protocol' +import { RELAY_REMOTE_DIR } from './remote-frame-protocol' import { isWindowsRemoteHost, joinRemotePath, type RemoteHostPlatform } from './ssh-remote-platform' import { powerShellCommand } from './ssh-remote-powershell' import { quotePowerShellLiteral as powerShellLiteral } from '../../shared/powershell-native-argument' diff --git a/src/main/ssh/ssh-relay-versioned-install-termination.test.ts b/src/main/ssh/remote-versioned-install-termination.test.ts similarity index 95% rename from src/main/ssh/ssh-relay-versioned-install-termination.test.ts rename to src/main/ssh/remote-versioned-install-termination.test.ts index ae45d755fa7..aa990100882 100644 --- a/src/main/ssh/ssh-relay-versioned-install-termination.test.ts +++ b/src/main/ssh/remote-versioned-install-termination.test.ts @@ -1,14 +1,14 @@ -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) import type { SshConnection } from './ssh-connection' import { REMOTE_INSTALL_MODELS } from './remote-install-model' -import { execCommand } from './ssh-relay-exec-command' +import { execCommand } from './remote-exec-command' import { abandonInstall, finalizeInstall, diff --git a/src/main/ssh/remote-versioned-install.test.ts b/src/main/ssh/remote-versioned-install.test.ts index 4484554a05b..9c6cbd02670 100644 --- a/src/main/ssh/remote-versioned-install.test.ts +++ b/src/main/ssh/remote-versioned-install.test.ts @@ -1,12 +1,12 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type * as ExecCommandModule from './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' vi.mock('fs', () => ({ existsSync: vi.fn(), readFileSync: vi.fn() })) -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./remote-exec-command', async (importOriginal) => ({ ...(await importOriginal()), execCommand: vi.fn() })) @@ -24,15 +24,15 @@ import { } from './remote-versioned-install' import { gcOldRemoteInstallVersions } from './remote-install-gc' import { ORCAD_INSTALL_MODEL } from './remote-install-model' -import { isUnconfirmedSshCommandTermination, execCommand } from './ssh-relay-exec-command' -import { acquireInstallLock } from './ssh-relay-install-lock' +import { isUnconfirmedSshCommandTermination, execCommand } from './remote-exec-command' +import { acquireInstallLock } from './remote-install-lock' import { isRelayGcClaimed, relayGcClaimPath, releaseRelayGcClaim, tryAcquireRelayGcClaim, waitForRelayGcClaimRelease -} from './ssh-relay-gc-claim' +} from './remote-install-gc-claim' import { getRemoteHostPlatform, type RemoteHostPlatform } from './ssh-remote-platform' import type { SshConnection } from './ssh-connection' diff --git a/src/main/ssh/remote-versioned-install.ts b/src/main/ssh/remote-versioned-install.ts index f1a7f716033..f8c1bab239b 100644 --- a/src/main/ssh/remote-versioned-install.ts +++ b/src/main/ssh/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-relay-host-exec' -import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command' -import { RELAY_INSTALL_LOCK_NAME } from './ssh-relay-install-lock' -import { RELAY_REMOTE_DIR } from './relay-protocol' +import { execHostCommand } from './remote-host-exec' +import { isUnconfirmedSshCommandTermination } from './remote-exec-command' +import { RELAY_INSTALL_LOCK_NAME } from './remote-install-lock' +import { RELAY_REMOTE_DIR } from './remote-frame-protocol' import { remoteInstallDirName, type RemoteInstallModel } from './remote-install-model' import { probeRemoteInstallCompleteCommand, diff --git a/src/main/ssh/sftp-namespace-resolution.ts b/src/main/ssh/sftp-namespace-resolution.ts index dd019a84d88..d3f8bc2fb15 100644 --- a/src/main/ssh/sftp-namespace-resolution.ts +++ b/src/main/ssh/sftp-namespace-resolution.ts @@ -7,7 +7,7 @@ import type { SFTPWrapper } from 'ssh2' import { assertSafeRemotePathSegment, isWindowsRemoteHost } from './ssh-remote-platform' import type { RemoteHostPlatform } from './ssh-remote-platform' -import { redactRelayInstallMarkerTokens } from './ssh-relay-install-marker' +import { redactRelayInstallMarkerTokens } from './remote-install-marker' export type SftpNamespacePathMapping = { homeRelativeNamespaceRoot: string diff --git a/src/main/ssh/sftp-stream-late-error.test.ts b/src/main/ssh/sftp-stream-late-error.test.ts index 71e7ecf9e81..176ee5d6f35 100644 --- a/src/main/ssh/sftp-stream-late-error.test.ts +++ b/src/main/ssh/sftp-stream-late-error.test.ts @@ -6,7 +6,7 @@ import { PassThrough } from 'node:stream' import type { SFTPWrapper } from 'ssh2' import { afterEach, beforeEach, describe, expect, it } from 'vitest' import { uploadBuffer, uploadFile, writeStringViaSftp } from './sftp-upload' -import { writeRelayFile } from './ssh-relay-install-transfers' +import { writeRelayFile } from './remote-install-transfers' import type { SshConnection } from './ssh-connection' import { getRemoteHostPlatform } from './ssh-remote-platform' diff --git a/src/main/ssh/ssh-channel-multiplexer-backpressure.test.ts b/src/main/ssh/ssh-channel-multiplexer-backpressure.test.ts index 12ad7d86319..1ff817c43f8 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 './relay-protocol' +import { encodeFrame, encodeKeepAliveFrame, MessageType } from './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 fd9034f27f9..2c92c28d91e 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,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { encodeKeepAliveFrame, KEEPALIVE_SEND_MS, TIMEOUT_MS } from './relay-protocol' +import { encodeKeepAliveFrame, KEEPALIVE_SEND_MS, TIMEOUT_MS } from './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 093941c2936..3f4e058791d 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 './relay-protocol' +import { encodeFrame, MessageType, encodeKeepAliveFrame } from './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 f82edc67939..12bf62c2781 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 './relay-protocol' +} from './remote-frame-protocol' import { SshMultiplexerTransportWriter, type MultiplexerTransport, 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 5cc5a362060..c7af6197b92 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 './ssh-relay-exec-command' +import { execCommand, isSshCommandExitError } from './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.ts b/src/main/ssh/ssh-exec-stdin-file-transfer.ts index ab7f5818b85..b103659cfde 100644 --- a/src/main/ssh/ssh-exec-stdin-file-transfer.ts +++ b/src/main/ssh/ssh-exec-stdin-file-transfer.ts @@ -13,8 +13,8 @@ import { posix } from 'node:path' import { Readable } from 'node:stream' import type { RemoteInstallTransport } from './remote-install-transport' import { shellEscape } from './ssh-connection-utils' -import { execCommand } from './ssh-relay-exec-command' -import { RELAY_DEPLOY_TIMEOUT_MS } from './ssh-relay-deploy-timing' +import { execCommand } from './remote-exec-command' +import { RELAY_DEPLOY_TIMEOUT_MS } from './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' diff --git a/src/main/ssh/ssh-remote-commands.test.ts b/src/main/ssh/ssh-remote-commands.test.ts index 997f71fc813..34731b28f19 100644 --- a/src/main/ssh/ssh-remote-commands.test.ts +++ b/src/main/ssh/ssh-remote-commands.test.ts @@ -18,7 +18,7 @@ import { lockAgeSecondsCommand, tryCreateInstallLockCommand, tryStealInstallLockCommand -} from './ssh-relay-install-lock-commands' +} from './remote-install-lock-commands' import { commandWithNodePath, listRemoteInstallBaseDirsCommand, @@ -35,7 +35,7 @@ import { readUncappedRelayGcPaths, runCappedRelayGcShellCommand, SSH_EXEC_OUTPUT_CAP_CHARS -} from './ssh-relay-gc-listing.test-fixture' +} from './remote-install-gc-listing.test-fixture' const posix = getRemoteHostPlatform('linux-x64') const nativePosix = getRemoteHostPlatform( diff --git a/src/main/ssh/ssh-remote-node-install-guidance.ts b/src/main/ssh/ssh-remote-node-install-guidance.ts index 6e16b2e71d5..af8b1bba92c 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 './ssh-relay-exec-command' +import { execCommand } from './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 7b7d885b5f5..8a01050dbed 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 './ssh-relay-exec-command' +import type * as ExecCommandModule from './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('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./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 9e9e5a89276..ef58f2004d3 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 './ssh-relay-exec-command' +import { execCommand, isSshCommandExitError } from './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 b39c4a0af31..a7b3445e609 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 './ssh-relay-exec-command' +import type * as ExecCommandModule from './remote-exec-command' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { SshConnection } from './ssh-connection' -import { SSH_EXEC_TIMEOUT_CODE } from './ssh-relay-exec-command' +import { SSH_EXEC_TIMEOUT_CODE } from './remote-exec-command' const execCommandMock = vi.hoisted(() => vi.fn()) -vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({ +vi.mock('./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 93bde1e7e56..acfb8791e8b 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 './relay-protocol' +import { parseUnameToRelayPlatform, type RelayPlatform } from './remote-frame-protocol' import { execCommand, isSshExecTimeout, isUnconfirmedSshCommandTermination -} from './ssh-relay-exec-command' +} from './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 eb5f094cafc..1fcd9ede6d7 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 './relay-protocol' +import type { RelayPlatform } from './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 f7a97aaf530..166ea01025d 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 @@ -2,7 +2,7 @@ import { gunzipSync } from 'node:zlib' import { describe, expect, it } from 'vitest' import { CMD_EXE_COMMAND_LINE_MAX_CHARS } from '../providers/windows-shell-args' import { getRemoteHostPlatform } from './ssh-remote-platform' -import { tryStealInstallLockCommand } from './ssh-relay-install-lock-commands' +import { tryStealInstallLockCommand } from './remote-install-lock-commands' import { decodeRemotePowerShellScript, powerShellCommand } from './ssh-remote-powershell' import { makeWindowsPublishStagedFileCommand, diff --git a/src/main/wsl/wsl-command-loop.test.ts b/src/main/wsl/wsl-command-loop.test.ts index ecdce9dbcbe..8bcc120eebb 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/ssh-relay-exec-command' +import { execCommand } from '../ssh/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 b53189c9179..bd4be6c722c 100644 --- a/src/main/wsl/wsl-directory-upload.ts +++ b/src/main/wsl/wsl-directory-upload.ts @@ -11,8 +11,8 @@ import { Readable } from 'node:stream' import { parseWslUncPath, toLinuxPath } from '../../shared/wsl-paths' import type { RemoteInstallTransport } from '../ssh/remote-install-transport' import { shellEscape } from '../ssh/ssh-connection-utils' -import { execCommand } from '../ssh/ssh-relay-exec-command' -import { RELAY_DEPLOY_TIMEOUT_MS } from '../ssh/ssh-relay-deploy-timing' +import { execCommand } from '../ssh/remote-exec-command' +import { RELAY_DEPLOY_TIMEOUT_MS } from '../ssh/remote-deploy-timing' import { getRemoteHostPlatform } from '../ssh/ssh-remote-platform' import { collectLocalUploadPlan, type LocalUploadPlan } from '../ssh/system-ssh-file-transfer' import { buildUstarEntryHeader, USTAR_BLOCK_BYTES, ustarPaddingBytes } from '../ustar-entry-header' diff --git a/src/main/wsl/wsl-guest-process-identity.ts b/src/main/wsl/wsl-guest-process-identity.ts index d539140e28d..728f2b407dc 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/ssh-relay-exec-command' +import { execCommand } from '../ssh/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 af6b6ff2285..6598f9d825f 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/ssh-relay-exec-command' +import { execCommand } from '../ssh/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 4cf60cf0763..a89ed0b3bf7 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/ssh-relay-exec-command', () => ({ execCommand: mocks.exec })) +vi.mock('../ssh/remote-exec-command', () => ({ execCommand: mocks.exec })) vi.mock('../ssh/orcad-remote-context', () => ({ resolveOrcadRemoteContext: mocks.resolveContext })) vi.mock('../ssh/orcad-activation-recovery', () => ({ recoverInterruptedOrcadActivation: mocks.recover diff --git a/src/main/wsl/wsl-orcad-deploy.ts b/src/main/wsl/wsl-orcad-deploy.ts index 2a6bc78886c..32124d546d1 100644 --- a/src/main/wsl/wsl-orcad-deploy.ts +++ b/src/main/wsl/wsl-orcad-deploy.ts @@ -28,7 +28,7 @@ import { resolveOrcadRemoteContext } from '../ssh/orcad-remote-context' import { deployOrcad } from '../ssh/orcad-remote-deploy' import { ORCAD_PID_FILENAME } from '../ssh/orcad-remote-host-support' import { shellEscape } from '../ssh/ssh-connection-utils' -import { execCommand } from '../ssh/ssh-relay-exec-command' +import { execCommand } from '../ssh/remote-exec-command' import { joinRemotePath } from '../ssh/ssh-remote-platform' import { readLocalFullVersion } from '../ssh/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 7642de92b6b..8b2a2262e1f 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/ssh-relay-exec-command' +import { execCommand } from '../ssh/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 f3da2aafb25..2392667bbf6 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/ssh-relay-exec-command' +import { execCommand } from '../ssh/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 fbe624a45cd..d5f7afe501b 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/ssh-relay-exec-command' +import { execCommand } from '../ssh/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/renderer/src/components/terminal-pane/legacy-relay-bridge-panes.ts b/src/renderer/src/components/terminal-pane/legacy-relay-bridge-panes.ts index 53c8bf2c6f7..08fa95d22a2 100644 --- a/src/renderer/src/components/terminal-pane/legacy-relay-bridge-panes.ts +++ b/src/renderer/src/components/terminal-pane/legacy-relay-bridge-panes.ts @@ -1,6 +1,6 @@ /** * Which panes main's legacy relay bridge serves, known before those panes mount. - * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay-bridge/. + * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay/. */ import type { LegacyRelayBridgedPane } from '../../../../shared/legacy-relay-bridge-contract' import { parseAppSshPtyId } from '../../../../shared/ssh-pty-id' diff --git a/src/renderer/src/components/terminal-pane/legacy-relay-bridge-transport.ts b/src/renderer/src/components/terminal-pane/legacy-relay-bridge-transport.ts index fa012e7b502..47ec54ab9e0 100644 --- a/src/renderer/src/components/terminal-pane/legacy-relay-bridge-transport.ts +++ b/src/renderer/src/components/terminal-pane/legacy-relay-bridge-transport.ts @@ -1,7 +1,7 @@ /** * A runtime pane whose terminal still runs inside an older Orca's relay: it reattaches through * main's legacy relay bridge, and hands every other connect to the managed server's transport. - * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay-bridge/. + * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay/. * * When the bridge answers that the terminal is gone, the pane gets the host's "session expired" * error, which retires its binding and starts a fresh shell on the managed server. When the relay diff --git a/src/renderer/src/runtime/web-runtime-session-legacy-relay-bridged-activation.test.ts b/src/renderer/src/runtime/web-runtime-session-legacy-relay-bridged-activation.test.ts index 021a48b41ca..2b90baad4b4 100644 --- a/src/renderer/src/runtime/web-runtime-session-legacy-relay-bridged-activation.test.ts +++ b/src/renderer/src/runtime/web-runtime-session-legacy-relay-bridged-activation.test.ts @@ -1,4 +1,4 @@ -// COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay-bridge/. +// COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay/. // The managed server starts a shell for any unmaterialized pane a client activates. A pane an older // relay still runs is served by the bridge, so activating it would leave a second, unseen shell. import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' diff --git a/src/shared/legacy-relay-bridge-contract.ts b/src/shared/legacy-relay-bridge-contract.ts index ffda60f4054..b6b024f04b8 100644 --- a/src/shared/legacy-relay-bridge-contract.ts +++ b/src/shared/legacy-relay-bridge-contract.ts @@ -1,4 +1,4 @@ -// COMPAT(legacy-relay-bridge): revisit 2027-01-15 with src/main/ssh/legacy-relay-bridge/. +// COMPAT(legacy-relay-bridge): revisit 2027-01-15 with src/main/ssh/legacy-relay/. /** A pane whose terminal still runs inside an older Orca's relay and is reached through the bridge. */ export type LegacyRelayBridgedPane = { diff --git a/src/shared/telemetry-ssh-host-server-event-schemas.ts b/src/shared/telemetry-ssh-host-server-event-schemas.ts index b90c87d07d9..54eb0791800 100644 --- a/src/shared/telemetry-ssh-host-server-event-schemas.ts +++ b/src/shared/telemetry-ssh-host-server-event-schemas.ts @@ -147,7 +147,7 @@ export const sshHostServerMoveSchema = z }) .strict() -// COMPAT(legacy-relay-bridge): revisit 2027-01-15; drop with src/main/ssh/legacy-relay-bridge/. +// COMPAT(legacy-relay-bridge): revisit 2027-01-15; drop with src/main/ssh/legacy-relay/. export const SSH_HOST_SERVER_LEGACY_RELAY_BRIDGE_TERMINAL_VALUES = [ 'none', '1', diff --git a/src/wsl-guest/protocol-json-payload.test.ts b/src/wsl-guest/protocol-json-payload.test.ts index 3abdb47058e..c634b94e0fd 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/relay-protocol' +import * as mainProtocol from '../main/ssh/remote-frame-protocol' import { HEADER_LENGTH, MAX_MESSAGE_SIZE, diff --git a/src/wsl-guest/protocol.ts b/src/wsl-guest/protocol.ts index e0633c2d128..b65723f45b8 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/relay-protocol.ts +// Self-contained relay protocol — mirrors src/main/ssh/remote-frame-protocol.ts // but has no Electron dependencies. Deployed standalone to remote hosts. import { diff --git a/tests/e2e/cross-version-wire/legacy-relay-bridge.unit.test.ts b/tests/e2e/cross-version-wire/legacy-relay-bridge.unit.test.ts index 6293355984d..b6b4e8e4045 100644 --- a/tests/e2e/cross-version-wire/legacy-relay-bridge.unit.test.ts +++ b/tests/e2e/cross-version-wire/legacy-relay-bridge.unit.test.ts @@ -3,7 +3,7 @@ * shell alive, and that relay refuses this build's handshake. The bridge must reach the shell through * the old relay's own `--connect`, drive it, survive a dropped connection, never displace an * attached 1.4.224 client, and retire the pane once the shell exits. - * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay-bridge/. + * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay/. */ import type { ChildProcess } from 'node:child_process' import { mkdtemp, rm } from 'node:fs/promises' @@ -14,9 +14,9 @@ import { toAppSshPtyId } from '../../../src/shared/ssh-pty-id' import { LegacyRelayClient, LegacyRelayOwnerHeldError -} from '../../../src/main/ssh/legacy-relay-bridge/legacy-relay-client' -import { LegacyRelayTargetBridge } from '../../../src/main/ssh/legacy-relay-bridge/legacy-relay-target-bridge' -import type { LegacyRelayEndpoint } from '../../../src/main/ssh/legacy-relay-bridge/legacy-relay-endpoints' +} from '../../../src/main/ssh/legacy-relay/legacy-relay-client' +import { LegacyRelayTargetBridge } from '../../../src/main/ssh/legacy-relay/legacy-relay-target-bridge' +import type { LegacyRelayEndpoint } from '../../../src/main/ssh/legacy-relay/legacy-relay-endpoints' import { getRemoteHostPlatform } from '../../../src/main/ssh/ssh-remote-platform' import { materializeReleaseCheckout } from './release-checkout' import { diff --git a/tests/e2e/cross-version-wire/released-relay-daemon.ts b/tests/e2e/cross-version-wire/released-relay-daemon.ts index 9e28fa123d7..47013697648 100644 --- a/tests/e2e/cross-version-wire/released-relay-daemon.ts +++ b/tests/e2e/cross-version-wire/released-relay-daemon.ts @@ -1,7 +1,7 @@ /** * A released relay, built from its own tagged sources and run as the real detached daemon, so a test * can leave live terminals in it exactly as a quit app does and reach them the way a later build must. - * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay-bridge/. + * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay/. */ import { execFile, spawn, type ChildProcess } from 'node:child_process' import { existsSync } from 'node:fs' diff --git a/tests/e2e/cross-version-wire/released-relay-transport.ts b/tests/e2e/cross-version-wire/released-relay-transport.ts index a0446aca78f..fff3c01f32c 100644 --- a/tests/e2e/cross-version-wire/released-relay-transport.ts +++ b/tests/e2e/cross-version-wire/released-relay-transport.ts @@ -1,14 +1,14 @@ /** * The client half of talking to a released relay: its own bridge transport and what a shipped * desktop did over it. Kept free of build tooling so Playwright specs can import it. - * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay-bridge/. + * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay/. */ import { spawn } from 'node:child_process' import { SshChannelMultiplexer, type MultiplexerTransport } from '../../../src/main/ssh/ssh-channel-multiplexer' -import { RELAY_SENTINEL } from '../../../src/main/ssh/relay-protocol' +import { RELAY_SENTINEL } from '../../../src/main/ssh/remote-frame-protocol' const SENTINEL = Buffer.from(RELAY_SENTINEL, 'utf-8') const OWNER_HELD_DISCONNECTED = -32045 diff --git a/tests/e2e/helpers/build-released-relay-bundle.mts b/tests/e2e/helpers/build-released-relay-bundle.mts index b70bd208fbc..5d72d4d8796 100644 --- a/tests/e2e/helpers/build-released-relay-bundle.mts +++ b/tests/e2e/helpers/build-released-relay-bundle.mts @@ -1,7 +1,7 @@ /** * Prints `{ bundleDir, version }` for the released relay's bundle. Run through tsx so the * Playwright spec never loads the ESM-only release checkout and build tooling itself. - * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay-bridge/. + * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay/. */ import { materializeReleaseCheckout } from '../cross-version-wire/release-checkout.ts' import { diff --git a/tests/e2e/helpers/legacy-relay-docker-host.ts b/tests/e2e/helpers/legacy-relay-docker-host.ts index ff2128481f0..8ee011153b2 100644 --- a/tests/e2e/helpers/legacy-relay-docker-host.ts +++ b/tests/e2e/helpers/legacy-relay-docker-host.ts @@ -1,14 +1,14 @@ /** * A Docker SSH host left exactly as a 1.4.224 desktop leaves it on quit: that release's relay * running detached with a live shell, under `~/.orca-remote/relay-/`. - * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay-bridge/. + * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay/. */ import { execFileSync } from 'node:child_process' import { cpSync, mkdtempSync, rmSync } from 'node:fs' import os from 'node:os' import path from 'node:path' import { quotePosixShell } from '../../../src/shared/wsl-login-shell-command' -import { relaySocketNameForInstanceId } from '../../../src/main/ssh/ssh-relay-instance-id' +import { relaySocketNameForInstanceId } from '../../../src/main/ssh/legacy-relay/ssh-relay-instance-id' import { SshChannelMultiplexer } from '../../../src/main/ssh/ssh-channel-multiplexer' import { leaveShellInReleasedRelay, diff --git a/tests/e2e/ssh-orcad-legacy-relay-bridge.spec.ts b/tests/e2e/ssh-orcad-legacy-relay-bridge.spec.ts index 979651e80ac..abc886fa133 100644 --- a/tests/e2e/ssh-orcad-legacy-relay-bridge.spec.ts +++ b/tests/e2e/ssh-orcad-legacy-relay-bridge.spec.ts @@ -10,7 +10,7 @@ * When another desktop on the same login already moved that terminal's project to the host's * server, the host stays unmoved but connected, and the old tab keeps its shell until it exits. * - * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay-bridge/. + * COMPAT(legacy-relay-bridge): revisit 2027-01-15, with src/main/ssh/legacy-relay/. */ import type { ElectronApplication, Page, TestInfo } from '@stablyai/playwright-test' import { z } from 'zod'