@vm0/cli 9.165.3 → 9.166.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-X7OEKYPB.js → chunk-TRRVYMW2.js} +74 -3
- package/{chunk-X7OEKYPB.js.map → chunk-TRRVYMW2.js.map} +1 -1
- package/index.js +9 -9
- package/package.json +1 -1
- package/zero.js +140 -27
- package/zero.js.map +1 -1
package/index.js
CHANGED
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
source_default,
|
|
69
69
|
volumeConfigSchema,
|
|
70
70
|
withErrorHandler
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-TRRVYMW2.js";
|
|
72
72
|
import {
|
|
73
73
|
__toESM,
|
|
74
74
|
init_esm_shims
|
|
@@ -387,7 +387,7 @@ function getConfigPath() {
|
|
|
387
387
|
return join(os.homedir(), ".vm0", "config.json");
|
|
388
388
|
}
|
|
389
389
|
var infoCommand = new Command().name("info").description("Display environment and debug information").action(async () => {
|
|
390
|
-
console.log(source_default.bold(`VM0 CLI v${"9.
|
|
390
|
+
console.log(source_default.bold(`VM0 CLI v${"9.166.0"}`));
|
|
391
391
|
console.log();
|
|
392
392
|
const config = await loadConfig();
|
|
393
393
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -4280,7 +4280,7 @@ var composeCommand = new Command().name("compose").description("Create or update
|
|
|
4280
4280
|
options.autoUpdate = false;
|
|
4281
4281
|
}
|
|
4282
4282
|
if (options.autoUpdate !== false) {
|
|
4283
|
-
await startSilentUpgrade("9.
|
|
4283
|
+
await startSilentUpgrade("9.166.0");
|
|
4284
4284
|
}
|
|
4285
4285
|
try {
|
|
4286
4286
|
let result;
|
|
@@ -4372,7 +4372,7 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
|
|
|
4372
4372
|
withErrorHandler(
|
|
4373
4373
|
async (identifier, prompt, options) => {
|
|
4374
4374
|
if (options.autoUpdate !== false) {
|
|
4375
|
-
await startSilentUpgrade("9.
|
|
4375
|
+
await startSilentUpgrade("9.166.0");
|
|
4376
4376
|
}
|
|
4377
4377
|
const { name, version } = parseIdentifier(identifier);
|
|
4378
4378
|
let composeId;
|
|
@@ -6165,13 +6165,13 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
6165
6165
|
if (latestVersion === null) {
|
|
6166
6166
|
throw new Error("Could not check for updates. Please try again later.");
|
|
6167
6167
|
}
|
|
6168
|
-
if (latestVersion === "9.
|
|
6169
|
-
console.log(source_default.green(`\u2713 Already up to date (${"9.
|
|
6168
|
+
if (latestVersion === "9.166.0") {
|
|
6169
|
+
console.log(source_default.green(`\u2713 Already up to date (${"9.166.0"})`));
|
|
6170
6170
|
return;
|
|
6171
6171
|
}
|
|
6172
6172
|
console.log(
|
|
6173
6173
|
source_default.yellow(
|
|
6174
|
-
`Current version: ${"9.
|
|
6174
|
+
`Current version: ${"9.166.0"} -> Latest version: ${latestVersion}`
|
|
6175
6175
|
)
|
|
6176
6176
|
);
|
|
6177
6177
|
console.log();
|
|
@@ -6198,7 +6198,7 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
6198
6198
|
const success = await performUpgrade(packageManager);
|
|
6199
6199
|
if (success) {
|
|
6200
6200
|
console.log(
|
|
6201
|
-
source_default.green(`\u2713 Upgraded from ${"9.
|
|
6201
|
+
source_default.green(`\u2713 Upgraded from ${"9.166.0"} to ${latestVersion}`)
|
|
6202
6202
|
);
|
|
6203
6203
|
return;
|
|
6204
6204
|
}
|
|
@@ -6265,7 +6265,7 @@ var whoamiCommand = new Command().name("whoami").description("Show current ident
|
|
|
6265
6265
|
|
|
6266
6266
|
// src/index.ts
|
|
6267
6267
|
var program = new Command();
|
|
6268
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.
|
|
6268
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.166.0");
|
|
6269
6269
|
program.addCommand(authCommand);
|
|
6270
6270
|
program.addCommand(infoCommand);
|
|
6271
6271
|
program.addCommand(composeCommand);
|
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -152,7 +152,7 @@ import {
|
|
|
152
152
|
zeroAgentCustomSkillNameSchema,
|
|
153
153
|
zeroLocalAgentCommand,
|
|
154
154
|
zeroTokenAllowsFeatureSwitch
|
|
155
|
-
} from "./chunk-
|
|
155
|
+
} from "./chunk-TRRVYMW2.js";
|
|
156
156
|
import {
|
|
157
157
|
__toESM,
|
|
158
158
|
init_esm_shims
|
|
@@ -6850,6 +6850,44 @@ import { mkdir, writeFile } from "fs/promises";
|
|
|
6850
6850
|
import { join as join6 } from "path";
|
|
6851
6851
|
var COMPUTER_USE_SCREENSHOT_DIR = "/tmp/vm0/computer-use";
|
|
6852
6852
|
var DATA_URL_PATTERN = /^data:([^;,]+);base64,(.*)$/s;
|
|
6853
|
+
var COMPUTER_USE_HELP_TEXT = `
|
|
6854
|
+
Workflow:
|
|
6855
|
+
1. Start the Zero Desktop app and make sure Computer Use is online.
|
|
6856
|
+
2. Run "zero computer-use list-apps" to find the target app name or bundle id.
|
|
6857
|
+
3. Run "zero computer-use get-app-state --app <app>" to get a screenshot,
|
|
6858
|
+
snapshotId, visible element indexes, and accessibility state.
|
|
6859
|
+
4. Prefer element actions with --snapshot-id and --element-index. Use --x/--y
|
|
6860
|
+
only when the target is visible in the returned screenshot but has no useful
|
|
6861
|
+
accessibility element.
|
|
6862
|
+
5. Read the JSON result. Screenshot data is saved under /tmp/vm0/computer-use
|
|
6863
|
+
and replaced with a local file path in CLI output.
|
|
6864
|
+
|
|
6865
|
+
Notes:
|
|
6866
|
+
Write commands are sent to the connected Desktop host and may wait for local
|
|
6867
|
+
approval before they run. Coordinate fallbacks use screenshot coordinates from
|
|
6868
|
+
get-app-state; pass the matching --snapshot-id when acting on a prior snapshot.
|
|
6869
|
+
|
|
6870
|
+
Examples:
|
|
6871
|
+
List available apps:
|
|
6872
|
+
zero computer-use list-apps
|
|
6873
|
+
|
|
6874
|
+
Inspect Safari state:
|
|
6875
|
+
zero computer-use get-app-state --app Safari
|
|
6876
|
+
|
|
6877
|
+
Click element index 7 from snapshot desktop_abc:
|
|
6878
|
+
zero computer-use click --app Safari --snapshot-id desktop_abc --element-index 7
|
|
6879
|
+
|
|
6880
|
+
Click screenshot coordinate (320, 240) from snapshot desktop_abc:
|
|
6881
|
+
zero computer-use click --app Safari --snapshot-id desktop_abc --x 320 --y 240
|
|
6882
|
+
|
|
6883
|
+
Type text into the current focus in Safari:
|
|
6884
|
+
zero computer-use type-text --app Safari --text "Hello"
|
|
6885
|
+
|
|
6886
|
+
Press a keyboard shortcut:
|
|
6887
|
+
zero computer-use press-key --app Safari --key Command+L
|
|
6888
|
+
|
|
6889
|
+
Open an app without activating the current foreground app:
|
|
6890
|
+
zero computer-use open-app --app Things`;
|
|
6853
6891
|
function sleep2(ms) {
|
|
6854
6892
|
return new Promise((resolve2) => {
|
|
6855
6893
|
setTimeout(resolve2, ms);
|
|
@@ -7144,7 +7182,7 @@ var openAppCommand = appOption(
|
|
|
7144
7182
|
)
|
|
7145
7183
|
)
|
|
7146
7184
|
);
|
|
7147
|
-
var zeroComputerUseCommand = new Command().name("computer-use").description("Desktop app computer use through Zero CLI").addCommand(listAppsCommand).addCommand(getAppStateCommand).addCommand(clickCommand).addCommand(scrollCommand).addCommand(setValueCommand).addCommand(typeTextCommand).addCommand(pressKeyCommand).addCommand(performActionCommand).addCommand(openAppCommand);
|
|
7185
|
+
var zeroComputerUseCommand = new Command().name("computer-use").description("Desktop app computer use through Zero CLI").addHelpText("after", COMPUTER_USE_HELP_TEXT).addCommand(listAppsCommand).addCommand(getAppStateCommand).addCommand(clickCommand).addCommand(scrollCommand).addCommand(setValueCommand).addCommand(typeTextCommand).addCommand(pressKeyCommand).addCommand(performActionCommand).addCommand(openAppCommand);
|
|
7148
7186
|
|
|
7149
7187
|
// src/commands/zero/built-in/index.ts
|
|
7150
7188
|
init_esm_shims();
|
|
@@ -7441,6 +7479,7 @@ var OPEN_DESIGN_REGISTRY = [
|
|
|
7441
7479
|
kind: "image-style",
|
|
7442
7480
|
name: "Notion Illustration",
|
|
7443
7481
|
description: "Zero-native illustration style for hand-drawn product spot illustrations with simple ink contours and soft backgrounds.",
|
|
7482
|
+
desc: 'Notion-editorial-style hand-drawn spot illustration. Black brush-pen ink on white, tapered confident strokes, solid-black curly hair, solid-black pants/shoes, 3/4 face turned toward viewer with closed-eye smile and soft nose hint, open breathing body outlines, and 1-3 supporting scene props + ambient marks that frame the moment. Trigger when user says /notion-illustration, asks for a "Notion-style illustration", "Notion spot illustration", or a new piece in this hand-drawn brush-pen Notion editorial style.',
|
|
7444
7483
|
source: sourceRef(
|
|
7445
7484
|
VM0_SKILLS_REPO,
|
|
7446
7485
|
VM0_SKILLS_REF,
|
|
@@ -7473,6 +7512,7 @@ var OPEN_DESIGN_REGISTRY = [
|
|
|
7473
7512
|
kind: "image-style",
|
|
7474
7513
|
name: "vm0 Illustration",
|
|
7475
7514
|
description: "vm0 in-app spot illustration style with bold hand-drawn ink line art, white-filled interiors, and a soft rounded color backdrop.",
|
|
7515
|
+
desc: "Generate vm0-style vm0 in-app spot illustrations: bold hand-drawn ink line art with white-filled interiors, a soft rounded color backdrop, transparent output, and simple iconic metaphors for product states.",
|
|
7476
7516
|
source: sourceRef(
|
|
7477
7517
|
VM0_SKILLS_REPO,
|
|
7478
7518
|
VM0_SKILLS_REF,
|
|
@@ -7509,6 +7549,16 @@ var OPEN_DESIGN_REGISTRY = [
|
|
|
7509
7549
|
priority: 19
|
|
7510
7550
|
}
|
|
7511
7551
|
];
|
|
7552
|
+
function listImageStyles() {
|
|
7553
|
+
return OPEN_DESIGN_REGISTRY.filter((entry) => {
|
|
7554
|
+
return entry.kind === "image-style" && entry.status !== "hidden";
|
|
7555
|
+
});
|
|
7556
|
+
}
|
|
7557
|
+
function findImageStyle(id) {
|
|
7558
|
+
return listImageStyles().find((entry) => {
|
|
7559
|
+
return entry.id === id;
|
|
7560
|
+
});
|
|
7561
|
+
}
|
|
7512
7562
|
function toOpenDesignTarget(value) {
|
|
7513
7563
|
if (value === "dashboard") {
|
|
7514
7564
|
return "dashboard-design";
|
|
@@ -7639,16 +7689,22 @@ function selectOpenDesignCandidates(options) {
|
|
|
7639
7689
|
// src/commands/zero/shared/image-style-authoring.ts
|
|
7640
7690
|
var outputDir = "./opendesign/images";
|
|
7641
7691
|
var artifactRules = [
|
|
7642
|
-
"Select the image style that best matches the prompt before generation.",
|
|
7643
7692
|
"Resolve the selected style source before generating the image.",
|
|
7644
7693
|
"Use the style skill's referenced assets and generation path when it provides one.",
|
|
7645
7694
|
"Produce a single final image file and keep any temporary metadata under the output directory."
|
|
7646
7695
|
];
|
|
7647
7696
|
function createStyledImageAuthoringPacket(options) {
|
|
7648
|
-
const
|
|
7697
|
+
const baseSlice = selectOpenDesignCandidates({
|
|
7649
7698
|
target: "image",
|
|
7650
7699
|
prompt: [options.prompt, ...options.details, ...artifactRules].join("\n")
|
|
7651
7700
|
});
|
|
7701
|
+
const candidateSlice = {
|
|
7702
|
+
...baseSlice,
|
|
7703
|
+
candidates: {
|
|
7704
|
+
...baseSlice.candidates,
|
|
7705
|
+
imageStyles: [options.style]
|
|
7706
|
+
}
|
|
7707
|
+
};
|
|
7652
7708
|
const selectionSchema = {
|
|
7653
7709
|
imageStyle: "string",
|
|
7654
7710
|
skills: "string[]",
|
|
@@ -7671,18 +7727,20 @@ function createStyledImageAuthoringPacket(options) {
|
|
|
7671
7727
|
outputDir
|
|
7672
7728
|
};
|
|
7673
7729
|
const instructions = [
|
|
7674
|
-
|
|
7730
|
+
`# Zero built-in generate image --style ${options.style.id}`,
|
|
7675
7731
|
"",
|
|
7676
7732
|
"This is a federated generation resource-selection packet for the current agent.",
|
|
7677
|
-
"Zero is not generating this image on the server yet.
|
|
7733
|
+
"Zero is not generating this image on the server yet. The image style has already been selected by the caller \u2014 resolve it and generate the styled image.",
|
|
7678
7734
|
"",
|
|
7679
7735
|
"## User Prompt",
|
|
7680
7736
|
options.prompt,
|
|
7681
7737
|
"",
|
|
7682
|
-
"##
|
|
7683
|
-
|
|
7738
|
+
"## Selected Image Style",
|
|
7739
|
+
`- \`${options.style.id}\` \u2014 ${options.style.name}`,
|
|
7740
|
+
"",
|
|
7741
|
+
"## Stage 1: Supporting Resource Selection",
|
|
7742
|
+
"- The image style is locked. Optionally pick supporting skills/templates from the candidate slice below.",
|
|
7684
7743
|
"- Choose only IDs present in this packet; do not invent registry IDs.",
|
|
7685
|
-
"- Prefer image-style resources with matching triggers, but the user prompt is the highest-priority signal.",
|
|
7686
7744
|
"- Treat the selection JSON as internal working state, then continue to generation.",
|
|
7687
7745
|
"",
|
|
7688
7746
|
"## Selection Output Schema",
|
|
@@ -7748,6 +7806,43 @@ function createStyledImageAuthoringPacket(options) {
|
|
|
7748
7806
|
}
|
|
7749
7807
|
|
|
7750
7808
|
// src/commands/zero/shared/image-generate.ts
|
|
7809
|
+
function formatStyleListing(styles) {
|
|
7810
|
+
if (styles.length === 0) {
|
|
7811
|
+
return " (no image styles registered)";
|
|
7812
|
+
}
|
|
7813
|
+
return styles.map((style) => {
|
|
7814
|
+
const desc = style.desc ?? style.description;
|
|
7815
|
+
return ` ${style.id}
|
|
7816
|
+
${desc}`;
|
|
7817
|
+
}).join("\n\n");
|
|
7818
|
+
}
|
|
7819
|
+
function requireStyleError(usageCommand) {
|
|
7820
|
+
const styles = listImageStyles();
|
|
7821
|
+
const message = [
|
|
7822
|
+
"--style <id> or --skip-style is required",
|
|
7823
|
+
"",
|
|
7824
|
+
"Available styles:",
|
|
7825
|
+
formatStyleListing(styles),
|
|
7826
|
+
"",
|
|
7827
|
+
`Examples:`,
|
|
7828
|
+
` ${usageCommand} --style ${styles[0]?.id ?? "<style-id>"} --prompt "..."`,
|
|
7829
|
+
` ${usageCommand} --skip-style --prompt "..."`
|
|
7830
|
+
].join("\n");
|
|
7831
|
+
return new Error(message);
|
|
7832
|
+
}
|
|
7833
|
+
function unknownStyleError(id, usageCommand) {
|
|
7834
|
+
const styles = listImageStyles();
|
|
7835
|
+
const message = [
|
|
7836
|
+
`Unknown image style: ${id}`,
|
|
7837
|
+
"",
|
|
7838
|
+
"Available styles:",
|
|
7839
|
+
formatStyleListing(styles),
|
|
7840
|
+
"",
|
|
7841
|
+
`Example:`,
|
|
7842
|
+
` ${usageCommand} --style ${styles[0]?.id ?? "<style-id>"} --prompt "..."`
|
|
7843
|
+
].join("\n");
|
|
7844
|
+
return new Error(message);
|
|
7845
|
+
}
|
|
7751
7846
|
function readPrompt(options, usageCommand) {
|
|
7752
7847
|
if (options.prompt?.trim()) {
|
|
7753
7848
|
return options.prompt.trim();
|
|
@@ -7837,17 +7932,21 @@ function createImageGenerateCommand(config) {
|
|
|
7837
7932
|
"--image-prompt-strength <0-1>",
|
|
7838
7933
|
"Reference strength override for Flux Redux"
|
|
7839
7934
|
).option(
|
|
7840
|
-
"--
|
|
7841
|
-
"
|
|
7842
|
-
).option(
|
|
7843
|
-
"
|
|
7844
|
-
|
|
7935
|
+
"--style <id>",
|
|
7936
|
+
"Image style id from the registry (see Image Styles below)"
|
|
7937
|
+
).option(
|
|
7938
|
+
"--skip-style",
|
|
7939
|
+
"Opt out of styled image generation for this invocation"
|
|
7940
|
+
).option("--json", "Print metadata as JSON").addHelpText("after", () => {
|
|
7941
|
+
const styles = listImageStyles();
|
|
7942
|
+
return `
|
|
7845
7943
|
Examples:
|
|
7846
7944
|
${config.examples}
|
|
7847
7945
|
|
|
7848
7946
|
Output:
|
|
7849
|
-
Prints the generated /f/ image file URL and metadata. With --
|
|
7850
|
-
an Open Design resource-selection packet for the current agent
|
|
7947
|
+
Prints the generated /f/ image file URL and metadata. With --style <id>,
|
|
7948
|
+
prints an Open Design resource-selection packet for the current agent
|
|
7949
|
+
with the selected style locked in.
|
|
7851
7950
|
|
|
7852
7951
|
Notes:
|
|
7853
7952
|
- Authenticates via ZERO_TOKEN (requires file:write capability)
|
|
@@ -7864,6 +7963,8 @@ Models:
|
|
|
7864
7963
|
|
|
7865
7964
|
Options:
|
|
7866
7965
|
- Prompt: required, up to 32,000 characters; stdin is supported.
|
|
7966
|
+
- Style: required. Pass --style <id> to generate in a registered style
|
|
7967
|
+
or --skip-style to bypass styled generation entirely.
|
|
7867
7968
|
- Size: gpt-image-2 accepts auto or WIDTHxHEIGHT. Popular sizes include
|
|
7868
7969
|
1024x1024,
|
|
7869
7970
|
1536x1024, 1024x1536, 2048x2048, 2048x1152, 3840x2160,
|
|
@@ -7883,14 +7984,26 @@ Options:
|
|
|
7883
7984
|
Flux Redux accepts --image-prompt-strength to override the provider
|
|
7884
7985
|
default; GPT edit models accept --input-fidelity and supported models
|
|
7885
7986
|
accept --mask-image-url.
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7987
|
+
|
|
7988
|
+
Image Styles:
|
|
7989
|
+
${formatStyleListing(styles)}`;
|
|
7990
|
+
}).action(
|
|
7889
7991
|
withErrorHandler(async (options, command) => {
|
|
7992
|
+
if (options.style && options.skipStyle) {
|
|
7993
|
+
throw new Error("--style and --skip-style cannot be combined");
|
|
7994
|
+
}
|
|
7995
|
+
if (!options.style && !options.skipStyle) {
|
|
7996
|
+
throw requireStyleError(config.usageCommand);
|
|
7997
|
+
}
|
|
7890
7998
|
const prompt = readPrompt(options, config.usageCommand);
|
|
7891
|
-
if (options.
|
|
7999
|
+
if (options.style) {
|
|
8000
|
+
const style = findImageStyle(options.style);
|
|
8001
|
+
if (!style) {
|
|
8002
|
+
throw unknownStyleError(options.style, config.usageCommand);
|
|
8003
|
+
}
|
|
7892
8004
|
const packet = createStyledImageAuthoringPacket({
|
|
7893
8005
|
prompt,
|
|
8006
|
+
style,
|
|
7894
8007
|
details: [
|
|
7895
8008
|
`Model preference if direct image generation is used: ${options.model}`,
|
|
7896
8009
|
`Requested size: ${options.size}`,
|
|
@@ -7966,12 +8079,12 @@ Options:
|
|
|
7966
8079
|
var imageCommand = createImageGenerateCommand({
|
|
7967
8080
|
name: "image",
|
|
7968
8081
|
usageCommand: "zero built-in generate image",
|
|
7969
|
-
examples: `
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
GPT Image model: zero built-in generate image --model gpt-image-1.5 --prompt "A poster" --size 1024x1536 --quality high
|
|
7973
|
-
Flux model: zero built-in generate image --model flux-pro-1.1 --prompt "A product hero shot" --seed 42
|
|
7974
|
-
Image-to-image: zero built-in generate image --model flux-pro-1.1 --image-url https://example.com/mockup.png --prompt "Turn this mockup into a polished product shot"`
|
|
8082
|
+
examples: ` Styled image: zero built-in generate image --style vm0:image-style:notion-illustration --prompt "A product manager mapping a launch plan"
|
|
8083
|
+
Skip style: zero built-in generate image --skip-style --prompt "A watercolor fox"
|
|
8084
|
+
Pipe prompt: cat prompt.txt | zero built-in generate image --skip-style
|
|
8085
|
+
GPT Image model: zero built-in generate image --skip-style --model gpt-image-1.5 --prompt "A poster" --size 1024x1536 --quality high
|
|
8086
|
+
Flux model: zero built-in generate image --skip-style --model flux-pro-1.1 --prompt "A product hero shot" --seed 42
|
|
8087
|
+
Image-to-image: zero built-in generate image --skip-style --model flux-pro-1.1 --image-url https://example.com/mockup.png --prompt "Turn this mockup into a polished product shot"`
|
|
7975
8088
|
});
|
|
7976
8089
|
|
|
7977
8090
|
// src/commands/zero/built-in/generate/open-design-artifacts.ts
|
|
@@ -10083,7 +10196,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
10083
10196
|
var program = new Command();
|
|
10084
10197
|
program.name("zero").description(
|
|
10085
10198
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
10086
|
-
).version("9.
|
|
10199
|
+
).version("9.166.0").addHelpText("after", () => {
|
|
10087
10200
|
return buildZeroHelpText();
|
|
10088
10201
|
});
|
|
10089
10202
|
if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {
|