/** * Core execution logic shared by all AI framework adapters. * * This module extracts the framework-agnostic bash tool execution * from the original ai.ts and exposes it as ToolDefinition objects * that adapters can reshape into any format. */ import type { Bash } from "../Bash.js"; import type { ToolDefinition, ToolResult } from "./types.js"; /** * Options for creating a bash tool (shared across all adapters). */ export interface CreateBashToolOptions { /** * The Bash sandbox instance to use for execution. */ sandbox: Bash; /** * Extra instructions to append to the tool description. */ extraInstructions?: string; /** * Optional callback called before a bash command is executed. */ onBeforeBashCall?: (input: { command: string; }) => void | Promise; /** * Optional callback called after a bash command is executed. */ onAfterBashCall?: (input: { command: string; result: ToolResult; }) => void | Promise; } /** * Build the core tool definitions from a Bash sandbox. * * Returns an array of ToolDefinition objects that any adapter can * transform into a framework-specific shape. */ export declare function buildToolDefinitions(options: CreateBashToolOptions): ToolDefinition[];