@vm0/cli 9.227.0 → 9.229.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/{agent-DGSPWQNY.js → agent-6I3S3EIU.js} +4 -4
- package/{banking-JHYVOWF5.js → banking-JTEDNDFU.js} +2 -2
- package/chat-SWX5TFN3.js +251 -0
- package/chat-SWX5TFN3.js.map +1 -0
- package/{chunk-EY2VZRB2.js → chunk-2P5AKBPK.js} +2 -2
- package/{chunk-NC6FCDKK.js → chunk-6RKTJJPZ.js} +8 -15
- package/{chunk-NC6FCDKK.js.map → chunk-6RKTJJPZ.js.map} +1 -1
- package/{chunk-WSV35YDZ.js → chunk-AIJGP7GE.js} +3 -3
- package/{chunk-YYR5LIJY.js → chunk-DKOCDBW4.js} +29 -9
- package/chunk-DKOCDBW4.js.map +1 -0
- package/{chunk-OEAI3Q7W.js → chunk-F7BBBLJC.js} +3 -3
- package/{chunk-5ERR7HTW.js → chunk-GWQOCHOY.js} +2 -2
- package/{chunk-4VMDT4EL.js → chunk-NHJID5Y2.js} +129 -4
- package/chunk-NHJID5Y2.js.map +1 -0
- package/{chunk-LBGX3XPM.js → chunk-OCRWY5Y7.js} +2 -2
- package/{chunk-MZSBZSJO.js → chunk-PGU3RHGG.js} +2 -2
- package/{chunk-GYQBZT25.js → chunk-Q63UMEJ6.js} +2 -2
- package/{chunk-GYQBZT25.js.map → chunk-Q63UMEJ6.js.map} +1 -1
- package/{computer-use-ZDALRU7D.js → computer-use-GEEWNJQM.js} +2 -2
- package/{connector-5I66WCBC.js → connector-EYTI2AQV.js} +2 -2
- package/{credit-HGNKEVFZ.js → credit-NZB5JP5V.js} +2 -2
- package/{developer-support-U65KGI6M.js → developer-support-PAMZ2XRA.js} +2 -2
- package/{doctor-WTQ7VC4T.js → doctor-W6XZPNI5.js} +5 -5
- package/{generate-DHDE5EAR.js → generate-HVVD6EYP.js} +144 -115
- package/generate-HVVD6EYP.js.map +1 -0
- package/{github-QDXMHTJZ.js → github-4UD5X5HJ.js} +2 -2
- package/{goal-JRXI5QXW.js → goal-EBSAUAFF.js} +2 -2
- package/{host-RRYXBDTU.js → host-XMGMUEIS.js} +2 -2
- package/index.js +14 -14
- package/{logs-NDOKTRB6.js → logs-ZVA3RX7T.js} +7 -7
- package/{maps-IQBIONR2.js → maps-KA77OBM7.js} +2 -2
- package/{model-JO3G5KZI.js → model-LXH7APW3.js} +3 -3
- package/{model-provider-FEVH3VPX.js → model-provider-LPWRU53L.js} +3 -3
- package/{org-FQMXNSIY.js → org-YAIXNWYJ.js} +2 -2
- package/package.json +1 -1
- package/{phone-SQDE53ZF.js → phone-LJZKV6SV.js} +2 -2
- package/{preference-S5VFYYXB.js → preference-CZ3I4HFF.js} +2 -2
- package/{relationship-HCBN4USZ.js → relationship-QKUXP77B.js} +2 -2
- package/{resource-RSKJLS3T.js → resource-BKPC6E53.js} +3 -3
- package/{search-EMQSXATT.js → search-MTEX6GJA.js} +7 -7
- package/{secret-GKBBHURS.js → secret-ZIEZBGZG.js} +3 -3
- package/{slack-MPYGJ244.js → slack-TVVSMYRW.js} +2 -2
- package/{telegram-QPPLW7F4.js → telegram-ACBXXCBM.js} +2 -2
- package/{variable-Y4HRWCTO.js → variable-JJJKVBNK.js} +2 -2
- package/{web-AME2COQN.js → web-LFI6P5BX.js} +2 -2
- package/{whoami-V3SX3JTG.js → whoami-PU2MNPCP.js} +4 -4
- package/{workflow-DWK4QY3W.js → workflow-3ZFUOHIE.js} +71 -9
- package/workflow-3ZFUOHIE.js.map +1 -0
- package/zero.js +32 -32
- package/zero.js.map +1 -1
- package/chat-5PALCJD4.js +0 -123
- package/chat-5PALCJD4.js.map +0 -1
- package/chunk-4VMDT4EL.js.map +0 -1
- package/chunk-YYR5LIJY.js.map +0 -1
- package/generate-DHDE5EAR.js.map +0 -1
- package/workflow-DWK4QY3W.js.map +0 -1
- /package/{agent-DGSPWQNY.js.map → agent-6I3S3EIU.js.map} +0 -0
- /package/{banking-JHYVOWF5.js.map → banking-JTEDNDFU.js.map} +0 -0
- /package/{chunk-EY2VZRB2.js.map → chunk-2P5AKBPK.js.map} +0 -0
- /package/{chunk-WSV35YDZ.js.map → chunk-AIJGP7GE.js.map} +0 -0
- /package/{chunk-OEAI3Q7W.js.map → chunk-F7BBBLJC.js.map} +0 -0
- /package/{chunk-5ERR7HTW.js.map → chunk-GWQOCHOY.js.map} +0 -0
- /package/{chunk-LBGX3XPM.js.map → chunk-OCRWY5Y7.js.map} +0 -0
- /package/{chunk-MZSBZSJO.js.map → chunk-PGU3RHGG.js.map} +0 -0
- /package/{computer-use-ZDALRU7D.js.map → computer-use-GEEWNJQM.js.map} +0 -0
- /package/{connector-5I66WCBC.js.map → connector-EYTI2AQV.js.map} +0 -0
- /package/{credit-HGNKEVFZ.js.map → credit-NZB5JP5V.js.map} +0 -0
- /package/{developer-support-U65KGI6M.js.map → developer-support-PAMZ2XRA.js.map} +0 -0
- /package/{doctor-WTQ7VC4T.js.map → doctor-W6XZPNI5.js.map} +0 -0
- /package/{github-QDXMHTJZ.js.map → github-4UD5X5HJ.js.map} +0 -0
- /package/{goal-JRXI5QXW.js.map → goal-EBSAUAFF.js.map} +0 -0
- /package/{host-RRYXBDTU.js.map → host-XMGMUEIS.js.map} +0 -0
- /package/{logs-NDOKTRB6.js.map → logs-ZVA3RX7T.js.map} +0 -0
- /package/{maps-IQBIONR2.js.map → maps-KA77OBM7.js.map} +0 -0
- /package/{model-JO3G5KZI.js.map → model-LXH7APW3.js.map} +0 -0
- /package/{model-provider-FEVH3VPX.js.map → model-provider-LPWRU53L.js.map} +0 -0
- /package/{org-FQMXNSIY.js.map → org-YAIXNWYJ.js.map} +0 -0
- /package/{phone-SQDE53ZF.js.map → phone-LJZKV6SV.js.map} +0 -0
- /package/{preference-S5VFYYXB.js.map → preference-CZ3I4HFF.js.map} +0 -0
- /package/{relationship-HCBN4USZ.js.map → relationship-QKUXP77B.js.map} +0 -0
- /package/{resource-RSKJLS3T.js.map → resource-BKPC6E53.js.map} +0 -0
- /package/{search-EMQSXATT.js.map → search-MTEX6GJA.js.map} +0 -0
- /package/{secret-GKBBHURS.js.map → secret-ZIEZBGZG.js.map} +0 -0
- /package/{slack-MPYGJ244.js.map → slack-TVVSMYRW.js.map} +0 -0
- /package/{telegram-QPPLW7F4.js.map → telegram-ACBXXCBM.js.map} +0 -0
- /package/{variable-Y4HRWCTO.js.map → variable-JJJKVBNK.js.map} +0 -0
- /package/{web-AME2COQN.js.map → web-LFI6P5BX.js.map} +0 -0
- /package/{whoami-V3SX3JTG.js.map → whoami-PU2MNPCP.js.map} +0 -0
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
findPresentationRunbookPackage,
|
|
12
12
|
findTemplate,
|
|
13
13
|
findVideoTemplate,
|
|
14
|
+
findWebsiteTemplateResource,
|
|
14
15
|
listDesignSystems,
|
|
15
16
|
listImageStyles,
|
|
16
17
|
listPresentationRunbookPackages,
|
|
@@ -19,12 +20,12 @@ import {
|
|
|
19
20
|
resolvePresentationRunbookColorToken,
|
|
20
21
|
selectResourceCandidates,
|
|
21
22
|
toGenerationTarget
|
|
22
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-DKOCDBW4.js";
|
|
23
24
|
import {
|
|
24
25
|
getZeroAgentUserConnectors,
|
|
25
26
|
listZeroConnectorCatalog,
|
|
26
27
|
listZeroConnectorCatalogStatus
|
|
27
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-NHJID5Y2.js";
|
|
28
29
|
import "./chunk-LTDQISD7.js";
|
|
29
30
|
import {
|
|
30
31
|
generateWebImage,
|
|
@@ -56,37 +57,22 @@ init_esm_shims();
|
|
|
56
57
|
|
|
57
58
|
// src/commands/zero/shared/image-style-authoring.ts
|
|
58
59
|
init_esm_shims();
|
|
59
|
-
|
|
60
|
-
// src/commands/zero/shared/resource-registry.ts
|
|
61
|
-
init_esm_shims();
|
|
62
|
-
|
|
63
|
-
// src/commands/zero/shared/image-style-authoring.ts
|
|
64
|
-
function formatCandidateSource(source) {
|
|
60
|
+
function formatStyleSource(source) {
|
|
65
61
|
if ("repo" in source) {
|
|
66
|
-
return
|
|
62
|
+
return [
|
|
63
|
+
`- Repository: \`${source.repo}@${source.ref}\``,
|
|
64
|
+
`- Path: \`${source.path}\``
|
|
65
|
+
];
|
|
67
66
|
}
|
|
68
|
-
return `-
|
|
67
|
+
return [`- Path: \`${source.path}\``];
|
|
69
68
|
}
|
|
70
69
|
var outputDir = "./generated/images";
|
|
71
70
|
var artifactRules = [
|
|
72
|
-
"
|
|
73
|
-
"Use the style
|
|
74
|
-
"
|
|
71
|
+
"Compile the user prompt into a final image prompt before generating.",
|
|
72
|
+
"Use the style source, referenced assets, and generation path when they are available.",
|
|
73
|
+
"Generate with `--compiled-prompt`; do not pass `--style` during final image generation."
|
|
75
74
|
];
|
|
76
|
-
function
|
|
77
|
-
const baseSlice = selectResourceCandidates();
|
|
78
|
-
const candidateSlice = {
|
|
79
|
-
...baseSlice,
|
|
80
|
-
candidates: {
|
|
81
|
-
...baseSlice.candidates,
|
|
82
|
-
imageStyles: [options.style]
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
const selectionSchema = {
|
|
86
|
-
imageStyle: "string",
|
|
87
|
-
skills: "string[]",
|
|
88
|
-
rationale: "string"
|
|
89
|
-
};
|
|
75
|
+
function createStyledImageCompilationPacket(options) {
|
|
90
76
|
const artifact = {
|
|
91
77
|
outputMode: "primary-image",
|
|
92
78
|
primaryArtifact: {
|
|
@@ -104,47 +90,27 @@ function createStyledImageAuthoringPacket(options) {
|
|
|
104
90
|
outputDir
|
|
105
91
|
};
|
|
106
92
|
const instructions = [
|
|
107
|
-
`# Zero generate image
|
|
93
|
+
`# Zero generate image prompt compile ${options.style.id}`,
|
|
108
94
|
"",
|
|
109
|
-
"This is
|
|
110
|
-
"Zero is not generating this image
|
|
95
|
+
"This is an image prompt-compilation packet for the current agent.",
|
|
96
|
+
"Zero is not generating this image yet. The image style has already been selected \u2014 compile the user prompt into a final image prompt, then generate with `--compiled-prompt`.",
|
|
111
97
|
"",
|
|
112
98
|
"## User Prompt",
|
|
113
99
|
options.prompt,
|
|
114
100
|
"",
|
|
115
101
|
"## Selected Image Style",
|
|
116
102
|
`- \`${options.style.id}\` \u2014 ${options.style.name}`,
|
|
103
|
+
`- ${options.style.description}`,
|
|
117
104
|
"",
|
|
118
|
-
"##
|
|
119
|
-
|
|
120
|
-
"- Choose only IDs present in this packet; do not invent registry IDs.",
|
|
121
|
-
"- Treat the selection JSON as internal working state, then continue to generation.",
|
|
122
|
-
"",
|
|
123
|
-
"## Selection Output Schema",
|
|
124
|
-
"```json",
|
|
125
|
-
JSON.stringify(selectionSchema, null, 2),
|
|
126
|
-
"```",
|
|
127
|
-
"",
|
|
128
|
-
"## Candidate Registry Slice",
|
|
129
|
-
`Registry: \`${candidateSlice.registryVersion}\``,
|
|
130
|
-
"Sources:",
|
|
131
|
-
...candidateSlice.sources.map(formatCandidateSource),
|
|
105
|
+
"## Style Source",
|
|
106
|
+
...formatStyleSource(options.style.source),
|
|
132
107
|
"",
|
|
133
|
-
"
|
|
134
|
-
|
|
135
|
-
"
|
|
136
|
-
"",
|
|
137
|
-
"
|
|
138
|
-
"-
|
|
139
|
-
"- Each candidate carries a `source` object with `path` and optional `repo`/`ref`; when `repo`/`ref` are omitted, fall back to the registry-level source above.",
|
|
140
|
-
"- If `source.archive` is present, pull the private R2 archive with `zero resource pull <resource-id> --dir ./generated/resources`; the CLI requests an authenticated short-lived download URL, verifies the digest, and then extracts `source.path`.",
|
|
141
|
-
"- For directory refs, inspect the most relevant files such as `SKILL.md`, references, examples, and templates.",
|
|
142
|
-
"- If a source file cannot be fetched, state that limitation and fall back to the registry metadata for that resource.",
|
|
143
|
-
"",
|
|
144
|
-
"## Stage 3: Generate Image",
|
|
145
|
-
"- Generate one production-quality image using the selected style.",
|
|
146
|
-
"- Follow the selected style skill's generation path when it defines one.",
|
|
147
|
-
"- If the style skill delegates to a model or connector, use that flow directly instead of restating the style text manually.",
|
|
108
|
+
"## Prompt Compiler Task",
|
|
109
|
+
"- Read the selected style source when available, especially `SKILL.md`, references, examples, and templates.",
|
|
110
|
+
"- Rewrite the user prompt into one final image-generation prompt that obeys the selected style.",
|
|
111
|
+
"- Include style-specific composition, medium, palette, subject handling, reference usage, and must-avoid constraints in the final prompt.",
|
|
112
|
+
"- Keep user intent intact; expand only the visual details needed to satisfy the style.",
|
|
113
|
+
"- Return only the compiled prompt text when preparing the next command.",
|
|
148
114
|
"",
|
|
149
115
|
"## Artifact Output Model",
|
|
150
116
|
`- Primary artifact: \`${artifact.primaryArtifact.kind}\` under \`${artifact.primaryArtifact.path}\`.`,
|
|
@@ -161,21 +127,21 @@ function createStyledImageAuthoringPacket(options) {
|
|
|
161
127
|
return `- ${rule}`;
|
|
162
128
|
}),
|
|
163
129
|
"",
|
|
130
|
+
"## Next Command Template",
|
|
131
|
+
"```bash",
|
|
132
|
+
'zero generate image --compiled-prompt "<compiled prompt>"',
|
|
133
|
+
"```",
|
|
134
|
+
"",
|
|
164
135
|
"## Verification",
|
|
165
136
|
"- Verify the final image exists and is nonblank.",
|
|
166
137
|
"- Check that the selected style's required reference anchors or source assets were used when applicable.",
|
|
167
138
|
"- Report the final image URL or path and the selected registry resource ID."
|
|
168
139
|
].join("\n");
|
|
169
140
|
return {
|
|
170
|
-
type: "
|
|
141
|
+
type: "image-prompt-compilation",
|
|
171
142
|
kind: "image",
|
|
172
143
|
prompt: options.prompt,
|
|
173
|
-
registryVersion: candidateSlice.registryVersion,
|
|
174
144
|
artifact,
|
|
175
|
-
selection: {
|
|
176
|
-
candidates: candidateSlice.candidates,
|
|
177
|
-
outputSchema: selectionSchema
|
|
178
|
-
},
|
|
179
145
|
authoring: {
|
|
180
146
|
details: options.details,
|
|
181
147
|
artifactRules
|
|
@@ -185,6 +151,9 @@ function createStyledImageAuthoringPacket(options) {
|
|
|
185
151
|
};
|
|
186
152
|
}
|
|
187
153
|
|
|
154
|
+
// src/commands/zero/shared/resource-registry.ts
|
|
155
|
+
init_esm_shims();
|
|
156
|
+
|
|
188
157
|
// src/commands/zero/shared/resource-listing.ts
|
|
189
158
|
init_esm_shims();
|
|
190
159
|
function formatRegistryListing(entries, emptyLabel) {
|
|
@@ -733,6 +702,9 @@ async function dispatchGenerate(options) {
|
|
|
733
702
|
}
|
|
734
703
|
const resolvedPrompt = resolvePrompt(options.prompt);
|
|
735
704
|
if (resolvedPrompt === null) {
|
|
705
|
+
if (options.listOnMissingPrompt === false) {
|
|
706
|
+
throw new Error(options.missingPromptError ?? "Prompt is required");
|
|
707
|
+
}
|
|
736
708
|
await runLister(options.generationType, {
|
|
737
709
|
all: options.all
|
|
738
710
|
});
|
|
@@ -757,17 +729,18 @@ function resolvePrompt(prompt) {
|
|
|
757
729
|
}
|
|
758
730
|
|
|
759
731
|
// src/commands/zero/shared/image-generate.ts
|
|
760
|
-
function
|
|
732
|
+
function requireImageModeError(usageCommand) {
|
|
761
733
|
const styles = listImageStyles();
|
|
762
734
|
const message = [
|
|
763
|
-
"
|
|
735
|
+
"Choose one image prompt mode",
|
|
764
736
|
"",
|
|
765
|
-
"
|
|
766
|
-
|
|
737
|
+
"Modes:",
|
|
738
|
+
` Compile styled prompt: ${usageCommand} --style ${styles[0]?.id ?? "<style-id>"} --prompt "..." --compile`,
|
|
739
|
+
` Generate compiled prompt: ${usageCommand} --compiled-prompt "..."`,
|
|
740
|
+
` Generate raw prompt: ${usageCommand} --raw-prompt "..."`,
|
|
767
741
|
"",
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
` ${usageCommand} --skip-style --prompt "..."`
|
|
742
|
+
"Available styles:",
|
|
743
|
+
formatRegistryListing(styles, "image styles")
|
|
771
744
|
].join("\n");
|
|
772
745
|
return new Error(message);
|
|
773
746
|
}
|
|
@@ -780,7 +753,7 @@ function unknownStyleError(id, usageCommand) {
|
|
|
780
753
|
formatRegistryListing(styles, "image styles"),
|
|
781
754
|
"",
|
|
782
755
|
`Example:`,
|
|
783
|
-
` ${usageCommand} --style ${styles[0]?.id ?? "<style-id>"} --prompt "..."`
|
|
756
|
+
` ${usageCommand} --style ${styles[0]?.id ?? "<style-id>"} --prompt "..." --compile`
|
|
784
757
|
].join("\n");
|
|
785
758
|
return new Error(message);
|
|
786
759
|
}
|
|
@@ -823,8 +796,49 @@ function parseImagePromptStrength(value) {
|
|
|
823
796
|
}
|
|
824
797
|
return strength;
|
|
825
798
|
}
|
|
799
|
+
function resolvePromptInput(options) {
|
|
800
|
+
return options.compiledPrompt ?? options.rawPrompt ?? options.prompt;
|
|
801
|
+
}
|
|
802
|
+
function hasImagePromptModeRequest(options) {
|
|
803
|
+
return options.style !== void 0 || options.compile === true || options.prompt !== void 0 || options.compiledPrompt !== void 0 || options.rawPrompt !== void 0;
|
|
804
|
+
}
|
|
805
|
+
function resolveImagePromptMode(options, usageCommand) {
|
|
806
|
+
const hasCompiledPrompt = options.compiledPrompt !== void 0;
|
|
807
|
+
const hasRawPrompt = options.rawPrompt !== void 0;
|
|
808
|
+
const compile = options.compile === true;
|
|
809
|
+
if (!compile && options.style) {
|
|
810
|
+
throw new Error("--style can only be used with --compile");
|
|
811
|
+
}
|
|
812
|
+
if ([compile, hasCompiledPrompt, hasRawPrompt].filter(Boolean).length !== 1) {
|
|
813
|
+
throw requireImageModeError(usageCommand);
|
|
814
|
+
}
|
|
815
|
+
if (compile && !options.style) {
|
|
816
|
+
throw new Error("--compile requires --style <id>");
|
|
817
|
+
}
|
|
818
|
+
if (!compile && options.prompt !== void 0) {
|
|
819
|
+
throw new Error(
|
|
820
|
+
"--prompt can only be used with --style <id> --compile; use --compiled-prompt or --raw-prompt to generate"
|
|
821
|
+
);
|
|
822
|
+
}
|
|
823
|
+
if (compile) {
|
|
824
|
+
return "compile";
|
|
825
|
+
}
|
|
826
|
+
if (hasCompiledPrompt) {
|
|
827
|
+
return "compiled";
|
|
828
|
+
}
|
|
829
|
+
return "raw";
|
|
830
|
+
}
|
|
826
831
|
function createImageGenerateCommand(config) {
|
|
827
|
-
return new Command().name(config.name).description("Generate a billed image file from a prompt").option(
|
|
832
|
+
return new Command().name(config.name).description("Generate a billed image file from a prompt").option(
|
|
833
|
+
"--prompt <text>",
|
|
834
|
+
"User prompt to compile with --style and --compile; can also be piped via stdin"
|
|
835
|
+
).option(
|
|
836
|
+
"--compiled-prompt <text>",
|
|
837
|
+
"Final image prompt produced from a prompt-compilation packet"
|
|
838
|
+
).option(
|
|
839
|
+
"--raw-prompt <text>",
|
|
840
|
+
"Final image prompt for unstyled/model-native generation"
|
|
841
|
+
).option(
|
|
828
842
|
"--provider <name>",
|
|
829
843
|
"Provider: 'built-in' to run vm0's pipeline, or a connector name to get its skill-invocation guidance"
|
|
830
844
|
).option(
|
|
@@ -866,10 +880,10 @@ function createImageGenerateCommand(config) {
|
|
|
866
880
|
"Reference strength override for Flux Redux"
|
|
867
881
|
).option(
|
|
868
882
|
"--style <id>",
|
|
869
|
-
"Image style id from the registry (see Image Styles below)"
|
|
883
|
+
"Image style id to compile from the registry (see Image Styles below)"
|
|
870
884
|
).option(
|
|
871
|
-
"--
|
|
872
|
-
"
|
|
885
|
+
"--compile",
|
|
886
|
+
"Resolve the selected style and print a prompt-compilation packet"
|
|
873
887
|
).addHelpText("after", () => {
|
|
874
888
|
const styles = listImageStyles();
|
|
875
889
|
return `
|
|
@@ -877,9 +891,9 @@ Examples:
|
|
|
877
891
|
${config.examples}
|
|
878
892
|
|
|
879
893
|
Output:
|
|
880
|
-
Prints the generated /f/ image file URL and metadata
|
|
881
|
-
|
|
882
|
-
|
|
894
|
+
Prints the generated /f/ image file URL and metadata with --compiled-prompt
|
|
895
|
+
or --raw-prompt. With --style <id> --prompt "..." --compile, prints a
|
|
896
|
+
prompt-compilation packet for the current agent.
|
|
883
897
|
|
|
884
898
|
Notes:
|
|
885
899
|
- Authenticates via ZERO_TOKEN (requires file:write capability)
|
|
@@ -895,9 +909,10 @@ Models:
|
|
|
895
909
|
megapixel, depending on the model.
|
|
896
910
|
|
|
897
911
|
Options:
|
|
898
|
-
- Prompt:
|
|
899
|
-
|
|
900
|
-
or --
|
|
912
|
+
- Prompt modes: choose exactly one mode. Use --style <id> --prompt "..."
|
|
913
|
+
--compile to prepare a styled prompt-compilation packet, --compiled-prompt
|
|
914
|
+
to generate from an agent-compiled prompt, or --raw-prompt to generate
|
|
915
|
+
without a style. stdin is supported for --prompt in compile mode.
|
|
901
916
|
- Size: gpt-image-2 accepts auto or WIDTHxHEIGHT. Popular sizes include
|
|
902
917
|
1024x1024,
|
|
903
918
|
1536x1024, 1024x1536, 2048x2048, 2048x1152, 3840x2160,
|
|
@@ -925,24 +940,25 @@ ${formatRegistryListing(styles, "image styles")}`;
|
|
|
925
940
|
const dispatch = await dispatchGenerate({
|
|
926
941
|
generationType: config.generationType,
|
|
927
942
|
provider: options.provider,
|
|
928
|
-
prompt: options
|
|
929
|
-
all: options.all
|
|
943
|
+
prompt: resolvePromptInput(options),
|
|
944
|
+
all: options.all,
|
|
945
|
+
listOnMissingPrompt: !hasImagePromptModeRequest(options),
|
|
946
|
+
missingPromptError: options.compile || options.style ? "--compile requires --prompt <text> or piped stdin" : void 0
|
|
930
947
|
});
|
|
931
948
|
if (dispatch.outcome === "handled") return;
|
|
932
|
-
const
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
const style = findImageStyle(options.style);
|
|
949
|
+
const resolvedPrompt = dispatch.prompt;
|
|
950
|
+
const mode = resolveImagePromptMode(options, config.usageCommand);
|
|
951
|
+
if (mode === "compile") {
|
|
952
|
+
const styleId = options.style;
|
|
953
|
+
if (!styleId) {
|
|
954
|
+
throw new Error("--compile requires --style <id>");
|
|
955
|
+
}
|
|
956
|
+
const style = findImageStyle(styleId);
|
|
941
957
|
if (!style) {
|
|
942
|
-
throw unknownStyleError(
|
|
958
|
+
throw unknownStyleError(styleId, config.usageCommand);
|
|
943
959
|
}
|
|
944
|
-
const packet =
|
|
945
|
-
prompt,
|
|
960
|
+
const packet = createStyledImageCompilationPacket({
|
|
961
|
+
prompt: resolvedPrompt,
|
|
946
962
|
style,
|
|
947
963
|
details: [
|
|
948
964
|
`Model preference if direct image generation is used: ${options.model}`,
|
|
@@ -965,7 +981,7 @@ ${formatRegistryListing(styles, "image styles")}`;
|
|
|
965
981
|
const hasSourceImage = options.imageUrl.length > 0;
|
|
966
982
|
const size = hasSourceImage && command.getOptionValueSource("size") === "default" ? "auto" : options.size;
|
|
967
983
|
const result = await generateWebImage({
|
|
968
|
-
prompt,
|
|
984
|
+
prompt: resolvedPrompt,
|
|
969
985
|
model: options.model,
|
|
970
986
|
size,
|
|
971
987
|
quality: options.quality,
|
|
@@ -1012,13 +1028,14 @@ var imageCommand = createImageGenerateCommand({
|
|
|
1012
1028
|
name: "image",
|
|
1013
1029
|
generationType: "image",
|
|
1014
1030
|
usageCommand: "zero generate image",
|
|
1015
|
-
examples: `
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1031
|
+
examples: ` Compile styled prompt: zero generate image --style image-style:notion-illustration --prompt "A product manager mapping a launch plan" --compile
|
|
1032
|
+
Generate compiled: zero generate image --compiled-prompt "A Notion-style brush-pen illustration..."
|
|
1033
|
+
Generate raw: zero generate image --raw-prompt "A watercolor fox"
|
|
1034
|
+
Pipe compile prompt: cat prompt.txt | zero generate image --style image-style:notion-illustration --compile
|
|
1035
|
+
GPT Image model: zero generate image --compiled-prompt "A poster" --model gpt-image-1.5 --size 1024x1536 --quality high
|
|
1036
|
+
Flux model: zero generate image --raw-prompt "A product hero shot" --model flux-pro-1.1 --seed 42
|
|
1037
|
+
Nano Banana 2: zero generate image --compiled-prompt "A crisp launch poster with readable typography" --model nano-banana-2
|
|
1038
|
+
Image-to-image: zero generate image --compiled-prompt "Turn this mockup into a polished product shot" --model flux-pro-1.1 --image-url https://example.com/mockup.png
|
|
1022
1039
|
List providers: zero generate image
|
|
1023
1040
|
Use a connector: zero generate image --provider replicate`
|
|
1024
1041
|
});
|
|
@@ -1052,7 +1069,7 @@ function titleForKind(kind) {
|
|
|
1052
1069
|
function outputDirForSite(site) {
|
|
1053
1070
|
return `./generated/mockups/${site}`;
|
|
1054
1071
|
}
|
|
1055
|
-
function
|
|
1072
|
+
function formatCandidateSource(source) {
|
|
1056
1073
|
if ("repo" in source) {
|
|
1057
1074
|
return `- \`${source.repo}@${source.ref}\``;
|
|
1058
1075
|
}
|
|
@@ -1130,7 +1147,7 @@ function createHtmlArtifactAuthoringPacket(options) {
|
|
|
1130
1147
|
"## Candidate Registry Slice",
|
|
1131
1148
|
`Registry: \`${candidateSlice.registryVersion}\``,
|
|
1132
1149
|
"Sources:",
|
|
1133
|
-
...candidateSlice.sources.map(
|
|
1150
|
+
...candidateSlice.sources.map(formatCandidateSource),
|
|
1134
1151
|
"",
|
|
1135
1152
|
"```json",
|
|
1136
1153
|
JSON.stringify(candidateSlice.candidates, null, 2),
|
|
@@ -1651,7 +1668,7 @@ function createSpriteAuthoringPacket(options) {
|
|
|
1651
1668
|
`- Output name: ${plan.name}`,
|
|
1652
1669
|
"",
|
|
1653
1670
|
"## Recommended Model",
|
|
1654
|
-
`- Use \`${plan.model}\` for every raw sheet via built-in image generation (\`zero generate image --provider built-in --model ${plan.model} --
|
|
1671
|
+
`- Use \`${plan.model}\` for every raw sheet via built-in image generation (\`zero generate image --provider built-in --model ${plan.model} --raw-prompt "..."\`, or the in-context image tool).`,
|
|
1655
1672
|
"- gpt-image-2 is recommended for sprite sheets: it accepts flexible WIDTHxHEIGHT sizes and high quality for crisp, evenly-spaced grids. It does not emit transparent backgrounds, which is expected here \u2014 the solid magenta background is chroma-keyed by the local processor.",
|
|
1656
1673
|
"- Pick a sheet-friendly square or grid-aligned size (for example 1024x1024 for 2x2/3x3/4x4) so each cell stays evenly spaced.",
|
|
1657
1674
|
"",
|
|
@@ -1885,7 +1902,7 @@ init_esm_shims();
|
|
|
1885
1902
|
|
|
1886
1903
|
// src/commands/zero/shared/video-template-authoring.ts
|
|
1887
1904
|
init_esm_shims();
|
|
1888
|
-
function
|
|
1905
|
+
function formatCandidateSource2(source) {
|
|
1889
1906
|
if ("repo" in source) {
|
|
1890
1907
|
return `- \`${source.repo}@${source.ref}\``;
|
|
1891
1908
|
}
|
|
@@ -1969,7 +1986,7 @@ function createVideoTemplateAuthoringPacket(options) {
|
|
|
1969
1986
|
"## Locked Template Source",
|
|
1970
1987
|
`Registry: \`${candidateSlice.registryVersion}\``,
|
|
1971
1988
|
"Sources:",
|
|
1972
|
-
...candidateSlice.sources.map(
|
|
1989
|
+
...candidateSlice.sources.map(formatCandidateSource2),
|
|
1973
1990
|
"",
|
|
1974
1991
|
"```json",
|
|
1975
1992
|
JSON.stringify(candidateSlice.candidates, null, 2),
|
|
@@ -2406,6 +2423,18 @@ var videoCommand = createVideoGenerateCommand({
|
|
|
2406
2423
|
init_esm_shims();
|
|
2407
2424
|
var WEBSITE_TARGET = "website";
|
|
2408
2425
|
var WEBSITE_USAGE_COMMAND = "zero generate website";
|
|
2426
|
+
function selectedTemplateDetails(template) {
|
|
2427
|
+
if (!template) {
|
|
2428
|
+
return ["Selected template: agent decides"];
|
|
2429
|
+
}
|
|
2430
|
+
const details = [`Selected template: ${template.id} (${template.name})`];
|
|
2431
|
+
if (template.source.archive) {
|
|
2432
|
+
details.push(
|
|
2433
|
+
`Selected template package: zero resource pull ${template.id} --dir ./generated/resources`
|
|
2434
|
+
);
|
|
2435
|
+
}
|
|
2436
|
+
return details;
|
|
2437
|
+
}
|
|
2409
2438
|
function unknownDesignSystemError2(id) {
|
|
2410
2439
|
const designSystems = listDesignSystems();
|
|
2411
2440
|
const message = [
|
|
@@ -2486,7 +2515,7 @@ ${formatRegistryListing(templates, "website templates")}`;
|
|
|
2486
2515
|
let resolvedTemplate;
|
|
2487
2516
|
if (options.template !== void 0) {
|
|
2488
2517
|
const canonical = canonicalizeRegistryId("template", options.template);
|
|
2489
|
-
const entry = findTemplate(canonical);
|
|
2518
|
+
const entry = findWebsiteTemplateResource(options.template) ?? findTemplate(canonical);
|
|
2490
2519
|
if (!entry || !entry.targets?.includes(WEBSITE_TARGET)) {
|
|
2491
2520
|
throw unknownTemplateError4(options.template);
|
|
2492
2521
|
}
|
|
@@ -2500,7 +2529,7 @@ ${formatRegistryListing(templates, "website templates")}`;
|
|
|
2500
2529
|
details: [
|
|
2501
2530
|
`Requested title/site name: ${options.title ?? "not specified"}`,
|
|
2502
2531
|
`Selected design system: ${resolvedDesignSystem ? `${resolvedDesignSystem.id} (${resolvedDesignSystem.name})` : "agent decides"}`,
|
|
2503
|
-
|
|
2532
|
+
...selectedTemplateDetails(resolvedTemplate)
|
|
2504
2533
|
],
|
|
2505
2534
|
artifactRules: [
|
|
2506
2535
|
"Build the usable website as the first screen; do not output a landing-page plan.",
|
|
@@ -2636,7 +2665,7 @@ var documentCommand = createListerOnlyCommand({
|
|
|
2636
2665
|
});
|
|
2637
2666
|
function buildGenerateHelpText() {
|
|
2638
2667
|
const examples = [
|
|
2639
|
-
' Generate image: zero generate image --prompt "A watercolor fox"',
|
|
2668
|
+
' Generate image: zero generate image --raw-prompt "A watercolor fox"',
|
|
2640
2669
|
' Generate deck: zero generate presentation --prompt "A product roadmap"',
|
|
2641
2670
|
' Generate report: zero generate report --prompt "A Q2 usage report"',
|
|
2642
2671
|
' Generate docs: zero generate docs-design --prompt "A setup guide"',
|
|
@@ -2649,7 +2678,7 @@ function buildGenerateHelpText() {
|
|
|
2649
2678
|
" Show image choices: zero generate image",
|
|
2650
2679
|
" Show report choices: zero generate report",
|
|
2651
2680
|
" Use a connector: zero generate video --provider heygen",
|
|
2652
|
-
" Force built-in: zero generate image --provider built-in --model gpt-image-1.5 --prompt ..."
|
|
2681
|
+
" Force built-in: zero generate image --provider built-in --model gpt-image-1.5 --raw-prompt ..."
|
|
2653
2682
|
];
|
|
2654
2683
|
return `
|
|
2655
2684
|
Examples:
|
|
@@ -2666,4 +2695,4 @@ var generateCommand = new Command().name("generate").description(
|
|
|
2666
2695
|
export {
|
|
2667
2696
|
generateCommand
|
|
2668
2697
|
};
|
|
2669
|
-
//# sourceMappingURL=generate-
|
|
2698
|
+
//# sourceMappingURL=generate-HVVD6EYP.js.map
|