55 lines
2.6 KiB
JavaScript
55 lines
2.6 KiB
JavaScript
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-DxJyvt4o.js";
|
|
import "./manifest-registry-tuAcHxrV.js";
|
|
import "./server-context-CM_E6wD5.js";
|
|
import "./errors-DdT2Dtkb.js";
|
|
import "./client-BYx0ZoAv.js";
|
|
import "./call-BDMBg5WA.js";
|
|
import "./message-channel-Csfn34Sf.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-XDcV8NF0.js";
|
|
import "./pi-embedded-helpers-wpP9rGyv.js";
|
|
import "./sandbox-DO8gYgPg.js";
|
|
import "./channel-summary-CgnCeeeN.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-Bg1fpDyw.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 }; |