import type { ModelRegistry } from "./model-registry.js"; import { type SubagentBudget, type SubagentDefinition, type SubagentExecutionMode, type SubagentModelResolution, type SubagentResolutionError } from "./subagent-registry.js"; export interface SubagentContextPacket { objective: string; roleContract: string; acceptanceCriteria: string[]; selectedEvidenceIds: string[]; selectedFileReferences: string[]; constraints: string[]; effectiveAllowedTools: string[]; effectiveDeniedEffects: string[]; effectiveExecutionMode: SubagentExecutionMode; effectiveBudget: SubagentBudget; requiredOutputSchema: string; parentRunId: string; childRunId: string; } export interface ParentSubagentPolicy { allowedTools?: readonly string[]; deniedEffects?: readonly string[]; executionMode?: SubagentExecutionMode; budget?: SubagentBudget; recursionDepth?: number; maxConcurrentChildren?: number; } export interface ResolvedSubagentInvocation { canonicalAgentName: string; source: "builtin" | "user" | "workspace"; definitionVersion: number; provider: string; configuredModel: string; resolvedModel: string; modelResolutionKind: SubagentModelResolution["resolutionKind"]; executionMode: SubagentExecutionMode; effectiveAllowedTools: string[]; effectiveDeniedEffects: string[]; effectiveBudget: SubagentBudget; recursionDepth: number; inputSchemaId: string; outputSchemaId: string; parentRunId: string; childRunId: string; definition: SubagentDefinition; } export type SubagentRuntimeErrorCode = "SUBAGENT_RESOLUTION_FAILED" | "SUBAGENT_PERMISSION_CONFLICT" | "SUBAGENT_BUDGET_EXCEEDED" | "SUBAGENT_RECURSION_LIMIT" | "SUBAGENT_OUTPUT_INVALID"; export declare class SubagentRuntimeError extends Error { readonly code: SubagentRuntimeErrorCode; readonly details: Record; constructor(code: SubagentRuntimeErrorCode, message: string, details?: Record); } export declare function resolveSubagentInvocation(options: { requestedAgent: string; parentRunId: string; childRunId?: string; parentPolicy?: ParentSubagentPolicy; modelRegistry?: ModelRegistry; source?: "builtin" | "user" | "workspace"; }): ResolvedSubagentInvocation; export declare function createSubagentContextPacket(options: { invocation: ResolvedSubagentInvocation; objective: string; roleContract?: string; acceptanceCriteria?: readonly string[]; selectedEvidenceIds?: readonly string[]; selectedFileReferences?: readonly string[]; constraints?: readonly string[]; }): SubagentContextPacket; export declare function validateParentSubagentOutput(options: { invocation: ResolvedSubagentInvocation; rawOutput: unknown; }): { value: Record; sanitizedRawOutput: string; }; export declare function getResolvedModelForDispatch(definition: SubagentDefinition, modelRegistry?: ModelRegistry): SubagentModelResolution; export type { SubagentResolutionError }; //# sourceMappingURL=subagent-runtime.d.ts.map