@vm0/cli 9.142.1 → 9.143.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/{chunk-MB6EHK2G.js → chunk-FEQSPUBX.js} +119 -32
- package/{chunk-MB6EHK2G.js.map → chunk-FEQSPUBX.js.map} +1 -1
- package/index.js +11 -11
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +132 -69
- package/zero.js.map +1 -1
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -127,7 +127,7 @@ import {
|
|
|
127
127
|
upsertZeroOrgModelProvider,
|
|
128
128
|
withErrorHandler,
|
|
129
129
|
zeroAgentCustomSkillNameSchema
|
|
130
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-FEQSPUBX.js";
|
|
131
131
|
import {
|
|
132
132
|
__toESM,
|
|
133
133
|
init_esm_shims
|
|
@@ -2725,10 +2725,16 @@ How connectors work:
|
|
|
2725
2725
|
|
|
2726
2726
|
// src/commands/zero/doctor/generate.ts
|
|
2727
2727
|
init_esm_shims();
|
|
2728
|
+
var BUILT_IN_GENERATION_OPTIONS = {
|
|
2729
|
+
voice: {
|
|
2730
|
+
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."
|
|
2731
|
+
}
|
|
2732
|
+
};
|
|
2728
2733
|
var GENERATION_TYPE_ORDER = [
|
|
2729
2734
|
"image",
|
|
2730
2735
|
"video",
|
|
2731
2736
|
"audio",
|
|
2737
|
+
"voice",
|
|
2732
2738
|
"text",
|
|
2733
2739
|
"code",
|
|
2734
2740
|
"document",
|
|
@@ -2743,8 +2749,15 @@ var GENERATION_TYPE_LABELS = {
|
|
|
2743
2749
|
presentation: "Presentation",
|
|
2744
2750
|
text: "Text",
|
|
2745
2751
|
video: "Video",
|
|
2752
|
+
voice: "Voice",
|
|
2746
2753
|
website: "Website"
|
|
2747
2754
|
};
|
|
2755
|
+
function getConnectorGenerationType(generationType) {
|
|
2756
|
+
if (generationType === "voice") {
|
|
2757
|
+
return "audio";
|
|
2758
|
+
}
|
|
2759
|
+
return generationType;
|
|
2760
|
+
}
|
|
2748
2761
|
function getAvailableGenerationTypes() {
|
|
2749
2762
|
const available = /* @__PURE__ */ new Set();
|
|
2750
2763
|
for (const config of Object.values(CONNECTOR_TYPES)) {
|
|
@@ -2753,7 +2766,7 @@ function getAvailableGenerationTypes() {
|
|
|
2753
2766
|
}
|
|
2754
2767
|
}
|
|
2755
2768
|
return GENERATION_TYPE_ORDER.filter((type) => {
|
|
2756
|
-
return available.has(type);
|
|
2769
|
+
return type in BUILT_IN_GENERATION_OPTIONS || available.has(getConnectorGenerationType(type));
|
|
2757
2770
|
});
|
|
2758
2771
|
}
|
|
2759
2772
|
function parseGenerationType(value) {
|
|
@@ -2874,6 +2887,13 @@ function renderActions(candidates) {
|
|
|
2874
2887
|
console.log(` [${candidate.actionLabel}](${candidate.actionUrl})`);
|
|
2875
2888
|
}
|
|
2876
2889
|
}
|
|
2890
|
+
function renderBuiltInOption(generationType) {
|
|
2891
|
+
const option = BUILT_IN_GENERATION_OPTIONS[generationType];
|
|
2892
|
+
if (!option) return;
|
|
2893
|
+
console.log("");
|
|
2894
|
+
console.log("Fallback option:");
|
|
2895
|
+
console.log(` ${option.description}`);
|
|
2896
|
+
}
|
|
2877
2897
|
function renderText(params) {
|
|
2878
2898
|
const { generationType, agentId, ready, other, showAll } = params;
|
|
2879
2899
|
const label = GENERATION_TYPE_LABELS[generationType];
|
|
@@ -2894,6 +2914,7 @@ function renderText(params) {
|
|
|
2894
2914
|
} else {
|
|
2895
2915
|
console.log(`No ready ${generationType} generation connectors found.`);
|
|
2896
2916
|
}
|
|
2917
|
+
renderBuiltInOption(generationType);
|
|
2897
2918
|
if (showAll && other.length > 0) {
|
|
2898
2919
|
console.log("");
|
|
2899
2920
|
console.log(`Other ${generationType} generation connectors`);
|
|
@@ -2910,6 +2931,7 @@ var generateCommand = new Command().name("generate").description("Show generatio
|
|
|
2910
2931
|
).option("--all", "Also show unavailable or not-yet-authorized connectors").option("--json", "Output machine-readable JSON").action(
|
|
2911
2932
|
withErrorHandler(async (type, options) => {
|
|
2912
2933
|
const generationType = parseGenerationType(type);
|
|
2934
|
+
const connectorGenerationType = getConnectorGenerationType(generationType);
|
|
2913
2935
|
const agentId = process.env.ZERO_AGENT_ID;
|
|
2914
2936
|
const [connectorList, enabledTypes, platformOrigin] = await Promise.all([
|
|
2915
2937
|
listZeroConnectors(),
|
|
@@ -2923,7 +2945,7 @@ var generateCommand = new Command().name("generate").description("Show generatio
|
|
|
2923
2945
|
);
|
|
2924
2946
|
const configuredTypes = new Set(connectorList.configuredTypes);
|
|
2925
2947
|
const authorizedTypes = enabledTypes ? new Set(enabledTypes) : null;
|
|
2926
|
-
const candidates = getGenerationConnectors(
|
|
2948
|
+
const candidates = getGenerationConnectors(connectorGenerationType).map(
|
|
2927
2949
|
([connectorType, config]) => {
|
|
2928
2950
|
return toCandidate({
|
|
2929
2951
|
type: connectorType,
|
|
@@ -2947,10 +2969,12 @@ var generateCommand = new Command().name("generate").description("Show generatio
|
|
|
2947
2969
|
JSON.stringify(
|
|
2948
2970
|
{
|
|
2949
2971
|
generationType,
|
|
2972
|
+
connectorGenerationType,
|
|
2950
2973
|
availableTypes: getAvailableGenerationTypes(),
|
|
2951
2974
|
agentId: agentId ?? null,
|
|
2952
2975
|
choices: ready,
|
|
2953
|
-
otherCandidates: other
|
|
2976
|
+
otherCandidates: other,
|
|
2977
|
+
builtInOption: BUILT_IN_GENERATION_OPTIONS[generationType] ?? null
|
|
2954
2978
|
},
|
|
2955
2979
|
null,
|
|
2956
2980
|
2
|
|
@@ -5568,7 +5592,7 @@ Examples:
|
|
|
5568
5592
|
const limit = options.limit ? parseInt(options.limit, 10) : void 0;
|
|
5569
5593
|
const since = options.since ? parseTime(options.since) : void 0;
|
|
5570
5594
|
const result = await listZeroLogs({
|
|
5571
|
-
|
|
5595
|
+
agentId: options.agent,
|
|
5572
5596
|
status: options.status,
|
|
5573
5597
|
since,
|
|
5574
5598
|
limit
|
|
@@ -5714,7 +5738,7 @@ async function runLogsSearch(keyword, options) {
|
|
|
5714
5738
|
const limit = parseLimit2(options.limit);
|
|
5715
5739
|
const response = await searchZeroLogs({
|
|
5716
5740
|
keyword,
|
|
5717
|
-
|
|
5741
|
+
agentId: options.agentId,
|
|
5718
5742
|
runId: options.run,
|
|
5719
5743
|
since,
|
|
5720
5744
|
limit,
|
|
@@ -5740,9 +5764,12 @@ Examples:
|
|
|
5740
5764
|
zero logs search "timeout" --agent 123e4567-e89b-12d3-a456-426614174000 -C 2
|
|
5741
5765
|
zero logs search "failed" --since 30d --limit 50`
|
|
5742
5766
|
).action(
|
|
5743
|
-
withErrorHandler(
|
|
5744
|
-
|
|
5745
|
-
|
|
5767
|
+
withErrorHandler(
|
|
5768
|
+
async (keyword, options) => {
|
|
5769
|
+
const { agent, ...searchOptions } = options;
|
|
5770
|
+
await runLogsSearch(keyword, { ...searchOptions, agentId: agent });
|
|
5771
|
+
}
|
|
5772
|
+
)
|
|
5746
5773
|
);
|
|
5747
5774
|
|
|
5748
5775
|
// src/commands/zero/logs/index.ts
|
|
@@ -5920,7 +5947,7 @@ async function runLogsSource(query, options) {
|
|
|
5920
5947
|
afterContext: options.afterContext,
|
|
5921
5948
|
beforeContext: options.beforeContext,
|
|
5922
5949
|
context: options.context,
|
|
5923
|
-
|
|
5950
|
+
agentId: options.agent,
|
|
5924
5951
|
run: options.run,
|
|
5925
5952
|
since: options.since,
|
|
5926
5953
|
limit: options.limit
|
|
@@ -5972,7 +5999,7 @@ async function runChatSource(query, options) {
|
|
|
5972
5999
|
const since = options.since ? parseTime(options.since) : Date.now() - SEVEN_DAYS_MS2;
|
|
5973
6000
|
const response = await searchZeroChat({
|
|
5974
6001
|
keyword: query,
|
|
5975
|
-
|
|
6002
|
+
agentId: options.agent,
|
|
5976
6003
|
since,
|
|
5977
6004
|
limit,
|
|
5978
6005
|
before,
|
|
@@ -5997,7 +6024,7 @@ var zeroSearchCommand = new Command().name("search").description("Search logs, c
|
|
|
5997
6024
|
"Source to search: logs | chat | slack (pass once)",
|
|
5998
6025
|
collectSource,
|
|
5999
6026
|
[]
|
|
6000
|
-
).option("--agent <
|
|
6027
|
+
).option("--agent <id>", "Filter by Zero agent ID").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(
|
|
6001
6028
|
withErrorHandler(async (query, options) => {
|
|
6002
6029
|
const sources = options.source;
|
|
6003
6030
|
if (sources.length === 0) {
|
|
@@ -7100,6 +7127,93 @@ Examples:
|
|
|
7100
7127
|
);
|
|
7101
7128
|
var zeroComputerUseCommand = new Command().name("computer-use").description("Remote desktop control for cloud agents").addCommand(hostCommand).addCommand(clientCommand);
|
|
7102
7129
|
|
|
7130
|
+
// src/commands/zero/official/index.ts
|
|
7131
|
+
init_esm_shims();
|
|
7132
|
+
|
|
7133
|
+
// src/commands/zero/official/generate/index.ts
|
|
7134
|
+
init_esm_shims();
|
|
7135
|
+
|
|
7136
|
+
// src/commands/zero/official/generate/voice.ts
|
|
7137
|
+
init_esm_shims();
|
|
7138
|
+
|
|
7139
|
+
// src/commands/zero/shared/voice-generate.ts
|
|
7140
|
+
init_esm_shims();
|
|
7141
|
+
import { readFileSync as readFileSync10 } from "fs";
|
|
7142
|
+
function readText(options, usageCommand) {
|
|
7143
|
+
if (options.text?.trim()) {
|
|
7144
|
+
return options.text.trim();
|
|
7145
|
+
}
|
|
7146
|
+
if (process.stdin.isTTY === false) {
|
|
7147
|
+
const text = readFileSync10("/dev/stdin", "utf8").trim();
|
|
7148
|
+
if (text.length > 0) {
|
|
7149
|
+
return text;
|
|
7150
|
+
}
|
|
7151
|
+
}
|
|
7152
|
+
throw new Error("--text is required", {
|
|
7153
|
+
cause: new Error(`Usage: ${usageCommand} --text "Hello"`)
|
|
7154
|
+
});
|
|
7155
|
+
}
|
|
7156
|
+
function createVoiceGenerateCommand(config) {
|
|
7157
|
+
return new Command().name(config.name).description("Generate a billed speech audio file from text").option("--text <text>", "Text to speak; can also be piped via stdin").option("--voice <voice>", "OpenAI voice to use", "marin").option("--instructions <text>", "Voice style instructions").option("--json", "Print metadata as JSON").addHelpText(
|
|
7158
|
+
"after",
|
|
7159
|
+
`
|
|
7160
|
+
Examples:
|
|
7161
|
+
${config.examples}
|
|
7162
|
+
|
|
7163
|
+
Output:
|
|
7164
|
+
Prints the generated /f/ audio file URL and metadata
|
|
7165
|
+
|
|
7166
|
+
Notes:
|
|
7167
|
+
- Authenticates via ZERO_TOKEN (requires file:write capability)
|
|
7168
|
+
- Charges org credits after successful audio generation
|
|
7169
|
+
- Uses gpt-4o-mini-tts with WAV output`
|
|
7170
|
+
).action(
|
|
7171
|
+
withErrorHandler(async (options) => {
|
|
7172
|
+
const text = readText(options, config.usageCommand);
|
|
7173
|
+
const result = await generateWebVoice({
|
|
7174
|
+
text,
|
|
7175
|
+
voice: options.voice,
|
|
7176
|
+
instructions: options.instructions
|
|
7177
|
+
});
|
|
7178
|
+
if (options.json) {
|
|
7179
|
+
console.log(JSON.stringify(result));
|
|
7180
|
+
return;
|
|
7181
|
+
}
|
|
7182
|
+
console.log(source_default.green(`\u2713 Voice generated: ${result.url}`));
|
|
7183
|
+
console.log(source_default.dim(` File: ${result.filename}`));
|
|
7184
|
+
console.log(source_default.dim(` Duration: ${result.durationSeconds}s`));
|
|
7185
|
+
console.log(source_default.dim(` Credits charged: ${result.creditsCharged}`));
|
|
7186
|
+
console.log(source_default.dim(` Model: ${result.model}`));
|
|
7187
|
+
console.log(source_default.dim(` Voice: ${result.voice}`));
|
|
7188
|
+
})
|
|
7189
|
+
);
|
|
7190
|
+
}
|
|
7191
|
+
|
|
7192
|
+
// src/commands/zero/official/generate/voice.ts
|
|
7193
|
+
var voiceCommand = createVoiceGenerateCommand({
|
|
7194
|
+
name: "voice",
|
|
7195
|
+
usageCommand: "zero official generate voice",
|
|
7196
|
+
examples: ` Generate speech: zero official generate voice --text "Hello from vm0"
|
|
7197
|
+
Pipe text: cat script.txt | zero official generate voice
|
|
7198
|
+
Pick a voice: zero official generate voice --text "Ship it" --voice cedar`
|
|
7199
|
+
});
|
|
7200
|
+
|
|
7201
|
+
// src/commands/zero/official/generate/index.ts
|
|
7202
|
+
var generateCommand2 = new Command().name("generate").description("Generate assets with official Zero services").addCommand(voiceCommand).addHelpText(
|
|
7203
|
+
"after",
|
|
7204
|
+
`
|
|
7205
|
+
Examples:
|
|
7206
|
+
Generate speech: zero official generate voice --text "Hello"`
|
|
7207
|
+
);
|
|
7208
|
+
|
|
7209
|
+
// src/commands/zero/official/index.ts
|
|
7210
|
+
var zeroOfficialCommand = new Command().name("official").description("Use official Zero services").addCommand(generateCommand2).addHelpText(
|
|
7211
|
+
"after",
|
|
7212
|
+
`
|
|
7213
|
+
Examples:
|
|
7214
|
+
Generate speech: zero official generate voice --text "Hello"`
|
|
7215
|
+
);
|
|
7216
|
+
|
|
7103
7217
|
// src/commands/zero/web/index.ts
|
|
7104
7218
|
init_esm_shims();
|
|
7105
7219
|
|
|
@@ -7177,67 +7291,13 @@ Notes:
|
|
|
7177
7291
|
)
|
|
7178
7292
|
);
|
|
7179
7293
|
|
|
7180
|
-
// src/commands/zero/web/voice.ts
|
|
7181
|
-
init_esm_shims();
|
|
7182
|
-
import { readFileSync as readFileSync10 } from "fs";
|
|
7183
|
-
function readText(options) {
|
|
7184
|
-
if (options.text?.trim()) {
|
|
7185
|
-
return options.text.trim();
|
|
7186
|
-
}
|
|
7187
|
-
if (process.stdin.isTTY === false) {
|
|
7188
|
-
const text = readFileSync10("/dev/stdin", "utf8").trim();
|
|
7189
|
-
if (text.length > 0) {
|
|
7190
|
-
return text;
|
|
7191
|
-
}
|
|
7192
|
-
}
|
|
7193
|
-
throw new Error("--text is required", {
|
|
7194
|
-
cause: new Error('Usage: zero web voice --text "Hello"')
|
|
7195
|
-
});
|
|
7196
|
-
}
|
|
7197
|
-
var voiceCommand = new Command().name("voice").description("Generate a billed speech audio file from text").option("--text <text>", "Text to speak; can also be piped via stdin").option("--voice <voice>", "OpenAI voice to use", "marin").option("--instructions <text>", "Voice style instructions").option("--json", "Print metadata as JSON").addHelpText(
|
|
7198
|
-
"after",
|
|
7199
|
-
`
|
|
7200
|
-
Examples:
|
|
7201
|
-
Generate speech: zero web voice --text "Hello from vm0"
|
|
7202
|
-
Pipe text: cat script.txt | zero web voice
|
|
7203
|
-
Pick a voice: zero web voice --text "Ship it" --voice cedar
|
|
7204
|
-
|
|
7205
|
-
Output:
|
|
7206
|
-
Prints the generated /f/ audio file URL and metadata
|
|
7207
|
-
|
|
7208
|
-
Notes:
|
|
7209
|
-
- Authenticates via ZERO_TOKEN (requires file:write capability)
|
|
7210
|
-
- Charges org credits after successful audio generation
|
|
7211
|
-
- Uses gpt-4o-mini-tts with WAV output`
|
|
7212
|
-
).action(
|
|
7213
|
-
withErrorHandler(async (options) => {
|
|
7214
|
-
const text = readText(options);
|
|
7215
|
-
const result = await generateWebVoice({
|
|
7216
|
-
text,
|
|
7217
|
-
voice: options.voice,
|
|
7218
|
-
instructions: options.instructions
|
|
7219
|
-
});
|
|
7220
|
-
if (options.json) {
|
|
7221
|
-
console.log(JSON.stringify(result));
|
|
7222
|
-
return;
|
|
7223
|
-
}
|
|
7224
|
-
console.log(source_default.green(`\u2713 Voice generated: ${result.url}`));
|
|
7225
|
-
console.log(source_default.dim(` File: ${result.filename}`));
|
|
7226
|
-
console.log(source_default.dim(` Duration: ${result.durationSeconds}s`));
|
|
7227
|
-
console.log(source_default.dim(` Credits charged: ${result.creditsCharged}`));
|
|
7228
|
-
console.log(source_default.dim(` Model: ${result.model}`));
|
|
7229
|
-
console.log(source_default.dim(` Voice: ${result.voice}`));
|
|
7230
|
-
})
|
|
7231
|
-
);
|
|
7232
|
-
|
|
7233
7294
|
// src/commands/zero/web/index.ts
|
|
7234
|
-
var zeroWebCommand = new Command().name("web").description("Upload
|
|
7295
|
+
var zeroWebCommand = new Command().name("web").description("Upload and download files via the web chat endpoint").addCommand(downloadFileCommand3).addCommand(uploadFileCommand3).addHelpText(
|
|
7235
7296
|
"after",
|
|
7236
7297
|
`
|
|
7237
7298
|
Examples:
|
|
7238
7299
|
Upload a file: zero web upload-file -f /tmp/report.pdf
|
|
7239
|
-
Download a file: zero web download-file <file-id> -o /tmp/out.pdf
|
|
7240
|
-
Generate speech: zero web voice --text "Hello"`
|
|
7300
|
+
Download a file: zero web download-file <file-id> -o /tmp/out.pdf`
|
|
7241
7301
|
);
|
|
7242
7302
|
|
|
7243
7303
|
// src/zero.ts
|
|
@@ -7256,6 +7316,7 @@ var COMMAND_CAPABILITY_MAP = {
|
|
|
7256
7316
|
whoami: null,
|
|
7257
7317
|
"developer-support": null,
|
|
7258
7318
|
"computer-use": "computer-use:write",
|
|
7319
|
+
official: "file:write",
|
|
7259
7320
|
web: null
|
|
7260
7321
|
};
|
|
7261
7322
|
var DEFAULT_COMMANDS = [
|
|
@@ -7277,6 +7338,7 @@ var DEFAULT_COMMANDS = [
|
|
|
7277
7338
|
zeroSkillCommand,
|
|
7278
7339
|
zeroDeveloperSupportCommand,
|
|
7279
7340
|
zeroComputerUseCommand,
|
|
7341
|
+
zeroOfficialCommand,
|
|
7280
7342
|
zeroWebCommand
|
|
7281
7343
|
];
|
|
7282
7344
|
function shouldHideCommand(name, payload) {
|
|
@@ -7302,7 +7364,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
7302
7364
|
var program = new Command();
|
|
7303
7365
|
program.name("zero").description(
|
|
7304
7366
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
7305
|
-
).version("9.
|
|
7367
|
+
).version("9.143.0").addHelpText(
|
|
7306
7368
|
"after",
|
|
7307
7369
|
`
|
|
7308
7370
|
Examples:
|
|
@@ -7315,6 +7377,7 @@ Examples:
|
|
|
7315
7377
|
Set up a schedule? zero schedule setup --help
|
|
7316
7378
|
Update yourself? zero agent --help
|
|
7317
7379
|
Manage custom skills? zero skill --help
|
|
7380
|
+
Generate voice? zero official generate voice --help
|
|
7318
7381
|
Check your identity? zero whoami`
|
|
7319
7382
|
);
|
|
7320
7383
|
if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {
|