import type { AgentToolResult, ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent"; import { type Static, Type } from "typebox"; import type { PluginContext } from "../types.js"; declare const BashTaskParams: Type.TObject<{ task_id: Type.TString; }>; declare const BashStatusParams: Type.TObject<{ task_id: Type.TString; output_mode: Type.TOptional, Type.TLiteral<"raw">, Type.TLiteral<"both">]>>; }>; declare const BashWatchParams: Type.TObject<{ task_id: Type.TString; pattern: Type.TOptional]>>; background: Type.TOptional; timeout_ms: Type.TOptional>; once: Type.TOptional; }>; declare const BashWriteParams: Type.TObject<{ task_id: Type.TString; input: Type.TUnion<[Type.TString, Type.TArray]>>]>; }>; interface BashStatusWaited { reason: "matched" | "exited" | "timeout" | "user_message" | "unavailable"; elapsed_ms: number; match?: string; match_offset?: number; match_stream?: "stdout" | "stderr"; } interface BashStatusDetails { success: boolean; status: string; exit_code?: number; duration_ms?: number; output_preview?: string; command?: string; mode?: string; output_path?: string; pty_rows?: number; pty_cols?: number; pty_screen?: string; pty_raw?: string; live_descendants?: Array<{ pid: number; comm: string; argv0: string; }> | null; live_descendants_omitted?: number; live_descendants_summary?: string; waited?: BashStatusWaited; } interface BashWriteDetails { success: boolean; bytes_written?: number; } interface BashKillDetails { success: boolean; status: string; kill_signaled?: boolean; kill_reached?: number; } interface BashWatchDetails extends Record { } /** Register AFT's primary bash tool under either the host or aft_ name. */ export declare function registerBashTool(pi: ExtensionAPI, ctx: PluginContext, aftSearchRegistered?: boolean, registeredName?: string, registerCompanions?: boolean, shell?: "bash" | "powershell"): void; /** * Register controls for AFT-owned background task IDs. * * These names deliberately do not follow the primary bash tool's prefix: Pi's * native bash cannot create or inspect AFT task IDs, so the controls do not * replace host-native behavior and must stay discoverable for `aft_bash`. */ export declare function registerBashCompanionTools(pi: ExtensionAPI, ctx: PluginContext): void; export declare function createBashStatusTool(ctx: PluginContext): { name: string; label: string; description: string; promptSnippet: string; parameters: Type.TObject<{ task_id: Type.TString; output_mode: Type.TOptional, Type.TLiteral<"raw">, Type.TLiteral<"both">]>>; }>; execute(_toolCallId: string, params: Static, _signal: AbortSignal | undefined, _onUpdate: ((update: AgentToolResult) => void) | undefined, extCtx: ExtensionContext): Promise>; }; export declare function createBashWatchTool(ctx: PluginContext): { name: string; label: string; description: string; promptSnippet: string; parameters: Type.TObject<{ task_id: Type.TString; pattern: Type.TOptional]>>; background: Type.TOptional; timeout_ms: Type.TOptional>; once: Type.TOptional; }>; execute(_toolCallId: string, params: Static, _signal: AbortSignal | undefined, _onUpdate: ((update: AgentToolResult) => void) | undefined, extCtx: ExtensionContext): Promise>; }; export declare function createBashWriteTool(ctx: PluginContext): { name: string; label: string; description: string; promptSnippet: string; parameters: Type.TObject<{ task_id: Type.TString; input: Type.TUnion<[Type.TString, Type.TArray]>>]>; }>; execute(_toolCallId: string, params: Static, _signal: AbortSignal | undefined, _onUpdate: ((update: AgentToolResult) => void) | undefined, extCtx: ExtensionContext): Promise>; }; export declare function createBashKillTool(ctx: PluginContext): { name: string; label: string; description: string; promptSnippet: string; parameters: Type.TObject<{ task_id: Type.TString; }>; execute(_toolCallId: string, params: Static, _signal: AbortSignal | undefined, _onUpdate: ((update: AgentToolResult) => void) | undefined, extCtx: ExtensionContext): Promise>; }; type BashWaitPattern = { kind: "substring"; value: string; } | { kind: "regex"; source: string; }; export declare function __parseWaitPatternForTests(value: unknown): BashWaitPattern | undefined; export declare function __trimWaitScanBufferForTests(text: string, baseOffset: number, pattern: BashWaitPattern): { text: string; baseOffset: number; }; export {}; //# sourceMappingURL=bash.d.ts.map