import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core"; import type { Component } from "@oh-my-pi/pi-tui"; import * as z from "zod/v4"; import type { RenderResultOptions } from "../extensibility/custom-tools/types"; import type { Theme } from "../modes/theme/theme"; import type { ToolSession } from "."; import type { OutputMeta } from "./output-meta"; declare const astEditSchema: z.ZodObject<{ ops: z.ZodArray>; paths: z.ZodArray; }, z.core.$strip>; export interface AstEditToolDetails { totalReplacements: number; filesTouched: number; filesSearched: number; applied: boolean; limitReached: boolean; parseErrors?: string[]; /** Total parse error count before {@link PARSE_ERRORS_LIMIT} capping. Omitted when no errors. */ parseErrorsTotal?: number; scopePath?: string; files?: string[]; fileReplacements?: Array<{ path: string; count: number; }>; meta?: OutputMeta; /** Pre-formatted text for the user-visible TUI render. Mirrors `result.text` lines but uses * a `│` gutter (no model-only hashline anchors). The TUI uses this directly so it never parses model-facing text. */ displayContent?: string; /** Absolute base directory used during the edit. Used by the renderer to resolve * display-relative paths to absolute paths for OSC 8 hyperlinks. */ searchPath?: string; } export declare class AstEditTool implements AgentTool { private readonly session; readonly name = "ast_edit"; readonly label = "AST Edit"; readonly summary = "Perform AST-aware code edits (structural refactoring)"; readonly description: string; readonly parameters: z.ZodObject<{ ops: z.ZodArray>; paths: z.ZodArray; }, z.core.$strip>; readonly strict = true; readonly deferrable = true; readonly loadMode = "discoverable"; constructor(session: ToolSession); execute(_toolCallId: string, params: z.infer, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback, _context?: AgentToolContext): Promise>; } interface AstEditRenderArgs { ops?: Array<{ pat?: string; out?: string; }>; paths?: string[]; } export declare const astEditToolRenderer: { inline: boolean; renderCall(args: AstEditRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component; renderResult(result: { content: Array<{ type: string; text?: string; }>; details?: AstEditToolDetails; isError?: boolean; }, options: RenderResultOptions, uiTheme: Theme, args?: AstEditRenderArgs): Component; mergeCallAndResult: boolean; }; export {};