@vm0/cli 3.8.2 → 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.
Files changed (2) hide show
  1. package/index.js +27 -19
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -13124,15 +13124,17 @@ async function pollEvents(runId, timeoutSeconds, options) {
13124
13124
  let previousTimestamp = startTimestamp;
13125
13125
  const verbose = options.verbose;
13126
13126
  while (!complete) {
13127
- const timeSinceLastEvent = Date.now() - lastEventTime;
13128
- if (timeSinceLastEvent > timeoutMs) {
13129
- console.error(
13130
- chalk4.red(
13131
- `
13127
+ if (timeoutSeconds > 0) {
13128
+ const timeSinceLastEvent = Date.now() - lastEventTime;
13129
+ if (timeSinceLastEvent > timeoutMs) {
13130
+ console.error(
13131
+ chalk4.red(
13132
+ `
13132
13133
  \u2717 Agent execution timed out after ${timeoutSeconds} seconds without receiving new events`
13133
- )
13134
- );
13135
- throw new Error("Agent execution timed out");
13134
+ )
13135
+ );
13136
+ throw new Error("Agent execution timed out");
13137
+ }
13136
13138
  }
13137
13139
  const response = await apiClient.getEvents(runId, {
13138
13140
  since: nextSequence
@@ -13223,15 +13225,17 @@ var runCmd = new Command2().name("run").description("Execute an agent").argument
13223
13225
  "Resume from conversation ID (for fine-grained control)"
13224
13226
  ).option(
13225
13227
  "-t, --timeout <seconds>",
13226
- "Timeout in seconds without new events (default: 120)",
13228
+ "Timeout in seconds without new events, 0 = no timeout (default: 120)",
13227
13229
  String(DEFAULT_TIMEOUT_SECONDS)
13228
13230
  ).option("-v, --verbose", "Show verbose output with timing information").action(
13229
13231
  async (identifier, prompt, options) => {
13230
13232
  const startTimestamp = /* @__PURE__ */ new Date();
13231
13233
  const timeoutSeconds = parseInt(options.timeout, 10);
13232
- if (isNaN(timeoutSeconds) || timeoutSeconds <= 0) {
13234
+ if (isNaN(timeoutSeconds) || timeoutSeconds < 0) {
13233
13235
  console.error(
13234
- chalk4.red("\u2717 Invalid timeout value. Must be a positive number.")
13236
+ chalk4.red(
13237
+ "\u2717 Invalid timeout value. Must be a non-negative number (0 = no timeout)."
13238
+ )
13235
13239
  );
13236
13240
  process.exit(1);
13237
13241
  }
@@ -13369,16 +13373,18 @@ runCmd.command("resume").description("Resume an agent run from a checkpoint (use
13369
13373
  {}
13370
13374
  ).option(
13371
13375
  "-t, --timeout <seconds>",
13372
- "Timeout in seconds without new events (default: 120)",
13376
+ "Timeout in seconds without new events, 0 = no timeout (default: 120)",
13373
13377
  String(DEFAULT_TIMEOUT_SECONDS)
13374
13378
  ).option("-v, --verbose", "Show verbose output with timing information").action(
13375
13379
  async (checkpointId, prompt, options, command) => {
13376
13380
  const startTimestamp = /* @__PURE__ */ new Date();
13377
13381
  const allOpts = command.optsWithGlobals();
13378
13382
  const timeoutSeconds = parseInt(options.timeout, 10);
13379
- if (isNaN(timeoutSeconds) || timeoutSeconds <= 0) {
13383
+ if (isNaN(timeoutSeconds) || timeoutSeconds < 0) {
13380
13384
  console.error(
13381
- chalk4.red("\u2717 Invalid timeout value. Must be a positive number.")
13385
+ chalk4.red(
13386
+ "\u2717 Invalid timeout value. Must be a non-negative number (0 = no timeout)."
13387
+ )
13382
13388
  );
13383
13389
  process.exit(1);
13384
13390
  }
@@ -13442,16 +13448,18 @@ runCmd.command("continue").description(
13442
13448
  {}
13443
13449
  ).option(
13444
13450
  "-t, --timeout <seconds>",
13445
- "Timeout in seconds without new events (default: 120)",
13451
+ "Timeout in seconds without new events, 0 = no timeout (default: 120)",
13446
13452
  String(DEFAULT_TIMEOUT_SECONDS)
13447
13453
  ).option("-v, --verbose", "Show verbose output with timing information").action(
13448
13454
  async (agentSessionId, prompt, options, command) => {
13449
13455
  const startTimestamp = /* @__PURE__ */ new Date();
13450
13456
  const allOpts = command.optsWithGlobals();
13451
13457
  const timeoutSeconds = parseInt(options.timeout, 10);
13452
- if (isNaN(timeoutSeconds) || timeoutSeconds <= 0) {
13458
+ if (isNaN(timeoutSeconds) || timeoutSeconds < 0) {
13453
13459
  console.error(
13454
- chalk4.red("\u2717 Invalid timeout value. Must be a positive number.")
13460
+ chalk4.red(
13461
+ "\u2717 Invalid timeout value. Must be a non-negative number (0 = no timeout)."
13462
+ )
13455
13463
  );
13456
13464
  process.exit(1);
13457
13465
  }
@@ -14414,7 +14422,7 @@ function escapeRegExp(str) {
14414
14422
  }
14415
14423
  var cookCommand = new Command15().name("cook").description("One-click agent preparation and execution from vm0.yaml").argument("[prompt]", "Prompt for the agent").option(
14416
14424
  "-t, --timeout <seconds>",
14417
- "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)"
14418
14426
  ).action(async (prompt, options) => {
14419
14427
  const cwd = process.cwd();
14420
14428
  console.log(chalk14.blue(`Reading config: ${CONFIG_FILE3}`));
@@ -14582,7 +14590,7 @@ var cookCommand = new Command15().name("cook").description("One-click agent prep
14582
14590
 
14583
14591
  // src/index.ts
14584
14592
  var program = new Command16();
14585
- program.name("vm0").description("VM0 CLI - A modern build tool").version("3.8.2");
14593
+ program.name("vm0").description("VM0 CLI - A modern build tool").version("3.9.0");
14586
14594
  program.command("hello").description("Say hello from the App").action(() => {
14587
14595
  console.log(chalk15.blue("Welcome to the VM0 CLI!"));
14588
14596
  console.log(chalk15.green(`Core says: ${FOO}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "3.8.2",
3
+ "version": "3.9.0",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",