@vm0/cli 9.172.1 → 9.173.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-BBCUKURF.js → chunk-2P2LCHJX.js} +60026 -62424
- package/{chunk-BBCUKURF.js.map → chunk-2P2LCHJX.js.map} +1 -1
- package/index.js +23 -12
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +160 -369
- package/zero.js.map +1 -1
package/zero.js
CHANGED
|
@@ -23,8 +23,6 @@ import {
|
|
|
23
23
|
createComputerUseReadCommand,
|
|
24
24
|
createComputerUseWriteCommand,
|
|
25
25
|
createGithubLabelListener,
|
|
26
|
-
createLocalBrowserReadCommand,
|
|
27
|
-
createLocalBrowserWriteCommand,
|
|
28
26
|
createSkill,
|
|
29
27
|
createZeroAgent,
|
|
30
28
|
createZeroCreditCheckout,
|
|
@@ -32,7 +30,6 @@ import {
|
|
|
32
30
|
decodeCliTokenPayload,
|
|
33
31
|
decodeZeroTokenPayload,
|
|
34
32
|
deleteGithubLabelListener,
|
|
35
|
-
deleteLocalBrowserHost,
|
|
36
33
|
deleteSkill,
|
|
37
34
|
deleteZeroAgent,
|
|
38
35
|
deleteZeroOrg,
|
|
@@ -66,7 +63,6 @@ import {
|
|
|
66
63
|
getConnectorTypeForSecretName,
|
|
67
64
|
getDefaultAuthMethod,
|
|
68
65
|
getGithubInstallation,
|
|
69
|
-
getLocalBrowserReadCommand,
|
|
70
66
|
getScopeDiff,
|
|
71
67
|
getSecretsForAuthMethod,
|
|
72
68
|
getSelectableProviderTypes,
|
|
@@ -95,8 +91,6 @@ import {
|
|
|
95
91
|
isInteractive,
|
|
96
92
|
isUUID,
|
|
97
93
|
leaveZeroOrg,
|
|
98
|
-
listLocalBrowserAuditEvents,
|
|
99
|
-
listLocalBrowserHosts,
|
|
100
94
|
listSkills,
|
|
101
95
|
listTelegramBots,
|
|
102
96
|
listZeroAgents,
|
|
@@ -150,9 +144,8 @@ import {
|
|
|
150
144
|
upsertZeroOrgModelProvider,
|
|
151
145
|
withErrorHandler,
|
|
152
146
|
zeroAgentCustomSkillNameSchema,
|
|
153
|
-
zeroLocalAgentCommand,
|
|
154
147
|
zeroTokenAllowsFeatureSwitch
|
|
155
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-2P2LCHJX.js";
|
|
156
149
|
import {
|
|
157
150
|
__toESM,
|
|
158
151
|
init_esm_shims
|
|
@@ -6580,6 +6573,10 @@ Notes:
|
|
|
6580
6573
|
Write commands are sent to the connected Desktop host and may wait for local
|
|
6581
6574
|
approval before they run. Coordinate fallbacks use screenshot coordinates from
|
|
6582
6575
|
get-app-state; pass the matching --snapshot-id when acting on a prior snapshot.
|
|
6576
|
+
type-text sends literal keyboard input to the target app's current focus. Use
|
|
6577
|
+
set-value when you need deterministic accessibility value assignment.
|
|
6578
|
+
press-key accepts xdotool-style names such as shift+semicolon, Control_L+J,
|
|
6579
|
+
ctrl+alt+n, and BackSpace, plus existing macOS-style forms such as Command+L.
|
|
6583
6580
|
|
|
6584
6581
|
Examples:
|
|
6585
6582
|
List available apps:
|
|
@@ -6598,7 +6595,7 @@ Examples:
|
|
|
6598
6595
|
zero computer-use type-text --app Safari --text "Hello"
|
|
6599
6596
|
|
|
6600
6597
|
Press a keyboard shortcut:
|
|
6601
|
-
zero computer-use press-key --app Safari --key
|
|
6598
|
+
zero computer-use press-key --app Safari --key shift+semicolon
|
|
6602
6599
|
|
|
6603
6600
|
Open an app without activating the current foreground app:
|
|
6604
6601
|
zero computer-use open-app --app Things`;
|
|
@@ -6887,7 +6884,7 @@ var setValueCommand = appOption(
|
|
|
6887
6884
|
);
|
|
6888
6885
|
var typeTextCommand = appOption(
|
|
6889
6886
|
addTargetOptions(
|
|
6890
|
-
new Command().name("type-text").description("Type literal
|
|
6887
|
+
new Command().name("type-text").description("Type literal keyboard input into the target app").requiredOption("--text <text>", "Text to type").action(
|
|
6891
6888
|
withErrorHandler(async (options) => {
|
|
6892
6889
|
await runWriteCommand("keyboard.type_text", options, {
|
|
6893
6890
|
app: options.app,
|
|
@@ -6901,7 +6898,7 @@ var pressKeyCommand = appOption(
|
|
|
6901
6898
|
addTargetOptions(
|
|
6902
6899
|
new Command().name("press-key").description("Send a background key or key combination to the target app").requiredOption(
|
|
6903
6900
|
"--key <key>",
|
|
6904
|
-
"Key or
|
|
6901
|
+
"Key or xdotool-style combination, for example Command+K, shift+semicolon, or Control_L+J"
|
|
6905
6902
|
).action(
|
|
6906
6903
|
withErrorHandler(async (options) => {
|
|
6907
6904
|
await runWriteCommand("keyboard.press_key", options, {
|
|
@@ -7479,7 +7476,7 @@ var OPEN_DESIGN_REGISTRY = [
|
|
|
7479
7476
|
id: "od:skill:ui-ux-pro-max",
|
|
7480
7477
|
kind: "skill",
|
|
7481
7478
|
name: "UI UX Pro Max",
|
|
7482
|
-
description: "Catalog-only UI/UX Pro Max entry. The full upstream templates, data, and search workflow are not bundled in
|
|
7479
|
+
description: "Catalog-only UI/UX Pro Max entry. The full upstream templates, data, and search workflow are not bundled in this registry.",
|
|
7483
7480
|
source: { path: "skills/ui-ux-pro-max/SKILL.md" }
|
|
7484
7481
|
},
|
|
7485
7482
|
{
|
|
@@ -8067,7 +8064,7 @@ var OPEN_DESIGN_REGISTRY = [
|
|
|
8067
8064
|
id: "od:template:live-artifact",
|
|
8068
8065
|
kind: "template",
|
|
8069
8066
|
name: "Live Artifact",
|
|
8070
|
-
description: "Create refreshable, auditable
|
|
8067
|
+
description: "Create refreshable, auditable artifacts backed by connector or local data. Trigger when the user asks for live dashboards, refreshable reports, synced views, or reusable data-backed artifacts.",
|
|
8071
8068
|
source: { path: "design-templates/live-artifact" }
|
|
8072
8069
|
},
|
|
8073
8070
|
{
|
|
@@ -8108,14 +8105,14 @@ var OPEN_DESIGN_REGISTRY = [
|
|
|
8108
8105
|
{
|
|
8109
8106
|
id: "od:template:open-design-landing",
|
|
8110
8107
|
kind: "template",
|
|
8111
|
-
name: "
|
|
8108
|
+
name: "Editorial Landing",
|
|
8112
8109
|
description: "Single-page editorial landing site in the Atelier Zero visual language (Monocle / Apartamento / \xC9tudes collage). Composes from a typed inputs.json with optional gpt-image-2 assets.",
|
|
8113
8110
|
source: { path: "design-templates/open-design-landing" }
|
|
8114
8111
|
},
|
|
8115
8112
|
{
|
|
8116
8113
|
id: "od:template:open-design-landing-deck",
|
|
8117
8114
|
kind: "template",
|
|
8118
|
-
name: "
|
|
8115
|
+
name: "Editorial Landing Deck",
|
|
8119
8116
|
description: "Single-file slide deck in the Atelier Zero visual language \u2014 warm-paper, italic-serif emphasis, coral terminating dots, surreal collage. Horizontal swipe + ESC overview grid.",
|
|
8120
8117
|
source: { path: "design-templates/open-design-landing-deck" }
|
|
8121
8118
|
},
|
|
@@ -9540,6 +9537,126 @@ var OPEN_DESIGN_REGISTRY = [
|
|
|
9540
9537
|
ref: VM0_SKILLS_REF,
|
|
9541
9538
|
path: "illustration-template/mellow-pop"
|
|
9542
9539
|
}
|
|
9540
|
+
},
|
|
9541
|
+
{
|
|
9542
|
+
id: "vm0:image-style:grainy-duotone",
|
|
9543
|
+
kind: "image-style",
|
|
9544
|
+
name: "Grainy Duotone",
|
|
9545
|
+
description: "Editorial spot illustration on a warm cream background \u2014 grainy charcoal-stippled hands, outline-free flat two-tone color blocks with internal patterns, and scattered ambient marks.",
|
|
9546
|
+
desc: 'Grainy-duotone editorial spot illustration: warm cream off-white background, grainy charcoal-stippled hands (and occasional faces) drawn in textured black ink, paired with free-floating flat two-tone color blocks that carry NO outlines and are filled with internal patterns (grid, dots, spiral, hatching, squiggles, wavy lines), surrounded by scattered ambient marks (zigzags, triangles, x marks, circles, dashes). Square 1:1 scene-as-metaphor compositions. Five creative dials per brief: palette (two flat hues, e.g. teal+yellow / coral+sage / lavender+mustard / navy+peach / burgundy+dusty pink), elements (hand(s) + 1-3 props like flag, sprout, magnifier, balloons, ladder), scene archetype (Launch / Grow / Connect / Discover / Communicate / Reflect / Navigate / Care / Transform / Build), complexity (L1 minimal / L2 balanced / L3 rich), and mood (celebratory / calm / curious / reflective / determined / warm / quiet). Trigger when user says /grainy-duotone, asks for a "grainy two-tone editorial illustration", "charcoal-stippled hand illustration", "duotone editorial spot", or briefs with a scene metaphor + two-color palette + complexity.',
|
|
9547
|
+
source: {
|
|
9548
|
+
repo: VM0_SKILLS_REPO,
|
|
9549
|
+
ref: VM0_SKILLS_REF,
|
|
9550
|
+
path: "illustration-template/grainy-duotone"
|
|
9551
|
+
}
|
|
9552
|
+
},
|
|
9553
|
+
{
|
|
9554
|
+
id: "vm0:image-style:op-ed-cover",
|
|
9555
|
+
kind: "image-style",
|
|
9556
|
+
name: "Op-Ed Cover",
|
|
9557
|
+
description: "Editorial magazine op-ed cover \u2014 flat-vector scene with paper grain, elongated ink-line characters, muted retro palette, and a serif headline block in the lower-right.",
|
|
9558
|
+
desc: 'Editorial magazine op-ed cover illustration. Flat-vector + paper-grain scene with expressive elongated ink-line characters, gentle painterly shading, 1950s-60s editorial mood, and a serif headline overlay block in the lower-right corner carrying a witty contrarian or declarative title with two short lines of italic body copy. 5-axis framework: palette (background + accent + ink), complexity (L1 single hero / L2 small ensemble / L3 busy crowd), scene metaphor (specific cultural microcosm), headline voice (declarative / pun / appreciative / contrarian), and headline block style (solid vs. translucent). Trigger when user says /op-ed-cover, asks for an "editorial magazine illustration", an "op-ed cover", a "magazine essay illustration", or a scene with a headline overlay in this style.',
|
|
9559
|
+
source: {
|
|
9560
|
+
repo: VM0_SKILLS_REPO,
|
|
9561
|
+
ref: VM0_SKILLS_REF,
|
|
9562
|
+
path: "illustration-template/op-ed-cover"
|
|
9563
|
+
}
|
|
9564
|
+
},
|
|
9565
|
+
{
|
|
9566
|
+
id: "vm0:image-style:grain-poster",
|
|
9567
|
+
kind: "image-style",
|
|
9568
|
+
name: "Grain Poster",
|
|
9569
|
+
description: "Flat-vector editorial poster of a serene full-body figure with one hero prop \u2014 riso grain on a single textile, closed-eye smile + red cheek blush, muted limited palette.",
|
|
9570
|
+
desc: 'Grain Poster \u2014 flat-vector editorial illustration of a serene full-body figure interacting with one hero prop (bicycle, bouquet, cat, book, skateboard, sun hat, guitar, dog leash). Closed-eye smile + single round red cheek blush + dark nose mark + solid black hair, silhouette-first (no inked outlines). Riso/halftone grain confined to exactly ONE textile element (skirt or trousers); every other surface is flat color. Muted single-hue background, generous negative space, no headlines or wordmarks. Six tunable dials: palette (cool-dawn \xB7 sunset-coral \xB7 twilight \xB7 forest-green \xB7 custom), mood, scene, cast, complexity (L1/L2/L3), framing. Strongest at L1 + side-profile + solo. Trigger when user says /grain-poster, asks for a "flat-vector editorial poster", "riso-grain figure poster", "grainy editorial illustration", or briefs with a scene + palette + cast in this house style.',
|
|
9571
|
+
source: {
|
|
9572
|
+
repo: VM0_SKILLS_REPO,
|
|
9573
|
+
ref: VM0_SKILLS_REF,
|
|
9574
|
+
path: "illustration-template/grain-poster"
|
|
9575
|
+
}
|
|
9576
|
+
},
|
|
9577
|
+
{
|
|
9578
|
+
id: "vm0:image-style:light-pop-portrait",
|
|
9579
|
+
kind: "image-style",
|
|
9580
|
+
name: "Light Pop Portrait",
|
|
9581
|
+
description: "Light hand-drawn flat-vector single-character portrait on a fully saturated color block \u2014 chunky black hair, big shiny eyes, tiny red nose, pink five-point-star sparkle blush.",
|
|
9582
|
+
desc: 'Light Pop Portrait \u2014 a hand-drawn flat-vector single-character portrait style for playful avatars, mood pieces, and editorial character cards. Square 1:1 canvas filled with one fully saturated background hue; a single child\u2013tween character with chunky glossy-black hair (with one or two flyaway strands), big round shiny eyes (single white glint each, thin lashes above), tiny round red nose, expressive small mouth, and pink FIVE-POINT STAR sparkle blush on the cheeks (never solid dots). Thin delicate slightly-wavy hand-drawn contour lines, flat solid fills only, no gradients or texture, ~5-color palette per piece. Eight creative dials: expression, hairstyle, gender register, pose, palette, headwear, prop, outfit. Trigger when user says /light-pop-portrait, asks for a "light pop portrait", "flat-vector character portrait", "saturated color-block character", or briefs with expression + hairstyle + palette + prop.',
|
|
9583
|
+
source: {
|
|
9584
|
+
repo: VM0_SKILLS_REPO,
|
|
9585
|
+
ref: VM0_SKILLS_REF,
|
|
9586
|
+
path: "illustration-template/light-pop-portrait"
|
|
9587
|
+
}
|
|
9588
|
+
},
|
|
9589
|
+
{
|
|
9590
|
+
id: "vm0:image-style:endpaper",
|
|
9591
|
+
kind: "image-style",
|
|
9592
|
+
name: "Endpaper",
|
|
9593
|
+
description: "Riso-grain flat-vector collection of chill characters or objects scattered across a saturated solid color field, with two-tone interior shading and closed-eye sleepy faces.",
|
|
9594
|
+
desc: `Riso-grain flat-vector editorial collection illustration. Many small animals or objects scattered across a fully saturated solid color background \u2014 like the inside endpaper of a children's picture book. Subtle riso/screenprint grain inside every fill, two-tone interior shading on every character (darker top + lighter belly), closed crescent-eye sleepy smiles with tiny dot noses, NO outlines on character bodies, loose hand-drawn line details on props (yarn spirals, leaf veins, pot stripes), scattered curated composition where characters overlap and touch the canvas edges. Five dials: background hue, cast (cats/dogs/foxes/birds/sea-creatures/houseplants/kitchen-objects/etc.), character palette (3\u20135 curated fills), density (L1 sparse / L2 balanced / L3 packed), prop vocabulary matched to cast. Trigger when user says /endpaper, asks for an "endpaper illustration", a "scattered animal or object collection on saturated color", a "children's-book endpaper scene", or briefs with a cast + background hue + density + palette.`,
|
|
9595
|
+
source: {
|
|
9596
|
+
repo: VM0_SKILLS_REPO,
|
|
9597
|
+
ref: VM0_SKILLS_REF,
|
|
9598
|
+
path: "illustration-template/endpaper"
|
|
9599
|
+
}
|
|
9600
|
+
},
|
|
9601
|
+
{
|
|
9602
|
+
id: "vm0:image-style:editorial-flatfolk",
|
|
9603
|
+
kind: "image-style",
|
|
9604
|
+
name: "Editorial Flatfolk",
|
|
9605
|
+
description: "Editorial hand-drawn naive book-illustration style \u2014 flat saturated color blocks, loose ink line overlay, paper grain, and a strong sense of place.",
|
|
9606
|
+
desc: 'Editorial hand-drawn naive book-illustration style. Flat saturated color blocks with loose hand-drawn ink line work sitting ON TOP of the color, subtle paper grain across the canvas, simple ink hatching for sky / sun rays / rain / snow, and a strong sense of place built from tall narrow architecture and a one-point depth axis. Five dials per brief: palette (warm-primary, coastal-peach, jewel-night, winter-cool, autumn-rust, monsoon-twilight), scene metaphor (street, harbor, market, transit, park, square, interior, alpine-village), perspective (one-point street, frontal facade, low-angle hero, isometric, top-down), cast (solo wanderer, paired, small crowd, none), and light/weather (midday sun, golden hour, rain, snow, blue hour). Trigger when user says /editorial-flatfolk, asks for an "editorial flat-folk illustration", a "saturated naive book-illustration scene", a "tall narrow row-house illustration", or briefs a palette + scene metaphor + season.',
|
|
9607
|
+
source: {
|
|
9608
|
+
repo: VM0_SKILLS_REPO,
|
|
9609
|
+
ref: VM0_SKILLS_REF,
|
|
9610
|
+
path: "illustration-template/editorial-flatfolk"
|
|
9611
|
+
}
|
|
9612
|
+
},
|
|
9613
|
+
{
|
|
9614
|
+
id: "vm0:image-style:soft-vector",
|
|
9615
|
+
kind: "image-style",
|
|
9616
|
+
name: "Soft Vector",
|
|
9617
|
+
description: "Airy flat-vector spot illustration \u2014 square pale-blue canvas, thin ~1.5-2px dark-navy linework with intentionally open / unclosed outlines, flat fills, one muted accent hue, centered subject with breathing room.",
|
|
9618
|
+
desc: `Soft Vector \u2014 an airy flat-vector spot illustration style for in-app onboarding art, empty states, billing cards, and friendly UI moments. Square 1:1 canvas on a single flat pale-blue field #EEF1F5; thin uniform dark-navy outlines (~1.5-2px, rounded caps, NOT chunky); the signature lift comes from several intentionally OPEN / unclosed outlines per piece (mug rim gap, handle that doesn't close, ground line ending in mid-air, cloud silhouette break, lamp arm fade, pot rim gap); strictly flat colour fills with no gradients or shading; one muted lead accent (mustard / lime-sage / warm-orange / violet) plus neutrals; subject centered at ~60-75% of canvas with generous breathing room; scattered thin-navy micro-marks (dots, plus signs, sparkles, or motion ticks). Six dials per brief: palette accent, scene metaphor, complexity (L1/L2/L3), cast, accent marks, action/mood. Trigger when user says /soft-vector, asks for a "soft-vector illustration", a "friendly UI onboarding illustration", a "thin-line flat spot illustration", or briefs a scene metaphor + palette + complexity in this house style.`,
|
|
9619
|
+
source: {
|
|
9620
|
+
repo: VM0_SKILLS_REPO,
|
|
9621
|
+
ref: VM0_SKILLS_REF,
|
|
9622
|
+
path: "illustration-template/soft-vector"
|
|
9623
|
+
}
|
|
9624
|
+
},
|
|
9625
|
+
{
|
|
9626
|
+
id: "vm0:image-style:loose-contour",
|
|
9627
|
+
kind: "image-style",
|
|
9628
|
+
name: "Loose Contour",
|
|
9629
|
+
description: "Flat editorial spot illustration \u2014 open teal contour lines, offset color blobs (printing-misregistration look), one ribbon line on warm cream paper.",
|
|
9630
|
+
desc: 'Loose-contour flat editorial spot illustration: confident open-contour ink drawings in dark teal-green (#1e4d4a) over flat offset color blobs (printing-misregistration look) on warm cream paper (#f0ebdc), with exactly one continuous looping ribbon line of the same teal weaving through the scene. Tight 5-color palette: cream + teal + mustard + soft blue + coral. Lines are deliberately broken at joints and edges. Five dials per brief: scene metaphor, cast, complexity (L1/L2/L3), accent lead, ribbon path. Trigger when user says /loose-contour, asks for a "loose-contour illustration", "offset-blob editorial illustration", or "cream paper ribbon-line scene".',
|
|
9631
|
+
source: {
|
|
9632
|
+
repo: VM0_SKILLS_REPO,
|
|
9633
|
+
ref: VM0_SKILLS_REF,
|
|
9634
|
+
path: "illustration-template/loose-contour"
|
|
9635
|
+
}
|
|
9636
|
+
},
|
|
9637
|
+
{
|
|
9638
|
+
id: "vm0:image-style:jade-blockprint",
|
|
9639
|
+
kind: "image-style",
|
|
9640
|
+
name: "Jade Blockprint",
|
|
9641
|
+
description: "Two-tone hand-drawn block-print spot illustration \u2014 accent color painted as free-floating shapes on white, with chunky black ink layered on top. Eight palettes.",
|
|
9642
|
+
desc: 'Jade-blockprint two-pass hand-drawn block-print spot illustration: one accent color painted FIRST as free-floating shapes on pure white, then chunky black ink line art layered ON TOP. Color blobs have no perimeter outline \u2014 ink draws detail, hatching, and motion marks, never traces the colored shape. Wobbly variable-weight linework with occasional flooded black masses; tiny linocut speckle grain inside color fills. Eight named palettes (jade, coral, cobalt, plum, sage, rose, slate, terracotta) plus custom-hex override. Resolves vague briefs (growth, trust, freedom, fairness) into concrete scene metaphors via an internal synthesizer table before generating. Five dials per piece: palette, scene metaphor, complexity (L1 single object / L2 mini-scene / L3 vignette), motion marks, speckle density. Trigger when the user says /jade-blockprint, asks for a "block-print illustration", "linocut spot illustration", "two-tone screen-print", or briefs a metaphor for a blog cover or marketing card in this style.',
|
|
9643
|
+
source: {
|
|
9644
|
+
repo: VM0_SKILLS_REPO,
|
|
9645
|
+
ref: VM0_SKILLS_REF,
|
|
9646
|
+
path: "illustration-template/jade-blockprint"
|
|
9647
|
+
}
|
|
9648
|
+
},
|
|
9649
|
+
{
|
|
9650
|
+
id: "vm0:image-style:shadow-pop",
|
|
9651
|
+
kind: "image-style",
|
|
9652
|
+
name: "Shadow Pop",
|
|
9653
|
+
description: "Bright flat-vector illustration with offset black shape shadows, white dashed stitching, palette confetti, and transparent PNG output.",
|
|
9654
|
+
desc: 'Bright flat-vector editorial illustration style \u2014 every colored shape sits in front of an offset black silhouette of itself (the signature depth trick, no outlines on the fills), with white hand-drawn dashed stitching, scattered palette-colored sparkle confetti, and a fully transparent PNG background so the piece drops cleanly onto any surface. Five dials per brief \u2014 palette (default / berry-pop / tropical / citrus-cobalt), scene metaphor, complexity (L1 / L2 / L3), confetti density, and subject domain. Trigger when user says /shadow-pop, asks for a "shadow-pop illustration", a "bright flat-vector illustration with offset shadow", an "in-app illustration with offset shadow trick", or briefs in the style of the included reference images.',
|
|
9655
|
+
source: {
|
|
9656
|
+
repo: VM0_SKILLS_REPO,
|
|
9657
|
+
ref: VM0_SKILLS_REF,
|
|
9658
|
+
path: "illustration-template/shadow-pop"
|
|
9659
|
+
}
|
|
9543
9660
|
}
|
|
9544
9661
|
];
|
|
9545
9662
|
function filterByKind(kind) {
|
|
@@ -9597,7 +9714,7 @@ function selectOpenDesignCandidates() {
|
|
|
9597
9714
|
}
|
|
9598
9715
|
|
|
9599
9716
|
// src/commands/zero/shared/image-style-authoring.ts
|
|
9600
|
-
var outputDir = "./
|
|
9717
|
+
var outputDir = "./generated/images";
|
|
9601
9718
|
var artifactRules = [
|
|
9602
9719
|
"Resolve the selected style source before generating the image.",
|
|
9603
9720
|
"Use the style skill's referenced assets and generation path when it provides one.",
|
|
@@ -9636,7 +9753,7 @@ function createStyledImageAuthoringPacket(options) {
|
|
|
9636
9753
|
const instructions = [
|
|
9637
9754
|
`# Zero generate image --style ${options.style.id}`,
|
|
9638
9755
|
"",
|
|
9639
|
-
"This is a federated generation
|
|
9756
|
+
"This is a federated generation source-selection packet for the current agent.",
|
|
9640
9757
|
"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.",
|
|
9641
9758
|
"",
|
|
9642
9759
|
"## User Prompt",
|
|
@@ -9698,7 +9815,7 @@ function createStyledImageAuthoringPacket(options) {
|
|
|
9698
9815
|
"- Report the final image URL or path and the selected registry resource ID."
|
|
9699
9816
|
].join("\n");
|
|
9700
9817
|
return {
|
|
9701
|
-
type: "
|
|
9818
|
+
type: "generation-source-selection",
|
|
9702
9819
|
kind: "image",
|
|
9703
9820
|
prompt: options.prompt,
|
|
9704
9821
|
registryVersion: candidateSlice.registryVersion,
|
|
@@ -10512,7 +10629,7 @@ ${config.examples}
|
|
|
10512
10629
|
|
|
10513
10630
|
Output:
|
|
10514
10631
|
Prints the generated /f/ image file URL and metadata. With --style <id>,
|
|
10515
|
-
prints
|
|
10632
|
+
prints a source-selection packet for the current agent
|
|
10516
10633
|
with the selected style locked in.
|
|
10517
10634
|
|
|
10518
10635
|
Notes:
|
|
@@ -10693,7 +10810,7 @@ function titleForKind(kind) {
|
|
|
10693
10810
|
return titles[kind];
|
|
10694
10811
|
}
|
|
10695
10812
|
function outputDirForSite(site) {
|
|
10696
|
-
return `./
|
|
10813
|
+
return `./generated/mockups/${site}`;
|
|
10697
10814
|
}
|
|
10698
10815
|
function createHtmlArtifactAuthoringPacket(options) {
|
|
10699
10816
|
const site = options.site ?? slugify(options.slugSource ?? options.prompt);
|
|
@@ -10745,7 +10862,7 @@ function createHtmlArtifactAuthoringPacket(options) {
|
|
|
10745
10862
|
const instructions = [
|
|
10746
10863
|
`# Zero generate ${options.kind}`,
|
|
10747
10864
|
"",
|
|
10748
|
-
"This is a federated generation
|
|
10865
|
+
"This is a federated generation source-selection packet for the current agent.",
|
|
10749
10866
|
`Zero is not generating this ${title} on the server. You select resources, resolve them, and author the artifact.`,
|
|
10750
10867
|
"",
|
|
10751
10868
|
"## User Prompt",
|
|
@@ -10802,7 +10919,7 @@ function createHtmlArtifactAuthoringPacket(options) {
|
|
|
10802
10919
|
return `- ${detail}`;
|
|
10803
10920
|
}),
|
|
10804
10921
|
"",
|
|
10805
|
-
"##
|
|
10922
|
+
"## Authoring Rules",
|
|
10806
10923
|
"- Let the selected template define structure, the selected design system define visual language, and the selected skills define process.",
|
|
10807
10924
|
"- Read the local codebase, brand assets, and existing design systems when the prompt depends on this repository.",
|
|
10808
10925
|
"- Avoid generic AI design defaults: no stock SaaS gradients, no emoji-as-icons, no filler stats, no decorative chrome that does not help the artifact.",
|
|
@@ -10829,7 +10946,7 @@ function createHtmlArtifactAuthoringPacket(options) {
|
|
|
10829
10946
|
"```"
|
|
10830
10947
|
].join("\n");
|
|
10831
10948
|
return {
|
|
10832
|
-
type: "
|
|
10949
|
+
type: "generation-source-selection",
|
|
10833
10950
|
kind: options.kind,
|
|
10834
10951
|
prompt: options.prompt,
|
|
10835
10952
|
registryVersion: candidateSlice.registryVersion,
|
|
@@ -10864,7 +10981,7 @@ Examples:
|
|
|
10864
10981
|
${config.examples}
|
|
10865
10982
|
|
|
10866
10983
|
Output:
|
|
10867
|
-
Prints
|
|
10984
|
+
Prints a source-selection packet for the current agent. The
|
|
10868
10985
|
agent authors a static HTML artifact and hosts it with zero host. With no
|
|
10869
10986
|
--prompt and no piped input, prints the provider menu instead.
|
|
10870
10987
|
|
|
@@ -10912,7 +11029,7 @@ var reportCommand = createOpenDesignArtifactGenerateCommand({
|
|
|
10912
11029
|
name: "report",
|
|
10913
11030
|
generationType: "report",
|
|
10914
11031
|
target: "report",
|
|
10915
|
-
description: "Generate an
|
|
11032
|
+
description: "Generate an HTML report from a prompt",
|
|
10916
11033
|
usageCommand: "zero generate report",
|
|
10917
11034
|
examples: ` Generate report: zero generate report --prompt "A Q2 usage report for the API team"
|
|
10918
11035
|
Stable hosted slug: zero generate report --site api-usage-q2 --prompt "A Q2 usage report"
|
|
@@ -10929,10 +11046,10 @@ var docsDesignCommand = createOpenDesignArtifactGenerateCommand({
|
|
|
10929
11046
|
name: "docs-design",
|
|
10930
11047
|
generationType: "docs-design",
|
|
10931
11048
|
target: "docs-design",
|
|
10932
|
-
description: "Generate
|
|
11049
|
+
description: "Generate a documentation design from a prompt",
|
|
10933
11050
|
usageCommand: "zero generate docs-design",
|
|
10934
|
-
examples: ` Generate docs design: zero generate docs-design --prompt "Docs for adding
|
|
10935
|
-
Stable hosted slug: zero generate docs-design --site
|
|
11051
|
+
examples: ` Generate docs design: zero generate docs-design --prompt "Docs for adding artifact targets"
|
|
11052
|
+
Stable hosted slug: zero generate docs-design --site artifact-target-docs --prompt "Artifact target docs"
|
|
10936
11053
|
List providers: zero generate docs-design`,
|
|
10937
11054
|
details: standardDetails("docs-design"),
|
|
10938
11055
|
artifactRules: [
|
|
@@ -10946,10 +11063,10 @@ var posterCommand = createOpenDesignArtifactGenerateCommand({
|
|
|
10946
11063
|
name: "poster",
|
|
10947
11064
|
generationType: "poster",
|
|
10948
11065
|
target: "poster",
|
|
10949
|
-
description: "Generate an
|
|
11066
|
+
description: "Generate an HTML poster from a prompt",
|
|
10950
11067
|
usageCommand: "zero generate poster",
|
|
10951
|
-
examples: ` Generate poster: zero generate poster --prompt "A launch poster for
|
|
10952
|
-
Stable hosted slug: zero generate poster --site
|
|
11068
|
+
examples: ` Generate poster: zero generate poster --prompt "A launch poster for artifact targets"
|
|
11069
|
+
Stable hosted slug: zero generate poster --site artifact-poster --prompt "A launch poster"
|
|
10953
11070
|
List providers: zero generate poster`,
|
|
10954
11071
|
details: standardDetails("poster"),
|
|
10955
11072
|
artifactRules: [
|
|
@@ -10963,7 +11080,7 @@ var dashboardDesignCommand = createOpenDesignArtifactGenerateCommand({
|
|
|
10963
11080
|
name: "dashboard-design",
|
|
10964
11081
|
generationType: "dashboard-design",
|
|
10965
11082
|
target: "dashboard-design",
|
|
10966
|
-
description: "Generate
|
|
11083
|
+
description: "Generate a dashboard design from a prompt",
|
|
10967
11084
|
usageCommand: "zero generate dashboard-design",
|
|
10968
11085
|
examples: ` Generate dash design: zero generate dashboard-design --prompt "An ops dashboard for generation runs"
|
|
10969
11086
|
Stable hosted slug: zero generate dashboard-design --site generation-ops --prompt "A generation ops dashboard"
|
|
@@ -10980,7 +11097,7 @@ var mobileAppDesignCommand = createOpenDesignArtifactGenerateCommand({
|
|
|
10980
11097
|
name: "mobile-app-design",
|
|
10981
11098
|
generationType: "mobile-app-design",
|
|
10982
11099
|
target: "mobile-app-design",
|
|
10983
|
-
description: "Generate
|
|
11100
|
+
description: "Generate a mobile app design prototype from a prompt",
|
|
10984
11101
|
usageCommand: "zero generate mobile-app-design",
|
|
10985
11102
|
examples: ` Generate mobile UI: zero generate mobile-app-design --prompt "A mobile review screen for generation artifacts"
|
|
10986
11103
|
Stable hosted slug: zero generate mobile-app-design --site generation-mobile-review --prompt "A mobile review screen"
|
|
@@ -11047,7 +11164,7 @@ Examples:
|
|
|
11047
11164
|
${config.examples}
|
|
11048
11165
|
|
|
11049
11166
|
Output:
|
|
11050
|
-
Prints
|
|
11167
|
+
Prints a source-selection packet for the current agent.
|
|
11051
11168
|
|
|
11052
11169
|
Notes:
|
|
11053
11170
|
- Authenticates via ZERO_TOKEN
|
|
@@ -11478,7 +11595,7 @@ Examples:
|
|
|
11478
11595
|
List providers: zero generate website
|
|
11479
11596
|
|
|
11480
11597
|
Output:
|
|
11481
|
-
Prints
|
|
11598
|
+
Prints a source-selection packet for the current agent.
|
|
11482
11599
|
With no --prompt and no piped input, prints the provider menu instead.
|
|
11483
11600
|
|
|
11484
11601
|
Notes:
|
|
@@ -11767,327 +11884,6 @@ Examples:
|
|
|
11767
11884
|
Download a file: zero web download-file <file-id> -o /tmp/out.pdf`
|
|
11768
11885
|
);
|
|
11769
11886
|
|
|
11770
|
-
// src/commands/zero/local-browser/index.ts
|
|
11771
|
-
init_esm_shims();
|
|
11772
|
-
function sleep3(ms) {
|
|
11773
|
-
return new Promise((resolve2) => {
|
|
11774
|
-
setTimeout(resolve2, ms);
|
|
11775
|
-
});
|
|
11776
|
-
}
|
|
11777
|
-
function parseTimeoutSeconds2(value) {
|
|
11778
|
-
if (!value) return 30;
|
|
11779
|
-
const seconds = Number.parseInt(value, 10);
|
|
11780
|
-
if (!Number.isFinite(seconds) || seconds <= 0) {
|
|
11781
|
-
throw new Error("Timeout must be a positive number of seconds");
|
|
11782
|
-
}
|
|
11783
|
-
return seconds;
|
|
11784
|
-
}
|
|
11785
|
-
function parseOptionalNonNegativeInteger2(value, label) {
|
|
11786
|
-
if (value === void 0) return void 0;
|
|
11787
|
-
const parsed = Number.parseInt(value, 10);
|
|
11788
|
-
if (!Number.isFinite(parsed) || parsed < 0) {
|
|
11789
|
-
throw new Error(`${label} must be a non-negative integer`);
|
|
11790
|
-
}
|
|
11791
|
-
return parsed;
|
|
11792
|
-
}
|
|
11793
|
-
function parsePositiveInteger3(value, label) {
|
|
11794
|
-
if (value === void 0) {
|
|
11795
|
-
throw new Error(`${label} is required`);
|
|
11796
|
-
}
|
|
11797
|
-
const parsed = Number.parseInt(value, 10);
|
|
11798
|
-
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
11799
|
-
throw new Error(`${label} must be a positive integer`);
|
|
11800
|
-
}
|
|
11801
|
-
return parsed;
|
|
11802
|
-
}
|
|
11803
|
-
function parseLimit4(value) {
|
|
11804
|
-
if (value === void 0) {
|
|
11805
|
-
return 50;
|
|
11806
|
-
}
|
|
11807
|
-
const parsed = parsePositiveInteger3(value, "limit");
|
|
11808
|
-
if (parsed > 200) {
|
|
11809
|
-
throw new Error("limit must be 200 or less");
|
|
11810
|
-
}
|
|
11811
|
-
return parsed;
|
|
11812
|
-
}
|
|
11813
|
-
function resultText(command) {
|
|
11814
|
-
if (!command.result) {
|
|
11815
|
-
return "";
|
|
11816
|
-
}
|
|
11817
|
-
return JSON.stringify(command.result, null, 2);
|
|
11818
|
-
}
|
|
11819
|
-
async function runReadCommand2(kind, options) {
|
|
11820
|
-
const timeoutSeconds = parseTimeoutSeconds2(options.timeout);
|
|
11821
|
-
const created = await createLocalBrowserReadCommand({
|
|
11822
|
-
kind,
|
|
11823
|
-
timeoutMs: timeoutSeconds * 1e3,
|
|
11824
|
-
...options.tabId ? { tabId: options.tabId } : {},
|
|
11825
|
-
...options.host ? { hostName: options.host } : {},
|
|
11826
|
-
...options.hostId ? { hostId: options.hostId } : {}
|
|
11827
|
-
});
|
|
11828
|
-
const deadline = Date.now() + timeoutSeconds * 1e3;
|
|
11829
|
-
while (Date.now() <= deadline) {
|
|
11830
|
-
const command = await getLocalBrowserReadCommand(created.commandId);
|
|
11831
|
-
if (command.status === "queued" || command.status === "running") {
|
|
11832
|
-
if (process.stdout.isTTY) {
|
|
11833
|
-
process.stdout.write(".");
|
|
11834
|
-
}
|
|
11835
|
-
await sleep3(1e3);
|
|
11836
|
-
continue;
|
|
11837
|
-
}
|
|
11838
|
-
if (process.stdout.isTTY) {
|
|
11839
|
-
process.stdout.write("\n");
|
|
11840
|
-
}
|
|
11841
|
-
if (command.status === "failed") {
|
|
11842
|
-
throw new Error(
|
|
11843
|
-
command.error ? `${command.error.code}: ${command.error.message}` : "Local-browser command failed"
|
|
11844
|
-
);
|
|
11845
|
-
}
|
|
11846
|
-
const text = resultText(command);
|
|
11847
|
-
if (text) {
|
|
11848
|
-
console.log(text);
|
|
11849
|
-
}
|
|
11850
|
-
return;
|
|
11851
|
-
}
|
|
11852
|
-
throw new Error(`Local-browser command timed out: ${created.commandId}`);
|
|
11853
|
-
}
|
|
11854
|
-
async function waitForCommand2(commandId, timeoutSeconds) {
|
|
11855
|
-
const deadline = Date.now() + timeoutSeconds * 1e3;
|
|
11856
|
-
while (Date.now() <= deadline) {
|
|
11857
|
-
const command = await getLocalBrowserReadCommand(commandId);
|
|
11858
|
-
if (command.status === "pending_approval" || command.status === "queued" || command.status === "running") {
|
|
11859
|
-
if (process.stdout.isTTY) {
|
|
11860
|
-
process.stdout.write(".");
|
|
11861
|
-
}
|
|
11862
|
-
await sleep3(1e3);
|
|
11863
|
-
continue;
|
|
11864
|
-
}
|
|
11865
|
-
if (process.stdout.isTTY) {
|
|
11866
|
-
process.stdout.write("\n");
|
|
11867
|
-
}
|
|
11868
|
-
if (command.status === "failed") {
|
|
11869
|
-
throw new Error(
|
|
11870
|
-
command.error ? `${command.error.code}: ${command.error.message}` : "Local-browser command failed"
|
|
11871
|
-
);
|
|
11872
|
-
}
|
|
11873
|
-
const text = resultText(command);
|
|
11874
|
-
if (text) {
|
|
11875
|
-
console.log(text);
|
|
11876
|
-
}
|
|
11877
|
-
return;
|
|
11878
|
-
}
|
|
11879
|
-
throw new Error(`Local-browser command timed out: ${commandId}`);
|
|
11880
|
-
}
|
|
11881
|
-
async function runWriteCommand2(kind, options, payload) {
|
|
11882
|
-
const timeoutSeconds = parseTimeoutSeconds2(options.timeout);
|
|
11883
|
-
const created = await createLocalBrowserWriteCommand({
|
|
11884
|
-
kind,
|
|
11885
|
-
timeoutMs: timeoutSeconds * 1e3,
|
|
11886
|
-
...options.tabId ? { tabId: options.tabId } : {},
|
|
11887
|
-
...options.host ? { hostName: options.host } : {},
|
|
11888
|
-
...options.hostId ? { hostId: options.hostId } : {},
|
|
11889
|
-
...payload
|
|
11890
|
-
});
|
|
11891
|
-
await waitForCommand2(created.commandId, timeoutSeconds);
|
|
11892
|
-
}
|
|
11893
|
-
function addReadOptions(command) {
|
|
11894
|
-
return command.option("--host <name>", "Run on a named local-browser host").option("--host-id <id>", "Run on a specific local-browser host id").option("--tab-id <id>", "Target a specific browser tab").option("--timeout <seconds>", "Maximum time to wait", "30");
|
|
11895
|
-
}
|
|
11896
|
-
function addWriteOptions(command, options = {}) {
|
|
11897
|
-
const withHostOptions = command.option("--host <name>", "Run on a named local-browser host").option("--host-id <id>", "Run on a specific local-browser host id").option("--timeout <seconds>", "Maximum time to wait", "30");
|
|
11898
|
-
return options.tabId === false ? withHostOptions : withHostOptions.option("--tab-id <id>", "Target a specific browser tab");
|
|
11899
|
-
}
|
|
11900
|
-
function readCommand(name, kind) {
|
|
11901
|
-
return addReadOptions(
|
|
11902
|
-
new Command().name(name).description(`Run ${kind}`).action(
|
|
11903
|
-
withErrorHandler(async (options) => {
|
|
11904
|
-
await runReadCommand2(kind, options);
|
|
11905
|
-
})
|
|
11906
|
-
)
|
|
11907
|
-
);
|
|
11908
|
-
}
|
|
11909
|
-
function formatCapabilities(capabilities) {
|
|
11910
|
-
return capabilities.length > 0 ? capabilities.join(", ") : "none";
|
|
11911
|
-
}
|
|
11912
|
-
function formatHost(host) {
|
|
11913
|
-
const status = host.status === "online" ? source_default.green("online") : source_default.dim("offline");
|
|
11914
|
-
return [
|
|
11915
|
-
`${status} ${host.displayName}`,
|
|
11916
|
-
` id: ${host.id}`,
|
|
11917
|
-
` browser: ${host.browser}`,
|
|
11918
|
-
` extension: ${host.extensionVersion}`,
|
|
11919
|
-
` last seen: ${host.lastSeenAt}`,
|
|
11920
|
-
` capabilities: ${formatCapabilities(host.supportedCapabilities)}`
|
|
11921
|
-
].join("\n");
|
|
11922
|
-
}
|
|
11923
|
-
function formatAuditEvent(event) {
|
|
11924
|
-
const parts = [
|
|
11925
|
-
event.createdAt,
|
|
11926
|
-
event.event,
|
|
11927
|
-
event.kind,
|
|
11928
|
-
`command=${event.commandId}`
|
|
11929
|
-
];
|
|
11930
|
-
if (event.hostId) {
|
|
11931
|
-
parts.push(`host=${event.hostId}`);
|
|
11932
|
-
}
|
|
11933
|
-
if (event.runId) {
|
|
11934
|
-
parts.push(`run=${event.runId}`);
|
|
11935
|
-
}
|
|
11936
|
-
if (event.tabId) {
|
|
11937
|
-
parts.push(`tab=${event.tabId}`);
|
|
11938
|
-
}
|
|
11939
|
-
if (event.targetUrl) {
|
|
11940
|
-
parts.push(`url=${event.targetUrl}`);
|
|
11941
|
-
}
|
|
11942
|
-
if (event.approvalOutcome) {
|
|
11943
|
-
parts.push(`approval=${event.approvalOutcome}`);
|
|
11944
|
-
}
|
|
11945
|
-
if (event.error) {
|
|
11946
|
-
parts.push(`error=${JSON.stringify(event.error)}`);
|
|
11947
|
-
}
|
|
11948
|
-
return parts.join(" ");
|
|
11949
|
-
}
|
|
11950
|
-
var hostsCommand = new Command().name("hosts").description("List and revoke linked local-browser hosts").addCommand(
|
|
11951
|
-
new Command().name("list").description("List linked local-browser hosts").option("--json", "Output hosts as JSON").action(
|
|
11952
|
-
withErrorHandler(async (options) => {
|
|
11953
|
-
const result = await listLocalBrowserHosts();
|
|
11954
|
-
if (options.json) {
|
|
11955
|
-
console.log(JSON.stringify(result));
|
|
11956
|
-
return;
|
|
11957
|
-
}
|
|
11958
|
-
if (result.hosts.length === 0) {
|
|
11959
|
-
console.log(source_default.dim("No linked local-browser hosts."));
|
|
11960
|
-
return;
|
|
11961
|
-
}
|
|
11962
|
-
console.log(result.hosts.map(formatHost).join("\n\n"));
|
|
11963
|
-
})
|
|
11964
|
-
)
|
|
11965
|
-
).addCommand(
|
|
11966
|
-
new Command().name("revoke").description("Revoke a linked local-browser host").argument("<host-id>", "Local-browser host id").option("--json", "Output the revoke result as JSON").action(
|
|
11967
|
-
withErrorHandler(async (hostId, options) => {
|
|
11968
|
-
const result = await deleteLocalBrowserHost(hostId);
|
|
11969
|
-
if (options.json) {
|
|
11970
|
-
console.log(JSON.stringify(result));
|
|
11971
|
-
return;
|
|
11972
|
-
}
|
|
11973
|
-
console.log(source_default.green("Local-browser host revoked"));
|
|
11974
|
-
console.log(source_default.dim(` Host: ${hostId}`));
|
|
11975
|
-
})
|
|
11976
|
-
)
|
|
11977
|
-
);
|
|
11978
|
-
var auditCommand = new Command().name("audit").description("Inspect local-browser write command audit events").addCommand(
|
|
11979
|
-
new Command().name("list").description("List local-browser write command audit events").option("--limit <count>", "Maximum events to show", "50").option("--command-id <id>", "Filter by command id").option("--host-id <id>", "Filter by host id").option("--run-id <id>", "Filter by run id").option("--json", "Output audit events as JSON").action(
|
|
11980
|
-
withErrorHandler(async (options) => {
|
|
11981
|
-
const result = await listLocalBrowserAuditEvents({
|
|
11982
|
-
limit: parseLimit4(options.limit),
|
|
11983
|
-
...options.commandId ? { commandId: options.commandId } : {},
|
|
11984
|
-
...options.hostId ? { hostId: options.hostId } : {},
|
|
11985
|
-
...options.runId ? { runId: options.runId } : {}
|
|
11986
|
-
});
|
|
11987
|
-
if (options.json) {
|
|
11988
|
-
console.log(JSON.stringify(result));
|
|
11989
|
-
return;
|
|
11990
|
-
}
|
|
11991
|
-
if (result.auditEvents.length === 0) {
|
|
11992
|
-
console.log(source_default.dim("No local-browser audit events found."));
|
|
11993
|
-
return;
|
|
11994
|
-
}
|
|
11995
|
-
console.log(result.auditEvents.map(formatAuditEvent).join("\n"));
|
|
11996
|
-
})
|
|
11997
|
-
)
|
|
11998
|
-
);
|
|
11999
|
-
var tabsCommand = new Command().name("tabs").description("Read and control browser tabs").addCommand(readCommand("list", "tabs.list")).addCommand(readCommand("current", "tabs.current")).addCommand(
|
|
12000
|
-
addWriteOptions(
|
|
12001
|
-
new Command().name("activate").description("Run tabs.activate").requiredOption("--tab-id <id>", "Tab to activate").action(
|
|
12002
|
-
withErrorHandler(async (options) => {
|
|
12003
|
-
await runWriteCommand2("tabs.activate", options, {});
|
|
12004
|
-
})
|
|
12005
|
-
),
|
|
12006
|
-
{ tabId: false }
|
|
12007
|
-
)
|
|
12008
|
-
).addCommand(
|
|
12009
|
-
addWriteOptions(
|
|
12010
|
-
new Command().name("open").description("Run tabs.open").requiredOption("--url <url>", "URL to open").action(
|
|
12011
|
-
withErrorHandler(async (options) => {
|
|
12012
|
-
await runWriteCommand2("tabs.open", options, { url: options.url });
|
|
12013
|
-
})
|
|
12014
|
-
)
|
|
12015
|
-
)
|
|
12016
|
-
).addCommand(
|
|
12017
|
-
addWriteOptions(
|
|
12018
|
-
new Command().name("close").description("Run tabs.close").requiredOption("--tab-id <id>", "Tab to close").action(
|
|
12019
|
-
withErrorHandler(async (options) => {
|
|
12020
|
-
await runWriteCommand2("tabs.close", options, {});
|
|
12021
|
-
})
|
|
12022
|
-
),
|
|
12023
|
-
{ tabId: false }
|
|
12024
|
-
)
|
|
12025
|
-
);
|
|
12026
|
-
var pageCommand = new Command().name("page").description("Read and control the active browser page").addCommand(readCommand("snapshot", "page.snapshot")).addCommand(readCommand("screenshot", "page.screenshot")).addCommand(readCommand("selection", "page.selection")).addCommand(readCommand("metadata", "page.metadata")).addCommand(
|
|
12027
|
-
addWriteOptions(
|
|
12028
|
-
new Command().name("click").description("Run page.click").option("--selector <selector>", "CSS selector to click").option("--x <pixels>", "X coordinate to click").option("--y <pixels>", "Y coordinate to click").action(
|
|
12029
|
-
withErrorHandler(async (options) => {
|
|
12030
|
-
await runWriteCommand2("page.click", options, {
|
|
12031
|
-
...options.selector ? { selector: options.selector } : {},
|
|
12032
|
-
...options.x !== void 0 ? { x: parseOptionalNonNegativeInteger2(options.x, "x") } : {},
|
|
12033
|
-
...options.y !== void 0 ? { y: parseOptionalNonNegativeInteger2(options.y, "y") } : {}
|
|
12034
|
-
});
|
|
12035
|
-
})
|
|
12036
|
-
)
|
|
12037
|
-
)
|
|
12038
|
-
).addCommand(
|
|
12039
|
-
addWriteOptions(
|
|
12040
|
-
new Command().name("type").description("Run page.type").requiredOption("--selector <selector>", "CSS selector to type into").requiredOption("--text <text>", "Text to type").action(
|
|
12041
|
-
withErrorHandler(async (options) => {
|
|
12042
|
-
await runWriteCommand2("page.type", options, {
|
|
12043
|
-
selector: options.selector,
|
|
12044
|
-
text: options.text
|
|
12045
|
-
});
|
|
12046
|
-
})
|
|
12047
|
-
)
|
|
12048
|
-
)
|
|
12049
|
-
).addCommand(
|
|
12050
|
-
addWriteOptions(
|
|
12051
|
-
new Command().name("scroll").description("Run page.scroll").option(
|
|
12052
|
-
"--direction <direction>",
|
|
12053
|
-
"Scroll direction: up or down",
|
|
12054
|
-
"down"
|
|
12055
|
-
).option("--amount <pixels>", "Scroll amount in pixels", "600").action(
|
|
12056
|
-
withErrorHandler(async (options) => {
|
|
12057
|
-
if (options.direction !== "up" && options.direction !== "down") {
|
|
12058
|
-
throw new Error("direction must be up or down");
|
|
12059
|
-
}
|
|
12060
|
-
await runWriteCommand2("page.scroll", options, {
|
|
12061
|
-
direction: options.direction,
|
|
12062
|
-
amount: parsePositiveInteger3(options.amount, "amount")
|
|
12063
|
-
});
|
|
12064
|
-
})
|
|
12065
|
-
)
|
|
12066
|
-
)
|
|
12067
|
-
).addCommand(
|
|
12068
|
-
addWriteOptions(
|
|
12069
|
-
new Command().name("navigate").description("Run page.navigate").requiredOption("--url <url>", "URL to navigate to").action(
|
|
12070
|
-
withErrorHandler(async (options) => {
|
|
12071
|
-
await runWriteCommand2("page.navigate", options, {
|
|
12072
|
-
url: options.url
|
|
12073
|
-
});
|
|
12074
|
-
})
|
|
12075
|
-
)
|
|
12076
|
-
)
|
|
12077
|
-
);
|
|
12078
|
-
var zeroLocalBrowserCommand = new Command().name("local-browser").description("Read and manage authorized browser context").addHelpText(
|
|
12079
|
-
"after",
|
|
12080
|
-
`
|
|
12081
|
-
Examples:
|
|
12082
|
-
List hosts? zero local-browser hosts list
|
|
12083
|
-
Revoke host? zero local-browser hosts revoke <host-id>
|
|
12084
|
-
List tabs? zero local-browser tabs list
|
|
12085
|
-
Current tab? zero local-browser tabs current
|
|
12086
|
-
Click page? zero local-browser page click --selector button
|
|
12087
|
-
Open tab? zero local-browser tabs open --url https://example.com
|
|
12088
|
-
Audit actions? zero local-browser audit list`
|
|
12089
|
-
).addCommand(hostsCommand).addCommand(auditCommand).addCommand(tabsCommand).addCommand(pageCommand);
|
|
12090
|
-
|
|
12091
11887
|
// src/commands/zero/host/index.ts
|
|
12092
11888
|
init_esm_shims();
|
|
12093
11889
|
|
|
@@ -12425,15 +12221,15 @@ function parseLongitude(value) {
|
|
|
12425
12221
|
}
|
|
12426
12222
|
return longitude;
|
|
12427
12223
|
}
|
|
12428
|
-
function
|
|
12224
|
+
function parsePositiveInteger3(value) {
|
|
12429
12225
|
const parsed = Number(value);
|
|
12430
12226
|
if (!Number.isInteger(parsed) || parsed < 1) {
|
|
12431
12227
|
throw new InvalidArgumentError("value must be a positive integer");
|
|
12432
12228
|
}
|
|
12433
12229
|
return parsed;
|
|
12434
12230
|
}
|
|
12435
|
-
function
|
|
12436
|
-
const limit =
|
|
12231
|
+
function parseLimit4(value) {
|
|
12232
|
+
const limit = parsePositiveInteger3(value);
|
|
12437
12233
|
if (limit > 20) {
|
|
12438
12234
|
throw new InvalidArgumentError("limit must be between 1 and 20");
|
|
12439
12235
|
}
|
|
@@ -12529,11 +12325,11 @@ var directionsCommand = new Command().name("directions").description("Get a rout
|
|
|
12529
12325
|
var placesSearchCommand = new Command().name("search").description("Search for places").requiredOption("--query <query>", "Place search query").option("--location <lat,lng>", "Optional location bias").option(
|
|
12530
12326
|
"--radius <meters>",
|
|
12531
12327
|
"Optional search radius in meters",
|
|
12532
|
-
|
|
12328
|
+
parsePositiveInteger3
|
|
12533
12329
|
).option(
|
|
12534
12330
|
"--limit <n>",
|
|
12535
12331
|
"Maximum places to return, from 1 to 20",
|
|
12536
|
-
|
|
12332
|
+
parseLimit4,
|
|
12537
12333
|
5
|
|
12538
12334
|
).option("--region <code>", "Optional region bias, such as US or CN").option("--json", "Print the raw maps response as JSON").action(
|
|
12539
12335
|
withErrorHandler(async (options) => {
|
|
@@ -12741,9 +12537,7 @@ var COMMAND_CAPABILITY_MAP = {
|
|
|
12741
12537
|
generate: "file:write",
|
|
12742
12538
|
web: null,
|
|
12743
12539
|
host: "host:write",
|
|
12744
|
-
maps: "maps:read"
|
|
12745
|
-
"local-agent": ["local-agent:read", "local-agent:write"],
|
|
12746
|
-
"local-browser": ["local-browser:read", "local-browser:write"]
|
|
12540
|
+
maps: "maps:read"
|
|
12747
12541
|
};
|
|
12748
12542
|
var DEFAULT_COMMANDS = [
|
|
12749
12543
|
zeroOrgCommand,
|
|
@@ -12772,9 +12566,7 @@ var DEFAULT_COMMANDS = [
|
|
|
12772
12566
|
generateCommand,
|
|
12773
12567
|
zeroWebCommand,
|
|
12774
12568
|
zeroHostCommand,
|
|
12775
|
-
zeroMapsCommand
|
|
12776
|
-
zeroLocalAgentCommand,
|
|
12777
|
-
zeroLocalBrowserCommand
|
|
12569
|
+
zeroMapsCommand
|
|
12778
12570
|
];
|
|
12779
12571
|
function shouldHideCommand(name, payload) {
|
|
12780
12572
|
if (!payload) return false;
|
|
@@ -12815,7 +12607,6 @@ function buildZeroHelpText(payload = decodeZeroTokenPayload()) {
|
|
|
12815
12607
|
' Generate image? zero generate image --prompt "..."',
|
|
12816
12608
|
...zeroTokenAllowsFeatureSwitch("hostedSites" /* HostedSites */, payload) ? [' Generate website? zero generate website --prompt "..."'] : [],
|
|
12817
12609
|
' Generate voice? zero generate voice --prompt "..."',
|
|
12818
|
-
...shouldHideCommand("local-browser", payload) ? [] : [" Read browser context? zero local-browser --help"],
|
|
12819
12610
|
...shouldHideCommand("host", payload) ? [] : [" Host a static site? zero host ./dist --site my-site --spa"],
|
|
12820
12611
|
...shouldHideCommand("maps", payload) ? [] : [
|
|
12821
12612
|
' Get directions? zero maps directions --origin "SFO" --destination "Mountain View" --json'
|
|
@@ -12837,7 +12628,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
12837
12628
|
var program = new Command();
|
|
12838
12629
|
program.name("zero").description(
|
|
12839
12630
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
12840
|
-
).version("9.
|
|
12631
|
+
).version("9.173.0").addHelpText("after", () => {
|
|
12841
12632
|
return buildZeroHelpText();
|
|
12842
12633
|
});
|
|
12843
12634
|
if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {
|