import { AgentInput } from "../types.js"; import { AgentEvent, AgentResult, Message, RunState, Tool } from "@graphorin/core"; //#region src/runtime/agent-to-tool.d.ts /** * Well-known marker on every `toTool()` tool object. The * graphorin tool-call walk detects it and executes the sub-agent * INLINE (through the same seam as a handoff) so a child suspending on * `awaiting_approval` parks on the parent instead of throwing from the * executor; the resume router resolves parked toTool sub-runs through * the same refs. `Symbol.for` so duplicate package copies agree. * Foreign harnesses mounting the tool outside the graphorin loop keep * the plain `execute()` behavior (a suspended child throws there). */ declare const SUBAGENT_TOOL: unique symbol; /** Child taint flags carried across the toTool fold. */ interface SubAgentFoldTaint { readonly untrusted?: boolean; readonly sensitive?: boolean; readonly sourceKind?: string; } /** * The live references {@link SUBAGENT_TOOL} carries. Typed * loosely on purpose: the walk is generic over foreign TDeps/TOutput * and only ever passes through values it received from the same * factory instance. */ interface SubAgentToolRefs { readonly agentName: string; readonly run: (input: unknown, options?: Record) => Promise>; readonly stream: (input: unknown, options?: Record) => AsyncIterable>; /** Capability restriction from `AgentToToolOptions.capability`. */ readonly capability?: 'read-only'; /** Forwarding policy from `AgentToToolOptions.forwardEvents`. */ readonly forwardEvents?: 'none' | 'lifecycle' | 'all'; /** Reproduce `execute()`'s seed semantics (inputFilter + input string). */ readonly buildSeed: (input: { readonly input: string; }, parentMessages: ReadonlyArray) => AgentInput; /** Reproduce `execute()`'s output shaping (exposeTurns/contextFold/taint). */ readonly shapeCompleted: (result: AgentResult, turns: ReadonlyArray) => { readonly output: unknown; readonly taint?: SubAgentFoldTaint; }; } /** Read the {@link SUBAGENT_TOOL} refs off a (possibly wrapped) tool. */ declare function getSubAgentToolRefs(tool: unknown): SubAgentToolRefs | undefined; //#endregion export { SUBAGENT_TOOL, SubAgentFoldTaint, SubAgentToolRefs, getSubAgentToolRefs }; //# sourceMappingURL=agent-to-tool.d.ts.map