import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core"; import type * as z from "zod/v4"; import { type HashlineParams, hashlineEditParamsSchema } from "../hashline"; import type { ToolSession } from "../tools"; import { vimSchema } from "../tools/vim"; import { type EditMode } from "../utils/edit-mode"; import type { VimToolDetails } from "../vim/types"; import { type ApplyPatchParams, applyPatchSchema } from "./modes/apply-patch"; import { type PatchParams, patchEditSchema } from "./modes/patch"; import { type ReplaceParams, replaceEditSchema } from "./modes/replace"; import { type EditToolDetails } from "./renderer"; export { DEFAULT_EDIT_MODE, type EditMode, normalizeEditMode } from "../utils/edit-mode"; export * from "./apply-patch"; export * from "./diff"; export * from "./file-read-cache"; export * from "../hashline"; export * from "./modes/apply-patch"; export * from "./modes/patch"; export * from "./modes/replace"; export * from "./normalize"; export * from "./renderer"; export * from "./streaming"; type TInput = typeof replaceEditSchema | typeof patchEditSchema | typeof hashlineEditParamsSchema | typeof vimSchema | typeof applyPatchSchema; type VimParams = z.infer; type EditParams = ReplaceParams | PatchParams | HashlineParams | VimParams | ApplyPatchParams; type EditToolResultDetails = EditToolDetails | VimToolDetails; export declare class EditTool implements AgentTool { #private; private readonly session; readonly name = "edit"; readonly label = "Edit"; readonly loadMode = "essential"; readonly nonAbortable = true; readonly concurrency = "exclusive"; readonly strict = true; constructor(session: ToolSession); get mode(): EditMode; get description(): string; get parameters(): TInput; /** * When in `apply_patch` mode, expose the Codex Lark grammar so providers * that support OpenAI-style custom tools can emit a grammar-constrained * variant. Providers that don't support custom tools ignore this field * and fall back to emitting a JSON function tool from `parameters`. */ get customFormat(): { syntax: "lark"; definition: string; } | undefined; /** * Wire-level tool name used when the custom-tool variant is active. GPT-5+ * is trained on the literal name `apply_patch`; internally this is just a * mode of the `edit` tool. The agent-loop dispatcher matches both the * internal `name` and `customWireName`, so returned calls route correctly. */ get customWireName(): string | undefined; execute(_toolCallId: string, params: EditParams, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback, context?: AgentToolContext): Promise>; }