import { DynamicStructuredTool } from '@langchain/core/tools'; import type * as t from '@/types'; import { Constants } from '@/common'; export declare const BashProgrammaticToolCallingSchema: { readonly type: "object"; readonly properties: { readonly code: { readonly type: "string"; readonly minLength: 1; readonly description: "Bash code that calls tools programmatically. Tools are available as bash functions.\n\nCRITICAL - STATELESS EXECUTION:\nEach call is a fresh bash shell. Variables and state do NOT persist between calls.\nYou MUST complete your entire workflow in ONE code block.\nDO NOT split work across multiple calls expecting to reuse variables.\n\nEach tool function accepts a JSON string as its argument.\nExample: tool_name '{\"key\": \"value\"}'\n\nExample (Complete workflow in one call):\n # Query data and process\n data=$(query_database '{\"sql\": \"SELECT * FROM users\"}')\n echo \"$data\" | jq '.[] | .name'\n\nExample (Parallel calls):\n web_search '{\"query\": \"SF weather\"}' > /tmp/sf.txt &\n web_search '{\"query\": \"NY weather\"}' > /tmp/ny.txt &\n wait\n echo \"SF: $(cat /tmp/sf.txt)\"\n echo \"NY: $(cat /tmp/ny.txt)\"\n\nRules:\n- EVERYTHING in one call—no state persists between executions\n- Tools are pre-defined as bash functions—DO NOT redefine them\n- Each tool function accepts a JSON string argument\n- Only echo/printf output returns to the model\n- Generated files are automatically available in /mnt/data/ for subsequent executions"; }; readonly timeout: { readonly type: "integer"; readonly minimum: 1000; readonly maximum: 300000; readonly default: 60000; readonly description: "Maximum execution time in milliseconds. Default: 60 seconds. Max: 5 minutes."; }; }; readonly required: readonly ["code"]; }; export declare const BashProgrammaticToolCallingName = Constants.BASH_PROGRAMMATIC_TOOL_CALLING; export declare const BashProgrammaticToolCallingDescription: string; export declare const BashProgrammaticToolCallingDefinition: { readonly name: Constants.BASH_PROGRAMMATIC_TOOL_CALLING; readonly description: string; readonly schema: { readonly type: "object"; readonly properties: { readonly code: { readonly type: "string"; readonly minLength: 1; readonly description: "Bash code that calls tools programmatically. Tools are available as bash functions.\n\nCRITICAL - STATELESS EXECUTION:\nEach call is a fresh bash shell. Variables and state do NOT persist between calls.\nYou MUST complete your entire workflow in ONE code block.\nDO NOT split work across multiple calls expecting to reuse variables.\n\nEach tool function accepts a JSON string as its argument.\nExample: tool_name '{\"key\": \"value\"}'\n\nExample (Complete workflow in one call):\n # Query data and process\n data=$(query_database '{\"sql\": \"SELECT * FROM users\"}')\n echo \"$data\" | jq '.[] | .name'\n\nExample (Parallel calls):\n web_search '{\"query\": \"SF weather\"}' > /tmp/sf.txt &\n web_search '{\"query\": \"NY weather\"}' > /tmp/ny.txt &\n wait\n echo \"SF: $(cat /tmp/sf.txt)\"\n echo \"NY: $(cat /tmp/ny.txt)\"\n\nRules:\n- EVERYTHING in one call—no state persists between executions\n- Tools are pre-defined as bash functions—DO NOT redefine them\n- Each tool function accepts a JSON string argument\n- Only echo/printf output returns to the model\n- Generated files are automatically available in /mnt/data/ for subsequent executions"; }; readonly timeout: { readonly type: "integer"; readonly minimum: 1000; readonly maximum: 300000; readonly default: 60000; readonly description: "Maximum execution time in milliseconds. Default: 60 seconds. Max: 5 minutes."; }; }; readonly required: readonly ["code"]; }; }; /** * Normalizes a tool name to a valid bash function identifier. * 1. Replace hyphens, spaces, dots with underscores * 2. Remove any other invalid characters * 3. Prefix with underscore if starts with number * 4. Append `_tool` if it's a bash reserved word */ export declare function normalizeToBashIdentifier(name: string): string; /** * Extracts tool names that are actually called in the bash code. * Bash functions are invoked as commands (no parentheses), so we match * the normalized name as a word boundary. */ export declare function extractUsedBashToolNames(code: string, toolNameMap: Map): Set; /** * Filters tool definitions to only include tools actually used in the bash code. */ export declare function filterBashToolsByUsage(toolDefs: t.LCTool[], code: string, debug?: boolean): t.LCTool[]; /** * Creates a Bash Programmatic Tool Calling tool for multi-tool orchestration. * * This tool enables AI agents to write bash scripts that orchestrate multiple * tool calls programmatically via the remote Code API, reducing LLM round-trips. * * The tool map must be provided at runtime via config.toolCall (injected by ToolNode). */ export declare function createBashProgrammaticToolCallingTool(initParams?: t.BashProgrammaticToolCallingParams): DynamicStructuredTool;