@vm0/cli 9.142.0 → 9.142.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.
package/index.js CHANGED
@@ -65,7 +65,7 @@ import {
65
65
  source_default,
66
66
  volumeConfigSchema,
67
67
  withErrorHandler
68
- } from "./chunk-OD6W3UMZ.js";
68
+ } from "./chunk-MB6EHK2G.js";
69
69
  import {
70
70
  __toESM,
71
71
  init_esm_shims
@@ -398,7 +398,7 @@ function getConfigPath() {
398
398
  return join(homedir(), ".vm0", "config.json");
399
399
  }
400
400
  var infoCommand = new Command().name("info").description("Display environment and debug information").action(async () => {
401
- console.log(source_default.bold(`VM0 CLI v${"9.142.0"}`));
401
+ console.log(source_default.bold(`VM0 CLI v${"9.142.1"}`));
402
402
  console.log();
403
403
  const config = await loadConfig();
404
404
  const hasEnvToken = !!process.env.VM0_TOKEN;
@@ -4291,7 +4291,7 @@ var composeCommand = new Command().name("compose").description("Create or update
4291
4291
  options.autoUpdate = false;
4292
4292
  }
4293
4293
  if (options.autoUpdate !== false) {
4294
- await startSilentUpgrade("9.142.0");
4294
+ await startSilentUpgrade("9.142.1");
4295
4295
  }
4296
4296
  try {
4297
4297
  let result;
@@ -4383,7 +4383,7 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
4383
4383
  withErrorHandler(
4384
4384
  async (identifier, prompt, options) => {
4385
4385
  if (options.autoUpdate !== false) {
4386
- await startSilentUpgrade("9.142.0");
4386
+ await startSilentUpgrade("9.142.1");
4387
4387
  }
4388
4388
  const { name, version } = parseIdentifier(identifier);
4389
4389
  let composeId;
@@ -6170,13 +6170,13 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
6170
6170
  if (latestVersion === null) {
6171
6171
  throw new Error("Could not check for updates. Please try again later.");
6172
6172
  }
6173
- if (latestVersion === "9.142.0") {
6174
- console.log(source_default.green(`\u2713 Already up to date (${"9.142.0"})`));
6173
+ if (latestVersion === "9.142.1") {
6174
+ console.log(source_default.green(`\u2713 Already up to date (${"9.142.1"})`));
6175
6175
  return;
6176
6176
  }
6177
6177
  console.log(
6178
6178
  source_default.yellow(
6179
- `Current version: ${"9.142.0"} -> Latest version: ${latestVersion}`
6179
+ `Current version: ${"9.142.1"} -> Latest version: ${latestVersion}`
6180
6180
  )
6181
6181
  );
6182
6182
  console.log();
@@ -6203,7 +6203,7 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
6203
6203
  const success = await performUpgrade(packageManager);
6204
6204
  if (success) {
6205
6205
  console.log(
6206
- source_default.green(`\u2713 Upgraded from ${"9.142.0"} to ${latestVersion}`)
6206
+ source_default.green(`\u2713 Upgraded from ${"9.142.1"} to ${latestVersion}`)
6207
6207
  );
6208
6208
  return;
6209
6209
  }
@@ -6270,7 +6270,7 @@ var whoamiCommand = new Command().name("whoami").description("Show current ident
6270
6270
 
6271
6271
  // src/index.ts
6272
6272
  var program = new Command();
6273
- program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.142.0");
6273
+ program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.142.1");
6274
6274
  program.addCommand(authCommand);
6275
6275
  program.addCommand(infoCommand);
6276
6276
  program.addCommand(composeCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "9.142.0",
3
+ "version": "9.142.1",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",
package/zero.js CHANGED
@@ -127,7 +127,7 @@ import {
127
127
  upsertZeroOrgModelProvider,
128
128
  withErrorHandler,
129
129
  zeroAgentCustomSkillNameSchema
130
- } from "./chunk-OD6W3UMZ.js";
130
+ } from "./chunk-MB6EHK2G.js";
131
131
  import {
132
132
  __toESM,
133
133
  init_esm_shims
@@ -2192,6 +2192,18 @@ async function getPlatformOrigin() {
2192
2192
 
2193
2193
  // src/commands/zero/connector/status.ts
2194
2194
  var LABEL_WIDTH = 16;
2195
+ function getDoctorCommand(type) {
2196
+ const [envName] = Object.keys(getConnectorEnvironmentMapping(type));
2197
+ return envName ? `zero doctor check-connector --env-name ${envName}` : null;
2198
+ }
2199
+ function printDoctorHint(type) {
2200
+ const command = getDoctorCommand(type);
2201
+ if (command) {
2202
+ console.log(`Diagnose it with: ${command}`);
2203
+ } else {
2204
+ console.log("Having trouble? Run: zero doctor --help");
2205
+ }
2206
+ }
2195
2207
  var statusCommand2 = new Command().name("status").description("Show detailed status of a connector").argument("<type>", "Connector type (e.g., github)").option("--agent <id>", "Show authorization state for the given agent").action(
2196
2208
  withErrorHandler(async (type, options) => {
2197
2209
  const parseResult = connectorTypeSchema.safeParse(type);
@@ -2256,7 +2268,15 @@ var statusCommand2 = new Command().name("status").description("Show detailed sta
2256
2268
  const isConnected = connector !== null;
2257
2269
  const agentLabel = agentCtx.displayName === agentCtx.agentId ? agentCtx.agentId : `${agentCtx.displayName} (${agentCtx.agentId})`;
2258
2270
  console.log();
2259
- if (authorized) {
2271
+ if (authorized && !isConnected) {
2272
+ const origin = await getPlatformOrigin();
2273
+ const url = `${origin}/connectors/${parseResult.data}/connect?agentId=${agentCtx.agentId}`;
2274
+ console.log(
2275
+ `The ${parseResult.data} connector is authorized for agent ${agentLabel}, but it is not connected.`
2276
+ );
2277
+ console.log(`Connect it at: [Connect ${parseResult.data}](${url})`);
2278
+ printDoctorHint(parseResult.data);
2279
+ } else if (authorized) {
2260
2280
  console.log(
2261
2281
  `The ${parseResult.data} connector is authorized for agent ${agentLabel}.`
2262
2282
  );
@@ -2267,6 +2287,7 @@ var statusCommand2 = new Command().name("status").description("Show detailed sta
2267
2287
  `The ${parseResult.data} connector is not connected. Once connected, it will be authorized for agent ${agentLabel}.`
2268
2288
  );
2269
2289
  console.log(`Connect it at: [Connect ${parseResult.data}](${url})`);
2290
+ printDoctorHint(parseResult.data);
2270
2291
  } else {
2271
2292
  const origin = await getPlatformOrigin();
2272
2293
  const url = `${origin}/connectors/${parseResult.data}/authorize?agentId=${agentCtx.agentId}`;
@@ -2277,6 +2298,9 @@ var statusCommand2 = new Command().name("status").description("Show detailed sta
2277
2298
  `Authorize it at: [Authorize ${parseResult.data}](${url})`
2278
2299
  );
2279
2300
  }
2301
+ } else if (!connector) {
2302
+ console.log();
2303
+ printDoctorHint(parseResult.data);
2280
2304
  }
2281
2305
  })
2282
2306
  );
@@ -2358,7 +2382,10 @@ async function checkConnectorStatus(ctx) {
2358
2382
  console.log("");
2359
2383
  if (!isConnected) {
2360
2384
  console.log(`The ${ctx.label} connector is not connected.`);
2361
- if (!ctx.agentId) {
2385
+ if (ctx.agentId && hasPermission) {
2386
+ const connectUrl = `${ctx.platformOrigin}/connectors/${ctx.connectorType}/connect?agentId=${ctx.agentId}`;
2387
+ console.log(`Connect it at: [Connect ${ctx.label}](${connectUrl})`);
2388
+ } else if (!ctx.agentId) {
2362
2389
  const connectUrl = `${ctx.platformOrigin}/connectors/${ctx.connectorType}/connect`;
2363
2390
  console.log(`Connect it at: [Connect ${ctx.label}](${connectUrl})`);
2364
2391
  }
@@ -2383,7 +2410,9 @@ async function checkConnectorStatus(ctx) {
2383
2410
  `Skipped \u2014 agent authorization can only be checked once the ${ctx.label} connector is reconnected (see 2a).`
2384
2411
  );
2385
2412
  } else if (hasPermission) {
2386
- console.log(`The ${ctx.label} connector is authorized for this agent.`);
2413
+ console.log(
2414
+ isConnected ? `The ${ctx.label} connector is authorized for this agent.` : `The ${ctx.label} connector is authorized for this agent, but it is not connected.`
2415
+ );
2387
2416
  } else {
2388
2417
  const url = `${ctx.platformOrigin}/connectors/${ctx.connectorType}/authorize?agentId=${ctx.agentId}`;
2389
2418
  console.log(
@@ -5518,7 +5547,7 @@ function formatStatus(status) {
5518
5547
  function formatTime(iso) {
5519
5548
  return new Date(iso).toISOString().replace(/\.\d{3}Z$/, "Z");
5520
5549
  }
5521
- var listCommand12 = new Command().name("list").alias("ls").description("List agent run logs").option("--agent <name>", "Filter by agent name").option(
5550
+ var listCommand12 = new Command().name("list").alias("ls").description("List agent run logs").option("--agent <id>", "Filter by Zero agent ID").option(
5522
5551
  "--status <status>",
5523
5552
  "Filter by status (queued|pending|running|completed|failed|timeout|cancelled)"
5524
5553
  ).option(
@@ -5529,7 +5558,7 @@ var listCommand12 = new Command().name("list").alias("ls").description("List age
5529
5558
  `
5530
5559
  Examples:
5531
5560
  zero logs list
5532
- zero logs list --agent my-agent
5561
+ zero logs list --agent 123e4567-e89b-12d3-a456-426614174000
5533
5562
  zero logs list --status completed --limit 10
5534
5563
  zero logs list --since 1h
5535
5564
  zero logs list --since 1d --status completed`
@@ -5703,12 +5732,12 @@ async function runLogsSearch(keyword, options) {
5703
5732
  }
5704
5733
  renderResults(response);
5705
5734
  }
5706
- var searchCommand2 = new Command().name("search").description("Search agent events across runs").argument("<keyword>", "Search keyword").option("-A, --after-context <n>", "Show n events after each match").option("-B, --before-context <n>", "Show n events before each match").option("-C, --context <n>", "Show n events before and after each match").option("--agent <name>", "Filter by agent name").option("--run <id>", "Filter by specific run ID").option("--since <time>", "Search logs since (default: 7d)").option("--limit <n>", "Maximum number of matches (default: 20)").addHelpText(
5735
+ var searchCommand2 = new Command().name("search").description("Search agent events across runs").argument("<keyword>", "Search keyword").option("-A, --after-context <n>", "Show n events after each match").option("-B, --before-context <n>", "Show n events before each match").option("-C, --context <n>", "Show n events before and after each match").option("--agent <id>", "Filter by Zero agent ID").option("--run <id>", "Filter by specific run ID").option("--since <time>", "Search logs since (default: 7d)").option("--limit <n>", "Maximum number of matches (default: 20)").addHelpText(
5707
5736
  "after",
5708
5737
  `
5709
5738
  Examples:
5710
5739
  zero logs search "error"
5711
- zero logs search "timeout" --agent my-agent -C 2
5740
+ zero logs search "timeout" --agent 123e4567-e89b-12d3-a456-426614174000 -C 2
5712
5741
  zero logs search "failed" --since 30d --limit 50`
5713
5742
  ).action(
5714
5743
  withErrorHandler(async (keyword, options) => {
@@ -5968,7 +5997,7 @@ var zeroSearchCommand = new Command().name("search").description("Search logs, c
5968
5997
  "Source to search: logs | chat | slack (pass once)",
5969
5998
  collectSource,
5970
5999
  []
5971
- ).option("--agent <name>", "Filter by agent name").option("--run <id>", "Filter by run ID").option("--since <time>", "Time window (e.g., 7d, 2h)").option("--limit <n>", "Maximum number of matches").option("-A, --after-context <n>", "Show n items after each match").option("-B, --before-context <n>", "Show n items before each match").option("-C, --context <n>", "Show n items before and after each match").addHelpText("after", SEARCH_EXPLAINER).action(
6000
+ ).option("--agent <agent>", "Filter by agent (logs use ID; chat uses name)").option("--run <id>", "Filter by run ID").option("--since <time>", "Time window (e.g., 7d, 2h)").option("--limit <n>", "Maximum number of matches").option("-A, --after-context <n>", "Show n items after each match").option("-B, --before-context <n>", "Show n items before each match").option("-C, --context <n>", "Show n items before and after each match").addHelpText("after", SEARCH_EXPLAINER).action(
5972
6001
  withErrorHandler(async (query, options) => {
5973
6002
  const sources = options.source;
5974
6003
  if (sources.length === 0) {
@@ -7273,7 +7302,7 @@ function registerZeroCommands(prog, commands) {
7273
7302
  var program = new Command();
7274
7303
  program.name("zero").description(
7275
7304
  "Zero CLI \u2014 interact with the zero platform from inside the sandbox"
7276
- ).version("9.142.0").addHelpText(
7305
+ ).version("9.142.1").addHelpText(
7277
7306
  "after",
7278
7307
  `
7279
7308
  Examples: