@vm0/cli 9.87.1 → 9.89.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
@@ -60,7 +60,7 @@ import {
60
60
  showNextSteps,
61
61
  volumeConfigSchema,
62
62
  withErrorHandler
63
- } from "./chunk-QAFCEPXB.js";
63
+ } from "./chunk-AM6X5N5J.js";
64
64
 
65
65
  // src/index.ts
66
66
  import { Command as Command44 } from "commander";
@@ -445,7 +445,7 @@ function getConfigPath() {
445
445
  return join(homedir(), ".vm0", "config.json");
446
446
  }
447
447
  var infoCommand = new Command6().name("info").description("Display environment and debug information").action(async () => {
448
- console.log(chalk3.bold(`VM0 CLI v${"9.87.1"}`));
448
+ console.log(chalk3.bold(`VM0 CLI v${"9.89.0"}`));
449
449
  console.log();
450
450
  const config = await loadConfig();
451
451
  const hasEnvToken = !!process.env.VM0_TOKEN;
@@ -1548,7 +1548,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
1548
1548
  options.autoUpdate = false;
1549
1549
  }
1550
1550
  if (options.autoUpdate !== false) {
1551
- await startSilentUpgrade("9.87.1");
1551
+ await startSilentUpgrade("9.89.0");
1552
1552
  }
1553
1553
  try {
1554
1554
  let result;
@@ -1625,7 +1625,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
1625
1625
  withErrorHandler(
1626
1626
  async (identifier, prompt, options) => {
1627
1627
  if (options.autoUpdate !== false) {
1628
- await startSilentUpgrade("9.87.1");
1628
+ await startSilentUpgrade("9.89.0");
1629
1629
  }
1630
1630
  const { org, name, version } = parseIdentifier(identifier);
1631
1631
  let composeId;
@@ -3394,7 +3394,7 @@ var cookAction = new Command35().name("cook").description("Quick start: prepare,
3394
3394
  withErrorHandler(
3395
3395
  async (prompt, options) => {
3396
3396
  if (options.autoUpdate !== false) {
3397
- const shouldExit = await checkAndUpgrade("9.87.1", prompt);
3397
+ const shouldExit = await checkAndUpgrade("9.89.0", prompt);
3398
3398
  if (shouldExit) {
3399
3399
  process.exit(0);
3400
3400
  }
@@ -4134,13 +4134,13 @@ var upgradeCommand = new Command42().name("upgrade").description("Upgrade vm0 CL
4134
4134
  if (latestVersion === null) {
4135
4135
  throw new Error("Could not check for updates. Please try again later.");
4136
4136
  }
4137
- if (latestVersion === "9.87.1") {
4138
- console.log(chalk33.green(`\u2713 Already up to date (${"9.87.1"})`));
4137
+ if (latestVersion === "9.89.0") {
4138
+ console.log(chalk33.green(`\u2713 Already up to date (${"9.89.0"})`));
4139
4139
  return;
4140
4140
  }
4141
4141
  console.log(
4142
4142
  chalk33.yellow(
4143
- `Current version: ${"9.87.1"} -> Latest version: ${latestVersion}`
4143
+ `Current version: ${"9.89.0"} -> Latest version: ${latestVersion}`
4144
4144
  )
4145
4145
  );
4146
4146
  console.log();
@@ -4167,7 +4167,7 @@ var upgradeCommand = new Command42().name("upgrade").description("Upgrade vm0 CL
4167
4167
  const success = await performUpgrade(packageManager);
4168
4168
  if (success) {
4169
4169
  console.log(
4170
- chalk33.green(`\u2713 Upgraded from ${"9.87.1"} to ${latestVersion}`)
4170
+ chalk33.green(`\u2713 Upgraded from ${"9.89.0"} to ${latestVersion}`)
4171
4171
  );
4172
4172
  return;
4173
4173
  }
@@ -4235,7 +4235,7 @@ var whoamiCommand = new Command43().name("whoami").description("Show current ide
4235
4235
 
4236
4236
  // src/index.ts
4237
4237
  var program = new Command44();
4238
- program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.87.1");
4238
+ program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.89.0");
4239
4239
  program.addCommand(authCommand);
4240
4240
  program.addCommand(infoCommand);
4241
4241
  program.addCommand(composeCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "9.87.1",
3
+ "version": "9.89.0",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",
package/zero.js CHANGED
@@ -42,6 +42,7 @@ import {
42
42
  getToken,
43
43
  getZeroAgent,
44
44
  getZeroAgentInstructions,
45
+ getZeroAgentUserConnectors,
45
46
  getZeroConnector,
46
47
  getZeroConnectorSession,
47
48
  getZeroOrg,
@@ -78,6 +79,7 @@ import {
78
79
  resolveZeroScheduleByAgent,
79
80
  saveConfig,
80
81
  sendSlackMessage,
82
+ setZeroAgentUserConnectors,
81
83
  setZeroOrgModelProviderDefault,
82
84
  setZeroOrgSecret,
83
85
  setZeroOrgVariable,
@@ -91,7 +93,7 @@ import {
91
93
  updateZeroUserPreferences,
92
94
  upsertZeroOrgModelProvider,
93
95
  withErrorHandler
94
- } from "./chunk-QAFCEPXB.js";
96
+ } from "./chunk-AM6X5N5J.js";
95
97
 
96
98
  // src/zero.ts
97
99
  import { Command as Command61 } from "commander";
@@ -1068,9 +1070,12 @@ import { Command as Command29 } from "commander";
1068
1070
  import { Command as Command24 } from "commander";
1069
1071
  import { readFileSync } from "fs";
1070
1072
  import chalk21 from "chalk";
1071
- var createCommand = new Command24().name("create").description("Create a new zero agent").requiredOption(
1073
+ var createCommand = new Command24().name("create").description("Create a new zero agent").option(
1072
1074
  "--connectors <items>",
1073
- "Comma-separated connector short names (e.g. github,linear)"
1075
+ "Comma-separated connector types to enable for this agent (e.g. github,linear)"
1076
+ ).option(
1077
+ "--skills <items>",
1078
+ "Comma-separated custom skill names to attach (e.g. my-skill,other-skill)"
1074
1079
  ).option("--display-name <name>", "Agent display name").option("--description <text>", "Agent description").option(
1075
1080
  "--sound <tone>",
1076
1081
  "Agent tone: professional, friendly, direct, supportive"
@@ -1078,26 +1083,36 @@ var createCommand = new Command24().name("create").description("Create a new zer
1078
1083
  "after",
1079
1084
  `
1080
1085
  Examples:
1081
- Minimal: zero agent create --connectors github
1082
- With display name: zero agent create --connectors github,linear --display-name "My Agent"
1086
+ Minimal: zero agent create --display-name "My Agent"
1087
+ With connectors: zero agent create --connectors github,linear --display-name "My Agent"
1088
+ With skills: zero agent create --skills my-skill,other-skill --display-name "My Agent"
1083
1089
  With instructions: zero agent create --connectors github --instructions-file ./instructions.md`
1084
1090
  ).action(
1085
1091
  withErrorHandler(
1086
1092
  async (options) => {
1087
- const connectors = options.connectors.split(",").map((s) => s.trim());
1093
+ const customSkills = options.skills ? options.skills.split(",").map((s) => s.trim()) : void 0;
1088
1094
  const agent = await createZeroAgent({
1089
- connectors,
1090
1095
  displayName: options.displayName,
1091
1096
  description: options.description,
1092
- sound: options.sound
1097
+ sound: options.sound,
1098
+ customSkills
1093
1099
  });
1100
+ if (options.connectors) {
1101
+ const connectors = options.connectors.split(",").map((s) => s.trim());
1102
+ await setZeroAgentUserConnectors(agent.agentId, connectors);
1103
+ }
1094
1104
  if (options.instructionsFile) {
1095
1105
  const content = readFileSync(options.instructionsFile, "utf-8");
1096
1106
  await updateZeroAgentInstructions(agent.agentId, content);
1097
1107
  }
1098
1108
  console.log(chalk21.green(`\u2713 Agent "${agent.agentId}" created`));
1099
1109
  console.log(` Agent ID: ${agent.agentId}`);
1100
- console.log(` Connectors: ${agent.connectors.join(", ")}`);
1110
+ if (options.connectors) {
1111
+ console.log(` Connectors: ${options.connectors}`);
1112
+ }
1113
+ if (customSkills?.length) {
1114
+ console.log(` Skills: ${customSkills.join(", ")}`);
1115
+ }
1101
1116
  if (agent.displayName) {
1102
1117
  console.log(` Display Name: ${agent.displayName}`);
1103
1118
  }
@@ -1109,18 +1124,19 @@ Examples:
1109
1124
  import { Command as Command25 } from "commander";
1110
1125
  import { readFileSync as readFileSync2 } from "fs";
1111
1126
  import chalk22 from "chalk";
1112
- var editCommand = new Command25().name("edit").description("Edit a zero agent").argument("<agent-id>", "Agent ID").option(
1113
- "--connectors <items>",
1114
- "Comma-separated connector short names (e.g. github,linear)"
1115
- ).option("--display-name <name>", "New display name").option("--description <text>", "New description").option(
1127
+ var editCommand = new Command25().name("edit").description("Edit a zero agent").argument("<agent-id>", "Agent ID").option("--display-name <name>", "New display name").option("--description <text>", "New description").option(
1116
1128
  "--sound <tone>",
1117
1129
  "New tone: professional, friendly, direct, supportive"
1130
+ ).option(
1131
+ "--skills <items>",
1132
+ "Comma-separated custom skill names to attach (replaces existing)"
1118
1133
  ).option("--instructions-file <path>", "Path to new instructions file").addHelpText(
1119
1134
  "after",
1120
1135
  `
1121
1136
  Examples:
1122
1137
  Update description: zero agent edit <agent-id> --description "new role"
1123
1138
  Update tone: zero agent edit <agent-id> --sound friendly
1139
+ Update skills: zero agent edit <agent-id> --skills my-skill,other-skill
1124
1140
  Update instructions: zero agent edit <agent-id> --instructions-file ./instructions.md
1125
1141
  Update yourself: zero agent edit $ZERO_AGENT_ID --description "new role"
1126
1142
 
@@ -1130,20 +1146,20 @@ Notes:
1130
1146
  ).action(
1131
1147
  withErrorHandler(
1132
1148
  async (agentId, options) => {
1133
- const hasAgentUpdate = options.connectors !== void 0 || options.displayName !== void 0 || options.description !== void 0 || options.sound !== void 0;
1149
+ const hasAgentUpdate = options.displayName !== void 0 || options.description !== void 0 || options.sound !== void 0 || options.skills !== void 0;
1134
1150
  if (!hasAgentUpdate && !options.instructionsFile) {
1135
1151
  throw new Error(
1136
- "At least one option is required (--connectors, --display-name, --description, --sound, --instructions-file)"
1152
+ "At least one option is required (--display-name, --description, --sound, --skills, --instructions-file)"
1137
1153
  );
1138
1154
  }
1139
1155
  if (hasAgentUpdate) {
1140
1156
  const current = await getZeroAgent(agentId);
1141
- const connectors = options.connectors ? options.connectors.split(",").map((s) => s.trim()) : current.connectors;
1157
+ const customSkills = options.skills ? options.skills.split(",").map((s) => s.trim()) : void 0;
1142
1158
  await updateZeroAgent(agentId, {
1143
- connectors,
1144
1159
  displayName: options.displayName !== void 0 ? options.displayName : current.displayName ?? void 0,
1145
1160
  description: options.description !== void 0 ? options.description : current.description ?? void 0,
1146
- sound: options.sound !== void 0 ? options.sound : current.sound ?? void 0
1161
+ sound: options.sound !== void 0 ? options.sound : current.sound ?? void 0,
1162
+ customSkills
1147
1163
  });
1148
1164
  }
1149
1165
  if (options.instructionsFile) {
@@ -1173,7 +1189,9 @@ Examples:
1173
1189
  if (agent.displayName) console.log(chalk23.dim(agent.displayName));
1174
1190
  console.log();
1175
1191
  console.log(`Agent ID: ${agent.agentId}`);
1176
- console.log(`Connectors: ${agent.connectors.join(", ") || "-"}`);
1192
+ const connectors = await getZeroAgentUserConnectors(agentId);
1193
+ if (connectors.length > 0)
1194
+ console.log(`Connectors: ${connectors.join(", ")}`);
1177
1195
  if (agent.description)
1178
1196
  console.log(`Description: ${agent.description}`);
1179
1197
  if (agent.sound) console.log(`Sound: ${agent.sound}`);
@@ -1209,7 +1227,7 @@ Notes:
1209
1227
  console.log(chalk24.dim("No zero agents found"));
1210
1228
  console.log(
1211
1229
  chalk24.dim(
1212
- ' Create one with: zero agent create --connectors github --display-name "My Agent"'
1230
+ ' Create one with: zero agent create --display-name "My Agent"'
1213
1231
  )
1214
1232
  );
1215
1233
  return;
@@ -1221,15 +1239,13 @@ Notes:
1221
1239
  );
1222
1240
  const header = [
1223
1241
  "AGENT ID".padEnd(idWidth),
1224
- "DISPLAY NAME".padEnd(displayWidth),
1225
- "CONNECTORS"
1242
+ "DISPLAY NAME".padEnd(displayWidth)
1226
1243
  ].join(" ");
1227
1244
  console.log(chalk24.dim(header));
1228
1245
  for (const agent of agents) {
1229
1246
  const row = [
1230
1247
  agent.agentId.padEnd(idWidth),
1231
- (agent.displayName ?? "-").padEnd(displayWidth),
1232
- agent.connectors.join(", ") || "-"
1248
+ (agent.displayName ?? "-").padEnd(displayWidth)
1233
1249
  ].join(" ");
1234
1250
  console.log(row);
1235
1251
  }
@@ -1892,6 +1908,19 @@ import { Command as Command36 } from "commander";
1892
1908
 
1893
1909
  // src/commands/zero/doctor/missing-token.ts
1894
1910
  import { Command as Command35 } from "commander";
1911
+ function toPlatformUrl(apiUrl) {
1912
+ const parsed = new URL(apiUrl);
1913
+ const parts = parsed.hostname.split(".");
1914
+ if (parts[0].endsWith("-www")) {
1915
+ parts[0] = parts[0].slice(0, -"-www".length) + "-app";
1916
+ } else if (parts[0] === "www" || parts[0] === "platform") {
1917
+ parts[0] = "app";
1918
+ } else if (parts[0] !== "app" && parts[0] !== "localhost") {
1919
+ parts.unshift("app");
1920
+ }
1921
+ parsed.hostname = parts.join(".");
1922
+ return parsed;
1923
+ }
1895
1924
  var missingTokenCommand = new Command35().name("missing-token").description(
1896
1925
  "Diagnose a missing token and find the connector that provides it"
1897
1926
  ).argument("<token-name>", "The environment variable / token name to look up").addHelpText(
@@ -1915,19 +1944,32 @@ Notes:
1915
1944
  }
1916
1945
  const { label } = CONNECTOR_TYPES[connectorType];
1917
1946
  const apiUrl = await getApiUrl();
1918
- const parsed = new URL(apiUrl);
1919
- const parts = parsed.hostname.split(".");
1920
- if (parts[0] === "www" || parts[0] === "platform") {
1921
- parts[0] = "app";
1922
- } else if (parts[0] !== "app" && parts[0] !== "localhost") {
1923
- parts.unshift("app");
1924
- }
1925
- parsed.hostname = parts.join(".");
1947
+ const platformUrl = toPlatformUrl(apiUrl);
1926
1948
  const agentId = process.env.ZERO_AGENT_ID;
1927
- const path = agentId ? `/team/${agentId}` : "/team";
1928
- const url = `${parsed.origin}${path}?tab=connectors`;
1949
+ const [connector, enabledTypes] = await Promise.all([
1950
+ getZeroConnector(connectorType).catch(() => null),
1951
+ agentId ? getZeroAgentUserConnectors(agentId).catch(() => null) : Promise.resolve(null)
1952
+ ]);
1953
+ const isConnected = connector !== null;
1954
+ const hasPermission = enabledTypes !== null && enabledTypes.includes(connectorType);
1929
1955
  console.log(`${tokenName} is provided by the ${label} connector.`);
1930
- console.log(`Ask the user to connect it at: ${url}`);
1956
+ if (!isConnected) {
1957
+ const url = `${platformUrl.origin}/connectors`;
1958
+ console.log(
1959
+ `The ${label} connector is not connected. Ask the user to connect it at: ${url}`
1960
+ );
1961
+ } else if (!hasPermission) {
1962
+ const path = agentId ? `/team/${agentId}` : "/team";
1963
+ const url = `${platformUrl.origin}${path}?tab=authorization`;
1964
+ console.log(
1965
+ `The ${label} connector is connected but not authorized for this agent. Ask the user to enable it at: ${url}`
1966
+ );
1967
+ } else {
1968
+ const url = `${platformUrl.origin}/connectors`;
1969
+ console.log(
1970
+ `The ${label} connector is connected and authorized, but the token is still missing. Ask the user to check the connector status at: ${url}`
1971
+ );
1972
+ }
1931
1973
  })
1932
1974
  );
1933
1975
 
@@ -2685,7 +2727,8 @@ Examples:
2685
2727
  Notes:
2686
2728
  - Re-running setup with the same agent updates the existing "default" schedule
2687
2729
  - Use -n to manage multiple named schedules for the same agent
2688
- - All flags are required in non-interactive mode; interactive mode prompts for missing values`
2730
+ - All flags are required in non-interactive mode; interactive mode prompts for missing values
2731
+ - When --notify-slack is enabled, run results are automatically posted to the Slack channel specified by --notify-slack-channel-id (or as a DM if not set). No need to include Slack delivery instructions in your prompt.`
2689
2732
  ).action(
2690
2733
  withErrorHandler(async (agentIdentifier, options) => {
2691
2734
  const compose = await resolveCompose(agentIdentifier);
@@ -3005,15 +3048,12 @@ var zeroScheduleCommand = new Command46().name("schedule").description("Create o
3005
3048
  "after",
3006
3049
  `
3007
3050
  Examples:
3008
- Create a daily schedule: zero schedule setup <agent-id> -f daily -t 09:00 -p "run report"
3009
- Create a loop schedule: zero schedule setup <agent-id> -f loop -i 300 -p "poll for updates"
3010
- Check all schedules: zero schedule list
3011
- Pause a schedule: zero schedule disable <agent-id>
3012
- Resume a schedule: zero schedule enable <agent-id>
3013
-
3014
- Notes:
3015
- - setup is idempotent \u2014 re-running it with the same agent updates the existing schedule
3016
- - Schedules are created disabled by default; use --enable or enable separately`
3051
+ Create a schedule: zero schedule setup --help
3052
+ Check all schedules: zero schedule list
3053
+ Check schedule status: zero schedule status <agent-id>
3054
+ Pause a schedule: zero schedule disable <agent-id>
3055
+ Resume a schedule: zero schedule enable <agent-id>
3056
+ Delete a schedule: zero schedule delete <agent-id>`
3017
3057
  );
3018
3058
 
3019
3059
  // src/commands/zero/secret/index.ts
@@ -3523,14 +3563,14 @@ function registerZeroCommands(prog, commands) {
3523
3563
  var program = new Command61();
3524
3564
  program.name("zero").description(
3525
3565
  "Zero CLI \u2014 interact with the zero platform from inside the sandbox"
3526
- ).version("9.87.1").addHelpText(
3566
+ ).version("9.89.0").addHelpText(
3527
3567
  "after",
3528
3568
  `
3529
3569
  Examples:
3530
3570
  Missing a token? zero doctor missing-token <TOKEN_NAME>
3531
- Delegate to teammate? zero run <agent-id> "your task"
3532
- Send a Slack message? zero slack message send -c <channel> -t "text"
3533
- Set up a schedule? zero schedule setup <agent-id>
3571
+ Delegate to teammate? zero run --help
3572
+ Send a Slack message? zero slack message send --help
3573
+ Set up a schedule? zero schedule setup --help
3534
3574
  Update yourself? zero agent --help
3535
3575
  Check your identity? zero whoami`
3536
3576
  );