Public declaration syntax from forge-ts/packages/forge-agent/src/subagent.ts Original source SHA-256: 30c60fd0938dc0eb99383880558d8a791b3eb371ecd3ef1dd2a2bc74c0dad444 Function bodies and constant values are omitted. This is not the complete implementation. Source line 35 export interface SubAgentConfig { /** A human-readable name for the sub-agent. */ readonly name: string; /** The language model for the sub-agent (may differ from parent). */ readonly model: LanguageModel; /** Optional system prompt for the sub-agent. */ readonly systemPrompt?: string; /** Maximum tool loop iterations. Defaults to 10. */ readonly maxIterations?: number; /** Generation options for the sub-agent's model calls. */ readonly generateOptions?: GenerateOptions; /** Approval handler for the sub-agent. Defaults to parent's handler. */ readonly approvalHandler?: ApprovalHandler; /** Custom stop conditions for the sub-agent. */ readonly stopConditions?: readonly AgentStopCondition[]; /** * Tool names to grant to the sub-agent. Must be a subset of the * parent's registered tools. * * ANVIL Spec section 11.3: child_capabilities subset_of parent_capabilities. */ readonly allowedTools?: readonly string[]; /** Optional sub-agent DID. */ readonly agentDid?: string; } Source line 91 export function createSubAgent( parent: ToolLoopAgent, config: SubAgentConfig ): ToolLoopAgent; Source line 179 export async function runSubAgentTask( parent: ToolLoopAgent, config: SubAgentConfig, message: string ): Promise;