@vm0/cli 9.110.2 → 9.111.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 CHANGED
@@ -70,7 +70,7 @@ import {
70
70
  source_default,
71
71
  volumeConfigSchema,
72
72
  withErrorHandler
73
- } from "./chunk-W353Y7DH.js";
73
+ } from "./chunk-QX23MVVI.js";
74
74
 
75
75
  // src/index.ts
76
76
  init_esm_shims();
@@ -463,7 +463,7 @@ function getConfigPath() {
463
463
  return join(homedir(), ".vm0", "config.json");
464
464
  }
465
465
  var infoCommand = new Command().name("info").description("Display environment and debug information").action(async () => {
466
- console.log(source_default.bold(`VM0 CLI v${"9.110.2"}`));
466
+ console.log(source_default.bold(`VM0 CLI v${"9.111.0"}`));
467
467
  console.log();
468
468
  const config = await loadConfig();
469
469
  const hasEnvToken = !!process.env.VM0_TOKEN;
@@ -4492,7 +4492,7 @@ var composeCommand = new Command().name("compose").description("Create or update
4492
4492
  options.autoUpdate = false;
4493
4493
  }
4494
4494
  if (options.autoUpdate !== false) {
4495
- await startSilentUpgrade("9.110.2");
4495
+ await startSilentUpgrade("9.111.0");
4496
4496
  }
4497
4497
  try {
4498
4498
  let result;
@@ -4572,7 +4572,7 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
4572
4572
  withErrorHandler(
4573
4573
  async (identifier, prompt, options) => {
4574
4574
  if (options.autoUpdate !== false) {
4575
- await startSilentUpgrade("9.110.2");
4575
+ await startSilentUpgrade("9.111.0");
4576
4576
  }
4577
4577
  const { name, version } = parseIdentifier(identifier);
4578
4578
  let composeId;
@@ -6313,7 +6313,7 @@ var cookAction = new Command().name("cook").description("Quick start: prepare, c
6313
6313
  withErrorHandler(
6314
6314
  async (prompt, options) => {
6315
6315
  if (options.autoUpdate !== false) {
6316
- const shouldExit = await checkAndUpgrade("9.110.2", prompt);
6316
+ const shouldExit = await checkAndUpgrade("9.111.0", prompt);
6317
6317
  if (shouldExit) {
6318
6318
  process.exit(0);
6319
6319
  }
@@ -7080,13 +7080,13 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
7080
7080
  if (latestVersion === null) {
7081
7081
  throw new Error("Could not check for updates. Please try again later.");
7082
7082
  }
7083
- if (latestVersion === "9.110.2") {
7084
- console.log(source_default.green(`\u2713 Already up to date (${"9.110.2"})`));
7083
+ if (latestVersion === "9.111.0") {
7084
+ console.log(source_default.green(`\u2713 Already up to date (${"9.111.0"})`));
7085
7085
  return;
7086
7086
  }
7087
7087
  console.log(
7088
7088
  source_default.yellow(
7089
- `Current version: ${"9.110.2"} -> Latest version: ${latestVersion}`
7089
+ `Current version: ${"9.111.0"} -> Latest version: ${latestVersion}`
7090
7090
  )
7091
7091
  );
7092
7092
  console.log();
@@ -7113,7 +7113,7 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
7113
7113
  const success = await performUpgrade(packageManager);
7114
7114
  if (success) {
7115
7115
  console.log(
7116
- source_default.green(`\u2713 Upgraded from ${"9.110.2"} to ${latestVersion}`)
7116
+ source_default.green(`\u2713 Upgraded from ${"9.111.0"} to ${latestVersion}`)
7117
7117
  );
7118
7118
  return;
7119
7119
  }
@@ -7180,7 +7180,7 @@ var whoamiCommand = new Command().name("whoami").description("Show current ident
7180
7180
 
7181
7181
  // src/index.ts
7182
7182
  var program = new Command();
7183
- program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.110.2");
7183
+ program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.111.0");
7184
7184
  program.addCommand(authCommand);
7185
7185
  program.addCommand(infoCommand);
7186
7186
  program.addCommand(composeCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "9.110.2",
3
+ "version": "9.111.0",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",
package/zero.js CHANGED
@@ -128,7 +128,7 @@ import {
128
128
  upsertZeroOrgModelProvider,
129
129
  withErrorHandler,
130
130
  zeroAgentCustomSkillNameSchema
131
- } from "./chunk-W353Y7DH.js";
131
+ } from "./chunk-QX23MVVI.js";
132
132
 
133
133
  // src/zero.ts
134
134
  init_esm_shims();
@@ -5762,12 +5762,58 @@ init_esm_shims();
5762
5762
  // src/commands/zero/phone/call.ts
5763
5763
  init_esm_shims();
5764
5764
  import * as fs from "fs";
5765
+
5766
+ // src/commands/zero/phone/format.ts
5767
+ init_esm_shims();
5768
+ function printTranscript(transcript) {
5769
+ if (!transcript || transcript.length === 0) {
5770
+ console.log(" (no transcript)");
5771
+ return;
5772
+ }
5773
+ for (const entry of transcript) {
5774
+ console.log(` ${source_default.dim(`[${entry.role}]`)} ${entry.text}`);
5775
+ }
5776
+ }
5777
+ function printCallInfo(call, callId) {
5778
+ console.log(` ${"Call ID:".padEnd(16)}${source_default.cyan(call.id ?? callId)}`);
5779
+ console.log(` ${"From:".padEnd(16)}${call.fromNumber}`);
5780
+ console.log(` ${"To:".padEnd(16)}${call.toNumber}`);
5781
+ console.log(` ${"Status:".padEnd(16)}${call.status}`);
5782
+ console.log(
5783
+ ` ${"Duration:".padEnd(16)}${call.durationSeconds != null ? `${call.durationSeconds}s` : "N/A"}`
5784
+ );
5785
+ console.log(` ${"Started:".padEnd(16)}${call.startedAt ?? ""}`);
5786
+ }
5787
+
5788
+ // src/commands/zero/phone/call.ts
5789
+ var POLL_INTERVAL_MS = 1e4;
5790
+ var POLL_TIMEOUT_MS = 15 * 60 * 1e3;
5791
+ var delay2 = {
5792
+ ms: (ms) => {
5793
+ return new Promise((resolve) => {
5794
+ setTimeout(resolve, ms);
5795
+ });
5796
+ }
5797
+ };
5798
+ var TERMINAL_STATUSES = /* @__PURE__ */ new Set([
5799
+ "completed",
5800
+ "ended",
5801
+ "failed",
5802
+ "no-answer",
5803
+ "busy",
5804
+ "cancelled"
5805
+ ]);
5765
5806
  function isErrnoException(err) {
5766
5807
  return err instanceof Error && "code" in err;
5767
5808
  }
5768
5809
  var callCommand = new Command().name("call").description("Initiate an outbound phone call").argument(
5769
5810
  "<to-number>",
5770
5811
  "Phone number to call (E.164 format, e.g. +14155551234)"
5812
+ ).addOption(
5813
+ new Option(
5814
+ "--mode <mode>",
5815
+ "onhold: wait for call to complete and return transcript. fire-and-forget: initiate and return immediately."
5816
+ ).choices(["onhold", "fire-and-forget"]).makeOptionMandatory()
5771
5817
  ).option(
5772
5818
  "--system-prompt-file <path>",
5773
5819
  "File that defines the agent's persona and task context for this call"
@@ -5803,48 +5849,43 @@ var callCommand = new Command().name("call").description("Initiate an outbound p
5803
5849
  console.log(source_default.green("Call initiated"));
5804
5850
  console.log(` ${"Call ID:".padEnd(12)}${source_default.cyan(result.callId)}`);
5805
5851
  console.log(` ${"Status:".padEnd(12)}${result.status}`);
5852
+ if (options.mode === "fire-and-forget") {
5853
+ return;
5854
+ }
5855
+ console.log();
5856
+ console.log(
5857
+ source_default.dim("Waiting for call to complete (polling every 10s)...")
5858
+ );
5859
+ const startTime = Date.now();
5860
+ while (Date.now() - startTime < POLL_TIMEOUT_MS) {
5861
+ await delay2.ms(POLL_INTERVAL_MS);
5862
+ const detail = await getPhoneCallDetail(result.callId);
5863
+ const status = detail.call.status;
5864
+ const elapsed = Math.round((Date.now() - startTime) / 1e3);
5865
+ if (TERMINAL_STATUSES.has(status)) {
5866
+ console.log();
5867
+ console.log(source_default.bold("Call Detail"));
5868
+ console.log();
5869
+ printCallInfo(detail.call, result.callId);
5870
+ console.log();
5871
+ console.log(source_default.bold("Transcript"));
5872
+ console.log();
5873
+ printTranscript(detail.transcript);
5874
+ if (status === "failed") {
5875
+ process.exit(1);
5876
+ }
5877
+ return;
5878
+ }
5879
+ console.log(source_default.dim(` [${elapsed}s] status: ${status}`));
5880
+ }
5881
+ console.error(source_default.red("\nCall timed out after 15 minutes"));
5882
+ process.exit(1);
5806
5883
  }
5807
5884
  )
5808
5885
  );
5809
5886
 
5810
5887
  // src/commands/zero/phone/record.ts
5811
5888
  init_esm_shims();
5812
- function printTranscript(transcript) {
5813
- if (Array.isArray(transcript)) {
5814
- for (const entry of transcript) {
5815
- if (typeof entry === "string") {
5816
- console.log(` ${entry}`);
5817
- } else if (typeof entry === "object" && entry !== null) {
5818
- const e = entry;
5819
- const role = e.role ?? e.speaker ?? "Unknown";
5820
- const text = e.text ?? e.content ?? e.body ?? "";
5821
- console.log(` ${source_default.dim(`[${role}]`)} ${text}`);
5822
- }
5823
- }
5824
- } else if (typeof transcript === "string") {
5825
- console.log(` ${transcript}`);
5826
- } else {
5827
- console.log(` ${JSON.stringify(transcript, null, 2)}`);
5828
- }
5829
- }
5830
- function printCallInfo(call, callId) {
5831
- console.log(
5832
- ` ${"Call ID:".padEnd(16)}${source_default.cyan(String(call.id ?? callId))}`
5833
- );
5834
- console.log(
5835
- ` ${"From:".padEnd(16)}${String(call.fromNumber ?? call.from_number ?? "")}`
5836
- );
5837
- console.log(
5838
- ` ${"To:".padEnd(16)}${String(call.toNumber ?? call.to_number ?? "")}`
5839
- );
5840
- console.log(` ${"Status:".padEnd(16)}${String(call.status ?? "")}`);
5841
- console.log(
5842
- ` ${"Duration:".padEnd(16)}${String(call.durationSeconds ?? call.duration_seconds ?? "N/A")}s`
5843
- );
5844
- console.log(
5845
- ` ${"Started:".padEnd(16)}${String(call.startedAt ?? call.started_at ?? "")}`
5846
- );
5847
- }
5848
5889
  async function showCallDetail(callId) {
5849
5890
  const result = await getPhoneCallDetail(callId);
5850
5891
  console.log(source_default.bold("Call Detail"));
@@ -5864,14 +5905,12 @@ async function showCallList(limit) {
5864
5905
  console.log(source_default.bold("Recent Calls"));
5865
5906
  console.log();
5866
5907
  for (const call of result.data) {
5867
- const id = String(call.id ?? "");
5868
- const from = String(call.fromNumber ?? call.from_number ?? "");
5869
- const to = String(call.toNumber ?? call.to_number ?? "");
5870
- const status = String(call.status ?? "");
5871
- const duration = call.durationSeconds ?? call.duration_seconds;
5872
- const snippet = String(
5873
- call.lastTranscriptSnippet ?? call.last_transcript_snippet ?? ""
5874
- );
5908
+ const id = call.id;
5909
+ const from = call.fromNumber;
5910
+ const to = call.toNumber;
5911
+ const status = call.status;
5912
+ const duration = call.durationSeconds;
5913
+ const snippet = call.lastTranscriptSnippet ?? "";
5875
5914
  console.log(` ${source_default.cyan(id)}`);
5876
5915
  console.log(
5877
5916
  ` ${from} \u2192 ${to} ${source_default.dim(status)}${duration != null ? ` ${duration}s` : ""}`
@@ -6019,7 +6058,7 @@ function registerZeroCommands(prog, commands) {
6019
6058
  var program = new Command();
6020
6059
  program.name("zero").description(
6021
6060
  "Zero CLI \u2014 interact with the zero platform from inside the sandbox"
6022
- ).version("9.110.2").addHelpText(
6061
+ ).version("9.111.0").addHelpText(
6023
6062
  "after",
6024
6063
  `
6025
6064
  Examples: