@vm0/cli 9.161.8 → 9.162.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-BWCVGYRL.js → chunk-I3LF3KZW.js} +6791 -4397
- package/{chunk-BWCVGYRL.js.map → chunk-I3LF3KZW.js.map} +1 -1
- package/index.js +9 -9
- package/package.json +1 -1
- package/zero.js +922 -78
- package/zero.js.map +1 -1
package/zero.js
CHANGED
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
connectorTypeSchema,
|
|
22
22
|
createComputerUseReadCommand,
|
|
23
23
|
createComputerUseWriteCommand,
|
|
24
|
+
createGithubLabelListener,
|
|
24
25
|
createLocalBrowserReadCommand,
|
|
25
26
|
createLocalBrowserWriteCommand,
|
|
26
27
|
createSkill,
|
|
@@ -29,6 +30,7 @@ import {
|
|
|
29
30
|
createZeroRun,
|
|
30
31
|
decodeCliTokenPayload,
|
|
31
32
|
decodeZeroTokenPayload,
|
|
33
|
+
deleteGithubLabelListener,
|
|
32
34
|
deleteLocalBrowserHost,
|
|
33
35
|
deleteSkill,
|
|
34
36
|
deleteZeroAgent,
|
|
@@ -64,6 +66,7 @@ import {
|
|
|
64
66
|
getConnectorGenerationTypes,
|
|
65
67
|
getConnectorTypeForSecretName,
|
|
66
68
|
getDefaultAuthMethod,
|
|
69
|
+
getGithubInstallation,
|
|
67
70
|
getLocalBrowserReadCommand,
|
|
68
71
|
getScopeDiff,
|
|
69
72
|
getSecretsForAuthMethod,
|
|
@@ -139,6 +142,7 @@ import {
|
|
|
139
142
|
source_default,
|
|
140
143
|
submitDeveloperSupport,
|
|
141
144
|
switchZeroOrg,
|
|
145
|
+
updateGithubLabelListener,
|
|
142
146
|
updateSkill,
|
|
143
147
|
updateZeroAgent,
|
|
144
148
|
updateZeroAgentInstructions,
|
|
@@ -150,7 +154,7 @@ import {
|
|
|
150
154
|
zeroAgentCustomSkillNameSchema,
|
|
151
155
|
zeroLocalAgentCommand,
|
|
152
156
|
zeroTokenAllowsFeatureSwitch
|
|
153
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-I3LF3KZW.js";
|
|
154
158
|
import {
|
|
155
159
|
__commonJS,
|
|
156
160
|
__require,
|
|
@@ -30362,6 +30366,46 @@ var BUILT_IN_GENERATION_PROVIDERS = {
|
|
|
30362
30366
|
reason: "available without connector setup"
|
|
30363
30367
|
}
|
|
30364
30368
|
],
|
|
30369
|
+
report: [
|
|
30370
|
+
{
|
|
30371
|
+
label: "Built-in",
|
|
30372
|
+
model: "gpt-5.5",
|
|
30373
|
+
command: "zero built-in generate report -h",
|
|
30374
|
+
reason: "available without connector setup"
|
|
30375
|
+
}
|
|
30376
|
+
],
|
|
30377
|
+
"docs-design": [
|
|
30378
|
+
{
|
|
30379
|
+
label: "Built-in",
|
|
30380
|
+
model: "gpt-5.5",
|
|
30381
|
+
command: "zero built-in generate docs-design -h",
|
|
30382
|
+
reason: "available without connector setup"
|
|
30383
|
+
}
|
|
30384
|
+
],
|
|
30385
|
+
poster: [
|
|
30386
|
+
{
|
|
30387
|
+
label: "Built-in",
|
|
30388
|
+
model: "gpt-5.5",
|
|
30389
|
+
command: "zero built-in generate poster -h",
|
|
30390
|
+
reason: "available without connector setup"
|
|
30391
|
+
}
|
|
30392
|
+
],
|
|
30393
|
+
"dashboard-design": [
|
|
30394
|
+
{
|
|
30395
|
+
label: "Built-in",
|
|
30396
|
+
model: "gpt-5.5",
|
|
30397
|
+
command: "zero built-in generate dashboard-design -h",
|
|
30398
|
+
reason: "available without connector setup"
|
|
30399
|
+
}
|
|
30400
|
+
],
|
|
30401
|
+
"mobile-app-design": [
|
|
30402
|
+
{
|
|
30403
|
+
label: "Built-in",
|
|
30404
|
+
model: "gpt-5.5",
|
|
30405
|
+
command: "zero built-in generate mobile-app-design -h",
|
|
30406
|
+
reason: "available without connector setup"
|
|
30407
|
+
}
|
|
30408
|
+
],
|
|
30365
30409
|
website: [
|
|
30366
30410
|
{
|
|
30367
30411
|
label: "Built-in",
|
|
@@ -30427,6 +30471,31 @@ var BUILT_IN_GENERATION_COMMANDS = {
|
|
|
30427
30471
|
command: "zero built-in generate presentation -h",
|
|
30428
30472
|
models: "gpt-5.5"
|
|
30429
30473
|
},
|
|
30474
|
+
report: {
|
|
30475
|
+
label: "Built-in report generation",
|
|
30476
|
+
command: "zero built-in generate report -h",
|
|
30477
|
+
models: "gpt-5.5"
|
|
30478
|
+
},
|
|
30479
|
+
"docs-design": {
|
|
30480
|
+
label: "Built-in docs design generation",
|
|
30481
|
+
command: "zero built-in generate docs-design -h",
|
|
30482
|
+
models: "gpt-5.5"
|
|
30483
|
+
},
|
|
30484
|
+
poster: {
|
|
30485
|
+
label: "Built-in poster generation",
|
|
30486
|
+
command: "zero built-in generate poster -h",
|
|
30487
|
+
models: "gpt-5.5"
|
|
30488
|
+
},
|
|
30489
|
+
"dashboard-design": {
|
|
30490
|
+
label: "Built-in dashboard design generation",
|
|
30491
|
+
command: "zero built-in generate dashboard-design -h",
|
|
30492
|
+
models: "gpt-5.5"
|
|
30493
|
+
},
|
|
30494
|
+
"mobile-app-design": {
|
|
30495
|
+
label: "Built-in mobile app design generation",
|
|
30496
|
+
command: "zero built-in generate mobile-app-design -h",
|
|
30497
|
+
models: "gpt-5.5"
|
|
30498
|
+
},
|
|
30430
30499
|
website: {
|
|
30431
30500
|
label: "Built-in website generation",
|
|
30432
30501
|
command: "zero built-in generate website -h",
|
|
@@ -30447,31 +30516,65 @@ var GENERATION_TYPE_ORDER = [
|
|
|
30447
30516
|
"code",
|
|
30448
30517
|
"document",
|
|
30449
30518
|
"presentation",
|
|
30450
|
-
"website"
|
|
30519
|
+
"website",
|
|
30520
|
+
"report",
|
|
30521
|
+
"docs-design",
|
|
30522
|
+
"poster",
|
|
30523
|
+
"dashboard-design",
|
|
30524
|
+
"mobile-app-design"
|
|
30451
30525
|
];
|
|
30452
30526
|
var GENERATION_TYPE_LABELS = {
|
|
30453
30527
|
audio: "Audio",
|
|
30454
30528
|
code: "Code",
|
|
30529
|
+
"dashboard-design": "Dashboard design",
|
|
30455
30530
|
document: "Document",
|
|
30531
|
+
"docs-design": "Docs design",
|
|
30456
30532
|
image: "Image",
|
|
30533
|
+
"mobile-app-design": "Mobile app design",
|
|
30534
|
+
poster: "Poster",
|
|
30457
30535
|
presentation: "Presentation",
|
|
30536
|
+
report: "Report",
|
|
30458
30537
|
text: "Text",
|
|
30459
30538
|
video: "Video",
|
|
30460
30539
|
voice: "Voice",
|
|
30461
30540
|
website: "Website"
|
|
30462
30541
|
};
|
|
30463
30542
|
function getConnectorGenerationType(generationType) {
|
|
30464
|
-
|
|
30465
|
-
|
|
30543
|
+
switch (generationType) {
|
|
30544
|
+
case "voice":
|
|
30545
|
+
return "audio";
|
|
30546
|
+
case "dashboard-design":
|
|
30547
|
+
case "docs-design":
|
|
30548
|
+
case "mobile-app-design":
|
|
30549
|
+
case "poster":
|
|
30550
|
+
case "report":
|
|
30551
|
+
return null;
|
|
30552
|
+
case "audio":
|
|
30553
|
+
case "code":
|
|
30554
|
+
case "document":
|
|
30555
|
+
case "image":
|
|
30556
|
+
case "presentation":
|
|
30557
|
+
case "text":
|
|
30558
|
+
case "video":
|
|
30559
|
+
case "website":
|
|
30560
|
+
return generationType;
|
|
30466
30561
|
}
|
|
30467
|
-
return generationType;
|
|
30468
30562
|
}
|
|
30469
30563
|
function getBuiltInProviders(generationType) {
|
|
30564
|
+
if (isOpenDesignArtifactGenerationType(generationType) && !zeroTokenAllowsFeatureSwitch("openDesignGenerate" /* OpenDesignGenerate */)) {
|
|
30565
|
+
return [];
|
|
30566
|
+
}
|
|
30470
30567
|
return BUILT_IN_GENERATION_PROVIDERS[generationType] ?? [];
|
|
30471
30568
|
}
|
|
30472
30569
|
function getBuiltInCommand(generationType) {
|
|
30570
|
+
if (isOpenDesignArtifactGenerationType(generationType) && !zeroTokenAllowsFeatureSwitch("openDesignGenerate" /* OpenDesignGenerate */)) {
|
|
30571
|
+
return null;
|
|
30572
|
+
}
|
|
30473
30573
|
return BUILT_IN_GENERATION_COMMANDS[generationType] ?? null;
|
|
30474
30574
|
}
|
|
30575
|
+
function isOpenDesignArtifactGenerationType(generationType) {
|
|
30576
|
+
return generationType === "dashboard-design" || generationType === "docs-design" || generationType === "mobile-app-design" || generationType === "poster" || generationType === "report";
|
|
30577
|
+
}
|
|
30475
30578
|
function getAvailableGenerationTypes() {
|
|
30476
30579
|
const available = /* @__PURE__ */ new Set();
|
|
30477
30580
|
for (const type of CONNECTOR_TYPE_KEYS) {
|
|
@@ -30480,7 +30583,8 @@ function getAvailableGenerationTypes() {
|
|
|
30480
30583
|
}
|
|
30481
30584
|
}
|
|
30482
30585
|
return GENERATION_TYPE_ORDER.filter((type) => {
|
|
30483
|
-
|
|
30586
|
+
const connectorGenerationType = getConnectorGenerationType(type);
|
|
30587
|
+
return getBuiltInProviders(type).length > 0 || connectorGenerationType !== null && available.has(connectorGenerationType);
|
|
30484
30588
|
});
|
|
30485
30589
|
}
|
|
30486
30590
|
function parseGenerationType(value) {
|
|
@@ -30680,7 +30784,7 @@ var generateCommand = new Command().name("generate").description("Show generatio
|
|
|
30680
30784
|
);
|
|
30681
30785
|
const configuredTypes = new Set(connectorList.configuredTypes);
|
|
30682
30786
|
const authorizedTypes = enabledTypes ? new Set(enabledTypes) : null;
|
|
30683
|
-
const candidates = getGenerationConnectors(connectorGenerationType).map(
|
|
30787
|
+
const candidates = connectorGenerationType ? getGenerationConnectors(connectorGenerationType).map(
|
|
30684
30788
|
([connectorType, config]) => {
|
|
30685
30789
|
return toCandidate({
|
|
30686
30790
|
type: connectorType,
|
|
@@ -30692,7 +30796,7 @@ var generateCommand = new Command().name("generate").description("Show generatio
|
|
|
30692
30796
|
platformOrigin
|
|
30693
30797
|
});
|
|
30694
30798
|
}
|
|
30695
|
-
);
|
|
30799
|
+
) : [];
|
|
30696
30800
|
const ready = candidates.filter((candidate) => {
|
|
30697
30801
|
return candidate.status === "ready";
|
|
30698
30802
|
});
|
|
@@ -32385,28 +32489,36 @@ init_esm_shims();
|
|
|
32385
32489
|
init_esm_shims();
|
|
32386
32490
|
import { basename, join } from "path";
|
|
32387
32491
|
import { tmpdir } from "os";
|
|
32388
|
-
function
|
|
32389
|
-
|
|
32390
|
-
const
|
|
32391
|
-
|
|
32392
|
-
|
|
32393
|
-
|
|
32394
|
-
|
|
32492
|
+
function filenameFromUrl(fileUrl) {
|
|
32493
|
+
if (URL.canParse(fileUrl)) {
|
|
32494
|
+
const segment = new URL(fileUrl).pathname.split("/").filter(Boolean).pop();
|
|
32495
|
+
if (!segment) {
|
|
32496
|
+
return "file";
|
|
32497
|
+
}
|
|
32498
|
+
try {
|
|
32499
|
+
return decodeURIComponent(segment);
|
|
32500
|
+
} catch {
|
|
32501
|
+
return segment;
|
|
32502
|
+
}
|
|
32395
32503
|
}
|
|
32504
|
+
return basename(fileUrl) || "file";
|
|
32505
|
+
}
|
|
32506
|
+
function defaultOutPath(fileUrl, filename) {
|
|
32507
|
+
return join(tmpdir(), `github-${filename || filenameFromUrl(fileUrl)}`);
|
|
32396
32508
|
}
|
|
32397
|
-
var downloadFileCommand = new Command().name("download-file").description("Download a
|
|
32509
|
+
var downloadFileCommand = new Command().name("download-file").description("Download a file from a GitHub context block").argument("<url>", "URL from a [GitHub file] block").option(
|
|
32398
32510
|
"-o, --out <path>",
|
|
32399
|
-
"Output path for the downloaded file (default: /tmp/github-<url-basename>)"
|
|
32511
|
+
"Output path for the downloaded file (default: /tmp/github-<filename-or-url-basename>)"
|
|
32400
32512
|
).option("--filename <name>", "Filename hint from the [GitHub file] block").addHelpText(
|
|
32401
32513
|
"after",
|
|
32402
32514
|
`
|
|
32403
32515
|
Examples:
|
|
32404
|
-
Download to default temp path: zero github download-file https://github.com/user-attachments/assets/abc123
|
|
32516
|
+
Download to default temp path: zero github download-file https://github.com/user-attachments/assets/abc123 --filename screenshot.png
|
|
32405
32517
|
Download to explicit path: zero github download-file https://github.com/user-attachments/assets/abc123 -o /tmp/screenshot.png
|
|
32406
32518
|
|
|
32407
32519
|
Output:
|
|
32408
32520
|
Prints a JSON object to stdout on success:
|
|
32409
|
-
{"path":"/tmp/github-
|
|
32521
|
+
{"path":"/tmp/github-screenshot.png","mimetype":"image/png","size":12345}
|
|
32410
32522
|
|
|
32411
32523
|
How to read the downloaded file:
|
|
32412
32524
|
- Images (png/jpg/gif/webp/svg): open the file path with your image viewing tool
|
|
@@ -32416,12 +32528,12 @@ How to read the downloaded file:
|
|
|
32416
32528
|
- PDF/text/csv/json/markdown: read the file directly
|
|
32417
32529
|
|
|
32418
32530
|
Notes:
|
|
32419
|
-
-
|
|
32420
|
-
- Streams the file bytes directly to disk`
|
|
32531
|
+
- The URL comes from a [GitHub file] block
|
|
32532
|
+
- Streams the GitHub file bytes through VM0 directly to disk`
|
|
32421
32533
|
).action(
|
|
32422
32534
|
withErrorHandler(
|
|
32423
32535
|
async (fileUrl, options) => {
|
|
32424
|
-
const outPath = options.out ?? defaultOutPath(fileUrl);
|
|
32536
|
+
const outPath = options.out ?? defaultOutPath(fileUrl, options.filename);
|
|
32425
32537
|
const result = await downloadGithubFile(
|
|
32426
32538
|
fileUrl,
|
|
32427
32539
|
outPath,
|
|
@@ -32432,6 +32544,160 @@ Notes:
|
|
|
32432
32544
|
)
|
|
32433
32545
|
);
|
|
32434
32546
|
|
|
32547
|
+
// src/commands/zero/github/label-listener/index.ts
|
|
32548
|
+
init_esm_shims();
|
|
32549
|
+
function parseTriggerMode(value) {
|
|
32550
|
+
if (value === "created_by_me" || value === "anyone") {
|
|
32551
|
+
return value;
|
|
32552
|
+
}
|
|
32553
|
+
throw new Error("trigger-mode must be one of: created_by_me, anyone");
|
|
32554
|
+
}
|
|
32555
|
+
function enabledLabel(listener) {
|
|
32556
|
+
return listener.enabled ? source_default.green("yes") : source_default.dim("no");
|
|
32557
|
+
}
|
|
32558
|
+
function manageableLabel(listener) {
|
|
32559
|
+
return listener.canManage ? source_default.green("yes") : source_default.dim("no");
|
|
32560
|
+
}
|
|
32561
|
+
function printListeners(listeners) {
|
|
32562
|
+
if (listeners.length === 0) {
|
|
32563
|
+
console.log(source_default.dim("No GitHub label listeners found"));
|
|
32564
|
+
return;
|
|
32565
|
+
}
|
|
32566
|
+
const idWidth = Math.max(
|
|
32567
|
+
2,
|
|
32568
|
+
...listeners.map((listener) => {
|
|
32569
|
+
return listener.id.length;
|
|
32570
|
+
})
|
|
32571
|
+
);
|
|
32572
|
+
const labelWidth = Math.max(
|
|
32573
|
+
5,
|
|
32574
|
+
...listeners.map((listener) => {
|
|
32575
|
+
return listener.labelName.length;
|
|
32576
|
+
})
|
|
32577
|
+
);
|
|
32578
|
+
const agentWidth = Math.max(
|
|
32579
|
+
5,
|
|
32580
|
+
...listeners.map((listener) => {
|
|
32581
|
+
return (listener.agent?.name ?? "-").length;
|
|
32582
|
+
})
|
|
32583
|
+
);
|
|
32584
|
+
console.log(
|
|
32585
|
+
source_default.dim(
|
|
32586
|
+
[
|
|
32587
|
+
"ID".padEnd(idWidth),
|
|
32588
|
+
"LABEL".padEnd(labelWidth),
|
|
32589
|
+
"AGENT".padEnd(agentWidth),
|
|
32590
|
+
"TRIGGER".padEnd(13),
|
|
32591
|
+
"ENABLED",
|
|
32592
|
+
"CAN MANAGE"
|
|
32593
|
+
].join(" ")
|
|
32594
|
+
)
|
|
32595
|
+
);
|
|
32596
|
+
for (const listener of listeners) {
|
|
32597
|
+
console.log(
|
|
32598
|
+
[
|
|
32599
|
+
listener.id.padEnd(idWidth),
|
|
32600
|
+
listener.labelName.padEnd(labelWidth),
|
|
32601
|
+
(listener.agent?.name ?? "-").padEnd(agentWidth),
|
|
32602
|
+
listener.triggerMode.padEnd(13),
|
|
32603
|
+
enabledLabel(listener).padEnd(7),
|
|
32604
|
+
manageableLabel(listener)
|
|
32605
|
+
].join(" ")
|
|
32606
|
+
);
|
|
32607
|
+
}
|
|
32608
|
+
}
|
|
32609
|
+
var listCommand9 = new Command().name("list").alias("ls").description("List GitHub label listeners for the active organization").option("--json", "Print raw JSON").action(
|
|
32610
|
+
withErrorHandler(async (options) => {
|
|
32611
|
+
const installation = await getGithubInstallation();
|
|
32612
|
+
if (options.json) {
|
|
32613
|
+
console.log(JSON.stringify(installation.labelListeners));
|
|
32614
|
+
return;
|
|
32615
|
+
}
|
|
32616
|
+
printListeners(installation.labelListeners);
|
|
32617
|
+
})
|
|
32618
|
+
);
|
|
32619
|
+
var createCommand2 = new Command().name("create").description("Create a GitHub label listener").requiredOption("--label <name>", "GitHub label name to watch").requiredOption(
|
|
32620
|
+
"--agent-id <id>",
|
|
32621
|
+
"Agent ID to run when the label is applied"
|
|
32622
|
+
).requiredOption("--prompt <text>", "Prompt to pass to the agent").option(
|
|
32623
|
+
"--trigger-mode <mode>",
|
|
32624
|
+
"Who can trigger the listener: anyone | created_by_me",
|
|
32625
|
+
"anyone"
|
|
32626
|
+
).option("--disabled", "Create the listener disabled").option("--json", "Print raw JSON").action(
|
|
32627
|
+
withErrorHandler(
|
|
32628
|
+
async (options) => {
|
|
32629
|
+
const result = await createGithubLabelListener({
|
|
32630
|
+
labelName: options.label,
|
|
32631
|
+
agentId: options.agentId,
|
|
32632
|
+
prompt: options.prompt,
|
|
32633
|
+
triggerMode: parseTriggerMode(options.triggerMode),
|
|
32634
|
+
enabled: options.disabled ? false : void 0
|
|
32635
|
+
});
|
|
32636
|
+
if (options.json) {
|
|
32637
|
+
console.log(JSON.stringify(result.listener));
|
|
32638
|
+
return;
|
|
32639
|
+
}
|
|
32640
|
+
console.log(`Created GitHub label listener ${result.listener.id}`);
|
|
32641
|
+
}
|
|
32642
|
+
)
|
|
32643
|
+
);
|
|
32644
|
+
var updateCommand = new Command().name("update").alias("edit").description("Update a GitHub label listener").argument("<listener-id>", "GitHub label listener ID").option("--label <name>", "New GitHub label name").option("--agent-id <id>", "New agent ID").option("--prompt <text>", "New prompt").option(
|
|
32645
|
+
"--trigger-mode <mode>",
|
|
32646
|
+
"Who can trigger the listener: anyone | created_by_me"
|
|
32647
|
+
).option("--enable", "Enable the listener").option("--disable", "Disable the listener").option("--json", "Print raw JSON").action(
|
|
32648
|
+
withErrorHandler(
|
|
32649
|
+
async (listenerId, options) => {
|
|
32650
|
+
if (options.enable && options.disable) {
|
|
32651
|
+
throw new Error("Use only one of --enable or --disable");
|
|
32652
|
+
}
|
|
32653
|
+
const body = {};
|
|
32654
|
+
if (options.label !== void 0) body.labelName = options.label;
|
|
32655
|
+
if (options.agentId !== void 0) body.agentId = options.agentId;
|
|
32656
|
+
if (options.prompt !== void 0) body.prompt = options.prompt;
|
|
32657
|
+
if (options.triggerMode !== void 0) {
|
|
32658
|
+
body.triggerMode = parseTriggerMode(options.triggerMode);
|
|
32659
|
+
}
|
|
32660
|
+
if (options.enable) body.enabled = true;
|
|
32661
|
+
if (options.disable) body.enabled = false;
|
|
32662
|
+
if (Object.keys(body).length === 0) {
|
|
32663
|
+
throw new Error(
|
|
32664
|
+
"Provide at least one change: --label, --agent-id, --prompt, --trigger-mode, --enable, or --disable"
|
|
32665
|
+
);
|
|
32666
|
+
}
|
|
32667
|
+
const result = await updateGithubLabelListener(listenerId, body);
|
|
32668
|
+
if (options.json) {
|
|
32669
|
+
console.log(JSON.stringify(result.listener));
|
|
32670
|
+
return;
|
|
32671
|
+
}
|
|
32672
|
+
console.log(`Updated GitHub label listener ${result.listener.id}`);
|
|
32673
|
+
}
|
|
32674
|
+
)
|
|
32675
|
+
);
|
|
32676
|
+
var deleteCommand5 = new Command().name("delete").alias("rm").description("Delete a GitHub label listener").argument("<listener-id>", "GitHub label listener ID").option("--json", "Print raw JSON").action(
|
|
32677
|
+
withErrorHandler(
|
|
32678
|
+
async (listenerId, options) => {
|
|
32679
|
+
const result = await deleteGithubLabelListener(listenerId);
|
|
32680
|
+
if (options.json) {
|
|
32681
|
+
console.log(JSON.stringify(result));
|
|
32682
|
+
return;
|
|
32683
|
+
}
|
|
32684
|
+
console.log(`Deleted GitHub label listener ${listenerId}`);
|
|
32685
|
+
}
|
|
32686
|
+
)
|
|
32687
|
+
);
|
|
32688
|
+
var labelListenerCommand = new Command().name("label-listener").alias("label-listeners").alias("labels").description("Manage GitHub label listeners").addCommand(listCommand9).addCommand(createCommand2).addCommand(updateCommand).addCommand(deleteCommand5).addHelpText(
|
|
32689
|
+
"after",
|
|
32690
|
+
`
|
|
32691
|
+
Examples:
|
|
32692
|
+
List listeners: zero github label-listener list
|
|
32693
|
+
Create listener: zero github label-listener create --label zero --agent-id <agent-id> --prompt "Handle this issue"
|
|
32694
|
+
Edit listener: zero github label-listener update <listener-id> --disable
|
|
32695
|
+
Delete listener: zero github label-listener delete <listener-id>
|
|
32696
|
+
|
|
32697
|
+
Notes:
|
|
32698
|
+
- Updating or deleting a listener is allowed only for the listener owner or an org admin.`
|
|
32699
|
+
);
|
|
32700
|
+
|
|
32435
32701
|
// src/commands/zero/github/upload-file.ts
|
|
32436
32702
|
init_esm_shims();
|
|
32437
32703
|
import { readFileSync as readFileSync5, statSync } from "fs";
|
|
@@ -32531,12 +32797,13 @@ Notes:
|
|
|
32531
32797
|
);
|
|
32532
32798
|
|
|
32533
32799
|
// src/commands/zero/github/index.ts
|
|
32534
|
-
var zeroGithubCommand = new Command().name("github").description("
|
|
32800
|
+
var zeroGithubCommand = new Command().name("github").description("Manage GitHub integration files and label listeners").addCommand(downloadFileCommand).addCommand(labelListenerCommand).addCommand(uploadFileCommand).addHelpText(
|
|
32535
32801
|
"after",
|
|
32536
32802
|
`
|
|
32537
32803
|
Examples:
|
|
32538
32804
|
Upload a file: zero github upload-file -f /tmp/report.pdf -r vm0-ai/vm0 -i 42
|
|
32539
|
-
Download a file: zero github download-file https://github.com/user-attachments/assets/abc123 -o /tmp/out.png
|
|
32805
|
+
Download a file: zero github download-file https://github.com/user-attachments/assets/abc123 -o /tmp/out.png
|
|
32806
|
+
List labels: zero github label-listener list`
|
|
32540
32807
|
);
|
|
32541
32808
|
|
|
32542
32809
|
// src/commands/zero/slack/index.ts
|
|
@@ -32748,7 +33015,7 @@ function statusLabel(bot) {
|
|
|
32748
33015
|
if (bot.tokenStatus === "invalid") return source_default.red("invalid");
|
|
32749
33016
|
return source_default.yellow("unknown");
|
|
32750
33017
|
}
|
|
32751
|
-
var
|
|
33018
|
+
var listCommand10 = new Command().name("list").alias("ls").description("List Telegram bots available in the active organization").addHelpText(
|
|
32752
33019
|
"after",
|
|
32753
33020
|
`
|
|
32754
33021
|
Examples:
|
|
@@ -32807,7 +33074,7 @@ Notes:
|
|
|
32807
33074
|
);
|
|
32808
33075
|
|
|
32809
33076
|
// src/commands/zero/telegram/bot/index.ts
|
|
32810
|
-
var zeroTelegramBotCommand = new Command().name("bot").description("Inspect Telegram bots").addCommand(
|
|
33077
|
+
var zeroTelegramBotCommand = new Command().name("bot").description("Inspect Telegram bots").addCommand(listCommand10).addHelpText(
|
|
32811
33078
|
"after",
|
|
32812
33079
|
`
|
|
32813
33080
|
Examples:
|
|
@@ -33221,7 +33488,7 @@ function truncateValue2(value, maxLength = 60) {
|
|
|
33221
33488
|
}
|
|
33222
33489
|
return value.slice(0, maxLength - 15) + "... [truncated]";
|
|
33223
33490
|
}
|
|
33224
|
-
var
|
|
33491
|
+
var listCommand11 = new Command().name("list").alias("ls").description("List all variables").action(
|
|
33225
33492
|
withErrorHandler(async () => {
|
|
33226
33493
|
const result = await listZeroVariables();
|
|
33227
33494
|
if (result.variables.length === 0) {
|
|
@@ -33277,7 +33544,7 @@ var setCommand5 = new Command().name("set").description("Create or update a vari
|
|
|
33277
33544
|
|
|
33278
33545
|
// src/commands/zero/variable/delete.ts
|
|
33279
33546
|
init_esm_shims();
|
|
33280
|
-
var
|
|
33547
|
+
var deleteCommand6 = new Command().name("delete").description("Delete a variable").argument("<name>", "Variable name to delete").option("-y, --yes", "Skip confirmation prompt").action(
|
|
33281
33548
|
withErrorHandler(async (name, options) => {
|
|
33282
33549
|
if (!options.yes) {
|
|
33283
33550
|
if (!isInteractive()) {
|
|
@@ -33298,7 +33565,7 @@ var deleteCommand5 = new Command().name("delete").description("Delete a variable
|
|
|
33298
33565
|
);
|
|
33299
33566
|
|
|
33300
33567
|
// src/commands/zero/variable/index.ts
|
|
33301
|
-
var zeroVariableCommand = new Command().name("variable").description("Read or write non-sensitive configuration values").addCommand(
|
|
33568
|
+
var zeroVariableCommand = new Command().name("variable").description("Read or write non-sensitive configuration values").addCommand(listCommand11).addCommand(setCommand5).addCommand(deleteCommand6);
|
|
33302
33569
|
|
|
33303
33570
|
// src/commands/zero/whoami.ts
|
|
33304
33571
|
init_esm_shims();
|
|
@@ -33487,7 +33754,7 @@ function readSkillDirectory(dirPath) {
|
|
|
33487
33754
|
}
|
|
33488
33755
|
|
|
33489
33756
|
// src/commands/zero/skill/create.ts
|
|
33490
|
-
var
|
|
33757
|
+
var createCommand3 = new Command().name("create").description("Create a custom skill in the organization").argument("<name>", "Skill name (lowercase alphanumeric with hyphens)").requiredOption("--dir <path>", "Path to directory containing SKILL.md").option("--display-name <name>", "Skill display name").option("--description <text>", "Skill description").addHelpText(
|
|
33491
33758
|
"after",
|
|
33492
33759
|
`
|
|
33493
33760
|
Examples:
|
|
@@ -33577,7 +33844,7 @@ Examples:
|
|
|
33577
33844
|
|
|
33578
33845
|
// src/commands/zero/skill/list.ts
|
|
33579
33846
|
init_esm_shims();
|
|
33580
|
-
var
|
|
33847
|
+
var listCommand12 = new Command().name("list").alias("ls").description("List custom skills in the organization").addHelpText(
|
|
33581
33848
|
"after",
|
|
33582
33849
|
`
|
|
33583
33850
|
Examples:
|
|
@@ -33623,7 +33890,7 @@ Examples:
|
|
|
33623
33890
|
|
|
33624
33891
|
// src/commands/zero/skill/delete.ts
|
|
33625
33892
|
init_esm_shims();
|
|
33626
|
-
var
|
|
33893
|
+
var deleteCommand7 = new Command().name("delete").alias("rm").description("Delete a custom skill from the organization").argument("<name>", "Skill name").option("-y, --yes", "Skip confirmation prompt").addHelpText(
|
|
33627
33894
|
"after",
|
|
33628
33895
|
`
|
|
33629
33896
|
Examples:
|
|
@@ -33655,7 +33922,7 @@ Notes:
|
|
|
33655
33922
|
);
|
|
33656
33923
|
|
|
33657
33924
|
// src/commands/zero/skill/index.ts
|
|
33658
|
-
var zeroSkillCommand = new Command("skill").description("Manage custom skills").addCommand(
|
|
33925
|
+
var zeroSkillCommand = new Command("skill").description("Manage custom skills").addCommand(createCommand3).addCommand(editCommand2).addCommand(viewCommand2).addCommand(listCommand12).addCommand(deleteCommand7).addHelpText(
|
|
33659
33926
|
"after",
|
|
33660
33927
|
`
|
|
33661
33928
|
Examples:
|
|
@@ -33696,7 +33963,7 @@ function formatStatus(status) {
|
|
|
33696
33963
|
function formatTime(iso) {
|
|
33697
33964
|
return new Date(iso).toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
33698
33965
|
}
|
|
33699
|
-
var
|
|
33966
|
+
var listCommand13 = new Command().name("list").alias("ls").description("List agent run logs").option("--agent <id>", "Filter by Zero agent ID").option(
|
|
33700
33967
|
"--status <status>",
|
|
33701
33968
|
"Filter by status (queued|pending|running|completed|failed|timeout|cancelled)"
|
|
33702
33969
|
).option(
|
|
@@ -33959,7 +34226,7 @@ async function showAgentEvents(runId, options) {
|
|
|
33959
34226
|
renderer.render(parsed);
|
|
33960
34227
|
}
|
|
33961
34228
|
}
|
|
33962
|
-
var zeroLogsCommand = new Command().name("logs").description("View and search agent run logs").argument("[runId]", "Run ID to view agent events for").addCommand(
|
|
34229
|
+
var zeroLogsCommand = new Command().name("logs").description("View and search agent run logs").argument("[runId]", "Run ID to view agent events for").addCommand(listCommand13).addCommand(searchCommand2).option(
|
|
33963
34230
|
"--since <time>",
|
|
33964
34231
|
"Show logs since timestamp (e.g., 5m, 2h, 1d, 2024-01-15T10:30:00Z)"
|
|
33965
34232
|
).option("--tail <n>", "Show last N entries (default: 5)").option("--head <n>", "Show first N entries").option("--all", "Fetch all log entries").addHelpText(
|
|
@@ -34165,13 +34432,13 @@ var zeroSearchCommand = new Command().name("search").description("Search logs, c
|
|
|
34165
34432
|
if (sources.length > 1) {
|
|
34166
34433
|
throw new Error("Only one --source is allowed.");
|
|
34167
34434
|
}
|
|
34168
|
-
const
|
|
34169
|
-
if (!SUPPORTED_SOURCES.includes(
|
|
34435
|
+
const source2 = sources[0];
|
|
34436
|
+
if (!SUPPORTED_SOURCES.includes(source2)) {
|
|
34170
34437
|
throw new Error(
|
|
34171
|
-
`Unknown --source "${
|
|
34438
|
+
`Unknown --source "${source2}". Expected one of: ${SUPPORTED_SOURCES.join(", ")}`
|
|
34172
34439
|
);
|
|
34173
34440
|
}
|
|
34174
|
-
switch (
|
|
34441
|
+
switch (source2) {
|
|
34175
34442
|
case "logs":
|
|
34176
34443
|
await runLogsSource(query, options);
|
|
34177
34444
|
return;
|
|
@@ -34381,8 +34648,6 @@ async function runReadCommand(kind, options, payload = {}) {
|
|
|
34381
34648
|
const created = await createComputerUseReadCommand({
|
|
34382
34649
|
kind,
|
|
34383
34650
|
timeoutMs: timeoutSeconds * 1e3,
|
|
34384
|
-
...options.host ? { hostName: options.host } : {},
|
|
34385
|
-
...options.hostId ? { hostId: options.hostId } : {},
|
|
34386
34651
|
...payload
|
|
34387
34652
|
});
|
|
34388
34653
|
await waitForCommand(created.commandId, timeoutSeconds);
|
|
@@ -34392,14 +34657,12 @@ async function runWriteCommand(kind, options, payload) {
|
|
|
34392
34657
|
const created = await createComputerUseWriteCommand({
|
|
34393
34658
|
kind,
|
|
34394
34659
|
timeoutMs: timeoutSeconds * 1e3,
|
|
34395
|
-
...options.host ? { hostName: options.host } : {},
|
|
34396
|
-
...options.hostId ? { hostId: options.hostId } : {},
|
|
34397
34660
|
...payload
|
|
34398
34661
|
});
|
|
34399
34662
|
await waitForCommand(created.commandId, timeoutSeconds);
|
|
34400
34663
|
}
|
|
34401
34664
|
function addTargetOptions(command) {
|
|
34402
|
-
return command.option("--
|
|
34665
|
+
return command.option("--timeout <seconds>", "Maximum time to wait", "30");
|
|
34403
34666
|
}
|
|
34404
34667
|
function appOption(command) {
|
|
34405
34668
|
return command.requiredOption("--app <name>", "Target app name or bundle id");
|
|
@@ -34413,7 +34676,9 @@ var listAppsCommand = addTargetOptions(
|
|
|
34413
34676
|
);
|
|
34414
34677
|
var getAppStateCommand = appOption(
|
|
34415
34678
|
addTargetOptions(
|
|
34416
|
-
new Command().name("get-app-state").description(
|
|
34679
|
+
new Command().name("get-app-state").description(
|
|
34680
|
+
"Get screenshot and accessibility state without activating an app"
|
|
34681
|
+
).action(
|
|
34417
34682
|
withErrorHandler(async (options) => {
|
|
34418
34683
|
await runReadCommand("app.state", options, { app: options.app });
|
|
34419
34684
|
})
|
|
@@ -34422,7 +34687,9 @@ var getAppStateCommand = appOption(
|
|
|
34422
34687
|
);
|
|
34423
34688
|
var clickCommand = appOption(
|
|
34424
34689
|
addTargetOptions(
|
|
34425
|
-
new Command().name("click").description(
|
|
34690
|
+
new Command().name("click").description(
|
|
34691
|
+
"Click an accessibility element or background screenshot coordinate"
|
|
34692
|
+
).option("--snapshot-id <id>", "Snapshot id returned by get-app-state").option("--element <id>", "Element id from get-app-state").option("--element-index <index>", "Element index from get-app-state").option("--x <points>", "Screenshot x coordinate fallback").option("--y <points>", "Screenshot y coordinate fallback").option("--button <button>", "Mouse button", "left").option("--click-count <count>", "Number of clicks", "1").action(
|
|
34426
34693
|
withErrorHandler(async (options) => {
|
|
34427
34694
|
const x = parseOptionalNonNegativeInteger(options.x, "x");
|
|
34428
34695
|
const y = parseOptionalNonNegativeInteger(options.y, "y");
|
|
@@ -34490,7 +34757,7 @@ var typeTextCommand = appOption(
|
|
|
34490
34757
|
);
|
|
34491
34758
|
var pressKeyCommand = appOption(
|
|
34492
34759
|
addTargetOptions(
|
|
34493
|
-
new Command().name("press-key").description("
|
|
34760
|
+
new Command().name("press-key").description("Send a background key or key combination to the target app").requiredOption(
|
|
34494
34761
|
"--key <key>",
|
|
34495
34762
|
"Key or key combination to press, for example Command+K or Control+K"
|
|
34496
34763
|
).action(
|
|
@@ -34519,7 +34786,7 @@ var performActionCommand = appOption(
|
|
|
34519
34786
|
);
|
|
34520
34787
|
var openAppCommand = appOption(
|
|
34521
34788
|
addTargetOptions(
|
|
34522
|
-
new Command().name("open-app").description("Open
|
|
34789
|
+
new Command().name("open-app").description("Open an app on the Desktop host without activating it").action(
|
|
34523
34790
|
withErrorHandler(async (options) => {
|
|
34524
34791
|
await runWriteCommand("app.open", options, { app: options.app });
|
|
34525
34792
|
})
|
|
@@ -34739,13 +35006,376 @@ var imageCommand = createImageGenerateCommand({
|
|
|
34739
35006
|
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"`
|
|
34740
35007
|
});
|
|
34741
35008
|
|
|
34742
|
-
// src/commands/zero/built-in/generate/
|
|
35009
|
+
// src/commands/zero/built-in/generate/open-design-artifacts.ts
|
|
34743
35010
|
init_esm_shims();
|
|
34744
35011
|
|
|
34745
|
-
// src/commands/zero/shared/
|
|
35012
|
+
// src/commands/zero/shared/open-design-artifact-generate.ts
|
|
34746
35013
|
init_esm_shims();
|
|
34747
35014
|
import { readFileSync as readFileSync14 } from "fs";
|
|
34748
35015
|
|
|
35016
|
+
// src/commands/zero/shared/open-design-registry.ts
|
|
35017
|
+
init_esm_shims();
|
|
35018
|
+
var OPEN_DESIGN_REPO = "vm0-ai/open-design";
|
|
35019
|
+
var OPEN_DESIGN_COMMIT = "d021b04720ace133f1d6133d1487326f5fc28f07";
|
|
35020
|
+
var OPEN_DESIGN_REGISTRY_VERSION = `${OPEN_DESIGN_REPO}@${OPEN_DESIGN_COMMIT}`;
|
|
35021
|
+
function source(path) {
|
|
35022
|
+
return {
|
|
35023
|
+
repo: OPEN_DESIGN_REPO,
|
|
35024
|
+
commit: OPEN_DESIGN_COMMIT,
|
|
35025
|
+
path
|
|
35026
|
+
};
|
|
35027
|
+
}
|
|
35028
|
+
var OPEN_DESIGN_REGISTRY = [
|
|
35029
|
+
{
|
|
35030
|
+
id: "od:skill:data-report",
|
|
35031
|
+
kind: "skill",
|
|
35032
|
+
name: "Data Report",
|
|
35033
|
+
description: "Turns source-backed data, rankings, metrics, or lists into a concise analytical report.",
|
|
35034
|
+
source: source("skills/data-report/SKILL.md"),
|
|
35035
|
+
targets: [
|
|
35036
|
+
"presentation",
|
|
35037
|
+
"website",
|
|
35038
|
+
"dashboard-design",
|
|
35039
|
+
"report",
|
|
35040
|
+
"docs-design"
|
|
35041
|
+
],
|
|
35042
|
+
tags: ["analysis", "data", "report", "ranking", "sources", "table"],
|
|
35043
|
+
triggers: ["report", "top 10", "ranking", "metrics", "analysis"],
|
|
35044
|
+
bestFor: ["source-backed reports", "ranked lists", "data summaries"],
|
|
35045
|
+
status: "curated",
|
|
35046
|
+
priority: 40
|
|
35047
|
+
},
|
|
35048
|
+
{
|
|
35049
|
+
id: "od:skill:article-magazine",
|
|
35050
|
+
kind: "skill",
|
|
35051
|
+
name: "Article Magazine",
|
|
35052
|
+
description: "Shapes research or editorial material into a magazine-like narrative with strong hierarchy.",
|
|
35053
|
+
source: source("skills/article-magazine/SKILL.md"),
|
|
35054
|
+
targets: ["presentation", "website", "poster", "report", "docs-design"],
|
|
35055
|
+
tags: ["editorial", "magazine", "article", "narrative", "research"],
|
|
35056
|
+
triggers: ["magazine", "editorial", "story", "essay", "briefing"],
|
|
35057
|
+
bestFor: [
|
|
35058
|
+
"editorial reports",
|
|
35059
|
+
"narrative explainers",
|
|
35060
|
+
"research synthesis"
|
|
35061
|
+
],
|
|
35062
|
+
status: "curated",
|
|
35063
|
+
priority: 28
|
|
35064
|
+
},
|
|
35065
|
+
{
|
|
35066
|
+
id: "od:skill:design-brief",
|
|
35067
|
+
kind: "skill",
|
|
35068
|
+
name: "Design Brief",
|
|
35069
|
+
description: "Converts a product, brand, or feature request into a structured design brief.",
|
|
35070
|
+
source: source("skills/design-brief/SKILL.md"),
|
|
35071
|
+
targets: ["presentation", "website", "mobile-app-design", "docs-design"],
|
|
35072
|
+
tags: ["design", "brief", "product", "brand", "requirements"],
|
|
35073
|
+
triggers: ["design brief", "brand", "product direction", "requirements"],
|
|
35074
|
+
bestFor: ["product design briefs", "brand-driven websites"],
|
|
35075
|
+
status: "curated",
|
|
35076
|
+
priority: 16
|
|
35077
|
+
},
|
|
35078
|
+
{
|
|
35079
|
+
id: "od:template:dashboard",
|
|
35080
|
+
kind: "template",
|
|
35081
|
+
name: "Dashboard",
|
|
35082
|
+
description: "Dense operational dashboard layout for KPIs, lists, filters, and repeated scanning.",
|
|
35083
|
+
source: source("design-templates/dashboard"),
|
|
35084
|
+
targets: ["website", "dashboard-design", "report"],
|
|
35085
|
+
tags: ["dashboard", "analytics", "kpi", "metrics", "operations", "table"],
|
|
35086
|
+
triggers: ["dashboard", "analytics", "monitoring", "metrics", "ops"],
|
|
35087
|
+
bestFor: ["metric-heavy pages", "status surfaces", "operational summaries"],
|
|
35088
|
+
compatibleWith: ["od:skill:data-report", "od:design-system:dashboard"],
|
|
35089
|
+
status: "curated",
|
|
35090
|
+
priority: 36
|
|
35091
|
+
},
|
|
35092
|
+
{
|
|
35093
|
+
id: "od:template:finance-report",
|
|
35094
|
+
kind: "template",
|
|
35095
|
+
name: "Finance Report",
|
|
35096
|
+
description: "Executive report layout with tables, callouts, trend blocks, and source notes.",
|
|
35097
|
+
source: source("design-templates/finance-report"),
|
|
35098
|
+
targets: ["presentation", "website", "report"],
|
|
35099
|
+
tags: ["report", "finance", "executive", "table", "analysis", "sources"],
|
|
35100
|
+
triggers: ["report", "brief", "analysis", "top 10", "finance"],
|
|
35101
|
+
bestFor: ["source-backed reports", "executive summaries", "ranked lists"],
|
|
35102
|
+
compatibleWith: ["od:skill:data-report", "od:design-system:dashboard"],
|
|
35103
|
+
status: "curated",
|
|
35104
|
+
priority: 34
|
|
35105
|
+
},
|
|
35106
|
+
{
|
|
35107
|
+
id: "od:template:docs-page",
|
|
35108
|
+
kind: "template",
|
|
35109
|
+
name: "Docs Page",
|
|
35110
|
+
description: "Documentation-style page layout for structured explanations, navigation, and examples.",
|
|
35111
|
+
source: source("design-templates/docs-page"),
|
|
35112
|
+
targets: ["website", "docs-design", "report"],
|
|
35113
|
+
tags: ["docs", "explanation", "guide", "structured", "reference"],
|
|
35114
|
+
triggers: ["docs", "documentation", "guide", "explain", "how to"],
|
|
35115
|
+
bestFor: ["technical explainers", "product docs", "implementation notes"],
|
|
35116
|
+
compatibleWith: ["od:skill:design-brief", "od:design-system:mono"],
|
|
35117
|
+
status: "curated",
|
|
35118
|
+
priority: 26
|
|
35119
|
+
},
|
|
35120
|
+
{
|
|
35121
|
+
id: "od:template:mobile-app",
|
|
35122
|
+
kind: "template",
|
|
35123
|
+
name: "Mobile App Design",
|
|
35124
|
+
description: "Single-screen mobile UI design rendered in a realistic iPhone device frame.",
|
|
35125
|
+
source: source("design-templates/mobile-app"),
|
|
35126
|
+
targets: ["mobile-app-design"],
|
|
35127
|
+
tags: ["mobile", "app", "ios", "design", "prototype", "phone"],
|
|
35128
|
+
triggers: [
|
|
35129
|
+
"mobile app",
|
|
35130
|
+
"ios app",
|
|
35131
|
+
"android app",
|
|
35132
|
+
"phone screen",
|
|
35133
|
+
"app ui",
|
|
35134
|
+
"app mockup"
|
|
35135
|
+
],
|
|
35136
|
+
bestFor: ["mobile UI mockups", "single-screen app design reviews"],
|
|
35137
|
+
compatibleWith: ["od:skill:design-brief", "od:design-system:apple"],
|
|
35138
|
+
status: "curated",
|
|
35139
|
+
priority: 38
|
|
35140
|
+
},
|
|
35141
|
+
{
|
|
35142
|
+
id: "od:template:html-ppt-graphify-dark-graph",
|
|
35143
|
+
kind: "template",
|
|
35144
|
+
name: "Graphify Dark Graph",
|
|
35145
|
+
description: "Dark graph-heavy HTML presentation template for data stories and technical briefings.",
|
|
35146
|
+
source: source("design-templates/html-ppt-graphify-dark-graph"),
|
|
35147
|
+
targets: ["presentation", "report"],
|
|
35148
|
+
tags: ["presentation", "dark", "graph", "data", "technical", "metrics"],
|
|
35149
|
+
triggers: ["deck", "presentation", "graph", "dark", "data story"],
|
|
35150
|
+
bestFor: ["data presentations", "technical executive briefings"],
|
|
35151
|
+
compatibleWith: [
|
|
35152
|
+
"od:skill:data-report",
|
|
35153
|
+
"od:design-system:trading-terminal"
|
|
35154
|
+
],
|
|
35155
|
+
status: "curated",
|
|
35156
|
+
priority: 32
|
|
35157
|
+
},
|
|
35158
|
+
{
|
|
35159
|
+
id: "od:template:html-ppt-zhangzara-retro-zine",
|
|
35160
|
+
kind: "template",
|
|
35161
|
+
name: "Zhangzara Retro Zine",
|
|
35162
|
+
description: "Expressive retro editorial HTML presentation template with zine-like composition.",
|
|
35163
|
+
source: source("design-templates/html-ppt-zhangzara-retro-zine"),
|
|
35164
|
+
targets: ["presentation", "poster", "report"],
|
|
35165
|
+
tags: ["presentation", "retro", "zine", "editorial", "expressive"],
|
|
35166
|
+
triggers: ["retro", "zine", "editorial", "magazine", "bold"],
|
|
35167
|
+
bestFor: [
|
|
35168
|
+
"editorial decks",
|
|
35169
|
+
"culture reports",
|
|
35170
|
+
"visually distinctive summaries"
|
|
35171
|
+
],
|
|
35172
|
+
compatibleWith: [
|
|
35173
|
+
"od:skill:article-magazine",
|
|
35174
|
+
"od:design-system:warm-editorial"
|
|
35175
|
+
],
|
|
35176
|
+
status: "curated",
|
|
35177
|
+
priority: 30
|
|
35178
|
+
},
|
|
35179
|
+
{
|
|
35180
|
+
id: "od:template:weekly-update",
|
|
35181
|
+
kind: "template",
|
|
35182
|
+
name: "Weekly Update",
|
|
35183
|
+
description: "Compact update deck/page structure for highlights, risks, next steps, and metrics.",
|
|
35184
|
+
source: source("design-templates/weekly-update"),
|
|
35185
|
+
targets: ["presentation", "report", "docs-design"],
|
|
35186
|
+
tags: ["update", "status", "briefing", "report", "metrics"],
|
|
35187
|
+
triggers: ["weekly", "status", "update", "briefing"],
|
|
35188
|
+
bestFor: ["team updates", "status reports", "progress summaries"],
|
|
35189
|
+
compatibleWith: ["od:skill:data-report", "od:design-system:dashboard"],
|
|
35190
|
+
status: "curated",
|
|
35191
|
+
priority: 24
|
|
35192
|
+
},
|
|
35193
|
+
{
|
|
35194
|
+
id: "od:template:web-prototype-taste-editorial",
|
|
35195
|
+
kind: "template",
|
|
35196
|
+
name: "Taste Editorial Web Prototype",
|
|
35197
|
+
description: "Editorial website prototype direction with image-led sections and strong copy hierarchy.",
|
|
35198
|
+
source: source("design-templates/web-prototype-taste-editorial"),
|
|
35199
|
+
targets: ["website", "poster"],
|
|
35200
|
+
tags: ["website", "editorial", "brand", "visual", "prototype"],
|
|
35201
|
+
triggers: ["landing", "site", "brand", "editorial", "launch"],
|
|
35202
|
+
bestFor: ["brand websites", "launch pages", "editorial product pages"],
|
|
35203
|
+
compatibleWith: ["od:skill:article-magazine", "od:design-system:editorial"],
|
|
35204
|
+
status: "curated",
|
|
35205
|
+
priority: 30
|
|
35206
|
+
},
|
|
35207
|
+
{
|
|
35208
|
+
id: "od:design-system:dashboard",
|
|
35209
|
+
kind: "design-system",
|
|
35210
|
+
name: "Dashboard",
|
|
35211
|
+
description: "Quiet, dense interface system for dashboards, tables, filters, and repeat workflows.",
|
|
35212
|
+
source: source("design-systems/dashboard"),
|
|
35213
|
+
targets: ["website", "dashboard-design", "report"],
|
|
35214
|
+
tags: ["dashboard", "neutral", "dense", "table", "operations", "charts"],
|
|
35215
|
+
triggers: ["dashboard", "analytics", "metrics", "ops", "report"],
|
|
35216
|
+
bestFor: ["operational UIs", "data reports", "admin surfaces"],
|
|
35217
|
+
status: "curated",
|
|
35218
|
+
priority: 36
|
|
35219
|
+
},
|
|
35220
|
+
{
|
|
35221
|
+
id: "od:design-system:trading-terminal",
|
|
35222
|
+
kind: "design-system",
|
|
35223
|
+
name: "Trading Terminal",
|
|
35224
|
+
description: "Dark dense market-terminal aesthetic for charts, feeds, tables, and high information density.",
|
|
35225
|
+
source: source("design-systems/trading-terminal"),
|
|
35226
|
+
targets: ["presentation", "website", "dashboard-design", "report"],
|
|
35227
|
+
tags: ["dark", "terminal", "finance", "data", "charts", "dense"],
|
|
35228
|
+
triggers: ["dark", "terminal", "trading", "chart", "graph"],
|
|
35229
|
+
bestFor: ["dark analytical reports", "graph-heavy dashboards"],
|
|
35230
|
+
status: "curated",
|
|
35231
|
+
priority: 32
|
|
35232
|
+
},
|
|
35233
|
+
{
|
|
35234
|
+
id: "od:design-system:warm-editorial",
|
|
35235
|
+
kind: "design-system",
|
|
35236
|
+
name: "Warm Editorial",
|
|
35237
|
+
description: "Warm editorial design system for readable narrative pages, zines, and reports.",
|
|
35238
|
+
source: source("design-systems/warm-editorial"),
|
|
35239
|
+
targets: ["presentation", "website", "poster", "report", "docs-design"],
|
|
35240
|
+
tags: ["warm", "editorial", "magazine", "narrative", "readable"],
|
|
35241
|
+
triggers: ["editorial", "magazine", "zine", "warm", "story"],
|
|
35242
|
+
bestFor: ["narrative reports", "editorial decks", "long-form pages"],
|
|
35243
|
+
status: "curated",
|
|
35244
|
+
priority: 30
|
|
35245
|
+
},
|
|
35246
|
+
{
|
|
35247
|
+
id: "od:design-system:editorial",
|
|
35248
|
+
kind: "design-system",
|
|
35249
|
+
name: "Editorial",
|
|
35250
|
+
description: "Clean editorial design system with strong typography, media framing, and section rhythm.",
|
|
35251
|
+
source: source("design-systems/editorial"),
|
|
35252
|
+
targets: ["presentation", "website", "poster", "report", "docs-design"],
|
|
35253
|
+
tags: ["editorial", "typography", "media", "brand", "article"],
|
|
35254
|
+
triggers: ["editorial", "article", "brand", "landing", "magazine"],
|
|
35255
|
+
bestFor: ["brand sites", "article-style reports", "visual narratives"],
|
|
35256
|
+
status: "curated",
|
|
35257
|
+
priority: 28
|
|
35258
|
+
},
|
|
35259
|
+
{
|
|
35260
|
+
id: "od:design-system:mono",
|
|
35261
|
+
kind: "design-system",
|
|
35262
|
+
name: "Mono",
|
|
35263
|
+
description: "Minimal monospace-oriented system for documentation, technical pages, and precise reports.",
|
|
35264
|
+
source: source("design-systems/mono"),
|
|
35265
|
+
targets: ["website", "docs-design", "report"],
|
|
35266
|
+
tags: ["mono", "docs", "technical", "minimal", "structured"],
|
|
35267
|
+
triggers: ["docs", "technical", "reference", "minimal", "api"],
|
|
35268
|
+
bestFor: ["technical documentation", "implementation reports"],
|
|
35269
|
+
status: "curated",
|
|
35270
|
+
priority: 20
|
|
35271
|
+
},
|
|
35272
|
+
{
|
|
35273
|
+
id: "od:design-system:apple",
|
|
35274
|
+
kind: "design-system",
|
|
35275
|
+
name: "Apple",
|
|
35276
|
+
description: "Apple-inspired interface system for polished mobile and product UI design.",
|
|
35277
|
+
source: source("design-systems/apple"),
|
|
35278
|
+
targets: ["mobile-app-design", "website"],
|
|
35279
|
+
tags: ["apple", "mobile", "ios", "clean", "product"],
|
|
35280
|
+
triggers: ["mobile", "ios", "iphone", "app design", "app ui"],
|
|
35281
|
+
bestFor: ["phone-framed product mocks", "consumer mobile UI"],
|
|
35282
|
+
status: "curated",
|
|
35283
|
+
priority: 34
|
|
35284
|
+
}
|
|
35285
|
+
];
|
|
35286
|
+
function toOpenDesignTarget(value) {
|
|
35287
|
+
if (value === "dashboard") {
|
|
35288
|
+
return "dashboard-design";
|
|
35289
|
+
}
|
|
35290
|
+
if (value === "docs") {
|
|
35291
|
+
return "docs-design";
|
|
35292
|
+
}
|
|
35293
|
+
if (value === "mobile-app") {
|
|
35294
|
+
return "mobile-app-design";
|
|
35295
|
+
}
|
|
35296
|
+
return value;
|
|
35297
|
+
}
|
|
35298
|
+
function normalizeText(value) {
|
|
35299
|
+
return value.toLowerCase();
|
|
35300
|
+
}
|
|
35301
|
+
function tokenize(value) {
|
|
35302
|
+
return normalizeText(value).split(/[^a-z0-9]+/u).filter((token) => {
|
|
35303
|
+
return token.length >= 2;
|
|
35304
|
+
});
|
|
35305
|
+
}
|
|
35306
|
+
function phraseScore(values, prompt, weight) {
|
|
35307
|
+
if (!values) {
|
|
35308
|
+
return 0;
|
|
35309
|
+
}
|
|
35310
|
+
return values.reduce((score, value) => {
|
|
35311
|
+
return prompt.includes(normalizeText(value)) ? score + weight : score;
|
|
35312
|
+
}, 0);
|
|
35313
|
+
}
|
|
35314
|
+
function tokenScore(values, promptTokens, weight) {
|
|
35315
|
+
if (!values) {
|
|
35316
|
+
return 0;
|
|
35317
|
+
}
|
|
35318
|
+
return values.reduce((score, value) => {
|
|
35319
|
+
const matches = tokenize(value).filter((token) => {
|
|
35320
|
+
return promptTokens.has(token);
|
|
35321
|
+
});
|
|
35322
|
+
return score + matches.length * weight;
|
|
35323
|
+
}, 0);
|
|
35324
|
+
}
|
|
35325
|
+
function scoreEntry(entry, target, prompt) {
|
|
35326
|
+
const normalizedPrompt = normalizeText(prompt);
|
|
35327
|
+
const promptTokens = new Set(tokenize(prompt));
|
|
35328
|
+
const targetScore = entry.targets.includes(target) ? 100 : 0;
|
|
35329
|
+
const curationScore = entry.status === "curated" ? 20 : entry.status === "experimental" ? -20 : -1e3;
|
|
35330
|
+
return targetScore + curationScore + (entry.priority ?? 0) + phraseScore(entry.triggers, normalizedPrompt, 40) + phraseScore(entry.bestFor, normalizedPrompt, 15) + tokenScore(entry.tags, promptTokens, 10) + tokenScore(entry.description.split(" "), promptTokens, 2);
|
|
35331
|
+
}
|
|
35332
|
+
function selectByKind(kind, target, prompt, limit) {
|
|
35333
|
+
return OPEN_DESIGN_REGISTRY.filter((entry) => {
|
|
35334
|
+
return entry.kind === kind && entry.status !== "hidden";
|
|
35335
|
+
}).map((entry) => {
|
|
35336
|
+
return { entry, score: scoreEntry(entry, target, prompt) };
|
|
35337
|
+
}).filter(({ score }) => {
|
|
35338
|
+
return score > 0;
|
|
35339
|
+
}).sort((left, right) => {
|
|
35340
|
+
if (right.score !== left.score) {
|
|
35341
|
+
return right.score - left.score;
|
|
35342
|
+
}
|
|
35343
|
+
return left.entry.id.localeCompare(right.entry.id);
|
|
35344
|
+
}).slice(0, limit).map(({ entry }) => {
|
|
35345
|
+
return entry;
|
|
35346
|
+
});
|
|
35347
|
+
}
|
|
35348
|
+
function selectOpenDesignCandidates(options) {
|
|
35349
|
+
const limitPerKind = options.limitPerKind ?? 8;
|
|
35350
|
+
return {
|
|
35351
|
+
registryVersion: OPEN_DESIGN_REGISTRY_VERSION,
|
|
35352
|
+
source: {
|
|
35353
|
+
repo: OPEN_DESIGN_REPO,
|
|
35354
|
+
commit: OPEN_DESIGN_COMMIT
|
|
35355
|
+
},
|
|
35356
|
+
candidates: {
|
|
35357
|
+
skills: selectByKind(
|
|
35358
|
+
"skill",
|
|
35359
|
+
options.target,
|
|
35360
|
+
options.prompt,
|
|
35361
|
+
limitPerKind
|
|
35362
|
+
),
|
|
35363
|
+
templates: selectByKind(
|
|
35364
|
+
"template",
|
|
35365
|
+
options.target,
|
|
35366
|
+
options.prompt,
|
|
35367
|
+
limitPerKind
|
|
35368
|
+
),
|
|
35369
|
+
designSystems: selectByKind(
|
|
35370
|
+
"design-system",
|
|
35371
|
+
options.target,
|
|
35372
|
+
options.prompt,
|
|
35373
|
+
limitPerKind
|
|
35374
|
+
)
|
|
35375
|
+
}
|
|
35376
|
+
};
|
|
35377
|
+
}
|
|
35378
|
+
|
|
34749
35379
|
// src/commands/zero/shared/html-artifact-authoring.ts
|
|
34750
35380
|
init_esm_shims();
|
|
34751
35381
|
function slugify(value) {
|
|
@@ -34753,7 +35383,17 @@ function slugify(value) {
|
|
|
34753
35383
|
return slug.length >= 3 ? slug : "html-artifact";
|
|
34754
35384
|
}
|
|
34755
35385
|
function titleForKind(kind) {
|
|
34756
|
-
|
|
35386
|
+
const titles = {
|
|
35387
|
+
presentation: "HTML presentation",
|
|
35388
|
+
website: "hosted website",
|
|
35389
|
+
"dashboard-design": "dashboard design prototype",
|
|
35390
|
+
"mobile-app-design": "mobile app design prototype",
|
|
35391
|
+
poster: "poster",
|
|
35392
|
+
"intro-video": "intro video storyboard",
|
|
35393
|
+
report: "report",
|
|
35394
|
+
"docs-design": "documentation design prototype"
|
|
35395
|
+
};
|
|
35396
|
+
return titles[kind];
|
|
34757
35397
|
}
|
|
34758
35398
|
function outputDirForSite(site) {
|
|
34759
35399
|
return `./opendesign/mockups/${site}`;
|
|
@@ -34763,15 +35403,58 @@ function createHtmlArtifactAuthoringPacket(options) {
|
|
|
34763
35403
|
const outputDir = outputDirForSite(site);
|
|
34764
35404
|
const hostCommand = `zero host ${outputDir} --site ${site}${options.kind === "website" ? " --spa" : ""}`;
|
|
34765
35405
|
const title = titleForKind(options.kind);
|
|
35406
|
+
const candidateSlice = selectOpenDesignCandidates({
|
|
35407
|
+
target: options.kind,
|
|
35408
|
+
prompt: [
|
|
35409
|
+
options.prompt,
|
|
35410
|
+
options.slugSource ?? "",
|
|
35411
|
+
...options.details,
|
|
35412
|
+
...options.artifactRules
|
|
35413
|
+
].join("\n")
|
|
35414
|
+
});
|
|
35415
|
+
const selectionSchema = {
|
|
35416
|
+
skills: "string[]",
|
|
35417
|
+
template: "string",
|
|
35418
|
+
designSystem: "string | null",
|
|
35419
|
+
rationale: "string"
|
|
35420
|
+
};
|
|
34766
35421
|
const instructions = [
|
|
34767
35422
|
`# Zero built-in generate ${options.kind}`,
|
|
34768
35423
|
"",
|
|
34769
|
-
|
|
34770
|
-
|
|
35424
|
+
"This is an Open Design resource-selection packet for the current agent.",
|
|
35425
|
+
`Zero is not generating this ${title} on the server. You select resources, resolve them, and author the artifact.`,
|
|
34771
35426
|
"",
|
|
34772
35427
|
"## User Prompt",
|
|
34773
35428
|
options.prompt,
|
|
34774
35429
|
"",
|
|
35430
|
+
"## Stage 1: Resource Selection",
|
|
35431
|
+
"- Choose the Open Design resources from the bundled registry slice below.",
|
|
35432
|
+
"- Select one template, one or more skills, and zero or one design system.",
|
|
35433
|
+
"- Choose only IDs present in this packet; do not invent registry IDs.",
|
|
35434
|
+
"- Prefer compatible resources, but the user prompt is the highest-priority signal.",
|
|
35435
|
+
"- Treat the selection JSON as internal working state, then continue to authoring.",
|
|
35436
|
+
"",
|
|
35437
|
+
"## Selection Output Schema",
|
|
35438
|
+
"```json",
|
|
35439
|
+
JSON.stringify(selectionSchema, null, 2),
|
|
35440
|
+
"```",
|
|
35441
|
+
"",
|
|
35442
|
+
"## Candidate Registry Slice",
|
|
35443
|
+
`Registry: \`${candidateSlice.registryVersion}\``,
|
|
35444
|
+
"",
|
|
35445
|
+
"```json",
|
|
35446
|
+
JSON.stringify(candidateSlice.candidates, null, 2),
|
|
35447
|
+
"```",
|
|
35448
|
+
"",
|
|
35449
|
+
"## Stage 2: Resolve Selected Resources",
|
|
35450
|
+
"- For every selected resource, fetch or read the referenced Open Design source before authoring.",
|
|
35451
|
+
"- Source refs are pinned as `repo@commit:path`; use the commit in the packet for reproducibility.",
|
|
35452
|
+
"- For directory refs, inspect the most relevant files such as `SKILL.md`, `DESIGN.md`, `README.md`, tokens, examples, and templates.",
|
|
35453
|
+
"- If a source file cannot be fetched, state that limitation and fall back to the registry metadata for that resource.",
|
|
35454
|
+
"",
|
|
35455
|
+
"## Stage 3: Author Artifact",
|
|
35456
|
+
`Author a production-quality ${title} as a static HTML artifact using the selected Open Design resources.`,
|
|
35457
|
+
"",
|
|
34775
35458
|
"## Output Contract",
|
|
34776
35459
|
`- Write the artifact under \`${outputDir}/\`.`,
|
|
34777
35460
|
`- The entry file must be \`${outputDir}/index.html\`.`,
|
|
@@ -34785,9 +35468,9 @@ function createHtmlArtifactAuthoringPacket(options) {
|
|
|
34785
35468
|
return `- ${detail}`;
|
|
34786
35469
|
}),
|
|
34787
35470
|
"",
|
|
34788
|
-
"##
|
|
34789
|
-
"-
|
|
34790
|
-
"-
|
|
35471
|
+
"## Open Design Authoring Rules",
|
|
35472
|
+
"- Let the selected template define structure, the selected design system define visual language, and the selected skills define process.",
|
|
35473
|
+
"- Read the local codebase, brand assets, and existing design systems when the prompt depends on this repository.",
|
|
34791
35474
|
"- 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.",
|
|
34792
35475
|
"- Build the actual artifact first, not a marketing explanation of the artifact.",
|
|
34793
35476
|
"- Make controls and interactions real when they are visible.",
|
|
@@ -34810,9 +35493,18 @@ function createHtmlArtifactAuthoringPacket(options) {
|
|
|
34810
35493
|
"```"
|
|
34811
35494
|
].join("\n");
|
|
34812
35495
|
return {
|
|
34813
|
-
type: "
|
|
35496
|
+
type: "open-design-resource-selection",
|
|
34814
35497
|
kind: options.kind,
|
|
34815
35498
|
prompt: options.prompt,
|
|
35499
|
+
registryVersion: candidateSlice.registryVersion,
|
|
35500
|
+
selection: {
|
|
35501
|
+
candidates: candidateSlice.candidates,
|
|
35502
|
+
outputSchema: selectionSchema
|
|
35503
|
+
},
|
|
35504
|
+
authoring: {
|
|
35505
|
+
details: options.details,
|
|
35506
|
+
artifactRules: options.artifactRules
|
|
35507
|
+
},
|
|
34816
35508
|
outputDir,
|
|
34817
35509
|
site,
|
|
34818
35510
|
hostCommand,
|
|
@@ -34820,7 +35512,152 @@ function createHtmlArtifactAuthoringPacket(options) {
|
|
|
34820
35512
|
};
|
|
34821
35513
|
}
|
|
34822
35514
|
|
|
35515
|
+
// src/commands/zero/shared/open-design-artifact-generate.ts
|
|
35516
|
+
function readPrompt2(options, usageCommand) {
|
|
35517
|
+
if (options.prompt?.trim()) {
|
|
35518
|
+
return options.prompt.trim();
|
|
35519
|
+
}
|
|
35520
|
+
if (process.stdin.isTTY === false) {
|
|
35521
|
+
const prompt = readFileSync14("/dev/stdin", "utf8").trim();
|
|
35522
|
+
if (prompt.length > 0) {
|
|
35523
|
+
return prompt;
|
|
35524
|
+
}
|
|
35525
|
+
}
|
|
35526
|
+
throw new Error("--prompt is required", {
|
|
35527
|
+
cause: new Error(`Usage: ${usageCommand} --prompt "A product report"`)
|
|
35528
|
+
});
|
|
35529
|
+
}
|
|
35530
|
+
function createOpenDesignArtifactGenerateCommand(config) {
|
|
35531
|
+
return new Command().name(config.name).description(config.description).option("--prompt <text>", "Artifact prompt; can also be piped via stdin").option("--site <slug>", "Hosted site slug; defaults to generated name").option("--title <text>", "Requested artifact title or name").option("--audience <text>", "Audience context").option("--json", "Print metadata as JSON").addHelpText(
|
|
35532
|
+
"after",
|
|
35533
|
+
`
|
|
35534
|
+
Examples:
|
|
35535
|
+
${config.examples}
|
|
35536
|
+
|
|
35537
|
+
Output:
|
|
35538
|
+
Prints an Open Design resource-selection packet for the current agent. The
|
|
35539
|
+
agent authors a static HTML artifact and hosts it with zero host.
|
|
35540
|
+
|
|
35541
|
+
Notes:
|
|
35542
|
+
- Authenticates via ZERO_TOKEN
|
|
35543
|
+
- OpenDesign path is gated by the openDesignGenerate feature switch`
|
|
35544
|
+
).action(
|
|
35545
|
+
withErrorHandler(async (options) => {
|
|
35546
|
+
if (!zeroTokenAllowsFeatureSwitch("openDesignGenerate" /* OpenDesignGenerate */)) {
|
|
35547
|
+
throw new Error(
|
|
35548
|
+
`${config.usageCommand} requires the openDesignGenerate feature switch`
|
|
35549
|
+
);
|
|
35550
|
+
}
|
|
35551
|
+
const prompt = readPrompt2(options, config.usageCommand);
|
|
35552
|
+
const packet = createHtmlArtifactAuthoringPacket({
|
|
35553
|
+
kind: toOpenDesignTarget(config.target),
|
|
35554
|
+
prompt,
|
|
35555
|
+
slugSource: options.title,
|
|
35556
|
+
site: options.site,
|
|
35557
|
+
details: config.details(options),
|
|
35558
|
+
artifactRules: config.artifactRules
|
|
35559
|
+
});
|
|
35560
|
+
if (options.json) {
|
|
35561
|
+
console.log(JSON.stringify(packet));
|
|
35562
|
+
return;
|
|
35563
|
+
}
|
|
35564
|
+
console.log(packet.instructions);
|
|
35565
|
+
})
|
|
35566
|
+
);
|
|
35567
|
+
}
|
|
35568
|
+
|
|
35569
|
+
// src/commands/zero/built-in/generate/open-design-artifacts.ts
|
|
35570
|
+
function standardDetails(kind) {
|
|
35571
|
+
return (options) => {
|
|
35572
|
+
return [
|
|
35573
|
+
`Artifact kind: ${kind}`,
|
|
35574
|
+
`Requested title/name: ${options.title ?? "not specified"}`,
|
|
35575
|
+
`Audience: ${options.audience ?? "not specified"}`
|
|
35576
|
+
];
|
|
35577
|
+
};
|
|
35578
|
+
}
|
|
35579
|
+
var reportCommand = createOpenDesignArtifactGenerateCommand({
|
|
35580
|
+
name: "report",
|
|
35581
|
+
target: "report",
|
|
35582
|
+
description: "Generate an Open Design HTML report from a prompt",
|
|
35583
|
+
usageCommand: "zero built-in generate report",
|
|
35584
|
+
examples: ` Generate report: zero built-in generate report --prompt "A Q2 usage report for the API team"
|
|
35585
|
+
Stable hosted slug: zero built-in generate report --site api-usage-q2 --prompt "A Q2 usage report"`,
|
|
35586
|
+
details: standardDetails("report"),
|
|
35587
|
+
artifactRules: [
|
|
35588
|
+
"Produce an analytical report, not a marketing page.",
|
|
35589
|
+
"Use concrete metrics, tables, chart-like visuals, and a clear findings section.",
|
|
35590
|
+
"Keep source assumptions visible when the prompt does not provide real data.",
|
|
35591
|
+
"Verify the report is readable at desktop and mobile widths."
|
|
35592
|
+
]
|
|
35593
|
+
});
|
|
35594
|
+
var docsDesignCommand = createOpenDesignArtifactGenerateCommand({
|
|
35595
|
+
name: "docs-design",
|
|
35596
|
+
target: "docs-design",
|
|
35597
|
+
description: "Generate an Open Design documentation design from a prompt",
|
|
35598
|
+
usageCommand: "zero built-in generate docs-design",
|
|
35599
|
+
examples: ` Generate docs design: zero built-in generate docs-design --prompt "Docs for adding OpenDesign artifact targets"
|
|
35600
|
+
Stable hosted slug: zero built-in generate docs-design --site opendesign-target-docs --prompt "OpenDesign target docs"`,
|
|
35601
|
+
details: standardDetails("docs-design"),
|
|
35602
|
+
artifactRules: [
|
|
35603
|
+
"Produce a documentation design mockup, not a production documentation system.",
|
|
35604
|
+
"Include navigation, article structure, code or command examples when relevant, and clear section anchors as static design content.",
|
|
35605
|
+
"Use restrained documentation styling optimized for long-form reading.",
|
|
35606
|
+
"Verify the page works at mobile and desktop widths."
|
|
35607
|
+
]
|
|
35608
|
+
});
|
|
35609
|
+
var posterCommand = createOpenDesignArtifactGenerateCommand({
|
|
35610
|
+
name: "poster",
|
|
35611
|
+
target: "poster",
|
|
35612
|
+
description: "Generate an Open Design HTML poster from a prompt",
|
|
35613
|
+
usageCommand: "zero built-in generate poster",
|
|
35614
|
+
examples: ` Generate poster: zero built-in generate poster --prompt "A launch poster for OpenDesign artifact targets"
|
|
35615
|
+
Stable hosted slug: zero built-in generate poster --site opendesign-poster --prompt "A launch poster"`,
|
|
35616
|
+
details: standardDetails("poster"),
|
|
35617
|
+
artifactRules: [
|
|
35618
|
+
"Produce a poster-style HTML artifact with strong hierarchy and composition.",
|
|
35619
|
+
"Treat this as an HTML poster surface; do not imply a raster image was generated unless image assets are actually created.",
|
|
35620
|
+
"Make the poster responsive enough to inspect on mobile and desktop.",
|
|
35621
|
+
"Keep text deliberate and avoid placeholder copy."
|
|
35622
|
+
]
|
|
35623
|
+
});
|
|
35624
|
+
var dashboardDesignCommand = createOpenDesignArtifactGenerateCommand({
|
|
35625
|
+
name: "dashboard-design",
|
|
35626
|
+
target: "dashboard-design",
|
|
35627
|
+
description: "Generate an Open Design dashboard design from a prompt",
|
|
35628
|
+
usageCommand: "zero built-in generate dashboard-design",
|
|
35629
|
+
examples: ` Generate dash design: zero built-in generate dashboard-design --prompt "An ops dashboard for generation runs"
|
|
35630
|
+
Stable hosted slug: zero built-in generate dashboard-design --site generation-ops --prompt "A generation ops dashboard"`,
|
|
35631
|
+
details: standardDetails("dashboard-design"),
|
|
35632
|
+
artifactRules: [
|
|
35633
|
+
"Produce a dashboard design mockup, not a live operational dashboard.",
|
|
35634
|
+
"Include scannable KPIs, chart-like visuals, lists or tables, and realistic empty/loading/error states as static design content.",
|
|
35635
|
+
"Prioritize dense, repeat-use UI over decorative sections.",
|
|
35636
|
+
"Verify the dashboard does not overflow at desktop and mobile widths."
|
|
35637
|
+
]
|
|
35638
|
+
});
|
|
35639
|
+
var mobileAppDesignCommand = createOpenDesignArtifactGenerateCommand({
|
|
35640
|
+
name: "mobile-app-design",
|
|
35641
|
+
target: "mobile-app-design",
|
|
35642
|
+
description: "Generate an Open Design mobile app design prototype from a prompt",
|
|
35643
|
+
usageCommand: "zero built-in generate mobile-app-design",
|
|
35644
|
+
examples: ` Generate mobile UI: zero built-in generate mobile-app-design --prompt "A mobile review screen for generation artifacts"
|
|
35645
|
+
Stable hosted slug: zero built-in generate mobile-app-design --site generation-mobile-review --prompt "A mobile review screen"`,
|
|
35646
|
+
details: standardDetails("mobile-app-design"),
|
|
35647
|
+
artifactRules: [
|
|
35648
|
+
"Produce a design prototype, not a runnable or installable mobile app.",
|
|
35649
|
+
"Render the design inside a realistic phone frame with status bar, device chrome, and home indicator when possible.",
|
|
35650
|
+
"Focus on one mobile screen and one primary job.",
|
|
35651
|
+
"Use mobile-appropriate tap targets, type sizes, and spacing."
|
|
35652
|
+
]
|
|
35653
|
+
});
|
|
35654
|
+
|
|
35655
|
+
// src/commands/zero/built-in/generate/presentation.ts
|
|
35656
|
+
init_esm_shims();
|
|
35657
|
+
|
|
34823
35658
|
// src/commands/zero/shared/presentation-generate.ts
|
|
35659
|
+
init_esm_shims();
|
|
35660
|
+
import { readFileSync as readFileSync15 } from "fs";
|
|
34824
35661
|
var PRESENTATION_MAX_IMAGES = 8;
|
|
34825
35662
|
function parseSlideCount(value) {
|
|
34826
35663
|
const slideCount = Number(value);
|
|
@@ -34841,12 +35678,12 @@ function parseImageCount(value) {
|
|
|
34841
35678
|
}
|
|
34842
35679
|
return imageCount;
|
|
34843
35680
|
}
|
|
34844
|
-
function
|
|
35681
|
+
function readPrompt3(options, usageCommand) {
|
|
34845
35682
|
if (options.prompt?.trim()) {
|
|
34846
35683
|
return options.prompt.trim();
|
|
34847
35684
|
}
|
|
34848
35685
|
if (process.stdin.isTTY === false) {
|
|
34849
|
-
const prompt =
|
|
35686
|
+
const prompt = readFileSync15("/dev/stdin", "utf8").trim();
|
|
34850
35687
|
if (prompt.length > 0) {
|
|
34851
35688
|
return prompt;
|
|
34852
35689
|
}
|
|
@@ -34879,7 +35716,7 @@ Examples:
|
|
|
34879
35716
|
${config.examples}
|
|
34880
35717
|
|
|
34881
35718
|
Output:
|
|
34882
|
-
Prints the generated /f/ HTML presentation URL and metadata. With openDesignGenerate enabled, prints an
|
|
35719
|
+
Prints the generated /f/ HTML presentation URL and metadata. With openDesignGenerate enabled, prints an Open Design registry-selection packet for the current agent instead.
|
|
34883
35720
|
|
|
34884
35721
|
Notes:
|
|
34885
35722
|
- Authenticates via ZERO_TOKEN
|
|
@@ -34887,7 +35724,7 @@ Notes:
|
|
|
34887
35724
|
- OpenDesign path is gated by the openDesignGenerate feature switch`
|
|
34888
35725
|
).action(
|
|
34889
35726
|
withErrorHandler(async (options) => {
|
|
34890
|
-
const prompt =
|
|
35727
|
+
const prompt = readPrompt3(options, config.usageCommand);
|
|
34891
35728
|
if (zeroTokenAllowsFeatureSwitch("openDesignGenerate" /* OpenDesignGenerate */)) {
|
|
34892
35729
|
const packet = createHtmlArtifactAuthoringPacket({
|
|
34893
35730
|
kind: "presentation",
|
|
@@ -34964,7 +35801,7 @@ init_esm_shims();
|
|
|
34964
35801
|
|
|
34965
35802
|
// src/commands/zero/shared/video-generate.ts
|
|
34966
35803
|
init_esm_shims();
|
|
34967
|
-
import { readFileSync as
|
|
35804
|
+
import { readFileSync as readFileSync16 } from "fs";
|
|
34968
35805
|
var FRAME_ASPECT_RATIO_TOLERANCE = 0.02;
|
|
34969
35806
|
var JPEG_START_OF_FRAME_MARKERS = /* @__PURE__ */ new Set([
|
|
34970
35807
|
192,
|
|
@@ -35158,12 +35995,12 @@ async function validateVideoOptions(options) {
|
|
|
35158
35995
|
)
|
|
35159
35996
|
]);
|
|
35160
35997
|
}
|
|
35161
|
-
function
|
|
35998
|
+
function readPrompt4(options, usageCommand) {
|
|
35162
35999
|
if (options.prompt?.trim()) {
|
|
35163
36000
|
return options.prompt.trim();
|
|
35164
36001
|
}
|
|
35165
36002
|
if (process.stdin.isTTY === false) {
|
|
35166
|
-
const prompt =
|
|
36003
|
+
const prompt = readFileSync16("/dev/stdin", "utf8").trim();
|
|
35167
36004
|
if (prompt.length > 0) {
|
|
35168
36005
|
return prompt;
|
|
35169
36006
|
}
|
|
@@ -35228,7 +36065,7 @@ Models:
|
|
|
35228
36065
|
4k output, negative prompts, and optional audio.`
|
|
35229
36066
|
).action(
|
|
35230
36067
|
withErrorHandler(async (options) => {
|
|
35231
|
-
const prompt =
|
|
36068
|
+
const prompt = readPrompt4(options, config.usageCommand);
|
|
35232
36069
|
await validateVideoOptions(options);
|
|
35233
36070
|
const result = await generateWebVideo({
|
|
35234
36071
|
prompt,
|
|
@@ -35279,7 +36116,7 @@ var videoCommand = createVideoGenerateCommand({
|
|
|
35279
36116
|
// src/commands/zero/built-in/generate/website.ts
|
|
35280
36117
|
init_esm_shims();
|
|
35281
36118
|
import { mkdtemp, rm } from "fs/promises";
|
|
35282
|
-
import { readFileSync as
|
|
36119
|
+
import { readFileSync as readFileSync17 } from "fs";
|
|
35283
36120
|
import { join as join8 } from "path";
|
|
35284
36121
|
import { tmpdir as tmpdir5 } from "os";
|
|
35285
36122
|
|
|
@@ -36334,12 +37171,12 @@ function parseImageCount2(value) {
|
|
|
36334
37171
|
}
|
|
36335
37172
|
return imageCount;
|
|
36336
37173
|
}
|
|
36337
|
-
function
|
|
37174
|
+
function readPrompt5(options) {
|
|
36338
37175
|
if (options.prompt?.trim()) {
|
|
36339
37176
|
return options.prompt.trim();
|
|
36340
37177
|
}
|
|
36341
37178
|
if (process.stdin.isTTY === false) {
|
|
36342
|
-
const prompt =
|
|
37179
|
+
const prompt = readFileSync17("/dev/stdin", "utf8").trim();
|
|
36343
37180
|
if (prompt.length > 0) {
|
|
36344
37181
|
return prompt;
|
|
36345
37182
|
}
|
|
@@ -36378,7 +37215,7 @@ Examples:
|
|
|
36378
37215
|
Pipe prompt: cat brief.txt | zero built-in generate website
|
|
36379
37216
|
|
|
36380
37217
|
Output:
|
|
36381
|
-
Generates and publishes a hosted website. With openDesignGenerate enabled, prints an
|
|
37218
|
+
Generates and publishes a hosted website. With openDesignGenerate enabled, prints an Open Design registry-selection packet for the current agent instead.
|
|
36382
37219
|
|
|
36383
37220
|
Notes:
|
|
36384
37221
|
- Authenticates via ZERO_TOKEN
|
|
@@ -36386,7 +37223,7 @@ Notes:
|
|
|
36386
37223
|
- OpenDesign path is gated by the openDesignGenerate feature switch`
|
|
36387
37224
|
).action(
|
|
36388
37225
|
withErrorHandler(async (options) => {
|
|
36389
|
-
const prompt =
|
|
37226
|
+
const prompt = readPrompt5(options);
|
|
36390
37227
|
if (zeroTokenAllowsFeatureSwitch("openDesignGenerate" /* OpenDesignGenerate */)) {
|
|
36391
37228
|
const packet = createHtmlArtifactAuthoringPacket({
|
|
36392
37229
|
kind: "website",
|
|
@@ -36511,13 +37348,13 @@ init_esm_shims();
|
|
|
36511
37348
|
|
|
36512
37349
|
// src/commands/zero/shared/voice-generate.ts
|
|
36513
37350
|
init_esm_shims();
|
|
36514
|
-
import { readFileSync as
|
|
37351
|
+
import { readFileSync as readFileSync18 } from "fs";
|
|
36515
37352
|
function readText(options, usageCommand) {
|
|
36516
37353
|
if (options.text?.trim()) {
|
|
36517
37354
|
return options.text.trim();
|
|
36518
37355
|
}
|
|
36519
37356
|
if (process.stdin.isTTY === false) {
|
|
36520
|
-
const text =
|
|
37357
|
+
const text = readFileSync18("/dev/stdin", "utf8").trim();
|
|
36521
37358
|
if (text.length > 0) {
|
|
36522
37359
|
return text;
|
|
36523
37360
|
}
|
|
@@ -36576,6 +37413,10 @@ function buildGenerateHelpText() {
|
|
|
36576
37413
|
const examples = [
|
|
36577
37414
|
' Generate image: zero built-in generate image --prompt "A watercolor fox"',
|
|
36578
37415
|
' Generate deck: zero built-in generate presentation --prompt "A product roadmap"',
|
|
37416
|
+
...zeroTokenAllowsFeatureSwitch("openDesignGenerate" /* OpenDesignGenerate */) ? [
|
|
37417
|
+
' Generate report: zero built-in generate report --prompt "A Q2 usage report"',
|
|
37418
|
+
' Generate docs: zero built-in generate docs-design --prompt "A setup guide"'
|
|
37419
|
+
] : [],
|
|
36579
37420
|
' Generate video: zero built-in generate video --prompt "A cinematic city shot"',
|
|
36580
37421
|
...zeroTokenAllowsFeatureSwitch("hostedSites" /* HostedSites */) ? [
|
|
36581
37422
|
' Generate site: zero built-in generate website --prompt "A launch site"'
|
|
@@ -36586,7 +37427,10 @@ function buildGenerateHelpText() {
|
|
|
36586
37427
|
Examples:
|
|
36587
37428
|
${examples.join("\n")}`;
|
|
36588
37429
|
}
|
|
36589
|
-
var
|
|
37430
|
+
var openDesignCommandOptions = zeroTokenAllowsFeatureSwitch(
|
|
37431
|
+
"openDesignGenerate" /* OpenDesignGenerate */
|
|
37432
|
+
) ? {} : { hidden: true };
|
|
37433
|
+
var generateCommand2 = new Command().name("generate").description("Generate assets with built-in vm0 services").addCommand(imageCommand).addCommand(presentationCommand).addCommand(reportCommand, openDesignCommandOptions).addCommand(docsDesignCommand, openDesignCommandOptions).addCommand(posterCommand, openDesignCommandOptions).addCommand(dashboardDesignCommand, openDesignCommandOptions).addCommand(mobileAppDesignCommand, openDesignCommandOptions).addCommand(videoCommand).addCommand(
|
|
36590
37434
|
websiteCommand,
|
|
36591
37435
|
zeroTokenAllowsFeatureSwitch("hostedSites" /* HostedSites */) ? {} : { hidden: true }
|
|
36592
37436
|
).addCommand(voiceCommand).addHelpText("after", buildGenerateHelpText);
|
|
@@ -37290,7 +38134,7 @@ function getModelSwitchGuidance(integration = getCurrentIntegration()) {
|
|
|
37290
38134
|
}
|
|
37291
38135
|
return "Open https://app.vm0.ai and switch models from the model selector next to the input box.";
|
|
37292
38136
|
}
|
|
37293
|
-
var
|
|
38137
|
+
var listCommand14 = new Command().name("list").alias("ls").description("List models allowed by the current organization").action(
|
|
37294
38138
|
withErrorHandler(async () => {
|
|
37295
38139
|
const result = await listZeroModelPolicies();
|
|
37296
38140
|
if (result.policies.length === 0) {
|
|
@@ -37326,7 +38170,7 @@ var listCommand13 = new Command().name("list").alias("ls").description("List mod
|
|
|
37326
38170
|
var switchCommand = new Command().name("switch").description("Show how to switch models in the current environment").action(() => {
|
|
37327
38171
|
console.log(getModelSwitchGuidance());
|
|
37328
38172
|
});
|
|
37329
|
-
var zeroModelCommand = new Command().name("model").description("List available models and model-switching guidance").addCommand(
|
|
38173
|
+
var zeroModelCommand = new Command().name("model").description("List available models and model-switching guidance").addCommand(listCommand14).addCommand(switchCommand);
|
|
37330
38174
|
|
|
37331
38175
|
// src/commands/zero/model-provider/index.ts
|
|
37332
38176
|
init_esm_shims();
|
|
@@ -37337,7 +38181,7 @@ var MODEL_PROVIDER_SET_GUIDANCE = [
|
|
|
37337
38181
|
"",
|
|
37338
38182
|
"If an organization admin sets a model provider to subscription, members must use the bottom-left user menu, choose Preferences / Personal Models, and connect their personal subscription."
|
|
37339
38183
|
].join("\n");
|
|
37340
|
-
var
|
|
38184
|
+
var listCommand15 = new Command().name("list").alias("ls").description(
|
|
37341
38185
|
"List provider routing for each model allowed by the organization"
|
|
37342
38186
|
).action(
|
|
37343
38187
|
withErrorHandler(async () => {
|
|
@@ -37372,7 +38216,7 @@ var setCommand6 = new Command().name("set").description("Show where to adjust mo
|
|
|
37372
38216
|
${MODEL_PROVIDER_SET_GUIDANCE}`).action(() => {
|
|
37373
38217
|
console.log(MODEL_PROVIDER_SET_GUIDANCE);
|
|
37374
38218
|
});
|
|
37375
|
-
var zeroModelProviderCommand = new Command().name("model-provider").description("Inspect model provider routing").addCommand(
|
|
38219
|
+
var zeroModelProviderCommand = new Command().name("model-provider").description("Inspect model provider routing").addCommand(listCommand15).addCommand(setCommand6);
|
|
37376
38220
|
|
|
37377
38221
|
// src/zero.ts
|
|
37378
38222
|
var COMMAND_CAPABILITY_MAP = {
|
|
@@ -37493,7 +38337,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
37493
38337
|
var program = new Command();
|
|
37494
38338
|
program.name("zero").description(
|
|
37495
38339
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
37496
|
-
).version("9.
|
|
38340
|
+
).version("9.162.0").addHelpText("after", () => {
|
|
37497
38341
|
return buildZeroHelpText();
|
|
37498
38342
|
});
|
|
37499
38343
|
if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {
|