import type { AgentTool } from "../types.js";
import type { HookRunner } from "./kit/hook-runner.js";
import { type SandboxConfig } from "./sandbox-backend.js";
import { type TruncationResult } from "./truncate.js";
export interface BashSecurityConfig {
    /** Patterns that, when matched, stop a command from running. */
    blockedPatterns?: RegExp[];
}
declare const bashSchema: import("@sinclair/typebox").TObject<{
    command: import("@sinclair/typebox").TString;
    timeout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
}>;
export interface BashToolDetails {
    truncation?: TruncationResult;
    fullOutputPath?: string;
}
/**
 * Pluggable execution backend for the bash tool. Provide a custom implementation
 * to dispatch commands somewhere other than the local shell, for instance to a
 * remote host over a transport layer.
 */
export interface BashOperations {
    /**
     * Execute a command, relaying its output back through a callback as it streams in.
     * @param command - The command line to execute
     * @param cwd - Working directory for the command
     * @param options - Streaming callback, cancellation signal, timeout, and env overrides
     * @returns A promise resolving to the exit code, or null if the process was terminated
     */
    exec: (command: string, cwd: string, options: {
        onData: (data: Buffer) => void;
        signal?: AbortSignal;
        timeout?: number;
        env?: NodeJS.ProcessEnv;
    }) => Promise<{
        exitCode: number | null;
    }>;
}
export interface BashToolOptions {
    /** Backend hook for running commands. When omitted, the local shell is used. */
    operations?: BashOperations;
    /** Text glued to the front of every command (e.g. "shopt -s expand_aliases" to enable aliases). */
    commandPrefix?: string;
    /** Dispatcher consulted for the shell.env hook so callers can inject env vars. */
    hookRunner?: HookRunner;
    /** Settings that decide which commands are allowed to run. */
    security?: BashSecurityConfig;
    /**
     * OPT-IN OS sandbox. OFF by default: when omitted or `enabled` is false the
     * bash tool spawns exactly as before. When enabled, each command is wrapped
     * in the platform's OS sandbox (macOS `sandbox-exec`, Linux `bwrap`); if no
     * sandbox tool is available the command runs un-sandboxed and a note is
     * recorded via `onSandboxNote` rather than silently claiming sandboxing.
     */
    sandbox?: SandboxConfig;
    /** Receives an honest note describing whether the sandbox was applied or skipped. */
    onSandboxNote?: (note: string) => void;
    /** Optional log that collects the commands as they are issued. */
    commandHistory?: string[];
    /** Time budget, in seconds, applied when the model omits `timeout`. Defaults to 120s. */
    defaultTimeoutSeconds?: number;
    /** Hard ceiling, in seconds, that any supplied `timeout` is clamped to. Defaults to 600s (and is never lower than the default). */
    maxTimeoutSeconds?: number;
}
export declare function createBashTool(cwd: string, options?: BashToolOptions): AgentTool<typeof bashSchema>;
/** Ready-made bash tool bound to the process working directory. */
export declare const bashTool: AgentTool<import("@sinclair/typebox").TObject<{
    command: import("@sinclair/typebox").TString;
    timeout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
}>, any>;
export {};
