UNPKG

@mariozechner/pi-coding-agent

Version:

Coding agent CLI with read, bash, edit, write tools and session management

37 lines 1.94 kB
import type { AgentTool } from "@mariozechner/pi-agent-core"; import { type Static } from "@sinclair/typebox"; import type { ToolDefinition } from "../extensions/types.js"; import { type TruncationResult } from "./truncate.js"; declare const grepSchema: import("@sinclair/typebox").TObject<{ pattern: import("@sinclair/typebox").TString; path: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>; glob: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>; ignoreCase: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>; literal: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>; context: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>; limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>; }>; export type GrepToolInput = Static<typeof grepSchema>; export interface GrepToolDetails { truncation?: TruncationResult; matchLimitReached?: number; linesTruncated?: boolean; } /** * Pluggable operations for the grep tool. * Override these to delegate search to remote systems (for example SSH). */ export interface GrepOperations { /** Check if path is a directory. Throws if path does not exist. */ isDirectory: (absolutePath: string) => Promise<boolean> | boolean; /** Read file contents for context lines */ readFile: (absolutePath: string) => Promise<string> | string; } export interface GrepToolOptions { /** Custom operations for grep. Default: local filesystem plus ripgrep */ operations?: GrepOperations; } export declare function createGrepToolDefinition(cwd: string, options?: GrepToolOptions): ToolDefinition<typeof grepSchema, GrepToolDetails | undefined>; export declare function createGrepTool(cwd: string, options?: GrepToolOptions): AgentTool<typeof grepSchema>; export {}; //# sourceMappingURL=grep.d.ts.map