This repository has been archived on 2026-03-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-extensions/wecom/node_modules/openclaw/dist/gateway-rpc-C4HiuJkJ.js
T

28 lines
1.1 KiB
JavaScript

import { h as GATEWAY_CLIENT_NAMES, m as GATEWAY_CLIENT_MODES } from "./message-channel-BD3kuDks.js";
import { n as callGateway } from "./call-BxBOsbXG.js";
import { n as withProgress } from "./progress-uNDQDtGB.js";
//#region src/cli/gateway-rpc.ts
function addGatewayClientOptions(cmd) {
return cmd.option("--url <url>", "Gateway WebSocket URL (defaults to gateway.remote.url when configured)").option("--token <token>", "Gateway token (if required)").option("--timeout <ms>", "Timeout in ms", "30000").option("--expect-final", "Wait for final response (agent)", false);
}
async function callGatewayFromCli(method, opts, params, extra) {
const showProgress = extra?.progress ?? opts.json !== true;
return await withProgress({
label: `Gateway ${method}`,
indeterminate: true,
enabled: showProgress
}, async () => await callGateway({
url: opts.url,
token: opts.token,
method,
params,
expectFinal: extra?.expectFinal ?? Boolean(opts.expectFinal),
timeoutMs: Number(opts.timeout ?? 1e4),
clientName: GATEWAY_CLIENT_NAMES.CLI,
mode: GATEWAY_CLIENT_MODES.CLI
}));
}
//#endregion
export { callGatewayFromCli as n, addGatewayClientOptions as t };