@vm0/cli 9.176.5 → 9.177.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-4XXIJOZP.js → chunk-IL6D4DEA.js} +5 -4
- package/{chunk-4XXIJOZP.js.map → chunk-IL6D4DEA.js.map} +1 -1
- package/index.js +9 -9
- package/package.json +1 -1
- package/zero.js +314 -3
- package/zero.js.map +1 -1
package/index.js
CHANGED
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
source_default,
|
|
68
68
|
volumeConfigSchema,
|
|
69
69
|
withErrorHandler
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-IL6D4DEA.js";
|
|
71
71
|
import {
|
|
72
72
|
__toESM,
|
|
73
73
|
init_esm_shims
|
|
@@ -400,7 +400,7 @@ function getConfigPath() {
|
|
|
400
400
|
return join(os.homedir(), ".vm0", "config.json");
|
|
401
401
|
}
|
|
402
402
|
var infoCommand = new Command().name("info").description("Display environment and debug information").action(async () => {
|
|
403
|
-
console.log(source_default.bold(`VM0 CLI v${"9.
|
|
403
|
+
console.log(source_default.bold(`VM0 CLI v${"9.177.0"}`));
|
|
404
404
|
console.log();
|
|
405
405
|
const config = await loadConfig();
|
|
406
406
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -4293,7 +4293,7 @@ var composeCommand = new Command().name("compose").description("Create or update
|
|
|
4293
4293
|
options.autoUpdate = false;
|
|
4294
4294
|
}
|
|
4295
4295
|
if (options.autoUpdate !== false) {
|
|
4296
|
-
await startSilentUpgrade("9.
|
|
4296
|
+
await startSilentUpgrade("9.177.0");
|
|
4297
4297
|
}
|
|
4298
4298
|
try {
|
|
4299
4299
|
let result;
|
|
@@ -4395,7 +4395,7 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
|
|
|
4395
4395
|
withErrorHandler(
|
|
4396
4396
|
async (identifier, prompt, options) => {
|
|
4397
4397
|
if (options.autoUpdate !== false) {
|
|
4398
|
-
await startSilentUpgrade("9.
|
|
4398
|
+
await startSilentUpgrade("9.177.0");
|
|
4399
4399
|
}
|
|
4400
4400
|
const { name, version } = parseIdentifier(identifier);
|
|
4401
4401
|
let composeId;
|
|
@@ -6189,13 +6189,13 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
6189
6189
|
if (latestVersion === null) {
|
|
6190
6190
|
throw new Error("Could not check for updates. Please try again later.");
|
|
6191
6191
|
}
|
|
6192
|
-
if (latestVersion === "9.
|
|
6193
|
-
console.log(source_default.green(`\u2713 Already up to date (${"9.
|
|
6192
|
+
if (latestVersion === "9.177.0") {
|
|
6193
|
+
console.log(source_default.green(`\u2713 Already up to date (${"9.177.0"})`));
|
|
6194
6194
|
return;
|
|
6195
6195
|
}
|
|
6196
6196
|
console.log(
|
|
6197
6197
|
source_default.yellow(
|
|
6198
|
-
`Current version: ${"9.
|
|
6198
|
+
`Current version: ${"9.177.0"} -> Latest version: ${latestVersion}`
|
|
6199
6199
|
)
|
|
6200
6200
|
);
|
|
6201
6201
|
console.log();
|
|
@@ -6222,7 +6222,7 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
6222
6222
|
const success = await performUpgrade(packageManager);
|
|
6223
6223
|
if (success) {
|
|
6224
6224
|
console.log(
|
|
6225
|
-
source_default.green(`\u2713 Upgraded from ${"9.
|
|
6225
|
+
source_default.green(`\u2713 Upgraded from ${"9.177.0"} to ${latestVersion}`)
|
|
6226
6226
|
);
|
|
6227
6227
|
return;
|
|
6228
6228
|
}
|
|
@@ -6289,7 +6289,7 @@ var whoamiCommand = new Command().name("whoami").description("Show current ident
|
|
|
6289
6289
|
|
|
6290
6290
|
// src/index.ts
|
|
6291
6291
|
var program = new Command();
|
|
6292
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.
|
|
6292
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.177.0");
|
|
6293
6293
|
program.addCommand(authCommand);
|
|
6294
6294
|
program.addCommand(infoCommand);
|
|
6295
6295
|
program.addCommand(composeCommand);
|
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -144,7 +144,7 @@ import {
|
|
|
144
144
|
upsertZeroOrgModelProvider,
|
|
145
145
|
withErrorHandler,
|
|
146
146
|
zeroAgentCustomSkillNameSchema
|
|
147
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-IL6D4DEA.js";
|
|
148
148
|
import {
|
|
149
149
|
__toESM,
|
|
150
150
|
init_esm_shims
|
|
@@ -10285,6 +10285,11 @@ var BUILT_IN_GENERATION_COMMANDS = {
|
|
|
10285
10285
|
command: "zero generate website -h",
|
|
10286
10286
|
models: "gpt-5.5"
|
|
10287
10287
|
},
|
|
10288
|
+
sprite: {
|
|
10289
|
+
label: "Built-in sprite asset generation",
|
|
10290
|
+
command: "zero generate sprite -h",
|
|
10291
|
+
models: "gpt-image-2 (recommended) via built-in image generation"
|
|
10292
|
+
},
|
|
10288
10293
|
voice: {
|
|
10289
10294
|
label: "Built-in voice generation",
|
|
10290
10295
|
command: "zero generate voice --provider built-in -h",
|
|
@@ -10312,6 +10317,7 @@ var GENERATION_TYPE_LABELS = {
|
|
|
10312
10317
|
poster: "Poster",
|
|
10313
10318
|
presentation: "Presentation",
|
|
10314
10319
|
report: "Report",
|
|
10320
|
+
sprite: "Sprite",
|
|
10315
10321
|
text: "Text",
|
|
10316
10322
|
video: "Video",
|
|
10317
10323
|
voice: "Voice",
|
|
@@ -10328,6 +10334,7 @@ function getConnectorGenerationType(generationType) {
|
|
|
10328
10334
|
case "poster":
|
|
10329
10335
|
case "presentation":
|
|
10330
10336
|
case "report":
|
|
10337
|
+
case "sprite":
|
|
10331
10338
|
case "website":
|
|
10332
10339
|
return null;
|
|
10333
10340
|
case "audio":
|
|
@@ -11425,6 +11432,309 @@ var presentationCommand = createPresentationGenerateCommand({
|
|
|
11425
11432
|
Show choices: zero generate presentation`
|
|
11426
11433
|
});
|
|
11427
11434
|
|
|
11435
|
+
// src/commands/zero/generate/sprite.ts
|
|
11436
|
+
init_esm_shims();
|
|
11437
|
+
|
|
11438
|
+
// src/commands/zero/shared/sprite-authoring.ts
|
|
11439
|
+
init_esm_shims();
|
|
11440
|
+
var SPRITE_SKILL = {
|
|
11441
|
+
repo: "0x0funky/agent-sprite-forge",
|
|
11442
|
+
ref: "main",
|
|
11443
|
+
skillPath: "skills/generate2dsprite/SKILL.md",
|
|
11444
|
+
references: [
|
|
11445
|
+
"skills/generate2dsprite/references/prompt-rules.md",
|
|
11446
|
+
"skills/generate2dsprite/references/modes.md"
|
|
11447
|
+
],
|
|
11448
|
+
script: "skills/generate2dsprite/scripts/generate2dsprite.py"
|
|
11449
|
+
};
|
|
11450
|
+
var CORE_INVARIANTS = [
|
|
11451
|
+
"Every raw sprite image must come from built-in image generation. Never draw raw sprite art with Three.js, Canvas, SVG, HTML/CSS, PIL shapes, procedural geometry, placeholder primitives, or code-rendered screenshots. Code may only assemble layout guides, postprocess generated images, or display finished assets at runtime.",
|
|
11452
|
+
"Background is 100% solid flat magenta `#FF00FF` with no gradient, so the local processor can chroma-key it to transparency. Keep this rule unless the user explicitly wants a different processing workflow.",
|
|
11453
|
+
"No text, labels, UI, speech bubbles, borders, or frames between cells. Generate the exact requested grid count only.",
|
|
11454
|
+
"Keep the same asset identity, the same bounding box, and the same pixel scale across every frame.",
|
|
11455
|
+
"Containment: the entire subject fits fully inside each cell with magenta margin on all four sides. No limb, weapon, tail, wing tip, orb, spark, or trail may cross a cell edge.",
|
|
11456
|
+
"Do not use raw single-row sheets (1x4, 1x6, 1x8, 1xN) for any body subject \u2014 players, heroes, creatures, NPCs, enemies, summons, or animated props. Use centered multi-row grids: 4 frames -> 2x2, 6 -> 2x3, 8 -> 2x4, 9 -> 3x3, 12 -> 3x4 or 4x3, 16 -> 4x4.",
|
|
11457
|
+
"For controllable heroes and main characters, attack/shoot/cast body sheets are body-only by default and must preserve idle/run body scale and the feet/bottom anchor. Generate slash arcs, weapon trails, muzzle flashes, projectiles, dust, and impacts as separate fx/projectile/impact sheets unless the runtime explicitly supports wider per-action cells plus per-action origins.",
|
|
11458
|
+
"For map prop packs, classify props first. Square 2x2/3x3/4x4 packs are only for compact props. Floors, platforms, bridges, walls, ladders, gates, doors, long hazards, wide/tall props, collision-bearing objects, and tileset/strip pieces use one-by-one generation, 1x3/1x4 strips, custom wide cells, or a tileset-like atlas instead.",
|
|
11459
|
+
"Mixed-action atlases (4x4, 5x5, custom) are a deterministic delivery step assembled from separate per-action sheets after each passes QC \u2014 never one raw mixed-action image. Raw multi-cell grids are valid only for one coherent action family, canonical directional locomotion, prop packs, or tileset-like atlases."
|
|
11460
|
+
];
|
|
11461
|
+
var WORKFLOW = [
|
|
11462
|
+
"1. Resolve the upstream skill below, then infer or confirm the asset plan. Pick the smallest useful output and do not pad unrelated actions into one raw sheet.",
|
|
11463
|
+
"2. Write the art prompt by hand using the skill's prompt-rules. Lock the art style, the exact sheet shape, the solid magenta background, the identity, and the containment rules. Do not delegate prompt writing to a script.",
|
|
11464
|
+
"3. Generate each raw sheet with built-in image generation using the recommended model below. If a reference is involved, make it visible to the model first (view a local file before generating); never pass a bare filesystem path as the visual reference.",
|
|
11465
|
+
"4. Postprocess each raw sheet locally with the skill's processor script: magenta cleanup, frame extraction, alignment, shared-scale normalization, component filtering, QC metadata, transparent sheet export, and GIF export.",
|
|
11466
|
+
"5. QC each sheet: no frame touches a cell edge, scale is consistent, detached FX did not become noise, the sheet reads as one coherent animation, and hero/player body height matches the accepted idle/run scale within ~10-15%. Reprocess or regenerate if it fails.",
|
|
11467
|
+
"6. Return the bundle for the resolved plan (single sheet, unit/spell/combat bundle, line bundle, or hero action bundle with separate FX assets and an optional assembled engine atlas after per-action QC)."
|
|
11468
|
+
];
|
|
11469
|
+
var EXPECTED_OUTPUTS = [
|
|
11470
|
+
"`raw-sheet.png` (and one raw sheet per action for bundles)",
|
|
11471
|
+
"`raw-sheet-clean.png` (magenta cleaned)",
|
|
11472
|
+
"`sheet-transparent.png`",
|
|
11473
|
+
"per-frame PNGs",
|
|
11474
|
+
"`animation.gif` (per direction/action where applicable)",
|
|
11475
|
+
"`prompt-used.txt`",
|
|
11476
|
+
"`pipeline-meta.json`"
|
|
11477
|
+
];
|
|
11478
|
+
function createSpriteAuthoringPacket(options) {
|
|
11479
|
+
const { prompt, plan } = options;
|
|
11480
|
+
const outputDir2 = `./generated/sprites/${plan.name}`;
|
|
11481
|
+
const planEntries = [
|
|
11482
|
+
["Asset type", plan.assetType],
|
|
11483
|
+
["Action", plan.action],
|
|
11484
|
+
["View", plan.view],
|
|
11485
|
+
["Sheet / grid", plan.sheet],
|
|
11486
|
+
["Frames", plan.frames],
|
|
11487
|
+
["Bundle", plan.bundle],
|
|
11488
|
+
["Art style", plan.artStyle],
|
|
11489
|
+
["Anchor", plan.anchor],
|
|
11490
|
+
["Margin", plan.margin],
|
|
11491
|
+
["Effect policy", plan.effectPolicy],
|
|
11492
|
+
["Reference", plan.reference]
|
|
11493
|
+
];
|
|
11494
|
+
const instructions = [
|
|
11495
|
+
"# Zero generate sprite",
|
|
11496
|
+
"",
|
|
11497
|
+
"This is a federated generation source-selection packet for the current agent.",
|
|
11498
|
+
"Zero is not generating these sprites on the server. You resolve the sprite skill below, write the art prompt yourself, generate each raw sheet with built-in image generation, then run the skill's local processor for chroma-key cleanup, frame extraction, alignment, QC, and transparent/GIF export.",
|
|
11499
|
+
"",
|
|
11500
|
+
"## User Prompt",
|
|
11501
|
+
prompt,
|
|
11502
|
+
"",
|
|
11503
|
+
"## Sprite Plan",
|
|
11504
|
+
"These parameters were resolved from the command. `agent decides` means the flag was not set \u2014 infer the best value from the prompt and the skill's modes reference; do not force the user to spell it out.",
|
|
11505
|
+
"",
|
|
11506
|
+
...planEntries.map(([label, value]) => {
|
|
11507
|
+
return `- ${label}: ${value}`;
|
|
11508
|
+
}),
|
|
11509
|
+
`- Output name: ${plan.name}`,
|
|
11510
|
+
"",
|
|
11511
|
+
"## Recommended Model",
|
|
11512
|
+
`- Use \`${plan.model}\` for every raw sheet via built-in image generation (\`zero generate image --provider built-in --model ${plan.model} --skip-style --prompt "..."\`, or the in-context image tool).`,
|
|
11513
|
+
"- 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.",
|
|
11514
|
+
"- Pick a sheet-friendly square or grid-aligned size (for example 1024x1024 for 2x2/3x3/4x4) so each cell stays evenly spaced.",
|
|
11515
|
+
"",
|
|
11516
|
+
"## Workflow Skill",
|
|
11517
|
+
"Resolve this skill before authoring; it is the authority for sprite prompt patterns, sheet/bundle selection, and the postprocessing primitive.",
|
|
11518
|
+
"",
|
|
11519
|
+
`- Repo: \`${SPRITE_SKILL.repo}@${SPRITE_SKILL.ref}\``,
|
|
11520
|
+
`- Skill: \`${SPRITE_SKILL.skillPath}\``,
|
|
11521
|
+
`- References: ${SPRITE_SKILL.references.map((ref) => {
|
|
11522
|
+
return `\`${ref}\``;
|
|
11523
|
+
}).join(", ")}`,
|
|
11524
|
+
`- Processor script: \`${SPRITE_SKILL.script}\``,
|
|
11525
|
+
"- For map props that must match a tile map, prefer the sibling `generate2dmap` skill in the same repo.",
|
|
11526
|
+
"- If a source file cannot be fetched, state that limitation and fall back to the core invariants below.",
|
|
11527
|
+
"",
|
|
11528
|
+
"## Core Invariants",
|
|
11529
|
+
...CORE_INVARIANTS.map((rule) => {
|
|
11530
|
+
return `- ${rule}`;
|
|
11531
|
+
}),
|
|
11532
|
+
"",
|
|
11533
|
+
"## Workflow",
|
|
11534
|
+
...WORKFLOW,
|
|
11535
|
+
"",
|
|
11536
|
+
"## Output Contract",
|
|
11537
|
+
`- Write the bundle under \`${outputDir2}/\`.`,
|
|
11538
|
+
"- Keep the original generated images and produce, per sheet:",
|
|
11539
|
+
...EXPECTED_OUTPUTS.map((item) => {
|
|
11540
|
+
return ` - ${item}`;
|
|
11541
|
+
}),
|
|
11542
|
+
"- For bundles, create one subfolder per asset and keep the per-action FX/projectile/impact sheets separate.",
|
|
11543
|
+
"",
|
|
11544
|
+
"## Verification",
|
|
11545
|
+
"- Confirm each transparent sheet and its frames are nonblank and free of magenta fringing.",
|
|
11546
|
+
"- Confirm no frame touches a cell edge and that scale and identity stay consistent across frames.",
|
|
11547
|
+
"- For hero/player body actions, confirm body height matches the accepted idle/run scale within ~10-15%.",
|
|
11548
|
+
"- Report the output directory, the final assets, and the resolved plan."
|
|
11549
|
+
].join("\n");
|
|
11550
|
+
return {
|
|
11551
|
+
type: "generation-source-selection",
|
|
11552
|
+
kind: "sprite",
|
|
11553
|
+
prompt,
|
|
11554
|
+
plan,
|
|
11555
|
+
model: plan.model,
|
|
11556
|
+
outputDir: outputDir2,
|
|
11557
|
+
skill: SPRITE_SKILL,
|
|
11558
|
+
instructions
|
|
11559
|
+
};
|
|
11560
|
+
}
|
|
11561
|
+
|
|
11562
|
+
// src/commands/zero/generate/sprite.ts
|
|
11563
|
+
var SPRITE_USAGE_COMMAND = "zero generate sprite";
|
|
11564
|
+
var DEFAULT_MODEL = "gpt-image-2";
|
|
11565
|
+
var AGENT_DECIDES = "agent decides";
|
|
11566
|
+
var ASSET_TYPES = [
|
|
11567
|
+
"player",
|
|
11568
|
+
"npc",
|
|
11569
|
+
"creature",
|
|
11570
|
+
"character",
|
|
11571
|
+
"spell",
|
|
11572
|
+
"projectile",
|
|
11573
|
+
"impact",
|
|
11574
|
+
"prop",
|
|
11575
|
+
"summon",
|
|
11576
|
+
"fx"
|
|
11577
|
+
];
|
|
11578
|
+
var ACTIONS = [
|
|
11579
|
+
"single",
|
|
11580
|
+
"idle",
|
|
11581
|
+
"cast",
|
|
11582
|
+
"attack",
|
|
11583
|
+
"shoot",
|
|
11584
|
+
"jump",
|
|
11585
|
+
"hurt",
|
|
11586
|
+
"combat",
|
|
11587
|
+
"walk",
|
|
11588
|
+
"run",
|
|
11589
|
+
"hover",
|
|
11590
|
+
"charge",
|
|
11591
|
+
"projectile",
|
|
11592
|
+
"impact",
|
|
11593
|
+
"explode",
|
|
11594
|
+
"death"
|
|
11595
|
+
];
|
|
11596
|
+
var VIEWS = ["topdown", "side", "3-4"];
|
|
11597
|
+
var SHEETS = [
|
|
11598
|
+
"auto",
|
|
11599
|
+
"2x2",
|
|
11600
|
+
"2x3",
|
|
11601
|
+
"2x4",
|
|
11602
|
+
"3x3",
|
|
11603
|
+
"3x4",
|
|
11604
|
+
"4x4",
|
|
11605
|
+
"5x5",
|
|
11606
|
+
"strip-1x3",
|
|
11607
|
+
"strip-1x4",
|
|
11608
|
+
"custom"
|
|
11609
|
+
];
|
|
11610
|
+
var BUNDLES = [
|
|
11611
|
+
"single",
|
|
11612
|
+
"unit",
|
|
11613
|
+
"spell",
|
|
11614
|
+
"combat",
|
|
11615
|
+
"line",
|
|
11616
|
+
"hero-action",
|
|
11617
|
+
"engine-atlas"
|
|
11618
|
+
];
|
|
11619
|
+
var ART_STYLES = [
|
|
11620
|
+
"pixel-art",
|
|
11621
|
+
"clean-hd",
|
|
11622
|
+
"pixel-inspired",
|
|
11623
|
+
"retro-pixel",
|
|
11624
|
+
"map-style",
|
|
11625
|
+
"project-native"
|
|
11626
|
+
];
|
|
11627
|
+
var ANCHORS = ["center", "bottom", "feet"];
|
|
11628
|
+
var MARGINS = ["tight", "normal", "safe"];
|
|
11629
|
+
var EFFECT_POLICIES = ["all", "largest"];
|
|
11630
|
+
function validateEnum(flag, value, allowed) {
|
|
11631
|
+
if (value !== void 0 && !allowed.includes(value)) {
|
|
11632
|
+
throw new Error(
|
|
11633
|
+
`${flag} must be one of: ${allowed.join(", ")} (got "${value}")`
|
|
11634
|
+
);
|
|
11635
|
+
}
|
|
11636
|
+
}
|
|
11637
|
+
function resolveFrames(value) {
|
|
11638
|
+
if (value === void 0) {
|
|
11639
|
+
return AGENT_DECIDES;
|
|
11640
|
+
}
|
|
11641
|
+
if (value === "auto") {
|
|
11642
|
+
return value;
|
|
11643
|
+
}
|
|
11644
|
+
const frames = Number(value);
|
|
11645
|
+
if (!Number.isInteger(frames) || frames < 1 || frames > 64) {
|
|
11646
|
+
throw new Error("--frames must be 'auto' or an integer from 1 to 64");
|
|
11647
|
+
}
|
|
11648
|
+
return String(frames);
|
|
11649
|
+
}
|
|
11650
|
+
function slugify2(value) {
|
|
11651
|
+
const slug = value.toLowerCase().replace(/[^a-z0-9]+/gu, "-").replace(/^-+|-+$/gu, "").replace(/-{2,}/gu, "-").slice(0, 48).replace(/-+$/u, "");
|
|
11652
|
+
return slug.length >= 3 ? slug : "sprite";
|
|
11653
|
+
}
|
|
11654
|
+
var spriteCommand = new Command().name("sprite").description(
|
|
11655
|
+
"Prepare 2D game sprite/asset authoring instructions from a prompt"
|
|
11656
|
+
).option("--prompt <text>", "Sprite prompt/theme; can also be piped via stdin").option("--asset-type <type>", `Asset type: ${ASSET_TYPES.join(", ")}`).option("--action <action>", `Animation/action: ${ACTIONS.join(", ")}`).option(
|
|
11657
|
+
"--view <view>",
|
|
11658
|
+
`Camera view: ${VIEWS.join(", ")} (3-4 means 3/4 view)`
|
|
11659
|
+
).option("--sheet <grid>", `Sheet/grid shape: ${SHEETS.join(", ")}`, "auto").option("--frames <count>", "Frame count: 'auto' or an integer (1-64)").option("--bundle <preset>", `Bundle preset: ${BUNDLES.join(", ")}`).option(
|
|
11660
|
+
"--art-style <style>",
|
|
11661
|
+
`Sprite art style (the sprite analog of 'zero generate image --style'): ${ART_STYLES.join(", ")}`
|
|
11662
|
+
).option("--anchor <anchor>", `Frame anchor: ${ANCHORS.join(", ")}`).option("--margin <margin>", `Safe-area margin: ${MARGINS.join(", ")}`).option(
|
|
11663
|
+
"--effect-policy <policy>",
|
|
11664
|
+
`Detached-FX component policy: ${EFFECT_POLICIES.join(", ")}`
|
|
11665
|
+
).option(
|
|
11666
|
+
"--reference <url>",
|
|
11667
|
+
"Reference image URL for identity/style consistency"
|
|
11668
|
+
).option(
|
|
11669
|
+
"--model <model>",
|
|
11670
|
+
"Recommended image model for raw sheets",
|
|
11671
|
+
DEFAULT_MODEL
|
|
11672
|
+
).option("--name <slug>", "Output bundle name/slug").addHelpText(
|
|
11673
|
+
"after",
|
|
11674
|
+
`
|
|
11675
|
+
Examples:
|
|
11676
|
+
Generate sprite: ${SPRITE_USAGE_COMMAND} --prompt "A green slime monster idle loop"
|
|
11677
|
+
Pick asset + action: ${SPRITE_USAGE_COMMAND} --asset-type creature --action idle --sheet 3x3 --prompt "A fire dragon boss"
|
|
11678
|
+
Hero action bundle: ${SPRITE_USAGE_COMMAND} --asset-type player --bundle hero-action --view side --prompt "A knight with idle, run, attack, jump"
|
|
11679
|
+
4-direction walk: ${SPRITE_USAGE_COMMAND} --asset-type player --action walk --view topdown --sheet 4x4 --prompt "A 16-bit RPG villager"
|
|
11680
|
+
Pixel art style: ${SPRITE_USAGE_COMMAND} --art-style pixel-art --prompt "A retro fireball projectile" --sheet 2x2
|
|
11681
|
+
Match a reference: ${SPRITE_USAGE_COMMAND} --reference https://example.com/hero.png --action attack --prompt "Attack animation for this hero"
|
|
11682
|
+
Pipe prompt: cat brief.txt | ${SPRITE_USAGE_COMMAND}
|
|
11683
|
+
Show choices: ${SPRITE_USAGE_COMMAND}
|
|
11684
|
+
|
|
11685
|
+
Output:
|
|
11686
|
+
Prints a sprite source-selection packet for the current agent: the resolved
|
|
11687
|
+
plan, the recommended image model, the upstream sprite skill to resolve, and
|
|
11688
|
+
the hard containment rules for grids, identity, and FX.
|
|
11689
|
+
With no --prompt and no piped input, prints the generation choices instead.
|
|
11690
|
+
|
|
11691
|
+
Notes:
|
|
11692
|
+
- The agent generates each raw sheet with built-in image generation
|
|
11693
|
+
(gpt-image-2 recommended) on a solid magenta background, then runs the
|
|
11694
|
+
sprite skill's local processor for chroma-key cleanup, frame extraction,
|
|
11695
|
+
alignment, QC, and transparent/GIF export.
|
|
11696
|
+
- Raw sprite art must originate from image generation, never from code-drawn
|
|
11697
|
+
primitives (Three.js/Canvas/SVG/HTML/PIL).
|
|
11698
|
+
- Unset flags resolve to "agent decides"; the agent infers them from the
|
|
11699
|
+
prompt and the skill's modes reference.`
|
|
11700
|
+
).action(
|
|
11701
|
+
withErrorHandler(async (options) => {
|
|
11702
|
+
validateEnum("--asset-type", options.assetType, ASSET_TYPES);
|
|
11703
|
+
validateEnum("--action", options.action, ACTIONS);
|
|
11704
|
+
validateEnum("--view", options.view, VIEWS);
|
|
11705
|
+
validateEnum("--sheet", options.sheet, SHEETS);
|
|
11706
|
+
validateEnum("--bundle", options.bundle, BUNDLES);
|
|
11707
|
+
validateEnum("--art-style", options.artStyle, ART_STYLES);
|
|
11708
|
+
validateEnum("--anchor", options.anchor, ANCHORS);
|
|
11709
|
+
validateEnum("--margin", options.margin, MARGINS);
|
|
11710
|
+
validateEnum("--effect-policy", options.effectPolicy, EFFECT_POLICIES);
|
|
11711
|
+
const frames = resolveFrames(options.frames);
|
|
11712
|
+
const dispatch = await dispatchGenerate({
|
|
11713
|
+
generationType: "sprite",
|
|
11714
|
+
prompt: options.prompt
|
|
11715
|
+
});
|
|
11716
|
+
if (dispatch.outcome === "handled") return;
|
|
11717
|
+
const prompt = dispatch.prompt;
|
|
11718
|
+
const plan = {
|
|
11719
|
+
assetType: options.assetType ?? AGENT_DECIDES,
|
|
11720
|
+
action: options.action ?? AGENT_DECIDES,
|
|
11721
|
+
view: options.view ?? AGENT_DECIDES,
|
|
11722
|
+
sheet: options.sheet ?? "auto",
|
|
11723
|
+
frames,
|
|
11724
|
+
bundle: options.bundle ?? AGENT_DECIDES,
|
|
11725
|
+
artStyle: options.artStyle ?? AGENT_DECIDES,
|
|
11726
|
+
anchor: options.anchor ?? AGENT_DECIDES,
|
|
11727
|
+
margin: options.margin ?? AGENT_DECIDES,
|
|
11728
|
+
effectPolicy: options.effectPolicy ?? AGENT_DECIDES,
|
|
11729
|
+
reference: options.reference ?? "none",
|
|
11730
|
+
model: options.model,
|
|
11731
|
+
name: slugify2(options.name ?? prompt)
|
|
11732
|
+
};
|
|
11733
|
+
const packet = createSpriteAuthoringPacket({ prompt, plan });
|
|
11734
|
+
console.log(packet.instructions);
|
|
11735
|
+
})
|
|
11736
|
+
);
|
|
11737
|
+
|
|
11428
11738
|
// src/commands/zero/generate/video.ts
|
|
11429
11739
|
init_esm_shims();
|
|
11430
11740
|
|
|
@@ -11979,6 +12289,7 @@ function buildGenerateHelpText() {
|
|
|
11979
12289
|
' Generate docs: zero generate docs-design --prompt "A setup guide"',
|
|
11980
12290
|
' Generate video: zero generate video --prompt "A cinematic city shot"',
|
|
11981
12291
|
' Generate site: zero generate website --prompt "A launch site"',
|
|
12292
|
+
' Generate sprite: zero generate sprite --prompt "A slime monster idle loop"',
|
|
11982
12293
|
' Generate speech: zero generate voice --prompt "Hello"',
|
|
11983
12294
|
" Show music choices: zero generate music",
|
|
11984
12295
|
"",
|
|
@@ -11998,7 +12309,7 @@ Notes:
|
|
|
11998
12309
|
}
|
|
11999
12310
|
var generateCommand = new Command().name("generate").description(
|
|
12000
12311
|
"Generate assets via vm0's built-in pipelines or get connector skill-invocation guidance"
|
|
12001
|
-
).addCommand(imageCommand).addCommand(presentationCommand).addCommand(reportCommand).addCommand(docsDesignCommand).addCommand(posterCommand).addCommand(dashboardDesignCommand).addCommand(mobileAppDesignCommand).addCommand(videoCommand).addCommand(websiteCommand).addCommand(voiceCommand).addCommand(musicCommand).addCommand(textCommand).addCommand(codeCommand).addCommand(documentCommand).addHelpText("after", buildGenerateHelpText);
|
|
12312
|
+
).addCommand(imageCommand).addCommand(presentationCommand).addCommand(reportCommand).addCommand(docsDesignCommand).addCommand(posterCommand).addCommand(dashboardDesignCommand).addCommand(mobileAppDesignCommand).addCommand(videoCommand).addCommand(websiteCommand).addCommand(spriteCommand).addCommand(voiceCommand).addCommand(musicCommand).addCommand(textCommand).addCommand(codeCommand).addCommand(documentCommand).addHelpText("after", buildGenerateHelpText);
|
|
12002
12313
|
|
|
12003
12314
|
// src/commands/zero/web/index.ts
|
|
12004
12315
|
init_esm_shims();
|
|
@@ -12827,7 +13138,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
12827
13138
|
var program = new Command();
|
|
12828
13139
|
program.name("zero").description(
|
|
12829
13140
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
12830
|
-
).version("9.
|
|
13141
|
+
).version("9.177.0").addHelpText("after", () => {
|
|
12831
13142
|
return buildZeroHelpText();
|
|
12832
13143
|
});
|
|
12833
13144
|
if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {
|