import { t } from "structural"; import { SequenceIdTagged } from "../history.ts"; import { Config } from "../config.ts"; import { Transport } from "../transports/transport-common.ts"; export declare class ToolError extends Error { constructor(message: string); } export declare const USER_ABORTED_ERROR_MESSAGE = "Aborted by user"; export declare function attempt(errMessage: string, callback: () => Promise): Promise; export declare function attemptUntrackedStat(transport: Transport, signal: AbortSignal, path: string): Promise; export declare function attemptUntrackedRead(transport: Transport, signal: AbortSignal, path: string): Promise; export type ToolResult = { content: string; lines?: number; }; export type ToolDef = { ArgumentsSchema: t.Type; Schema: t.Type; validate: (abortSignal: AbortSignal, transport: Transport, t: T, cfg: Config) => Promise; run: (abortSignal: AbortSignal, transport: Transport, t: SequenceIdTagged<{ tool: T; }>, cfg: Config, modelOverride: string | null) => Promise; };