@vm0/cli 9.80.0 → 9.81.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
@@ -65,7 +65,7 @@ import {
65
65
  storagesPrepareContract,
66
66
  volumeConfigSchema,
67
67
  withErrorHandler
68
- } from "./chunk-QKXNL42S.js";
68
+ } from "./chunk-3EOIDO3I.js";
69
69
 
70
70
  // src/index.ts
71
71
  import { Command as Command44 } from "commander";
@@ -451,7 +451,7 @@ function getConfigPath() {
451
451
  return join(homedir(), ".vm0", "config.json");
452
452
  }
453
453
  var infoCommand = new Command6().name("info").description("Display environment and debug information").action(async () => {
454
- console.log(chalk3.bold(`VM0 CLI v${"9.80.0"}`));
454
+ console.log(chalk3.bold(`VM0 CLI v${"9.81.0"}`));
455
455
  console.log();
456
456
  const config = await loadConfig();
457
457
  const hasEnvToken = !!process.env.VM0_TOKEN;
@@ -1677,7 +1677,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
1677
1677
  options.autoUpdate = false;
1678
1678
  }
1679
1679
  if (options.autoUpdate !== false) {
1680
- await startSilentUpgrade("9.80.0");
1680
+ await startSilentUpgrade("9.81.0");
1681
1681
  }
1682
1682
  try {
1683
1683
  let result;
@@ -2512,7 +2512,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
2512
2512
  withErrorHandler(
2513
2513
  async (identifier, prompt, options) => {
2514
2514
  if (options.autoUpdate !== false) {
2515
- await startSilentUpgrade("9.80.0");
2515
+ await startSilentUpgrade("9.81.0");
2516
2516
  }
2517
2517
  const { org, name, version } = parseIdentifier(identifier);
2518
2518
  let composeId;
@@ -4268,7 +4268,7 @@ var cookAction = new Command35().name("cook").description("Quick start: prepare,
4268
4268
  withErrorHandler(
4269
4269
  async (prompt, options) => {
4270
4270
  if (options.autoUpdate !== false) {
4271
- const shouldExit = await checkAndUpgrade("9.80.0", prompt);
4271
+ const shouldExit = await checkAndUpgrade("9.81.0", prompt);
4272
4272
  if (shouldExit) {
4273
4273
  process.exit(0);
4274
4274
  }
@@ -5434,13 +5434,13 @@ var upgradeCommand = new Command42().name("upgrade").description("Upgrade vm0 CL
5434
5434
  if (latestVersion === null) {
5435
5435
  throw new Error("Could not check for updates. Please try again later.");
5436
5436
  }
5437
- if (latestVersion === "9.80.0") {
5438
- console.log(chalk36.green(`\u2713 Already up to date (${"9.80.0"})`));
5437
+ if (latestVersion === "9.81.0") {
5438
+ console.log(chalk36.green(`\u2713 Already up to date (${"9.81.0"})`));
5439
5439
  return;
5440
5440
  }
5441
5441
  console.log(
5442
5442
  chalk36.yellow(
5443
- `Current version: ${"9.80.0"} -> Latest version: ${latestVersion}`
5443
+ `Current version: ${"9.81.0"} -> Latest version: ${latestVersion}`
5444
5444
  )
5445
5445
  );
5446
5446
  console.log();
@@ -5467,7 +5467,7 @@ var upgradeCommand = new Command42().name("upgrade").description("Upgrade vm0 CL
5467
5467
  const success = await performUpgrade(packageManager);
5468
5468
  if (success) {
5469
5469
  console.log(
5470
- chalk36.green(`\u2713 Upgraded from ${"9.80.0"} to ${latestVersion}`)
5470
+ chalk36.green(`\u2713 Upgraded from ${"9.81.0"} to ${latestVersion}`)
5471
5471
  );
5472
5472
  return;
5473
5473
  }
@@ -5535,7 +5535,7 @@ var whoamiCommand = new Command43().name("whoami").description("Show current ide
5535
5535
 
5536
5536
  // src/index.ts
5537
5537
  var program = new Command44();
5538
- program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.80.0");
5538
+ program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.81.0");
5539
5539
  program.addCommand(authCommand);
5540
5540
  program.addCommand(infoCommand);
5541
5541
  program.addCommand(composeCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "9.80.0",
3
+ "version": "9.81.0",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",
package/zero.js CHANGED
@@ -9,6 +9,7 @@ import {
9
9
  createZeroAgent,
10
10
  createZeroComputerConnector,
11
11
  createZeroConnectorSession,
12
+ decodeZeroTokenPayload,
12
13
  deleteZeroAgent,
13
14
  deleteZeroComputerConnector,
14
15
  deleteZeroConnector,
@@ -23,6 +24,7 @@ import {
23
24
  disableZeroSchedule,
24
25
  enableZeroSchedule,
25
26
  getActiveOrg,
27
+ getApiUrl,
26
28
  getAuthMethodsForType,
27
29
  getBaseUrl,
28
30
  getComposeByName,
@@ -34,6 +36,7 @@ import {
34
36
  getScopeDiff,
35
37
  getSecretsForAuthMethod,
36
38
  getSelectableProviderTypes,
39
+ getToken,
37
40
  getZeroAgent,
38
41
  getZeroAgentInstructions,
39
42
  getZeroConnector,
@@ -76,10 +79,10 @@ import {
76
79
  updateZeroUserPreferences,
77
80
  upsertZeroOrgModelProvider,
78
81
  withErrorHandler
79
- } from "./chunk-QKXNL42S.js";
82
+ } from "./chunk-3EOIDO3I.js";
80
83
 
81
84
  // src/zero.ts
82
- import { Command as Command51 } from "commander";
85
+ import { Command as Command52 } from "commander";
83
86
 
84
87
  // src/commands/zero/org/index.ts
85
88
  import { Command as Command23 } from "commander";
@@ -320,10 +323,6 @@ var setCommand2 = new Command11().name("set").description("Create or update an o
320
323
  throw error;
321
324
  }
322
325
  console.log(chalk11.green(`\u2713 Org secret "${secret.name}" saved`));
323
- console.log();
324
- console.log("Use in vm0.yaml:");
325
- console.log(chalk11.cyan(` environment:`));
326
- console.log(chalk11.cyan(` ${name}: \${{ secrets.${name} }}`));
327
326
  }
328
327
  )
329
328
  );
@@ -417,10 +416,6 @@ var setCommand3 = new Command15().name("set").description("Create or update an o
417
416
  throw error;
418
417
  }
419
418
  console.log(chalk14.green(`\u2713 Org variable "${variable.name}" saved`));
420
- console.log();
421
- console.log("Use in vm0.yaml:");
422
- console.log(chalk14.cyan(` environment:`));
423
- console.log(chalk14.cyan(` ${name}: \${{ vars.${name} }}`));
424
419
  }
425
420
  )
426
421
  );
@@ -1058,7 +1053,7 @@ var createCommand = new Command24().name("create").description("Create a new zer
1058
1053
  import { Command as Command25 } from "commander";
1059
1054
  import { readFileSync as readFileSync2 } from "fs";
1060
1055
  import chalk22 from "chalk";
1061
- var editCommand = new Command25().name("edit").description("Edit a zero agent").argument("<name>", "Agent name").option(
1056
+ var editCommand = new Command25().name("edit").description("Edit a zero agent").argument("<agent-id>", "Agent ID").option(
1062
1057
  "--connectors <items>",
1063
1058
  "Comma-separated connector short names (e.g. github,linear)"
1064
1059
  ).option("--display-name <name>", "New display name").option("--description <text>", "New description").option(
@@ -1066,7 +1061,7 @@ var editCommand = new Command25().name("edit").description("Edit a zero agent").
1066
1061
  "New tone: professional, friendly, direct, supportive"
1067
1062
  ).option("--instructions-file <path>", "Path to new instructions file").action(
1068
1063
  withErrorHandler(
1069
- async (name, options) => {
1064
+ async (agentId, options) => {
1070
1065
  const hasAgentUpdate = options.connectors !== void 0 || options.displayName !== void 0 || options.description !== void 0 || options.sound !== void 0;
1071
1066
  if (!hasAgentUpdate && !options.instructionsFile) {
1072
1067
  throw new Error(
@@ -1074,9 +1069,9 @@ var editCommand = new Command25().name("edit").description("Edit a zero agent").
1074
1069
  );
1075
1070
  }
1076
1071
  if (hasAgentUpdate) {
1077
- const current = await getZeroAgent(name);
1072
+ const current = await getZeroAgent(agentId);
1078
1073
  const connectors = options.connectors ? options.connectors.split(",").map((s) => s.trim()) : current.connectors;
1079
- await updateZeroAgent(name, {
1074
+ await updateZeroAgent(agentId, {
1080
1075
  connectors,
1081
1076
  displayName: options.displayName !== void 0 ? options.displayName : current.displayName ?? void 0,
1082
1077
  description: options.description !== void 0 ? options.description : current.description ?? void 0,
@@ -1085,9 +1080,9 @@ var editCommand = new Command25().name("edit").description("Edit a zero agent").
1085
1080
  }
1086
1081
  if (options.instructionsFile) {
1087
1082
  const content = readFileSync2(options.instructionsFile, "utf-8");
1088
- await updateZeroAgentInstructions(name, content);
1083
+ await updateZeroAgentInstructions(agentId, content);
1089
1084
  }
1090
- console.log(chalk22.green(`\u2713 Zero agent '${name}' updated`));
1085
+ console.log(chalk22.green(`\u2713 Zero agent '${agentId}' updated`));
1091
1086
  }
1092
1087
  )
1093
1088
  );
@@ -1095,10 +1090,10 @@ var editCommand = new Command25().name("edit").description("Edit a zero agent").
1095
1090
  // src/commands/zero/agent/view.ts
1096
1091
  import { Command as Command26 } from "commander";
1097
1092
  import chalk23 from "chalk";
1098
- var viewCommand = new Command26().name("view").description("View a zero agent").argument("<name>", "Agent name").option("--instructions", "Also show instructions content").action(
1093
+ var viewCommand = new Command26().name("view").description("View a zero agent").argument("<agent-id>", "Agent ID").option("--instructions", "Also show instructions content").action(
1099
1094
  withErrorHandler(
1100
- async (name, options) => {
1101
- const agent = await getZeroAgent(name);
1095
+ async (agentId, options) => {
1096
+ const agent = await getZeroAgent(agentId);
1102
1097
  console.log(chalk23.bold(agent.agentId));
1103
1098
  if (agent.displayName) console.log(chalk23.dim(agent.displayName));
1104
1099
  console.log();
@@ -1109,7 +1104,7 @@ var viewCommand = new Command26().name("view").description("View a zero agent").
1109
1104
  if (agent.sound) console.log(`Sound: ${agent.sound}`);
1110
1105
  if (options.instructions) {
1111
1106
  console.log();
1112
- const result = await getZeroAgentInstructions(name);
1107
+ const result = await getZeroAgentInstructions(agentId);
1113
1108
  if (result.content) {
1114
1109
  console.log(chalk23.dim("\u2500\u2500 Instructions \u2500\u2500"));
1115
1110
  console.log(result.content);
@@ -1161,15 +1156,15 @@ var listCommand5 = new Command27().name("list").alias("ls").description("List al
1161
1156
  // src/commands/zero/agent/delete.ts
1162
1157
  import { Command as Command28 } from "commander";
1163
1158
  import chalk25 from "chalk";
1164
- var deleteCommand2 = new Command28().name("delete").alias("rm").description("Delete a zero agent").argument("<name>", "Agent name").option("-y, --yes", "Skip confirmation prompt").action(
1165
- withErrorHandler(async (name, options) => {
1166
- await getZeroAgent(name);
1159
+ var deleteCommand2 = new Command28().name("delete").alias("rm").description("Delete a zero agent").argument("<agent-id>", "Agent ID").option("-y, --yes", "Skip confirmation prompt").action(
1160
+ withErrorHandler(async (agentId, options) => {
1161
+ await getZeroAgent(agentId);
1167
1162
  if (!options.yes) {
1168
1163
  if (!isInteractive()) {
1169
1164
  throw new Error("--yes flag is required in non-interactive mode");
1170
1165
  }
1171
1166
  const confirmed = await promptConfirm(
1172
- `Delete zero agent '${name}'?`,
1167
+ `Delete zero agent '${agentId}'?`,
1173
1168
  false
1174
1169
  );
1175
1170
  if (!confirmed) {
@@ -1177,8 +1172,8 @@ var deleteCommand2 = new Command28().name("delete").alias("rm").description("Del
1177
1172
  return;
1178
1173
  }
1179
1174
  }
1180
- await deleteZeroAgent(name);
1181
- console.log(chalk25.green(`\u2713 Zero agent '${name}' deleted`));
1175
+ await deleteZeroAgent(agentId);
1176
+ console.log(chalk25.green(`\u2713 Zero agent '${agentId}' deleted`));
1182
1177
  })
1183
1178
  );
1184
1179
 
@@ -2744,10 +2739,6 @@ var setCommand4 = new Command44().name("set").description("Create or update a se
2744
2739
  throw error;
2745
2740
  }
2746
2741
  console.log(chalk39.green(`\u2713 Secret "${secret.name}" saved`));
2747
- console.log();
2748
- console.log("Use in vm0.yaml:");
2749
- console.log(chalk39.cyan(` environment:`));
2750
- console.log(chalk39.cyan(` ${name}: \${{ secrets.${name} }}`));
2751
2742
  }
2752
2743
  )
2753
2744
  );
@@ -2841,10 +2832,6 @@ var setCommand5 = new Command48().name("set").description("Create or update a va
2841
2832
  throw error;
2842
2833
  }
2843
2834
  console.log(chalk42.green(`\u2713 Variable "${variable.name}" saved`));
2844
- console.log();
2845
- console.log("Use in vm0.yaml:");
2846
- console.log(chalk42.cyan(` environment:`));
2847
- console.log(chalk42.cyan(` ${name}: \${{ vars.${name} }}`));
2848
2835
  }
2849
2836
  )
2850
2837
  );
@@ -2875,9 +2862,60 @@ var deleteCommand5 = new Command49().name("delete").description("Delete a variab
2875
2862
  // src/commands/zero/variable/index.ts
2876
2863
  var zeroVariableCommand = new Command50().name("variable").description("Manage variables").addCommand(listCommand9).addCommand(setCommand5).addCommand(deleteCommand5);
2877
2864
 
2865
+ // src/commands/zero/whoami.ts
2866
+ import { Command as Command51 } from "commander";
2867
+ import chalk44 from "chalk";
2868
+ function isInsideSandbox() {
2869
+ return !!process.env.ZERO_AGENT_ID;
2870
+ }
2871
+ async function showSandboxInfo() {
2872
+ const agentId = process.env.ZERO_AGENT_ID;
2873
+ const payload = decodeZeroTokenPayload();
2874
+ console.log(chalk44.bold("Agent:"));
2875
+ console.log(` ID: ${agentId}`);
2876
+ console.log();
2877
+ console.log(chalk44.bold("Run:"));
2878
+ console.log(` ID: ${payload?.runId ?? chalk44.dim("unavailable")}`);
2879
+ console.log(` Org: ${payload?.orgId ?? chalk44.dim("unavailable")}`);
2880
+ if (payload?.capabilities?.length) {
2881
+ console.log();
2882
+ console.log(chalk44.bold("Capabilities:"));
2883
+ console.log(` ${payload.capabilities.join(", ")}`);
2884
+ }
2885
+ }
2886
+ async function showLocalInfo() {
2887
+ const token = await getToken();
2888
+ const apiUrl = await getApiUrl();
2889
+ const activeOrg = await getActiveOrg();
2890
+ console.log(chalk44.bold("Auth:"));
2891
+ if (token) {
2892
+ const tokenSource = process.env.ZERO_TOKEN ? "ZERO_TOKEN env var" : process.env.VM0_TOKEN ? "VM0_TOKEN env var" : "config file";
2893
+ console.log(
2894
+ ` Status: ${chalk44.green("Authenticated")} (via ${tokenSource})`
2895
+ );
2896
+ } else {
2897
+ console.log(` Status: ${chalk44.dim("Not authenticated")}`);
2898
+ }
2899
+ console.log(` API: ${apiUrl}`);
2900
+ console.log();
2901
+ if (activeOrg) {
2902
+ console.log(chalk44.bold("Org:"));
2903
+ console.log(` Active: ${activeOrg}`);
2904
+ }
2905
+ }
2906
+ var zeroWhoamiCommand = new Command51().name("whoami").description("Show current identity and environment information").action(
2907
+ withErrorHandler(async () => {
2908
+ if (isInsideSandbox()) {
2909
+ await showSandboxInfo();
2910
+ } else {
2911
+ await showLocalInfo();
2912
+ }
2913
+ })
2914
+ );
2915
+
2878
2916
  // src/zero.ts
2879
- var program = new Command51();
2880
- program.name("zero").description("Zero CLI - Manage your zero platform").version("9.80.0");
2917
+ var program = new Command52();
2918
+ program.name("zero").description("Zero CLI - Manage your zero platform").version("9.81.0");
2881
2919
  program.addCommand(zeroOrgCommand);
2882
2920
  program.addCommand(agentCommand);
2883
2921
  program.addCommand(zeroConnectorCommand);
@@ -2885,6 +2923,7 @@ program.addCommand(zeroPreferenceCommand);
2885
2923
  program.addCommand(zeroScheduleCommand);
2886
2924
  program.addCommand(zeroSecretCommand);
2887
2925
  program.addCommand(zeroVariableCommand);
2926
+ program.addCommand(zeroWhoamiCommand);
2888
2927
  if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {
2889
2928
  process.stdout.on("error", (err) => {
2890
2929
  if (err.code === "EPIPE") process.exit(0);