mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
refactor(runtime): import mobile-cloud-relay and browser-host helpers from their owning modules (#30279)
Removes the re-export lines in relay-region-preference, relay-session-broker, browser-host-page-placement and browser-host-page-reconciliation-plan (no barrels).
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { BrowserClientHostedPageInventory } from '../../../shared/browser-client-host-protocol'
|
||||
import type { BrowserClientPageExecutionHostGrant } from './browser-host-client-page-creation'
|
||||
import type { BrowserHostLeaseState } from './browser-host-lease-records'
|
||||
import type { RuntimeBrowserPlacement } from './browser-host-page-placement'
|
||||
import type { RuntimeBrowserPlacement } from '../../../shared/runtime-browser-placement'
|
||||
import type { BrowserHostRuntimePageIntent } from './browser-host-page-reconciliation-plan'
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { BrowserHostLeaseRegistry } from './browser-host-lease-registry'
|
||||
import type {
|
||||
BrowserClientPageAuthority,
|
||||
RuntimeBrowserClientPlacement
|
||||
} from './browser-host-page-placement'
|
||||
import type { BrowserClientPageAuthority } from './browser-host-page-placement'
|
||||
import type { RuntimeBrowserClientPlacement } from '../../../shared/runtime-browser-placement'
|
||||
|
||||
const registry = (reconnectGraceMs?: number): BrowserHostLeaseRegistry =>
|
||||
new BrowserHostLeaseRegistry({
|
||||
|
||||
@@ -19,10 +19,12 @@ import { issueBrowserHostClientPageCommand } from './browser-host-client-page-co
|
||||
import {
|
||||
BrowserHostPagePlacementRegistry,
|
||||
type BrowserClientPageAuthority,
|
||||
type BrowserPageRetirement,
|
||||
type RuntimeBrowserClientPlacement,
|
||||
type RuntimeBrowserPlacement
|
||||
type BrowserPageRetirement
|
||||
} from './browser-host-page-placement'
|
||||
import type {
|
||||
RuntimeBrowserClientPlacement,
|
||||
RuntimeBrowserPlacement
|
||||
} from '../../../shared/runtime-browser-placement'
|
||||
import { requireLiveBrowserClientPage } from './browser-host-page-authority'
|
||||
import type { BrowserHostFenceReason } from './browser-host-lease-fence'
|
||||
import { dispatchBrowserHostLeaseFence } from './browser-host-lease-fence-dispatch'
|
||||
|
||||
@@ -11,12 +11,6 @@ import {
|
||||
type BrowserHostPlacementIdentity
|
||||
} from './browser-host-page-placement-validation'
|
||||
|
||||
export type {
|
||||
RuntimeBrowserClientPlacement,
|
||||
RuntimeBrowserPlacement,
|
||||
RuntimeBrowserServerPlacement
|
||||
} from '../../../shared/runtime-browser-placement'
|
||||
|
||||
const DEFAULT_MAX_PAGE_PLACEMENTS = 256
|
||||
|
||||
export type BrowserPageRetirement = Readonly<{
|
||||
|
||||
@@ -7,9 +7,9 @@ import { assertBrowserHostPageCommandAdmission } from './browser-host-page-comma
|
||||
import type { BrowserHostLeaseState } from './browser-host-lease-records'
|
||||
import type {
|
||||
BrowserClientPagePlacementReservation,
|
||||
BrowserHostPagePlacementRegistry,
|
||||
RuntimeBrowserPlacement
|
||||
BrowserHostPagePlacementRegistry
|
||||
} from './browser-host-page-placement'
|
||||
import type { RuntimeBrowserPlacement } from '../../../shared/runtime-browser-placement'
|
||||
import type { BrowserHostPageReconciliationActions as ActionHandlers } from './browser-host-page-reconciliation-executor'
|
||||
import type {
|
||||
BrowserHostPageReconciliationPlan,
|
||||
|
||||
@@ -5,9 +5,9 @@ import {
|
||||
} from './browser-host-page-reconciliation-executor'
|
||||
import {
|
||||
planBrowserHostPageReconciliation,
|
||||
type BrowserClientHostedPageInventory,
|
||||
type BrowserHostRuntimePageIntent
|
||||
} from './browser-host-page-reconciliation-plan'
|
||||
import type { BrowserClientHostedPageInventory } from '../../../shared/browser-client-host-protocol'
|
||||
|
||||
const inventorySource = { inventoryPairedDeviceId: 'device-a' }
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import type { BrowserClientHostedPageInventory } from '../../../shared/browser-client-host-protocol'
|
||||
import type { BrowserHostLeaseState } from './browser-host-lease-records'
|
||||
import type {
|
||||
BrowserHostPagePlacementRegistry,
|
||||
RuntimeBrowserPlacement
|
||||
} from './browser-host-page-placement'
|
||||
import type { BrowserHostPagePlacementRegistry } from './browser-host-page-placement'
|
||||
import type { RuntimeBrowserPlacement } from '../../../shared/runtime-browser-placement'
|
||||
import { BrowserHostPageReconciliationActions } from './browser-host-page-reconciliation-actions'
|
||||
import {
|
||||
executeBrowserHostPageReconciliation,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
planBrowserHostPageReconciliation,
|
||||
type BrowserClientHostedPageInventory,
|
||||
type BrowserHostRuntimePageIntent
|
||||
} from './browser-host-page-reconciliation-plan'
|
||||
import type { BrowserClientHostedPageInventory } from '../../../shared/browser-client-host-protocol'
|
||||
|
||||
const inventorySource = { inventoryPairedDeviceId: 'device-a' }
|
||||
|
||||
|
||||
@@ -23,8 +23,6 @@ export type BrowserHostRuntimePageIntent = BrowserHostPageAuthority &
|
||||
reclaimFrom?: BrowserHostPageAuthority & Readonly<{ pairedDeviceId: string }>
|
||||
}>
|
||||
|
||||
export type { BrowserClientHostedPageInventory } from '../../../shared/browser-client-host-protocol'
|
||||
|
||||
type PagePair = Readonly<{
|
||||
intent: BrowserHostRuntimePageIntent
|
||||
page: BrowserClientHostedPageInventory
|
||||
|
||||
@@ -11,7 +11,8 @@ import { readRelayAuthContext } from './relay-auth-context'
|
||||
import { relayIdentityKey } from './relay-auth-identity'
|
||||
import { RelayAuthCoordinator } from './relay-auth-coordinator'
|
||||
import { RelayUnavailableError } from './relay-readiness'
|
||||
import { RelaySessionBroker, type RelayBrokerStatus } from './relay-session-broker'
|
||||
import { RelaySessionBroker } from './relay-session-broker'
|
||||
import type { RelayBrokerStatus } from './relay-session-broker-contract'
|
||||
import type { PairingRelay } from '../../../shared/mobile-relay-pairing-offer'
|
||||
import type {
|
||||
RelayRevokeOutbox,
|
||||
|
||||
@@ -3,8 +3,7 @@ import {
|
||||
type RelayHostCloseReason
|
||||
} from '../../../shared/relay-host-close-reason'
|
||||
import { relayStatusCellUrl } from '../../../shared/mobile-relay-status'
|
||||
import type { RelayBrokerStatus } from './relay-session-broker'
|
||||
import type { RelayAccessTokenRefresh } from './relay-session-broker-contract'
|
||||
import type { RelayBrokerStatus, RelayAccessTokenRefresh } from './relay-session-broker-contract'
|
||||
import { shouldRetryRelayConnectionError } from './relay-http-client'
|
||||
import {
|
||||
RelayReadinessWaiters,
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
sharedRelayAssignRateGate,
|
||||
type RelayAssignRateGate
|
||||
} from './relay-assign-rate-gate'
|
||||
import type { RelayRegion } from './relay-region-preference'
|
||||
import type { RelayRegion } from './relay-region-probe'
|
||||
import {
|
||||
RelayRegionCorrectionResponseSchema,
|
||||
type RelayRegionCorrectionRequest
|
||||
|
||||
@@ -2,7 +2,7 @@ import type WebSocket from 'ws'
|
||||
import type { E2EEKeypair } from '../e2ee-keypair'
|
||||
import type { MobileSocketWiring } from '../rpc/mobile-socket-wiring'
|
||||
import type { RelayBrokerStatus, RelayIdentity } from './relay-session-broker-contract'
|
||||
import type { RelayRegion } from './relay-region-preference'
|
||||
import type { RelayRegion } from './relay-region-probe'
|
||||
|
||||
export type RelayOriginPoolOptions = {
|
||||
directorUrl: string
|
||||
|
||||
@@ -31,8 +31,6 @@ import {
|
||||
type RelayRegionProbeReport
|
||||
} from './relay-region-probe'
|
||||
|
||||
export { RELAY_REGIONS, type RelayRegion } from './relay-region-probe'
|
||||
|
||||
const RELAY_REGION_CACHE_FILENAME = 'orca-relay-region-preference.json'
|
||||
const CACHE_MAX_BYTES = 8 * 1024
|
||||
const CACHE_TTL_MS = 24 * 60 * 60_000
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { MobileRelayStatus } from '../../../shared/mobile-relay-status'
|
||||
import type { E2EEKeypair } from '../e2ee-keypair'
|
||||
import type { MobileSocketWiring } from '../rpc/mobile-socket-wiring'
|
||||
import type { RelayHostCloseReason } from '../../../shared/relay-host-close-reason'
|
||||
import type { RelayRegion } from './relay-region-preference'
|
||||
import type { RelayRegion } from './relay-region-probe'
|
||||
import type { RelayRegionDecision, RelayRegionWindow } from './relay-region-correction-protocol'
|
||||
|
||||
export type RelayBrokerStatus = MobileRelayStatus
|
||||
|
||||
@@ -88,7 +88,8 @@ vi.mock('../rpc/relay-transport', () => ({
|
||||
}
|
||||
}))
|
||||
|
||||
import { RelaySessionBroker, StaleRelayBrokerError } from './relay-session-broker'
|
||||
import { RelaySessionBroker } from './relay-session-broker'
|
||||
import { StaleRelayBrokerError } from './relay-session-broker-contract'
|
||||
import { RelayHttpError } from './relay-http-client'
|
||||
import { RelayAuthCoordinator } from './relay-auth-coordinator'
|
||||
import type { RelayAuthContext } from './relay-auth-identity'
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { StaleRelayBrokerError } from './relay-session-broker-contract'
|
||||
export { StaleRelayBrokerError } from './relay-session-broker-contract'
|
||||
import { relayStatusCellUrl } from '../../../shared/mobile-relay-status'
|
||||
import type { PairingRelay } from '../../../shared/mobile-relay-pairing-offer'
|
||||
import type {
|
||||
@@ -24,8 +23,6 @@ import { RelayRegionRefresh } from './relay-region-refresh'
|
||||
import { relayRenewalDelayMs } from './relay-renewal-jitter'
|
||||
import type { RelayBrokerStatus, RelaySessionBrokerOptions } from './relay-session-broker-contract'
|
||||
|
||||
export type { RelayBrokerStatus } from './relay-session-broker-contract'
|
||||
|
||||
export class RelaySessionBroker {
|
||||
private readonly options: RelaySessionBrokerOptions
|
||||
private readonly relayHostId: string
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import {
|
||||
BrowserHostPagePlacementRegistry,
|
||||
type RuntimeBrowserClientPlacement
|
||||
} from './browser-host/browser-host-page-placement'
|
||||
import { BrowserHostPagePlacementRegistry } from './browser-host/browser-host-page-placement'
|
||||
import type { RuntimeBrowserClientPlacement } from '../../shared/runtime-browser-placement'
|
||||
import {
|
||||
closeRuntimeBrowserClientPage,
|
||||
createRuntimeBrowserClientPage,
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { BrowserNetworkExecutionHost } from '../../shared/browser-client-ho
|
||||
import { BROWSER_CLIENT_AUTOMATION_HOST_CAPABILITY } from '../../shared/browser-client-automation-protocol'
|
||||
import { browserNetworkExecutionHostKey } from '../browser/browser-network-execution-route'
|
||||
import type { BrowserHostLeaseRegistry } from './browser-host/browser-host-lease-registry'
|
||||
import type { RuntimeBrowserClientPlacement } from './browser-host/browser-host-page-placement'
|
||||
import type { RuntimeBrowserClientPlacement } from '../../shared/runtime-browser-placement'
|
||||
|
||||
type RuntimeBrowserClientPageAuthority = Pick<
|
||||
BrowserHostLeaseRegistry,
|
||||
|
||||
@@ -25,7 +25,7 @@ import type { PluginKillListService } from '../plugins/plugin-kill-list-service'
|
||||
import type { PluginMarketplaceService } from '../plugins/plugin-marketplace-service'
|
||||
import type { PluginMarketplaceInstaller } from '../plugins/plugin-marketplace-installer'
|
||||
import type { KeybindingService } from '../keybindings/keybinding-service'
|
||||
import type { RelayBrokerStatus } from '../runtime/mobile-cloud-relay/relay-session-broker'
|
||||
import type { RelayBrokerStatus } from '../runtime/mobile-cloud-relay/relay-session-broker-contract'
|
||||
import type { AgentBrowserBridge } from '../browser/agent-browser-bridge'
|
||||
import type { EmulatorBridge } from '../emulator/emulator-bridge'
|
||||
import type { GpuFallbackMarker, GpuFallbackEnvironment } from './gpu-fallback-marker'
|
||||
|
||||
Reference in New Issue
Block a user