From 9a5da64fddb24cb33b1aa0fcc29d4259c7d32c90 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Fri, 23 Oct 2026 15:52:57 -0700 Subject: [PATCH] refactor: group remote runtime requests and subscriptions (#32952) --- config/reliability-gates.jsonc | 14 +++++------ config/scripts/ci-shard-timings.json | 24 +++++++++---------- config/scripts/pr-layout-oracle-route.mjs | 2 +- .../remote-agent-session-repro-client.mjs | 9 ++++++- config/scripts/vitest-node-runtime-files.mjs | 4 ++-- .../paired-runtime-browser-client-host.ts | 2 +- ...ired-runtime-browser-host-lease-options.ts | 2 +- ...ired-runtime-browser-network-route.test.ts | 2 +- .../paired-runtime-browser-network-route.ts | 2 +- ...aired-runtime-browser-network-transport.ts | 2 +- ...runtime-environment-request-connections.ts | 2 +- ...me-environment-runtime-pinned-send.test.ts | 2 +- ...b-check-details-paired.integration.test.ts | 2 +- ...session-host-authority.integration.test.ts | 2 +- ...e-runtime-close-intent.integration.test.ts | 2 +- ...ime-request-connection.integration.test.ts | 2 +- src/main/runtime/rpc/e2ee-channel.test.ts | 2 +- src/main/runtime/rpc/e2ee-channel.ts | 2 +- .../rpc/mobile-e2ee-auth-validation.ts | 2 +- src/shared/remote-runtime-client-handshake.ts | 2 +- src/shared/remote-runtime-client.ts | 6 ++--- .../remote-runtime-connect-bound.test.ts | 2 +- .../remote-runtime-outbound-admission.test.ts | 4 ++-- .../remote-runtime-passthrough-socket.ts | 4 ++-- ...ntime-shared-control-connection-actions.ts | 6 ++--- ...runtime-shared-control-connection-frame.ts | 2 +- ...-runtime-shared-control-connection.test.ts | 2 +- ...emote-runtime-shared-control-connection.ts | 8 +++---- ...e-runtime-shared-control-frame-dispatch.ts | 8 +++---- ...te-runtime-shared-control-frame-handler.ts | 4 ++-- ...e-shared-control-keepalive-refresh.test.ts | 2 +- .../remote-runtime-shared-control-open.ts | 4 ++-- .../remote-runtime-shared-control-protocol.ts | 2 +- .../remote-runtime-shared-control-ready.ts | 2 +- .../remote-runtime-shared-control-refusal.ts | 2 +- .../remote-runtime-shared-control-send.ts | 4 ++-- ...ote-runtime-shared-control-socket-close.ts | 2 +- ...e-shared-control-socket-generation.test.ts | 2 +- .../remote-runtime-shared-control-state.ts | 4 ++-- .../remote-runtime-shared-control-types.ts | 2 +- ...-runtime-transport-error-agreement.test.ts | 2 +- ...mote-runtime-prepared-request-admission.ts | 6 ++--- ...e-runtime-request-connection-stale.test.ts | 8 +++---- .../remote-runtime-request-connection.test.ts | 8 +++---- .../remote-runtime-request-connection.ts | 18 +++++++------- .../remote-runtime-request-frames.test.ts | 2 +- .../remote-runtime-request-frames.ts | 11 +++++---- .../remote-runtime-request-ready-waiters.ts | 2 +- ...te-runtime-request-response-router.test.ts | 4 ++-- .../remote-runtime-request-response-router.ts | 10 ++++---- .../remote-runtime-request-rpc-frame.ts | 0 .../remote-runtime-request-socket.ts | 22 ++++++++--------- .../remote-runtime-request-websocket.test.ts | 6 ++--- .../remote-runtime-request-websocket.ts | 12 +++++----- .../remote-runtime-shared-control-requests.ts | 12 +++++----- ...shared-control-retired-request-ids.test.ts | 0 ...time-shared-control-retired-request-ids.ts | 0 ...-shared-control-subscription-close.test.ts | 2 +- ...ntime-shared-control-subscription-close.ts | 2 +- ...-shared-control-subscription-start.test.ts | 2 +- ...ntime-shared-control-subscription-start.ts | 6 ++--- ...ntime-shared-control-subscriptions.test.ts | 4 ++-- ...te-runtime-shared-control-subscriptions.ts | 8 +++---- ...runtime-subscription-connect-bound.test.ts | 10 ++++---- .../remote-runtime-subscription-contract.ts | 8 +++---- ...-runtime-subscription-frame-router.test.ts | 6 ++--- ...emote-runtime-subscription-frame-router.ts | 8 +++---- .../remote-runtime-subscription-outbound.ts | 4 ++-- ...te-runtime-subscription-request-channel.ts | 12 +++++----- ...emote-runtime-subscription-request.test.ts | 8 +++---- .../remote-runtime-subscription-transport.ts | 18 +++++++------- 71 files changed, 193 insertions(+), 183 deletions(-) rename src/shared/{ => remote-runtime/requests}/remote-runtime-prepared-request-admission.ts (95%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-request-connection-stale.test.ts (95%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-request-connection.test.ts (96%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-request-connection.ts (93%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-request-frames.test.ts (93%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-request-frames.ts (90%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-request-ready-waiters.ts (95%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-request-response-router.test.ts (93%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-request-response-router.ts (94%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-request-rpc-frame.ts (100%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-request-socket.ts (91%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-request-websocket.test.ts (91%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-request-websocket.ts (90%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-shared-control-requests.ts (89%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-shared-control-retired-request-ids.test.ts (100%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-shared-control-retired-request-ids.ts (100%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-shared-control-subscription-close.test.ts (95%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-shared-control-subscription-close.ts (93%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-shared-control-subscription-start.test.ts (96%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-shared-control-subscription-start.ts (89%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-shared-control-subscriptions.test.ts (97%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-shared-control-subscriptions.ts (94%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-subscription-connect-bound.test.ts (93%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-subscription-contract.ts (79%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-subscription-frame-router.test.ts (94%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-subscription-frame-router.ts (95%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-subscription-outbound.ts (97%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-subscription-request-channel.ts (89%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-subscription-request.test.ts (98%) rename src/shared/{ => remote-runtime/requests}/remote-runtime-subscription-transport.ts (93%) diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index 1bb3fb0f88f..3956d883388 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -6505,7 +6505,7 @@ "pnpm exec vitest run --config config/vitest.config.ts src/shared/browser-client-host-protocol.test.ts src/shared/ws-outbound-backpressure-queue.test.ts src/shared/remote-runtime-client.test.ts src/main/runtime/browser-host/browser-host-lease-registry.test.ts src/main/runtime/runtime-rpc-browser-host-admission.test.ts src/main/runtime/rpc/methods/browser-client-host.test.ts src/main/runtime/rpc/methods/browser-network-tunnel.test.ts src/main/browser/paired-runtime-browser-host-lease.test.ts src/main/browser/paired-runtime-browser-network-route.test.ts src/main/runtime/browser-network-tunnel-paired-runtime.integration.test.ts src/main/browser/browser-network-tunnel-client.test.ts src/main/browser/browser-network-tunnel-client-memory-budget.test.ts src/main/browser/browser-network-tunnel-session.test.ts src/main/browser/browser-network-tunnel-session-aggregate-memory.test.ts src/main/browser/browser-network-tunnel-outbound-memory-budget.test.ts src/main/browser/remote-browser-socks-server.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/shared/browser-client-host-protocol.test.ts src/main/runtime/browser-host/browser-host-lease-registry.test.ts src/main/runtime/runtime-rpc-browser-host-admission.test.ts src/main/runtime/rpc/methods/browser-client-host.test.ts src/main/runtime/rpc/methods/browser-network-tunnel.test.ts src/main/browser/paired-runtime-browser-host-lease.test.ts src/main/browser/paired-runtime-browser-network-route.test.ts src/main/runtime/browser-network-tunnel-paired-runtime.integration.test.ts src/main/browser/browser-network-tunnel-client.test.ts src/main/browser/browser-network-tunnel-session.test.ts src/main/browser/remote-browser-socks-server.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/shared/remote-runtime-client.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/shared/remote-runtime-subscription-request.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/shared/remote-runtime/requests/remote-runtime-subscription-request.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/browser-client-host-command-dispatcher.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/paired-runtime-browser-client-host.test.ts src/main/browser/paired-runtime-browser-host-lease.test.ts src/main/browser/browser-client-host-command-dispatcher.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/paired-runtime-browser-client-host.test.ts src/main/browser/paired-runtime-browser-client-host-reconnect.test.ts src/main/browser/paired-runtime-browser-host-lease.test.ts src/main/browser/paired-runtime-browser-host-lease-reconnect.test.ts src/main/browser/browser-host-lease-reconnect-delay.test.ts src/main/browser/browser-client-host-command-dispatcher.test.ts", @@ -6578,7 +6578,7 @@ "src/main/runtime/rpc/methods/browser-network-tunnel.test.ts", "src/main/runtime/browser-network-tunnel-paired-runtime.integration.test.ts", "src/shared/remote-runtime-client.test.ts", - "src/shared/remote-runtime-subscription-request.test.ts", + "src/shared/remote-runtime/requests/remote-runtime-subscription-request.test.ts", "src/shared/ws-outbound-backpressure-queue.test.ts", "tests/e2e/ssh-browser-network-execution-route.docker.unit.test.ts" ], @@ -7085,7 +7085,7 @@ ] }, { - "file": "src/shared/remote-runtime-subscription-request.test.ts", + "file": "src/shared/remote-runtime/requests/remote-runtime-subscription-request.test.ts", "assertions": [ "nested JSON responses route by exact request ID under reverse-order delivery", "unknown and duplicate response IDs fail the authenticated subscription", @@ -7180,7 +7180,7 @@ "date": "2026-08-14", "runner": "local", "platform": "macos", - "command": "pnpm exec vitest run --config config/vitest.config.ts src/shared/remote-runtime-subscription-request.test.ts", + "command": "pnpm exec vitest run --config config/vitest.config.ts src/shared/remote-runtime/requests/remote-runtime-subscription-request.test.ts", "result": "passed", "durationSeconds": 0.4, "summary": "Ten tests passed same-socket nested JSON request delivery, reverse-order exact-ID routing, unknown and duplicate response rejection, 32-request admission, serialization rollback, concurrent timeout teardown, queued/native memory release, and exact-once socket-registration and queue-claim denial." @@ -9272,7 +9272,7 @@ "invariant": "Reconnect, replay, or lifecycle observations from a viewer that negotiated explicit close intent must never kill a live PTY. A capable reasonless close must keep and republish; a legacy paired viewer must retain current-main behavior because its intentional close and cleanup echo are wire-identical. Lifecycle close requires the exact observed publication, terminal, environment, and authoritative liveness, never signals a process, and leaves renderer-owned or partial-split retirement to its owner. Legacy daemon hello and warm reattachment remain non-destructive.", "oracle": "Start isolated v25 and v26 daemon generations with one capable-viewer PTY and one legacy-viewer PTY per generation in four target worktrees plus an unaddressed control PTY in a fifth worktree. Route them through the production desktop scanner, runtime, RPC dispatcher, renderer-close relay, and daemon router. First issue sequential reasonless closes from an authenticated capable connection and require refusal, snapshot republish, zero shutdown calls, exact process survival, and post-close I/O. Then issue the byte-identical requests without the negotiated capability and require current-main behavior: two ordered immediate shutdowns, session-killed events, and exact root/descendant death, while capable and control PTYs survive. An observer lists all targets before, between, and after while issuing zero closes. Unit contracts also require in-process reasonless refusal, legacy runtime/mobile compatibility, explicit user closes, encrypted client-auth advertisement, and old-server lifecycle calls never to fall back.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/daemon-server-kill-attribution.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/remote-runtime-request-connection.integration.test.ts src/main/runtime/rpc/runtime-close-attribution-topology.test.ts src/main/runtime/rpc/methods/session-tabs.test.ts src/main/runtime/rpc/methods/session-tabs-schemas.test.ts src/main/runtime/rpc/e2ee-channel.test.ts src/main/runtime/rpc/e2ee-channel-v2.test.ts src/main/runtime/rpc/mobile-socket-wiring.test.ts src/main/runtime/rpc/runtime-client-capabilities.test.ts src/shared/remote-runtime-client.test.ts src/shared/remote-runtime-request-connection.test.ts src/shared/remote-runtime-shared-control-connection.test.ts src/cli/runtime/websocket-transport.test.ts src/renderer/src/web/web-runtime-client.test.ts src/renderer/src/runtime/web-runtime-session.test.ts src/renderer/src/runtime/web-session-close-intent.test.ts src/renderer/src/runtime/web-session-tabs-sync.test.ts src/renderer/src/components/terminal/terminal-tab-actions.test.ts src/renderer/src/components/terminal/terminal-close-incarnation.test.ts src/renderer/src/components/terminal-pane/terminal-parked-tab-watchers.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/daemon-server-kill-attribution.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/remote-runtime-request-connection.integration.test.ts src/main/runtime/rpc/runtime-close-attribution-topology.test.ts src/main/runtime/rpc/methods/session-tabs.test.ts src/main/runtime/rpc/methods/session-tabs-schemas.test.ts src/main/runtime/rpc/e2ee-channel.test.ts src/main/runtime/rpc/e2ee-channel-v2.test.ts src/main/runtime/rpc/mobile-socket-wiring.test.ts src/main/runtime/rpc/runtime-client-capabilities.test.ts src/shared/remote-runtime-client.test.ts src/shared/remote-runtime/requests/remote-runtime-request-connection.test.ts src/shared/remote-runtime-shared-control-connection.test.ts src/cli/runtime/websocket-transport.test.ts src/renderer/src/web/web-runtime-client.test.ts src/renderer/src/runtime/web-runtime-session.test.ts src/renderer/src/runtime/web-session-close-intent.test.ts src/renderer/src/runtime/web-session-tabs-sync.test.ts src/renderer/src/components/terminal/terminal-tab-actions.test.ts src/renderer/src/components/terminal/terminal-close-incarnation.test.ts src/renderer/src/components/terminal-pane/terminal-parked-tab-watchers.test.ts", "pnpm exec playwright test tests/e2e/daemon-generation-reconnect-safety.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", "pnpm exec playwright test tests/e2e/daemon-generation-legacy-close-safety.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1" ], @@ -9288,7 +9288,7 @@ "src/main/runtime/rpc/mobile-socket-wiring.test.ts", "src/main/runtime/rpc/runtime-client-capabilities.test.ts", "src/shared/remote-runtime-client.test.ts", - "src/shared/remote-runtime-request-connection.test.ts", + "src/shared/remote-runtime/requests/remote-runtime-request-connection.test.ts", "src/shared/remote-runtime-shared-control-connection.test.ts", "src/cli/runtime/websocket-transport.test.ts", "src/renderer/src/web/web-runtime-client.test.ts", @@ -9368,7 +9368,7 @@ ] }, { - "file": "src/shared/remote-runtime-request-connection.test.ts", + "file": "src/shared/remote-runtime/requests/remote-runtime-request-connection.test.ts", "assertions": [ "the cached paired-desktop request connection advertises close-intent support in encrypted authentication while reusing one socket" ] diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index 1b3023f720b..b563c78a29f 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -11790,24 +11790,24 @@ "src/shared/remote-runtime-memory-limits.test.ts": 120, "src/shared/remote-runtime-outbound-admission.test.ts": 1044, "src/shared/remote-runtime-pty-id.test.ts": 38, - "src/shared/remote-runtime-request-connection-stale.test.ts": 311, - "src/shared/remote-runtime-request-connection.test.ts": 393, - "src/shared/remote-runtime-request-frames.test.ts": 280, - "src/shared/remote-runtime-request-response-router.test.ts": 243, - "src/shared/remote-runtime-request-websocket.test.ts": 406, + "src/shared/remote-runtime/requests/remote-runtime-request-connection-stale.test.ts": 311, + "src/shared/remote-runtime/requests/remote-runtime-request-connection.test.ts": 393, + "src/shared/remote-runtime/requests/remote-runtime-request-frames.test.ts": 280, + "src/shared/remote-runtime/requests/remote-runtime-request-response-router.test.ts": 243, + "src/shared/remote-runtime/requests/remote-runtime-request-websocket.test.ts": 406, "src/shared/remote-runtime-shared-control-connection.test.ts": 3965, "src/shared/remote-runtime-shared-control-keepalive-refresh.test.ts": 287, "src/shared/remote-runtime-shared-control-reconnect.test.ts": 257, - "src/shared/remote-runtime-shared-control-retired-request-ids.test.ts": 40, + "src/shared/remote-runtime/requests/remote-runtime-shared-control-retired-request-ids.test.ts": 40, "src/shared/remote-runtime-shared-control-socket-generation.test.ts": 197, "src/shared/remote-runtime-shared-control-standing-intent.test.ts": 961, - "src/shared/remote-runtime-shared-control-subscription-close.test.ts": 261, - "src/shared/remote-runtime-shared-control-subscription-start.test.ts": 308, - "src/shared/remote-runtime-shared-control-subscriptions.test.ts": 275, + "src/shared/remote-runtime/requests/remote-runtime-shared-control-subscription-close.test.ts": 261, + "src/shared/remote-runtime/requests/remote-runtime-shared-control-subscription-start.test.ts": 308, + "src/shared/remote-runtime/requests/remote-runtime-shared-control-subscriptions.test.ts": 275, "src/shared/remote-runtime-socket-liveness.test.ts": 37, - "src/shared/remote-runtime-subscription-connect-bound.test.ts": 658, - "src/shared/remote-runtime-subscription-frame-router.test.ts": 282, - "src/shared/remote-runtime-subscription-request.test.ts": 668, + "src/shared/remote-runtime/requests/remote-runtime-subscription-connect-bound.test.ts": 658, + "src/shared/remote-runtime/requests/remote-runtime-subscription-frame-router.test.ts": 282, + "src/shared/remote-runtime/requests/remote-runtime-subscription-request.test.ts": 668, "src/shared/remote-runtime-tailscale-hint.test.ts": 47, "src/shared/remote-runtime-transport-error-agreement.test.ts": 297, "src/shared/renderer-restart-preparation.test.ts": 163, diff --git a/config/scripts/pr-layout-oracle-route.mjs b/config/scripts/pr-layout-oracle-route.mjs index 8050842b504..0c487027c10 100644 --- a/config/scripts/pr-layout-oracle-route.mjs +++ b/config/scripts/pr-layout-oracle-route.mjs @@ -50,7 +50,7 @@ const LAYOUT_ORACLE_PREFIXES = [ // The client the oracle reads every view through. 'src/cli/runtime/client.ts', 'src/shared/remote-runtime-client.ts', - 'src/shared/remote-runtime-subscription-transport.ts', + 'src/shared/remote-runtime/requests/remote-runtime-subscription-transport.ts', 'src/shared/paired-runtime-connection.ts', 'src/shared/pairing.ts', // The harness: the oracle imports most of the shared e2e helpers, not just its own. diff --git a/config/scripts/remote-agent-session-repro-client.mjs b/config/scripts/remote-agent-session-repro-client.mjs index cc28cd9028d..074f39ea042 100644 --- a/config/scripts/remote-agent-session-repro-client.mjs +++ b/config/scripts/remote-agent-session-repro-client.mjs @@ -7,7 +7,14 @@ const require = createRequire(import.meta.url) const repoRoot = path.resolve(import.meta.dirname, '..', '..') const { parsePairingCode } = require(path.join(repoRoot, 'out', 'shared', 'pairing.js')) const { RemoteRuntimeRequestConnection } = require( - path.join(repoRoot, 'out', 'shared', 'remote-runtime-request-connection.js') + path.join( + repoRoot, + 'out', + 'shared', + 'remote-runtime', + 'requests', + 'remote-runtime-request-connection.js' + ) ) const [pairingCode, method, rawParams, responseMode] = process.argv.slice(2) diff --git a/config/scripts/vitest-node-runtime-files.mjs b/config/scripts/vitest-node-runtime-files.mjs index b624c6fe377..00c0e3fecd0 100644 --- a/config/scripts/vitest-node-runtime-files.mjs +++ b/config/scripts/vitest-node-runtime-files.mjs @@ -164,8 +164,8 @@ const NODE_RUNTIME_INCLUDE = [ 'src/shared/remote-runtime-client.test.ts', 'src/shared/remote-runtime-connect-bound.test.ts', // Bun's built-in ws client ignores maxPayload; the product opener only runs on Node. - 'src/shared/remote-runtime-request-websocket.test.ts', - 'src/shared/remote-runtime-subscription-connect-bound.test.ts', + 'src/shared/remote-runtime/requests/remote-runtime-request-websocket.test.ts', + 'src/shared/remote-runtime/requests/remote-runtime-subscription-connect-bound.test.ts', 'src/main/codex/codex-shared-server-probe.test.ts', 'src/main/opencode/opencode-launch-model-context-supervision.test.ts', 'src/main/hermes/hermes-config-remote-adapter.test.ts', diff --git a/src/main/browser/paired-runtime-browser-client-host.ts b/src/main/browser/paired-runtime-browser-client-host.ts index 262e8000b8d..dc60937a51c 100644 --- a/src/main/browser/paired-runtime-browser-client-host.ts +++ b/src/main/browser/paired-runtime-browser-client-host.ts @@ -5,7 +5,7 @@ import type { BrowserClientHostLeaseAuthority } from '../../shared/browser-client-host-protocol' import type { PairedRuntimeConnection } from '../../shared/paired-runtime-connection' -import type { RemoteRuntimeSubscriptionOptions } from '../../shared/remote-runtime-subscription-contract' +import type { RemoteRuntimeSubscriptionOptions } from '../../shared/remote-runtime/requests/remote-runtime-subscription-contract' import type { RuntimeRpcResponse } from '../../shared/runtime-rpc-envelope' import type { BrowserClientFileChannelAvailability } from './browser-client-file-channel-transport' import { BrowserClientHostCommandDispatcher } from './browser-client-host-command-dispatcher' diff --git a/src/main/browser/paired-runtime-browser-host-lease-options.ts b/src/main/browser/paired-runtime-browser-host-lease-options.ts index 0e4f6971b80..6d87bc3fedc 100644 --- a/src/main/browser/paired-runtime-browser-host-lease-options.ts +++ b/src/main/browser/paired-runtime-browser-host-lease-options.ts @@ -5,7 +5,7 @@ import type { BrowserClientHostLeaseAuthority } from '../../shared/browser-client-host-protocol' import type { PairedRuntimeConnection } from '../../shared/paired-runtime-connection' -import type { RemoteRuntimeSubscriptionOptions } from '../../shared/remote-runtime-subscription-contract' +import type { RemoteRuntimeSubscriptionOptions } from '../../shared/remote-runtime/requests/remote-runtime-subscription-contract' export type PairedRuntimeBrowserHostLeaseOptions = { connection: PairedRuntimeConnection diff --git a/src/main/browser/paired-runtime-browser-network-route.test.ts b/src/main/browser/paired-runtime-browser-network-route.test.ts index 9b1ca908d5b..4317b69dc67 100644 --- a/src/main/browser/paired-runtime-browser-network-route.test.ts +++ b/src/main/browser/paired-runtime-browser-network-route.test.ts @@ -13,7 +13,7 @@ import type { RemoteRuntimeSubscription, RemoteRuntimeSubscriptionCallbacks } from '../../shared/remote-runtime-client' -import type { RemoteRuntimeSubscriptionOptions } from '../../shared/remote-runtime-subscription-contract' +import type { RemoteRuntimeSubscriptionOptions } from '../../shared/remote-runtime/requests/remote-runtime-subscription-contract' const { subscribeRemoteRuntimeRequestMock } = vi.hoisted(() => ({ subscribeRemoteRuntimeRequestMock: vi.fn() diff --git a/src/main/browser/paired-runtime-browser-network-route.ts b/src/main/browser/paired-runtime-browser-network-route.ts index 7d749232ff5..af7c5b3dd75 100644 --- a/src/main/browser/paired-runtime-browser-network-route.ts +++ b/src/main/browser/paired-runtime-browser-network-route.ts @@ -2,7 +2,7 @@ import type { BrowserHostLeaseAuthority } from '../../shared/browser-client-host import type { BrowserNetworkExecutionHost } from '../../shared/browser-network-execution-host' import type { BrowserNetworkTunnelOpen } from '../../shared/browser-network-tunnel-protocol' import type { PairedRuntimeConnection } from '../../shared/paired-runtime-connection' -import type { RemoteRuntimeSubscriptionOptions } from '../../shared/remote-runtime-subscription-contract' +import type { RemoteRuntimeSubscriptionOptions } from '../../shared/remote-runtime/requests/remote-runtime-subscription-contract' import { resolveBrowserHostReconnectDelay } from './browser-host-lease-reconnect-delay' import { retryBrowserNetworkRouteReconnect } from './browser-network-route-reconnect-retry' import { diff --git a/src/main/browser/paired-runtime-browser-network-transport.ts b/src/main/browser/paired-runtime-browser-network-transport.ts index 76e167e54c0..3fffb0eeeca 100644 --- a/src/main/browser/paired-runtime-browser-network-transport.ts +++ b/src/main/browser/paired-runtime-browser-network-transport.ts @@ -8,7 +8,7 @@ import { subscribeRemoteRuntimeRequest, type RemoteRuntimeSubscription } from '../../shared/remote-runtime-client' -import type { RemoteRuntimeSubscriptionOptions } from '../../shared/remote-runtime-subscription-contract' +import type { RemoteRuntimeSubscriptionOptions } from '../../shared/remote-runtime/requests/remote-runtime-subscription-contract' import { RemoteRuntimeClientError } from '../../shared/remote-runtime-client-error' import { BROWSER_CLIENT_HOST_RUNTIME_CAPABILITY, diff --git a/src/main/ipc/runtime-environments/runtime-environment-request-connections.ts b/src/main/ipc/runtime-environments/runtime-environment-request-connections.ts index 78f09b3dc3d..b287b8fee51 100644 --- a/src/main/ipc/runtime-environments/runtime-environment-request-connections.ts +++ b/src/main/ipc/runtime-environments/runtime-environment-request-connections.ts @@ -9,7 +9,7 @@ import type { RuntimeOrchestrationEnvelope, RuntimeRpcResponse } from '../../../shared/runtime-rpc-envelope' -import { RemoteRuntimeRequestConnection } from '../../../shared/remote-runtime-request-connection' +import { RemoteRuntimeRequestConnection } from '../../../shared/remote-runtime/requests/remote-runtime-request-connection' import { RemoteRuntimeSharedControlConnection } from '../../../shared/remote-runtime-shared-control-connection' import { probeAllRemoteRuntimeSocketsNow } from '../../../shared/remote-runtime-socket-liveness' import type { diff --git a/src/main/ipc/runtime-environments/runtime-environment-runtime-pinned-send.test.ts b/src/main/ipc/runtime-environments/runtime-environment-runtime-pinned-send.test.ts index e12c011244f..274b5129708 100644 --- a/src/main/ipc/runtime-environments/runtime-environment-runtime-pinned-send.test.ts +++ b/src/main/ipc/runtime-environments/runtime-environment-runtime-pinned-send.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { requestSharedControl } from '../../../shared/remote-runtime-shared-control-requests' +import { requestSharedControl } from '../../../shared/remote-runtime/requests/remote-runtime-shared-control-requests' import type { SharedControlPendingRequest } from '../../../shared/remote-runtime-shared-control-types' import type { KnownRuntimeEnvironment } from '../../../shared/runtime-environments' import { getPreferredPairedRuntimeConnection } from '../../../shared/runtime-environments' diff --git a/src/main/runtime/github-check-details-paired.integration.test.ts b/src/main/runtime/github-check-details-paired.integration.test.ts index cbb5bdb0d11..6bc0625afaf 100644 --- a/src/main/runtime/github-check-details-paired.integration.test.ts +++ b/src/main/runtime/github-check-details-paired.integration.test.ts @@ -11,7 +11,7 @@ import { } from '../../shared/__fixtures__/fake-spawned-child' import { parsePairingCode } from '../../shared/pairing' import { pairedRuntimeConnectionFromOffer } from '../../shared/paired-runtime-connection' -import { RemoteRuntimeRequestConnection } from '../../shared/remote-runtime-request-connection' +import { RemoteRuntimeRequestConnection } from '../../shared/remote-runtime/requests/remote-runtime-request-connection' import type { Repo } from '../../shared/repo-types' import type { OrcaRuntimeService } from './orca-runtime' import { OrcaRuntimeRpcServer } from './runtime-rpc' diff --git a/src/main/runtime/remote-agent-session-host-authority.integration.test.ts b/src/main/runtime/remote-agent-session-host-authority.integration.test.ts index 43ddc61544e..0579ea5d119 100644 --- a/src/main/runtime/remote-agent-session-host-authority.integration.test.ts +++ b/src/main/runtime/remote-agent-session-host-authority.integration.test.ts @@ -6,7 +6,7 @@ import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' import { FLOATING_TERMINAL_WORKTREE_ID } from '../../shared/constants' import { parsePairingCode } from '../../shared/pairing' -import { RemoteRuntimeRequestConnection } from '../../shared/remote-runtime-request-connection' +import { RemoteRuntimeRequestConnection } from '../../shared/remote-runtime/requests/remote-runtime-request-connection' import type { RuntimeEnsureAgentSessionResult, RuntimeEnsureAgentSessionRequest diff --git a/src/main/runtime/remote-runtime-close-intent.integration.test.ts b/src/main/runtime/remote-runtime-close-intent.integration.test.ts index 04355562178..59122de21aa 100644 --- a/src/main/runtime/remote-runtime-close-intent.integration.test.ts +++ b/src/main/runtime/remote-runtime-close-intent.integration.test.ts @@ -4,7 +4,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import { expect, it, vi } from 'vitest' import { parsePairingCode } from '../../shared/pairing' -import { RemoteRuntimeRequestConnection } from '../../shared/remote-runtime-request-connection' +import { RemoteRuntimeRequestConnection } from '../../shared/remote-runtime/requests/remote-runtime-request-connection' import type { OrcaRuntimeService } from './orca-runtime' import { OrcaRuntimeRpcServer } from './runtime-rpc' diff --git a/src/main/runtime/remote-runtime-request-connection.integration.test.ts b/src/main/runtime/remote-runtime-request-connection.integration.test.ts index e5b1c454e6b..617de85f75e 100644 --- a/src/main/runtime/remote-runtime-request-connection.integration.test.ts +++ b/src/main/runtime/remote-runtime-request-connection.integration.test.ts @@ -6,7 +6,7 @@ import { describe, expect, it } from 'vitest' import { getDefaultRepoHookSettings } from '../../shared/constants' import type { Repo } from '../../shared/repo-types' import { parsePairingCode } from '../../shared/pairing' -import { RemoteRuntimeRequestConnection } from '../../shared/remote-runtime-request-connection' +import { RemoteRuntimeRequestConnection } from '../../shared/remote-runtime/requests/remote-runtime-request-connection' import { RemoteRuntimeSharedControlConnection } from '../../shared/remote-runtime-shared-control-connection' import { subscribeRemoteRuntimeRequest } from '../../shared/remote-runtime-client' import type { diff --git a/src/main/runtime/rpc/e2ee-channel.test.ts b/src/main/runtime/rpc/e2ee-channel.test.ts index 949fdc1b1ad..a8514fd8d05 100644 --- a/src/main/runtime/rpc/e2ee-channel.test.ts +++ b/src/main/runtime/rpc/e2ee-channel.test.ts @@ -13,7 +13,7 @@ import { REMOTE_RUNTIME_MAX_OUTBOUND_BINARY_FRAME_BYTES, REMOTE_RUNTIME_MAX_OUTBOUND_JSON_BYTES } from '../../../shared/remote-runtime-memory-limits' -import { REMOTE_RUNTIME_JSON_STRUCTURE_LIMITS } from '../../../shared/remote-runtime-request-frames' +import { REMOTE_RUNTIME_JSON_STRUCTURE_LIMITS } from '../../../shared/remote-runtime/requests/remote-runtime-request-frames' import { SESSION_TAB_CLOSE_INTENT_RUNTIME_CAPABILITY } from '../../../shared/protocol-version' function publicKeyToBase64(key: Uint8Array): string { diff --git a/src/main/runtime/rpc/e2ee-channel.ts b/src/main/runtime/rpc/e2ee-channel.ts index 453a32be66f..0d24369efd3 100644 --- a/src/main/runtime/rpc/e2ee-channel.ts +++ b/src/main/runtime/rpc/e2ee-channel.ts @@ -14,7 +14,7 @@ import { type DeviceKeyResolution } from './mobile-e2ee-auth-validation' import { isMobileE2EEOutboundItemWithinLimit } from './mobile-e2ee-outbound-admission' -import { parseRemoteRuntimeJsonText } from '../../../shared/remote-runtime-request-frames' +import { parseRemoteRuntimeJsonText } from '../../../shared/remote-runtime/requests/remote-runtime-request-frames' import type { MobileE2EEOutboundMemoryBudget } from './mobile-e2ee-outbound-memory-budget' import { MobileE2EEDesktopOutboundOwner } from './mobile-e2ee-desktop-outbound-owner' import { createLegacyReplySenders } from './mobile-e2ee-legacy-reply-senders' diff --git a/src/main/runtime/rpc/mobile-e2ee-auth-validation.ts b/src/main/runtime/rpc/mobile-e2ee-auth-validation.ts index 506319e199e..a9f7507b3c1 100644 --- a/src/main/runtime/rpc/mobile-e2ee-auth-validation.ts +++ b/src/main/runtime/rpc/mobile-e2ee-auth-validation.ts @@ -1,6 +1,6 @@ import type { DesktopMobileE2EEV2Session } from './mobile-e2ee-v2-desktop-session' import { publicKeyFromBase64 } from '../../../shared/e2ee-crypto' -import { parseRemoteRuntimeJsonText } from '../../../shared/remote-runtime-request-frames' +import { parseRemoteRuntimeJsonText } from '../../../shared/remote-runtime/requests/remote-runtime-request-frames' import { isDeviceProofB64, verifyDeviceProof } from '../../../shared/device-key-proof' export type ClassifiedE2EEAuth = diff --git a/src/shared/remote-runtime-client-handshake.ts b/src/shared/remote-runtime-client-handshake.ts index a86a534fd74..7803357afab 100644 --- a/src/shared/remote-runtime-client-handshake.ts +++ b/src/shared/remote-runtime-client-handshake.ts @@ -4,7 +4,7 @@ import { } from './paired-e2ee-client-handshake' import { NODE_PAIRED_E2EE_PRIMITIVES } from './paired-e2ee-node-primitives' import { serializeRemoteRuntimePayload } from './remote-runtime-memory-limits' -import { parseRemoteRuntimeJsonText } from './remote-runtime-request-frames' +import { parseRemoteRuntimeJsonText } from './remote-runtime/requests/remote-runtime-request-frames' export type RemoteRuntimeHandshakeState = 'awaiting_ready' | 'awaiting_authenticated' | 'ready' diff --git a/src/shared/remote-runtime-client.ts b/src/shared/remote-runtime-client.ts index 6491586ba89..459ee6a9b53 100644 --- a/src/shared/remote-runtime-client.ts +++ b/src/shared/remote-runtime-client.ts @@ -1,12 +1,12 @@ import type { PairedRuntimeConnection } from './paired-runtime-connection' import type { RuntimeCapability } from './protocol-version' import type { RemoteRuntimeClientError } from './remote-runtime-client-error' -import { sendRemoteRuntimeRequestOnSocket } from './remote-runtime-request-socket' -import { subscribeRemoteRuntimeTransport } from './remote-runtime-subscription-transport' +import { sendRemoteRuntimeRequestOnSocket } from './remote-runtime/requests/remote-runtime-request-socket' +import { subscribeRemoteRuntimeTransport } from './remote-runtime/requests/remote-runtime-subscription-transport' import type { RemoteRuntimeSubscriptionOptions, RemoteRuntimeTransportSubscriptionCallbacks -} from './remote-runtime-subscription-contract' +} from './remote-runtime/requests/remote-runtime-subscription-contract' import type { RuntimeOrchestrationEnvelope, RuntimeRpcResponse } from './runtime-rpc-envelope' import type { RuntimeStatus } from './runtime-types' diff --git a/src/shared/remote-runtime-connect-bound.test.ts b/src/shared/remote-runtime-connect-bound.test.ts index b02d29c24be..88dbb6f6e53 100644 --- a/src/shared/remote-runtime-connect-bound.test.ts +++ b/src/shared/remote-runtime-connect-bound.test.ts @@ -11,7 +11,7 @@ import { remoteRuntimeConnectFailureMessage, remoteRuntimeConnectOptions } from './remote-runtime-connect-bound' -import { openRemoteRuntimeWebSocket } from './remote-runtime-request-websocket' +import { openRemoteRuntimeWebSocket } from './remote-runtime/requests/remote-runtime-request-websocket' import { withRemoteRuntimeTailscaleHint } from './remote-runtime-tailscale-hint' const servers = new Set() diff --git a/src/shared/remote-runtime-outbound-admission.test.ts b/src/shared/remote-runtime-outbound-admission.test.ts index 50ce99284d8..57eeba8cb6d 100644 --- a/src/shared/remote-runtime-outbound-admission.test.ts +++ b/src/shared/remote-runtime-outbound-admission.test.ts @@ -20,8 +20,8 @@ import { retainedRemoteRuntimeJsonStringBytes, serializeRemoteRuntimeRpcRequest } from './remote-runtime-memory-limits' -import { getRemoteRuntimeRequestAdmissionEvidence } from './remote-runtime-prepared-request-admission' -import { RemoteRuntimeRequestConnection } from './remote-runtime-request-connection' +import { getRemoteRuntimeRequestAdmissionEvidence } from './remote-runtime/requests/remote-runtime-prepared-request-admission' +import { RemoteRuntimeRequestConnection } from './remote-runtime/requests/remote-runtime-request-connection' import { RemoteRuntimeSharedControlConnection } from './remote-runtime-shared-control-connection' import { waitForSharedControlReadyWithTimeout } from './remote-runtime-shared-control-ready' diff --git a/src/shared/remote-runtime-passthrough-socket.ts b/src/shared/remote-runtime-passthrough-socket.ts index 16c37f201e5..658e7b9423e 100644 --- a/src/shared/remote-runtime-passthrough-socket.ts +++ b/src/shared/remote-runtime-passthrough-socket.ts @@ -6,13 +6,13 @@ import { sendRemoteRuntimeTokenAuth } from './remote-runtime-client-handshake' import { RemoteRuntimeClientError } from './remote-runtime-client-error' -import { openRemoteRuntimeWebSocket } from './remote-runtime-request-websocket' +import { openRemoteRuntimeWebSocket } from './remote-runtime/requests/remote-runtime-request-websocket' import { closeRemoteRuntimeSocket } from './remote-runtime-socket-close' import { startRemoteRuntimeSocketLiveness, type RemoteRuntimeSocketLivenessOptions } from './remote-runtime-socket-liveness' -import { RemoteRuntimeSubscriptionOutbound } from './remote-runtime-subscription-outbound' +import { RemoteRuntimeSubscriptionOutbound } from './remote-runtime/requests/remote-runtime-subscription-outbound' export type RemoteRuntimePassthroughSocket = { /** Queues one plaintext RPC frame; false when the socket can no longer carry it. */ diff --git a/src/shared/remote-runtime-shared-control-connection-actions.ts b/src/shared/remote-runtime-shared-control-connection-actions.ts index 2d0204bfde7..a0d8bb3ec39 100644 --- a/src/shared/remote-runtime-shared-control-connection-actions.ts +++ b/src/shared/remote-runtime-shared-control-connection-actions.ts @@ -1,13 +1,13 @@ import * as sharedControlProtocol from './remote-runtime-shared-control-protocol' import * as sharedControlState from './remote-runtime-shared-control-state' -import { closeSharedControlConnectionSubscription } from './remote-runtime-shared-control-subscription-close' -import * as sharedControlSubscriptions from './remote-runtime-shared-control-subscriptions' +import { closeSharedControlConnectionSubscription } from './remote-runtime/requests/remote-runtime-shared-control-subscription-close' +import * as sharedControlSubscriptions from './remote-runtime/requests/remote-runtime-shared-control-subscriptions' import * as sharedControlSend from './remote-runtime-shared-control-send' import type { SharedControlLogicalSubscription, SharedControlPendingRequest } from './remote-runtime-shared-control-types' -import type { SharedControlRetiredRequestIds } from './remote-runtime-shared-control-retired-request-ids' +import type { SharedControlRetiredRequestIds } from './remote-runtime/requests/remote-runtime-shared-control-retired-request-ids' export function sendSharedControlRequest(args: { pendingRequests: Map> diff --git a/src/shared/remote-runtime-shared-control-connection-frame.ts b/src/shared/remote-runtime-shared-control-connection-frame.ts index 0f76eceb61d..de9f902b34f 100644 --- a/src/shared/remote-runtime-shared-control-connection-frame.ts +++ b/src/shared/remote-runtime-shared-control-connection-frame.ts @@ -10,7 +10,7 @@ import type { SharedControlPendingRequest, SharedControlReadyWaiter } from './remote-runtime-shared-control-types' -import type { SharedControlRetiredRequestIds } from './remote-runtime-shared-control-retired-request-ids' +import type { SharedControlRetiredRequestIds } from './remote-runtime/requests/remote-runtime-shared-control-retired-request-ids' export function handleRuntimeControlTextFrame(args: { frame: string diff --git a/src/shared/remote-runtime-shared-control-connection.test.ts b/src/shared/remote-runtime-shared-control-connection.test.ts index 66b9f706fe5..11e23f52ef8 100644 --- a/src/shared/remote-runtime-shared-control-connection.test.ts +++ b/src/shared/remote-runtime-shared-control-connection.test.ts @@ -8,7 +8,7 @@ import { retainedRemoteRuntimeJsonStringBytes, serializeRemoteRuntimeRpcRequest } from './remote-runtime-memory-limits' -import { getRemoteRuntimeRequestAdmissionEvidence } from './remote-runtime-prepared-request-admission' +import { getRemoteRuntimeRequestAdmissionEvidence } from './remote-runtime/requests/remote-runtime-prepared-request-admission' import { remoteRuntimeClientCapabilities } from './remote-runtime-client-capabilities' import { RemoteRuntimeSharedControlConnection } from './remote-runtime-shared-control-connection' import * as sharedControlProtocol from './remote-runtime-shared-control-protocol' diff --git a/src/shared/remote-runtime-shared-control-connection.ts b/src/shared/remote-runtime-shared-control-connection.ts index 858ef891098..1955c4f5c03 100644 --- a/src/shared/remote-runtime-shared-control-connection.ts +++ b/src/shared/remote-runtime-shared-control-connection.ts @@ -3,18 +3,18 @@ import type WebSocket from 'ws' import type { PairedRuntimeConnection } from './paired-runtime-connection' import type { RemoteRuntimeClientError } from './remote-runtime-client-error' import { remoteRuntimeClientCapabilities } from './remote-runtime-client-capabilities' -import { remoteRuntimeUnavailableError } from './remote-runtime-request-frames' +import { remoteRuntimeUnavailableError } from './remote-runtime/requests/remote-runtime-request-frames' import { openSharedControlSocket } from './remote-runtime-shared-control-open' import { closeSharedControlAfterError } from './remote-runtime-shared-control-refusal' import * as sharedControlReady from './remote-runtime-shared-control-ready' import * as sharedControlProtocol from './remote-runtime-shared-control-protocol' import { SharedControlReconnectScheduler } from './remote-runtime-shared-control-reconnect' -import { requestSharedControl } from './remote-runtime-shared-control-requests' -import { SharedControlRetiredRequestIds } from './remote-runtime-shared-control-retired-request-ids' +import { requestSharedControl } from './remote-runtime/requests/remote-runtime-shared-control-requests' +import { SharedControlRetiredRequestIds } from './remote-runtime/requests/remote-runtime-shared-control-retired-request-ids' import { SharedControlReadyStableResetTimer } from './remote-runtime-shared-control-stability' import * as sharedControlState from './remote-runtime-shared-control-state' import { closeSharedControlSocket } from './remote-runtime-shared-control-socket-close' -import { startSharedControlSubscription } from './remote-runtime-shared-control-subscription-start' +import { startSharedControlSubscription } from './remote-runtime/requests/remote-runtime-shared-control-subscription-start' import { SharedControlSocketGeneration } from './remote-runtime-shared-control-socket-generation' import { refreshRemoteRuntimeSharedControl } from './remote-runtime-shared-control-refresh' import { SharedControlDiagnosticsTracker } from './remote-runtime-shared-control-diagnostics' diff --git a/src/shared/remote-runtime-shared-control-frame-dispatch.ts b/src/shared/remote-runtime-shared-control-frame-dispatch.ts index 20c73b879ed..a700dfe9641 100644 --- a/src/shared/remote-runtime-shared-control-frame-dispatch.ts +++ b/src/shared/remote-runtime-shared-control-frame-dispatch.ts @@ -1,8 +1,8 @@ -import type { parseRemoteRuntimeRpcFrame } from './remote-runtime-request-frames' +import type { parseRemoteRuntimeRpcFrame } from './remote-runtime/requests/remote-runtime-request-frames' import { logUnknownSharedControlResponse } from './remote-runtime-shared-control-diagnostics-log' -import type { SharedControlRetiredRequestIds } from './remote-runtime-shared-control-retired-request-ids' -import { sendRetiredSharedControlCleanupRequest } from './remote-runtime-shared-control-subscription-close' -import { handleSharedControlLogicalResponse } from './remote-runtime-shared-control-subscriptions' +import type { SharedControlRetiredRequestIds } from './remote-runtime/requests/remote-runtime-shared-control-retired-request-ids' +import { sendRetiredSharedControlCleanupRequest } from './remote-runtime/requests/remote-runtime-shared-control-subscription-close' +import { handleSharedControlLogicalResponse } from './remote-runtime/requests/remote-runtime-shared-control-subscriptions' import { refreshSharedControlPendingRequestTimeouts, resolveSharedControlPendingResponse diff --git a/src/shared/remote-runtime-shared-control-frame-handler.ts b/src/shared/remote-runtime-shared-control-frame-handler.ts index 903ead94d6c..61b8364db91 100644 --- a/src/shared/remote-runtime-shared-control-frame-handler.ts +++ b/src/shared/remote-runtime-shared-control-frame-handler.ts @@ -3,11 +3,11 @@ import { remoteRuntimeAuthReplyError, remoteRuntimeReadyError, remoteRuntimeUnavailableError -} from './remote-runtime-request-frames' +} from './remote-runtime/requests/remote-runtime-request-frames' import type { RemoteRuntimeClientError } from './remote-runtime-client-error' import { dispatchSharedControlFrame } from './remote-runtime-shared-control-frame-dispatch' import { parseSharedControlFrame } from './remote-runtime-shared-control-protocol' -import type { SharedControlRetiredRequestIds } from './remote-runtime-shared-control-retired-request-ids' +import type { SharedControlRetiredRequestIds } from './remote-runtime/requests/remote-runtime-shared-control-retired-request-ids' import { resolveSharedControlReadyWaiters } from './remote-runtime-shared-control-state' import type { SharedControlConnectionState, diff --git a/src/shared/remote-runtime-shared-control-keepalive-refresh.test.ts b/src/shared/remote-runtime-shared-control-keepalive-refresh.test.ts index 736a79bd905..e93ea26a818 100644 --- a/src/shared/remote-runtime-shared-control-keepalive-refresh.test.ts +++ b/src/shared/remote-runtime-shared-control-keepalive-refresh.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { requestSharedControl } from './remote-runtime-shared-control-requests' +import { requestSharedControl } from './remote-runtime/requests/remote-runtime-shared-control-requests' import { refreshSharedControlPendingRequestTimeouts, resolveSharedControlPendingResponse diff --git a/src/shared/remote-runtime-shared-control-open.ts b/src/shared/remote-runtime-shared-control-open.ts index db6d0f174cb..541002f91aa 100644 --- a/src/shared/remote-runtime-shared-control-open.ts +++ b/src/shared/remote-runtime-shared-control-open.ts @@ -1,11 +1,11 @@ import type WebSocket from 'ws' import type { PairedRuntimeConnection } from './paired-runtime-connection' import type { RemoteRuntimeClientError } from './remote-runtime-client-error' -import { remoteRuntimeUnavailableError } from './remote-runtime-request-frames' +import { remoteRuntimeUnavailableError } from './remote-runtime/requests/remote-runtime-request-frames' import { openRemoteRuntimeWebSocket, type RemoteRuntimeWebSocket -} from './remote-runtime-request-websocket' +} from './remote-runtime/requests/remote-runtime-request-websocket' import { formatSharedControlCloseMessage } from './remote-runtime-shared-control-protocol' import { startRemoteRuntimeSocketLiveness, diff --git a/src/shared/remote-runtime-shared-control-protocol.ts b/src/shared/remote-runtime-shared-control-protocol.ts index 347c8b4204c..337e1631f32 100644 --- a/src/shared/remote-runtime-shared-control-protocol.ts +++ b/src/shared/remote-runtime-shared-control-protocol.ts @@ -5,7 +5,7 @@ import { serializeRemoteRuntimePayload } from './remote-runtime-memory-limits' import { invalidRemoteRuntimeResponseError, parseRemoteRuntimeRpcFrame -} from './remote-runtime-request-frames' +} from './remote-runtime/requests/remote-runtime-request-frames' import type { SharedControlConnectionState, SharedControlLogicalSubscription diff --git a/src/shared/remote-runtime-shared-control-ready.ts b/src/shared/remote-runtime-shared-control-ready.ts index e653d00fa01..f769f51674f 100644 --- a/src/shared/remote-runtime-shared-control-ready.ts +++ b/src/shared/remote-runtime-shared-control-ready.ts @@ -3,7 +3,7 @@ import WebSocket from 'ws' import { abortSignalReason } from './abort-signal-reason' import { RemoteRuntimeClientError } from './remote-runtime-client-error' import { REMOTE_RUNTIME_MAX_READY_WAITERS } from './remote-runtime-memory-limits' -import { remoteRuntimeUnavailableError } from './remote-runtime-request-frames' +import { remoteRuntimeUnavailableError } from './remote-runtime/requests/remote-runtime-request-frames' import type { SharedControlConnectionState, SharedControlReadyWaiter diff --git a/src/shared/remote-runtime-shared-control-refusal.ts b/src/shared/remote-runtime-shared-control-refusal.ts index 141d1196f53..e8b38c0e026 100644 --- a/src/shared/remote-runtime-shared-control-refusal.ts +++ b/src/shared/remote-runtime-shared-control-refusal.ts @@ -1,5 +1,5 @@ import type { RemoteRuntimeClientError } from './remote-runtime-client-error' -import { remoteRuntimeUnavailableError } from './remote-runtime-request-frames' +import { remoteRuntimeUnavailableError } from './remote-runtime/requests/remote-runtime-request-frames' import type { SharedControlSocketGeneration } from './remote-runtime-shared-control-socket-generation' import type { SharedControlLogicalSubscription } from './remote-runtime-shared-control-types' diff --git a/src/shared/remote-runtime-shared-control-send.ts b/src/shared/remote-runtime-shared-control-send.ts index 2a7ff16cfa5..6db2715385b 100644 --- a/src/shared/remote-runtime-shared-control-send.ts +++ b/src/shared/remote-runtime-shared-control-send.ts @@ -1,5 +1,5 @@ -import { remoteRuntimeUnavailableError } from './remote-runtime-request-frames' -import { takeRemoteRuntimePreparedRequest } from './remote-runtime-prepared-request-admission' +import { remoteRuntimeUnavailableError } from './remote-runtime/requests/remote-runtime-request-frames' +import { takeRemoteRuntimePreparedRequest } from './remote-runtime/requests/remote-runtime-prepared-request-admission' import { finishSharedControlSubscription } from './remote-runtime-shared-control-state' import type { SharedControlLogicalSubscription, diff --git a/src/shared/remote-runtime-shared-control-socket-close.ts b/src/shared/remote-runtime-shared-control-socket-close.ts index ab3817f22ce..6e49cea0195 100644 --- a/src/shared/remote-runtime-shared-control-socket-close.ts +++ b/src/shared/remote-runtime-shared-control-socket-close.ts @@ -1,7 +1,7 @@ import type WebSocket from 'ws' import { logSharedControlSocketClose } from './remote-runtime-shared-control-diagnostics-log' import { closeSharedControlSocketState } from './remote-runtime-shared-control-state' -import { finishCloseAfterReadySubscriptions } from './remote-runtime-shared-control-subscriptions' +import { finishCloseAfterReadySubscriptions } from './remote-runtime/requests/remote-runtime-shared-control-subscriptions' import type { SharedControlConnectionState, SharedControlLogicalSubscription, diff --git a/src/shared/remote-runtime-shared-control-socket-generation.test.ts b/src/shared/remote-runtime-shared-control-socket-generation.test.ts index 37a95f0c12a..674a22c1162 100644 --- a/src/shared/remote-runtime-shared-control-socket-generation.test.ts +++ b/src/shared/remote-runtime-shared-control-socket-generation.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { remoteRuntimeUnavailableError } from './remote-runtime-request-frames' +import { remoteRuntimeUnavailableError } from './remote-runtime/requests/remote-runtime-request-frames' import { SharedControlSocketGeneration } from './remote-runtime-shared-control-socket-generation' describe('SharedControlSocketGeneration', () => { diff --git a/src/shared/remote-runtime-shared-control-state.ts b/src/shared/remote-runtime-shared-control-state.ts index c482de6f6ef..48ad5633eae 100644 --- a/src/shared/remote-runtime-shared-control-state.ts +++ b/src/shared/remote-runtime-shared-control-state.ts @@ -1,6 +1,6 @@ import type { RemoteRuntimeClientError } from './remote-runtime-client-error' -import { releaseRemoteRuntimePreparedRequest } from './remote-runtime-prepared-request-admission' -import { remoteRuntimeUnavailableError } from './remote-runtime-request-frames' +import { releaseRemoteRuntimePreparedRequest } from './remote-runtime/requests/remote-runtime-prepared-request-admission' +import { remoteRuntimeUnavailableError } from './remote-runtime/requests/remote-runtime-request-frames' import type { RuntimeRpcResponse } from './runtime-rpc-envelope' import type { SharedControlLogicalSubscription, diff --git a/src/shared/remote-runtime-shared-control-types.ts b/src/shared/remote-runtime-shared-control-types.ts index c2b89b0c3d5..2ce51d30226 100644 --- a/src/shared/remote-runtime-shared-control-types.ts +++ b/src/shared/remote-runtime-shared-control-types.ts @@ -1,6 +1,6 @@ import type { RuntimeRpcResponse } from './runtime-rpc-envelope' import type { RemoteRuntimeClientError } from './remote-runtime-client-error' -import type { RemoteRuntimePreparedRequest } from './remote-runtime-prepared-request-admission' +import type { RemoteRuntimePreparedRequest } from './remote-runtime/requests/remote-runtime-prepared-request-admission' import type { RuntimeCapability } from './protocol-version' import type { RemoteRuntimeSocketLivenessOptions } from './remote-runtime-socket-liveness' diff --git a/src/shared/remote-runtime-transport-error-agreement.test.ts b/src/shared/remote-runtime-transport-error-agreement.test.ts index 1e911f640c7..33b9403df37 100644 --- a/src/shared/remote-runtime-transport-error-agreement.test.ts +++ b/src/shared/remote-runtime-transport-error-agreement.test.ts @@ -40,7 +40,7 @@ import { remoteRuntimeReadyError, remoteRuntimeTimeoutError, remoteRuntimeUnavailableError -} from './remote-runtime-request-frames' +} from './remote-runtime/requests/remote-runtime-request-frames' import { formatSharedControlCloseMessage } from './remote-runtime-shared-control-protocol' import { RuntimeRpcCallQueueOverloadError } from './runtime-rpc-call-queue' import { withRemoteRuntimeTailscaleHint } from './remote-runtime-tailscale-hint' diff --git a/src/shared/remote-runtime-prepared-request-admission.ts b/src/shared/remote-runtime/requests/remote-runtime-prepared-request-admission.ts similarity index 95% rename from src/shared/remote-runtime-prepared-request-admission.ts rename to src/shared/remote-runtime/requests/remote-runtime-prepared-request-admission.ts index 5584d4d5103..89d68751b01 100644 --- a/src/shared/remote-runtime-prepared-request-admission.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-prepared-request-admission.ts @@ -1,12 +1,12 @@ -import { RemoteRuntimeClientError } from './remote-runtime-client-error' +import { RemoteRuntimeClientError } from '../../remote-runtime-client-error' import { REMOTE_RUNTIME_MAX_PENDING_REQUESTS, REMOTE_RUNTIME_MAX_PENDING_RPC_BYTES, REMOTE_RUNTIME_MAX_PROCESS_PENDING_REQUESTS, REMOTE_RUNTIME_MAX_PROCESS_PENDING_RPC_BYTES, retainedRemoteRuntimeJsonStringBytes -} from './remote-runtime-memory-limits' -import type { RuntimeRpcResponse } from './runtime-rpc-envelope' +} from '../../remote-runtime-memory-limits' +import type { RuntimeRpcResponse } from '../../runtime-rpc-envelope' export type RemoteRuntimePreparedRequest = { retainedBytes: number diff --git a/src/shared/remote-runtime-request-connection-stale.test.ts b/src/shared/remote-runtime/requests/remote-runtime-request-connection-stale.test.ts similarity index 95% rename from src/shared/remote-runtime-request-connection-stale.test.ts rename to src/shared/remote-runtime/requests/remote-runtime-request-connection-stale.test.ts index 867f3ef82b9..4eeb2782376 100644 --- a/src/shared/remote-runtime-request-connection-stale.test.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-request-connection-stale.test.ts @@ -1,9 +1,9 @@ -import { pairedRuntimeConnectionFromOffer } from './paired-runtime-connection' +import { pairedRuntimeConnectionFromOffer } from '../../paired-runtime-connection' import { beforeEach, describe, expect, it, vi } from 'vitest' import WebSocket from 'ws' -import type { PairingOffer } from './pairing' -import { decrypt, encrypt } from './e2ee-crypto' -import { createFixedKeyLegacyHandshakeForTest } from './paired-e2ee-fixed-key-test-fixture' +import type { PairingOffer } from '../../pairing' +import { decrypt, encrypt } from '../../e2ee-crypto' +import { createFixedKeyLegacyHandshakeForTest } from '../../paired-e2ee-fixed-key-test-fixture' import { getRemoteRuntimeRequestAdmissionEvidence } from './remote-runtime-prepared-request-admission' import type { RemoteRuntimeWebSocketCallbacks } from './remote-runtime-request-websocket' diff --git a/src/shared/remote-runtime-request-connection.test.ts b/src/shared/remote-runtime/requests/remote-runtime-request-connection.test.ts similarity index 96% rename from src/shared/remote-runtime-request-connection.test.ts rename to src/shared/remote-runtime/requests/remote-runtime-request-connection.test.ts index ba77c3f1edd..56fc5659b54 100644 --- a/src/shared/remote-runtime-request-connection.test.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-request-connection.test.ts @@ -1,11 +1,11 @@ import { pairedRuntimeConnectionFromOffer, type PairedRuntimeConnection -} from './paired-runtime-connection' +} from '../../paired-runtime-connection' import type { AddressInfo } from 'node:net' import { afterEach, describe, expect, it, vi } from 'vitest' import { WebSocketServer, type WebSocket } from 'ws' -import { encodePairingOffer, parsePairingCode } from './pairing' +import { encodePairingOffer, parsePairingCode } from '../../pairing' import { decrypt, deriveSharedKey, @@ -13,9 +13,9 @@ import { generateKeyPair, publicKeyFromBase64, publicKeyToBase64 -} from './e2ee-crypto' +} from '../../e2ee-crypto' import { RemoteRuntimeRequestConnection } from './remote-runtime-request-connection' -import { remoteRuntimeClientCapabilities } from './remote-runtime-client-capabilities' +import { remoteRuntimeClientCapabilities } from '../../remote-runtime-client-capabilities' type TestServer = { wss: WebSocketServer diff --git a/src/shared/remote-runtime-request-connection.ts b/src/shared/remote-runtime/requests/remote-runtime-request-connection.ts similarity index 93% rename from src/shared/remote-runtime-request-connection.ts rename to src/shared/remote-runtime/requests/remote-runtime-request-connection.ts index db48fa679f1..5b3c537a2bb 100644 --- a/src/shared/remote-runtime-request-connection.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-request-connection.ts @@ -1,10 +1,10 @@ import { randomUUID } from 'node:crypto' import WebSocket from 'ws' -import { abortSignalReason } from './abort-signal-reason' -import type { PairedRuntimeConnection } from './paired-runtime-connection' -import { scheduleOrphanedRemoteRuntimeSocketClose } from './remote-runtime-abort-orphaned-socket' -import { serializeRemoteRuntimeRpcRequest } from './remote-runtime-memory-limits' -import type { PairedE2EEClientHandshake } from './paired-e2ee-client-handshake' +import { abortSignalReason } from '../../abort-signal-reason' +import type { PairedRuntimeConnection } from '../../paired-runtime-connection' +import { scheduleOrphanedRemoteRuntimeSocketClose } from '../../remote-runtime-abort-orphaned-socket' +import { serializeRemoteRuntimeRpcRequest } from '../../remote-runtime-memory-limits' +import type { PairedE2EEClientHandshake } from '../../paired-e2ee-client-handshake' import { prepareRemoteRuntimeRequest, releaseRemoteRuntimePreparedRequest, @@ -21,7 +21,7 @@ import { remoteRuntimeUnavailableError } from './remote-runtime-request-frames' import { settleRemoteRuntimeRequestRpcFrame } from './remote-runtime-request-rpc-frame' -import type { RuntimeRpcResponse } from './runtime-rpc-envelope' +import type { RuntimeRpcResponse } from '../../runtime-rpc-envelope' import { rejectRemoteRuntimeRequestReadyWaiters, resolveRemoteRuntimeRequestReadyWaiters, @@ -29,9 +29,9 @@ import { type RemoteRuntimeRequestReadyWaiter } from './remote-runtime-request-ready-waiters' import { openRemoteRuntimeWebSocket } from './remote-runtime-request-websocket' -import { sendRemoteRuntimeTokenAuth } from './remote-runtime-client-handshake' -import { remoteRuntimeClientCapabilities } from './remote-runtime-client-capabilities' -import type { RuntimeCapability } from './protocol-version' +import { sendRemoteRuntimeTokenAuth } from '../../remote-runtime-client-handshake' +import { remoteRuntimeClientCapabilities } from '../../remote-runtime-client-capabilities' +import type { RuntimeCapability } from '../../protocol-version' type ConnectionState = 'closed' | 'awaiting_ready' | 'awaiting_authenticated' | 'ready' const IDLE_CLOSE_MS = 60_000 diff --git a/src/shared/remote-runtime-request-frames.test.ts b/src/shared/remote-runtime/requests/remote-runtime-request-frames.test.ts similarity index 93% rename from src/shared/remote-runtime-request-frames.test.ts rename to src/shared/remote-runtime/requests/remote-runtime-request-frames.test.ts index 225977e7f05..6dfdd52b466 100644 --- a/src/shared/remote-runtime-request-frames.test.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-request-frames.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { createRemoteRuntimeClientHandshake } from './remote-runtime-client-handshake' +import { createRemoteRuntimeClientHandshake } from '../../remote-runtime-client-handshake' import { parseRemoteRuntimeRpcFrame, remoteRuntimeAuthReplyError, diff --git a/src/shared/remote-runtime-request-frames.ts b/src/shared/remote-runtime/requests/remote-runtime-request-frames.ts similarity index 90% rename from src/shared/remote-runtime-request-frames.ts rename to src/shared/remote-runtime/requests/remote-runtime-request-frames.ts index eb9f7e8e179..0530e6b82e9 100644 --- a/src/shared/remote-runtime-request-frames.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-request-frames.ts @@ -2,10 +2,13 @@ import { RuntimeRpcEnvelopeSchema, type RuntimeRpcResponse, isKeepaliveFrame -} from './runtime-rpc-envelope' -import { RemoteRuntimeClientError } from './remote-runtime-client-error' -import { assertJsonTextStructureWithinLimits } from './json-text-structure-limit' -import type { PairedE2EEAuthReply, PairedE2EEReadyVerdict } from './paired-e2ee-client-handshake' +} from '../../runtime-rpc-envelope' +import { RemoteRuntimeClientError } from '../../remote-runtime-client-error' +import { assertJsonTextStructureWithinLimits } from '../../json-text-structure-limit' +import type { + PairedE2EEAuthReply, + PairedE2EEReadyVerdict +} from '../../paired-e2ee-client-handshake' export const REMOTE_RUNTIME_JSON_STRUCTURE_LIMITS = { structuralTokens: 256 * 1024, diff --git a/src/shared/remote-runtime-request-ready-waiters.ts b/src/shared/remote-runtime/requests/remote-runtime-request-ready-waiters.ts similarity index 95% rename from src/shared/remote-runtime-request-ready-waiters.ts rename to src/shared/remote-runtime/requests/remote-runtime-request-ready-waiters.ts index 9bc15f9b405..c26041242e3 100644 --- a/src/shared/remote-runtime-request-ready-waiters.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-request-ready-waiters.ts @@ -1,4 +1,4 @@ -import { abortSignalReason } from './abort-signal-reason' +import { abortSignalReason } from '../../abort-signal-reason' export type RemoteRuntimeRequestReadyWaiter = { resolve: () => void diff --git a/src/shared/remote-runtime-request-response-router.test.ts b/src/shared/remote-runtime/requests/remote-runtime-request-response-router.test.ts similarity index 93% rename from src/shared/remote-runtime-request-response-router.test.ts rename to src/shared/remote-runtime/requests/remote-runtime-request-response-router.test.ts index dc5e42d7c6c..af099e5c746 100644 --- a/src/shared/remote-runtime-request-response-router.test.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-request-response-router.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from 'vitest' -import { encrypt } from './e2ee-crypto' +import { encrypt } from '../../e2ee-crypto' import { RemoteRuntimeRequestResponseRouter } from './remote-runtime-request-response-router' -import { createFixedKeyLegacyHandshakeForTest } from './paired-e2ee-fixed-key-test-fixture' +import { createFixedKeyLegacyHandshakeForTest } from '../../paired-e2ee-fixed-key-test-fixture' const SHARED_KEY = new Uint8Array(32).fill(7) diff --git a/src/shared/remote-runtime-request-response-router.ts b/src/shared/remote-runtime/requests/remote-runtime-request-response-router.ts similarity index 94% rename from src/shared/remote-runtime-request-response-router.ts rename to src/shared/remote-runtime/requests/remote-runtime-request-response-router.ts index 2be90754fc2..cd269bdb0da 100644 --- a/src/shared/remote-runtime-request-response-router.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-request-response-router.ts @@ -1,13 +1,13 @@ -import type { PairedE2EEClientHandshake } from './paired-e2ee-client-handshake' -import type { RemoteRuntimeHandshakeState } from './remote-runtime-client-handshake' -import { RemoteRuntimeClientError } from './remote-runtime-client-error' +import type { PairedE2EEClientHandshake } from '../../paired-e2ee-client-handshake' +import type { RemoteRuntimeHandshakeState } from '../../remote-runtime-client-handshake' +import { RemoteRuntimeClientError } from '../../remote-runtime-client-error' import { isKeepaliveFrame, RuntimeRpcEnvelopeSchema, type RuntimeRpcResponse -} from './runtime-rpc-envelope' +} from '../../runtime-rpc-envelope' import { parseRemoteRuntimeJsonText } from './remote-runtime-request-frames' -import type { RuntimeStatus } from './runtime-types' +import type { RuntimeStatus } from '../../runtime-types' type RequestResponseRouterOptions = { handshake: PairedE2EEClientHandshake diff --git a/src/shared/remote-runtime-request-rpc-frame.ts b/src/shared/remote-runtime/requests/remote-runtime-request-rpc-frame.ts similarity index 100% rename from src/shared/remote-runtime-request-rpc-frame.ts rename to src/shared/remote-runtime/requests/remote-runtime-request-rpc-frame.ts diff --git a/src/shared/remote-runtime-request-socket.ts b/src/shared/remote-runtime/requests/remote-runtime-request-socket.ts similarity index 91% rename from src/shared/remote-runtime-request-socket.ts rename to src/shared/remote-runtime/requests/remote-runtime-request-socket.ts index b29ddf11f65..528ebcfc9ba 100644 --- a/src/shared/remote-runtime-request-socket.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-request-socket.ts @@ -1,33 +1,33 @@ import { randomUUID } from 'node:crypto' import WebSocket from 'ws' -import { abortSignalReason, throwIfSignalAborted } from './abort-signal-reason' -import type { PairedRuntimeConnection } from './paired-runtime-connection' -import type { RuntimeCapability } from './protocol-version' -import { remoteRuntimeClientCapabilities } from './remote-runtime-client-capabilities' +import { abortSignalReason, throwIfSignalAborted } from '../../abort-signal-reason' +import type { PairedRuntimeConnection } from '../../paired-runtime-connection' +import type { RuntimeCapability } from '../../protocol-version' +import { remoteRuntimeClientCapabilities } from '../../remote-runtime-client-capabilities' import { createRemoteRuntimeClientHandshake, formatRemoteRuntimeCloseMessage, ignoreSettledRemoteRuntimeSocketError -} from './remote-runtime-client-handshake' -import { RemoteRuntimeClientError } from './remote-runtime-client-error' +} from '../../remote-runtime-client-handshake' +import { RemoteRuntimeClientError } from '../../remote-runtime-client-error' import { remoteRuntimeConnectFailureMessage, remoteRuntimeConnectOptions -} from './remote-runtime-connect-bound' +} from '../../remote-runtime-connect-bound' import { REMOTE_RUNTIME_MAX_WEBSOCKET_FRAME_BYTES, serializeRemoteRuntimePayload, serializeRemoteRuntimeRpcRequest -} from './remote-runtime-memory-limits' +} from '../../remote-runtime-memory-limits' import { prepareRemoteRuntimeRequest, releaseRemoteRuntimePreparedRequest, takeRemoteRuntimePreparedRequest } from './remote-runtime-prepared-request-admission' import { RemoteRuntimeRequestResponseRouter } from './remote-runtime-request-response-router' -import type { RuntimeOrchestrationEnvelope, RuntimeRpcResponse } from './runtime-rpc-envelope' -import type { RuntimeStatus } from './runtime-types' -import { isSafeTimerDelayMs, MAX_TIMER_DELAY_MS } from './timer-delay' +import type { RuntimeOrchestrationEnvelope, RuntimeRpcResponse } from '../../runtime-rpc-envelope' +import type { RuntimeStatus } from '../../runtime-types' +import { isSafeTimerDelayMs, MAX_TIMER_DELAY_MS } from '../../timer-delay' export async function sendRemoteRuntimeRequestOnSocket( connection: PairedRuntimeConnection, diff --git a/src/shared/remote-runtime-request-websocket.test.ts b/src/shared/remote-runtime/requests/remote-runtime-request-websocket.test.ts similarity index 91% rename from src/shared/remote-runtime-request-websocket.test.ts rename to src/shared/remote-runtime/requests/remote-runtime-request-websocket.test.ts index 60d87911473..f7d032eb86f 100644 --- a/src/shared/remote-runtime-request-websocket.test.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-request-websocket.test.ts @@ -1,9 +1,9 @@ -import { pairedRuntimeConnectionFromOffer } from './paired-runtime-connection' +import { pairedRuntimeConnectionFromOffer } from '../../paired-runtime-connection' import type { EventEmitter } from 'node:events' import { describe, expect, it, vi } from 'vitest' -import { generateKeyPair, publicKeyToBase64 } from './e2ee-crypto' +import { generateKeyPair, publicKeyToBase64 } from '../../e2ee-crypto' import { openRemoteRuntimeWebSocket } from './remote-runtime-request-websocket' -import { REMOTE_RUNTIME_MAX_WEBSOCKET_FRAME_BYTES } from './remote-runtime-memory-limits' +import { REMOTE_RUNTIME_MAX_WEBSOCKET_FRAME_BYTES } from '../../remote-runtime-memory-limits' import { WebSocketServer } from 'ws' describe('openRemoteRuntimeWebSocket', () => { diff --git a/src/shared/remote-runtime-request-websocket.ts b/src/shared/remote-runtime/requests/remote-runtime-request-websocket.ts similarity index 90% rename from src/shared/remote-runtime-request-websocket.ts rename to src/shared/remote-runtime/requests/remote-runtime-request-websocket.ts index 02b243cca36..400a12006c5 100644 --- a/src/shared/remote-runtime-request-websocket.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-request-websocket.ts @@ -1,13 +1,13 @@ import WebSocket from 'ws' -import type { PairedRuntimeConnection } from './paired-runtime-connection' -import type { PairedE2EEClientHandshake } from './paired-e2ee-client-handshake' -import { createRemoteRuntimeClientHandshake } from './remote-runtime-client-handshake' -import { RemoteRuntimeClientError } from './remote-runtime-client-error' +import type { PairedRuntimeConnection } from '../../paired-runtime-connection' +import type { PairedE2EEClientHandshake } from '../../paired-e2ee-client-handshake' +import { createRemoteRuntimeClientHandshake } from '../../remote-runtime-client-handshake' +import { RemoteRuntimeClientError } from '../../remote-runtime-client-error' import { remoteRuntimeConnectFailureMessage, remoteRuntimeConnectOptions -} from './remote-runtime-connect-bound' -import { REMOTE_RUNTIME_MAX_WEBSOCKET_FRAME_BYTES } from './remote-runtime-memory-limits' +} from '../../remote-runtime-connect-bound' +import { REMOTE_RUNTIME_MAX_WEBSOCKET_FRAME_BYTES } from '../../remote-runtime-memory-limits' import { invalidRemoteRuntimeResponseError, remoteRuntimeUnavailableError diff --git a/src/shared/remote-runtime-shared-control-requests.ts b/src/shared/remote-runtime/requests/remote-runtime-shared-control-requests.ts similarity index 89% rename from src/shared/remote-runtime-shared-control-requests.ts rename to src/shared/remote-runtime/requests/remote-runtime-shared-control-requests.ts index 32cfe83f01c..d549f90c5d2 100644 --- a/src/shared/remote-runtime-shared-control-requests.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-shared-control-requests.ts @@ -1,16 +1,16 @@ import { randomUUID } from 'node:crypto' -import { abortSignalReason } from './abort-signal-reason' -import { serializeRemoteRuntimeRpcRequest } from './remote-runtime-memory-limits' +import { abortSignalReason } from '../../abort-signal-reason' +import { serializeRemoteRuntimeRpcRequest } from '../../remote-runtime-memory-limits' import { prepareRemoteRuntimeRequest, releaseRemoteRuntimePreparedRequest, type RemoteRuntimePreparedRequest } from './remote-runtime-prepared-request-admission' import { remoteRuntimeTimeoutError } from './remote-runtime-request-frames' -import type { RuntimeOrchestrationEnvelope, RuntimeRpcResponse } from './runtime-rpc-envelope' -import { toRemoteRuntimeClientError } from './remote-runtime-shared-control-protocol' -import { rejectSharedControlPendingRequest } from './remote-runtime-shared-control-state' -import type { SharedControlPendingRequest } from './remote-runtime-shared-control-types' +import type { RuntimeOrchestrationEnvelope, RuntimeRpcResponse } from '../../runtime-rpc-envelope' +import { toRemoteRuntimeClientError } from '../../remote-runtime-shared-control-protocol' +import { rejectSharedControlPendingRequest } from '../../remote-runtime-shared-control-state' +import type { SharedControlPendingRequest } from '../../remote-runtime-shared-control-types' const MAX_RETAINED_METHOD_CHARS = 256 diff --git a/src/shared/remote-runtime-shared-control-retired-request-ids.test.ts b/src/shared/remote-runtime/requests/remote-runtime-shared-control-retired-request-ids.test.ts similarity index 100% rename from src/shared/remote-runtime-shared-control-retired-request-ids.test.ts rename to src/shared/remote-runtime/requests/remote-runtime-shared-control-retired-request-ids.test.ts diff --git a/src/shared/remote-runtime-shared-control-retired-request-ids.ts b/src/shared/remote-runtime/requests/remote-runtime-shared-control-retired-request-ids.ts similarity index 100% rename from src/shared/remote-runtime-shared-control-retired-request-ids.ts rename to src/shared/remote-runtime/requests/remote-runtime-shared-control-retired-request-ids.ts diff --git a/src/shared/remote-runtime-shared-control-subscription-close.test.ts b/src/shared/remote-runtime/requests/remote-runtime-shared-control-subscription-close.test.ts similarity index 95% rename from src/shared/remote-runtime-shared-control-subscription-close.test.ts rename to src/shared/remote-runtime/requests/remote-runtime-shared-control-subscription-close.test.ts index 8020dfb6dad..37d34b9ae69 100644 --- a/src/shared/remote-runtime-shared-control-subscription-close.test.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-shared-control-subscription-close.test.ts @@ -5,7 +5,7 @@ import { sendRetiredSharedControlCleanupRequest } from './remote-runtime-shared-control-subscription-close' import { createSharedControlSubscription } from './remote-runtime-shared-control-subscriptions' -import type { SharedControlLogicalSubscription } from './remote-runtime-shared-control-types' +import type { SharedControlLogicalSubscription } from '../../remote-runtime-shared-control-types' describe('shared-control subscription retirement', () => { it('retires a closed subscription and its cleanup request', () => { diff --git a/src/shared/remote-runtime-shared-control-subscription-close.ts b/src/shared/remote-runtime/requests/remote-runtime-shared-control-subscription-close.ts similarity index 93% rename from src/shared/remote-runtime-shared-control-subscription-close.ts rename to src/shared/remote-runtime/requests/remote-runtime-shared-control-subscription-close.ts index 7ba60c9d624..be623685d03 100644 --- a/src/shared/remote-runtime-shared-control-subscription-close.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-shared-control-subscription-close.ts @@ -3,7 +3,7 @@ import { closeSharedControlLogicalSubscription, sendSharedControlCleanupRequest } from './remote-runtime-shared-control-subscriptions' -import type { SharedControlLogicalSubscription } from './remote-runtime-shared-control-types' +import type { SharedControlLogicalSubscription } from '../../remote-runtime-shared-control-types' export function closeSharedControlConnectionSubscription(args: { subscriptions: Map> diff --git a/src/shared/remote-runtime-shared-control-subscription-start.test.ts b/src/shared/remote-runtime/requests/remote-runtime-shared-control-subscription-start.test.ts similarity index 96% rename from src/shared/remote-runtime-shared-control-subscription-start.test.ts rename to src/shared/remote-runtime/requests/remote-runtime-shared-control-subscription-start.test.ts index 65f1258165d..1cff5de96b6 100644 --- a/src/shared/remote-runtime-shared-control-subscription-start.test.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-shared-control-subscription-start.test.ts @@ -3,7 +3,7 @@ import { startSharedControlSubscription } from './remote-runtime-shared-control- import { closeSharedControlConnectionSubscription } from './remote-runtime-shared-control-subscription-close' import { handleSharedControlLogicalResponse } from './remote-runtime-shared-control-subscriptions' import { SharedControlRetiredRequestIds } from './remote-runtime-shared-control-retired-request-ids' -import type { SharedControlLogicalSubscription } from './remote-runtime-shared-control-types' +import type { SharedControlLogicalSubscription } from '../../remote-runtime-shared-control-types' it.each([true, false])( 'cleans up replayed setup aborted with host id known=%s', diff --git a/src/shared/remote-runtime-shared-control-subscription-start.ts b/src/shared/remote-runtime/requests/remote-runtime-shared-control-subscription-start.ts similarity index 89% rename from src/shared/remote-runtime-shared-control-subscription-start.ts rename to src/shared/remote-runtime/requests/remote-runtime-shared-control-subscription-start.ts index 74410d4b07c..9f3570f3e2e 100644 --- a/src/shared/remote-runtime-shared-control-subscription-start.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-shared-control-subscription-start.ts @@ -1,13 +1,13 @@ -import { throwIfSignalAborted } from './abort-signal-reason' +import { throwIfSignalAborted } from '../../abort-signal-reason' import { randomUUID } from 'node:crypto' import { remoteRuntimeUnavailableError } from './remote-runtime-request-frames' -import { admitSharedControlSubscription } from './remote-runtime-shared-control-admission' +import { admitSharedControlSubscription } from '../../remote-runtime-shared-control-admission' import { createSharedControlSubscription } from './remote-runtime-shared-control-subscriptions' import type { RemoteRuntimeSharedSubscription, SharedControlLogicalSubscription, SharedControlSubscriptionCallbacks -} from './remote-runtime-shared-control-types' +} from '../../remote-runtime-shared-control-types' export async function startSharedControlSubscription(args: { subscriptions: Map> diff --git a/src/shared/remote-runtime-shared-control-subscriptions.test.ts b/src/shared/remote-runtime/requests/remote-runtime-shared-control-subscriptions.test.ts similarity index 97% rename from src/shared/remote-runtime-shared-control-subscriptions.test.ts rename to src/shared/remote-runtime/requests/remote-runtime-shared-control-subscriptions.test.ts index de5d5718b55..735e9848152 100644 --- a/src/shared/remote-runtime-shared-control-subscriptions.test.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-shared-control-subscriptions.test.ts @@ -1,12 +1,12 @@ import { describe, expect, it, vi } from 'vitest' -import type { RuntimeRpcResponse } from './runtime-rpc-envelope' +import type { RuntimeRpcResponse } from '../../runtime-rpc-envelope' import { closeSharedControlLogicalSubscription, createSharedControlSubscription, handleSharedControlLogicalResponse, replaySharedControlSubscriptions } from './remote-runtime-shared-control-subscriptions' -import type { SharedControlLogicalSubscription } from './remote-runtime-shared-control-types' +import type { SharedControlLogicalSubscription } from '../../remote-runtime-shared-control-types' function makeSubscriptions(): { subscriptions: Map> diff --git a/src/shared/remote-runtime-shared-control-subscriptions.ts b/src/shared/remote-runtime/requests/remote-runtime-shared-control-subscriptions.ts similarity index 94% rename from src/shared/remote-runtime-shared-control-subscriptions.ts rename to src/shared/remote-runtime/requests/remote-runtime-shared-control-subscriptions.ts index 4a93076d23f..1d2d048ca4b 100644 --- a/src/shared/remote-runtime-shared-control-subscriptions.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-shared-control-subscriptions.ts @@ -1,14 +1,14 @@ import { randomUUID } from 'node:crypto' -import type { RuntimeRpcResponse } from './runtime-rpc-envelope' -import { getCleanupRequest, getSubscriptionId } from './remote-runtime-shared-control-protocol' +import type { RuntimeRpcResponse } from '../../runtime-rpc-envelope' +import { getCleanupRequest, getSubscriptionId } from '../../remote-runtime-shared-control-protocol' import { finishSharedControlSubscription, handleSharedControlSubscriptionResponse -} from './remote-runtime-shared-control-state' +} from '../../remote-runtime-shared-control-state' import type { SharedControlLogicalSubscription, SharedControlSubscriptionCallbacks -} from './remote-runtime-shared-control-types' +} from '../../remote-runtime-shared-control-types' export function createSharedControlSubscription(args: { requestId: string diff --git a/src/shared/remote-runtime-subscription-connect-bound.test.ts b/src/shared/remote-runtime/requests/remote-runtime-subscription-connect-bound.test.ts similarity index 93% rename from src/shared/remote-runtime-subscription-connect-bound.test.ts rename to src/shared/remote-runtime/requests/remote-runtime-subscription-connect-bound.test.ts index 5af5df39b59..7cc4f3ba228 100644 --- a/src/shared/remote-runtime-subscription-connect-bound.test.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-subscription-connect-bound.test.ts @@ -1,4 +1,4 @@ -import { pairedRuntimeConnectionFromOffer } from './paired-runtime-connection' +import { pairedRuntimeConnectionFromOffer } from '../../paired-runtime-connection' /** * The subscribe path is the one that regressed: its connect failure rejects the subscribe * promise rather than reaching `onError`, and that rejection crosses `ipcMain.handle`, which @@ -9,14 +9,14 @@ import { pairedRuntimeConnectionFromOffer } from './paired-runtime-connection' */ import { createServer, type Server, type Socket } from 'node:net' import { afterEach, describe, expect, it, vi } from 'vitest' -import { generateKeyPair, publicKeyToBase64 } from './e2ee-crypto' -import { RemoteRuntimeClientError } from './remote-runtime-client-error' +import { generateKeyPair, publicKeyToBase64 } from '../../e2ee-crypto' +import { RemoteRuntimeClientError } from '../../remote-runtime-client-error' import { isRecoverableRemoteRuntimeConnectionError, toRemoteRuntimeClientErrorLike -} from './remote-runtime-client-error-classification' +} from '../../remote-runtime-client-error-classification' import { subscribeRemoteRuntimeTransport } from './remote-runtime-subscription-transport' -import { withRemoteRuntimeTailscaleHint } from './remote-runtime-tailscale-hint' +import { withRemoteRuntimeTailscaleHint } from '../../remote-runtime-tailscale-hint' const servers = new Set() const sockets = new Set() diff --git a/src/shared/remote-runtime-subscription-contract.ts b/src/shared/remote-runtime/requests/remote-runtime-subscription-contract.ts similarity index 79% rename from src/shared/remote-runtime-subscription-contract.ts rename to src/shared/remote-runtime/requests/remote-runtime-subscription-contract.ts index 5d2d65f0ac1..f732c627509 100644 --- a/src/shared/remote-runtime-subscription-contract.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-subscription-contract.ts @@ -1,7 +1,7 @@ -import type { RemoteRuntimeClientError } from './remote-runtime-client-error' -import type { RuntimeCapability } from './protocol-version' -import type { RuntimeRpcResponse } from './runtime-rpc-envelope' -import type { RemoteRuntimeSocketLivenessOptions } from './remote-runtime-socket-liveness' +import type { RemoteRuntimeClientError } from '../../remote-runtime-client-error' +import type { RuntimeCapability } from '../../protocol-version' +import type { RuntimeRpcResponse } from '../../runtime-rpc-envelope' +import type { RemoteRuntimeSocketLivenessOptions } from '../../remote-runtime-socket-liveness' import type { RemoteRuntimeOutboundMemoryBudget, RemoteRuntimeOutboundQueueOptions diff --git a/src/shared/remote-runtime-subscription-frame-router.test.ts b/src/shared/remote-runtime/requests/remote-runtime-subscription-frame-router.test.ts similarity index 94% rename from src/shared/remote-runtime-subscription-frame-router.test.ts rename to src/shared/remote-runtime/requests/remote-runtime-subscription-frame-router.test.ts index bcb0f2dee7d..fb75252bf76 100644 --- a/src/shared/remote-runtime-subscription-frame-router.test.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-subscription-frame-router.test.ts @@ -1,9 +1,9 @@ import { Buffer } from 'node:buffer' import { describe, expect, it, vi } from 'vitest' -import { encrypt, encryptBytes } from './e2ee-crypto' -import type { RemoteRuntimeClientError } from './remote-runtime-client-error' +import { encrypt, encryptBytes } from '../../e2ee-crypto' +import type { RemoteRuntimeClientError } from '../../remote-runtime-client-error' import { RemoteRuntimeSubscriptionFrameRouter } from './remote-runtime-subscription-frame-router' -import { createFixedKeyLegacyHandshakeForTest } from './paired-e2ee-fixed-key-test-fixture' +import { createFixedKeyLegacyHandshakeForTest } from '../../paired-e2ee-fixed-key-test-fixture' const SHARED_KEY = new Uint8Array(32).fill(7) diff --git a/src/shared/remote-runtime-subscription-frame-router.ts b/src/shared/remote-runtime/requests/remote-runtime-subscription-frame-router.ts similarity index 95% rename from src/shared/remote-runtime-subscription-frame-router.ts rename to src/shared/remote-runtime/requests/remote-runtime-subscription-frame-router.ts index c7b98e4ab6f..5f062e95139 100644 --- a/src/shared/remote-runtime-subscription-frame-router.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-subscription-frame-router.ts @@ -1,8 +1,8 @@ import type WebSocket from 'ws' -import type { PairedE2EEClientHandshake } from './paired-e2ee-client-handshake' -import type { RemoteRuntimeHandshakeState } from './remote-runtime-client-handshake' -import { RemoteRuntimeClientError } from './remote-runtime-client-error' -import { RuntimeRpcEnvelopeSchema, type RuntimeRpcResponse } from './runtime-rpc-envelope' +import type { PairedE2EEClientHandshake } from '../../paired-e2ee-client-handshake' +import type { RemoteRuntimeHandshakeState } from '../../remote-runtime-client-handshake' +import { RemoteRuntimeClientError } from '../../remote-runtime-client-error' +import { RuntimeRpcEnvelopeSchema, type RuntimeRpcResponse } from '../../runtime-rpc-envelope' import { parseRemoteRuntimeJsonText } from './remote-runtime-request-frames' type SubscriptionFrameRouterOptions = { diff --git a/src/shared/remote-runtime-subscription-outbound.ts b/src/shared/remote-runtime/requests/remote-runtime-subscription-outbound.ts similarity index 97% rename from src/shared/remote-runtime-subscription-outbound.ts rename to src/shared/remote-runtime/requests/remote-runtime-subscription-outbound.ts index 690e9d55888..29d6c32dad3 100644 --- a/src/shared/remote-runtime-subscription-outbound.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-subscription-outbound.ts @@ -1,6 +1,6 @@ import WebSocket from 'ws' -import { RemoteRuntimeClientError } from './remote-runtime-client-error' -import { createWsOutboundBackpressureQueue } from './ws-outbound-backpressure-queue' +import { RemoteRuntimeClientError } from '../../remote-runtime-client-error' +import { createWsOutboundBackpressureQueue } from '../../ws-outbound-backpressure-queue' export type RemoteRuntimeOutboundSocketMemory = { canSend: (bytes: number, alreadyRetained?: boolean) => boolean diff --git a/src/shared/remote-runtime-subscription-request-channel.ts b/src/shared/remote-runtime/requests/remote-runtime-subscription-request-channel.ts similarity index 89% rename from src/shared/remote-runtime-subscription-request-channel.ts rename to src/shared/remote-runtime/requests/remote-runtime-subscription-request-channel.ts index 02a0719b280..c4bd3530795 100644 --- a/src/shared/remote-runtime-subscription-request-channel.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-subscription-request-channel.ts @@ -1,11 +1,11 @@ import { randomUUID } from 'node:crypto' import type WebSocket from 'ws' -import type { PairedE2EEChannel } from './paired-e2ee-client-handshake' -import type { PairedRuntimeConnection } from './paired-runtime-connection' -import { RemoteRuntimeClientError } from './remote-runtime-client-error' -import { serializeRemoteRuntimeRpcRequest } from './remote-runtime-memory-limits' -import type { RuntimeRpcResponse } from './runtime-rpc-envelope' -import { isSafeTimerDelayMs, MAX_TIMER_DELAY_MS } from './timer-delay' +import type { PairedE2EEChannel } from '../../paired-e2ee-client-handshake' +import type { PairedRuntimeConnection } from '../../paired-runtime-connection' +import { RemoteRuntimeClientError } from '../../remote-runtime-client-error' +import { serializeRemoteRuntimeRpcRequest } from '../../remote-runtime-memory-limits' +import type { RuntimeRpcResponse } from '../../runtime-rpc-envelope' +import { isSafeTimerDelayMs, MAX_TIMER_DELAY_MS } from '../../timer-delay' type PendingRemoteRuntimeSubscriptionRequest = { resolve: (response: RuntimeRpcResponse) => void diff --git a/src/shared/remote-runtime-subscription-request.test.ts b/src/shared/remote-runtime/requests/remote-runtime-subscription-request.test.ts similarity index 98% rename from src/shared/remote-runtime-subscription-request.test.ts rename to src/shared/remote-runtime/requests/remote-runtime-subscription-request.test.ts index 2a8e01d3fd7..8c4903e8fb5 100644 --- a/src/shared/remote-runtime-subscription-request.test.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-subscription-request.test.ts @@ -1,7 +1,7 @@ import { pairedRuntimeConnectionFromOffer, type PairedRuntimeConnection -} from './paired-runtime-connection' +} from '../../paired-runtime-connection' import type { AddressInfo } from 'node:net' import { afterEach, describe, expect, it, vi } from 'vitest' import { WebSocketServer, type WebSocket } from 'ws' @@ -12,12 +12,12 @@ import { generateKeyPair, publicKeyFromBase64, publicKeyToBase64 -} from './e2ee-crypto' -import { encodePairingOffer, parsePairingCode } from './pairing' +} from '../../e2ee-crypto' +import { encodePairingOffer, parsePairingCode } from '../../pairing' import { subscribeRemoteRuntimeRequest, type RemoteRuntimeSubscription -} from './remote-runtime-client' +} from '../../remote-runtime-client' const servers: WebSocketServer[] = [] diff --git a/src/shared/remote-runtime-subscription-transport.ts b/src/shared/remote-runtime/requests/remote-runtime-subscription-transport.ts similarity index 93% rename from src/shared/remote-runtime-subscription-transport.ts rename to src/shared/remote-runtime/requests/remote-runtime-subscription-transport.ts index 6329b558183..553b1ef0dce 100644 --- a/src/shared/remote-runtime-subscription-transport.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-subscription-transport.ts @@ -1,31 +1,31 @@ -import { closeRemoteRuntimeSocket } from './remote-runtime-socket-close' -import { throwIfSignalAborted, abortSignalReason } from './abort-signal-reason' +import { closeRemoteRuntimeSocket } from '../../remote-runtime-socket-close' +import { throwIfSignalAborted, abortSignalReason } from '../../abort-signal-reason' import { randomUUID } from 'node:crypto' import WebSocket from 'ws' -import type { PairedRuntimeConnection } from './paired-runtime-connection' +import type { PairedRuntimeConnection } from '../../paired-runtime-connection' import { createRemoteRuntimeClientHandshake, formatRemoteRuntimeCloseMessage, ignoreSettledRemoteRuntimeSocketError -} from './remote-runtime-client-handshake' -import { RemoteRuntimeClientError } from './remote-runtime-client-error' +} from '../../remote-runtime-client-handshake' +import { RemoteRuntimeClientError } from '../../remote-runtime-client-error' import { remoteRuntimeConnectFailureMessage, remoteRuntimeConnectOptions -} from './remote-runtime-connect-bound' +} from '../../remote-runtime-connect-bound' import { isRemoteRuntimeBinaryFrameWithinLimit, REMOTE_RUNTIME_MAX_WEBSOCKET_FRAME_BYTES, serializeRemoteRuntimeRpcRequest -} from './remote-runtime-memory-limits' -import { remoteRuntimeClientCapabilities } from './remote-runtime-client-capabilities' +} from '../../remote-runtime-memory-limits' +import { remoteRuntimeClientCapabilities } from '../../remote-runtime-client-capabilities' import { RemoteRuntimeSubscriptionFrameRouter } from './remote-runtime-subscription-frame-router' import { RemoteRuntimeSubscriptionOutbound } from './remote-runtime-subscription-outbound' import { RemoteRuntimeSubscriptionRequestChannel } from './remote-runtime-subscription-request-channel' import { startRemoteRuntimeSocketLiveness, type RemoteRuntimeSocketLivenessMonitor -} from './remote-runtime-socket-liveness' +} from '../../remote-runtime-socket-liveness' import type { RemoteRuntimeSubscriptionOptions, RemoteRuntimeTransportSubscription,