@vm0/cli 9.111.1 → 9.111.3

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-H56HRDOU.js";
73
+ } from "./chunk-JZJGXOGN.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.111.1"}`));
466
+ console.log(source_default.bold(`VM0 CLI v${"9.111.3"}`));
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.111.1");
4495
+ await startSilentUpgrade("9.111.3");
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.111.1");
4575
+ await startSilentUpgrade("9.111.3");
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.111.1", prompt);
6316
+ const shouldExit = await checkAndUpgrade("9.111.3", 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.111.1") {
7084
- console.log(source_default.green(`\u2713 Already up to date (${"9.111.1"})`));
7083
+ if (latestVersion === "9.111.3") {
7084
+ console.log(source_default.green(`\u2713 Already up to date (${"9.111.3"})`));
7085
7085
  return;
7086
7086
  }
7087
7087
  console.log(
7088
7088
  source_default.yellow(
7089
- `Current version: ${"9.111.1"} -> Latest version: ${latestVersion}`
7089
+ `Current version: ${"9.111.3"} -> 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.111.1"} to ${latestVersion}`)
7116
+ source_default.green(`\u2713 Upgraded from ${"9.111.3"} 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.111.1");
7183
+ program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.111.3");
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.111.1",
3
+ "version": "9.111.3",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",
package/zero.js CHANGED
@@ -126,7 +126,7 @@ import {
126
126
  upsertZeroOrgModelProvider,
127
127
  withErrorHandler,
128
128
  zeroAgentCustomSkillNameSchema
129
- } from "./chunk-H56HRDOU.js";
129
+ } from "./chunk-JZJGXOGN.js";
130
130
 
131
131
  // src/zero.ts
132
132
  init_esm_shims();
@@ -1287,6 +1287,16 @@ Notes:
1287
1287
 
1288
1288
  // src/commands/zero/agent/view.ts
1289
1289
  init_esm_shims();
1290
+
1291
+ // src/lib/utils/format-utils.ts
1292
+ init_esm_shims();
1293
+ function policyIcon(policy) {
1294
+ if (policy === "allow") return source_default.green("\u2713");
1295
+ if (policy === "ask") return source_default.yellow("?");
1296
+ return source_default.dim("\u2717");
1297
+ }
1298
+
1299
+ // src/commands/zero/agent/view.ts
1290
1300
  function getConnectorPermissionInfo(type, resolvedPolicies) {
1291
1301
  if (!isFirewallConnectorType(type)) {
1292
1302
  return {
@@ -1294,12 +1304,13 @@ function getConnectorPermissionInfo(type, resolvedPolicies) {
1294
1304
  hasPermissions: false,
1295
1305
  permissions: [],
1296
1306
  policies: null,
1307
+ unknownPolicy: "allow",
1297
1308
  allowed: 0,
1298
1309
  total: 0
1299
1310
  };
1300
1311
  }
1301
- const rawPolicies = resolvedPolicies?.[type];
1302
- const policies = rawPolicies && Object.keys(rawPolicies).length > 0 ? rawPolicies : null;
1312
+ const refPolicy = resolvedPolicies?.[type];
1313
+ const policies = refPolicy && Object.keys(refPolicy.policies).length > 0 ? refPolicy.policies : null;
1303
1314
  const config = getConnectorFirewall(type);
1304
1315
  const permissions = config.apis.flatMap((a) => {
1305
1316
  return a.permissions ?? [];
@@ -1308,7 +1319,40 @@ function getConnectorPermissionInfo(type, resolvedPolicies) {
1308
1319
  const allowed = policies ? permissions.filter((p) => {
1309
1320
  return policies[p.name] === "allow";
1310
1321
  }).length : 0;
1311
- return { type, hasPermissions: true, permissions, policies, allowed, total };
1322
+ const unknownPolicy = refPolicy?.unknownPolicy ?? "allow";
1323
+ return {
1324
+ type,
1325
+ hasPermissions: true,
1326
+ permissions,
1327
+ policies,
1328
+ unknownPolicy,
1329
+ allowed,
1330
+ total
1331
+ };
1332
+ }
1333
+ function printDetailedPermissions(info) {
1334
+ if (!info.policies) {
1335
+ const icon = policyIcon(info.unknownPolicy);
1336
+ console.log(` ${icon} unknown endpoints`);
1337
+ return;
1338
+ }
1339
+ const nameWidth = Math.max(
1340
+ "unknown endpoints".length,
1341
+ ...info.permissions.map((p) => {
1342
+ return p.name.length;
1343
+ })
1344
+ );
1345
+ for (const perm of info.permissions) {
1346
+ const policy = info.policies[perm.name] ?? "deny";
1347
+ const desc = perm.description ?? "";
1348
+ console.log(
1349
+ ` ${policyIcon(policy)} ${perm.name.padEnd(nameWidth)} ${desc}`
1350
+ );
1351
+ }
1352
+ const unknownIcon = policyIcon(info.unknownPolicy);
1353
+ console.log(
1354
+ ` ${unknownIcon} ${"unknown endpoints".padEnd(nameWidth)} Endpoints not matching any rule`
1355
+ );
1312
1356
  }
1313
1357
  function formatConnectorIdentity(connector) {
1314
1358
  if (!connector) return "";
@@ -1391,25 +1435,8 @@ Examples:
1391
1435
  for (const info of connectorInfos) {
1392
1436
  const identity = formatDetailIdentity(identityMap.get(info.type));
1393
1437
  console.log(` ${info.type.padEnd(14)}${identity}`);
1394
- if (!info.hasPermissions) continue;
1395
- if (!info.policies) {
1396
- console.log(
1397
- source_default.dim(" full access \u2014 no permission rules configured")
1398
- );
1399
- continue;
1400
- }
1401
- const nameWidth = Math.max(
1402
- ...info.permissions.map((p) => {
1403
- return p.name.length;
1404
- })
1405
- );
1406
- for (const perm of info.permissions) {
1407
- const policy = info.policies[perm.name] ?? "deny";
1408
- const icon = policy === "allow" ? source_default.green("\u2713") : policy === "ask" ? source_default.yellow("?") : source_default.dim("\u2717");
1409
- const desc = perm.description ?? "";
1410
- console.log(
1411
- ` ${icon} ${perm.name.padEnd(nameWidth)} ${desc}`
1412
- );
1438
+ if (info.hasPermissions) {
1439
+ printDetailedPermissions(info);
1413
1440
  }
1414
1441
  }
1415
1442
  }
@@ -3898,8 +3925,8 @@ function formatConnectorIdentity2(connector) {
3898
3925
  }
3899
3926
  function printConnectorPermissions(type, resolvedPolicies) {
3900
3927
  if (!isFirewallConnectorType(type)) return;
3901
- const policies = resolvedPolicies?.[type];
3902
- if (!policies || Object.keys(policies).length === 0) {
3928
+ const refPolicy = resolvedPolicies?.[type];
3929
+ if (!refPolicy) {
3903
3930
  console.log(source_default.dim(" full access \u2014 no permission rules configured"));
3904
3931
  return;
3905
3932
  }
@@ -3907,18 +3934,27 @@ function printConnectorPermissions(type, resolvedPolicies) {
3907
3934
  const permissions = config.apis.flatMap((a) => {
3908
3935
  return a.permissions ?? [];
3909
3936
  });
3910
- if (permissions.length === 0) return;
3937
+ if (permissions.length === 0 && Object.keys(refPolicy.policies).length === 0) {
3938
+ const unknownIcon2 = policyIcon(refPolicy.unknownPolicy ?? "allow");
3939
+ console.log(` ${unknownIcon2} unknown endpoints`);
3940
+ return;
3941
+ }
3911
3942
  const nameWidth = Math.max(
3943
+ "unknown endpoints".length,
3912
3944
  ...permissions.map((p) => {
3913
3945
  return p.name.length;
3914
3946
  })
3915
3947
  );
3916
3948
  for (const perm of permissions) {
3917
- const policy = policies[perm.name] ?? "deny";
3918
- const icon = policy === "allow" ? source_default.green("\u2713") : policy === "ask" ? source_default.yellow("?") : source_default.dim("\u2717");
3949
+ const policy = refPolicy.policies[perm.name] ?? "deny";
3950
+ const icon = policyIcon(policy);
3919
3951
  const desc = perm.description ?? "";
3920
3952
  console.log(` ${icon} ${perm.name.padEnd(nameWidth)} ${desc}`);
3921
3953
  }
3954
+ const unknownIcon = policyIcon(refPolicy.unknownPolicy ?? "allow");
3955
+ console.log(
3956
+ ` ${unknownIcon} ${"unknown endpoints".padEnd(nameWidth)} Endpoints not matching any rule`
3957
+ );
3922
3958
  }
3923
3959
  async function showSandboxInfo(showPermissions) {
3924
3960
  const agentId = process.env.ZERO_AGENT_ID;
@@ -5946,7 +5982,7 @@ function registerZeroCommands(prog, commands) {
5946
5982
  var program = new Command();
5947
5983
  program.name("zero").description(
5948
5984
  "Zero CLI \u2014 interact with the zero platform from inside the sandbox"
5949
- ).version("9.111.1").addHelpText(
5985
+ ).version("9.111.3").addHelpText(
5950
5986
  "after",
5951
5987
  `
5952
5988
  Examples: