refactor: group agent launch contracts under concrete owners (#37915)

This commit is contained in:
Neil
2026-11-03 14:45:49 -08:00
committed by GitHub
parent ad5657a57f
commit d5f2a17cd2
1238 changed files with 2460 additions and 2319 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ import { z } from 'zod'
import {
AGENT_LAUNCH_RUNTIME_CAPABILITIES,
AGENT_LAUNCH_SURFACE_RUNTIME_CAPABILITY
} from '../shared/agent-launch-runtime-capability'
} from '../shared/agent-launch/contracts/agent-launch-runtime-capability'
import { agentLaunchFixture } from './agent-launch-test-fixtures'
it('real CLI processes carry surface choices and refuse invalid or unsupported picks before mutation', async () => {
+1 -1
View File
@@ -1,5 +1,5 @@
import { RuntimeClientError, RuntimeRpcFailureError } from './runtime-client'
import { classifyAgentLaunchReplayRefusal } from '../shared/agent-launch-replay-refusal'
import { classifyAgentLaunchReplayRefusal } from '../shared/agent-launch/contracts/agent-launch-replay-refusal'
import {
recoverableOrchestrationArgs,
resolveOrchestrationCliExecutable
+12 -6
View File
@@ -1,21 +1,27 @@
// agent.launch shares desktop/mobile policy; absent --surface uses the host's Chat | CLI choice for the agent.
import { randomUUID } from 'node:crypto'
import type { AgentLaunchPrompt, AgentLaunchResult } from '../shared/agent-launch-intent'
import { AGENT_LAUNCH_SURFACES, type AgentLaunchSurface } from '../shared/agent-launch-surface'
import { checkAgentLaunchModelPreferences } from '../shared/agent-launch-model-preferences'
import type {
AgentLaunchPrompt,
AgentLaunchResult
} from '../shared/agent-launch/contracts/agent-launch-intent'
import {
AGENT_LAUNCH_SURFACES,
type AgentLaunchSurface
} from '../shared/agent-launch/contracts/agent-launch-surface'
import { checkAgentLaunchModelPreferences } from '../shared/agent-launch/choices/agent-launch-model-preferences'
import {
AGENT_LAUNCH_RUNTIME_CAPABILITY,
AGENT_LAUNCH_PROMPT_CARRY_RUNTIME_CAPABILITY,
AGENT_LAUNCH_LOCAL_PRESENTATION_RUNTIME_CAPABILITY,
AGENT_LAUNCH_REPLAY_REQUIRED_RUNTIME_CAPABILITY,
AGENT_LAUNCH_SURFACE_RUNTIME_CAPABILITY
} from '../shared/agent-launch-runtime-capability'
} from '../shared/agent-launch/contracts/agent-launch-runtime-capability'
import { createStructuredAgentSessionOperationId } from '../shared/agent-session/lifecycle/structured-agent-session-mutation'
import { parseAgentSessionOperationTimestamp } from '../shared/agent-session/agent-session-host-authority'
import type { RuntimeStatus } from '../shared/runtime-types'
import type { TuiAgent } from '../shared/tui-agent'
import { isTuiAgent } from '../shared/tui-agent-config'
import type { TuiAgent } from '../shared/agent-launch/catalog/tui-agent'
import { isTuiAgent } from '../shared/agent-launch/catalog/tui-agent-config'
import {
getOptionalStringFlag,
getRequiredStringFlag,
+1 -1
View File
@@ -1,4 +1,4 @@
import { AGENT_LAUNCH_RUNTIME_CAPABILITIES } from '../shared/agent-launch-runtime-capability'
import { AGENT_LAUNCH_RUNTIME_CAPABILITIES } from '../shared/agent-launch/contracts/agent-launch-runtime-capability'
import { okFixture } from './test-fixtures'
export function agentLaunchHostFixture() {
+1 -1
View File
@@ -1,5 +1,5 @@
import { resolve as resolvePath } from 'node:path'
import type { TuiAgent } from '../shared/tui-agent'
import type { TuiAgent } from '../shared/agent-launch/catalog/tui-agent'
import {
isPathInsideOrEqual,
normalizeRuntimePathForComparison
+2 -2
View File
@@ -3,14 +3,14 @@ import {
normalizeTaskSourceContext,
type TaskSourceContext
} from '../../shared/task-source-context'
import type { TuiAgent } from '../../shared/tui-agent'
import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent'
import {
DEFAULT_AUTOMATION_PRECHECK_TIMEOUT_SECONDS,
MAX_AUTOMATION_PRECHECK_TIMEOUT_SECONDS
} from '../../shared/automation-precheck'
import { buildAutomationRrule } from '../../shared/automation-schedule-occurrences'
import { isValidAutomationSchedule } from '../../shared/automation-schedule-parsing'
import { isTuiAgent } from '../../shared/tui-agent-config'
import { isTuiAgent } from '../../shared/agent-launch/catalog/tui-agent-config'
import {
getOptionalPositiveIntegerFlag,
getOptionalStringFlag,
+1 -1
View File
@@ -5,7 +5,7 @@ import {
import {
EXTRA_AGENT_ARGS_HOST_UPDATE_REQUIRED,
hasExtraAgentArgs
} from '../../shared/automation-extra-agent-args'
} from '../../shared/agent-launch/startup/automation-extra-agent-args'
import type { RuntimeStatus } from '../../shared/runtime-types'
import type { RuntimeClient } from '../runtime-client'
import { RuntimeClientError } from '../runtime-client'
@@ -1,10 +1,10 @@
// Use agent.launch for surface/model/effort; older hosts fall back to the create startup terminal.
import type { AgentLaunchResult } from '../../shared/agent-launch-intent'
import type { AgentLaunchResult } from '../../shared/agent-launch/contracts/agent-launch-intent'
import {
AGENT_LAUNCH_LOCAL_PRESENTATION_RUNTIME_CAPABILITY,
AGENT_LAUNCH_PROMPT_CARRY_RUNTIME_CAPABILITY
} from '../../shared/agent-launch-runtime-capability'
} from '../../shared/agent-launch/contracts/agent-launch-runtime-capability'
import type { RuntimeWorktreeCreateResult, RuntimeWorktreeRecord } from '../../shared/runtime-types'
import {
callAgentLaunch,
+1 -1
View File
@@ -28,7 +28,7 @@ import {
resolveWorktreeCreateCwdContext,
resolveCurrentWorktreeSelector
} from '../selectors'
import type { TuiAgent } from '../../shared/tui-agent'
import type { TuiAgent } from '../../shared/agent-launch/catalog/tui-agent'
import { parseCliAgent, readCliAgentLaunch } from '../agent-launch-request'
import { createWorktreeWithAgent } from './worktree-create-agent-launch'
import { printLineageSummary } from './worktree-lineage-summary'
+1 -1
View File
@@ -7,7 +7,7 @@ import {
import { quoteWindowsCmdArgument } from '@orca/process-host/windows-command-line'
import { quotePowerShellNativeArgument } from '../shared/powershell-native-argument'
import { resolveWindowsShellStartupFamily } from '../shared/windows-terminal-shell'
import type { AgentStartupShell } from '../shared/tui-agent-startup-shell'
import type { AgentStartupShell } from '../shared/agent-launch/startup/tui-agent-startup-shell'
export function orchestrationMutationRecoveryError(
error: unknown,
+1 -1
View File
@@ -1,5 +1,5 @@
import { SKILL_INSTALL_RESULT_V2_CAPABILITY } from '../../shared/skill-install-capability'
import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../shared/agent-launch-runtime-capability'
import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../shared/agent-launch/contracts/agent-launch-runtime-capability'
import { createServer, type Server } from 'node:http'
import { mkdtempSync } from 'node:fs'
import { tmpdir } from 'node:os'
+1 -1
View File
@@ -4,7 +4,7 @@ import type {
RuntimeOrchestrationEnvelope
} from '../../shared/runtime-rpc-envelope'
import { RemoteRuntimeClientError } from '../../shared/remote-runtime/remote-runtime-client-error'
import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../shared/agent-launch-runtime-capability'
import { AGENT_LAUNCH_RUNTIME_CAPABILITY } from '../../shared/agent-launch/contracts/agent-launch-runtime-capability'
import {
sendRemoteRuntimeRequest,
sendRemoteRuntimeRequestWithStatusPreflight