refactor(cli): group runtime modules by responsibility (#42378)

* refactor(cli): group runtime modules by responsibility

* test(cli): retain QR privacy and mounted AppImage observations
This commit is contained in:
Neil
2026-11-14 04:43:56 -08:00
committed by GitHub
parent aa4076f1e6
commit 8af94ff899
264 changed files with 550 additions and 708 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ on:
# The launcher relies on how the CLI picks and starts its serve runtime.
- 'src/cli/runtime/launch.ts'
- 'src/cli/runtime/orca-app-executable.ts'
- 'src/cli/runtime/serve-orcad-launch.ts'
- 'src/cli/runtime/serve/startup/serve-orcad-launch.ts'
- 'src/shared/orcad-local-serve-selection.ts'
- 'src/shared/orcad-artifacts.ts'
# Catch serve regressions on main between releases.
+5 -5
View File
@@ -370,10 +370,10 @@
1 test-no-wall-clock:config/scripts/worktree-storage/reclaim-release-test-caches.test.ts
1 test-no-wall-clock:mobile/scripts/native-build-cache.test.ts
1 test-no-wall-clock:mobile/src/pairing/mobile-relay-invite-director.test.ts
2 test-no-wall-clock:src/cli/runtime/serve-appimage-update.test.ts
4 test-no-wall-clock:src/cli/runtime/serve-bundle-park.test.ts
5 test-no-wall-clock:src/cli/runtime/serve-pid1-init-reaper.test.ts
1 test-no-wall-clock:src/cli/runtime/status-caller.test.ts
2 test-no-wall-clock:src/cli/runtime/serve/updates/serve-appimage-update.test.ts
4 test-no-wall-clock:src/cli/runtime/serve/supervision/serve-bundle-park.test.ts
5 test-no-wall-clock:src/cli/runtime/serve/startup/serve-pid1-init-reaper.test.ts
1 test-no-wall-clock:src/cli/runtime/status/status-caller.test.ts
2 test-no-wall-clock:src/main/agent-hooks/installation/commands/windows-native-hook-exe-hosts.test.ts
2 test-no-wall-clock:src/main/agent-hooks/installation/scripts/managed-hook-timeout.test.ts
1 test-no-wall-clock:src/main/agent-hooks/server/testing/http/server-endpoint-file-lifecycle.test.ts
@@ -531,7 +531,7 @@
2 test-no-wall-clock:tests/e2e/cross-version-wire/release-source-retention.unit.test.ts
1 test-no-wall-clock:tests/e2e/host-cold-park-remote-subscriber.unit.test.ts
1 test-timeout-needs-reason:src/cli/agents/agent-launch-process.test.ts
1 test-timeout-needs-reason:src/cli/runtime/serve-pid1-init-reaper.test.ts
1 test-timeout-needs-reason:src/cli/runtime/serve/startup/serve-pid1-init-reaper.test.ts
1 test-timeout-needs-reason:src/cli/skills/skills-install.test.ts
2 test-timeout-needs-reason:src/main/acp/journal/acp-structured-broken-stream.test.ts
4 test-timeout-needs-reason:src/main/agent-hooks/server/testing/http/server-transport-interference.test.ts
@@ -1,7 +1,7 @@
# Existing production source files importing child_process at runtime outside @orca/process-host.
# Migration debt: this list may only shrink; new callers use the package public API.
src/cli/runtime/cli-lifecycle-handlers.ts
src/cli/runtime/commands/cli-lifecycle-handlers.ts
src/cli/accounts/interactive-login-interruption.ts
src/cli/runtime/launch.ts
src/main/agent-hooks/installation/locking/managed-hook-owner-identity.ts
+2 -2
View File
@@ -4,8 +4,8 @@
# This is a RATCHET: counts may only go DOWN.
# Prune after removing intervals: pnpm check:recurring-timer-ratchet --prune
1 src/cli/orchestration/messages/check-keepalive.ts
1 src/cli/runtime/mac-app-update-bundle.ts
1 src/cli/runtime/serve-supervised-service.ts
1 src/cli/runtime/serve/updates/mac-app-update-bundle.ts
1 src/cli/runtime/serve/supervision/serve-supervised-service.ts
1 src/main/agent-hooks/server/server-opencode-binder.ts
1 src/main/automations/observation/retained-run-reconciliation.ts
1 src/main/automations/automation-service.ts
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
import { getDefaultUserDataPath } from '../../../../src/cli/runtime/metadata'
import { getDefaultUserDataPath } from '../../../../src/cli/runtime/profile/metadata'
import type { PairingOffer } from '../../../../src/shared/remote-runtime/pairing/mobile-relay-pairing-offer'
import { RemoteRuntimeSharedControlConnection } from '../../../../src/shared/remote-runtime/control/remote-runtime-shared-control-connection'
import {
@@ -16,16 +16,35 @@ const beforeSource = execFileSync('git', ['show', `${baselineRef}:${sourcePath}`
})
let chunks = []
async function loadTransport(source) {
async function loadTransport(source, sourceFile = sourcePath) {
const built = await build({
stdin: { contents: source, loader: 'ts', resolveDir: dirname(resolve(sourcePath)) },
stdin: { contents: source, loader: 'ts', resolveDir: dirname(resolve(sourceFile)) },
bundle: true,
platform: 'node',
format: 'cjs',
write: false,
logLevel: 'silent'
logLevel: 'silent',
plugins: [
{
name: 'relocated-cli-runtime-baseline-owners',
setup(plugin) {
plugin.onResolve({ filter: /^\.\// }, ({ path, resolveDir }) => {
if (sourceFile !== sourcePath || resolveDir !== dirname(resolve(sourcePath))) {
return
}
const owners = {
'./envelope-schema': 'src/shared/runtime-rpc-envelope.ts',
'./types': 'src/cli/runtime/connection/types.ts',
'./runtime-access-denied': 'src/cli/runtime/connection/runtime-access-denied.ts'
}
const owner = owners[path]
return owner ? { path: resolve(owner) } : undefined
})
}
}
]
})
const module = new Module(resolve(sourcePath))
const module = new Module(resolve(sourceFile))
const originalRequire = module.require.bind(module)
module.require = (name) => {
if (name === 'node:crypto') {
@@ -50,12 +69,13 @@ async function loadTransport(source) {
}
}
}
module._compile(built.outputFiles[0].text, resolve(sourcePath))
module._compile(built.outputFiles[0].text, resolve(sourceFile))
return module.exports.sendRequest
}
const before = await loadTransport(beforeSource)
const after = await loadTransport(readFileSync(sourcePath, 'utf8'))
const currentSourcePath = 'src/cli/runtime/connection/transport.ts'
const after = await loadTransport(readFileSync(currentSourcePath, 'utf8'), currentSourcePath)
const metadata = {
runtimeId: 'benchmark-runtime',
authToken: 'benchmark-token',
@@ -133,7 +133,7 @@ export const PR_E2E_SOURCE_ROUTES = [
file
) ||
(isProductSource(file) &&
/^src\/(?:cli\/runtime\/(?:launch|serve-)|main\/orcad\/(?:main|orcad-entry|orcad-command-startup|orcad-instance-lock|orcad-command-arguments|orcad-lifecycle)\.ts$|main\/startup\/profile-startup\/desktop-profile-instance-lock\.ts$|main\/daemon\/(?:[^/]+\/)*daemon-(?:spawner|endpoint-adoption|init)|main\/server\/serve-)/.test(
/^src\/(?:cli\/runtime\/(?:launch|profile\/launch-user-data-path|commands\/serve-|app-launch\/serve-|serve\/(?:startup|supervision|updates)\/serve-)|main\/orcad\/(?:main|orcad-entry|orcad-command-startup|orcad-instance-lock|orcad-command-arguments|orcad-lifecycle)\.ts$|main\/startup\/profile-startup\/desktop-profile-instance-lock\.ts$|main\/daemon\/(?:[^/]+\/)*daemon-(?:spawner|endpoint-adoption|init)|main\/server\/serve-)/.test(
file
))
},
@@ -373,7 +373,7 @@ export const PR_E2E_SOURCE_ROUTES = [
],
matches: (file) =>
isProductSource(file) &&
/^src\/(?:main\/(?:ssh|orcad|managed-server)\/|main\/ipc\/(?:ssh|runtime-environment|orcad-)|cli\/runtime\/(?:launch-)?serve|shared\/(?:remote-runtime|orcad-|protocol-version\.ts$|runtime-capability)|renderer\/src\/store\/repos\/(?:repo-removal|runtime-project-terminal-stop)|renderer\/src\/components\/sidebar\/(?:workspace-actions\/sleep\/(?:sleep-|SleepTwin|WorkspaceSleep|use-worktree-sleep)|ssh-host-remove|host-rename-remove|HostRemove)|renderer\/src\/components\/terminal-pane\/(?:pty-transport\/remote-runtime\/recovery\/(?:TerminalRemoteRuntimeReconnectBanner|use-managed-pairing-refused)|controller\/TerminalPaneCodexRestartPortals|process-exit\/TerminalPaneProcessExitPortals|pty-transport\/recovery\/ssh\/TerminalPaneSshReconnectPortals|mobile-driver\/TerminalPaneMobileDriverPortals))/.test(
/^src\/(?:main\/(?:ssh|orcad|managed-server)\/|main\/ipc\/(?:ssh|runtime-environment|orcad-)|cli\/runtime\/(?:launch-serve|(?:commands|app-launch)\/serve|serve\/(?:startup|supervision|updates)\/serve)|shared\/(?:remote-runtime|orcad-|protocol-version\.ts$|runtime-capability)|renderer\/src\/store\/repos\/(?:repo-removal|runtime-project-terminal-stop)|renderer\/src\/components\/sidebar\/(?:workspace-actions\/sleep\/(?:sleep-|SleepTwin|WorkspaceSleep|use-worktree-sleep)|ssh-host-remove|host-rename-remove|HostRemove)|renderer\/src\/components\/terminal-pane\/(?:pty-transport\/remote-runtime\/recovery\/(?:TerminalRemoteRuntimeReconnectBanner|use-managed-pairing-refused)|controller\/TerminalPaneCodexRestartPortals|process-exit\/TerminalPaneProcessExitPortals|pty-transport\/recovery\/ssh\/TerminalPaneSshReconnectPortals|mobile-driver\/TerminalPaneMobileDriverPortals))/.test(
file
)
},
+4 -5
View File
@@ -17,11 +17,10 @@
"./scripts/test-runtime/node-worker/vitest-node-runtime-pool.ts",
"./scripts/test-runtime/module-cache/vitest-module-cache-resolution-key.ts",
"../src/main/**/*",
"../src/cli/runtime/transport.ts",
"../src/cli/runtime/envelope-schema.ts",
"../src/cli/runtime/types.ts",
"../src/cli/runtime/runtime-access-denied.ts",
"../src/cli/runtime/runtime-pid-liveness.ts",
"../src/cli/runtime/connection/transport.ts",
"../src/cli/runtime/connection/types.ts",
"../src/cli/runtime/connection/runtime-access-denied.ts",
"../src/cli/runtime/connection/runtime-pid-liveness.ts",
"../src/renderer/src/store/slices/worktrees/create/worktree-create-payload.ts",
"../src/renderer/src/runtime/repo-hooks/orca-hook-trust.ts",
"../src/renderer/src/components/native-chat/native-chat-resolution-receipt.ts",
+1 -1
View File
@@ -1,6 +1,6 @@
import type { HandlerContext } from '../dispatch/dispatch'
import { printResult } from '../output/command-result-output'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { ANTIGRAVITY_ACCOUNTS_RUNTIME_CAPABILITY } from '../../shared/account-runtime-capabilities'
import type {
AntigravityAccountState,
+1 -1
View File
@@ -4,7 +4,7 @@ import { tmpdir } from 'node:os'
import { delimiter, join } from 'node:path'
import type { CommandHandler, HandlerContext } from '../dispatch/dispatch'
import { printResult } from '../output/command-result-output'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { stripElectronRunAsNode } from '../runtime/orca-app-executable'
import { rejectRemoteSelectionFlags } from '../dispatch/remote-selection-flag-rejection'
import { buildWslExecArgs, buildWslLoginShellCommand } from '../../shared/wsl-login-shell-command'
+1 -1
View File
@@ -4,7 +4,7 @@ import { join } from 'node:path'
import type { HandlerContext } from '../dispatch/dispatch'
import { REPEATED_FLAG_SEPARATOR } from '../arguments/args'
import { printResult } from '../output/command-result-output'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { DATA_ACCOUNT_RUNTIME_CAPABILITY } from '../../shared/account-runtime-capabilities'
import type { RuntimeStatus } from '../../shared/runtime-session-contracts'
import type {
@@ -7,7 +7,7 @@ import {
import { inFlightWindowsTreeKill } from '@orca/process-host/windows-tree-kill'
import { createOutputSink } from '@orca/process-host/bounded-output-sink'
import { resolveCliCommand, withCliRuntimeOnPath } from '../../shared/node-cli-command-resolution'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import {
type InteractiveLoginSession,
LOGIN_PROCESS_POSIX_GRACE_MS,
+2 -2
View File
@@ -1,4 +1,4 @@
import type * as RuntimeMetadata from '../runtime/metadata'
import type * as RuntimeMetadata from '../runtime/profile/metadata'
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
import type * as fs from 'node:fs'
import { tmpdir } from 'node:os'
@@ -63,7 +63,7 @@ vi.mock('../runtime/client', () => {
return { RuntimeClient }
})
vi.mock('../runtime/metadata', async (importOriginal) => ({
vi.mock('../runtime/profile/metadata', async (importOriginal) => ({
...(await importOriginal<typeof RuntimeMetadata>()),
getDefaultUserDataPath: getDefaultUserDataPathMock
}))
+2 -2
View File
@@ -2,10 +2,10 @@ import { join } from 'node:path'
import type { CommandHandler } from '../dispatch/dispatch'
import { printResult } from '../output/command-result-output'
import { rejectRemoteSelectionFlags } from '../dispatch/remote-selection-flag-rejection'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import type { RuntimeClient } from '../runtime/client'
import type { RuntimeRpcSuccess } from '../../shared/runtime-rpc-envelope'
import { getDefaultUserDataPath } from '../runtime/metadata'
import { getDefaultUserDataPath } from '../runtime/profile/metadata'
import type { AgentHookInstallStatus } from '../../shared/agent-hook-listener/configuration/agent-hook-types'
import { DEFAULT_LOCAL_ORCA_PROFILE_ID } from '../../shared/orca-profiles'
import type { GlobalSettings } from '../../shared/global-settings-types'
+1 -1
View File
@@ -1,4 +1,4 @@
import { RuntimeClientError, RuntimeRpcFailureError } from '../runtime/types'
import { RuntimeClientError, RuntimeRpcFailureError } from '../runtime/connection/types'
import { classifyAgentLaunchReplayRefusal } from '../../shared/agent-launch/contracts/agent-launch-replay-refusal'
import {
recoverableOrchestrationArgs,
+1 -1
View File
@@ -29,7 +29,7 @@ import {
getRequiredStringFlagAllowingEmpty,
rejectValuelessFlag
} from '../arguments/flags'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import type { RuntimeClient } from '../runtime/client'
import type { RuntimeRpcSuccess } from '../../shared/runtime-rpc-envelope'
import { withCliAgentLaunchRecovery } from './agent-launch-recovery'
+1 -1
View File
@@ -8,7 +8,7 @@ import {
} from './agent-launch-request'
import { getRequiredStringFlag } from '../arguments/flags'
import { printResult } from '../output/command-result-output'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import {
getRequiredWorktreeSelector,
resolveCurrentWorktreeSelector
+1 -1
View File
@@ -1,7 +1,7 @@
import type { CommandHandler } from '../dispatch/dispatch'
import { getPresentStringFlag, getRequiredStringFlag } from '../arguments/flags'
import { printResult } from '../output/command-result-output'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { readInjectedAgentSessionId } from '../../shared/agent-session/lifecycle/launch/agent-session-caller-env'
type ChatRenameResult = { name: string | null; applied: boolean }
+1 -1
View File
@@ -1,4 +1,4 @@
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { unknownCommandData, unknownFlagData } from '../discovery/command-suggestion'
import { specPaths, type CommandSpec } from '../discovery/command-spec'
import {
+1 -1
View File
@@ -1,7 +1,7 @@
import { readFile } from 'node:fs/promises'
import { isAbsolute, join } from 'node:path'
import { getRequiredStringFlag, getRequiredStringFlagAllowingEmpty } from './flags'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
type BodyOptions = {
required: boolean
+1 -1
View File
@@ -1,4 +1,4 @@
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { REPEATED_FLAG_SEPARATOR } from './args'
import { describeQuoteStrippedJsonFlag } from './quote-stripped-json-flag'
import type { RepoKind } from '../../shared/repo-types'
+1 -1
View File
@@ -19,7 +19,7 @@ import {
} from '../../shared/artifacts/artifact-sharing-gate'
import type { CommandHandler, HandlerContext } from '../dispatch/dispatch'
import { rejectRemoteSelectionFlags } from '../dispatch/remote-selection-flag-rejection'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { formatArtifactListPage, formatArtifactShared } from './artifact-format'
import { printResult } from '../output/command-result-output'
@@ -1,4 +1,4 @@
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
/** An explicit empty value clears saved extras. */
export function getExtraAgentArgsFlag(flags: Map<string, string | boolean>): string | undefined {
@@ -19,7 +19,7 @@ import {
getOptionalStringFlag,
getRequiredStringFlag
} from '../arguments/flags'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
const PRESET_TRIGGERS = new Set<AutomationSchedulePreset>(['hourly', 'daily', 'weekdays', 'weekly'])
const SCHEDULE_MODIFIER_FLAGS = ['day', 'time'] as const
@@ -8,7 +8,7 @@ import {
} from '../../shared/agent-launch/startup/automation-extra-agent-args'
import type { RuntimeStatus } from '../../shared/runtime-session-contracts'
import type { RuntimeClient } from '../runtime/client'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
const SETUP_CHOICE_HOST_UPDATE_REQUIRED =
"This host's Orca is too old for --setup on automations. Update Orca on that host, or run the command without --setup."
@@ -1,6 +1,6 @@
import type { AutomationRun } from '../../shared/automations/history/automation-run'
import type { RuntimeRpcSuccess } from '../../shared/runtime-rpc-envelope'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import type { RuntimeClient } from '../runtime/client'
// Keep typical snapshot pages below the remote reply limit; retry smaller when needed.
+1 -1
View File
@@ -1,4 +1,4 @@
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import type { AutomationWorkspaceMode } from '../../shared/automations/automation-definition'
export function getAutomationSetupFlag(
+1 -1
View File
@@ -33,7 +33,7 @@ import {
readAllAutomationRuns,
readAutomationRunsPage
} from './automation-runs-paging'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import {
getOptionalWorktreeSelector,
resolveCurrentWorktreeSelector
+1 -1
View File
@@ -2,7 +2,7 @@ import { BROWSER_EXPECT_URL_RUNTIME_CAPABILITY } from '../../shared/browser/runt
import type { RuntimeStatus } from '../../shared/runtime-types'
import { getOptionalStringFlag, getPresentStringFlag } from '../arguments/flags'
import type { RuntimeClient } from '../runtime/client'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { assertLocalCwdWorktreeSelector } from '../hosts/local-environment-selector'
import { quoteCliCommandArgument } from '../arguments/shell-command-quote'
import {
+1 -1
View File
@@ -10,7 +10,7 @@ import {
getRequiredStringFlag,
getRequiredStringFlagAllowingEmpty
} from '../arguments/flags'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { getBrowserCommandTarget } from './browser-command-target'
function getOptionalCookieExpiry(flags: Map<string, string | boolean>): number | undefined {
+1 -1
View File
@@ -11,7 +11,7 @@ import {
getRequiredStringFlag,
getRequiredStringFlagAllowingEmpty
} from '../arguments/flags'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { getBrowserCommandTarget } from './browser-command-target'
export const BROWSER_ENV_HANDLERS: Record<string, CommandHandler> = {
@@ -23,7 +23,7 @@ vi.mock('../runtime/launch', async (importOriginal) => ({
serveOrcaApp: serveOrcaAppMock
}))
vi.mock('../runtime/metadata', async (importOriginal) => ({
vi.mock('../runtime/profile/metadata', async (importOriginal) => ({
...(await importOriginal<Record<string, unknown>>()),
getDefaultUserDataPath: getDefaultUserDataPathMock
}))
+1 -1
View File
@@ -23,7 +23,7 @@ vi.mock('../runtime/launch', async (importOriginal) => ({
serveOrcaApp: serveOrcaAppMock
}))
vi.mock('../runtime/metadata', async (importOriginal) => ({
vi.mock('../runtime/profile/metadata', async (importOriginal) => ({
...(await importOriginal<Record<string, unknown>>()),
getDefaultUserDataPath: getDefaultUserDataPathMock
}))
+1 -1
View File
@@ -8,7 +8,7 @@ import type { RuntimeStatus } from '../../shared/runtime-session-contracts'
import type { CommandHandler, HandlerContext } from '../dispatch/dispatch'
import { getRequiredStringFlag } from '../arguments/flags'
import { printResult } from '../output/command-result-output'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
async function assertBrowserIdentitySupported({ client }: HandlerContext): Promise<void> {
const status = await client.call<RuntimeStatus>('status.get')
+1 -1
View File
@@ -18,7 +18,7 @@ import {
getOptionalStringFlag,
getRequiredStringFlag
} from '../arguments/flags'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { getBrowserCommandTarget } from './browser-command-target'
import { browserWaitRequestTimeoutMs } from '../../shared/browser-wait-timeout'
+1 -1
View File
@@ -14,7 +14,7 @@ import {
formatTabProfileShow
} from './browser-format'
import { printResult } from '../output/command-result-output'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { getBrowserCommandTarget } from './browser-command-target'
function parseScopeFlag(flags: Map<string, string | boolean>): 'isolated' | 'imported' {
+1 -1
View File
@@ -19,7 +19,7 @@ import {
getPresentStringFlag,
getRequiredStringFlag
} from '../arguments/flags'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { isBrowserTabSplitDirection } from '../../shared/browser-tab-split-direction'
import { getBrowserWorktreeSelector } from '../workspace-selection/workspace-selector'
import { getBrowserCommandTarget, getScopedBrowserWorktreeSelector } from './browser-command-target'
@@ -1,4 +1,4 @@
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
export function validateExclusiveWindowTarget(
windowId: number | undefined,
+1 -1
View File
@@ -11,7 +11,7 @@ import {
getRequiredStringFlag,
getRequiredStringFlagAllowingEmpty
} from '../arguments/flags'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import {
validateDragTarget,
validateElementOrCoordinates,
+1 -1
View File
@@ -1,6 +1,6 @@
import type { ComputerAppQuery } from '../../shared/computer-use-runtime-types'
import type { RuntimeClient } from '../runtime/client'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { getOptionalStringFlag, getRequiredStringFlag } from '../arguments/flags'
import { getBrowserWorktreeSelector } from '../workspace-selection/workspace-selector'
+1 -1
View File
@@ -16,7 +16,7 @@ import {
getRequiredStringFlag
} from '../arguments/flags'
import { printResult } from '../output/command-result-output'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { getComputerCommandTarget } from './computer-command-target'
import { getComputerWindowTargetFlags } from './computer-action-flags'
+1 -1
View File
@@ -15,7 +15,7 @@ vi.mock('../runtime/client', async (importOriginal) => ({
import { main } from '../index'
import type * as RuntimeClientExports from '../runtime/client'
import { RuntimeRpcFailureError } from '../runtime/types'
import { RuntimeRpcFailureError } from '../runtime/connection/types'
import { okFixture, queueFixtures } from '../runtime/fixtures/runtime-rpc-fixtures'
describe('orca computer wait', () => {
+1 -1
View File
@@ -14,7 +14,7 @@ import {
import { cliErrorCode } from '../output/cli-error'
import { formatGetAppState, formatListWindows } from './computer-format'
import type { RuntimeClient } from '../runtime/client'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import type { RuntimeRpcSuccess } from '../../shared/runtime-rpc-envelope'
export type ComputerWaitCondition =
+1 -1
View File
@@ -15,7 +15,7 @@ import {
} from '../arguments/flags'
import { queryComputerTreeText } from './computer-tree-query'
import { runComputerWait } from './computer-wait-command'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import {
formatComputerAction,
formatGetAppState,
+1 -1
View File
@@ -8,7 +8,7 @@ import {
getRequiredStringFlag
} from '../arguments/flags'
import { printResult } from '../output/command-result-output'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { getRequiredWorktreeSelector } from '../workspace-selection/workspace-selector'
type ConnectorDelivery = { outcome: string; reason?: string; reopened?: boolean }
+1 -1
View File
@@ -1,5 +1,5 @@
import type { RuntimeClient } from '../runtime/client'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { HANDLER_GROUPS, type HandlerGroup } from './handler-group-manifest'
export type HandlerContext = {
+1 -1
View File
@@ -22,7 +22,7 @@ export const HANDLER_GROUPS: readonly HandlerGroup[] = [
{
name: 'core',
keys: ['claude-teams', 'open', 'serve', 'status'],
load: async () => (await import('../runtime/cli-lifecycle-handlers.js')).CORE_HANDLERS
load: async () => (await import('../runtime/commands/cli-lifecycle-handlers.js')).CORE_HANDLERS
},
...SERVE_PAIRING_HANDLER_GROUPS,
{
@@ -1,4 +1,4 @@
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
// Local-only command families reject explicit runtime selectors rather than silently ignoring them.
export const REMOTE_SELECTION_FLAGS = ['environment', 'pairing-code'] as const
+1 -1
View File
@@ -1,5 +1,5 @@
import type { RuntimeClient } from '../runtime/client'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { assertLocalCwdWorktreeSelector } from '../hosts/local-environment-selector'
import { getOptionalStringFlag } from '../arguments/flags'
import {
@@ -1,5 +1,5 @@
import { getOptionalStringFlag, getRequiredStringFlag } from '../arguments/flags'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
export type EmulatorPermissionRequest = {
op: 'grant' | 'revoke' | 'reset'
+1 -1
View File
@@ -10,7 +10,7 @@ import {
getRequiredStringFlag
} from '../arguments/flags'
import { getEmulatorCommandTarget } from './emulator-command-target'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { EMULATOR_ATTACH_RPC_TIMEOUT_MS } from '../../shared/emulator-attach-timeouts'
type EmulatorAttachResult = {
+1 -1
View File
@@ -1,6 +1,6 @@
import type { RuntimeFileOpenResult } from '../../shared/file-access/runtime-editor-file-open'
import type { HandlerContext } from '../dispatch/dispatch'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import type { RuntimeRpcSuccess } from '../../shared/runtime-rpc-envelope'
const NO_APP_WINDOW_MESSAGE =
+1 -1
View File
@@ -1,6 +1,6 @@
import type { RuntimeFileOpenPosition } from '../../shared/file-access/runtime-editor-file-open'
import { getOptionalPositiveIntegerFlag } from '../arguments/flags'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
export function getFileOpenPosition(
flags: Map<string, string | boolean>
+1 -1
View File
@@ -8,7 +8,7 @@ import { isWslUncPath, parseWslUncPath, toWindowsWslPath } from '../../shared/ws
import type { CommandHandler, HandlerContext } from '../dispatch/dispatch'
import { getOptionalStringFlag, getRequiredStringFlag } from '../arguments/flags'
import { printResult } from '../output/command-result-output'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { callFileOpen } from './file-open-call'
import {
getOptionalWorktreeSelector,
+4 -4
View File
@@ -10,8 +10,8 @@ import {
type SshTargetSummary
} from './host-selector-alternatives'
import { normalizeTypedName } from '../../shared/typed-name-normalization'
import { getDefaultUserDataPath } from '../runtime/metadata'
import { RuntimeClientError } from '../runtime/types'
import { getDefaultUserDataPath } from '../runtime/profile/metadata'
import { RuntimeClientError } from '../runtime/connection/types'
import type { RuntimeClient } from '../runtime/client'
import type { RuntimeRpcSuccess } from '../../shared/runtime-rpc-envelope'
@@ -24,8 +24,8 @@ import {
resolveEnvironment,
type EnvironmentAddResult,
type EnvironmentRemoveResult
} from '../runtime/environments'
import { exchangeCliPairingCode } from '../runtime/environment-pairing-exchange'
} from '../runtime/pairing/environments'
import { exchangeCliPairingCode } from '../runtime/pairing/environment-pairing-exchange'
import { refuseReservedEnvironmentName } from './local-environment-selector'
import { listEnvironments } from '../../shared/remote-runtime/host-store/runtime-environment-store'
+7 -7
View File
@@ -19,7 +19,7 @@ import {
} from './host-selector-alternatives'
import { normalizeTypedName, stripWrappingQuotes } from '../../shared/typed-name-normalization'
import type { RuntimeClient } from '../runtime/client'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { isLocalEnvironmentSelector } from './local-environment-selector'
export type HostFlagRoutingSelection = {
@@ -75,8 +75,8 @@ export async function resolveHostFlagEnvironmentId(
}
const [{ resolveEnvironment }, { getDefaultUserDataPath }, { listEnvironments }] =
await Promise.all([
import('../runtime/environments.js'),
import('../runtime/metadata.js'),
import('../runtime/pairing/environments.js'),
import('../runtime/profile/metadata.js'),
import('../../shared/remote-runtime/host-store/runtime-environment-store.js')
])
const userDataPath = getDefaultUserDataPath()
@@ -217,8 +217,8 @@ export async function resolveHostFlagTarget(
return host
}
const [, { getDefaultUserDataPath }, { listEnvironments }] = await Promise.all([
import('../runtime/environments.js'),
import('../runtime/metadata.js'),
import('../runtime/pairing/environments.js'),
import('../runtime/profile/metadata.js'),
import('../../shared/remote-runtime/host-store/runtime-environment-store.js')
])
const environments = listEnvironments(getDefaultUserDataPath()).map((candidate) => ({
@@ -295,8 +295,8 @@ export async function resolveEnvironmentSelectorForStore(
listSshTargetsForSuggestion: () => Promise<SshTargetSummary[]>
): Promise<string> {
const [, { getDefaultUserDataPath }, { listEnvironments }] = await Promise.all([
import('../runtime/environments.js'),
import('../runtime/metadata.js'),
import('../runtime/pairing/environments.js'),
import('../runtime/profile/metadata.js'),
import('../../shared/remote-runtime/host-store/runtime-environment-store.js')
])
const environments = listEnvironments(getDefaultUserDataPath()).map((candidate) => ({
+1 -1
View File
@@ -157,7 +157,7 @@ export async function resolveSshHostTargetId(
if (matched) {
return matched.id
}
const { RuntimeClientError } = await import('../runtime/types.js')
const { RuntimeClientError } = await import('../runtime/connection/types.js')
const ambiguous = ambiguousSshTargets(targets, targetId)
if (ambiguous.length > 0) {
throw new RuntimeClientError(
@@ -28,7 +28,7 @@ vi.mock('../runtime/client', async () => {
})
})
vi.mock('../runtime/metadata', async (importOriginal) => ({
vi.mock('../runtime/profile/metadata', async (importOriginal) => ({
...(await importOriginal<Record<string, unknown>>()),
getDefaultUserDataPath: getDefaultUserDataPathMock
}))
@@ -37,7 +37,7 @@ vi.mock('../runtime/launch', async (importOriginal) => ({
...(await importOriginal<Record<string, unknown>>()),
serveOrcaApp: serveOrcaAppMock
}))
vi.mock('../runtime/environments', () => ({
vi.mock('../runtime/pairing/environments', () => ({
addEnvironmentFromPairingCode: addEnvironmentFromPairingCodeMock,
removeEnvironment: vi.fn(),
resolveEnvironment: vi.fn()
+2 -2
View File
@@ -1,6 +1,6 @@
import { normalizeTypedName } from '../../shared/typed-name-normalization'
import type { RuntimeClient } from '../runtime/client'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { quoteCliCommandArgument } from '../arguments/shell-command-quote'
/** `--environment local`: the caller's own Orca, even over an ambient ORCA_ENVIRONMENT or pairing code. */
@@ -13,7 +13,7 @@ export function isLocalEnvironmentSelector(value: unknown): value is string {
/** `local` is reserved, so a saved entry named local is reached only by its id. */
export async function savedEnvironmentNamedLocal(): Promise<{ id: string } | undefined> {
const [{ getDefaultUserDataPath }, { listEnvironments }] = await Promise.all([
import('../runtime/metadata.js'),
import('../runtime/profile/metadata.js'),
import('../../shared/remote-runtime/host-store/runtime-environment-store.js')
])
return listEnvironments(getDefaultUserDataPath()).find((environment) =>
+1 -1
View File
@@ -2,7 +2,7 @@
import type { OrcadManagedRuntimeStatus } from '../../shared/orcad-managed-runtime'
import type { HandlerContext } from '../dispatch/dispatch'
import { printResult } from '../output/command-result-output'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import type { RuntimeRpcSuccess } from '../../shared/runtime-rpc-envelope'
const STATUS_ATTEMPTS = 15
+1 -1
View File
@@ -13,7 +13,7 @@ import type { RuntimeStatus } from '../../shared/runtime-session-contracts'
import type { CommandHandler, HandlerContext } from '../dispatch/dispatch'
import { getRequiredStringFlag } from '../arguments/flags'
import { printResult } from '../output/command-result-output'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import type { RuntimeRpcSuccess } from '../../shared/runtime-rpc-envelope'
import { formatManagedServerStatus } from './managed-server-format'
import { reportAfterClosedConnection } from './managed-server-reconnect'
@@ -40,8 +40,8 @@ export async function resolveOmittedHostScopeSelectors(
async function listPairedEnvironments(): Promise<{ id: string; name: string }[]> {
const [, { getDefaultUserDataPath }, { listEnvironments }] = await Promise.all([
import('../runtime/environments.js'),
import('../runtime/metadata.js'),
import('../runtime/pairing/environments.js'),
import('../runtime/profile/metadata.js'),
import('../../shared/remote-runtime/host-store/runtime-environment-store.js')
])
return listEnvironments(getDefaultUserDataPath()).map((environment) => ({
+1 -1
View File
@@ -1,7 +1,7 @@
import { existsSync, readFileSync } from 'node:fs'
import { join } from 'node:path'
import type { CommandHandler } from '../dispatch/dispatch'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { parseOrcaYaml } from '../../shared/orca-yaml'
import {
getEphemeralVmRecipeResultProjectRoot,
+3 -3
View File
@@ -33,12 +33,12 @@ vi.mock('./runtime/launch', async (importOriginal) => ({
serveOrcaApp: serveOrcaAppMock
}))
vi.mock('./runtime/metadata', async (importOriginal) => ({
vi.mock('./runtime/profile/metadata', async (importOriginal) => ({
...(await importOriginal<Record<string, unknown>>()),
getDefaultUserDataPath: getDefaultUserDataPathMock
}))
vi.mock('./runtime/environments', () => ({
vi.mock('./runtime/pairing/environments', () => ({
addEnvironmentFromPairingCode: addEnvironmentFromPairingCodeMock,
removeEnvironment: vi.fn(),
resolveEnvironment: vi.fn()
@@ -54,7 +54,7 @@ vi.mock('child_process', async () => {
})
import { main } from './index'
import { RuntimeClientError, RuntimeRpcFailureError } from './runtime/types'
import { RuntimeClientError, RuntimeRpcFailureError } from './runtime/connection/types'
import { queueFixtures } from './runtime/fixtures/runtime-rpc-fixtures'
import { useWorktreeAwarenessEnvironment } from './index-test-harness'
import { agentLaunchHostFixture } from './agents/agent-launch-test-fixtures'
+2 -1
View File
@@ -18,7 +18,8 @@ export type WorktreeAwarenessMocks = {
export async function createRuntimeClientModuleMock(mocks: RuntimeClientModuleMocks) {
// Error formatting uses instanceof, so the mock must preserve the production classes.
const { RuntimeClientError, RuntimeRpcFailureError } = await import('./runtime/types.js')
const { RuntimeClientError, RuntimeRpcFailureError } =
await import('./runtime/connection/types.js')
class RuntimeClient {
readonly isRemote: boolean
+2 -2
View File
@@ -33,12 +33,12 @@ vi.mock('./runtime/launch', async (importOriginal) => ({
serveOrcaApp: serveOrcaAppMock
}))
vi.mock('./runtime/metadata', async (importOriginal) => ({
vi.mock('./runtime/profile/metadata', async (importOriginal) => ({
...(await importOriginal<Record<string, unknown>>()),
getDefaultUserDataPath: getDefaultUserDataPathMock
}))
vi.mock('./runtime/environments', () => ({
vi.mock('./runtime/pairing/environments', () => ({
addEnvironmentFromPairingCode: addEnvironmentFromPairingCodeMock,
removeEnvironment: vi.fn(),
resolveEnvironment: vi.fn()
+2 -2
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env node
import './runtime/packaged-cli-interpreter'
import './runtime/app-launch/packaged-cli-interpreter'
import {
findCommandSpec,
isCommandGroup,
@@ -17,7 +17,7 @@ import {
} from './hosts/execution-host-flag'
import { fetchSshTargetSummaries, listSshTargets } from './hosts/host-selector-alternatives'
import { reportCliError } from './output/cli-error'
import { RuntimeClientError } from './runtime/types'
import { RuntimeClientError } from './runtime/connection/types'
import { cliErrorExitCode } from './output/cli-exit-code'
import { printHelp } from './discovery/help'
import type { RuntimeClient } from './runtime/client'
+1 -1
View File
@@ -8,7 +8,7 @@ import {
} from '../../shared/jira/jira-issue-url'
import type { HandlerContext } from '../dispatch/dispatch'
import { getOptionalStringFlag } from '../arguments/flags'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
export function resolveJiraTarget(
context: HandlerContext,
+1 -1
View File
@@ -17,7 +17,7 @@ import {
import { printResult } from '../output/command-result-output'
import { formatJiraCreate } from './jira-format'
import { resolveJiraTarget } from './jira-target'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import type { RuntimeRpcSuccess } from '../../shared/runtime-rpc-envelope'
async function callJiraWrite<T>(
+1 -1
View File
@@ -29,7 +29,7 @@ import {
formatJiraUserList
} from './jira-format'
import { resolveJiraTarget } from './jira-target'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import { JIRA_WRITE_HANDLERS } from './jira-write'
function issueTarget(context: HandlerContext) {
+1 -1
View File
@@ -10,7 +10,7 @@ import {
} from '../arguments/flags'
import { printResult } from '../output/command-result-output'
import { formatLinearMcpIssueList, printLinearMcpIssueListWarnings } from './linear-format'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
export const runLinearListIssues: CommandHandler = async ({ flags, client, json }) => {
const priority = getOptionalNonNegativeIntegerFlag(flags, 'priority')
+1 -1
View File
@@ -8,7 +8,7 @@ import { getRequiredStringFlag } from '../arguments/flags'
import { printResult } from '../output/command-result-output'
import { formatLinearRelationWrite } from './linear-format'
import { buildWriteTargetRequest } from './linear-request-builders'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
const LINEAR_WRITE_TIMEOUT_MS = 75_000
+1 -1
View File
@@ -18,7 +18,7 @@ import {
getRepeatedStringFlag,
getRequiredStringFlag
} from '../arguments/flags'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
const LINEAR_PRIORITY_VALUES = new Map([
['none', 0],
+1 -1
View File
@@ -12,7 +12,7 @@ import {
readLinearBody,
rejectAllWorkspaceForWrite
} from './linear-request-builders'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
export async function buildSaveIssueRequest(
flags: Map<string, string | boolean>,
+1 -1
View File
@@ -23,7 +23,7 @@ import type {
import { clampLinearSearchLimit } from '../../shared/linear/agent-access'
import type { CommandHandler } from '../dispatch/dispatch'
import { printResult } from '../output/command-result-output'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
import {
getOptionalPositiveIntegerFlag,
getOptionalStringFlag,
@@ -1,7 +1,7 @@
import type { CommandHandler } from '../../dispatch/dispatch'
import { printOrchestrationReceipt } from '../agent-view'
import { getOptionalStringFlag, getRequiredStringFlag } from '../../arguments/flags'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import { orchestrationMigrationData } from '../../../shared/orchestration/orchestration-rpc-contract'
import { callOrchestrationMutation } from '../recovery/mutation-request'
import { isDevCliInvocation } from '../recovery/runtime-compatibility'
@@ -1,6 +1,6 @@
import type { HandlerContext } from '../../dispatch/dispatch'
import { RuntimeClient } from '../../runtime/client'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import { readInjectedAgentSessionId } from '../../../shared/agent-session/lifecycle/launch/agent-session-caller-env'
import type { OrchestrationCallerShowResult } from '../../../shared/orchestration/orchestration-caller-status'
import { renderOrchestrationArgv } from '../agent-view'
@@ -8,7 +8,7 @@ vi.mock('../../output/command-result-output', () => ({ printResult: vi.fn() }))
vi.mock('../../terminals/terminal-selector', () => ({ getTerminalHandle: getTerminalHandleMock }))
import { ORCHESTRATION_HANDLERS } from '../orchestration-handlers'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import { printResult } from '../../output/command-result-output'
function staleHandleError(): RuntimeClientError {
@@ -1,7 +1,7 @@
// Fence caller flags before dispatch: older hosts would let a session act as another caller.
import type { CommandSpec, IdentityFlag } from '../../discovery/command-spec'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import {
injectedSessionAddress,
readInjectedAgentSessionId
@@ -1,6 +1,6 @@
import { getOptionalStringFlag, getPresentStringFlag } from '../../arguments/flags'
import type { RuntimeClient } from '../../runtime/client'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import { getTerminalHandle } from '../../terminals/terminal-selector'
import { hasStructuredSessionMarker } from '../../../shared/structured-session-marker'
import {
@@ -5,7 +5,7 @@ import { withReceiptNext } from '../receipt-next-text'
import { printOrchestrationResult } from '../agent-view'
import { checkView } from './message-agent-views'
import { getOptionalStringFlag } from '../../arguments/flags'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import type { RuntimeRpcSuccess } from '../../../shared/runtime-rpc-envelope'
import {
formatOrchestrationCheckText,
@@ -1,5 +1,5 @@
import { getOptionalJsonFlag, getOptionalStringFlag } from '../../arguments/flags'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
export function getOptionalStructuredMessagePayload(
flags: Map<string, string | boolean>
@@ -9,7 +9,7 @@ import {
} from '../workers/worker-start-agent-view'
import { withResolvedNextCommands } from '../recovery/orchestration-mutation-recovery'
import { getOptionalStringFlag, getRequiredStringFlag } from '../../arguments/flags'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import { readInjectedAgentSessionId } from '../../../shared/agent-session/lifecycle/launch/agent-session-caller-env'
import { requireWorkerDoneSettlement } from '../workers/orchestration-worker-settlement'
import { getOptionalStructuredMessagePayload } from './message-payload'
@@ -2,7 +2,7 @@ import type { CommandHandler } from '../../dispatch/dispatch'
import { getOptionalStringFlag } from '../../arguments/flags'
import { printResult } from '../../output/command-result-output'
import { renderCommand } from '../recovery/orchestration-mutation-recovery'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import type { RuntimeClient } from '../../runtime/client'
import type { RuntimeStatus } from '../../../shared/runtime-session-contracts'
import { ORCHESTRATION_ASK_RETURNS_AT_ONCE_RUNTIME_CAPABILITY } from '../../../shared/orchestration/orchestration-runtime-capabilities'
+1 -1
View File
@@ -1,5 +1,5 @@
import { parsePositiveSafeIntegerText } from '../../shared/timer-delay'
import { RuntimeClientError } from '../runtime/types'
import { RuntimeClientError } from '../runtime/connection/types'
export function getOptionalPositiveIntegerValueFlag(
flags: Map<string, string | boolean>,
@@ -33,12 +33,12 @@ vi.mock('../runtime/launch', async (importOriginal) => ({
serveOrcaApp: serveOrcaAppMock
}))
vi.mock('../runtime/metadata', async (importOriginal) => ({
vi.mock('../runtime/profile/metadata', async (importOriginal) => ({
...(await importOriginal<Record<string, unknown>>()),
getDefaultUserDataPath: getDefaultUserDataPathMock
}))
vi.mock('../runtime/environments', () => ({
vi.mock('../runtime/pairing/environments', () => ({
addEnvironmentFromPairingCode: addEnvironmentFromPairingCodeMock,
removeEnvironment: vi.fn(),
resolveEnvironment: vi.fn()
@@ -1,7 +1,7 @@
import type { CommandHandler } from '../../dispatch/dispatch'
import { printOrchestrationReceipt } from '../agent-view'
import { getOptionalStringFlag, getRequiredStringFlag } from '../../arguments/flags'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import type { OrchestrationMutationRequestShowResult } from '../../../shared/orchestration/orchestration-mutation-request'
export const ORCHESTRATION_REQUEST_SHOW_HANDLER: Record<string, CommandHandler> = {
@@ -1,9 +1,9 @@
import { randomUUID } from 'node:crypto'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import type { RuntimeClient } from '../../runtime/client'
import { readRetryRequestFlag } from './retry-request-flag'
import { orchestrationMutationRecoveryError } from './orchestration-mutation-recovery'
import { isRequestUnsent } from '../../runtime/client-error-recovery'
import { isRequestUnsent } from '../../runtime/connection/client-error-recovery'
const MAX_UNAVAILABLE_RETRY_DELAY_MS = 15_000
@@ -1,7 +1,7 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { ORCHESTRATION_HANDLERS } from '../orchestration-handlers'
import { RuntimeClient } from '../../runtime/client'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import { okFixture } from '../../runtime/fixtures/runtime-rpc-fixtures'
const client = new RuntimeClient('/tmp/orca-older-runtime-run', 60_000, null, null)
@@ -1,4 +1,4 @@
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import type { RuntimeClient } from '../../runtime/client'
import type { RuntimeStatus } from '../../../shared/runtime-session-contracts'
import {
@@ -4,7 +4,7 @@ import {
orchestrationMutationRecoveryError,
renderCommand
} from './orchestration-mutation-recovery'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
describe('orchestration mutation recovery', () => {
it.runIf(process.platform !== 'win32')(
@@ -1,5 +1,5 @@
import { quotePosixShellDoubleQuotedApostrophe } from '../../../shared/shell/launch/shell-argument-quoting'
import { RuntimeClientError, RuntimeRpcFailureError } from '../../runtime/types'
import { RuntimeClientError, RuntimeRpcFailureError } from '../../runtime/connection/types'
import {
recoverableOrchestrationArgs,
resolveOrchestrationCliExecutable
@@ -1,5 +1,5 @@
import { rejectValuelessFlag } from '../../arguments/flags'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import {
isOrchestrationRetryRequestId,
RETRY_REQUEST_ID_GUIDANCE
@@ -1,4 +1,4 @@
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
export function resolveCompatibilityCliCommand(): 'orca' | 'orca-ide' | 'orca-dev' {
const configured = process.env.ORCA_CLI_COMMAND
+1 -1
View File
@@ -1,6 +1,6 @@
import type { CommandHandler } from '../../dispatch/dispatch'
import { printOrchestrationReceipt } from '../agent-view'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import type { ResetRemovedWork } from '../../../shared/orchestration/orchestration-removed-work'
import { callOrchestrationMutation } from '../recovery/mutation-request'
import { formatResetResult } from './removed-work-format'
+1 -1
View File
@@ -3,7 +3,7 @@ import { printResult } from '../../output/command-result-output'
import { printOrchestrationResult } from '../agent-view'
import { TASK_LIST_VIEW, TASK_RECEIPT_VIEW, type TaskListResult } from './task-agent-views'
import { getOptionalStringFlag, getRequiredStringFlag } from '../../arguments/flags'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import { abbreviateOrchestrationTasks } from '../../../shared/orchestration/orchestration-task-summary'
import { callOrchestrationMutation } from '../recovery/mutation-request'
import { readTextOrFileFlag } from '../../arguments/command-body-input'
@@ -1,5 +1,5 @@
import type { RuntimeClient } from '../../runtime/client'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
export async function requireWorkerDoneSettlement(
client: RuntimeClient,
@@ -2,7 +2,7 @@ import type { CommandHandler } from '../../dispatch/dispatch'
import { printResult } from '../../output/command-result-output'
import { withReceiptNext } from '../receipt-next-text'
import { getOptionalStringFlag, getPresentStringFlag } from '../../arguments/flags'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import type { RuntimeClient } from '../../runtime/client'
import type { RuntimeStatus } from '../../../shared/runtime-session-contracts'
import { ORCHESTRATION_WORKER_LAUNCH_PREFERENCES_RUNTIME_CAPABILITY } from '../../../shared/orchestration/orchestration-runtime-capabilities'
@@ -7,7 +7,7 @@ import {
getOptionalStringFlag,
getRequiredStringFlag
} from '../../arguments/flags'
import { RuntimeClientError } from '../../runtime/types'
import { RuntimeClientError } from '../../runtime/connection/types'
import type {
OrchestrationWorkerReadResult,
OrchestrationWorkerReadSource

Some files were not shown because too many files have changed in this diff Show More