import { n as GatewayClientName, t as GatewayClientMode } from "./client-info-CgGSgtDZ.js"; import { R as GatewayAuthConfig, ct as GatewayTailscaleMode, ft as GatewayTrustedProxyConfig, i as OpenClawConfig, st as GatewayTailscaleConfig } from "./types.openclaw-DH5a2ppk.js"; import { t as OperatorScope } from "./operator-scopes-Phea7r7e.js"; import { Br as PluginNodeCapabilitySurface, Fr as RespondFn, Hr as mintPluginNodeCapabilityToken, Ir as NodeSession, Lr as DEFAULT_PLUGIN_NODE_CAPABILITY_TTL_MS, Mr as GatewayRequestHandlerOptions, Nr as GatewayRequestHandlers, Rr as NormalizedPluginNodeCapabilityUrl, Ur as normalizePluginNodeCapabilityScopedUrl, Vr as buildPluginNodeCapabilityScopedHostUrl, zr as PLUGIN_NODE_CAPABILITY_PATH_PREFIX } from "./types-DIBfaBvi.js"; import { F as errorShape, P as ErrorCodes, R as EventFrame } from "./internal-hooks-DYYCvcTJ.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-BpLiT-eK.js"; import { t as isLoopbackHost } from "./net-F7HGAsK5.js"; import { t as rawDataToString } from "./ws-B-FBaFGI.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/auth-resolve.d.ts /** Authentication modes after config, override, and credential inputs are combined. */ type ResolvedGatewayAuthMode = "none" | "token" | "password" | "trusted-proxy"; /** Records which input selected the effective Gateway auth mode. */ type ResolvedGatewayAuthModeSource = "override" | "config" | "password" | "token" | "default"; /** Fully resolved Gateway auth policy before startup validates required secrets. */ type ResolvedGatewayAuth = { mode: ResolvedGatewayAuthMode; modeSource?: ResolvedGatewayAuthModeSource; token?: string; password?: string; allowTailscale: boolean; trustedProxy?: GatewayTrustedProxyConfig; }; /** Resolve Gateway auth mode, credentials, trusted-proxy policy, and Tailscale allowance. */ declare function resolveGatewayAuth(params: { authConfig?: GatewayAuthConfig | null; authOverride?: GatewayAuthConfig | null; env?: NodeJS.ProcessEnv; tailscaleMode?: GatewayTailscaleMode; }): ResolvedGatewayAuth; //#endregion //#region src/gateway/startup-auth.d.ts /** Ensure startup has effective Gateway auth, generating only an ephemeral token if needed. */ declare function ensureGatewayStartupAuth(params: { cfg: OpenClawConfig; env?: NodeJS.ProcessEnv; authOverride?: GatewayAuthConfig; tailscaleOverride?: GatewayTailscaleConfig; warn?: (message: string) => void; /** * Legacy startup option retained for external callers. Startup-generated auth * is runtime-only; durable auth changes must go through explicit config tools. */ persist?: boolean; baseHash?: string; }): Promise<{ cfg: OpenClawConfig; auth: ReturnType; generatedToken?: string; persistedGeneratedToken: boolean; }>; //#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, DEFAULT_PLUGIN_NODE_CAPABILITY_TTL_MS, ErrorCodes, type EventFrame, GatewayClient, type GatewayRequestHandlerOptions, type GatewayRequestHandlers, type GatewayRpcOpts, type HostedPluginSurfaceUrlParams, type NodeMatchCandidate, type NodeSession, type NormalizedPluginNodeCapabilityUrl, PLUGIN_NODE_CAPABILITY_PATH_PREFIX, type PluginNodeCapabilitySurface, TransportActivityChannelStatusPatch, addGatewayClientOptions, buildPluginNodeCapabilityScopedHostUrl, callGatewayFromCli, createConnectedChannelStatusPatch, createOperatorApprovalsGatewayClient, createTransportActivityStatusPatch, ensureGatewayStartupAuth, errorShape, isLoopbackHost, isNodeCommandAllowed, mintPluginNodeCapabilityToken, normalizePluginNodeCapabilityScopedUrl, rawDataToString, resolveAdvertisedLanHost, resolveGatewayAuth, resolveHostedPluginSurfaceUrl, resolveNodeCommandAllowlist, resolveNodeFromNodeList, resolveNodeIdFromNodeList, respondUnavailableOnNodeInvokeError, safeParseJson, startGatewayClientWhenEventLoopReady, withOperatorApprovalsGatewayClient };