@vm0/cli 9.143.0 → 9.144.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-FEQSPUBX.js → chunk-75VR4R5J.js} +41 -3
- package/{chunk-FEQSPUBX.js.map → chunk-75VR4R5J.js.map} +1 -1
- package/index.js +9 -9
- package/package.json +1 -1
- package/zero.js +92 -5
- package/zero.js.map +1 -1
package/index.js
CHANGED
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
source_default,
|
|
66
66
|
volumeConfigSchema,
|
|
67
67
|
withErrorHandler
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-75VR4R5J.js";
|
|
69
69
|
import {
|
|
70
70
|
__toESM,
|
|
71
71
|
init_esm_shims
|
|
@@ -398,7 +398,7 @@ function getConfigPath() {
|
|
|
398
398
|
return join(homedir(), ".vm0", "config.json");
|
|
399
399
|
}
|
|
400
400
|
var infoCommand = new Command().name("info").description("Display environment and debug information").action(async () => {
|
|
401
|
-
console.log(source_default.bold(`VM0 CLI v${"9.
|
|
401
|
+
console.log(source_default.bold(`VM0 CLI v${"9.144.0"}`));
|
|
402
402
|
console.log();
|
|
403
403
|
const config = await loadConfig();
|
|
404
404
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -4291,7 +4291,7 @@ var composeCommand = new Command().name("compose").description("Create or update
|
|
|
4291
4291
|
options.autoUpdate = false;
|
|
4292
4292
|
}
|
|
4293
4293
|
if (options.autoUpdate !== false) {
|
|
4294
|
-
await startSilentUpgrade("9.
|
|
4294
|
+
await startSilentUpgrade("9.144.0");
|
|
4295
4295
|
}
|
|
4296
4296
|
try {
|
|
4297
4297
|
let result;
|
|
@@ -4383,7 +4383,7 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
|
|
|
4383
4383
|
withErrorHandler(
|
|
4384
4384
|
async (identifier, prompt, options) => {
|
|
4385
4385
|
if (options.autoUpdate !== false) {
|
|
4386
|
-
await startSilentUpgrade("9.
|
|
4386
|
+
await startSilentUpgrade("9.144.0");
|
|
4387
4387
|
}
|
|
4388
4388
|
const { name, version } = parseIdentifier(identifier);
|
|
4389
4389
|
let composeId;
|
|
@@ -6170,13 +6170,13 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
6170
6170
|
if (latestVersion === null) {
|
|
6171
6171
|
throw new Error("Could not check for updates. Please try again later.");
|
|
6172
6172
|
}
|
|
6173
|
-
if (latestVersion === "9.
|
|
6174
|
-
console.log(source_default.green(`\u2713 Already up to date (${"9.
|
|
6173
|
+
if (latestVersion === "9.144.0") {
|
|
6174
|
+
console.log(source_default.green(`\u2713 Already up to date (${"9.144.0"})`));
|
|
6175
6175
|
return;
|
|
6176
6176
|
}
|
|
6177
6177
|
console.log(
|
|
6178
6178
|
source_default.yellow(
|
|
6179
|
-
`Current version: ${"9.
|
|
6179
|
+
`Current version: ${"9.144.0"} -> Latest version: ${latestVersion}`
|
|
6180
6180
|
)
|
|
6181
6181
|
);
|
|
6182
6182
|
console.log();
|
|
@@ -6203,7 +6203,7 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
6203
6203
|
const success = await performUpgrade(packageManager);
|
|
6204
6204
|
if (success) {
|
|
6205
6205
|
console.log(
|
|
6206
|
-
source_default.green(`\u2713 Upgraded from ${"9.
|
|
6206
|
+
source_default.green(`\u2713 Upgraded from ${"9.144.0"} to ${latestVersion}`)
|
|
6207
6207
|
);
|
|
6208
6208
|
return;
|
|
6209
6209
|
}
|
|
@@ -6270,7 +6270,7 @@ var whoamiCommand = new Command().name("whoami").description("Show current ident
|
|
|
6270
6270
|
|
|
6271
6271
|
// src/index.ts
|
|
6272
6272
|
var program = new Command();
|
|
6273
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.
|
|
6273
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.144.0");
|
|
6274
6274
|
program.addCommand(authCommand);
|
|
6275
6275
|
program.addCommand(infoCommand);
|
|
6276
6276
|
program.addCommand(composeCommand);
|
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
enableZeroSchedule,
|
|
36
36
|
extractSecretNamesFromApis,
|
|
37
37
|
findMatchingPermissions,
|
|
38
|
+
generateWebImage,
|
|
38
39
|
generateWebVoice,
|
|
39
40
|
getActiveOrg,
|
|
40
41
|
getApiUrl,
|
|
@@ -127,7 +128,7 @@ import {
|
|
|
127
128
|
upsertZeroOrgModelProvider,
|
|
128
129
|
withErrorHandler,
|
|
129
130
|
zeroAgentCustomSkillNameSchema
|
|
130
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-75VR4R5J.js";
|
|
131
132
|
import {
|
|
132
133
|
__toESM,
|
|
133
134
|
init_esm_shims
|
|
@@ -2726,6 +2727,9 @@ How connectors work:
|
|
|
2726
2727
|
// src/commands/zero/doctor/generate.ts
|
|
2727
2728
|
init_esm_shims();
|
|
2728
2729
|
var BUILT_IN_GENERATION_OPTIONS = {
|
|
2730
|
+
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."
|
|
2732
|
+
},
|
|
2729
2733
|
voice: {
|
|
2730
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."
|
|
2731
2735
|
}
|
|
@@ -7133,18 +7137,98 @@ init_esm_shims();
|
|
|
7133
7137
|
// src/commands/zero/official/generate/index.ts
|
|
7134
7138
|
init_esm_shims();
|
|
7135
7139
|
|
|
7140
|
+
// src/commands/zero/official/generate/image.ts
|
|
7141
|
+
init_esm_shims();
|
|
7142
|
+
|
|
7143
|
+
// src/commands/zero/shared/image-generate.ts
|
|
7144
|
+
init_esm_shims();
|
|
7145
|
+
import { readFileSync as readFileSync10 } from "fs";
|
|
7146
|
+
function readPrompt(options, usageCommand) {
|
|
7147
|
+
if (options.prompt?.trim()) {
|
|
7148
|
+
return options.prompt.trim();
|
|
7149
|
+
}
|
|
7150
|
+
if (process.stdin.isTTY === false) {
|
|
7151
|
+
const prompt = readFileSync10("/dev/stdin", "utf8").trim();
|
|
7152
|
+
if (prompt.length > 0) {
|
|
7153
|
+
return prompt;
|
|
7154
|
+
}
|
|
7155
|
+
}
|
|
7156
|
+
throw new Error("--prompt is required", {
|
|
7157
|
+
cause: new Error(`Usage: ${usageCommand} --prompt "A watercolor fox"`)
|
|
7158
|
+
});
|
|
7159
|
+
}
|
|
7160
|
+
function createImageGenerateCommand(config) {
|
|
7161
|
+
return new Command().name(config.name).description("Generate a billed image file from a prompt").option("--prompt <text>", "Image prompt; can also be piped via stdin").option(
|
|
7162
|
+
"--size <size>",
|
|
7163
|
+
"Image size: 1024x1024, 1024x1536, or 1536x1024",
|
|
7164
|
+
"1024x1024"
|
|
7165
|
+
).option(
|
|
7166
|
+
"--quality <quality>",
|
|
7167
|
+
"Image quality: low, medium, high, or auto",
|
|
7168
|
+
"medium"
|
|
7169
|
+
).option(
|
|
7170
|
+
"--background <background>",
|
|
7171
|
+
"Background: auto, opaque, or transparent",
|
|
7172
|
+
"auto"
|
|
7173
|
+
).option("--format <format>", "Output format: png, webp, or jpeg", "png").option("--json", "Print metadata as JSON").addHelpText(
|
|
7174
|
+
"after",
|
|
7175
|
+
`
|
|
7176
|
+
Examples:
|
|
7177
|
+
${config.examples}
|
|
7178
|
+
|
|
7179
|
+
Output:
|
|
7180
|
+
Prints the generated /f/ image file URL and metadata
|
|
7181
|
+
|
|
7182
|
+
Notes:
|
|
7183
|
+
- Authenticates via ZERO_TOKEN (requires file:write capability)
|
|
7184
|
+
- Charges org credits after successful image generation
|
|
7185
|
+
- Uses OpenAI gpt-image-2 and bills returned usage tokens`
|
|
7186
|
+
).action(
|
|
7187
|
+
withErrorHandler(async (options) => {
|
|
7188
|
+
const prompt = readPrompt(options, config.usageCommand);
|
|
7189
|
+
const result = await generateWebImage({
|
|
7190
|
+
prompt,
|
|
7191
|
+
size: options.size,
|
|
7192
|
+
quality: options.quality,
|
|
7193
|
+
background: options.background,
|
|
7194
|
+
outputFormat: options.format
|
|
7195
|
+
});
|
|
7196
|
+
if (options.json) {
|
|
7197
|
+
console.log(JSON.stringify(result));
|
|
7198
|
+
return;
|
|
7199
|
+
}
|
|
7200
|
+
console.log(source_default.green(`\u2713 Image generated: ${result.url}`));
|
|
7201
|
+
console.log(source_default.dim(` File: ${result.filename}`));
|
|
7202
|
+
console.log(source_default.dim(` Size: ${result.imageSize}`));
|
|
7203
|
+
console.log(source_default.dim(` Quality: ${result.quality}`));
|
|
7204
|
+
console.log(source_default.dim(` Format: ${result.outputFormat}`));
|
|
7205
|
+
console.log(source_default.dim(` Credits charged: ${result.creditsCharged}`));
|
|
7206
|
+
console.log(source_default.dim(` Model: ${result.model}`));
|
|
7207
|
+
})
|
|
7208
|
+
);
|
|
7209
|
+
}
|
|
7210
|
+
|
|
7211
|
+
// src/commands/zero/official/generate/image.ts
|
|
7212
|
+
var imageCommand = createImageGenerateCommand({
|
|
7213
|
+
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`
|
|
7218
|
+
});
|
|
7219
|
+
|
|
7136
7220
|
// src/commands/zero/official/generate/voice.ts
|
|
7137
7221
|
init_esm_shims();
|
|
7138
7222
|
|
|
7139
7223
|
// src/commands/zero/shared/voice-generate.ts
|
|
7140
7224
|
init_esm_shims();
|
|
7141
|
-
import { readFileSync as
|
|
7225
|
+
import { readFileSync as readFileSync11 } from "fs";
|
|
7142
7226
|
function readText(options, usageCommand) {
|
|
7143
7227
|
if (options.text?.trim()) {
|
|
7144
7228
|
return options.text.trim();
|
|
7145
7229
|
}
|
|
7146
7230
|
if (process.stdin.isTTY === false) {
|
|
7147
|
-
const text =
|
|
7231
|
+
const text = readFileSync11("/dev/stdin", "utf8").trim();
|
|
7148
7232
|
if (text.length > 0) {
|
|
7149
7233
|
return text;
|
|
7150
7234
|
}
|
|
@@ -7199,10 +7283,11 @@ var voiceCommand = createVoiceGenerateCommand({
|
|
|
7199
7283
|
});
|
|
7200
7284
|
|
|
7201
7285
|
// src/commands/zero/official/generate/index.ts
|
|
7202
|
-
var generateCommand2 = new Command().name("generate").description("Generate assets with official Zero services").addCommand(voiceCommand).addHelpText(
|
|
7286
|
+
var generateCommand2 = new Command().name("generate").description("Generate assets with official Zero services").addCommand(imageCommand).addCommand(voiceCommand).addHelpText(
|
|
7203
7287
|
"after",
|
|
7204
7288
|
`
|
|
7205
7289
|
Examples:
|
|
7290
|
+
Generate image: zero official generate image --prompt "A watercolor fox"
|
|
7206
7291
|
Generate speech: zero official generate voice --text "Hello"`
|
|
7207
7292
|
);
|
|
7208
7293
|
|
|
@@ -7211,6 +7296,7 @@ var zeroOfficialCommand = new Command().name("official").description("Use offici
|
|
|
7211
7296
|
"after",
|
|
7212
7297
|
`
|
|
7213
7298
|
Examples:
|
|
7299
|
+
Generate image: zero official generate image --prompt "A watercolor fox"
|
|
7214
7300
|
Generate speech: zero official generate voice --text "Hello"`
|
|
7215
7301
|
);
|
|
7216
7302
|
|
|
@@ -7364,7 +7450,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
7364
7450
|
var program = new Command();
|
|
7365
7451
|
program.name("zero").description(
|
|
7366
7452
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
7367
|
-
).version("9.
|
|
7453
|
+
).version("9.144.0").addHelpText(
|
|
7368
7454
|
"after",
|
|
7369
7455
|
`
|
|
7370
7456
|
Examples:
|
|
@@ -7377,6 +7463,7 @@ Examples:
|
|
|
7377
7463
|
Set up a schedule? zero schedule setup --help
|
|
7378
7464
|
Update yourself? zero agent --help
|
|
7379
7465
|
Manage custom skills? zero skill --help
|
|
7466
|
+
Generate image? zero official generate image --help
|
|
7380
7467
|
Generate voice? zero official generate voice --help
|
|
7381
7468
|
Check your identity? zero whoami`
|
|
7382
7469
|
);
|