@vm0/cli 9.145.9 → 9.145.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "9.145.9",
3
+ "version": "9.145.11",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",
package/zero.js CHANGED
@@ -70,7 +70,6 @@ import {
70
70
  initSlackFileUpload,
71
71
  initTelegramFileUpload,
72
72
  inviteZeroOrgMember,
73
- isFeatureEnabled,
74
73
  isFirewallConnectorType,
75
74
  isInteractive,
76
75
  isUUID,
@@ -105,6 +104,7 @@ import {
105
104
  saveConfig,
106
105
  searchConnectors,
107
106
  searchZeroChat,
107
+ searchZeroConnectors,
108
108
  searchZeroLogs,
109
109
  sendChatMessage,
110
110
  sendSlackMessage,
@@ -128,7 +128,7 @@ import {
128
128
  upsertZeroOrgModelProvider,
129
129
  withErrorHandler,
130
130
  zeroAgentCustomSkillNameSchema
131
- } from "./chunk-K4JU76G2.js";
131
+ } from "./chunk-DLWFP5WP.js";
132
132
  import {
133
133
  __toESM,
134
134
  init_esm_shims
@@ -1897,11 +1897,14 @@ function padEndAnsi(s, width) {
1897
1897
  }
1898
1898
 
1899
1899
  // src/commands/zero/connector/list.ts
1900
+ function isConnectorType(type) {
1901
+ return type in CONNECTOR_TYPES;
1902
+ }
1900
1903
  var listCommand6 = new Command().name("list").alias("ls").description("List all connectors and their status").option("--agent <id>", "Show per-agent authorization column").action(
1901
1904
  withErrorHandler(async (options) => {
1902
- const [{ connectors }, orgId, agentCtx] = await Promise.all([
1905
+ const [{ connectors }, availableCatalog, agentCtx] = await Promise.all([
1903
1906
  listZeroConnectors(),
1904
- getActiveOrg(),
1907
+ searchZeroConnectors(),
1905
1908
  resolveAgentContext(options.agent)
1906
1909
  ]);
1907
1910
  const connectedMap = new Map(
@@ -1909,17 +1912,9 @@ var listCommand6 = new Command().name("list").alias("ls").description("List all
1909
1912
  return [c.type, c];
1910
1913
  })
1911
1914
  );
1912
- const allTypesRaw = Object.keys(CONNECTOR_TYPES);
1913
- const allTypes = [];
1914
- for (const type of allTypesRaw) {
1915
- const config = CONNECTOR_TYPES[type];
1916
- const flag = config.featureFlag;
1917
- const hasApiToken = "api-token" in config.authMethods;
1918
- if (flag && !isFeatureEnabled(flag, { orgId }) && (!hasApiToken || config.strictFeatureFlag)) {
1919
- continue;
1920
- }
1921
- allTypes.push(type);
1922
- }
1915
+ const allTypes = availableCatalog.connectors.map((connector) => {
1916
+ return connector.id;
1917
+ }).filter(isConnectorType);
1923
1918
  const typeWidth = Math.max(
1924
1919
  4,
1925
1920
  ...allTypes.map((t) => {
@@ -1961,6 +1956,9 @@ var listCommand6 = new Command().name("list").alias("ls").description("List all
1961
1956
  init_esm_shims();
1962
1957
  var DEFAULT_LIMIT = 5;
1963
1958
  var EXACT_MATCH_THRESHOLD = 80;
1959
+ function isConnectorType2(type) {
1960
+ return type in CONNECTOR_TYPES;
1961
+ }
1964
1962
  function parseLimit(raw) {
1965
1963
  const n = Number.parseInt(raw, 10);
1966
1964
  if (!Number.isFinite(n) || n <= 0) {
@@ -1980,9 +1978,9 @@ var searchCommand = new Command().name("search").description("Search connectors
1980
1978
  if (!trimmed) {
1981
1979
  throw new Error("Keyword cannot be empty.");
1982
1980
  }
1983
- const [{ connectors }, orgId, agentCtx] = await Promise.all([
1981
+ const [{ connectors }, availableCatalog, agentCtx] = await Promise.all([
1984
1982
  listZeroConnectors(),
1985
- getActiveOrg(),
1983
+ searchZeroConnectors(),
1986
1984
  resolveAgentContext(options.agent)
1987
1985
  ]);
1988
1986
  const connectedMap = new Map(
@@ -1990,16 +1988,17 @@ var searchCommand = new Command().name("search").description("Search connectors
1990
1988
  return [c.type, c];
1991
1989
  })
1992
1990
  );
1993
- const isTypeAvailable = (type) => {
1994
- const config = CONNECTOR_TYPES[type];
1995
- const flag = config.featureFlag;
1996
- const hasApiToken = "api-token" in config.authMethods;
1997
- return !flag || isFeatureEnabled(flag, { orgId }) || hasApiToken && !config.strictFeatureFlag;
1998
- };
1991
+ const availableTypes = new Set(
1992
+ availableCatalog.connectors.map((connector) => {
1993
+ return connector.id;
1994
+ }).filter(isConnectorType2)
1995
+ );
1999
1996
  const { results, total } = searchConnectors(
2000
1997
  trimmed,
2001
1998
  options.limit,
2002
- isTypeAvailable
1999
+ (type) => {
2000
+ return availableTypes.has(type);
2001
+ }
2003
2002
  );
2004
2003
  if (results.length === 0) {
2005
2004
  console.log("No matches found.");
@@ -2726,12 +2725,18 @@ How connectors work:
2726
2725
 
2727
2726
  // src/commands/zero/doctor/generate.ts
2728
2727
  init_esm_shims();
2729
- var BUILT_IN_GENERATION_OPTIONS = {
2728
+ var BUILT_IN_GENERATION_PROVIDERS = {
2730
2729
  image: {
2731
- description: "If the user did not explicitly request a specific connector or provider, you can use the official generation capability. Run `zero official generate image -h` for options."
2730
+ label: "Built-in",
2731
+ model: "gpt-image-2",
2732
+ command: "zero built-in generate image -h",
2733
+ reason: "available without connector setup"
2732
2734
  },
2733
2735
  voice: {
2734
- description: "If the user did not explicitly request a specific connector or provider, you can use the official generation capability. Run `zero official generate voice -h` for options."
2736
+ label: "Built-in",
2737
+ model: "gpt-4o-mini-tts",
2738
+ command: "zero built-in generate voice -h",
2739
+ reason: "available without connector setup"
2735
2740
  }
2736
2741
  };
2737
2742
  var GENERATION_TYPE_ORDER = [
@@ -2770,7 +2775,7 @@ function getAvailableGenerationTypes() {
2770
2775
  }
2771
2776
  }
2772
2777
  return GENERATION_TYPE_ORDER.filter((type) => {
2773
- return type in BUILT_IN_GENERATION_OPTIONS || available.has(getConnectorGenerationType(type));
2778
+ return type in BUILT_IN_GENERATION_PROVIDERS || available.has(getConnectorGenerationType(type));
2774
2779
  });
2775
2780
  }
2776
2781
  function parseGenerationType(value) {
@@ -2812,7 +2817,7 @@ function getAction(status, type, label, agentId, platformOrigin) {
2812
2817
  if (agentId) {
2813
2818
  return {
2814
2819
  actionLabel: `Connect and authorize ${label}`,
2815
- actionUrl: `${platformOrigin}/connectors/${type}/authorize?agentId=${agentId}`
2820
+ actionUrl: `${platformOrigin}/connectors/${type}/connect?agentId=${agentId}`
2816
2821
  };
2817
2822
  }
2818
2823
  return {
@@ -2891,12 +2896,13 @@ function renderActions(candidates) {
2891
2896
  console.log(` [${candidate.actionLabel}](${candidate.actionUrl})`);
2892
2897
  }
2893
2898
  }
2894
- function renderBuiltInOption(generationType) {
2895
- const option = BUILT_IN_GENERATION_OPTIONS[generationType];
2896
- if (!option) return;
2899
+ function renderBuiltInProvider(generationType) {
2900
+ const provider = BUILT_IN_GENERATION_PROVIDERS[generationType];
2901
+ if (!provider) return;
2897
2902
  console.log("");
2898
- console.log("Fallback option:");
2899
- console.log(` ${option.description}`);
2903
+ console.log("Built-in provider:");
2904
+ console.log(` vm0 ${provider.label} Model: ${provider.model}`);
2905
+ console.log(` Use: ${provider.command}`);
2900
2906
  }
2901
2907
  function renderText(params) {
2902
2908
  const { generationType, agentId, ready, other, showAll } = params;
@@ -2913,19 +2919,20 @@ function renderText(params) {
2913
2919
  );
2914
2920
  console.log("");
2915
2921
  }
2922
+ console.log("Connectors:");
2916
2923
  if (ready.length > 0) {
2917
2924
  renderRows(ready);
2918
2925
  } else {
2919
- console.log(`No ready ${generationType} generation connectors found.`);
2926
+ console.log(` No ready ${generationType} generation connectors found.`);
2920
2927
  }
2921
- renderBuiltInOption(generationType);
2928
+ renderBuiltInProvider(generationType);
2922
2929
  if (showAll && other.length > 0) {
2923
2930
  console.log("");
2924
2931
  console.log(`Other ${generationType} generation connectors`);
2925
2932
  console.log("");
2926
2933
  renderRows(other);
2927
2934
  }
2928
- if (ready.length === 0 || showAll) {
2935
+ if (showAll) {
2929
2936
  renderActions(other);
2930
2937
  }
2931
2938
  }
@@ -2978,7 +2985,7 @@ var generateCommand = new Command().name("generate").description("Show generatio
2978
2985
  agentId: agentId ?? null,
2979
2986
  choices: ready,
2980
2987
  otherCandidates: other,
2981
- builtInOption: BUILT_IN_GENERATION_OPTIONS[generationType] ?? null
2988
+ builtInProvider: BUILT_IN_GENERATION_PROVIDERS[generationType] ?? null
2982
2989
  },
2983
2990
  null,
2984
2991
  2
@@ -7131,13 +7138,13 @@ Examples:
7131
7138
  );
7132
7139
  var zeroComputerUseCommand = new Command().name("computer-use").description("Remote desktop control for cloud agents").addCommand(hostCommand).addCommand(clientCommand);
7133
7140
 
7134
- // src/commands/zero/official/index.ts
7141
+ // src/commands/zero/built-in/index.ts
7135
7142
  init_esm_shims();
7136
7143
 
7137
- // src/commands/zero/official/generate/index.ts
7144
+ // src/commands/zero/built-in/generate/index.ts
7138
7145
  init_esm_shims();
7139
7146
 
7140
- // src/commands/zero/official/generate/image.ts
7147
+ // src/commands/zero/built-in/generate/image.ts
7141
7148
  init_esm_shims();
7142
7149
 
7143
7150
  // src/commands/zero/shared/image-generate.ts
@@ -7208,16 +7215,16 @@ Notes:
7208
7215
  );
7209
7216
  }
7210
7217
 
7211
- // src/commands/zero/official/generate/image.ts
7218
+ // src/commands/zero/built-in/generate/image.ts
7212
7219
  var imageCommand = createImageGenerateCommand({
7213
7220
  name: "image",
7214
- usageCommand: "zero official generate image",
7215
- examples: ` Generate image: zero official generate image --prompt "A watercolor fox"
7216
- Pipe prompt: cat prompt.txt | zero official generate image
7217
- Pick size/quality: zero official generate image --prompt "A poster" --size 1024x1536 --quality high`
7221
+ usageCommand: "zero built-in generate image",
7222
+ examples: ` Generate image: zero built-in generate image --prompt "A watercolor fox"
7223
+ Pipe prompt: cat prompt.txt | zero built-in generate image
7224
+ Pick size/quality: zero built-in generate image --prompt "A poster" --size 1024x1536 --quality high`
7218
7225
  });
7219
7226
 
7220
- // src/commands/zero/official/generate/voice.ts
7227
+ // src/commands/zero/built-in/generate/voice.ts
7221
7228
  init_esm_shims();
7222
7229
 
7223
7230
  // src/commands/zero/shared/voice-generate.ts
@@ -7273,31 +7280,31 @@ Notes:
7273
7280
  );
7274
7281
  }
7275
7282
 
7276
- // src/commands/zero/official/generate/voice.ts
7283
+ // src/commands/zero/built-in/generate/voice.ts
7277
7284
  var voiceCommand = createVoiceGenerateCommand({
7278
7285
  name: "voice",
7279
- usageCommand: "zero official generate voice",
7280
- examples: ` Generate speech: zero official generate voice --text "Hello from vm0"
7281
- Pipe text: cat script.txt | zero official generate voice
7282
- Pick a voice: zero official generate voice --text "Ship it" --voice cedar`
7286
+ usageCommand: "zero built-in generate voice",
7287
+ examples: ` Generate speech: zero built-in generate voice --text "Hello from vm0"
7288
+ Pipe text: cat script.txt | zero built-in generate voice
7289
+ Pick a voice: zero built-in generate voice --text "Ship it" --voice cedar`
7283
7290
  });
7284
7291
 
7285
- // src/commands/zero/official/generate/index.ts
7286
- var generateCommand2 = new Command().name("generate").description("Generate assets with official Zero services").addCommand(imageCommand).addCommand(voiceCommand).addHelpText(
7292
+ // src/commands/zero/built-in/generate/index.ts
7293
+ var generateCommand2 = new Command().name("generate").description("Generate assets with built-in vm0 services").addCommand(imageCommand).addCommand(voiceCommand).addHelpText(
7287
7294
  "after",
7288
7295
  `
7289
7296
  Examples:
7290
- Generate image: zero official generate image --prompt "A watercolor fox"
7291
- Generate speech: zero official generate voice --text "Hello"`
7297
+ Generate image: zero built-in generate image --prompt "A watercolor fox"
7298
+ Generate speech: zero built-in generate voice --text "Hello"`
7292
7299
  );
7293
7300
 
7294
- // src/commands/zero/official/index.ts
7295
- var zeroOfficialCommand = new Command().name("official").description("Use official Zero services").addCommand(generateCommand2).addHelpText(
7301
+ // src/commands/zero/built-in/index.ts
7302
+ var zeroBuiltInCommand = new Command().name("built-in").description("Use built-in vm0 services").addCommand(generateCommand2).addHelpText(
7296
7303
  "after",
7297
7304
  `
7298
7305
  Examples:
7299
- Generate image: zero official generate image --prompt "A watercolor fox"
7300
- Generate speech: zero official generate voice --text "Hello"`
7306
+ Generate image: zero built-in generate image --prompt "A watercolor fox"
7307
+ Generate speech: zero built-in generate voice --text "Hello"`
7301
7308
  );
7302
7309
 
7303
7310
  // src/commands/zero/web/index.ts
@@ -7402,7 +7409,7 @@ var COMMAND_CAPABILITY_MAP = {
7402
7409
  whoami: null,
7403
7410
  "developer-support": null,
7404
7411
  "computer-use": "computer-use:write",
7405
- official: "file:write",
7412
+ "built-in": "file:write",
7406
7413
  web: null
7407
7414
  };
7408
7415
  var DEFAULT_COMMANDS = [
@@ -7424,7 +7431,7 @@ var DEFAULT_COMMANDS = [
7424
7431
  zeroSkillCommand,
7425
7432
  zeroDeveloperSupportCommand,
7426
7433
  zeroComputerUseCommand,
7427
- zeroOfficialCommand,
7434
+ zeroBuiltInCommand,
7428
7435
  zeroWebCommand
7429
7436
  ];
7430
7437
  function shouldHideCommand(name, payload) {
@@ -7450,7 +7457,7 @@ function registerZeroCommands(prog, commands) {
7450
7457
  var program = new Command();
7451
7458
  program.name("zero").description(
7452
7459
  "Zero CLI \u2014 interact with the zero platform from inside the sandbox"
7453
- ).version("9.145.9").addHelpText(
7460
+ ).version("9.145.11").addHelpText(
7454
7461
  "after",
7455
7462
  `
7456
7463
  Examples:
@@ -7463,8 +7470,8 @@ Examples:
7463
7470
  Set up a schedule? zero schedule setup --help
7464
7471
  Update yourself? zero agent --help
7465
7472
  Manage custom skills? zero skill --help
7466
- Generate image? zero official generate image --help
7467
- Generate voice? zero official generate voice --help
7473
+ Generate image? zero built-in generate image --help
7474
+ Generate voice? zero built-in generate voice --help
7468
7475
  Check your identity? zero whoami`
7469
7476
  );
7470
7477
  if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {