mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
refactor: group remote runtime requests and subscriptions (#32952)
This commit is contained in:
@@ -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"
|
||||
]
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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<Server>()
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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<string, SharedControlPendingRequest<unknown>>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
+3
-3
@@ -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
|
||||
+4
-4
@@ -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'
|
||||
|
||||
+4
-4
@@ -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
|
||||
+9
-9
@@ -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
|
||||
|
||||
+1
-1
@@ -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,
|
||||
+7
-4
@@ -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,
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { abortSignalReason } from './abort-signal-reason'
|
||||
import { abortSignalReason } from '../../abort-signal-reason'
|
||||
|
||||
export type RemoteRuntimeRequestReadyWaiter = {
|
||||
resolve: () => void
|
||||
+2
-2
@@ -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)
|
||||
|
||||
+5
-5
@@ -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<TResult> = {
|
||||
handshake: PairedE2EEClientHandshake
|
||||
+11
-11
@@ -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<TResult>(
|
||||
connection: PairedRuntimeConnection,
|
||||
+3
-3
@@ -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', () => {
|
||||
+6
-6
@@ -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
|
||||
+6
-6
@@ -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
|
||||
|
||||
+1
-1
@@ -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', () => {
|
||||
+1
-1
@@ -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<string, SharedControlLogicalSubscription<unknown>>
|
||||
+1
-1
@@ -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',
|
||||
+3
-3
@@ -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<TResult>(args: {
|
||||
subscriptions: Map<string, SharedControlLogicalSubscription<unknown>>
|
||||
+2
-2
@@ -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<string, SharedControlLogicalSubscription<unknown>>
|
||||
+4
-4
@@ -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<TResult>(args: {
|
||||
requestId: string
|
||||
+5
-5
@@ -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<Server>()
|
||||
const sockets = new Set<Socket>()
|
||||
+4
-4
@@ -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
|
||||
+3
-3
@@ -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)
|
||||
|
||||
+4
-4
@@ -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<TResult> = {
|
||||
+2
-2
@@ -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
|
||||
+6
-6
@@ -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<unknown>) => void
|
||||
+4
-4
@@ -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[] = []
|
||||
|
||||
+9
-9
@@ -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,
|
||||
Reference in New Issue
Block a user