@vm0/cli 3.8.0 → 3.8.2

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 +14 -10
  2. 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
- console.log(` ${key}: ${chalk3.gray(String(value))}`);
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
  }
@@ -13118,17 +13119,17 @@ async function pollEvents(runId, timeoutSeconds, options) {
13118
13119
  let result = { succeeded: true };
13119
13120
  const pollIntervalMs = 500;
13120
13121
  const timeoutMs = timeoutSeconds * 1e3;
13121
- const startTime = Date.now();
13122
+ let lastEventTime = Date.now();
13122
13123
  const startTimestamp = options.startTimestamp;
13123
13124
  let previousTimestamp = startTimestamp;
13124
13125
  const verbose = options.verbose;
13125
13126
  while (!complete) {
13126
- const elapsed = Date.now() - startTime;
13127
- if (elapsed > timeoutMs) {
13127
+ const timeSinceLastEvent = Date.now() - lastEventTime;
13128
+ if (timeSinceLastEvent > timeoutMs) {
13128
13129
  console.error(
13129
13130
  chalk4.red(
13130
13131
  `
13131
- \u2717 Agent execution timed out after ${timeoutSeconds} seconds without receiving events`
13132
+ \u2717 Agent execution timed out after ${timeoutSeconds} seconds without receiving new events`
13132
13133
  )
13133
13134
  );
13134
13135
  throw new Error("Agent execution timed out");
@@ -13161,6 +13162,9 @@ async function pollEvents(runId, timeoutSeconds, options) {
13161
13162
  }
13162
13163
  }
13163
13164
  nextSequence = response.nextSequence;
13165
+ if (response.events.length > 0) {
13166
+ lastEventTime = Date.now();
13167
+ }
13164
13168
  if (response.events.length === 0 && !complete) {
13165
13169
  await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
13166
13170
  }
@@ -13219,7 +13223,7 @@ var runCmd = new Command2().name("run").description("Execute an agent").argument
13219
13223
  "Resume from conversation ID (for fine-grained control)"
13220
13224
  ).option(
13221
13225
  "-t, --timeout <seconds>",
13222
- "Polling timeout in seconds (default: 120)",
13226
+ "Timeout in seconds without new events (default: 120)",
13223
13227
  String(DEFAULT_TIMEOUT_SECONDS)
13224
13228
  ).option("-v, --verbose", "Show verbose output with timing information").action(
13225
13229
  async (identifier, prompt, options) => {
@@ -13365,7 +13369,7 @@ runCmd.command("resume").description("Resume an agent run from a checkpoint (use
13365
13369
  {}
13366
13370
  ).option(
13367
13371
  "-t, --timeout <seconds>",
13368
- "Polling timeout in seconds (default: 120)",
13372
+ "Timeout in seconds without new events (default: 120)",
13369
13373
  String(DEFAULT_TIMEOUT_SECONDS)
13370
13374
  ).option("-v, --verbose", "Show verbose output with timing information").action(
13371
13375
  async (checkpointId, prompt, options, command) => {
@@ -13438,7 +13442,7 @@ runCmd.command("continue").description(
13438
13442
  {}
13439
13443
  ).option(
13440
13444
  "-t, --timeout <seconds>",
13441
- "Polling timeout in seconds (default: 120)",
13445
+ "Timeout in seconds without new events (default: 120)",
13442
13446
  String(DEFAULT_TIMEOUT_SECONDS)
13443
13447
  ).option("-v, --verbose", "Show verbose output with timing information").action(
13444
13448
  async (agentSessionId, prompt, options, command) => {
@@ -14410,7 +14414,7 @@ function escapeRegExp(str) {
14410
14414
  }
14411
14415
  var cookCommand = new Command15().name("cook").description("One-click agent preparation and execution from vm0.yaml").argument("[prompt]", "Prompt for the agent").option(
14412
14416
  "-t, --timeout <seconds>",
14413
- "Polling timeout in seconds for agent run (default: 120)"
14417
+ "Timeout in seconds without new events for agent run (default: 120)"
14414
14418
  ).action(async (prompt, options) => {
14415
14419
  const cwd = process.cwd();
14416
14420
  console.log(chalk14.blue(`Reading config: ${CONFIG_FILE3}`));
@@ -14578,7 +14582,7 @@ var cookCommand = new Command15().name("cook").description("One-click agent prep
14578
14582
 
14579
14583
  // src/index.ts
14580
14584
  var program = new Command16();
14581
- program.name("vm0").description("VM0 CLI - A modern build tool").version("3.8.0");
14585
+ program.name("vm0").description("VM0 CLI - A modern build tool").version("3.8.2");
14582
14586
  program.command("hello").description("Say hello from the App").action(() => {
14583
14587
  console.log(chalk15.blue("Welcome to the VM0 CLI!"));
14584
14588
  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.0",
3
+ "version": "3.8.2",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",