@vm0/cli 3.8.1 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +29 -20
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -12954,7 +12954,8 @@ var EventRenderer = class {
|
|
|
12954
12954
|
if (input && typeof input === "object") {
|
|
12955
12955
|
for (const [key, value] of Object.entries(input)) {
|
|
12956
12956
|
if (value !== void 0 && value !== null) {
|
|
12957
|
-
|
|
12957
|
+
const displayValue = typeof value === "object" ? JSON.stringify(value, null, 2) : String(value);
|
|
12958
|
+
console.log(` ${key}: ${chalk3.gray(displayValue)}`);
|
|
12958
12959
|
}
|
|
12959
12960
|
}
|
|
12960
12961
|
}
|
|
@@ -13123,15 +13124,17 @@ async function pollEvents(runId, timeoutSeconds, options) {
|
|
|
13123
13124
|
let previousTimestamp = startTimestamp;
|
|
13124
13125
|
const verbose = options.verbose;
|
|
13125
13126
|
while (!complete) {
|
|
13126
|
-
|
|
13127
|
-
|
|
13128
|
-
|
|
13129
|
-
|
|
13130
|
-
|
|
13127
|
+
if (timeoutSeconds > 0) {
|
|
13128
|
+
const timeSinceLastEvent = Date.now() - lastEventTime;
|
|
13129
|
+
if (timeSinceLastEvent > timeoutMs) {
|
|
13130
|
+
console.error(
|
|
13131
|
+
chalk4.red(
|
|
13132
|
+
`
|
|
13131
13133
|
\u2717 Agent execution timed out after ${timeoutSeconds} seconds without receiving new events`
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13134
|
+
)
|
|
13135
|
+
);
|
|
13136
|
+
throw new Error("Agent execution timed out");
|
|
13137
|
+
}
|
|
13135
13138
|
}
|
|
13136
13139
|
const response = await apiClient.getEvents(runId, {
|
|
13137
13140
|
since: nextSequence
|
|
@@ -13222,15 +13225,17 @@ var runCmd = new Command2().name("run").description("Execute an agent").argument
|
|
|
13222
13225
|
"Resume from conversation ID (for fine-grained control)"
|
|
13223
13226
|
).option(
|
|
13224
13227
|
"-t, --timeout <seconds>",
|
|
13225
|
-
"Timeout in seconds without new events (default: 120)",
|
|
13228
|
+
"Timeout in seconds without new events, 0 = no timeout (default: 120)",
|
|
13226
13229
|
String(DEFAULT_TIMEOUT_SECONDS)
|
|
13227
13230
|
).option("-v, --verbose", "Show verbose output with timing information").action(
|
|
13228
13231
|
async (identifier, prompt, options) => {
|
|
13229
13232
|
const startTimestamp = /* @__PURE__ */ new Date();
|
|
13230
13233
|
const timeoutSeconds = parseInt(options.timeout, 10);
|
|
13231
|
-
if (isNaN(timeoutSeconds) || timeoutSeconds
|
|
13234
|
+
if (isNaN(timeoutSeconds) || timeoutSeconds < 0) {
|
|
13232
13235
|
console.error(
|
|
13233
|
-
chalk4.red(
|
|
13236
|
+
chalk4.red(
|
|
13237
|
+
"\u2717 Invalid timeout value. Must be a non-negative number (0 = no timeout)."
|
|
13238
|
+
)
|
|
13234
13239
|
);
|
|
13235
13240
|
process.exit(1);
|
|
13236
13241
|
}
|
|
@@ -13368,16 +13373,18 @@ runCmd.command("resume").description("Resume an agent run from a checkpoint (use
|
|
|
13368
13373
|
{}
|
|
13369
13374
|
).option(
|
|
13370
13375
|
"-t, --timeout <seconds>",
|
|
13371
|
-
"Timeout in seconds without new events (default: 120)",
|
|
13376
|
+
"Timeout in seconds without new events, 0 = no timeout (default: 120)",
|
|
13372
13377
|
String(DEFAULT_TIMEOUT_SECONDS)
|
|
13373
13378
|
).option("-v, --verbose", "Show verbose output with timing information").action(
|
|
13374
13379
|
async (checkpointId, prompt, options, command) => {
|
|
13375
13380
|
const startTimestamp = /* @__PURE__ */ new Date();
|
|
13376
13381
|
const allOpts = command.optsWithGlobals();
|
|
13377
13382
|
const timeoutSeconds = parseInt(options.timeout, 10);
|
|
13378
|
-
if (isNaN(timeoutSeconds) || timeoutSeconds
|
|
13383
|
+
if (isNaN(timeoutSeconds) || timeoutSeconds < 0) {
|
|
13379
13384
|
console.error(
|
|
13380
|
-
chalk4.red(
|
|
13385
|
+
chalk4.red(
|
|
13386
|
+
"\u2717 Invalid timeout value. Must be a non-negative number (0 = no timeout)."
|
|
13387
|
+
)
|
|
13381
13388
|
);
|
|
13382
13389
|
process.exit(1);
|
|
13383
13390
|
}
|
|
@@ -13441,16 +13448,18 @@ runCmd.command("continue").description(
|
|
|
13441
13448
|
{}
|
|
13442
13449
|
).option(
|
|
13443
13450
|
"-t, --timeout <seconds>",
|
|
13444
|
-
"Timeout in seconds without new events (default: 120)",
|
|
13451
|
+
"Timeout in seconds without new events, 0 = no timeout (default: 120)",
|
|
13445
13452
|
String(DEFAULT_TIMEOUT_SECONDS)
|
|
13446
13453
|
).option("-v, --verbose", "Show verbose output with timing information").action(
|
|
13447
13454
|
async (agentSessionId, prompt, options, command) => {
|
|
13448
13455
|
const startTimestamp = /* @__PURE__ */ new Date();
|
|
13449
13456
|
const allOpts = command.optsWithGlobals();
|
|
13450
13457
|
const timeoutSeconds = parseInt(options.timeout, 10);
|
|
13451
|
-
if (isNaN(timeoutSeconds) || timeoutSeconds
|
|
13458
|
+
if (isNaN(timeoutSeconds) || timeoutSeconds < 0) {
|
|
13452
13459
|
console.error(
|
|
13453
|
-
chalk4.red(
|
|
13460
|
+
chalk4.red(
|
|
13461
|
+
"\u2717 Invalid timeout value. Must be a non-negative number (0 = no timeout)."
|
|
13462
|
+
)
|
|
13454
13463
|
);
|
|
13455
13464
|
process.exit(1);
|
|
13456
13465
|
}
|
|
@@ -14413,7 +14422,7 @@ function escapeRegExp(str) {
|
|
|
14413
14422
|
}
|
|
14414
14423
|
var cookCommand = new Command15().name("cook").description("One-click agent preparation and execution from vm0.yaml").argument("[prompt]", "Prompt for the agent").option(
|
|
14415
14424
|
"-t, --timeout <seconds>",
|
|
14416
|
-
"Timeout in seconds without new events for agent run (default: 120)"
|
|
14425
|
+
"Timeout in seconds without new events for agent run, 0 = no timeout (default: 120)"
|
|
14417
14426
|
).action(async (prompt, options) => {
|
|
14418
14427
|
const cwd = process.cwd();
|
|
14419
14428
|
console.log(chalk14.blue(`Reading config: ${CONFIG_FILE3}`));
|
|
@@ -14581,7 +14590,7 @@ var cookCommand = new Command15().name("cook").description("One-click agent prep
|
|
|
14581
14590
|
|
|
14582
14591
|
// src/index.ts
|
|
14583
14592
|
var program = new Command16();
|
|
14584
|
-
program.name("vm0").description("VM0 CLI - A modern build tool").version("3.
|
|
14593
|
+
program.name("vm0").description("VM0 CLI - A modern build tool").version("3.9.0");
|
|
14585
14594
|
program.command("hello").description("Say hello from the App").action(() => {
|
|
14586
14595
|
console.log(chalk15.blue("Welcome to the VM0 CLI!"));
|
|
14587
14596
|
console.log(chalk15.green(`Core says: ${FOO}`));
|