import type { ToolDefinition } from "@earendil-works/pi-coding-agent"; import type { adaptToolDefinition, PiToolOwnerAdapterOptions } from "@r3b1s/pi-repair-layer/pi"; /** * True only when `error` is a module-resolution failure for * `@r3b1s/pi-repair-layer` itself — never for a present-but-broken install. * * Both error codes are required: `MODULE_NOT_FOUND` is jiti's require path * (Node-based pi), `ERR_MODULE_NOT_FOUND` is native ESM and the compiled pi * binary. The message must additionally name `@r3b1s/pi-repair-layer` * specifically — a present-but-broken install throws the same codes naming a * *transitive* module, and swallowing that would silently disable repairs * the user believes are active, so it must be rethrown instead. Exported * separately from `loadRepairAdapter` so this classification is directly * unit-testable: vitest's module mocking can substitute what a successful * dynamic import resolves to, but it cannot make the import() itself reject * with an arbitrary error shape. */ export declare function isRepairPackageAbsent(error: unknown): boolean; /** * Attempt to load `@r3b1s/pi-repair-layer`'s adaptToolDefinition. Returns * undefined when the package is genuinely absent so callers can register * tmux-pilot's raw tool definitions unchanged; rethrows anything else. */ export declare function loadRepairAdapter(): Promise; /** * Decorate a tool definition with the repair adapter when available; * otherwise register the identity definition unchanged. Never a partial * wrapper. */ export declare function withRepair>(adapt: typeof adaptToolDefinition | undefined, definition: TDef, options?: PiToolOwnerAdapterOptions): TDef; /** * The `subagent` (spawn) tool's own description calls the `prompt` field * "the task for the agent to perform", which makes `task` a highly plausible * model-generated alias — the one preprocessor configured today. Other tools * (steer/resume/get-result) have no comparably strong, named collision to * alias without guessing, so they run with no preprocessors. */ export declare const subagentRepairOptions: { policy: "adaptive"; preprocessors: { kind: "alias"; selector: "/agents/*/prompt"; aliases: string[]; accepts: "string"; }[]; }; //# sourceMappingURL=tool-repair.d.ts.map