import type { AgentTool } from "@caupulican/pi-agent-core"; import { type TruncationResult } from "@caupulican/pi-agent-core/truncate"; import { type Static, Type } from "typebox"; import type { ArtifactStore } from "../context/context-artifacts.ts"; import { type BroadQueryTracker } from "../context/tool-output-packer.ts"; import type { ToolDefinition } from "../extensions/types.ts"; import { type FffSearchBackend } from "./fff-search-backend.ts"; import { type ManagedSearchToolOptions } from "./managed-search-tool.ts"; import type { SearchRouter } from "./search-router.ts"; declare const findSchema: Type.TObject<{ pattern: Type.TString; path: Type.TOptional; limit: Type.TOptional; ignoreCase: Type.TOptional; }>; export type FindToolInput = Static; export interface FindToolDetails { truncation?: TruncationResult; resultLimitReached?: number; /** Set only when output was packed to an artifact; see tool-output-packer.ts. */ artifactId?: string; /** Set when this exact query has repeatedly produced broad/truncated results. */ invalidationCandidate?: boolean; } /** * Pluggable operations for the find tool. * Override these to delegate file search to remote systems (for example SSH). */ export interface FindOperations { /** Check if path exists */ exists: (absolutePath: string) => Promise | boolean; /** Find files matching glob pattern. Returns relative or absolute paths. */ glob: (pattern: string, cwd: string, options: { ignore: string[]; limit: number; }) => Promise | string[]; } export interface FindToolOptions extends ManagedSearchToolOptions { /** Custom operations for find. Default: local filesystem plus routed FFF/fd search */ operations?: FindOperations; /** FFF backend for resident indexed search. Set false to force fd fallback. */ fff?: FffSearchBackend | false; /** Pure router that selects FFF or fd from request filters and environment facts. */ searchRouter?: SearchRouter; /** * Opt-in artifact store for first-capture-then-bound output packing (Phase 3). When * omitted (the default), behavior is byte-for-byte unchanged from before this option * existed: output is truncated the same way, just never artifact-backed. */ artifactStore?: ArtifactStore; /** Opt-in tracker for repeated-broad-query "do not repeat" signals. Also default-off. */ broadQueryTracker?: BroadQueryTracker; } export declare function tryFffFind(options: { backend: FffSearchBackend; router: SearchRouter; cwd: string; searchPath: string; pattern: string; ignoreCase?: boolean; effectiveLimit: number; toolCallId: string; artifactStore?: ArtifactStore; broadQueryTracker?: BroadQueryTracker; rawPath?: string; }): Promise<{ text: string; details: FindToolDetails; } | undefined>; export declare function createFindToolDefinition(cwd: string, options?: FindToolOptions): ToolDefinition; export declare function createFindTool(cwd: string, options?: FindToolOptions): AgentTool; export {}; //# sourceMappingURL=find.d.ts.map