@vm0/cli 3.7.0 → 3.8.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 +37 -11
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -13115,7 +13115,7 @@ var DEFAULT_TIMEOUT_SECONDS = 120;
|
|
|
13115
13115
|
async function pollEvents(runId, timeoutSeconds, options) {
|
|
13116
13116
|
let nextSequence = -1;
|
|
13117
13117
|
let complete = false;
|
|
13118
|
-
let
|
|
13118
|
+
let result = { succeeded: true };
|
|
13119
13119
|
const pollIntervalMs = 500;
|
|
13120
13120
|
const timeoutMs = timeoutSeconds * 1e3;
|
|
13121
13121
|
const startTime = Date.now();
|
|
@@ -13149,10 +13149,14 @@ async function pollEvents(runId, timeoutSeconds, options) {
|
|
|
13149
13149
|
previousTimestamp = parsed.timestamp;
|
|
13150
13150
|
if (parsed.type === "vm0_result") {
|
|
13151
13151
|
complete = true;
|
|
13152
|
-
|
|
13152
|
+
result = {
|
|
13153
|
+
succeeded: true,
|
|
13154
|
+
sessionId: parsed.data.agentSessionId,
|
|
13155
|
+
checkpointId: parsed.data.checkpointId
|
|
13156
|
+
};
|
|
13153
13157
|
} else if (parsed.type === "vm0_error") {
|
|
13154
13158
|
complete = true;
|
|
13155
|
-
|
|
13159
|
+
result = { succeeded: false };
|
|
13156
13160
|
}
|
|
13157
13161
|
}
|
|
13158
13162
|
}
|
|
@@ -13161,7 +13165,7 @@ async function pollEvents(runId, timeoutSeconds, options) {
|
|
|
13161
13165
|
await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
|
|
13162
13166
|
}
|
|
13163
13167
|
}
|
|
13164
|
-
return
|
|
13168
|
+
return result;
|
|
13165
13169
|
}
|
|
13166
13170
|
function logVerbosePreFlight(action, details) {
|
|
13167
13171
|
console.log(chalk4.blue(`
|
|
@@ -13175,6 +13179,25 @@ ${action}...`));
|
|
|
13175
13179
|
console.log(chalk4.blue("Executing in sandbox..."));
|
|
13176
13180
|
console.log();
|
|
13177
13181
|
}
|
|
13182
|
+
function showNextSteps(result) {
|
|
13183
|
+
const { sessionId, checkpointId } = result;
|
|
13184
|
+
if (sessionId || checkpointId) {
|
|
13185
|
+
console.log();
|
|
13186
|
+
console.log("Next steps:");
|
|
13187
|
+
if (sessionId) {
|
|
13188
|
+
console.log(" Continue with session (latest state):");
|
|
13189
|
+
console.log(
|
|
13190
|
+
chalk4.cyan(` vm0 run continue ${sessionId} "your next prompt"`)
|
|
13191
|
+
);
|
|
13192
|
+
}
|
|
13193
|
+
if (checkpointId) {
|
|
13194
|
+
console.log(" Resume from checkpoint (exact snapshot state):");
|
|
13195
|
+
console.log(
|
|
13196
|
+
chalk4.cyan(` vm0 run resume ${checkpointId} "your next prompt"`)
|
|
13197
|
+
);
|
|
13198
|
+
}
|
|
13199
|
+
}
|
|
13200
|
+
}
|
|
13178
13201
|
var runCmd = new Command2().name("run").description("Execute an agent").argument(
|
|
13179
13202
|
"<identifier>",
|
|
13180
13203
|
"Agent name, config ID, or name:version (e.g., 'my-agent', 'my-agent:abc123', 'my-agent:latest')"
|
|
@@ -13305,13 +13328,14 @@ var runCmd = new Command2().name("run").description("Execute an agent").argument
|
|
|
13305
13328
|
volumeVersions: Object.keys(options.volumeVersion).length > 0 ? options.volumeVersion : void 0,
|
|
13306
13329
|
conversationId: options.conversation
|
|
13307
13330
|
});
|
|
13308
|
-
const
|
|
13331
|
+
const result = await pollEvents(response.runId, timeoutSeconds, {
|
|
13309
13332
|
verbose,
|
|
13310
13333
|
startTimestamp
|
|
13311
13334
|
});
|
|
13312
|
-
if (!succeeded) {
|
|
13335
|
+
if (!result.succeeded) {
|
|
13313
13336
|
process.exit(1);
|
|
13314
13337
|
}
|
|
13338
|
+
showNextSteps(result);
|
|
13315
13339
|
} catch (error43) {
|
|
13316
13340
|
if (error43 instanceof Error) {
|
|
13317
13341
|
if (error43.message.includes("Not authenticated")) {
|
|
@@ -13378,13 +13402,14 @@ runCmd.command("resume").description("Resume an agent run from a checkpoint (use
|
|
|
13378
13402
|
prompt,
|
|
13379
13403
|
volumeVersions: Object.keys(allOpts.volumeVersion).length > 0 ? allOpts.volumeVersion : void 0
|
|
13380
13404
|
});
|
|
13381
|
-
const
|
|
13405
|
+
const result = await pollEvents(response.runId, timeoutSeconds, {
|
|
13382
13406
|
verbose,
|
|
13383
13407
|
startTimestamp
|
|
13384
13408
|
});
|
|
13385
|
-
if (!succeeded) {
|
|
13409
|
+
if (!result.succeeded) {
|
|
13386
13410
|
process.exit(1);
|
|
13387
13411
|
}
|
|
13412
|
+
showNextSteps(result);
|
|
13388
13413
|
} catch (error43) {
|
|
13389
13414
|
if (error43 instanceof Error) {
|
|
13390
13415
|
if (error43.message.includes("Not authenticated")) {
|
|
@@ -13451,13 +13476,14 @@ runCmd.command("continue").description(
|
|
|
13451
13476
|
prompt,
|
|
13452
13477
|
volumeVersions: Object.keys(allOpts.volumeVersion).length > 0 ? allOpts.volumeVersion : void 0
|
|
13453
13478
|
});
|
|
13454
|
-
const
|
|
13479
|
+
const result = await pollEvents(response.runId, timeoutSeconds, {
|
|
13455
13480
|
verbose,
|
|
13456
13481
|
startTimestamp
|
|
13457
13482
|
});
|
|
13458
|
-
if (!succeeded) {
|
|
13483
|
+
if (!result.succeeded) {
|
|
13459
13484
|
process.exit(1);
|
|
13460
13485
|
}
|
|
13486
|
+
showNextSteps(result);
|
|
13461
13487
|
} catch (error43) {
|
|
13462
13488
|
if (error43 instanceof Error) {
|
|
13463
13489
|
if (error43.message.includes("Not authenticated")) {
|
|
@@ -14552,7 +14578,7 @@ var cookCommand = new Command15().name("cook").description("One-click agent prep
|
|
|
14552
14578
|
|
|
14553
14579
|
// src/index.ts
|
|
14554
14580
|
var program = new Command16();
|
|
14555
|
-
program.name("vm0").description("VM0 CLI - A modern build tool").version("3.
|
|
14581
|
+
program.name("vm0").description("VM0 CLI - A modern build tool").version("3.8.0");
|
|
14556
14582
|
program.command("hello").description("Say hello from the App").action(() => {
|
|
14557
14583
|
console.log(chalk15.blue("Welcome to the VM0 CLI!"));
|
|
14558
14584
|
console.log(chalk15.green(`Core says: ${FOO}`));
|