/**
 * `structured_output` — terminating tool used to capture a subagent's final result.
 *
 * Injected into a subagent's toolset only when the workflow script asked for
 * structured output via `agent(prompt, { schema })`. The subagent is instructed
 * to invoke this tool exactly once with its final result; the tool sets
 * `terminate: true` so the agent loop stops without paying for an extra
 * assistant turn.
 *
 * Validation is done with ajv (already a xopc dep). pi-agent-core also validates
 * arguments against `parameters` before calling `execute`, but we re-check here
 * to (1) surface a clear error message back to the model when the schema is
 * non-trivial, and (2) avoid trusting the upstream layer's validator strictness.
 *
 * Note: the file is named `structured-output-tool.ts` to avoid clashing with the
 * existing `src/agent/tools/structured-output.ts` (an XML Element builder — a
 * completely unrelated utility).
 */
import type { AgentTool } from '@earendil-works/pi-agent-core';
import type { TSchema } from '@sinclair/typebox';
import type { JsonSchema } from './types.js';
export declare const STRUCTURED_OUTPUT_TOOL_NAME = "structured_output";
export interface StructuredOutputCapture<T = unknown> {
    called: boolean;
    value?: T;
}
export interface CreateStructuredOutputToolOptions<T = unknown> {
    schema: JsonSchema;
    capture: StructuredOutputCapture<T>;
    /** Override the tool name (rarely needed; default `structured_output`). */
    name?: string;
}
export declare function createStructuredOutputTool<T = unknown>(options: CreateStructuredOutputToolOptions<T>): AgentTool<TSchema, T>;
