import type { ChannelAdapter } from "#channel/adapter.js"; /** * Durable adapter kind used for delegated subagent child runs. * * Framework-owned — authored channel code never constructs a subagent * adapter directly. Emitted by `buildSubagentRunInput` * (`execution/subagent-tool.ts`) when a parent dispatches a child * subagent. */ export declare const SUBAGENT_ADAPTER_KIND = "subagent"; /** * Durable state carried on a subagent adapter instance. * * Populated by `buildSubagentRunInput` at dispatch time so the child * run retains the parent lineage metadata required to resume its parent * when the child finishes and to forward HITL requests up the chain. * * The parent's turn identifier is not duplicated here — it lives on * `RunInput.parent.turn.id` which is the single source of truth for the * child's parent-turn lineage. */ export interface SubagentAdapterState extends Record { readonly callId: string; readonly parentContinuationToken: string; readonly parentSessionId: string; readonly subagentName: string; } /** * Narrow runtime guard for {@link SubagentAdapterState}. * * Framework adapters live through a JSON round-trip at every workflow * step boundary, so consumers that want to treat the adapter state as * a structured record must validate the shape explicitly. */ export declare function isSubagentAdapterState(value: unknown): value is SubagentAdapterState; /** * Framework adapter that bridges a child subagent session to its * parent. * * It proxies child `input.requested` events upward so the parent channel * can render HITL prompts and route responses back down to the child. */ export declare const SUBAGENT_ADAPTER: ChannelAdapter;