/**
 * Custom tool bridge: generates a synthetic MCP stdio server that exposes
 * Managed Agents custom tools to claude inside the container.
 *
 * Architecture:
 *   - A pure-bash script that implements the MCP stdio protocol (JSON-RPC on
 *     stdin/stdout) — no Node.js dependency, instant startup (~10ms vs ~1.2s
 *     on Firecracker VMs)
 *   - Reads tool definitions from /tmp/tool-bridge/tools.json
 *   - On tool call: checks for pre-existing response.json (replay after
 *     --resume) and returns immediately. Otherwise writes request.json +
 *     creates pending sentinel, then polls for response.json (200ms interval,
 *     5-min timeout) and returns the result.
 *   - Handles both raw JSON lines (Claude Code v2.1.83+) and Content-Length
 *     framed JSON-RPC input; always responds with raw JSON lines.
 *
 * The driver polls for /tmp/tool-bridge/pending every 1s during the stream
 * loop. When found, it reads request.json, emits agent.custom_tool_use, and
 * waits for user.custom_tool_result to write response.json and remove the
 * pending sentinel.
 */
import type { CustomTool } from "../../types";
export declare const TOOL_BRIDGE_DIR = "/tmp/tool-bridge";
export declare const TOOL_BRIDGE_SCRIPT_PATH = "/tmp/tool-bridge/bridge.sh";
export declare const TOOL_BRIDGE_TOOLS_PATH = "/tmp/tool-bridge/tools.json";
export declare const TOOL_BRIDGE_REQUEST_PATH = "/tmp/tool-bridge/request.json";
export declare const TOOL_BRIDGE_RESPONSE_PATH = "/tmp/tool-bridge/response.json";
export declare const TOOL_BRIDGE_PENDING_PATH = "/tmp/tool-bridge/pending";
/**
 * Generate the MCP stdio server script as a string.
 * This script is written to the container and run by claude's --mcp-config.
 */
/**
 * Generate a pure-bash MCP stdio server. No Node.js — instant startup
 * (~10ms vs ~1.2s for Node on Firecracker VMs).
 *
 * Handles both raw JSON lines (Claude Code v2.1.83+) and Content-Length
 * framed JSON-RPC. Responds with raw JSON lines (no Content-Length
 * framing) — required by newer Claude Code versions.
 */
export declare function generateBridgeScript(): string;
/**
 * Build the --mcp-config JSON snippet that adds the tool bridge server
 * alongside any existing MCP servers.
 */
export declare function buildBridgeMcpConfig(existingServers: Record<string, unknown>): Record<string, unknown>;
/**
 * Convert CustomTool definitions to the tool bridge's tools.json format.
 */
export declare function toolsToJson(tools: CustomTool[]): string;
//# sourceMappingURL=tool-bridge.d.ts.map