/**
 * Remote Tool Executor — delegates tool execution to remote nodes.
 *
 * When a session's workspace is bound to a remote node (i.e. the
 * workspace path doesn't exist on the gateway), tool calls are proxied
 * to the remote node via the `tool.op-request` / `tool.op-response`
 * WS protocol instead of executing locally on the gateway.
 *
 * This solves the fundamental problem where CLI providers (Codex, Claude)
 * and built-in tools (terminal.run, file.write, etc.) need to operate
 * on the same machine where the workspace lives.
 *
 * Tools that are gateway-local by nature (e.g. surfaces.list, cron.*,
 * gateway.status) are always executed locally regardless of the workspace
 * binding.
 */
import type { ToolResult, ToolContext } from "./contracts.js";
import type { WsControlPlane } from "../ws.js";
export interface RemoteToolExecutorOptions {
    ws: WsControlPlane;
    /** Local executor — called when the tool should run on the gateway */
    localExecutor: (toolName: string, input: unknown, context: ToolContext, options?: {
        dryRun?: boolean;
        consentTimeoutMs?: number;
    }) => Promise<ToolResult>;
}
/**
 * Resolve which node ID (if any) should execute tools for a given session.
 *
 * Returns `null` if the workspace is local to the gateway or no matching
 * remote node is connected.
 */
export declare function resolveRemoteNodeForSession(ws: WsControlPlane, workspacePath: string | undefined): string | null;
/**
 * Create a tool executor that transparently delegates to a remote node
 * when the session's workspace is on that node.
 *
 * If `remoteNodeId` is null, all calls go to the local executor.
 */
export declare function createRemoteToolExecutor(options: RemoteToolExecutorOptions, remoteNodeId: string | null): (toolName: string, input: unknown, context: ToolContext, execOptions?: {
    dryRun?: boolean;
    consentTimeoutMs?: number;
}) => Promise<ToolResult>;
//# sourceMappingURL=remote-executor.d.ts.map