@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/{chunk-K4JU76G2.js → chunk-DLWFP5WP.js} +487 -483
- package/{chunk-K4JU76G2.js.map → chunk-DLWFP5WP.js.map} +1 -1
- package/index.js +9 -9
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +72 -65
- package/zero.js.map +1 -1
package/package.json
CHANGED
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-
|
|
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 },
|
|
1905
|
+
const [{ connectors }, availableCatalog, agentCtx] = await Promise.all([
|
|
1903
1906
|
listZeroConnectors(),
|
|
1904
|
-
|
|
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
|
|
1913
|
-
|
|
1914
|
-
|
|
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 },
|
|
1981
|
+
const [{ connectors }, availableCatalog, agentCtx] = await Promise.all([
|
|
1984
1982
|
listZeroConnectors(),
|
|
1985
|
-
|
|
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
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
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
|
-
|
|
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
|
|
2728
|
+
var BUILT_IN_GENERATION_PROVIDERS = {
|
|
2730
2729
|
image: {
|
|
2731
|
-
|
|
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
|
-
|
|
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
|
|
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}/
|
|
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
|
|
2895
|
-
const
|
|
2896
|
-
if (!
|
|
2899
|
+
function renderBuiltInProvider(generationType) {
|
|
2900
|
+
const provider = BUILT_IN_GENERATION_PROVIDERS[generationType];
|
|
2901
|
+
if (!provider) return;
|
|
2897
2902
|
console.log("");
|
|
2898
|
-
console.log("
|
|
2899
|
-
console.log(` ${
|
|
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
|
-
|
|
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 (
|
|
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
|
-
|
|
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/
|
|
7141
|
+
// src/commands/zero/built-in/index.ts
|
|
7135
7142
|
init_esm_shims();
|
|
7136
7143
|
|
|
7137
|
-
// src/commands/zero/
|
|
7144
|
+
// src/commands/zero/built-in/generate/index.ts
|
|
7138
7145
|
init_esm_shims();
|
|
7139
7146
|
|
|
7140
|
-
// src/commands/zero/
|
|
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/
|
|
7218
|
+
// src/commands/zero/built-in/generate/image.ts
|
|
7212
7219
|
var imageCommand = createImageGenerateCommand({
|
|
7213
7220
|
name: "image",
|
|
7214
|
-
usageCommand: "zero
|
|
7215
|
-
examples: ` Generate image: zero
|
|
7216
|
-
Pipe prompt: cat prompt.txt | zero
|
|
7217
|
-
Pick size/quality: zero
|
|
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/
|
|
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/
|
|
7283
|
+
// src/commands/zero/built-in/generate/voice.ts
|
|
7277
7284
|
var voiceCommand = createVoiceGenerateCommand({
|
|
7278
7285
|
name: "voice",
|
|
7279
|
-
usageCommand: "zero
|
|
7280
|
-
examples: ` Generate speech: zero
|
|
7281
|
-
Pipe text: cat script.txt | zero
|
|
7282
|
-
Pick a voice: zero
|
|
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/
|
|
7286
|
-
var generateCommand2 = new Command().name("generate").description("Generate assets with
|
|
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
|
|
7291
|
-
Generate speech: zero
|
|
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/
|
|
7295
|
-
var
|
|
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
|
|
7300
|
-
Generate speech: zero
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
|
7467
|
-
Generate voice? zero
|
|
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")) {
|