@vm0/cli 3.8.0 → 3.8.1

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