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 astGrepSchema: z.ZodObject<{ pat: z.ZodString; paths: z.ZodArray; skip: z.ZodOptional>; }, z.core.$strip>; export interface AstGrepToolDetails { matchCount: number; fileCount: number; filesSearched: number; limitReached: boolean; parseErrors?: string[]; /** Total parse error count before {@link PARSE_ERRORS_LIMIT} capping. Omitted when no errors. */ parseErrorsTotal?: number; scopePath?: string; files?: string[]; fileMatches?: Array<{ path: string; count: number; }>; meta?: OutputMeta; /** Pre-formatted text for the user-visible TUI render. Mirrors `result.text` lines but uses * a `│` gutter and `*` to mark match lines. The TUI uses this directly so it never parses model-facing text. */ displayContent?: string; /** Absolute base directory used during search. Used by the renderer to resolve * display-relative paths to absolute paths for OSC 8 hyperlinks. */ searchPath?: string; } export declare class AstGrepTool implements AgentTool { private readonly session; readonly name = "ast_grep"; readonly label = "AST Grep"; readonly summary = "Search code with AST patterns (structural grep)"; readonly description: string; readonly parameters: z.ZodObject<{ pat: z.ZodString; paths: z.ZodArray; skip: z.ZodOptional>; }, z.core.$strip>; readonly strict = true; readonly loadMode = "discoverable"; constructor(session: ToolSession); execute(_toolCallId: string, params: z.infer, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback, _context?: AgentToolContext): Promise>; } interface AstGrepRenderArgs { pat?: string; paths?: string[]; skip?: number; } export declare const astGrepToolRenderer: { inline: boolean; renderCall(args: AstGrepRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component; renderResult(result: { content: Array<{ type: string; text?: string; }>; details?: AstGrepToolDetails; isError?: boolean; }, options: RenderResultOptions, uiTheme: Theme, args?: AstGrepRenderArgs): Component; mergeCallAndResult: boolean; }; export {};