/** Advertised as `excomGate` in runner:hello (server EXCOM_GATE_VERSION). */ export declare const EXCOM_GATE_VERSION = 1; /** Advertised as `excomAllTools` in runner:hello: the host takes an EXCOM * executive's offered tools as its searchable set (MEL_ASSISTANT_ALLOWED_TOOLS). */ export declare const EXCOM_ALL_TOOLS_VERSION = 1; /** MEL_ASSISTANT_ALLOWED_TOOLS for a start payload: the offered tool names, * comma-joined, deduplicated; anything that is not a tool name (a comma, a * space, a newline) is dropped so it cannot change the list's shape. */ export declare function allowedToolsEnv(tools: unknown): string; /** Below the host's own wait (MEL_EXCOM_GATE_TIMEOUT_S, 30 s), so the host gets an explicit deny. */ export declare const EXCOM_GATE_ACK_MS = 25000; export interface GateSocketLike { connected?: boolean; emit(event: string, payload: unknown, ack?: (reply: unknown) => void): unknown; } export interface GateRelayCtx { sessionId: string; socket: GateSocketLike; /** Writes one line to the host's stdin. */ write: (line: string) => void; timeoutMs?: number; } export type GateDecision = "allow" | "deny" | "ask"; export interface GateReplyFrame { kind: "excom_gate_reply"; gateId: string; decision: GateDecision; message?: string; requestId?: string; cached?: string; report?: "meta" | "content"; isWrite?: boolean; } /** The reply the host gets: only known fields, any doubt is a deny. */ export declare function sanitizeGateReply(gateId: string, raw: unknown): GateReplyFrame; /** One `excom_gate` frame from the host: ask the server, answer the host once. */ export declare function relayExcomGate(frame: Record, ctx: GateRelayCtx): Promise; /** One `excom_gate_result` frame from the host: metadata to the server (best-effort). */ export declare function relayExcomGateResult(frame: Record, ctx: Pick): boolean;