mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 11:01:39 +03:00
feat: refresh CLI output styling and progress
This commit is contained in:
+18
-9
@@ -3,6 +3,7 @@ import fs from "node:fs/promises";
|
||||
import type { Command } from "commander";
|
||||
import { callGateway, randomIdempotencyKey } from "../gateway/call.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { withProgress } from "./progress.js";
|
||||
import { writeBase64ToFile } from "./nodes-camera.js";
|
||||
import {
|
||||
canvasSnapshotTempPath,
|
||||
@@ -80,15 +81,23 @@ const callGatewayCli = async (
|
||||
opts: CanvasOpts,
|
||||
params?: unknown,
|
||||
) =>
|
||||
callGateway({
|
||||
url: opts.url,
|
||||
token: opts.token,
|
||||
method,
|
||||
params,
|
||||
timeoutMs: Number(opts.timeout ?? 10_000),
|
||||
clientName: "cli",
|
||||
mode: "cli",
|
||||
});
|
||||
withProgress(
|
||||
{
|
||||
label: `Canvas ${method}`,
|
||||
indeterminate: true,
|
||||
enabled: opts.json !== true,
|
||||
},
|
||||
async () =>
|
||||
await callGateway({
|
||||
url: opts.url,
|
||||
token: opts.token,
|
||||
method,
|
||||
params,
|
||||
timeoutMs: Number(opts.timeout ?? 10_000),
|
||||
clientName: "cli",
|
||||
mode: "cli",
|
||||
}),
|
||||
);
|
||||
|
||||
function parseNodeList(value: unknown): NodeListNode[] {
|
||||
const obj =
|
||||
|
||||
Reference in New Issue
Block a user