/** * The `submit` tool: how a node with `output:` answers. * * A typed value is never parsed out of prose. The node's schema is published * as the tool's parameters, a call is checked against the same type by * `mismatch`, and what the node outputs is the call, not the text around it. * A call that does not match is refused back to the model, which can call * again within the same turn; a turn that ends with no accepted call fails * the node with `schema`. * * An accepted call ends the turn, as a recorded `verdict` does in a flow. * Measured with gemma-4-31b, three debaters in a loop: a turn left open after * its `submit` invented the rounds that had not happened yet and submitted * again for each, 96 tool calls in one round, until the answer reached the * output limit and failed the node with `provider`. */ import { type ToolDefinition } from "../../session.ts"; import { type ValueType } from "../type.ts"; /** The tool's name, which the runner adds to the agent's `tools:` for a typed node. */ export declare const SUBMIT_TOOL = "submit"; /** What a turn submitted: the value accepted, or why the last call was refused. */ export type Submission = { readonly ok: true; readonly value: unknown; } | { readonly ok: false; readonly message: string; }; /** The tool, and what was submitted through it since the last `take()`. */ export type SubmitTool = { readonly tool: ToolDefinition; /** The last value accepted, else the last refusal, else `undefined`; and forgets them. */ take(): Submission | undefined; }; /** A `submit` tool for values of `type`. One per subagent: the collector is how the value gets back. */ export declare function submitTool(type: ValueType): SubmitTool; /** What a call to the tool carries for `value` of `type`: the value itself, or `{ value }`. */ export declare function submission(value: unknown, type: ValueType): unknown; /** `type` as the JSON Schema a provider reads, descriptions kept for the model filling it. */ export declare function jsonSchema(type: ValueType): Record; //# sourceMappingURL=submit.d.ts.map