/**
 * agent_bridge — tool dispatcher (WAB.4, 0.5.97).
 *
 * Authoritative spec: `docs/tasks/T-warm-agent-chat-bridge.md` WAB.4.
 * Architecture: `docs/tasks/WAB.1-architecture.md` decisions (e) + (f).
 *
 * Responsibility:
 *   1. Hold a name-indexed registry of `ToolSpec` + `ToolHandler` pairs.
 *   2. On `call(name, input, ctx)`: look up the spec, run the spec's
 *      optional `validate(input)` guard (throws on bad input), forward
 *      the validated value to the handler, return the handler's string
 *      output (which the agent loop feeds back as a `tool_result` block).
 *   3. On `list()`: return the snapshot of registered specs in the order
 *      they were registered. The agent loop passes this to
 *      `Anthropic.messages.create({ tools })`.
 *
 * Non-responsibility:
 *   - Does NOT call the model. The agent loop (`agent_loop.ts`) owns the
 *     SDK round-trip; the dispatcher only resolves `tool_use` blocks.
 *   - Does NOT manage tool lifecycle (registration happens once per
 *     session at construction; no add/remove at runtime in WAB.4).
 *   - Does NOT auto-convert zod → JSON Schema. Tool authors supply both
 *     `input_schema` (JSON Schema, for the model) and `validate`
 *     (runtime guard, for the dispatcher) — see types.ts comment.
 *
 * Error contract:
 *   - Unknown name → `Error` with prefix `tool_dispatcher: unknown tool`.
 *     The agent loop catches and surfaces as a fatal turn error (the
 *     model invoked something not in the declared list — likely a
 *     schema/spec mismatch).
 *   - Validation failure → re-throws the validator's error (zod's
 *     `ZodError` carries structured detail; ajv's `ValidationError`
 *     similarly). Caller can inspect the error class.
 *   - Handler rejection → surfaces unmodified.
 *
 * Imports from: ./types.js.
 * Imported by: agent_loop.ts (caller), pack_binding.ts (WAB.6
 *   builder), daemon.ts (WAB.7 wiring).
 */
import type { ToolContext, ToolDispatcher, ToolHandler, ToolSpec } from './types.js';
export interface ToolRegistration {
    spec: ToolSpec;
    handler: ToolHandler;
}
export declare class SimpleToolDispatcher implements ToolDispatcher {
    private readonly tools;
    constructor(initial?: ToolRegistration[]);
    /**
     * Add a tool to the registry. Throws on duplicate name — silent
     * shadowing would let one pack hijack another pack's tool surface.
     */
    register(t: ToolRegistration): void;
    /** Live tool count (telemetry / tests). */
    get size(): number;
    /** Whether a tool with this name is registered. */
    has(name: string): boolean;
    list(): ToolSpec[];
    call(name: string, input: unknown, ctx: ToolContext): Promise<string>;
}
//# sourceMappingURL=tool_dispatcher.d.ts.map