import { type AgentConfig, type AgentScope, type AgentSource } from "../agents/agents.ts"; import { type ResolvedSubagentCapabilityCeiling, type SubagentCapabilityAudit } from "../runs/shared/capability-ceiling.ts"; import type { ResolvedMcpDirectToolSelection } from "../runs/shared/mcp-direct-tool-allowlist.ts"; import { type AvailableModelInfo, type ParentModel } from "../runs/shared/model-fallback.ts"; import { AGENT_DEFINITION_PROJECTION_VERSION } from "../shared/launch-contract.ts"; import type { ResolvedTurnBudget } from "../shared/types.ts"; import { type ArtifactDirPreference, type ArtifactPaths, type JsonSchemaObject, type OutputMode } from "../shared/types.ts"; export declare const SUBAGENT_LAUNCH_CONTRACT_VERSION: 2; export type SubagentLaunchContractReasonCode = "missing_agent" | "ambiguous_agent" | "missing_skill" | "denied_required_tool" | "invalid_artifact_dir" | "invalid_cwd" | "unsupported_mode" | "restricted_agent"; export interface SubagentLaunchContractDiagnostic { code: SubagentLaunchContractReasonCode | "host_required" | "snapshot_warning"; severity: "error" | "warning" | "host-required"; message: string; } export interface SubagentLaunchContractInput { agent: string; cwd: string; task?: string; agentScope?: AgentScope; context?: "fresh" | "fork"; model?: string; thinking?: string | false; parentModel?: ParentModel; availableModels?: ReadonlyArray; preferredProvider?: string; skill?: string | string[] | boolean; output?: string | boolean; outputMode?: OutputMode; outputSchema?: JsonSchemaObject; turnBudget?: ResolvedTurnBudget; artifacts?: boolean; artifactDir?: ArtifactDirPreference; parentSessionFile?: string | null; sessionRoot?: string; sessionDir?: string; runId?: string; /** Root run id supplied by a host when projecting nested async lifecycle paths. */ nestedRootRunId?: string; capabilityCeiling?: ResolvedSubagentCapabilityCeiling; inheritedCapabilityCeiling?: ResolvedSubagentCapabilityCeiling; } export interface SubagentLaunchContractAgentCandidate { name: string; localName?: string; packageName?: string; source: AgentSource; filePath: string; disabled?: boolean; selected: boolean; } export interface SubagentLaunchContractAgent { name: string; localName?: string; packageName?: string; source: AgentSource; filePath: string; definitionProjectionVersion: typeof AGENT_DEFINITION_PROJECTION_VERSION; definitionDigest: string; shadowedCandidates: SubagentLaunchContractAgentCandidate[]; } export interface SubagentLaunchContractSkills { requested: string[]; resolved: Array<{ name: string; path: string; source: string; }>; missing: string[]; } export interface SubagentLaunchContractTools { requestedBuiltin: string[]; declaredBuiltin: string[]; effectiveAllowlist: string[]; explicitAllowlist: boolean; requiredChildTools: string[]; internalTools: string[]; mcp: ResolvedMcpDirectToolSelection[]; effectiveMcpTools: string[]; toolExtensionPaths: string[]; runtimeExtensions: string[]; configuredExtensions: string[]; extensionArgs: string[]; disableAmbientExtensions: boolean; fanoutAuthorized: boolean; capabilityCeiling?: ResolvedSubagentCapabilityCeiling; capabilityAudit?: SubagentCapabilityAudit; } export interface SubagentLaunchContractRoots { cwd: string; sessionRoot?: string; sessionDir?: string; sessionFile?: string; artifactsDir?: string; artifactPaths?: ArtifactPaths; outputPath?: string; lifecycle?: { asyncDir: string; resultPath: string; statusPath: string; eventsPath: string; processTerminalPath: string; processTerminalCandidatePath: string; }; } export interface SubagentLaunchContract { version: typeof SUBAGENT_LAUNCH_CONTRACT_VERSION; runId: string; agent: SubagentLaunchContractAgent; context: "fresh" | "fork"; model?: string; modelCandidates: string[]; thinking?: string; systemPromptMode: AgentConfig["systemPromptMode"]; inheritProjectContext: boolean; inheritSkills: boolean; skills: SubagentLaunchContractSkills; tools: SubagentLaunchContractTools; roots: SubagentLaunchContractRoots; protocol: { lifecycleArtifactVersion: number; packageVersion: string; }; diagnostics: SubagentLaunchContractDiagnostic[]; /** Digest of the resolved child inputs, recomputed by execution paths. */ launchContractDigest: string; digest: string; } export type SubagentLaunchContractResult = { ok: true; contract: SubagentLaunchContract; } | { ok: false; code: SubagentLaunchContractReasonCode; message: string; diagnostics: SubagentLaunchContractDiagnostic[]; }; export declare function resolveSubagentLaunchContract(input: SubagentLaunchContractInput): Promise; //# sourceMappingURL=preflight.d.ts.map