import type { AgentTool } from "@apholdings/jensen-agent-core"; import { type Static } from "@sinclair/typebox"; import type { BashEvidence } from "../bash-executor.js"; import { type TruncationResult } from "./truncate.js"; declare const bashSchema: import("@sinclair/typebox").TObject<{ command: import("@sinclair/typebox").TString; timeout: import("@sinclair/typebox").TOptional; }>; export type BashToolInput = Static; /** * Public details for the bash tool shown in the TUI and event stream. * * All fields added after 1.1.6 are optional in the public type for backward * compatibility with consumers that construct mocks, adapters, or fixtures * using the 1.1.6 shape. The runtime always produces every field. */ export interface BashToolDetails { truncation?: TruncationResult; fullOutputPath?: string; cancelled?: boolean; command?: string; cwd?: string; stdout?: string; stderr?: string; exitCode?: number | undefined; startedAt?: string; finishedAt?: string; timedOut?: boolean; truncated?: boolean; spawnError?: string; evidence?: BashEvidence; } /** * Internal resolved details type. Every runtime-produced BashToolDetails * satisfies this contract. Internal consumers use this type so they can * rely on fields being present without optional chaining. */ export interface ResolvedBashToolDetails extends BashToolDetails { command: string; cwd: string; stdout: string; stderr: string; exitCode: number | undefined; startedAt: string; finishedAt: string; timedOut: boolean; cancelled: boolean; truncated: boolean; } export interface BashOperations { /** * Execute a command and stream output. * @param command - The command to execute * @param cwd - Working directory * @param options - Execution options * @returns Promise resolving to exit code (null if killed) and optional pipeline data */ exec: (command: string, cwd: string, options: { /** Combined stdout + stderr stream (legacy, always called) */ onData: (data: Buffer) => void; /** Separate stdout stream (optional, called alongside onData) */ onStdout?: (data: Buffer) => void; /** Separate stderr stream (optional, called alongside onData) */ onStderr?: (data: Buffer) => void; signal?: AbortSignal; timeout?: number; env?: NodeJS.ProcessEnv; }) => Promise<{ exitCode: number | null; }>; } export declare function createLocalBashOperations(): BashOperations; export interface BashSpawnContext { command: string; cwd: string; env: NodeJS.ProcessEnv; } export type BashSpawnHook = (context: BashSpawnContext) => BashSpawnContext; export interface BashToolOptions { /** Custom operations for command execution. Default: local shell */ operations?: BashOperations; /** Command prefix prepended to every command (e.g., "shopt -s expand_aliases" for alias support) */ commandPrefix?: string; /** Hook to adjust command, cwd, or env before execution */ spawnHook?: BashSpawnHook; } export declare function createBashTool(cwd: string, options?: BashToolOptions): AgentTool; /** Default bash tool using process.cwd() - for backwards compatibility */ export declare const bashTool: AgentTool; }>, any>; export {}; //# sourceMappingURL=bash.d.ts.map