/** * Pi tool factory adapter — implements IToolFactory by compiling * canonical tool definitions into Pi's native tool format. * * Pi's registerTool format (from its ExtensionAPI): * pi.registerTool({ * name, label, description, * parameters: TypeBox schema (JSON Schema compatible), * execute(toolCallId, params, signal, onUpdate, ctx) { ... } * }) * * Since @earendil-works/pi-coding-agent is an optional peer dependency, * this adapter uses loose typing (no direct import from Pi). */ import { z } from "zod"; import type { IToolFactory } from "../../ports/tool-factory.ts"; import type { CanonicalToolDef } from "../../types.ts"; import type { ToolInterceptorHooks } from "./tool-interceptor.ts"; /** * IToolFactory adapter for the Pi platform. * * Compiles CanonicalToolDefs into Pi-compatible tool definition objects * that can be passed to pi.registerTool(). * * Prefer compileAll() over compile() because Pi tool definitions require * a name (the record key), which is only available in compileAll(). */ export declare class PiToolFactory implements IToolFactory { #private; constructor(hooks?: ToolInterceptorHooks); compile(def: CanonicalToolDef): unknown; /** * Compile a record of named canonical tool definitions into a record of * Pi-compatible tool objects. The record key becomes the tool's `name` * and drives the auto-generated `label`. */ compileAll(defs: Record): Record; } //# sourceMappingURL=tool-factory.d.ts.map