/**
 * Remote Tool Executor — delegates tool execution to remote nodes.
 *
 * When a session's project is bound to a remote node (i.e. the
 * project 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 project lives.
 *
 * ── Which tools run remotely? ─────────────────────────────────────────
 * Only tools that genuinely operate on the project's filesystem are
 * proxied to the remote node — i.e. terminal execution, file I/O, and
 * project search. These tools *must* run on the same machine as the
 * project, otherwise they'd touch the gateway's disk instead.
 *
 * Everything else (memory, cron, surfaces, web, agent, todo, jait
 * meta-tool, gateway.status, etc.) is gateway-local by nature and is
 * always executed on the gateway regardless of where the project lives.
 *
 * This is an *allow-list* (not a deny-list) so that every new tool that
 * gets added to the registry defaults to running on the gateway — the only
 * way a tool becomes remotely executable is to be explicitly listed here
 * AND implemented by every remote node handler (primary-link.ts and the
 * Electron desktop main process).
 */
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 project is local to the gateway or no matching
 * remote node is connected.
 */
export declare function resolveRemoteNodeForSession(ws: WsControlPlane, projectPath: string | undefined): string | null;
/**
 * Create a tool executor that transparently delegates to a remote node
 * when the session's project 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