import { n as GatewayClientName$1, t as GatewayClientMode$1 } from "./client-info-D906D0qn.js"; import { N as GatewayAuthConfig, i as OpenClawConfig, nt as GatewayTailscaleConfig, ot as GatewayTrustedProxyConfig, rt as GatewayTailscaleMode } from "./types.openclaw-Dkap9jPv.js"; import { a as EventFrame, n as errorShape, t as ErrorCodes } from "./schema-D8ecK-5e.js"; import { a as DeviceIdentity$1, n as GatewayClientOptions$1, t as GatewayClient } from "./client-BWFNfa3t.js"; import { t as OperatorScope } from "./operator-scopes-ijAvkvEk.js"; import { c as DEFAULT_PLUGIN_NODE_CAPABILITY_TTL_MS, d as PluginNodeCapabilitySurface, f as buildPluginNodeCapabilityScopedHostUrl, i as GatewayRequestHandlers, l as NormalizedPluginNodeCapabilityUrl, m as normalizePluginNodeCapabilityScopedUrl, o as RespondFn, p as mintPluginNodeCapabilityToken, r as GatewayRequestHandlerOptions, s as NodeSession, u as PLUGIN_NODE_CAPABILITY_PATH_PREFIX } from "./types-CllBlUKV.js"; import { t as isLoopbackHost } from "./net-F7HGAsK5.js"; import { t as rawDataToString } from "./ws-DPQUGEy8.js"; import { EventFrame as EventFrame$1, HelloOk } from "@openclaw/gateway-protocol"; import { GatewayClientMode, GatewayClientName } from "@openclaw/gateway-protocol/client-info"; import { Command } from "commander"; //#region src/gateway/channel-status-patches.d.ts type ConnectedChannelStatusPatch = { connected: true; lastConnectedAt: number; lastEventAt: number; }; type TransportActivityChannelStatusPatch = { lastTransportActivityAt: number; }; declare function createConnectedChannelStatusPatch(at?: number): ConnectedChannelStatusPatch; declare function createTransportActivityStatusPatch(at?: number): TransportActivityChannelStatusPatch; //#endregion //#region src/cli/gateway-rpc.types.d.ts 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$1; mode?: GatewayClientMode$1; deviceIdentity?: DeviceIdentity$1 | null; expectFinal?: boolean; progress?: boolean; scopes?: OperatorScope[]; }): Promise>; //#endregion //#region src/gateway/hosted-plugin-surface-url.d.ts type HostSource = string | null | undefined; type HostedPluginSurfaceUrlParams = { port?: number; hostOverride?: HostSource; forwardedHost?: HostSource | HostSource[]; requestHost?: HostSource; forwardedProto?: HostSource | HostSource[]; localAddress?: HostSource; scheme?: "http" | "https"; }; 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 type NodeMatchCandidate = { nodeId: string; displayName?: string; remoteIp?: string; connected?: boolean; clientId?: string; }; //#endregion //#region src/shared/node-resolve.d.ts type ResolveNodeFromListOptions = { allowDefault?: boolean; pickDefaultNode?: (nodes: TNode[]) => TNode | null; }; declare function resolveNodeIdFromNodeList(nodes: TNode[], query?: string, options?: ResolveNodeFromListOptions): string; declare function resolveNodeFromNodeList(nodes: TNode[], query?: string, options?: ResolveNodeFromListOptions): TNode; //#endregion //#region src/gateway/server-json.d.ts declare function safeParseJson(value: string | null | undefined): unknown; //#endregion //#region src/gateway/server-methods/nodes.helpers.d.ts declare function respondUnavailableOnNodeInvokeError(respond: RespondFn, res: T): res is T & { ok: true; }; //#endregion //#region src/gateway/auth-resolve.d.ts type ResolvedGatewayAuthMode = "none" | "token" | "password" | "trusted-proxy"; type ResolvedGatewayAuthModeSource = "override" | "config" | "password" | "token" | "default"; type ResolvedGatewayAuth = { mode: ResolvedGatewayAuthMode; modeSource?: ResolvedGatewayAuthModeSource; token?: string; password?: string; allowTailscale: boolean; trustedProxy?: GatewayTrustedProxyConfig; }; declare function resolveGatewayAuth(params: { authConfig?: GatewayAuthConfig | null; authOverride?: GatewayAuthConfig | null; env?: NodeJS.ProcessEnv; tailscaleMode?: GatewayTailscaleMode; }): ResolvedGatewayAuth; //#endregion //#region src/gateway/startup-auth.d.ts declare function ensureGatewayStartupAuth(params: { cfg: OpenClawConfig; env?: NodeJS.ProcessEnv; authOverride?: GatewayAuthConfig; tailscaleOverride?: GatewayTailscaleConfig; /** * 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 packages/gateway-client/src/client.d.ts type DeviceIdentity = { deviceId: string; privateKeyPem: string; publicKeyPem: string; }; type DeviceAuthTokenRecord = { token?: string; scopes?: string[]; }; type GatewayClientHostDeps = { loadOrCreateDeviceIdentity?: () => DeviceIdentity | undefined; signDevicePayload?: (privateKeyPem: string, payload: string) => string; publicKeyRawBase64UrlFromPem?: (publicKeyPem: string) => string; loadDeviceAuthToken?: (params: { deviceId: string; role: string; env?: NodeJS.ProcessEnv; }) => DeviceAuthTokenRecord | null; storeDeviceAuthToken?: (params: { deviceId: string; role: string; token: string; scopes: string[]; env?: NodeJS.ProcessEnv; }) => void; clearDeviceAuthToken?: (params: { deviceId: string; role: string; env?: NodeJS.ProcessEnv; }) => void; beforeConnect?: () => void; registerGatewayLoopbackBypass?: (url: string) => (() => void) | undefined; logDebug?: (message: string) => void; logError?: (message: string) => void; redactForLog?: (message: string) => string; normalizeTlsFingerprint?: (fingerprint: string | undefined) => string; }; type GatewayReconnectPausedInfo = { code: number; reason: string; detailCode: string | null; }; type GatewayClientOptions = { url?: string; connectChallengeTimeoutMs?: number; /** @deprecated Use connectChallengeTimeoutMs. */ connectDelayMs?: number; /** * Server-side pre-auth handshake budget. Config-derived local clients use * this to keep the connect-challenge watchdog aligned with the gateway. */ preauthHandshakeTimeoutMs?: number; tickWatchMinIntervalMs?: number; tickWatchTimeoutMs?: number; requestTimeoutMs?: number; token?: string; bootstrapToken?: string; deviceToken?: string; password?: string; approvalRuntimeToken?: string; instanceId?: string; clientName?: GatewayClientName; clientDisplayName?: string; clientVersion?: string; platform?: string; deviceFamily?: string; mode?: GatewayClientMode; role?: string; scopes?: string[]; caps?: string[]; commands?: string[]; permissions?: Record; pathEnv?: string; env?: NodeJS.ProcessEnv; deviceIdentity?: DeviceIdentity | null; hostDeps?: GatewayClientHostDeps; minProtocol?: number; maxProtocol?: number; tlsFingerprint?: string; onEvent?: (evt: EventFrame$1) => void; onHelloOk?: (hello: HelloOk) => void; onConnectError?: (err: Error) => void; onReconnectPaused?: (info: GatewayReconnectPausedInfo) => void; onClose?: (code: number, reason: string) => void; onGap?: (info: { expected: number; received: number; }) => void; }; //#endregion //#region packages/gateway-client/src/event-loop-ready.d.ts type EventLoopReadyResult = { ready: boolean; elapsedMs: number; maxDriftMs: number; checks: number; aborted: boolean; }; //#endregion //#region packages/gateway-client/src/readiness.d.ts type GatewayClientStartable = { start(): void; }; type GatewayClientStartReadinessOptions = { timeoutMs?: number; clientOptions?: Pick; signal?: AbortSignal; }; //#endregion //#region src/gateway/client-start-readiness.d.ts declare function startGatewayClientWhenEventLoopReady(client: GatewayClientStartable, options?: GatewayClientStartReadinessOptions): Promise; //#endregion //#region src/gateway/operator-approvals-client.d.ts declare function createOperatorApprovalsGatewayClient(params: Pick & { config: OpenClawConfig; gatewayUrl?: string; }): Promise; declare function withOperatorApprovalsGatewayClient(params: { config: OpenClawConfig; gatewayUrl?: string; clientDisplayName: string; }, run: (client: GatewayClient) => Promise): 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, resolveGatewayAuth, resolveHostedPluginSurfaceUrl, resolveNodeCommandAllowlist, resolveNodeFromNodeList, resolveNodeIdFromNodeList, respondUnavailableOnNodeInvokeError, safeParseJson, startGatewayClientWhenEventLoopReady, withOperatorApprovalsGatewayClient };