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 TruncationResult } from "../session/streaming-output"; import type { ToolSession } from "."; import { type OutputMeta } from "./output-meta"; declare const findSchema: z.ZodObject<{ paths: z.ZodArray; hidden: z.ZodOptional>; gitignore: z.ZodOptional>; limit: z.ZodOptional>; timeout: z.ZodOptional>; }, z.core.$strict>; export type FindToolInput = z.infer; export interface FindToolDetails { truncation?: TruncationResult; resultLimitReached?: number; meta?: OutputMeta; scopePath?: string; fileCount?: number; files?: string[]; truncated?: boolean; error?: string; /** Working directory at search time. Used by the renderer to resolve relative * file paths to absolute paths for OSC 8 hyperlinks. */ cwd?: string; /** User-supplied paths whose base directory was missing on disk. The tool * skipped these and continued with the surviving entries; surfaced as a * non-fatal warning in the renderer and in the model-facing text. */ missingPaths?: string[]; } /** * Pluggable operations for the find tool. * Override these to delegate file search to remote systems (e.g., SSH). */ export interface FindOperations { /** Check if path exists */ exists: (absolutePath: string) => Promise | boolean; /** Optional stat for distinguishing files vs directories. */ stat?: (absolutePath: string) => Promise<{ isFile(): boolean; isDirectory(): boolean; }> | { isFile(): boolean; isDirectory(): boolean; }; /** Find files matching glob pattern. Returns relative paths. */ glob: (pattern: string, cwd: string, options: { ignore: string[]; limit: number; }) => Promise | string[]; } export interface FindToolOptions { /** Custom operations for find. Default: local filesystem + rg */ operations?: FindOperations; } export declare class FindTool implements AgentTool { #private; private readonly session; readonly name = "find"; readonly summary = "Find files and directories matching a glob pattern"; readonly loadMode = "discoverable"; readonly label = "Find"; readonly description: string; readonly parameters: z.ZodObject<{ paths: z.ZodArray; hidden: z.ZodOptional>; gitignore: z.ZodOptional>; limit: z.ZodOptional>; timeout: z.ZodOptional>; }, z.core.$strict>; readonly strict = true; constructor(session: ToolSession, options?: FindToolOptions); execute(_toolCallId: string, params: z.infer, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback, _context?: AgentToolContext): Promise>; } interface FindRenderArgs { paths?: string[]; limit?: number; } export declare const findToolRenderer: { inline: boolean; renderCall(args: FindRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component; renderResult(result: { content: Array<{ type: string; text?: string; }>; details?: FindToolDetails; isError?: boolean; }, options: RenderResultOptions, uiTheme: Theme, args?: FindRenderArgs): Component; mergeCallAndResult: boolean; }; export {};