UNPKG

@gguf/claw

Version:

WhatsApp gateway CLI (Baileys web) with Pi RPC agent

54 lines (52 loc) 2.68 kB
import { k as theme, p as defaultRuntime } from "./entry.js"; import "./auth-profiles-CfFGCDJa.js"; import "./agent-scope-jm0ZdXwM.js"; import "./utils-PmTbZoD1.js"; import "./exec-BIMFe4XS.js"; import "./github-copilot-token-rP-6QdKv.js"; import "./config-DCT1RAo6.js"; import "./manifest-registry-tuAcHxrV.js"; import "./server-context-CM_E6wD5.js"; import "./errors-DdT2Dtkb.js"; import "./client-cU7Xg1MO.js"; import "./message-channel-CAFcg7mw.js"; import { t as formatDocsLink } from "./links-jGisPfXW.js"; import "./plugins-TrKFfrLt.js"; import "./logging-fywhKCmE.js"; import "./accounts-B5QZU96b.js"; import "./paths-RvF0P6tQ.js"; import "./routes-yI5QIzeL.js"; import "./pi-embedded-helpers-DJgCXZEz.js"; import "./sandbox-Cnq9TXEn.js"; import "./channel-summary-BkqO8zZ9.js"; import "./skills-DtwGIkTI.js"; import "./redact-CDPAzwi8.js"; import "./tool-display-BMYWrp0L.js"; import { t as parseTimeoutMs } from "./parse-timeout-BIB19Upi.js"; import { t as runTui } from "./tui-DBmFYQTk.js"; //#region src/cli/tui-cli.ts function registerTuiCli(program) { program.command("tui").description("Open a terminal UI connected to the Gateway").option("--url <url>", "Gateway WebSocket URL (defaults to gateway.remote.url when configured)").option("--token <token>", "Gateway token (if required)").option("--password <password>", "Gateway password (if required)").option("--session <key>", "Session key (default: \"main\", or \"global\" when scope is global)").option("--deliver", "Deliver assistant replies", false).option("--thinking <level>", "Thinking level override").option("--message <text>", "Send an initial message after connecting").option("--timeout-ms <ms>", "Agent timeout in ms (defaults to agents.defaults.timeoutSeconds)").option("--history-limit <n>", "History entries to load", "200").addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/cli/tui", "docs.openclaw.ai/cli/tui")}\n`).action(async (opts) => { try { const timeoutMs = parseTimeoutMs(opts.timeoutMs); if (opts.timeoutMs !== void 0 && timeoutMs === void 0) defaultRuntime.error(`warning: invalid --timeout-ms "${String(opts.timeoutMs)}"; ignoring`); const historyLimit = Number.parseInt(String(opts.historyLimit ?? "200"), 10); await runTui({ url: opts.url, token: opts.token, password: opts.password, session: opts.session, deliver: Boolean(opts.deliver), thinking: opts.thinking, message: opts.message, timeoutMs, historyLimit: Number.isNaN(historyLimit) ? void 0 : historyLimit }); } catch (err) { defaultRuntime.error(String(err)); defaultRuntime.exit(1); } }); } //#endregion export { registerTuiCli };