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 { ToolDefinition } from "../extensions/types.ts"; import { type FileFailureRecoveryAuthority } from "./file-failure-recovery.ts"; declare const lsSchema: Type.TObject<{ path: Type.TOptional; limit: Type.TOptional; metadata: Type.TOptional; }>; export type LsToolInput = Static; export interface LsToolDetails { truncation?: TruncationResult; entryLimitReached?: number; } /** * Pluggable operations for the ls tool. * Override these to delegate directory listing to remote systems (for example SSH). */ export interface LsEntryStats { isDirectory: () => boolean; size?: number; mode?: number; } export interface LsOperations { /** Check if path exists */ exists: (absolutePath: string) => Promise | boolean; /** Get file or directory stats. Throws if not found. */ stat: (absolutePath: string) => Promise | LsEntryStats; /** Read directory entries */ readdir: (absolutePath: string) => Promise | string[]; } export interface LsToolOptions { /** Custom operations for directory listing. Default: local filesystem */ operations?: LsOperations; /** Shared backend identity for exact cross-tool recovery with custom operations. */ failureRecoveryAuthority?: FileFailureRecoveryAuthority; } export declare function createLsToolDefinition(cwd: string, options?: LsToolOptions): ToolDefinition; export declare function createLsTool(cwd: string, options?: LsToolOptions): AgentTool; export {}; //# sourceMappingURL=ls.d.ts.map