@vm0/cli 9.177.7 → 9.177.9

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
@@ -67,7 +67,7 @@ import {
67
67
  source_default,
68
68
  volumeConfigSchema,
69
69
  withErrorHandler
70
- } from "./chunk-PTDOPOBD.js";
70
+ } from "./chunk-HA7ZZ2L6.js";
71
71
  import {
72
72
  __toESM,
73
73
  init_esm_shims
@@ -400,7 +400,7 @@ function getConfigPath() {
400
400
  return join(os.homedir(), ".vm0", "config.json");
401
401
  }
402
402
  var infoCommand = new Command().name("info").description("Display environment and debug information").action(async () => {
403
- console.log(source_default.bold(`VM0 CLI v${"9.177.7"}`));
403
+ console.log(source_default.bold(`VM0 CLI v${"9.177.9"}`));
404
404
  console.log();
405
405
  const config = await loadConfig();
406
406
  const hasEnvToken = !!process.env.VM0_TOKEN;
@@ -4293,7 +4293,7 @@ var composeCommand = new Command().name("compose").description("Create or update
4293
4293
  options.autoUpdate = false;
4294
4294
  }
4295
4295
  if (options.autoUpdate !== false) {
4296
- await startSilentUpgrade("9.177.7");
4296
+ await startSilentUpgrade("9.177.9");
4297
4297
  }
4298
4298
  try {
4299
4299
  let result;
@@ -4395,7 +4395,7 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
4395
4395
  withErrorHandler(
4396
4396
  async (identifier, prompt, options) => {
4397
4397
  if (options.autoUpdate !== false) {
4398
- await startSilentUpgrade("9.177.7");
4398
+ await startSilentUpgrade("9.177.9");
4399
4399
  }
4400
4400
  const { name, version } = parseIdentifier(identifier);
4401
4401
  let composeId;
@@ -6189,13 +6189,13 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
6189
6189
  if (latestVersion === null) {
6190
6190
  throw new Error("Could not check for updates. Please try again later.");
6191
6191
  }
6192
- if (latestVersion === "9.177.7") {
6193
- console.log(source_default.green(`\u2713 Already up to date (${"9.177.7"})`));
6192
+ if (latestVersion === "9.177.9") {
6193
+ console.log(source_default.green(`\u2713 Already up to date (${"9.177.9"})`));
6194
6194
  return;
6195
6195
  }
6196
6196
  console.log(
6197
6197
  source_default.yellow(
6198
- `Current version: ${"9.177.7"} -> Latest version: ${latestVersion}`
6198
+ `Current version: ${"9.177.9"} -> Latest version: ${latestVersion}`
6199
6199
  )
6200
6200
  );
6201
6201
  console.log();
@@ -6222,7 +6222,7 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
6222
6222
  const success = await performUpgrade(packageManager);
6223
6223
  if (success) {
6224
6224
  console.log(
6225
- source_default.green(`\u2713 Upgraded from ${"9.177.7"} to ${latestVersion}`)
6225
+ source_default.green(`\u2713 Upgraded from ${"9.177.9"} to ${latestVersion}`)
6226
6226
  );
6227
6227
  return;
6228
6228
  }
@@ -6289,7 +6289,7 @@ var whoamiCommand = new Command().name("whoami").description("Show current ident
6289
6289
 
6290
6290
  // src/index.ts
6291
6291
  var program = new Command();
6292
- program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.177.7");
6292
+ program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.177.9");
6293
6293
  program.addCommand(authCommand);
6294
6294
  program.addCommand(infoCommand);
6295
6295
  program.addCommand(composeCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "9.177.7",
3
+ "version": "9.177.9",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",
package/zero.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  completeSlackFileUpload,
19
19
  completeTelegramFileUpload,
20
20
  configureGlobalProxyFromEnv,
21
- connectZeroConnectorApiToken,
21
+ connectZeroConnectorManualGrant,
22
22
  connectorTypeSchema,
23
23
  createComputerUseReadCommand,
24
24
  createComputerUseWriteCommand,
@@ -56,6 +56,8 @@ import {
56
56
  getApiUrl,
57
57
  getAuthMethodsForType,
58
58
  getComputerUseCommand,
59
+ getConfiguredConnectorAuthMethods,
60
+ getConnectorAuthMethod,
59
61
  getConnectorAuthMethodScopeDiff,
60
62
  getConnectorEnvBindings,
61
63
  getConnectorEnvNamesForSecret,
@@ -144,7 +146,7 @@ import {
144
146
  upsertZeroOrgModelProvider,
145
147
  withErrorHandler,
146
148
  zeroAgentCustomSkillNameSchema
147
- } from "./chunk-PTDOPOBD.js";
149
+ } from "./chunk-HA7ZZ2L6.js";
148
150
  import {
149
151
  __toESM,
150
152
  init_esm_shims
@@ -1734,7 +1736,51 @@ function parseConnectorType(type) {
1734
1736
  cause: new Error(`Available connectors: ${CONNECTOR_TYPE_KEYS.join(", ")}`)
1735
1737
  });
1736
1738
  }
1737
- var connectCommand = new Command().name("connect").description("Connect a connector with API-token credentials").argument("<type>", "Connector type (e.g., zendesk)").option(
1739
+ function parseConfiguredAuthMethod(type, rawAuthMethod) {
1740
+ const configuredAuthMethods = getConfiguredConnectorAuthMethods(type);
1741
+ const authMethod = configuredAuthMethods.find((method) => {
1742
+ return method === rawAuthMethod;
1743
+ });
1744
+ if (authMethod) {
1745
+ return authMethod;
1746
+ }
1747
+ throw new Error(
1748
+ `${type} connector does not have ${rawAuthMethod} auth method`,
1749
+ {
1750
+ cause: new Error(
1751
+ `Available auth methods: ${configuredAuthMethods.join(", ")}`
1752
+ )
1753
+ }
1754
+ );
1755
+ }
1756
+ function getManualGrantAuthMethods(type) {
1757
+ return getConfiguredConnectorAuthMethods(type).filter((authMethod) => {
1758
+ return getConnectorAuthMethod(type, authMethod)?.grant.kind === "manual";
1759
+ });
1760
+ }
1761
+ function parseManualGrantAuthMethod(type, rawAuthMethod) {
1762
+ if (rawAuthMethod) {
1763
+ const authMethod2 = parseConfiguredAuthMethod(type, rawAuthMethod);
1764
+ if (getConnectorAuthMethod(type, authMethod2)?.grant.kind === "manual") {
1765
+ return authMethod2;
1766
+ }
1767
+ throw new Error(
1768
+ `${type} ${authMethod2} auth method does not use a manual grant`
1769
+ );
1770
+ }
1771
+ const authMethods = getManualGrantAuthMethods(type);
1772
+ const authMethod = authMethods[0];
1773
+ if (authMethods.length === 1 && authMethod) {
1774
+ return authMethod;
1775
+ }
1776
+ if (authMethods.length === 0) {
1777
+ throw new Error(`${type} connector does not use a manual grant`);
1778
+ }
1779
+ throw new Error(`${type} connector has multiple manual grant auth methods`, {
1780
+ cause: new Error(`Pass --auth-method ${authMethods.join("|")}`)
1781
+ });
1782
+ }
1783
+ var connectCommand = new Command().name("connect").description("Connect a connector with manual grant values").argument("<type>", "Connector type (e.g., zendesk)").option("--auth-method <method>", "Connector auth method to use").option(
1738
1784
  "--value <name=value>",
1739
1785
  "Connector field value; repeat for multiple fields",
1740
1786
  collectValue,
@@ -1742,8 +1788,13 @@ var connectCommand = new Command().name("connect").description("Connect a connec
1742
1788
  ).option("--json", "Print the connector response as JSON").action(
1743
1789
  withErrorHandler(async (type, options) => {
1744
1790
  const connectorType = parseConnectorType(type);
1745
- const connector = await connectZeroConnectorApiToken(
1791
+ const authMethod = parseManualGrantAuthMethod(
1746
1792
  connectorType,
1793
+ options.authMethod
1794
+ );
1795
+ const connector = await connectZeroConnectorManualGrant(
1796
+ connectorType,
1797
+ authMethod,
1747
1798
  parseConnectorValues(options.value)
1748
1799
  );
1749
1800
  if (options.json) {
@@ -13138,7 +13189,7 @@ function registerZeroCommands(prog, commands) {
13138
13189
  var program = new Command();
13139
13190
  program.name("zero").description(
13140
13191
  "Zero CLI \u2014 interact with the zero platform from inside the sandbox"
13141
- ).version("9.177.7").addHelpText("after", () => {
13192
+ ).version("9.177.9").addHelpText("after", () => {
13142
13193
  return buildZeroHelpText();
13143
13194
  });
13144
13195
  if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {