/** * Isolated bounded subagents. * * First-class subagent runs: isolated context, bounded toolset, bounded budget, * bounded lifetime, cancellation propagation, durable start/finish events, and * structured output that the parent must validate before use. A subagent * cannot expand scope, cannot mutate/commit/publish by default, and cannot * recursively spawn children beyond explicit parent policy and depth limits. * All child consumption is charged to the parent budget via the ledger. */ import type { BudgetLedger } from "./budget-ledger.js"; import type { SubagentRunRecord, SubagentSpec, SubagentStatus } from "./types.js"; export interface SubagentRuntimeConfig { maxDepth: number; maxTotalChildren: number; maxConcurrentChildren: number; } export declare const DEFAULT_SUBAGENT_CONFIG: SubagentRuntimeConfig; export interface SubagentLaunchInput { spec: SubagentSpec; parentCanMutate: boolean; parentCanPublish: boolean; siblingCount: number; activeChildren: number; parentLedger: BudgetLedger; config?: SubagentRuntimeConfig; } export interface LaunchDecision { allowed: boolean; reasonCodes: string[]; record: SubagentRunRecord | null; } /** * Deterministically decide whether a subagent may launch under parent policy * and runtime limits (depth, total children, concurrency, budget, mutation). */ export declare function canLaunchSubagent(input: SubagentLaunchInput): LaunchDecision; /** Advance a subagent record status (durable event), frozen snapshot. */ export declare function transitionSubagent(record: SubagentRunRecord, status: SubagentStatus, at?: string): SubagentRunRecord; /** Charge a child's consumption to the parent budget (append-only, idempotent). */ export declare function chargeChildToParent(ledger: BudgetLedger, childId: string, resource: string, amount: number, runId: string): BudgetLedger; /** Deterministic ordering key for parallel read-only subagent results. */ export declare function parallelOrderKey(records: readonly SubagentRunRecord[]): string[]; export type { SubagentRunRecord, SubagentStatus }; //# sourceMappingURL=subagents.d.ts.map