import { i as OpenClawConfig } from "./types.openclaw-CXjMEWAQ.js"; import { n as GatewayClientName, t as GatewayClientMode } from "./client-info-CgGSgtDZ.js"; import { t as OperatorScope } from "./operator-scopes-Phea7r7e.js"; import { Fr as RespondFn, Ir as NodeSession } from "./types-DaHgOqFX.js"; import { t as DeviceIdentity } from "./device-identity-CcgLHrOC.js"; import { a as GatewayClientOptions, i as EventLoopReadyResult, n as GatewayClientStartReadinessOptions, r as GatewayClientStartable, t as GatewayClient } from "./client-Q5mtaEhi.js"; import { Command } from "commander"; //#region src/gateway/channel-status-patches.d.ts /** Patch emitted when a channel connection is established. */ type ConnectedChannelStatusPatch = { connected: true; lastConnectedAt: number; lastEventAt: number; }; /** Patch emitted when a channel transport reports activity without reconnecting. */ type TransportActivityChannelStatusPatch = { lastTransportActivityAt: number; }; /** Creates a connected-channel status patch with matching connection/event timestamps. */ declare function createConnectedChannelStatusPatch(at?: number): ConnectedChannelStatusPatch; /** Creates a transport-activity patch for health/activity monitors. */ declare function createTransportActivityStatusPatch(at?: number): TransportActivityChannelStatusPatch; //#endregion //#region src/cli/gateway-rpc.types.d.ts /** Common gateway RPC flags accepted by direct gateway command helpers. */ type GatewayRpcOpts = { url?: string; token?: string; timeout?: string; expectFinal?: boolean; json?: boolean; }; //#endregion //#region src/cli/gateway-rpc.d.ts declare function addGatewayClientOptions(cmd: Command): Command; declare function callGatewayFromCli(method: string, opts: GatewayRpcOpts, params?: unknown, extra?: { clientName?: GatewayClientName; mode?: GatewayClientMode; deviceIdentity?: DeviceIdentity | null; signal?: AbortSignal; expectFinal?: boolean; progress?: boolean; scopes?: OperatorScope[]; }): Promise>; //#endregion //#region src/gateway/hosted-plugin-surface-url.d.ts type HostSource = string | null | undefined; /** Inputs used to infer the externally reachable plugin surface URL. */ type HostedPluginSurfaceUrlParams = { port?: number; hostOverride?: HostSource; forwardedHost?: HostSource | HostSource[]; requestHost?: HostSource; forwardedProto?: HostSource | HostSource[]; localAddress?: HostSource; scheme?: "http" | "https"; }; /** Resolve the URL that plugins should advertise for hosted node surfaces. */ declare function resolveHostedPluginSurfaceUrl(params: HostedPluginSurfaceUrlParams): string | undefined; //#endregion //#region src/gateway/node-command-policy.d.ts type NodeCommandPolicyNode = Pick & Partial> & { approvedCommands?: readonly string[]; }; declare function resolveNodeCommandAllowlist(cfg: OpenClawConfig, node?: NodeCommandPolicyNode): Set; declare function isNodeCommandAllowed(params: { command: string; declaredCommands?: string[]; allowlist: Set; }): { ok: true; } | { ok: false; reason: string; }; //#endregion //#region src/shared/node-match.d.ts /** * Shared node-selection policy for CLI, gateway-facing SDK helpers, and plugins. * * Exact ids, remote IPs, normalized display names, and long id prefixes are the * only accepted query shapes; fuzzy ordering lives here so callers agree. */ /** Node fields accepted by shared CLI/API node selection helpers. */ type NodeMatchCandidate = { /** Stable node id used for RPC/session routing. */nodeId: string; /** Human-facing node name used for fuzzy operator input. */ displayName?: string; /** Tailscale or network address accepted as an exact match. */ remoteIp?: string; /** Connected nodes win only after the strongest match type is chosen. */ connected?: boolean; /** Client id used to prefer current OpenClaw nodes over legacy migration ties. */ clientId?: string; }; //#endregion //#region src/shared/node-resolve.d.ts type ResolveNodeFromListOptions = { allowDefault?: boolean; pickDefaultNode?: (nodes: TNode[]) => TNode | null; }; /** Resolves a user query to a node id, optionally using a caller-defined blank-query default. */ declare function resolveNodeIdFromNodeList(nodes: TNode[], query?: string, options?: ResolveNodeFromListOptions): string; /** Resolves a full node entry, preserving synthetic defaults returned by the picker. */ declare function resolveNodeFromNodeList(nodes: TNode[], query?: string, options?: ResolveNodeFromListOptions): TNode; //#endregion //#region src/gateway/server-json.d.ts /** Safely parses an optional JSON string, returning a payloadJSON wrapper on parse failure. */ declare function safeParseJson(value: string | null | undefined): unknown; //#endregion //#region src/gateway/server-methods/nodes.helpers.d.ts /** Narrows successful node invoke results or responds with the node error details. */ declare function respondUnavailableOnNodeInvokeError(respond: RespondFn, res: T): res is T & { ok: true; }; //#endregion //#region src/gateway/client-start-readiness.d.ts /** Starts a gateway client once the shared event-loop readiness check passes. */ declare function startGatewayClientWhenEventLoopReady(client: GatewayClientStartable, options?: GatewayClientStartReadinessOptions): Promise; //#endregion //#region src/gateway/operator-approvals-client.d.ts /** Create a Gateway client authorized for operator approval event handling. */ declare function createOperatorApprovalsGatewayClient(params: Pick & { config: OpenClawConfig; gatewayUrl?: string; }): Promise; /** Run a callback with a started operator-approvals Gateway client and close it after. */ declare function withOperatorApprovalsGatewayClient(params: { config: OpenClawConfig; gatewayUrl?: string; clientDisplayName: string; }, run: (client: GatewayClient) => Promise): Promise; //#endregion //#region src/plugin-sdk/gateway-runtime.d.ts declare function resolveAdvertisedLanHost(): Promise; //#endregion export { ConnectedChannelStatusPatch as _, respondUnavailableOnNodeInvokeError as a, createTransportActivityStatusPatch as b, resolveNodeIdFromNodeList as c, resolveNodeCommandAllowlist as d, HostedPluginSurfaceUrlParams as f, GatewayRpcOpts as g, callGatewayFromCli as h, startGatewayClientWhenEventLoopReady as i, NodeMatchCandidate as l, addGatewayClientOptions as m, createOperatorApprovalsGatewayClient as n, safeParseJson as o, resolveHostedPluginSurfaceUrl as p, withOperatorApprovalsGatewayClient as r, resolveNodeFromNodeList as s, resolveAdvertisedLanHost as t, isNodeCommandAllowed as u, TransportActivityChannelStatusPatch as v, createConnectedChannelStatusPatch as y };