@vm0/cli 9.249.1 → 9.249.2
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-PMWDKCSZ.js → agent-TOFXTWYP.js} +11 -10
- package/{agent-PMWDKCSZ.js.map → agent-TOFXTWYP.js.map} +1 -1
- package/{banking-S5RH46G5.js → banking-U7I6EJUO.js} +8 -7
- package/{banking-S5RH46G5.js.map → banking-U7I6EJUO.js.map} +1 -1
- package/{chat-2ZTZUIWC.js → chat-77EDGFMS.js} +9 -8
- package/{chat-2ZTZUIWC.js.map → chat-77EDGFMS.js.map} +1 -1
- package/{chunk-DIRAZ3YX.js → chunk-3VVCUQPB.js} +3 -3
- package/{chunk-DIRAZ3YX.js.map → chunk-3VVCUQPB.js.map} +1 -1
- package/{chunk-PLOJYRFL.js → chunk-4HN7U3JF.js} +40 -564
- package/chunk-4HN7U3JF.js.map +1 -0
- package/{chunk-FF5L22OE.js → chunk-5CZNUTFF.js} +3 -3
- package/chunk-A2NKQGRI.js +491 -0
- package/chunk-A2NKQGRI.js.map +1 -0
- package/{chunk-J2I5GYLR.js → chunk-AFNSFKAH.js} +5 -5
- package/{chunk-L63QVTYZ.js → chunk-BQOOTJNB.js} +27 -672
- package/chunk-BQOOTJNB.js.map +1 -0
- package/{chunk-KLIW3XK7.js → chunk-GPF7NSX7.js} +2 -2
- package/{chunk-HUMR2SA3.js → chunk-HSGQT7LT.js} +3 -3
- package/{chunk-SAW74AR6.js → chunk-JCLLQRCI.js} +3 -3
- package/{chunk-B3W2RUBP.js → chunk-LD4ZVU4O.js} +2 -2
- package/chunk-N6TDQYGF.js +678 -0
- package/chunk-N6TDQYGF.js.map +1 -0
- package/{chunk-KQN5YZZP.js → chunk-ROB3OE37.js} +10 -113
- package/chunk-ROB3OE37.js.map +1 -0
- package/{chunk-LTDQISD7.js → chunk-SB7EZ2ZO.js} +2 -2
- package/{chunk-RTYT3CSZ.js → chunk-UG5XA6KU.js} +2 -2
- package/{chunk-LKDE4AUC.js → chunk-UNQJRTJQ.js} +3 -3
- package/chunk-W75R7EZF.js +17 -0
- package/chunk-W75R7EZF.js.map +1 -0
- package/chunk-WDDZJGWL.js +32 -0
- package/chunk-WDDZJGWL.js.map +1 -0
- package/{chunk-JFY6GK7Y.js → chunk-X2545RBX.js} +2 -2
- package/{chunk-ZE2VIESK.js → chunk-X4DBCBU4.js} +2 -2
- package/{computer-use-GRK4TZYN.js → computer-use-BCGPVGWS.js} +7 -6
- package/{computer-use-GRK4TZYN.js.map → computer-use-BCGPVGWS.js.map} +1 -1
- package/{connector-2SVH4F2N.js → connector-CHZSI2LW.js} +14 -13
- package/{connector-2SVH4F2N.js.map → connector-CHZSI2LW.js.map} +1 -1
- package/credit-RWFBPKOS.js +166 -0
- package/credit-RWFBPKOS.js.map +1 -0
- package/{developer-support-RYTLIFUN.js → developer-support-IVR3HIP7.js} +8 -7
- package/{developer-support-RYTLIFUN.js.map → developer-support-IVR3HIP7.js.map} +1 -1
- package/{doctor-CS5TFE6A.js → doctor-KGWTXW2Q.js} +39 -13
- package/doctor-KGWTXW2Q.js.map +1 -0
- package/{esm-PZKPCIYJ.js → esm-GOCEMHJO.js} +3 -3
- package/{feishu-HFQIJDBU.js → feishu-PLF4P5OG.js} +8 -7
- package/{feishu-HFQIJDBU.js.map → feishu-PLF4P5OG.js.map} +1 -1
- package/{finance-56HIRALT.js → finance-LVFG3WWP.js} +8 -7
- package/{finance-56HIRALT.js.map → finance-LVFG3WWP.js.map} +1 -1
- package/{generate-4FEC4YVM.js → generate-4FIBMMJO.js} +77 -22
- package/generate-4FIBMMJO.js.map +1 -0
- package/{getMachineId-bsd-L73QENVB.js → getMachineId-bsd-SB7C44VX.js} +4 -4
- package/{getMachineId-darwin-TCCWKQ2S.js → getMachineId-darwin-R4BWY3CQ.js} +4 -4
- package/{getMachineId-linux-TJYYUZVM.js → getMachineId-linux-BR4HVNPW.js} +3 -3
- package/{getMachineId-unsupported-DPRVLH4Y.js → getMachineId-unsupported-FPGM635L.js} +3 -3
- package/{getMachineId-win-7EE436CJ.js → getMachineId-win-RB4JMF33.js} +4 -4
- package/{github-AALJ7IEM.js → github-WHNAVVG3.js} +8 -7
- package/{github-AALJ7IEM.js.map → github-WHNAVVG3.js.map} +1 -1
- package/{goal-CFSXEKHU.js → goal-G4J2BQ5Z.js} +8 -7
- package/{goal-CFSXEKHU.js.map → goal-G4J2BQ5Z.js.map} +1 -1
- package/{host-6NKXFQCO.js → host-3W6U2ZUP.js} +8 -7
- package/{host-6NKXFQCO.js.map → host-3W6U2ZUP.js.map} +1 -1
- package/{intro-MIVVJG7M.js → intro-PMHOBGDL.js} +3 -3
- package/{logs-F4KPELTF.js → logs-P7JLTGXY.js} +10 -9
- package/{logs-F4KPELTF.js.map → logs-P7JLTGXY.js.map} +1 -1
- package/{mail-RZTLZU3I.js → mail-LIAOXDD4.js} +12 -11
- package/{mail-RZTLZU3I.js.map → mail-LIAOXDD4.js.map} +1 -1
- package/{maps-QRHGR33R.js → maps-C4NOXSE7.js} +8 -7
- package/{maps-QRHGR33R.js.map → maps-C4NOXSE7.js.map} +1 -1
- package/{model-6N5VPIS5.js → model-I2MNQ5KC.js} +9 -8
- package/{model-6N5VPIS5.js.map → model-I2MNQ5KC.js.map} +1 -1
- package/{model-provider-UZO32ZTC.js → model-provider-AOCCHEMP.js} +9 -8
- package/{model-provider-UZO32ZTC.js.map → model-provider-AOCCHEMP.js.map} +1 -1
- package/{org-26ZL2W2U.js → org-MVBG3WXZ.js} +9 -8
- package/{org-26ZL2W2U.js.map → org-MVBG3WXZ.js.map} +1 -1
- package/package.json +1 -1
- package/{phone-QTRZLYIG.js → phone-4OZQFYHU.js} +8 -7
- package/{phone-QTRZLYIG.js.map → phone-4OZQFYHU.js.map} +1 -1
- package/{preference-JCFTTUBN.js → preference-H2A3WBGQ.js} +9 -8
- package/{preference-JCFTTUBN.js.map → preference-H2A3WBGQ.js.map} +1 -1
- package/{resource-64R7T4FF.js → resource-CPCQ6V6M.js} +9 -8
- package/{resource-64R7T4FF.js.map → resource-CPCQ6V6M.js.map} +1 -1
- package/{scrape-LVGJ56IS.js → scrape-6RMFDYAT.js} +8 -7
- package/{scrape-LVGJ56IS.js.map → scrape-6RMFDYAT.js.map} +1 -1
- package/{search-TRISF64L.js → search-HSQVSQZY.js} +10 -9
- package/{search-TRISF64L.js.map → search-HSQVSQZY.js.map} +1 -1
- package/{secret-UAJDU3SX.js → secret-S4D6CNOX.js} +9 -8
- package/{secret-UAJDU3SX.js.map → secret-S4D6CNOX.js.map} +1 -1
- package/{slack-PDOPNS5Z.js → slack-E3E2NIDZ.js} +50 -175
- package/slack-E3E2NIDZ.js.map +1 -0
- package/{teams-BL36IS5U.js → teams-CLEWT2LQ.js} +8 -7
- package/{teams-BL36IS5U.js.map → teams-CLEWT2LQ.js.map} +1 -1
- package/{telegram-X7YTUVNV.js → telegram-35FKKA4K.js} +8 -7
- package/{telegram-X7YTUVNV.js.map → telegram-35FKKA4K.js.map} +1 -1
- package/{undici-ZMFN7TNU.js → undici-YXSVPIYI.js} +2 -2
- package/upgrade-DNGUR42E.js +50 -0
- package/upgrade-DNGUR42E.js.map +1 -0
- package/{variable-EBCBNZSU.js → variable-C7RWUPV6.js} +9 -8
- package/{variable-EBCBNZSU.js.map → variable-C7RWUPV6.js.map} +1 -1
- package/{video-3HFJJJEE.js → video-JS5VOA2S.js} +9 -7
- package/{video-3HFJJJEE.js.map → video-JS5VOA2S.js.map} +1 -1
- package/{weather-Y37FKFKU.js → weather-5R2N5OX4.js} +8 -7
- package/{weather-Y37FKFKU.js.map → weather-5R2N5OX4.js.map} +1 -1
- package/{web-ZEWEVAI3.js → web-FXIIYCZ7.js} +10 -8
- package/{web-ZEWEVAI3.js.map → web-FXIIYCZ7.js.map} +1 -1
- package/{web-search-37SGCKB7.js → web-search-SZP7J4UM.js} +8 -7
- package/{web-search-37SGCKB7.js.map → web-search-SZP7J4UM.js.map} +1 -1
- package/{whoami-VZI6VS4C.js → whoami-J4FRN67A.js} +10 -9
- package/{whoami-VZI6VS4C.js.map → whoami-J4FRN67A.js.map} +1 -1
- package/{workflow-3WGBRMM5.js → workflow-HQHZKXB2.js} +9 -8
- package/{workflow-3WGBRMM5.js.map → workflow-HQHZKXB2.js.map} +1 -1
- package/zero.js +88 -61
- package/zero.js.map +1 -1
- package/chunk-KQN5YZZP.js.map +0 -1
- package/chunk-L63QVTYZ.js.map +0 -1
- package/chunk-LRHXR7JT.js +0 -33
- package/chunk-LRHXR7JT.js.map +0 -1
- package/chunk-PLOJYRFL.js.map +0 -1
- package/credit-LGMFDRFK.js +0 -128
- package/credit-LGMFDRFK.js.map +0 -1
- package/doctor-CS5TFE6A.js.map +0 -1
- package/generate-4FEC4YVM.js.map +0 -1
- package/slack-PDOPNS5Z.js.map +0 -1
- /package/{chunk-FF5L22OE.js.map → chunk-5CZNUTFF.js.map} +0 -0
- /package/{chunk-J2I5GYLR.js.map → chunk-AFNSFKAH.js.map} +0 -0
- /package/{chunk-KLIW3XK7.js.map → chunk-GPF7NSX7.js.map} +0 -0
- /package/{chunk-HUMR2SA3.js.map → chunk-HSGQT7LT.js.map} +0 -0
- /package/{chunk-SAW74AR6.js.map → chunk-JCLLQRCI.js.map} +0 -0
- /package/{chunk-B3W2RUBP.js.map → chunk-LD4ZVU4O.js.map} +0 -0
- /package/{chunk-LTDQISD7.js.map → chunk-SB7EZ2ZO.js.map} +0 -0
- /package/{chunk-RTYT3CSZ.js.map → chunk-UG5XA6KU.js.map} +0 -0
- /package/{chunk-LKDE4AUC.js.map → chunk-UNQJRTJQ.js.map} +0 -0
- /package/{chunk-JFY6GK7Y.js.map → chunk-X2545RBX.js.map} +0 -0
- /package/{chunk-ZE2VIESK.js.map → chunk-X4DBCBU4.js.map} +0 -0
- /package/{esm-PZKPCIYJ.js.map → esm-GOCEMHJO.js.map} +0 -0
- /package/{getMachineId-bsd-L73QENVB.js.map → getMachineId-bsd-SB7C44VX.js.map} +0 -0
- /package/{getMachineId-darwin-TCCWKQ2S.js.map → getMachineId-darwin-R4BWY3CQ.js.map} +0 -0
- /package/{getMachineId-linux-TJYYUZVM.js.map → getMachineId-linux-BR4HVNPW.js.map} +0 -0
- /package/{getMachineId-unsupported-DPRVLH4Y.js.map → getMachineId-unsupported-FPGM635L.js.map} +0 -0
- /package/{getMachineId-win-7EE436CJ.js.map → getMachineId-win-RB4JMF33.js.map} +0 -0
- /package/{intro-MIVVJG7M.js.map → intro-PMHOBGDL.js.map} +0 -0
- /package/{undici-ZMFN7TNU.js.map → undici-YXSVPIYI.js.map} +0 -0
package/generate-4FEC4YVM.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/zero/generate/index.ts","../src/commands/zero/generate/image.ts","../src/commands/zero/shared/image-generate.ts","../src/commands/zero/shared/image-style-authoring.ts","../src/commands/zero/shared/resource-registry.ts","../src/commands/zero/shared/resource-listing.ts","../src/commands/zero/generate/lib/dispatch.ts","../src/commands/zero/generate/lib/connector-guidance.ts","../src/commands/zero/generate/lib/lister.ts","../src/commands/zero/generate/artifacts.ts","../src/commands/zero/shared/artifact-generate.ts","../src/commands/zero/shared/html-artifact-authoring.ts","../src/commands/zero/generate/presentation.ts","../src/commands/zero/shared/presentation-generate.ts","../src/commands/zero/generate/sprite.ts","../src/commands/zero/shared/sprite-authoring.ts","../src/commands/zero/generate/video.ts","../src/commands/zero/shared/video-generate.ts","../src/commands/zero/shared/video-template-authoring.ts","../src/commands/zero/generate/website.ts","../src/commands/zero/generate/voice.ts","../src/commands/zero/shared/voice-generate.ts","../src/commands/zero/generate/lister-only.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { imageCommand } from \"./image\";\nimport {\n dashboardDesignCommand,\n docsDesignCommand,\n mobileAppDesignCommand,\n posterCommand,\n reportCommand,\n} from \"./artifacts\";\nimport { presentationCommand } from \"./presentation\";\nimport { spriteCommand } from \"./sprite\";\nimport { videoCommand } from \"./video\";\nimport { websiteCommand } from \"./website\";\nimport { voiceCommand } from \"./voice\";\nimport { createListerOnlyCommand } from \"./lister-only\";\n\nconst musicCommand = createListerOnlyCommand({\n name: \"music\",\n generationType: \"music\",\n description: \"List connectors that provide music generation\",\n});\n\nconst textCommand = createListerOnlyCommand({\n name: \"text\",\n generationType: \"text\",\n description: \"List connectors that provide text generation\",\n});\n\nconst codeCommand = createListerOnlyCommand({\n name: \"code\",\n generationType: \"code\",\n description: \"List connectors that provide code generation\",\n});\n\nconst documentCommand = createListerOnlyCommand({\n name: \"document\",\n generationType: \"document\",\n description: \"List connectors that provide document generation\",\n});\n\nfunction buildGenerateHelpText(): string {\n const examples = [\n ' Generate image: zero generate image --raw-prompt \"A watercolor fox\"',\n ' Generate deck: zero generate presentation --prompt \"A product roadmap\"',\n ' Generate report: zero generate report --prompt \"A Q2 usage report\"',\n ' Generate docs: zero generate docs-design --prompt \"A setup guide\"',\n ' Generate video: zero generate video --prompt \"A cinematic city shot\"',\n ' Generate site: zero generate website --prompt \"A launch site\"',\n ' Generate sprite: zero generate sprite --prompt \"A slime monster idle loop\"',\n ' Generate speech: zero generate voice --prompt \"Hello\"',\n \" Show music choices: zero generate music\",\n \"\",\n \" Show image choices: zero generate image\",\n \" Show report choices: zero generate report\",\n \" Use a connector: zero generate video --provider heygen\",\n \" Force built-in: zero generate image --provider built-in --model gpt-image-1.5 --raw-prompt ...\",\n ];\n\n return `\\nExamples:\\n${examples.join(\"\\n\")}\\n\\nNotes:\\n - Run \"zero generate <type>\" with no --prompt to list generation choices for that type.\n - Media and connector-backed generation types may expose --provider for vm0 or connector execution guidance.\n - HTML artifact types use registry-backed --design-system and --template selection.`;\n}\n\nexport const generateCommand = new Command()\n .name(\"generate\")\n .description(\n \"Generate assets via vm0's built-in pipelines or get connector skill-invocation guidance\",\n )\n .addCommand(imageCommand)\n .addCommand(presentationCommand)\n .addCommand(reportCommand)\n .addCommand(docsDesignCommand)\n .addCommand(posterCommand)\n .addCommand(dashboardDesignCommand)\n .addCommand(mobileAppDesignCommand)\n .addCommand(videoCommand)\n .addCommand(websiteCommand)\n .addCommand(spriteCommand)\n .addCommand(voiceCommand)\n .addCommand(musicCommand)\n .addCommand(textCommand)\n .addCommand(codeCommand)\n .addCommand(documentCommand)\n .addHelpText(\"after\", buildGenerateHelpText);\n","import { createImageGenerateCommand } from \"../shared/image-generate\";\n\nexport const imageCommand = createImageGenerateCommand({\n name: \"image\",\n generationType: \"image\",\n usageCommand: \"zero generate image\",\n examples: ` Compile styled prompt: zero generate image --style image-style:notion-illustration --prompt \"A product manager mapping a launch plan\" --compile\n Generate compiled: zero generate image --compiled-prompt \"A Notion-style brush-pen illustration...\"\n Generate raw: zero generate image --raw-prompt \"A watercolor fox\"\n Pipe compile prompt: cat prompt.txt | zero generate image --style image-style:notion-illustration --compile\n GPT Image model: zero generate image --compiled-prompt \"A poster\" --model gpt-image-1.5 --size 1024x1536 --quality high\n Flux model: zero generate image --raw-prompt \"A product hero shot\" --model flux-pro-1.1 --seed 42\n Nano Banana 2: zero generate image --compiled-prompt \"A crisp launch poster with readable typography\" --model nano-banana-2\n 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\n List providers: zero generate image\n Use a connector: zero generate image --provider replicate`,\n});\n","import { Command, InvalidArgumentError } from \"commander\";\nimport chalk from \"chalk\";\nimport { generateWebImage } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { createStyledImageCompilationPacket } from \"./image-style-authoring\";\nimport { findImageStyle, listImageStyles } from \"./resource-registry\";\nimport { formatRegistryListing } from \"./resource-listing\";\nimport { dispatchGenerate } from \"../generate/lib/dispatch\";\nimport type { GenerationType } from \"../generate/lib/lister\";\n\ninterface ImageOptions {\n prompt?: string;\n compiledPrompt?: string;\n rawPrompt?: string;\n provider?: string;\n model: string;\n size: string;\n quality: string;\n background: string;\n format: string;\n compression?: string;\n moderation: string;\n seed?: number;\n safetyTolerance: string;\n enhancePrompt?: boolean;\n imageUrl: string[];\n maskImageUrl?: string;\n inputFidelity?: string;\n imagePromptStrength?: string;\n style?: string;\n compile?: boolean;\n all?: boolean;\n}\n\ninterface ImageGenerateCommandConfig {\n name: string;\n generationType: GenerationType;\n usageCommand: string;\n examples: string;\n}\n\ntype ImagePromptMode = \"compile\" | \"compiled\" | \"raw\";\n\nfunction requireImageModeError(usageCommand: string): Error {\n const styles = listImageStyles();\n const message = [\n \"Choose one image prompt mode\",\n \"\",\n \"Modes:\",\n ` Compile styled prompt: ${usageCommand} --style ${styles[0]?.id ?? \"<style-id>\"} --prompt \"...\" --compile`,\n ` Generate compiled prompt: ${usageCommand} --compiled-prompt \"...\"`,\n ` Generate raw prompt: ${usageCommand} --raw-prompt \"...\"`,\n \"\",\n \"Available styles:\",\n formatRegistryListing(styles, \"image styles\"),\n ].join(\"\\n\");\n return new Error(message);\n}\n\nfunction unknownStyleError(id: string, usageCommand: string): Error {\n const styles = listImageStyles();\n const message = [\n `Unknown image style: ${id}`,\n \"\",\n \"Available styles:\",\n formatRegistryListing(styles, \"image styles\"),\n \"\",\n `Example:`,\n ` ${usageCommand} --style ${styles[0]?.id ?? \"<style-id>\"} --prompt \"...\" --compile`,\n ].join(\"\\n\");\n return new Error(message);\n}\n\nfunction parseCompression(value: string | undefined): number | undefined {\n if (value === undefined) {\n return undefined;\n }\n\n const compression = Number(value);\n if (!Number.isInteger(compression) || compression < 0 || compression > 100) {\n throw new Error(\"--compression must be an integer from 0 to 100\");\n }\n\n return compression;\n}\n\nfunction parseSeed(value: string): number {\n const seed = Number(value);\n if (!Number.isInteger(seed) || seed < 0 || !Number.isSafeInteger(seed)) {\n throw new InvalidArgumentError(\"seed must be a non-negative safe integer\");\n }\n return seed;\n}\n\nfunction collectString(value: string, previous: string[]): string[] {\n return [...previous, value];\n}\n\nfunction parseInputFidelity(value: string | undefined): string | undefined {\n if (value === undefined) {\n return undefined;\n }\n if (value !== \"low\" && value !== \"high\") {\n throw new Error(\"--input-fidelity must be low or high\");\n }\n return value;\n}\n\nfunction parseImagePromptStrength(\n value: string | undefined,\n): number | undefined {\n if (value === undefined) {\n return undefined;\n }\n const strength = Number(value);\n if (!Number.isFinite(strength) || strength < 0 || strength > 1) {\n throw new Error(\"--image-prompt-strength must be a number from 0 to 1\");\n }\n return strength;\n}\n\nfunction resolvePromptInput(options: ImageOptions): string | undefined {\n return options.compiledPrompt ?? options.rawPrompt ?? options.prompt;\n}\n\nfunction hasImagePromptModeRequest(options: ImageOptions): boolean {\n return (\n options.style !== undefined ||\n options.compile === true ||\n options.prompt !== undefined ||\n options.compiledPrompt !== undefined ||\n options.rawPrompt !== undefined\n );\n}\n\nfunction resolveImagePromptMode(\n options: ImageOptions,\n usageCommand: string,\n): ImagePromptMode {\n const hasCompiledPrompt = options.compiledPrompt !== undefined;\n const hasRawPrompt = options.rawPrompt !== undefined;\n const compile = options.compile === true;\n\n if (!compile && options.style) {\n throw new Error(\"--style can only be used with --compile\");\n }\n\n if ([compile, hasCompiledPrompt, hasRawPrompt].filter(Boolean).length !== 1) {\n throw requireImageModeError(usageCommand);\n }\n\n if (compile && !options.style) {\n throw new Error(\"--compile requires --style <id>\");\n }\n\n if (!compile && options.prompt !== undefined) {\n throw new Error(\n \"--prompt can only be used with --style <id> --compile; use --compiled-prompt or --raw-prompt to generate\",\n );\n }\n\n if (compile) {\n return \"compile\";\n }\n if (hasCompiledPrompt) {\n return \"compiled\";\n }\n return \"raw\";\n}\n\nexport function createImageGenerateCommand(\n config: ImageGenerateCommandConfig,\n): Command {\n return new Command()\n .name(config.name)\n .description(\"Generate a billed image file from a prompt\")\n .option(\n \"--prompt <text>\",\n \"User prompt to compile with --style and --compile; can also be piped via stdin\",\n )\n .option(\n \"--compiled-prompt <text>\",\n \"Final image prompt produced from a prompt-compilation packet\",\n )\n .option(\n \"--raw-prompt <text>\",\n \"Final image prompt for unstyled/model-native generation\",\n )\n .option(\n \"--provider <name>\",\n \"Provider: 'built-in' to run vm0's pipeline, or a connector name to get its skill-invocation guidance\",\n )\n .option(\n \"--all\",\n \"When listing providers (no --prompt given), include unavailable or not-yet-authorized connectors\",\n )\n .option(\n \"--model <model>\",\n \"Model: gpt-image-1 (default), gpt-image-2, gpt-image-1.5, gpt-image-1-mini, flux-pro-1.1, flux-pro-1.1-ultra, qwen-image, seedream4, or nano-banana-2\",\n \"gpt-image-1\",\n )\n .option(\n \"--size <size>\",\n \"Image size: auto or WIDTHxHEIGHT; support varies by model\",\n \"1024x1024\",\n )\n .option(\n \"--quality <quality>\",\n \"Image quality: low, medium, high, or auto\",\n \"medium\",\n )\n .option(\n \"--background <background>\",\n \"Background: auto, opaque, or transparent when supported\",\n \"auto\",\n )\n .option(\"--format <format>\", \"Output format: png, webp, or jpeg\", \"png\")\n .option(\"--compression <0-100>\", \"Output compression for jpeg/webp only\")\n .option(\n \"--moderation <moderation>\",\n \"Moderation strictness: auto or low\",\n \"auto\",\n )\n .option(\"--seed <integer>\", \"Deterministic seed for fal models\", parseSeed)\n .option(\"--safety-tolerance <level>\", \"fal safety tolerance: 1-6\", \"4\")\n .option(\"--enhance-prompt\", \"Enable fal prompt enhancement when supported\")\n .option(\n \"--image-url <url>\",\n \"Source/mockup image URL for image-to-image; repeat for multi-image edit models\",\n collectString,\n [],\n )\n .option(\n \"--mask-image-url <url>\",\n \"Mask image URL for supported edit models\",\n )\n .option(\n \"--input-fidelity <low|high>\",\n \"Source-image fidelity for GPT edit models\",\n )\n .option(\n \"--image-prompt-strength <0-1>\",\n \"Reference strength override for Flux Redux\",\n )\n .option(\n \"--style <id>\",\n \"Image style id to compile from the registry (see Image Styles below)\",\n )\n .option(\n \"--compile\",\n \"Resolve the selected style and print a prompt-compilation packet\",\n )\n .addHelpText(\"after\", () => {\n const styles = listImageStyles();\n return `\nExamples:\n${config.examples}\n\nOutput:\n Prints the generated /f/ image file URL and metadata with --compiled-prompt\n or --raw-prompt. With --style <id> --prompt \"...\" --compile, prints a\n prompt-compilation packet for the current agent.\n\nNotes:\n - Authenticates via ZERO_TOKEN (requires file:write capability)\n - Charges org credits after successful image generation\n - Uses fal.ai for all image model execution\n\nModels:\n - fal.ai: gpt-image-1 (default), gpt-image-2, gpt-image-1.5,\n gpt-image-1-mini, flux-pro-1.1, flux-pro-1.1-ultra, qwen-image,\n seedream4, nano-banana-2.\n GPT Image models bill by fal output image quality and size.\n Other fal generations bill by output image or rounded-up output\n megapixel, depending on the model.\n\nOptions:\n - Prompt modes: choose exactly one mode. Use --style <id> --prompt \"...\"\n --compile to prepare a styled prompt-compilation packet, --compiled-prompt\n to generate from an agent-compiled prompt, or --raw-prompt to generate\n without a style. stdin is supported for --prompt in compile mode.\n - Size: gpt-image-2 accepts auto or WIDTHxHEIGHT. Popular sizes include\n 1024x1024,\n 1536x1024, 1024x1536, 2048x2048, 2048x1152, 3840x2160,\n and 2160x3840. Custom sizes must have edges <= 3840px, both\n edges divisible by 16, long:short ratio <= 3:1, and total pixels\n between 655,360 and 8,294,400. gpt-image-1.5, gpt-image-1, and\n gpt-image-1-mini use auto, 1024x1024, 1536x1024, or 1024x1536.\n - Quality: low, medium, high, or auto. Low is fastest for drafts.\n - Background: auto, opaque, or transparent when supported. gpt-image-2,\n Flux, Qwen, and Seedream do not support transparent backgrounds.\n - Format: png, jpeg, or webp for GPT Image and Nano Banana 2 models; png or\n jpeg for the other fal models.\n - fal-only controls: --seed and --safety-tolerance for supported fal models;\n --enhance-prompt for flux-pro-1.1. --compression and --moderation low are\n not supported on the fal-backed image path.\n - Image-to-image: pass --image-url to use the model's fal edit/redux endpoint.\n Nano Banana 2 accepts up to 14 source images. Flux Redux accepts\n --image-prompt-strength to override the provider default; GPT edit models\n accept --input-fidelity and supported models accept --mask-image-url.\n\nImage Styles:\n${formatRegistryListing(styles, \"image styles\")}`;\n })\n .action(\n withErrorHandler(async (options: ImageOptions, command: Command) => {\n const dispatch = await dispatchGenerate({\n generationType: config.generationType,\n provider: options.provider,\n prompt: resolvePromptInput(options),\n all: options.all,\n listOnMissingPrompt: !hasImagePromptModeRequest(options),\n missingPromptError:\n options.compile || options.style\n ? \"--compile requires --prompt <text> or piped stdin\"\n : undefined,\n });\n if (dispatch.outcome === \"handled\") return;\n const resolvedPrompt = dispatch.prompt;\n const mode = resolveImagePromptMode(options, config.usageCommand);\n\n if (mode === \"compile\") {\n const styleId = options.style;\n if (!styleId) {\n throw new Error(\"--compile requires --style <id>\");\n }\n const style = findImageStyle(styleId);\n if (!style) {\n throw unknownStyleError(styleId, config.usageCommand);\n }\n\n const packet = createStyledImageCompilationPacket({\n prompt: resolvedPrompt,\n style,\n details: [\n `Model preference if direct image generation is used: ${options.model}`,\n `Requested size: ${options.size}`,\n `Requested quality: ${options.quality}`,\n `Requested background: ${options.background}`,\n `Requested format: ${options.format}`,\n `Source image URLs: ${\n options.imageUrl.length > 0\n ? options.imageUrl.join(\", \")\n : \"none\"\n }`,\n `Mask image URL: ${options.maskImageUrl ?? \"none\"}`,\n ],\n });\n\n console.log(packet.instructions);\n return;\n }\n\n const compression = parseCompression(options.compression);\n const inputFidelity = parseInputFidelity(options.inputFidelity);\n const imagePromptStrength = parseImagePromptStrength(\n options.imagePromptStrength,\n );\n const hasSourceImage = options.imageUrl.length > 0;\n const size =\n hasSourceImage && command.getOptionValueSource(\"size\") === \"default\"\n ? \"auto\"\n : options.size;\n const result = await generateWebImage({\n prompt: resolvedPrompt,\n model: options.model,\n size,\n quality: options.quality,\n background: options.background,\n outputFormat: options.format,\n outputCompression: compression,\n moderation: options.moderation,\n seed: options.seed,\n safetyTolerance: options.safetyTolerance,\n enhancePrompt: options.enhancePrompt,\n imageUrls: options.imageUrl,\n maskImageUrl: options.maskImageUrl,\n inputFidelity,\n imagePromptStrength,\n });\n\n console.log(chalk.green(`✓ Image generated: ${result.url}`));\n console.log(chalk.dim(` File: ${result.filename}`));\n console.log(chalk.dim(` Size: ${result.imageSize}`));\n console.log(chalk.dim(` Quality: ${result.quality}`));\n console.log(chalk.dim(` Format: ${result.outputFormat}`));\n if (result.outputCompression !== undefined) {\n console.log(chalk.dim(` Compression: ${result.outputCompression}`));\n }\n if (result.moderation) {\n console.log(chalk.dim(` Moderation: ${result.moderation}`));\n }\n if (result.safetyTolerance) {\n console.log(\n chalk.dim(` Safety tolerance: ${result.safetyTolerance}`),\n );\n }\n if (result.seed !== undefined) {\n console.log(chalk.dim(` Seed: ${result.seed}`));\n }\n console.log(chalk.dim(` Credits charged: ${result.creditsCharged}`));\n console.log(chalk.dim(` Model: ${result.model}`));\n console.log(chalk.dim(` Provider: ${result.provider}`));\n }),\n );\n}\n","import {\n type GenerationOutputKind,\n type RegistryEntry,\n} from \"./resource-registry\";\n\ninterface StyledImageCompilationOptions {\n readonly prompt: string;\n readonly details: readonly string[];\n readonly style: RegistryEntry;\n}\n\ninterface StyledImageCompilationPacket {\n readonly type: \"image-prompt-compilation\";\n readonly kind: \"image\";\n readonly prompt: string;\n readonly artifact: {\n readonly outputMode: \"primary-image\";\n readonly primaryArtifact: {\n readonly kind: GenerationOutputKind;\n readonly path: string;\n };\n readonly supportingAssets: readonly {\n readonly kind: GenerationOutputKind | \"metadata\";\n readonly path: string;\n readonly optional: boolean;\n }[];\n readonly previewKind: \"image\";\n readonly outputDir: string;\n };\n readonly authoring: {\n readonly details: readonly string[];\n readonly artifactRules: readonly string[];\n };\n readonly outputDir: string;\n readonly instructions: string;\n}\n\nfunction formatStyleSource(source: RegistryEntry[\"source\"]): readonly string[] {\n if (\"repo\" in source) {\n return [\n `- Repository: \\`${source.repo}@${source.ref}\\``,\n `- Path: \\`${source.path}\\``,\n ];\n }\n return [`- Path: \\`${source.path}\\``];\n}\n\nconst outputDir = \"./generated/images\";\nconst artifactRules = [\n \"Resolve the selected style source before compiling or generating.\",\n \"Use explicit requirements in the user prompt first, locked style requirements second, and CLI fallback values last.\",\n \"Keep visual style requirements in the compiled prompt; map only compatible execution settings to CLI flags (`--background` accepts only `auto`, `opaque`, or `transparent`).\",\n \"Generate with `--compiled-prompt`, without `--style`, and pass only required reference inputs.\",\n] as const;\n\nexport function createStyledImageCompilationPacket(\n options: StyledImageCompilationOptions,\n): StyledImageCompilationPacket {\n const artifact = {\n outputMode: \"primary-image\",\n primaryArtifact: {\n kind: \"image\",\n path: `${outputDir}/`,\n },\n supportingAssets: [\n {\n kind: \"metadata\",\n path: `${outputDir}/metadata.json`,\n optional: true,\n },\n ],\n previewKind: \"image\",\n outputDir,\n } as const;\n const instructions = [\n `# Zero generate image prompt compile ${options.style.id}`,\n \"\",\n \"This is an image prompt-compilation packet for the current agent.\",\n \"Zero is not generating this image yet. The image style has already been selected — resolve its source, compile the user prompt into a final image prompt, then generate with `--compiled-prompt`.\",\n \"\",\n \"## User Prompt\",\n options.prompt,\n \"\",\n \"## Selected Image Style\",\n `- \\`${options.style.id}\\` — ${options.style.name}`,\n `- ${options.style.description}`,\n \"\",\n \"## Style Source\",\n ...formatStyleSource(options.style.source),\n \"\",\n \"## Prompt Compiler Task\",\n \"- Read the selected style source before compiling, especially `SKILL.md`, references, examples, and templates. If unavailable, stop without generating.\",\n \"- Rewrite the user prompt into one final image-generation prompt that obeys the selected style.\",\n \"- Include style-specific composition, medium, palette, subject handling, reference usage, and must-avoid constraints in the final prompt.\",\n \"- Keep user intent intact; expand only the visual details needed to satisfy the style.\",\n \"- Return only the compiled prompt text when preparing the next command.\",\n \"\",\n \"## Artifact Output Model\",\n `- Primary artifact: \\`${artifact.primaryArtifact.kind}\\` under \\`${artifact.primaryArtifact.path}\\`.`,\n `- Output mode: \\`${artifact.outputMode}\\`.`,\n \"- Supporting metadata may live inside the same output directory when useful.\",\n \"\",\n \"## Requested Parameters\",\n ...options.details.map((detail) => {\n return `- ${detail}`;\n }),\n \"\",\n \"## Image Authoring Rules\",\n ...artifactRules.map((rule) => {\n return `- ${rule}`;\n }),\n \"\",\n \"## Next Command Template\",\n \"```bash\",\n 'zero generate image --compiled-prompt \"<compiled prompt>\"',\n \"```\",\n \"\",\n \"## Verification\",\n \"- Verify the final image exists and is nonblank.\",\n \"- Check that the selected style's required reference anchors or source assets were used when applicable.\",\n \"- Report the final image URL or path and the selected registry resource ID.\",\n ].join(\"\\n\");\n\n return {\n type: \"image-prompt-compilation\",\n kind: \"image\",\n prompt: options.prompt,\n artifact,\n authoring: {\n details: options.details,\n artifactRules,\n },\n outputDir,\n instructions,\n };\n}\n","// Thin re-export shim. The resource registry now lives in `@vm0/core` as the\n// single source of truth. Keep importing from this path within the CLI.\nexport * from \"@vm0/core/resource-registry\";\n","import type { RegistryEntry } from \"./resource-registry\";\n\n/**\n * Format a list of registry entries for help text or error messages.\n *\n * Each entry renders as a two-line block:\n *\n * ```\n * <id>\n * <desc or description>\n * ```\n *\n * Blank line between entries. Returns a single placeholder line when the\n * list is empty so callers can drop this directly into help output.\n */\nexport function formatRegistryListing(\n entries: readonly RegistryEntry[],\n emptyLabel: string,\n): string {\n if (entries.length === 0) {\n return ` (no ${emptyLabel} registered)`;\n }\n return entries\n .map((entry) => {\n const desc = entry.desc ?? entry.description;\n return ` ${entry.id}\\n ${desc}`;\n })\n .join(\"\\n\\n\");\n}\n\n/**\n * Canonicalize a user-supplied registry id by prepending the resource-kind\n * prefix when missing. For example, with prefix `template`, accepts either\n * `example` or `template:example`.\n */\nexport function canonicalizeRegistryId(prefix: string, value: string): string {\n const fullPrefix = `${prefix}:`;\n if (value.startsWith(fullPrefix)) {\n return value;\n }\n return `${fullPrefix}${value}`;\n}\n","import { readFileSync } from \"node:fs\";\nimport { printConnectorGuidance } from \"./connector-guidance\";\nimport { runLister, type GenerationType } from \"./lister\";\n\ninterface DispatchOptions {\n readonly generationType: GenerationType;\n readonly provider?: string;\n readonly prompt?: string;\n readonly all?: boolean;\n readonly listOnMissingPrompt?: boolean;\n readonly missingPromptError?: string;\n}\n\n/**\n * Resolve the dispatch for `zero generate <type>`.\n *\n * Returns `\"execute\"` when the caller should run the built-in pipeline.\n * Otherwise prints the appropriate output (lister or connector guidance)\n * and returns `\"handled\"`.\n *\n * The dispatcher consumes any piped stdin used to satisfy the prompt and\n * places the resolved text on `options.prompt` for the caller to use.\n */\nexport async function dispatchGenerate(\n options: DispatchOptions,\n): Promise<{ outcome: \"handled\" } | { outcome: \"execute\"; prompt: string }> {\n const provider = options.provider?.trim();\n\n if (provider && provider !== \"built-in\") {\n await printConnectorGuidance(options.generationType, provider);\n return { outcome: \"handled\" };\n }\n\n const resolvedPrompt = resolvePrompt(options.prompt);\n\n if (resolvedPrompt === null) {\n if (options.listOnMissingPrompt === false) {\n throw new Error(options.missingPromptError ?? \"Prompt is required\");\n }\n await runLister(options.generationType, {\n all: options.all,\n });\n return { outcome: \"handled\" };\n }\n\n return { outcome: \"execute\", prompt: resolvedPrompt };\n}\n\nfunction resolvePrompt(prompt: string | undefined): string | null {\n if (prompt?.trim()) {\n return prompt.trim();\n }\n\n if (!process.stdin.isTTY) {\n try {\n const piped = readFileSync(\"/dev/stdin\", \"utf8\").trim();\n if (piped.length > 0) {\n return piped;\n }\n } catch {\n // stdin not readable (e.g. test runner with no piped input);\n // treat as no piped prompt and fall through to lister.\n }\n }\n\n return null;\n}\n","import type { PublicConnectorCatalogItem } from \"@vm0/api-contracts/contracts/zero-connector-catalog\";\nimport { listZeroConnectorCatalog } from \"../../../../lib/api\";\nimport type { GenerationType } from \"./lister\";\n\nfunction toConnectorGenerationType(\n generationType: GenerationType,\n): string | null {\n switch (generationType) {\n case \"voice\":\n case \"music\":\n return \"audio\";\n case \"dashboard-design\":\n case \"docs-design\":\n case \"mobile-app-design\":\n case \"poster\":\n case \"presentation\":\n case \"report\":\n case \"sprite\":\n case \"website\":\n return null;\n case \"audio\":\n case \"code\":\n case \"document\":\n case \"image\":\n case \"text\":\n case \"video\":\n return generationType;\n }\n}\n\nfunction findConnector(\n connectors: readonly PublicConnectorCatalogItem[],\n provider: string,\n): PublicConnectorCatalogItem | null {\n const exact = connectors.find((connector) => {\n return connector.connectorRef === provider;\n });\n if (exact) return exact;\n\n const lower = provider.toLowerCase();\n return (\n connectors.find((connector) => {\n return connector.connectorRef.toLowerCase() === lower;\n }) ?? null\n );\n}\n\ninterface ConnectorGuidance {\n readonly type: string;\n readonly label: string;\n readonly supportsGenerationType: boolean;\n}\n\nasync function resolveConnector(\n provider: string,\n generationType: GenerationType,\n): Promise<ConnectorGuidance | null> {\n const catalog = await listZeroConnectorCatalog();\n const connector = findConnector(catalog.connectors, provider);\n if (!connector) return null;\n\n const connectorGenerationType = toConnectorGenerationType(generationType);\n const supports =\n connectorGenerationType !== null &&\n connector.generation.some((entry) => {\n return entry === connectorGenerationType;\n });\n return {\n type: connector.connectorRef,\n label: connector.label,\n supportsGenerationType: supports,\n };\n}\n\nexport async function printConnectorGuidance(\n generationType: GenerationType,\n provider: string,\n): Promise<void> {\n const guidance = await resolveConnector(provider, generationType);\n\n if (!guidance) {\n console.log(`Provider \"${provider}\" is not a known connector.`);\n console.log(\"\");\n console.log(\n `Run \"zero generate ${generationType}\" to see every provider available for this generation type.`,\n );\n return;\n }\n\n if (!guidance.supportsGenerationType) {\n console.log(\n `${guidance.label} (${guidance.type}) does not advertise ${generationType} generation.`,\n );\n console.log(\"\");\n console.log(\n `Run \"zero generate ${generationType}\" to see every provider that supports this generation type.`,\n );\n return;\n }\n\n console.log(\n `${guidance.label} (${guidance.type}) handles ${generationType} generation through its own connector skill, not through \"zero generate\".`,\n );\n console.log(\"\");\n console.log(`Next steps:`);\n console.log(` - Use the \"${guidance.type}\" skill in this session.`);\n console.log(\n ` - Or call the connector directly via its documented endpoints.`,\n );\n console.log(\"\");\n console.log(\n `Run \"zero connector status ${guidance.type}\" to verify the connector is connected and authorized for the current agent.`,\n );\n}\n","import chalk from \"chalk\";\nimport type { PublicConnectorCatalogStatusItem } from \"@vm0/api-contracts/contracts/zero-connector-catalog\";\nimport {\n getZeroAgentUserConnectors,\n listZeroConnectorCatalogStatus,\n} from \"../../../../lib/api\";\nimport { getPlatformOrigin } from \"../../doctor/platform-url\";\n\ntype ConnectorGenerationType =\n | \"audio\"\n | \"code\"\n | \"document\"\n | \"image\"\n | \"text\"\n | \"video\";\n\ntype BuiltInGenerationType =\n | \"dashboard-design\"\n | \"docs-design\"\n | \"image\"\n | \"mobile-app-design\"\n | \"music\"\n | \"poster\"\n | \"presentation\"\n | \"report\"\n | \"sprite\"\n | \"video\"\n | \"voice\"\n | \"website\";\nexport type GenerationType = ConnectorGenerationType | BuiltInGenerationType;\n\ninterface BuiltInGenerationProvider {\n label: string;\n model: string;\n command: string;\n reason: string;\n}\n\ninterface BuiltInGenerationCommand {\n label: string;\n command: string;\n models: string;\n}\n\ninterface GenerationContext {\n readonly lines: readonly string[];\n}\n\nconst BUILT_IN_GENERATION_PROVIDERS: Partial<\n Record<GenerationType, readonly BuiltInGenerationProvider[]>\n> = {\n image: [\n {\n label: \"Built-in fal.ai\",\n model: \"gpt-image-1\",\n command: \"zero generate image --provider built-in --model gpt-image-1 -h\",\n reason: \"available without connector setup\",\n },\n {\n label: \"Built-in fal.ai\",\n model: \"gpt-image-2\",\n command: \"zero generate image --provider built-in --model gpt-image-2 -h\",\n reason: \"available without connector setup\",\n },\n {\n label: \"Built-in fal.ai\",\n model: \"gpt-image-1.5\",\n command:\n \"zero generate image --provider built-in --model gpt-image-1.5 -h\",\n reason: \"available without connector setup\",\n },\n {\n label: \"Built-in fal.ai\",\n model: \"gpt-image-1-mini\",\n command:\n \"zero generate image --provider built-in --model gpt-image-1-mini -h\",\n reason: \"available without connector setup\",\n },\n {\n label: \"Built-in fal.ai\",\n model: \"fal-ai/flux-pro/v1.1\",\n command:\n \"zero generate image --provider built-in --model flux-pro-1.1 -h\",\n reason: \"available without connector setup\",\n },\n {\n label: \"Built-in fal.ai\",\n model: \"fal-ai/flux-pro/v1.1-ultra\",\n command:\n \"zero generate image --provider built-in --model flux-pro-1.1-ultra -h\",\n reason: \"available without connector setup\",\n },\n {\n label: \"Built-in fal.ai\",\n model: \"fal-ai/qwen-image\",\n command: \"zero generate image --provider built-in --model qwen-image -h\",\n reason: \"available without connector setup\",\n },\n {\n label: \"Built-in fal.ai\",\n model: \"fal-ai/bytedance/seedream/v4/text-to-image\",\n command: \"zero generate image --provider built-in --model seedream4 -h\",\n reason: \"available without connector setup\",\n },\n {\n label: \"Built-in fal.ai\",\n model: \"fal-ai/nano-banana-2\",\n command:\n \"zero generate image --provider built-in --model nano-banana-2 -h\",\n reason: \"available without connector setup\",\n },\n ],\n video: [\n {\n label: \"Built-in\",\n model: \"dreamina-seedance-2-0-260128\",\n command:\n \"zero generate video --provider built-in --model dreamina-seedance-2.0 -h\",\n reason: \"available without connector setup\",\n },\n {\n label: \"Built-in\",\n model: \"dreamina-seedance-2-0-fast-260128\",\n command:\n \"zero generate video --provider built-in --model dreamina-seedance-2.0-fast -h\",\n reason: \"available without connector setup\",\n },\n {\n label: \"Built-in\",\n model: \"seedance-1-5-pro-251215\",\n command:\n \"zero generate video --provider built-in --model seedance-1.5-pro -h\",\n reason: \"available without connector setup\",\n },\n {\n label: \"Built-in fal.ai\",\n model: \"fal-ai/veo3.1/fast\",\n command: \"zero generate video --provider built-in --model veo3.1-fast -h\",\n reason: \"available without connector setup\",\n },\n {\n label: \"Built-in fal.ai\",\n model: \"fal-ai/kling-video/v3/4k/text-to-video\",\n command: \"zero generate video --provider built-in --model kling-v3-4k -h\",\n reason: \"available without connector setup\",\n },\n ],\n voice: [\n {\n label: \"Built-in\",\n model: \"gpt-4o-mini-tts\",\n command: \"zero generate voice --provider built-in -h\",\n reason: \"available without connector setup\",\n },\n ],\n};\n\nconst BUILT_IN_GENERATION_COMMANDS: Partial<\n Record<GenerationType, BuiltInGenerationCommand>\n> = {\n image: {\n label: \"Built-in image generation\",\n command: \"zero generate image --provider built-in -h\",\n models:\n \"fal.ai: gpt-image-1 (default), gpt-image-2, gpt-image-1.5, gpt-image-1-mini, flux-pro-1.1, flux-pro-1.1-ultra, qwen-image, seedream4, nano-banana-2\",\n },\n video: {\n label: \"Built-in video generation\",\n command: \"zero generate video --provider built-in -h\",\n models:\n \"dreamina-seedance-2.0-fast (default), dreamina-seedance-2.0, seedance-1.5-pro, veo3.1-fast, kling-v3-4k\",\n },\n presentation: {\n label: \"Built-in presentation generation\",\n command: \"zero generate presentation -h\",\n models: \"gpt-5.5\",\n },\n report: {\n label: \"Built-in report generation\",\n command: \"zero generate report -h\",\n models: \"gpt-5.5\",\n },\n \"docs-design\": {\n label: \"Built-in docs design generation\",\n command: \"zero generate docs-design -h\",\n models: \"gpt-5.5\",\n },\n poster: {\n label: \"Built-in poster generation\",\n command: \"zero generate poster -h\",\n models: \"gpt-5.5\",\n },\n \"dashboard-design\": {\n label: \"Built-in dashboard design generation\",\n command: \"zero generate dashboard-design -h\",\n models: \"gpt-5.5\",\n },\n \"mobile-app-design\": {\n label: \"Built-in mobile app design generation\",\n command: \"zero generate mobile-app-design -h\",\n models: \"gpt-5.5\",\n },\n website: {\n label: \"Built-in website generation\",\n command: \"zero generate website -h\",\n models: \"gpt-5.5\",\n },\n sprite: {\n label: \"Built-in sprite asset generation\",\n command: \"zero generate sprite -h\",\n models: \"gpt-image-2 (recommended) via built-in image generation\",\n },\n voice: {\n label: \"Built-in voice generation\",\n command: \"zero generate voice --provider built-in -h\",\n models: \"gpt-4o-mini-tts\",\n },\n};\n\nconst GENERATION_CONTEXT: Partial<Record<GenerationType, GenerationContext>> = {\n website: {\n lines: [\n \"Standalone static website artifacts can be authored locally and published with zero host for a public URL.\",\n \"zero host is for static directories with index.html; it is not a general deploy system for apps that need a backend, database, worker, or long-running process.\",\n \"Existing web app changes should usually follow the project's own build, test, and deploy workflow.\",\n ],\n },\n};\n\nconst GENERATION_TYPE_LABELS: Record<GenerationType, string> = {\n audio: \"Audio\",\n code: \"Code\",\n \"dashboard-design\": \"Dashboard design\",\n document: \"Document\",\n \"docs-design\": \"Docs design\",\n image: \"Image\",\n \"mobile-app-design\": \"Mobile app design\",\n music: \"Music\",\n poster: \"Poster\",\n presentation: \"Presentation\",\n report: \"Report\",\n sprite: \"Sprite\",\n text: \"Text\",\n video: \"Video\",\n voice: \"Voice\",\n website: \"Website\",\n};\n\ntype CandidateStatus =\n | \"ready\"\n | \"needs-reconnect\"\n | \"not-authorized\"\n | \"not-connected\";\n\ninterface ListerOptions {\n all?: boolean;\n}\n\ninterface GenerationCandidate {\n type: string;\n label: string;\n status: CandidateStatus;\n reason: string;\n account?: string;\n authMethod?: string;\n actionLabel?: string;\n actionUrl?: string;\n}\n\nfunction getConnectorGenerationType(\n generationType: GenerationType,\n): ConnectorGenerationType | null {\n switch (generationType) {\n case \"voice\":\n case \"music\":\n return \"audio\";\n case \"dashboard-design\":\n case \"docs-design\":\n case \"mobile-app-design\":\n case \"poster\":\n case \"presentation\":\n case \"report\":\n case \"sprite\":\n case \"website\":\n return null;\n case \"audio\":\n case \"code\":\n case \"document\":\n case \"image\":\n case \"text\":\n case \"video\":\n return generationType;\n }\n}\n\nfunction getBuiltInProviders(\n generationType: GenerationType,\n): readonly BuiltInGenerationProvider[] {\n return BUILT_IN_GENERATION_PROVIDERS[generationType] ?? [];\n}\n\nfunction getBuiltInCommand(\n generationType: GenerationType,\n): BuiltInGenerationCommand | null {\n return BUILT_IN_GENERATION_COMMANDS[generationType] ?? null;\n}\n\nfunction getGenerationContext(\n generationType: GenerationType,\n): GenerationContext | null {\n return GENERATION_CONTEXT[generationType] ?? null;\n}\n\nfunction getGenerationConnectors(\n generationType: ConnectorGenerationType,\n connectors: readonly PublicConnectorCatalogStatusItem[],\n): PublicConnectorCatalogStatusItem[] {\n return connectors\n .filter((connector) => {\n return connector.generation.includes(generationType);\n })\n .sort((a, b) => {\n return a.connectorRef.localeCompare(b.connectorRef);\n });\n}\n\nfunction formatAccount(\n connector: PublicConnectorCatalogStatusItem,\n): string | undefined {\n if (connector.connection?.externalUsername) {\n return `@${connector.connection.externalUsername}`;\n }\n if (connector.connection?.externalEmail) {\n return connector.connection.externalEmail;\n }\n return undefined;\n}\n\nfunction getAction(\n status: CandidateStatus,\n type: string,\n label: string,\n agentId: string | undefined,\n platformOrigin: string,\n): { actionLabel?: string; actionUrl?: string } {\n if (status === \"needs-reconnect\") {\n return {\n actionLabel: `Reconnect ${label}`,\n actionUrl: `${platformOrigin}/connectors`,\n };\n }\n\n if (status === \"not-authorized\" && agentId) {\n return {\n actionLabel: `Authorize ${label}`,\n actionUrl: `${platformOrigin}/connectors/${type}/authorize?agentId=${agentId}`,\n };\n }\n\n if (status === \"not-connected\") {\n if (agentId) {\n return {\n actionLabel: `Connect and authorize ${label}`,\n actionUrl: `${platformOrigin}/connectors/${type}/connect?agentId=${agentId}`,\n };\n }\n\n return {\n actionLabel: `Connect ${label}`,\n actionUrl: `${platformOrigin}/connectors/${type}/connect`,\n };\n }\n\n return {};\n}\n\nfunction toCandidate(params: {\n connector: PublicConnectorCatalogStatusItem;\n authorizedTypes: Set<string> | null;\n agentId: string | undefined;\n platformOrigin: string;\n}): GenerationCandidate {\n const { connector, authorizedTypes, agentId, platformOrigin } = params;\n const type = connector.connectorRef;\n\n let status: CandidateStatus;\n let reason: string;\n\n if (connector.connectionStatus === \"reconnect-required\") {\n status = \"needs-reconnect\";\n reason = \"connected, reconnect required\";\n } else if (!connector.connected) {\n status = \"not-connected\";\n reason = agentId\n ? \"not connected or authorized for current agent\"\n : \"not connected\";\n } else if (authorizedTypes && !authorizedTypes.has(type)) {\n status = \"not-authorized\";\n reason = \"connected, not authorized for current agent\";\n } else {\n status = \"ready\";\n reason = agentId\n ? \"connected and authorized for current agent\"\n : \"connected; agent authorization was not checked\";\n }\n\n return {\n type,\n label: connector.label,\n status,\n reason,\n account: connector.connected ? formatAccount(connector) : undefined,\n authMethod: connector.connection?.authMethod,\n ...getAction(status, type, connector.label, agentId, platformOrigin),\n };\n}\n\nfunction pad(value: string, width: number): string {\n return value.padEnd(width);\n}\n\nfunction renderRows(candidates: GenerationCandidate[]): void {\n const typeWidth = Math.max(\n 4,\n ...candidates.map((candidate) => {\n return candidate.type.length;\n }),\n );\n const labelWidth = Math.max(\n 5,\n ...candidates.map((candidate) => {\n return candidate.label.length;\n }),\n );\n\n for (const candidate of candidates) {\n const suffix =\n candidate.status === \"ready\"\n ? (candidate.account ?? candidate.authMethod ?? \"\")\n : candidate.reason;\n console.log(\n ` ${pad(candidate.type, typeWidth)} ${pad(candidate.label, labelWidth)} ${suffix}`,\n );\n }\n}\n\nfunction renderActions(candidates: GenerationCandidate[]): void {\n const actionable = candidates.filter((candidate) => {\n return candidate.actionLabel && candidate.actionUrl;\n });\n if (actionable.length === 0) return;\n\n console.log(\"\");\n console.log(\"Next actions:\");\n for (const candidate of actionable) {\n console.log(` [${candidate.actionLabel}](${candidate.actionUrl})`);\n }\n}\n\nfunction renderBuiltInProvider(generationType: GenerationType): void {\n const command = getBuiltInCommand(generationType);\n if (command) {\n console.log(\"\");\n console.log(\"Built-in command:\");\n console.log(` vm0 ${command.label}`);\n console.log(` Models: ${command.models}`);\n console.log(` Use: ${command.command}`);\n return;\n }\n\n const providers = getBuiltInProviders(generationType);\n if (providers.length === 0) return;\n\n console.log(\"\");\n console.log(\n providers.length === 1 ? \"Built-in provider:\" : \"Built-in providers:\",\n );\n for (const provider of providers) {\n console.log(` vm0 ${provider.label} Model: ${provider.model}`);\n console.log(` Use: ${provider.command}`);\n }\n}\n\nfunction renderGenerationContext(generationType: GenerationType): void {\n const context = getGenerationContext(generationType);\n if (!context) return;\n\n console.log(\"\");\n console.log(\"Context:\");\n for (const line of context.lines) {\n console.log(` - ${line}`);\n }\n}\n\nfunction renderText(params: {\n generationType: GenerationType;\n agentId: string | undefined;\n ready: GenerationCandidate[];\n other: GenerationCandidate[];\n showAll: boolean;\n}): void {\n const { generationType, agentId, ready, other, showAll } = params;\n const label = GENERATION_TYPE_LABELS[generationType];\n const scope = agentId ? \"for current agent\" : \"(connected connectors)\";\n\n console.log(`${label} generation choices ${scope}`);\n console.log(\"\");\n\n if (agentId) {\n console.log(`${\"Agent:\".padEnd(10)}${agentId}`);\n console.log(\"\");\n } else {\n console.log(\n \"ZERO_AGENT_ID is not set, so agent authorization could not be checked.\",\n );\n console.log(\"\");\n }\n\n const hasBuiltInCommand = getBuiltInCommand(generationType) !== null;\n const showConnectorSummary =\n ready.length > 0 || !hasBuiltInCommand || showAll;\n if (showConnectorSummary) {\n console.log(\"Connectors:\");\n if (ready.length > 0) {\n renderRows(ready);\n } else {\n console.log(` No ready ${generationType} generation connectors found.`);\n }\n }\n\n renderBuiltInProvider(generationType);\n renderGenerationContext(generationType);\n\n if (showAll && other.length > 0) {\n console.log(\"\");\n console.log(`Other ${generationType} generation connectors`);\n console.log(\"\");\n renderRows(other);\n }\n\n if (showAll) {\n renderActions(other);\n }\n}\n\nexport async function runLister(\n generationType: GenerationType,\n options: ListerOptions = {},\n): Promise<void> {\n const connectorGenerationType = getConnectorGenerationType(generationType);\n const agentId = process.env.ZERO_AGENT_ID;\n const [catalog, enabledTypes, platformOrigin] = await Promise.all([\n listZeroConnectorCatalogStatus(),\n agentId ? getZeroAgentUserConnectors(agentId) : Promise.resolve(null),\n getPlatformOrigin(),\n ]);\n const authorizedTypes = enabledTypes ? new Set(enabledTypes) : null;\n const candidates = connectorGenerationType\n ? getGenerationConnectors(connectorGenerationType, catalog.connectors).map(\n (connector) => {\n return toCandidate({\n connector,\n authorizedTypes,\n agentId,\n platformOrigin,\n });\n },\n )\n : [];\n const ready = candidates.filter((candidate) => {\n return candidate.status === \"ready\";\n });\n const other = candidates.filter((candidate) => {\n return candidate.status !== \"ready\";\n });\n renderText({\n generationType,\n agentId,\n ready,\n other,\n showAll: options.all === true,\n });\n\n const shouldShowOtherHint =\n !options.all &&\n other.length > 0 &&\n (ready.length > 0 || getBuiltInCommand(generationType) === null);\n if (shouldShowOtherHint) {\n console.log(\"\");\n console.log(\n chalk.dim(\n `Use --all to see every ${generationType} generation candidate.`,\n ),\n );\n }\n}\n","import { createArtifactGenerateCommand } from \"../shared/artifact-generate\";\n\nfunction standardDetails(kind: string) {\n return (options: { title?: string }) => {\n return [\n `Artifact kind: ${kind}`,\n `Requested title/name: ${options.title ?? \"not specified\"}`,\n ];\n };\n}\n\nexport const reportCommand = createArtifactGenerateCommand({\n name: \"report\",\n generationType: \"report\",\n target: \"report\",\n description: \"Generate an HTML report from a prompt\",\n usageCommand: \"zero generate report\",\n examples: ` Generate report: zero generate report --prompt \"A Q2 usage report for the API team\"\n Custom site slug: zero generate report --site-slug api-usage-q2 --prompt \"A Q2 usage report\"\n Show choices: zero generate report`,\n details: standardDetails(\"report\"),\n artifactRules: [\n \"Produce an analytical report, not a marketing page.\",\n \"Use concrete metrics, tables, chart-like visuals, and a clear findings section.\",\n \"Keep source assumptions visible when the prompt does not provide real data.\",\n \"Verify the report is readable at desktop and mobile widths.\",\n ],\n});\n\nexport const docsDesignCommand = createArtifactGenerateCommand({\n name: \"docs-design\",\n generationType: \"docs-design\",\n target: \"docs-design\",\n description: \"Generate a documentation design from a prompt\",\n usageCommand: \"zero generate docs-design\",\n examples: ` Generate docs design: zero generate docs-design --prompt \"Docs for adding artifact targets\"\n Custom site slug: zero generate docs-design --site-slug artifact-target-docs --prompt \"Artifact target docs\"\n Show choices: zero generate docs-design`,\n details: standardDetails(\"docs-design\"),\n artifactRules: [\n \"Produce a documentation design mockup, not a production documentation system.\",\n \"Include navigation, article structure, code or command examples when relevant, and clear section anchors as static design content.\",\n \"Use restrained documentation styling optimized for long-form reading.\",\n \"Verify the page works at mobile and desktop widths.\",\n ],\n});\n\nexport const posterCommand = createArtifactGenerateCommand({\n name: \"poster\",\n generationType: \"poster\",\n target: \"poster\",\n description: \"Generate an HTML poster from a prompt\",\n usageCommand: \"zero generate poster\",\n examples: ` Generate poster: zero generate poster --prompt \"A launch poster for artifact targets\"\n Custom site slug: zero generate poster --site-slug artifact-poster --prompt \"A launch poster\"\n Show choices: zero generate poster`,\n details: standardDetails(\"poster\"),\n artifactRules: [\n \"Produce a poster-style HTML artifact with strong hierarchy and composition.\",\n \"Treat this as an HTML poster surface; do not imply a raster image was generated unless image assets are actually created.\",\n \"Make the poster responsive enough to inspect on mobile and desktop.\",\n \"Keep text deliberate and avoid placeholder copy.\",\n ],\n});\n\nexport const dashboardDesignCommand = createArtifactGenerateCommand({\n name: \"dashboard-design\",\n generationType: \"dashboard-design\",\n target: \"dashboard-design\",\n description: \"Generate a dashboard design from a prompt\",\n usageCommand: \"zero generate dashboard-design\",\n examples: ` Generate dash design: zero generate dashboard-design --prompt \"An ops dashboard for generation runs\"\n Custom site slug: zero generate dashboard-design --site-slug generation-ops --prompt \"A generation ops dashboard\"\n Show choices: zero generate dashboard-design`,\n details: standardDetails(\"dashboard-design\"),\n artifactRules: [\n \"Produce a dashboard design mockup, not a live operational dashboard.\",\n \"Include scannable KPIs, chart-like visuals, lists or tables, and realistic empty/loading/error states as static design content.\",\n \"Prioritize dense, repeat-use UI over decorative sections.\",\n \"Verify the dashboard does not overflow at desktop and mobile widths.\",\n ],\n});\n\nexport const mobileAppDesignCommand = createArtifactGenerateCommand({\n name: \"mobile-app-design\",\n generationType: \"mobile-app-design\",\n target: \"mobile-app-design\",\n description: \"Generate a mobile app design prototype from a prompt\",\n usageCommand: \"zero generate mobile-app-design\",\n examples: ` Generate mobile UI: zero generate mobile-app-design --prompt \"A mobile review screen for generation artifacts\"\n Custom site slug: zero generate mobile-app-design --site-slug generation-mobile-review --prompt \"A mobile review screen\"\n Show choices: zero generate mobile-app-design`,\n details: standardDetails(\"mobile-app-design\"),\n artifactRules: [\n \"Produce a design prototype, not a runnable or installable mobile app.\",\n \"Render the design inside a realistic phone frame with status bar, device chrome, and home indicator when possible.\",\n \"Focus on one mobile screen and one primary job.\",\n \"Use mobile-appropriate tap targets, type sizes, and spacing.\",\n ],\n});\n","import { Command } from \"commander\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport {\n findDesignSystem,\n findTemplate,\n listDesignSystems,\n listTemplates,\n type GenerationTarget,\n toGenerationTarget,\n} from \"./resource-registry\";\nimport {\n canonicalizeRegistryId,\n formatRegistryListing,\n} from \"./resource-listing\";\nimport { createHtmlArtifactAuthoringPacket } from \"./html-artifact-authoring\";\nimport { dispatchGenerate } from \"../generate/lib/dispatch\";\nimport type { GenerationType } from \"../generate/lib/lister\";\n\ninterface ArtifactOptions {\n prompt?: string;\n siteSlug?: string;\n title?: string;\n designSystem?: string;\n template?: string;\n}\n\ninterface ArtifactCommandConfig {\n name: string;\n generationType: GenerationType;\n target: GenerationTarget;\n description: string;\n usageCommand: string;\n examples: string;\n details: (options: ArtifactOptions) => readonly string[];\n artifactRules: readonly string[];\n}\n\nfunction unknownDesignSystemError(id: string, usageCommand: string): Error {\n const designSystems = listDesignSystems();\n const message = [\n `Unknown design system: ${id}`,\n \"\",\n \"Available design systems:\",\n formatRegistryListing(designSystems, \"design systems\"),\n \"\",\n `Example:`,\n ` ${usageCommand} --design-system ${\n designSystems[0]?.id ?? \"<design-system-id>\"\n } --prompt \"...\"`,\n ].join(\"\\n\");\n return new Error(message);\n}\n\nfunction unknownTemplateError(\n id: string,\n usageCommand: string,\n target: GenerationTarget,\n): Error {\n const templates = listTemplates(target);\n const message = [\n `Unknown template for ${target}: ${id}`,\n \"\",\n `Available templates for ${target}:`,\n formatRegistryListing(templates, `${target} templates`),\n \"\",\n `Example:`,\n ` ${usageCommand} --template ${\n templates[0]?.id ?? \"<template-id>\"\n } --prompt \"...\"`,\n ].join(\"\\n\");\n return new Error(message);\n}\n\nexport function createArtifactGenerateCommand(\n config: ArtifactCommandConfig,\n): Command {\n return new Command()\n .name(config.name)\n .description(config.description)\n .option(\"--prompt <text>\", \"Artifact prompt; can also be piped via stdin\")\n .option(\"--site-slug <slug>\", \"Hosted site slug override\")\n .option(\"--title <text>\", \"Requested artifact title or name\")\n .option(\n \"--design-system <id>\",\n \"Design system id from the registry (see Design Systems below). Accepts either 'apple' or 'design-system:apple'.\",\n )\n .option(\n \"--template <id>\",\n `Template id from the registry, scoped to ${config.target} (see Templates below). Accepts either short id or full 'template:<id>'.`,\n )\n .addHelpText(\"after\", () => {\n const designSystems = listDesignSystems();\n const templates = listTemplates(config.target);\n return `\nExamples:\n${config.examples}\n\nOutput:\n Prints a source-selection packet for the current agent. The\n agent authors a static HTML artifact and hosts it with zero host. With no\n --prompt and no piped input, prints the generation choices instead.\n\nNotes:\n - Authenticates via ZERO_TOKEN\n\nDesign Systems:\n${formatRegistryListing(designSystems, \"design systems\")}\n\nTemplates (${config.target}):\n${formatRegistryListing(templates, `${config.target} templates`)}`;\n })\n .action(\n withErrorHandler(async (options: ArtifactOptions) => {\n const dispatch = await dispatchGenerate({\n generationType: config.generationType,\n prompt: options.prompt,\n });\n if (dispatch.outcome === \"handled\") return;\n const prompt = dispatch.prompt;\n\n let resolvedDesignSystem;\n if (options.designSystem !== undefined) {\n const canonical = canonicalizeRegistryId(\n \"design-system\",\n options.designSystem,\n );\n const entry = findDesignSystem(canonical);\n if (!entry) {\n throw unknownDesignSystemError(\n options.designSystem,\n config.usageCommand,\n );\n }\n resolvedDesignSystem = entry;\n }\n\n let resolvedTemplate;\n if (options.template !== undefined) {\n const canonical = canonicalizeRegistryId(\n \"template\",\n options.template,\n );\n const entry = findTemplate(canonical);\n if (!entry || !entry.targets?.includes(config.target)) {\n throw unknownTemplateError(\n options.template,\n config.usageCommand,\n config.target,\n );\n }\n resolvedTemplate = entry;\n }\n\n const extraDetails = [\n `Selected design system: ${\n resolvedDesignSystem\n ? `${resolvedDesignSystem.id} (${resolvedDesignSystem.name})`\n : \"agent decides\"\n }`,\n `Selected template: ${\n resolvedTemplate\n ? `${resolvedTemplate.id} (${resolvedTemplate.name})`\n : \"agent decides\"\n }`,\n ];\n\n const packet = createHtmlArtifactAuthoringPacket({\n kind: toGenerationTarget(config.target),\n prompt,\n slugSource: options.title,\n siteSlug: options.siteSlug,\n details: [...config.details(options), ...extraDetails],\n artifactRules: config.artifactRules,\n });\n\n console.log(packet.instructions);\n }),\n );\n}\n","import {\n type GenerationOutputKind,\n type ResourceCandidateSlice,\n type GenerationTarget,\n selectResourceCandidates,\n} from \"./resource-registry\";\n\ntype HtmlArtifactKind = GenerationTarget;\n\ninterface HtmlArtifactAuthoringOptions {\n readonly kind: HtmlArtifactKind;\n readonly prompt: string;\n readonly slugSource?: string;\n readonly siteSlug?: string;\n readonly details: readonly string[];\n readonly artifactRules: readonly string[];\n}\n\ninterface HtmlArtifactAuthoringPacket {\n readonly type: \"generation-source-selection\";\n readonly kind: HtmlArtifactKind;\n readonly prompt: string;\n readonly registryVersion: string;\n readonly artifact: {\n readonly outputMode: \"primary-artifact-with-supporting-assets\";\n readonly primaryArtifact: {\n readonly kind: GenerationOutputKind;\n readonly path: string;\n };\n readonly supportingAssets: readonly {\n readonly kind: GenerationOutputKind | \"metadata\";\n readonly path: string;\n readonly optional: boolean;\n }[];\n readonly previewKind: \"hosted-url\";\n readonly outputDir: string;\n };\n readonly selection: {\n readonly candidates: ResourceCandidateSlice[\"candidates\"];\n readonly outputSchema: {\n readonly skills: \"string[]\";\n readonly template: \"string\";\n readonly designSystem: \"string | null\";\n readonly imageStyle: \"string | null\";\n readonly audioStyle: \"string | null\";\n readonly videoTemplate: \"string | null\";\n readonly bundleTemplate: \"string | null\";\n readonly rationale: \"string\";\n };\n };\n readonly authoring: {\n readonly details: readonly string[];\n readonly artifactRules: readonly string[];\n };\n readonly outputDir: string;\n readonly site: string;\n readonly hostCommand: string;\n readonly instructions: string;\n}\n\nfunction slugify(value: string): string {\n const slug = value\n .toLowerCase()\n .replace(/[^a-z0-9]+/gu, \"-\")\n .replace(/^-+|-+$/gu, \"\")\n .replace(/-{2,}/gu, \"-\")\n .slice(0, 48)\n .replace(/-+$/u, \"\");\n return slug.length >= 3 ? slug : \"html-artifact\";\n}\n\nfunction titleForKind(kind: HtmlArtifactKind): string {\n const titles: Record<HtmlArtifactKind, string> = {\n image: \"image\",\n presentation: \"HTML presentation\",\n website: \"hosted website\",\n \"dashboard-design\": \"dashboard design prototype\",\n \"mobile-app-design\": \"mobile app design prototype\",\n poster: \"poster\",\n \"intro-video\": \"intro video storyboard\",\n report: \"report\",\n \"docs-design\": \"documentation design prototype\",\n };\n\n return titles[kind];\n}\n\nfunction outputDirForSite(site: string): string {\n return `./generated/mockups/${site}`;\n}\n\nfunction formatCandidateSource(\n source: ResourceCandidateSlice[\"sources\"][number],\n): string {\n if (\"repo\" in source) {\n return `- \\`${source.repo}@${source.ref}\\``;\n }\n return `- ${source.description}`;\n}\n\nexport function createHtmlArtifactAuthoringPacket(\n options: HtmlArtifactAuthoringOptions,\n): HtmlArtifactAuthoringPacket {\n const site =\n options.siteSlug ?? slugify(options.slugSource ?? options.prompt);\n const outputDir = outputDirForSite(site);\n const artifactKindFlag =\n options.kind === \"presentation\" ? \" --artifact-kind presentation-html\" : \"\";\n const hostCommand = `zero host ${outputDir} --site ${site}${artifactKindFlag}${\n options.kind === \"website\" ? \" --spa\" : \"\"\n }`;\n const title = titleForKind(options.kind);\n const candidateSlice = selectResourceCandidates(options.kind);\n const selectionSchema = {\n skills: \"string[]\",\n template: \"string\",\n designSystem: \"string | null\",\n imageStyle: \"string | null\",\n audioStyle: \"string | null\",\n videoTemplate: \"string | null\",\n bundleTemplate: \"string | null\",\n rationale: \"string\",\n } as const;\n const artifact = {\n outputMode: \"primary-artifact-with-supporting-assets\",\n primaryArtifact: {\n kind: options.kind as GenerationOutputKind,\n path: `${outputDir}/index.html`,\n },\n supportingAssets: [\n {\n kind: \"image\",\n path: `${outputDir}/assets/`,\n optional: true,\n },\n {\n kind: \"audio\",\n path: `${outputDir}/assets/`,\n optional: true,\n },\n {\n kind: \"video\",\n path: `${outputDir}/assets/`,\n optional: true,\n },\n {\n kind: \"metadata\",\n path: `${outputDir}/metadata.json`,\n optional: true,\n },\n ],\n previewKind: \"hosted-url\",\n outputDir,\n } as const;\n const instructions = [\n `# Zero generate ${options.kind}`,\n \"\",\n \"This is a federated generation source-selection packet for the current agent.\",\n `Zero is not generating this ${title} on the server. You select resources, resolve them, and author the artifact.`,\n \"\",\n \"## User Prompt\",\n options.prompt,\n \"\",\n \"## Stage 1: Resource Selection\",\n \"- Choose generation resources from the bundled federated registry slice below.\",\n \"- Select one template, one or more skills, zero or one design system, and optional media/style resources when relevant.\",\n \"- Choose only IDs present in this packet; do not invent registry IDs.\",\n \"- Prefer compatible resources, but the user prompt is the highest-priority signal.\",\n \"- Treat the selection JSON as internal working state, then continue to authoring.\",\n \"\",\n \"## Selection Output Schema\",\n \"```json\",\n JSON.stringify(selectionSchema, null, 2),\n \"```\",\n \"\",\n \"## Candidate Registry Slice\",\n `Registry: \\`${candidateSlice.registryVersion}\\``,\n \"Sources:\",\n ...candidateSlice.sources.map(formatCandidateSource),\n \"\",\n \"```json\",\n JSON.stringify(candidateSlice.candidates, null, 2),\n \"```\",\n \"\",\n \"## Stage 2: Resolve Selected Resources\",\n \"- First resolve every required resource listed above, then resolve every selected resource before authoring.\",\n \"- 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.\",\n \"- 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`.\",\n \"- For directory refs, inspect the most relevant files such as `SKILL.md`, `DESIGN.md`, `README.md`, tokens, examples, and templates.\",\n \"- If a source file cannot be fetched, state that limitation and fall back to the registry metadata for that resource.\",\n \"\",\n \"## Stage 3: Author Artifact\",\n `Author a production-quality ${title} as a static HTML artifact using the selected generation resources.`,\n \"\",\n \"## Artifact Output Model\",\n `- Primary artifact: \\`${artifact.primaryArtifact.kind}\\` at \\`${artifact.primaryArtifact.path}\\`.`,\n `- Output mode: \\`${artifact.outputMode}\\`.`,\n \"- Supporting images, audio, video, or metadata may live inside the same output directory when the result needs them.\",\n \"- Treat the output directory as a project bundle when multiple media types are generated, while keeping the HTML entry point primary.\",\n \"\",\n \"## Output Contract\",\n `- Write the artifact under \\`${outputDir}/\\`.`,\n `- The entry file must be \\`${outputDir}/index.html\\`.`,\n \"- Keep every local asset inside the same output directory.\",\n \"- Do not reference files from another project path.\",\n \"- Use descriptive filenames and canonical HTML: close non-void tags and double-quote attributes.\",\n \"- Prefer a single self-contained HTML file unless the artifact genuinely needs separate assets.\",\n \"\",\n \"## Requested Parameters\",\n ...options.details.map((detail) => {\n return `- ${detail}`;\n }),\n \"\",\n \"## Authoring Rules\",\n \"- Let the selected template define structure, the selected design system define visual language, and the selected skills define process.\",\n \"- Read the local codebase, brand assets, and existing design systems when the prompt depends on this repository.\",\n \"- 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.\",\n \"- Build the actual artifact first, not a marketing explanation of the artifact.\",\n \"- Make controls and interactions real when they are visible.\",\n \"- Keep text readable at desktop and mobile preview sizes.\",\n ...options.artifactRules.map((rule) => {\n return `- ${rule}`;\n }),\n \"\",\n \"## Verification\",\n \"- Use `agent-browser` for browser verification when available. Start with `agent-browser skills get core` if you need command guidance.\",\n \"- Prefer `agent-browser` over Playwright, Puppeteer, or installing browser automation dependencies.\",\n \"- Open the HTML locally and verify it is nonblank.\",\n \"- Check that keyboard/click interactions work when present.\",\n \"- Check that text does not overflow or overlap at desktop and mobile viewport sizes.\",\n \"- Check that shapes, charts, images, or decorative graphics do not cover readable text at desktop and mobile viewport sizes.\",\n \"- Run the final hosting command only after the artifact looks correct.\",\n \"\",\n \"## Publish\",\n \"The hosted URL is the preview and user-accessible view for this static HTML artifact.\",\n `When everything is OK, publish it with:`,\n \"\",\n \"```bash\",\n hostCommand,\n \"```\",\n \"\",\n \"File upload is a separate delivery channel for when the user needs a local file copy, not another way to preview the same hosted artifact.\",\n ].join(\"\\n\");\n\n return {\n type: \"generation-source-selection\",\n kind: options.kind,\n prompt: options.prompt,\n registryVersion: candidateSlice.registryVersion,\n artifact,\n selection: {\n candidates: candidateSlice.candidates,\n outputSchema: selectionSchema,\n },\n authoring: {\n details: options.details,\n artifactRules: options.artifactRules,\n },\n outputDir,\n site,\n hostCommand,\n instructions,\n };\n}\n","import { createPresentationGenerateCommand } from \"../shared/presentation-generate\";\n\nexport const presentationCommand = createPresentationGenerateCommand({\n name: \"presentation\",\n generationType: \"presentation\",\n usageCommand: \"zero generate presentation\",\n examples: ` Generate deck: zero generate presentation --prompt \"A strategy deck for reducing support volume\"\n Pipe prompt: cat brief.txt | zero generate presentation\n Pick slide count: zero generate presentation --slides 10 --prompt \"A product launch narrative\"\n Custom site slug: zero generate presentation --site-slug api-migration-plan --prompt \"API migration plan\"\n Show choices: zero generate presentation`,\n});\n","import { Command, InvalidArgumentError } from \"commander\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { dispatchGenerate } from \"../generate/lib/dispatch\";\nimport type { GenerationType } from \"../generate/lib/lister\";\nimport {\n buildPresentationRunbookInstructionLines,\n findPresentationRunbookPackage,\n listPresentationRunbookPackages,\n resolvePresentationRunbookColorToken,\n} from \"./resource-registry\";\nimport { canonicalizeRegistryId } from \"./resource-listing\";\n\ntype PresentationRunbookPackage = ReturnType<\n typeof listPresentationRunbookPackages\n>[number];\n\ninterface PresentationOptions {\n prompt?: string;\n slides: number;\n title?: string;\n siteSlug?: string;\n template?: string;\n}\n\ninterface PresentationGenerateCommandConfig {\n name: string;\n generationType: GenerationType;\n usageCommand: string;\n examples: string;\n}\n\nfunction parseSlideCount(value: string): number {\n const slideCount = Number(value);\n if (!Number.isInteger(slideCount)) {\n throw new InvalidArgumentError(\"slides must be an integer\");\n }\n if (slideCount < 4 || slideCount > 20) {\n throw new InvalidArgumentError(\"slides must be between 4 and 20\");\n }\n return slideCount;\n}\n\nfunction listPresentationTemplates(): readonly PresentationRunbookPackage[] {\n return listPresentationRunbookPackages();\n}\n\nfunction unknownTemplateError(id: string, usageCommand: string): Error {\n const templates = listPresentationTemplates();\n const message = [\n `Unknown template for presentation: ${id}`,\n \"\",\n \"Available templates for presentation:\",\n formatPresentationTemplateListing(templates),\n \"\",\n \"Example:\",\n ` ${usageCommand} --template ${\n templates[0]?.templateId ?? \"<template-id>\"\n } --prompt \"...\"`,\n ].join(\"\\n\");\n return new Error(message);\n}\n\nfunction formatPresentationTemplateListing(\n templates: readonly PresentationRunbookPackage[],\n): string {\n if (templates.length === 0) {\n return \" (no presentation templates registered)\";\n }\n return templates\n .map((template) => {\n return ` ${template.templateId}\\n ${template.description}`;\n })\n .join(\"\\n\\n\");\n}\n\nexport function createPresentationGenerateCommand(\n config: PresentationGenerateCommandConfig,\n): Command {\n return new Command()\n .name(config.name)\n .description(\"Generate an HTML presentation from a prompt\")\n .option(\n \"--prompt <text>\",\n \"Presentation prompt; can also be piped via stdin\",\n )\n .option(\"--site-slug <slug>\", \"Hosted site slug override\")\n .option(\"--title <text>\", \"Requested deck title\")\n .option(\n \"--template <id>\",\n \"Presentation template id (see Templates below). Accepts either 'html-ppt-playful-launch' or 'template:html-ppt-playful-launch'.\",\n )\n .option(\"--slides <count>\", \"Slide count: 4-20\", parseSlideCount, 8)\n .addHelpText(\"after\", () => {\n const templates = listPresentationTemplates();\n return `\nExamples:\n${config.examples}\n\nOutput:\n Prints a source-selection packet for the current agent.\n\nNotes:\n - Authenticates via ZERO_TOKEN\n - The agent authors the HTML presentation artifact and hosts it with zero host\n\nTemplates (presentation):\n${formatPresentationTemplateListing(templates)}`;\n })\n .action(\n withErrorHandler(async (options: PresentationOptions) => {\n const dispatch = await dispatchGenerate({\n generationType: config.generationType,\n prompt: options.prompt,\n });\n if (dispatch.outcome === \"handled\") return;\n const prompt = dispatch.prompt;\n\n if (options.template !== undefined) {\n const canonical = canonicalizeRegistryId(\n \"template\",\n options.template,\n );\n const template = findPresentationRunbookPackage(canonical);\n if (!template) {\n throw unknownTemplateError(options.template, config.usageCommand);\n }\n const color = resolvePresentationRunbookColorToken(\n template,\n undefined,\n );\n const colorSystemToken =\n \"error\" in color ? template.defaultColorSystem : color.token;\n console.log(\n [\n \"# Presentation Generation (template)\",\n \"\",\n ...buildPresentationRunbookInstructionLines({\n runbookPackage: template,\n colorSystemToken,\n }),\n \"\",\n `User request: ${prompt}`,\n ].join(\"\\n\"),\n );\n return;\n }\n\n console.log(\n [\n \"# Zero generate presentation\",\n \"\",\n \"This is a direct HTML presentation authoring packet for the current agent.\",\n \"Author the deck directly from the user's request and any supplied source material.\",\n \"\",\n \"## User Prompt\",\n prompt,\n \"\",\n \"## Requested Parameters\",\n `- Slide count: ${options.slides}`,\n `- Requested deck title: ${options.title ?? \"not specified\"}`,\n \"- Selected template: agent decides\",\n \"\",\n \"## Authoring Rules\",\n \"- Think like a presentation designer, not a web page designer.\",\n \"- Use a fixed 1920x1080 slide canvas and scale it uniformly for smaller viewports.\",\n \"- Use one section per slide and keep repeated elements in consistent positions.\",\n \"- Build the deck static-first: the final index.html must contain every slide section and all user-visible slide content, with the first slide visible before JavaScript runs.\",\n \"- Do not store slide content in JavaScript data or use JavaScript to create, inject, fetch, hydrate, or replace slide content. JavaScript may only progressively enhance the existing DOM for navigation, controls, themes, or animation.\",\n \"- Make keyboard navigation work with ArrowLeft, ArrowRight, Home, and End.\",\n \"- Keep slide text readable from across a room; avoid memo-like walls of text.\",\n \"- Produce exactly the requested slide count. Do not let a template's reference example or preview slide count override the requested count.\",\n \"- Before authoring, make an internal slide plan with exactly the requested count and map each slide to a narrative role plus a selected template layout or device.\",\n \"- Adapt the selected template to the requested slide count: for shorter decks, merge or omit lower-priority content roles; for longer decks, split dense sections into multiple focused slides or reuse layout patterns with different substantive content. Do not add decorative, duplicate, or empty filler slides.\",\n \"- Use selected template references only for structure, layout devices, spacing, and visual language. Do not inherit or continue any reference deck's sample subject, sample story, sample copy, sample metrics, preview imagery, or media seed names.\",\n \"- Derive every presentation image/media choice from the user's requested topic, story, source material, or cited facts.\",\n \"- Before laying out slides, establish the deck's arc: the opening problem or question, how it develops, and what conclusion lands; every slide should serve a clear narrative role in that arc.\",\n \"- Vary slide forms across the deck — full-bleed statement, evidence with data, pull quote, section break, summary — and avoid defaulting every slide to title-plus-bullets.\",\n \"- Each slide carries one idea; prefer a single strong statement over a list, and never exceed three bullets on any slide.\",\n \"\",\n \"## Verification\",\n \"- Use `agent-browser` for browser verification when available. Start with `agent-browser skills get core` if you need command guidance.\",\n \"- Prefer `agent-browser` over Playwright, Puppeteer, or installing browser automation dependencies.\",\n \"- Open the HTML locally and verify it is nonblank.\",\n \"- Check that keyboard/click interactions work when present.\",\n \"- Check that text does not overflow or overlap at desktop and mobile viewport sizes.\",\n \"- Check that shapes, charts, images, or decorative graphics do not cover readable text at desktop and mobile viewport sizes.\",\n ].join(\"\\n\"),\n );\n }),\n );\n}\n","import { Command } from \"commander\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport {\n createSpriteAuthoringPacket,\n type SpritePlan,\n} from \"../shared/sprite-authoring\";\nimport { dispatchGenerate } from \"./lib/dispatch\";\n\nconst SPRITE_USAGE_COMMAND = \"zero generate sprite\";\nconst DEFAULT_MODEL = \"gpt-image-2\";\nconst AGENT_DECIDES = \"agent decides\";\n\nconst ASSET_TYPES = [\n \"player\",\n \"npc\",\n \"creature\",\n \"character\",\n \"spell\",\n \"projectile\",\n \"impact\",\n \"prop\",\n \"summon\",\n \"fx\",\n] as const;\n\nconst ACTIONS = [\n \"single\",\n \"idle\",\n \"cast\",\n \"attack\",\n \"shoot\",\n \"jump\",\n \"hurt\",\n \"combat\",\n \"walk\",\n \"run\",\n \"hover\",\n \"charge\",\n \"projectile\",\n \"impact\",\n \"explode\",\n \"death\",\n] as const;\n\nconst VIEWS = [\"topdown\", \"side\", \"3-4\"] as const;\n\nconst SHEETS = [\n \"auto\",\n \"2x2\",\n \"2x3\",\n \"2x4\",\n \"3x3\",\n \"3x4\",\n \"4x4\",\n \"5x5\",\n \"strip-1x3\",\n \"strip-1x4\",\n \"custom\",\n] as const;\n\nconst BUNDLES = [\n \"single\",\n \"unit\",\n \"spell\",\n \"combat\",\n \"line\",\n \"hero-action\",\n \"engine-atlas\",\n] as const;\n\nconst ART_STYLES = [\n \"pixel-art\",\n \"clean-hd\",\n \"pixel-inspired\",\n \"retro-pixel\",\n \"map-style\",\n \"project-native\",\n] as const;\n\nconst ANCHORS = [\"center\", \"bottom\", \"feet\"] as const;\nconst MARGINS = [\"tight\", \"normal\", \"safe\"] as const;\nconst EFFECT_POLICIES = [\"all\", \"largest\"] as const;\n\ninterface SpriteOptions {\n readonly prompt?: string;\n readonly assetType?: string;\n readonly action?: string;\n readonly view?: string;\n readonly sheet?: string;\n readonly frames?: string;\n readonly bundle?: string;\n readonly artStyle?: string;\n readonly anchor?: string;\n readonly margin?: string;\n readonly effectPolicy?: string;\n readonly reference?: string;\n readonly model: string;\n readonly name?: string;\n}\n\nfunction validateEnum(\n flag: string,\n value: string | undefined,\n allowed: readonly string[],\n): void {\n if (value !== undefined && !allowed.includes(value)) {\n throw new Error(\n `${flag} must be one of: ${allowed.join(\", \")} (got \"${value}\")`,\n );\n }\n}\n\nfunction resolveFrames(value: string | undefined): string {\n if (value === undefined) {\n return AGENT_DECIDES;\n }\n if (value === \"auto\") {\n return value;\n }\n const frames = Number(value);\n if (!Number.isInteger(frames) || frames < 1 || frames > 64) {\n throw new Error(\"--frames must be 'auto' or an integer from 1 to 64\");\n }\n return String(frames);\n}\n\nfunction slugify(value: string): string {\n const slug = value\n .toLowerCase()\n .replace(/[^a-z0-9]+/gu, \"-\")\n .replace(/^-+|-+$/gu, \"\")\n .replace(/-{2,}/gu, \"-\")\n .slice(0, 48)\n .replace(/-+$/u, \"\");\n return slug.length >= 3 ? slug : \"sprite\";\n}\n\nexport const spriteCommand = new Command()\n .name(\"sprite\")\n .description(\n \"Prepare 2D game sprite/asset authoring instructions from a prompt\",\n )\n .option(\"--prompt <text>\", \"Sprite prompt/theme; can also be piped via stdin\")\n .option(\"--asset-type <type>\", `Asset type: ${ASSET_TYPES.join(\", \")}`)\n .option(\"--action <action>\", `Animation/action: ${ACTIONS.join(\", \")}`)\n .option(\n \"--view <view>\",\n `Camera view: ${VIEWS.join(\", \")} (3-4 means 3/4 view)`,\n )\n .option(\"--sheet <grid>\", `Sheet/grid shape: ${SHEETS.join(\", \")}`, \"auto\")\n .option(\"--frames <count>\", \"Frame count: 'auto' or an integer (1-64)\")\n .option(\"--bundle <preset>\", `Bundle preset: ${BUNDLES.join(\", \")}`)\n .option(\n \"--art-style <style>\",\n `Sprite art style (the sprite analog of 'zero generate image --style'): ${ART_STYLES.join(\", \")}`,\n )\n .option(\"--anchor <anchor>\", `Frame anchor: ${ANCHORS.join(\", \")}`)\n .option(\"--margin <margin>\", `Safe-area margin: ${MARGINS.join(\", \")}`)\n .option(\n \"--effect-policy <policy>\",\n `Detached-FX component policy: ${EFFECT_POLICIES.join(\", \")}`,\n )\n .option(\n \"--reference <url>\",\n \"Reference image URL for identity/style consistency\",\n )\n .option(\n \"--model <model>\",\n \"Recommended image model for raw sheets\",\n DEFAULT_MODEL,\n )\n .option(\"--name <slug>\", \"Output bundle name/slug\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Generate sprite: ${SPRITE_USAGE_COMMAND} --prompt \"A green slime monster idle loop\"\n Pick asset + action: ${SPRITE_USAGE_COMMAND} --asset-type creature --action idle --sheet 3x3 --prompt \"A fire dragon boss\"\n Hero action bundle: ${SPRITE_USAGE_COMMAND} --asset-type player --bundle hero-action --view side --prompt \"A knight with idle, run, attack, jump\"\n 4-direction walk: ${SPRITE_USAGE_COMMAND} --asset-type player --action walk --view topdown --sheet 4x4 --prompt \"A 16-bit RPG villager\"\n Pixel art style: ${SPRITE_USAGE_COMMAND} --art-style pixel-art --prompt \"A retro fireball projectile\" --sheet 2x2\n Match a reference: ${SPRITE_USAGE_COMMAND} --reference https://example.com/hero.png --action attack --prompt \"Attack animation for this hero\"\n Pipe prompt: cat brief.txt | ${SPRITE_USAGE_COMMAND}\n Show choices: ${SPRITE_USAGE_COMMAND}\n\nOutput:\n Prints a sprite source-selection packet for the current agent: the resolved\n plan, the recommended image model, the upstream sprite skill to resolve, and\n the hard containment rules for grids, identity, and FX.\n With no --prompt and no piped input, prints the generation choices instead.\n\nNotes:\n - The agent generates each raw sheet with built-in image generation\n (gpt-image-2 recommended) on a solid magenta background, then runs the\n sprite skill's local processor for chroma-key cleanup, frame extraction,\n alignment, QC, and transparent/GIF export.\n - Raw sprite art must originate from image generation, never from code-drawn\n primitives (Three.js/Canvas/SVG/HTML/PIL).\n - Unset flags resolve to \"agent decides\"; the agent infers them from the\n prompt and the skill's modes reference.`,\n )\n .action(\n withErrorHandler(async (options: SpriteOptions) => {\n validateEnum(\"--asset-type\", options.assetType, ASSET_TYPES);\n validateEnum(\"--action\", options.action, ACTIONS);\n validateEnum(\"--view\", options.view, VIEWS);\n validateEnum(\"--sheet\", options.sheet, SHEETS);\n validateEnum(\"--bundle\", options.bundle, BUNDLES);\n validateEnum(\"--art-style\", options.artStyle, ART_STYLES);\n validateEnum(\"--anchor\", options.anchor, ANCHORS);\n validateEnum(\"--margin\", options.margin, MARGINS);\n validateEnum(\"--effect-policy\", options.effectPolicy, EFFECT_POLICIES);\n const frames = resolveFrames(options.frames);\n\n const dispatch = await dispatchGenerate({\n generationType: \"sprite\",\n prompt: options.prompt,\n });\n if (dispatch.outcome === \"handled\") return;\n const prompt = dispatch.prompt;\n\n const plan: SpritePlan = {\n assetType: options.assetType ?? AGENT_DECIDES,\n action: options.action ?? AGENT_DECIDES,\n view: options.view ?? AGENT_DECIDES,\n sheet: options.sheet ?? \"auto\",\n frames,\n bundle: options.bundle ?? AGENT_DECIDES,\n artStyle: options.artStyle ?? AGENT_DECIDES,\n anchor: options.anchor ?? AGENT_DECIDES,\n margin: options.margin ?? AGENT_DECIDES,\n effectPolicy: options.effectPolicy ?? AGENT_DECIDES,\n reference: options.reference ?? \"none\",\n model: options.model,\n name: slugify(options.name ?? prompt),\n };\n\n const packet = createSpriteAuthoringPacket({ prompt, plan });\n console.log(packet.instructions);\n }),\n );\n","/**\n * Sprite generation source-selection packet.\n *\n * `zero generate sprite` does not run a server-side pipeline. Like the website\n * and styled-image commands, it \"bounces\" a structured authoring packet back to\n * the calling agent: the resolved sprite plan, the recommended image model, the\n * upstream sprite skill to resolve, and the hard containment rules the agent\n * must honor when it drives built-in image generation plus local postprocessing.\n */\n\nexport interface SpritePlan {\n readonly assetType: string;\n readonly action: string;\n readonly view: string;\n readonly sheet: string;\n readonly frames: string;\n readonly bundle: string;\n readonly artStyle: string;\n readonly anchor: string;\n readonly margin: string;\n readonly effectPolicy: string;\n readonly reference: string;\n readonly model: string;\n readonly name: string;\n}\n\ninterface SpriteAuthoringOptions {\n readonly prompt: string;\n readonly plan: SpritePlan;\n}\n\ninterface SpriteAuthoringPacket {\n readonly type: \"generation-source-selection\";\n readonly kind: \"sprite\";\n readonly prompt: string;\n readonly plan: SpritePlan;\n readonly model: string;\n readonly outputDir: string;\n readonly skill: {\n readonly repo: string;\n readonly ref: string;\n readonly skillPath: string;\n readonly references: readonly string[];\n readonly script: string;\n };\n readonly instructions: string;\n}\n\nconst SPRITE_SKILL = {\n repo: \"0x0funky/agent-sprite-forge\",\n ref: \"main\",\n skillPath: \"skills/generate2dsprite/SKILL.md\",\n references: [\n \"skills/generate2dsprite/references/prompt-rules.md\",\n \"skills/generate2dsprite/references/modes.md\",\n ],\n script: \"skills/generate2dsprite/scripts/generate2dsprite.py\",\n} as const;\n\nconst CORE_INVARIANTS = [\n \"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.\",\n \"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.\",\n \"No text, labels, UI, speech bubbles, borders, or frames between cells. Generate the exact requested grid count only.\",\n \"Keep the same asset identity, the same bounding box, and the same pixel scale across every frame.\",\n \"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.\",\n \"Do not use raw single-row sheets (1x4, 1x6, 1x8, 1xN) for any body subject — 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.\",\n \"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.\",\n \"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.\",\n \"Mixed-action atlases (4x4, 5x5, custom) are a deterministic delivery step assembled from separate per-action sheets after each passes QC — 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.\",\n] as const;\n\nconst WORKFLOW = [\n \"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.\",\n \"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.\",\n \"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.\",\n \"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.\",\n \"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.\",\n \"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).\",\n] as const;\n\nconst EXPECTED_OUTPUTS = [\n \"`raw-sheet.png` (and one raw sheet per action for bundles)\",\n \"`raw-sheet-clean.png` (magenta cleaned)\",\n \"`sheet-transparent.png`\",\n \"per-frame PNGs\",\n \"`animation.gif` (per direction/action where applicable)\",\n \"`prompt-used.txt`\",\n \"`pipeline-meta.json`\",\n] as const;\n\nexport function createSpriteAuthoringPacket(\n options: SpriteAuthoringOptions,\n): SpriteAuthoringPacket {\n const { prompt, plan } = options;\n const outputDir = `./generated/sprites/${plan.name}`;\n\n const planEntries: ReadonlyArray<readonly [string, string]> = [\n [\"Asset type\", plan.assetType],\n [\"Action\", plan.action],\n [\"View\", plan.view],\n [\"Sheet / grid\", plan.sheet],\n [\"Frames\", plan.frames],\n [\"Bundle\", plan.bundle],\n [\"Art style\", plan.artStyle],\n [\"Anchor\", plan.anchor],\n [\"Margin\", plan.margin],\n [\"Effect policy\", plan.effectPolicy],\n [\"Reference\", plan.reference],\n ];\n\n const instructions = [\n \"# Zero generate sprite\",\n \"\",\n \"This is a federated generation source-selection packet for the current agent.\",\n \"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.\",\n \"\",\n \"## User Prompt\",\n prompt,\n \"\",\n \"## Sprite Plan\",\n \"These parameters were resolved from the command. `agent decides` means the flag was not set — infer the best value from the prompt and the skill's modes reference; do not force the user to spell it out.\",\n \"\",\n ...planEntries.map(([label, value]) => {\n return `- ${label}: ${value}`;\n }),\n `- Output name: ${plan.name}`,\n \"\",\n \"## Recommended Model\",\n `- 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).`,\n \"- 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 — the solid magenta background is chroma-keyed by the local processor.\",\n \"- Pick a sheet-friendly square or grid-aligned size (for example 1024x1024 for 2x2/3x3/4x4) so each cell stays evenly spaced.\",\n \"\",\n \"## Workflow Skill\",\n \"Resolve this skill before authoring; it is the authority for sprite prompt patterns, sheet/bundle selection, and the postprocessing primitive.\",\n \"\",\n `- Repo: \\`${SPRITE_SKILL.repo}@${SPRITE_SKILL.ref}\\``,\n `- Skill: \\`${SPRITE_SKILL.skillPath}\\``,\n `- References: ${SPRITE_SKILL.references\n .map((ref) => {\n return `\\`${ref}\\``;\n })\n .join(\", \")}`,\n `- Processor script: \\`${SPRITE_SKILL.script}\\``,\n \"- For map props that must match a tile map, prefer the sibling `generate2dmap` skill in the same repo.\",\n \"- If a source file cannot be fetched, state that limitation and fall back to the core invariants below.\",\n \"\",\n \"## Core Invariants\",\n ...CORE_INVARIANTS.map((rule) => {\n return `- ${rule}`;\n }),\n \"\",\n \"## Workflow\",\n ...WORKFLOW,\n \"\",\n \"## Output Contract\",\n `- Write the bundle under \\`${outputDir}/\\`.`,\n \"- Keep the original generated images and produce, per sheet:\",\n ...EXPECTED_OUTPUTS.map((item) => {\n return ` - ${item}`;\n }),\n \"- For bundles, create one subfolder per asset and keep the per-action FX/projectile/impact sheets separate.\",\n \"\",\n \"## Verification\",\n \"- Confirm each transparent sheet and its frames are nonblank and free of magenta fringing.\",\n \"- Confirm no frame touches a cell edge and that scale and identity stay consistent across frames.\",\n \"- For hero/player body actions, confirm body height matches the accepted idle/run scale within ~10-15%.\",\n \"- Report the output directory, the final assets, and the resolved plan.\",\n ].join(\"\\n\");\n\n return {\n type: \"generation-source-selection\",\n kind: \"sprite\",\n prompt,\n plan,\n model: plan.model,\n outputDir,\n skill: SPRITE_SKILL,\n instructions,\n };\n}\n","import { createVideoGenerateCommand } from \"../shared/video-generate\";\n\nexport const videoCommand = createVideoGenerateCommand({\n name: \"video\",\n generationType: \"video\",\n usageCommand: \"zero generate video\",\n examples: ` Generate video: zero generate video --prompt \"A tracking shot through a neon market\"\n Use a template: zero generate video --template video-template:epic-grandeur --prompt \"A cinematic mountain reveal\"\n Pipe prompt: cat prompt.txt | zero generate video\n Use Dreamina 2.0: zero generate video --model dreamina-seedance-2.0 --prompt \"A cinematic product reveal\" --duration 6s --resolution 1080p\n Use Seedance 1.5 Pro: zero generate video --model seedance-1.5-pro --prompt \"A multi-shot chase scene\" --duration 8s --resolution 720p\n Add a first frame: zero generate video --first-frame-image-url https://example.com/frame.png --prompt \"Animate this frame\"\n List providers: zero generate video\n Use HeyGen: zero generate video --provider heygen`,\n});\n","import { Command, InvalidArgumentError } from \"commander\";\nimport chalk from \"chalk\";\nimport { generateWebVideo } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { findVideoTemplate, listVideoTemplates } from \"./resource-registry\";\nimport { formatRegistryListing } from \"./resource-listing\";\nimport { createVideoTemplateAuthoringPacket } from \"./video-template-authoring\";\nimport { dispatchGenerate } from \"../generate/lib/dispatch\";\nimport type { GenerationType } from \"../generate/lib/lister\";\n\ninterface VideoOptions {\n prompt?: string;\n provider?: string;\n template?: string;\n model: string;\n aspectRatio: string;\n duration: string;\n resolution?: string;\n audio?: boolean;\n negativePrompt?: string;\n seed?: number;\n autoFix?: boolean;\n safetyTolerance: string;\n imageUrl?: string[];\n videoUrl?: string[];\n audioUrl?: string[];\n firstFrameImageUrl?: string;\n lastFrameImageUrl?: string;\n all?: boolean;\n}\n\ninterface VideoGenerateCommandConfig {\n name: string;\n generationType: GenerationType;\n usageCommand: string;\n examples: string;\n}\n\ninterface ImageDimensions {\n width: number;\n height: number;\n}\n\nconst FRAME_ASPECT_RATIO_TOLERANCE = 0.02;\nconst JPEG_START_OF_FRAME_MARKERS = new Set([\n 0xc0, 0xc1, 0xc2, 0xc3, 0xc5, 0xc6, 0xc7, 0xc9, 0xca, 0xcb, 0xcd, 0xce, 0xcf,\n]);\n\nfunction parseSeed(value: string): number {\n const seed = Number(value);\n if (!Number.isInteger(seed) || seed < 0 || !Number.isSafeInteger(seed)) {\n throw new InvalidArgumentError(\"seed must be a non-negative safe integer\");\n }\n return seed;\n}\n\nfunction collectUrl(value: string, previous: string[] = []): string[] {\n return [...previous, value];\n}\n\nfunction unknownTemplateError(id: string, usageCommand: string): Error {\n const templates = listVideoTemplates();\n const message = [\n `Unknown video template: ${id}`,\n \"\",\n \"Available video templates:\",\n formatRegistryListing(templates, \"video templates\"),\n \"\",\n `Example:`,\n ` ${usageCommand} --template ${templates[0]?.id ?? \"<template-id>\"} --prompt \"...\"`,\n ].join(\"\\n\");\n return new Error(message);\n}\n\nfunction parseAspectRatio(value: string): ImageDimensions {\n const [widthText, heightText] = value.split(\":\");\n const width = Number(widthText);\n const height = Number(heightText);\n if (\n !Number.isFinite(width) ||\n !Number.isFinite(height) ||\n width <= 0 ||\n height <= 0\n ) {\n throw new Error(`Invalid --aspect-ratio \"${value}\"`);\n }\n return { width, height };\n}\n\nfunction readPngDimensions(buffer: Buffer): ImageDimensions | undefined {\n if (\n buffer.length < 24 ||\n buffer.toString(\"latin1\", 0, 8) !== \"\\x89PNG\\r\\n\\x1a\\n\"\n ) {\n return undefined;\n }\n return {\n width: buffer.readUInt32BE(16),\n height: buffer.readUInt32BE(20),\n };\n}\n\nfunction readGifDimensions(buffer: Buffer): ImageDimensions | undefined {\n if (\n buffer.length < 10 ||\n !buffer.toString(\"latin1\", 0, 6).startsWith(\"GIF\")\n ) {\n return undefined;\n }\n return {\n width: buffer.readUInt16LE(6),\n height: buffer.readUInt16LE(8),\n };\n}\n\nfunction readJpegDimensions(buffer: Buffer): ImageDimensions | undefined {\n if (buffer.length < 4 || buffer[0] !== 0xff || buffer[1] !== 0xd8) {\n return undefined;\n }\n\n let offset = 2;\n while (offset + 9 < buffer.length) {\n if (buffer[offset] !== 0xff) {\n offset += 1;\n continue;\n }\n\n const marker = buffer[offset + 1] as number;\n if (marker === 0xd9 || marker === 0xda) {\n break;\n }\n\n const segmentLength = buffer.readUInt16BE(offset + 2);\n if (segmentLength < 2 || offset + 2 + segmentLength > buffer.length) {\n break;\n }\n\n if (JPEG_START_OF_FRAME_MARKERS.has(marker)) {\n return {\n height: buffer.readUInt16BE(offset + 5),\n width: buffer.readUInt16BE(offset + 7),\n };\n }\n\n offset += 2 + segmentLength;\n }\n\n return undefined;\n}\n\nfunction readUnsigned24LE(buffer: Buffer, offset: number): number {\n return (\n buffer.readUInt8(offset) +\n (buffer.readUInt8(offset + 1) << 8) +\n (buffer.readUInt8(offset + 2) << 16)\n );\n}\n\nfunction readWebpDimensions(buffer: Buffer): ImageDimensions | undefined {\n if (\n buffer.length < 30 ||\n buffer.toString(\"ascii\", 0, 4) !== \"RIFF\" ||\n buffer.toString(\"ascii\", 8, 12) !== \"WEBP\"\n ) {\n return undefined;\n }\n\n let offset = 12;\n while (offset + 8 <= buffer.length) {\n const chunkType = buffer.toString(\"ascii\", offset, offset + 4);\n const chunkSize = buffer.readUInt32LE(offset + 4);\n const payloadOffset = offset + 8;\n if (payloadOffset + chunkSize > buffer.length) {\n break;\n }\n\n if (chunkType === \"VP8X\" && chunkSize >= 10) {\n return {\n width: readUnsigned24LE(buffer, payloadOffset + 4) + 1,\n height: readUnsigned24LE(buffer, payloadOffset + 7) + 1,\n };\n }\n\n if (\n chunkType === \"VP8L\" &&\n chunkSize >= 5 &&\n buffer[payloadOffset] === 0x2f\n ) {\n const byte1 = buffer.readUInt8(payloadOffset + 1);\n const byte2 = buffer.readUInt8(payloadOffset + 2);\n const byte3 = buffer.readUInt8(payloadOffset + 3);\n const byte4 = buffer.readUInt8(payloadOffset + 4);\n return {\n width: 1 + byte1 + ((byte2 & 0x3f) << 8),\n height:\n 1 + ((byte2 & 0xc0) >> 6) + (byte3 << 2) + ((byte4 & 0x0f) << 10),\n };\n }\n\n if (\n chunkType === \"VP8 \" &&\n chunkSize >= 10 &&\n buffer[payloadOffset + 3] === 0x9d &&\n buffer[payloadOffset + 4] === 0x01 &&\n buffer[payloadOffset + 5] === 0x2a\n ) {\n return {\n width: buffer.readUInt16LE(payloadOffset + 6) & 0x3fff,\n height: buffer.readUInt16LE(payloadOffset + 8) & 0x3fff,\n };\n }\n\n offset = payloadOffset + chunkSize + (chunkSize % 2);\n }\n\n return undefined;\n}\n\nfunction readImageDimensions(buffer: Buffer): ImageDimensions | undefined {\n return (\n readPngDimensions(buffer) ??\n readJpegDimensions(buffer) ??\n readWebpDimensions(buffer) ??\n readGifDimensions(buffer)\n );\n}\n\nfunction formatDimensionsAsRatio({ width, height }: ImageDimensions): string {\n const divisor = greatestCommonDivisor(width, height);\n return `${width / divisor}:${height / divisor}`;\n}\n\nfunction greatestCommonDivisor(left: number, right: number): number {\n let a = Math.abs(left);\n let b = Math.abs(right);\n while (b !== 0) {\n const remainder = a % b;\n a = b;\n b = remainder;\n }\n return a || 1;\n}\n\nfunction hasMatchingAspectRatio(\n actual: ImageDimensions,\n expected: ImageDimensions,\n): boolean {\n const actualRatio = actual.width / actual.height;\n const expectedRatio = expected.width / expected.height;\n return (\n Math.abs(actualRatio - expectedRatio) / expectedRatio <=\n FRAME_ASPECT_RATIO_TOLERANCE\n );\n}\n\nasync function fetchImageDimensions(\n optionName: string,\n imageUrl: string,\n): Promise<ImageDimensions> {\n let url: URL;\n try {\n url = new URL(imageUrl);\n } catch {\n throw new Error(`${optionName} must be an absolute URL`);\n }\n\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(\n `Could not validate ${optionName}: failed to fetch image (HTTP ${response.status})`,\n );\n }\n\n const buffer = Buffer.from(await response.arrayBuffer());\n const dimensions = readImageDimensions(buffer);\n if (!dimensions) {\n throw new Error(\n `Could not validate ${optionName}: unsupported image format or missing dimensions`,\n );\n }\n return dimensions;\n}\n\nasync function validateFrameImageAspectRatio(\n optionName: string,\n imageUrl: string | undefined,\n aspectRatio: string,\n): Promise<void> {\n if (!imageUrl) {\n return;\n }\n\n const expected = parseAspectRatio(aspectRatio);\n const actual = await fetchImageDimensions(optionName, imageUrl);\n if (hasMatchingAspectRatio(actual, expected)) {\n return;\n }\n\n throw new Error(\n `${optionName} has aspect ratio ${formatDimensionsAsRatio(actual)} (${actual.width}x${actual.height}), but --aspect-ratio is ${aspectRatio}. Use --aspect-ratio ${formatDimensionsAsRatio(actual)} or provide a frame image with ${aspectRatio} dimensions.`,\n );\n}\n\nasync function validateVideoOptions(options: VideoOptions): Promise<void> {\n await Promise.all([\n validateFrameImageAspectRatio(\n \"--first-frame-image-url\",\n options.firstFrameImageUrl,\n options.aspectRatio,\n ),\n validateFrameImageAspectRatio(\n \"--last-frame-image-url\",\n options.lastFrameImageUrl,\n options.aspectRatio,\n ),\n ]);\n}\n\nfunction formatOptionalVideoParameter(\n value: string | number | undefined,\n fallback = \"none\",\n): string {\n return `${value ?? fallback}`;\n}\n\nfunction formatVideoUrlList(values: readonly string[] | undefined): string {\n const list = values ?? [];\n if (list.length === 0) {\n return \"none\";\n }\n return list.join(\", \");\n}\n\nfunction formatVideoToggle(enabled: boolean): string {\n return enabled ? \"on\" : \"off\";\n}\n\nfunction createVideoTemplateDetails(options: VideoOptions): readonly string[] {\n return [\n `Model preference if direct video generation is used: ${options.model}`,\n `Requested aspect ratio: ${options.aspectRatio}`,\n `Requested duration: ${options.duration}`,\n `Requested resolution: ${formatOptionalVideoParameter(\n options.resolution,\n \"provider default\",\n )}`,\n `Requested audio: ${formatVideoToggle(options.audio !== false)}`,\n `Requested negative prompt: ${formatOptionalVideoParameter(\n options.negativePrompt,\n )}`,\n `Requested seed: ${formatOptionalVideoParameter(options.seed)}`,\n `Prompt auto-fix: ${formatVideoToggle(options.autoFix !== false)}`,\n `Safety tolerance: ${options.safetyTolerance}`,\n `Reference image URLs: ${formatVideoUrlList(options.imageUrl)}`,\n `Reference video URLs: ${formatVideoUrlList(options.videoUrl)}`,\n `Reference audio URLs: ${formatVideoUrlList(options.audioUrl)}`,\n `First frame image URL: ${formatOptionalVideoParameter(\n options.firstFrameImageUrl,\n )}`,\n `Last frame image URL: ${formatOptionalVideoParameter(\n options.lastFrameImageUrl,\n )}`,\n ];\n}\n\nexport function createVideoGenerateCommand(\n config: VideoGenerateCommandConfig,\n): Command {\n return new Command()\n .name(config.name)\n .description(\"Generate a billed video file from a prompt\")\n .option(\"--prompt <text>\", \"Video prompt; can also be piped via stdin\")\n .option(\n \"--provider <name>\",\n \"Provider: 'built-in' to run vm0's pipeline, or a connector name to get its skill-invocation guidance\",\n )\n .option(\"--template <id>\", \"Registered video template id\")\n .option(\n \"--all\",\n \"When listing providers (no --prompt given), include unavailable or not-yet-authorized connectors\",\n )\n .option(\n \"--model <model>\",\n \"Model: dreamina-seedance-2.0-fast, dreamina-seedance-2.0, seedance-1.5-pro, veo3.1-fast, or kling-v3-4k\",\n \"dreamina-seedance-2.0-fast\",\n )\n .option(\n \"--aspect-ratio <ratio>\",\n \"Aspect ratio: 21:9, 16:9, 4:3, 1:1, 3:4, or 9:16\",\n \"16:9\",\n )\n .option(\n \"--duration <duration>\",\n \"Duration: 2s-15s depending on model\",\n \"8s\",\n )\n .option(\"--resolution <resolution>\", \"Resolution: 480p, 720p, or 1080p\")\n .option(\"--no-audio\", \"Generate a silent video\")\n .option(\"--negative-prompt <text>\", \"Negative prompt\")\n .option(\"--seed <integer>\", \"Deterministic seed\", parseSeed)\n .option(\"--no-auto-fix\", \"Disable prompt auto-fix\")\n .option(\"--safety-tolerance <level>\", \"Safety tolerance\", \"4\")\n .option(\n \"--image-url <url>\",\n \"Reference image URL; repeat for multiple Dreamina Seedance 2.0 references\",\n collectUrl,\n [],\n )\n .option(\n \"--video-url <url>\",\n \"Reference video URL; repeat up to 3 times for Dreamina Seedance 2.0\",\n collectUrl,\n [],\n )\n .option(\n \"--audio-url <url>\",\n \"Reference audio URL for Dreamina Seedance 2.0\",\n collectUrl,\n [],\n )\n .option(\"--first-frame-image-url <url>\", \"First frame image URL\")\n .option(\"--last-frame-image-url <url>\", \"Last frame image URL\")\n .addHelpText(\n \"after\",\n `\nExamples:\n${config.examples}\n\nOutput:\n Prints the generated /f/ video file URL and metadata\n\nNotes:\n - Authenticates via ZERO_TOKEN (requires file:write capability)\n - Charges org credits after successful video generation\n - Uses BytePlus ModelArk and fal.ai video models with configured usage pricing\n\nModels:\n - Dreamina Seedance 2.0: dreamina-seedance-2.0,\n dreamina-seedance-2.0-fast (default). Supports 4s-15s,\n 480p/720p, seed, optional audio, image references, and first/last\n frames. The non-fast model also supports 1080p and video/audio references.\n - Seedance 1.5 Pro: seedance-1.5-pro. Supports 4s-12s,\n 480p/720p/1080p, seed, optional audio, image references, and\n first/last frames.\n - fal.ai: veo3.1-fast and kling-v3-4k. veo3.1-fast supports\n 4s/6s/8s, 720p/1080p/4k, negative prompts, seed, auto-fix,\n safety tolerance, and optional audio. kling-v3-4k supports 3s-15s,\n 4k output, negative prompts, and optional audio.`,\n )\n .action(\n withErrorHandler(async (options: VideoOptions) => {\n const dispatch = await dispatchGenerate({\n generationType: config.generationType,\n provider: options.provider,\n prompt: options.prompt,\n all: options.all,\n });\n if (dispatch.outcome === \"handled\") return;\n const prompt = dispatch.prompt;\n\n if (options.template) {\n const template = findVideoTemplate(options.template);\n if (!template) {\n throw unknownTemplateError(options.template, config.usageCommand);\n }\n\n const packet = createVideoTemplateAuthoringPacket({\n prompt,\n template,\n details: createVideoTemplateDetails(options),\n });\n\n console.log(packet.instructions);\n return;\n }\n\n await validateVideoOptions(options);\n const result = await generateWebVideo({\n prompt,\n model: options.model,\n aspectRatio: options.aspectRatio,\n duration: options.duration,\n resolution: options.resolution,\n generateAudio: options.audio !== false,\n negativePrompt: options.negativePrompt,\n seed: options.seed,\n autoFix: options.autoFix !== false,\n safetyTolerance: options.safetyTolerance,\n imageUrls: options.imageUrl,\n videoUrls: options.videoUrl,\n audioUrls: options.audioUrl,\n firstFrameImageUrl: options.firstFrameImageUrl,\n lastFrameImageUrl: options.lastFrameImageUrl,\n });\n\n console.log(chalk.green(`✓ Video generated: ${result.url}`));\n console.log(chalk.dim(` File: ${result.filename}`));\n console.log(chalk.dim(` Duration: ${result.duration}`));\n console.log(chalk.dim(` Resolution: ${result.resolution}`));\n console.log(chalk.dim(` Aspect ratio: ${result.aspectRatio}`));\n console.log(\n chalk.dim(` Audio: ${result.generateAudio ? \"on\" : \"off\"}`),\n );\n console.log(chalk.dim(` Credits charged: ${result.creditsCharged}`));\n console.log(chalk.dim(` Model: ${result.model}`));\n }),\n );\n}\n","import {\n type GenerationOutputKind,\n type ResourceCandidateSlice,\n type VideoTemplateRegistryEntry,\n selectResourceCandidates,\n} from \"./resource-registry\";\n\ninterface VideoTemplateAuthoringOptions {\n readonly prompt: string;\n readonly details: readonly string[];\n readonly template: VideoTemplateRegistryEntry;\n}\n\ninterface VideoTemplateAuthoringPacket {\n readonly type: \"generation-source-selection\";\n readonly kind: \"video\";\n readonly prompt: string;\n readonly registryVersion: string;\n readonly artifact: {\n readonly outputMode: \"primary-video\";\n readonly primaryArtifact: {\n readonly kind: GenerationOutputKind;\n readonly path: string;\n };\n readonly supportingAssets: readonly {\n readonly kind: GenerationOutputKind | \"metadata\";\n readonly path: string;\n readonly optional: boolean;\n }[];\n readonly previewKind: \"video\";\n readonly outputDir: string;\n };\n readonly selection: {\n readonly candidates: ResourceCandidateSlice[\"candidates\"];\n readonly outputSchema: {\n readonly videoTemplate: \"string\";\n readonly rationale: \"string\";\n };\n };\n readonly authoring: {\n readonly details: readonly string[];\n readonly artifactRules: readonly string[];\n };\n readonly outputDir: string;\n readonly instructions: string;\n}\n\nfunction formatCandidateSource(\n source: ResourceCandidateSlice[\"sources\"][number],\n): string {\n if (\"repo\" in source) {\n return `- \\`${source.repo}@${source.ref}\\``;\n }\n return `- ${source.description}`;\n}\n\nconst outputDir = \"./generated/videos\";\nconst artifactRules = [\n \"Resolve the selected video template source before generating the video.\",\n \"Use the template skill's locked dimensions, prompt construction rules, generation parameters, worked examples, and reference output.\",\n \"Keep the user's subject and intent; use the selected template only to shape the video's look and generation parameters.\",\n \"Write the final prompt in the template's subject -> scene -> motion -> camera -> light -> style order, and explicitly include the template's medium/style locks.\",\n \"End the final video prompt with: safe for all audiences, nonviolent, no explicit content.\",\n \"Do not pass --template again when you run the final video generation command from this packet.\",\n] as const;\n\nexport function createVideoTemplateAuthoringPacket(\n options: VideoTemplateAuthoringOptions,\n): VideoTemplateAuthoringPacket {\n const baseSlice = selectResourceCandidates();\n const candidateSlice: ResourceCandidateSlice = {\n registryVersion: baseSlice.registryVersion,\n source: {\n repo: options.template.source.repo,\n ref: options.template.source.ref,\n },\n sources: [\n {\n repo: options.template.source.repo,\n ref: options.template.source.ref,\n },\n ],\n candidates: {\n skills: [],\n templates: [],\n designSystems: [],\n imageStyles: [],\n audioStyles: [],\n videoTemplates: [options.template],\n bundleTemplates: [],\n },\n };\n const selectionSchema = {\n videoTemplate: \"string\",\n rationale: \"string\",\n } as const;\n const artifact = {\n outputMode: \"primary-video\",\n primaryArtifact: {\n kind: \"video\",\n path: `${outputDir}/`,\n },\n supportingAssets: [\n {\n kind: \"metadata\",\n path: `${outputDir}/metadata.json`,\n optional: true,\n },\n ],\n previewKind: \"video\",\n outputDir,\n } as const;\n const instructions = [\n `# Zero generate video --template ${options.template.id}`,\n \"\",\n \"This is a federated generation source-selection packet for the current agent.\",\n \"Zero is not generating this video on the server yet. The video template has already been selected by the caller - resolve it and generate the templated video.\",\n \"\",\n \"## User Prompt\",\n options.prompt,\n \"\",\n \"## Selected Video Template\",\n `- \\`${options.template.id}\\` - ${options.template.name}`,\n \"\",\n \"## Stage 1: Locked Template\",\n \"- The video template is already selected and locked.\",\n \"- Do not pick supporting skills or templates from outside this packet.\",\n \"- Treat the selection JSON as internal working state, then continue to generation.\",\n \"\",\n \"## Selection Output Schema\",\n \"```json\",\n JSON.stringify(selectionSchema, null, 2),\n \"```\",\n \"\",\n \"## Locked Template Source\",\n `Registry: \\`${candidateSlice.registryVersion}\\``,\n \"Sources:\",\n ...candidateSlice.sources.map(formatCandidateSource),\n \"\",\n \"```json\",\n JSON.stringify(candidateSlice.candidates, null, 2),\n \"```\",\n \"\",\n \"## Stage 2: Resolve Selected Resources\",\n \"- Fetch or read the selected resource source before generation.\",\n \"- 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.\",\n \"- For directory refs, inspect the template `SKILL.md` first; only open examples or references if the SKILL.md points to them.\",\n \"- If a source file cannot be fetched, state that limitation and fall back to the registry metadata for that resource.\",\n \"\",\n \"## Stage 3: Generate Video\",\n \"- Generate one production-quality video using the selected template.\",\n \"- Follow the selected template skill's generation path and parameter guidance when it defines one.\",\n \"- Use direct video generation with the resolved prompt and parameters; do not invoke this same --template packet recursively.\",\n \"\",\n \"## Artifact Output Model\",\n `- Primary artifact: \\`${artifact.primaryArtifact.kind}\\` under \\`${artifact.primaryArtifact.path}\\`.`,\n `- Output mode: \\`${artifact.outputMode}\\`.`,\n \"- Supporting metadata may live inside the same output directory when useful.\",\n \"\",\n \"## Requested Parameters\",\n ...options.details.map((detail) => {\n return `- ${detail}`;\n }),\n \"\",\n \"## Video Authoring Rules\",\n ...artifactRules.map((rule) => {\n return `- ${rule}`;\n }),\n \"\",\n \"## Verification\",\n \"- Verify the final video exists and is nonblank.\",\n \"- Check that the selected template's locked dimensions and reference output were respected when applicable.\",\n \"- Report the final video URL or path and the selected registry resource ID.\",\n ].join(\"\\n\");\n\n return {\n type: \"generation-source-selection\",\n kind: \"video\",\n prompt: options.prompt,\n registryVersion: candidateSlice.registryVersion,\n artifact,\n selection: {\n candidates: candidateSlice.candidates,\n outputSchema: selectionSchema,\n },\n authoring: {\n details: options.details,\n artifactRules,\n },\n outputDir,\n instructions,\n };\n}\n","import { Command } from \"commander\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { createHtmlArtifactAuthoringPacket } from \"../shared/html-artifact-authoring\";\nimport {\n findDesignSystem,\n findWebsiteTemplateResource,\n findTemplate,\n listDesignSystems,\n listTemplates,\n} from \"../shared/resource-registry\";\nimport {\n canonicalizeRegistryId,\n formatRegistryListing,\n} from \"../shared/resource-listing\";\nimport { dispatchGenerate } from \"./lib/dispatch\";\n\nconst WEBSITE_TARGET = \"website\";\nconst WEBSITE_USAGE_COMMAND = \"zero generate website\";\n\ninterface WebsiteOptions {\n readonly prompt?: string;\n readonly template?: string;\n readonly designSystem?: string;\n readonly siteSlug?: string;\n readonly title?: string;\n}\n\nfunction selectedTemplateDetails(\n template: ReturnType<typeof findTemplate> | undefined,\n): readonly string[] {\n if (!template) {\n return [\"Selected template: agent decides\"];\n }\n const details = [`Selected template: ${template.id} (${template.name})`];\n if (template.source.archive) {\n details.push(\n `Selected template package: zero resource pull ${template.id} --dir ./generated/resources`,\n );\n }\n return details;\n}\n\nfunction unknownDesignSystemError(id: string): Error {\n const designSystems = listDesignSystems();\n const message = [\n `Unknown design system: ${id}`,\n \"\",\n \"Available design systems:\",\n formatRegistryListing(designSystems, \"design systems\"),\n \"\",\n `Example:`,\n ` ${WEBSITE_USAGE_COMMAND} --design-system ${\n designSystems[0]?.id ?? \"<design-system-id>\"\n } --prompt \"...\"`,\n ].join(\"\\n\");\n return new Error(message);\n}\n\nfunction unknownTemplateError(id: string): Error {\n const templates = listTemplates(WEBSITE_TARGET);\n const message = [\n `Unknown template for ${WEBSITE_TARGET}: ${id}`,\n \"\",\n `Available templates for ${WEBSITE_TARGET}:`,\n formatRegistryListing(templates, `${WEBSITE_TARGET} templates`),\n \"\",\n `Example:`,\n ` ${WEBSITE_USAGE_COMMAND} --template ${\n templates[0]?.id ?? \"<template-id>\"\n } --prompt \"...\"`,\n ].join(\"\\n\");\n return new Error(message);\n}\n\nexport const websiteCommand = new Command()\n .name(\"website\")\n .description(\"Prepare website authoring instructions from a prompt\")\n .option(\"--prompt <text>\", \"Website prompt; can also be piped via stdin\")\n .option(\"--site-slug <slug>\", \"Hosted site slug override\")\n .option(\"--title <text>\", \"Requested site title or name\")\n .option(\n \"--design-system <id>\",\n \"Design system id from the registry (see Design Systems below). Accepts either 'apple' or 'design-system:apple'.\",\n )\n .option(\n \"--template <id>\",\n \"Template id scoped to website (see Templates below). Accepts either short id or full 'template:<id>'.\",\n )\n .addHelpText(\"after\", () => {\n const designSystems = listDesignSystems();\n const templates = listTemplates(WEBSITE_TARGET);\n return `\nExamples:\n Generate site: zero generate website --prompt \"A launch site for a developer observability tool\"\n Pick template: zero generate website --template black-slabs --prompt \"Launch site for a billing API\"\n Pick design system: zero generate website --design-system stripe --prompt \"Pricing page for a SaaS\"\n Custom site slug: zero generate website --site-slug api-migration-demo --prompt \"An internal migration microsite\"\n Pipe prompt: cat brief.txt | zero generate website\n Show choices: zero generate website\n\nOutput:\n Prints a source-selection packet for the current agent.\n With no --prompt and no piped input, prints the generation choices instead.\n\nNotes:\n - Authenticates via ZERO_TOKEN\n - The agent authors the HTML artifact and hosts it with zero host\n\nDesign Systems:\n${formatRegistryListing(designSystems, \"design systems\")}\n\nTemplates (website):\n${formatRegistryListing(templates, \"website templates\")}`;\n })\n .action(\n withErrorHandler(async (options: WebsiteOptions) => {\n const dispatch = await dispatchGenerate({\n generationType: \"website\",\n prompt: options.prompt,\n });\n if (dispatch.outcome === \"handled\") return;\n const prompt = dispatch.prompt;\n\n let resolvedDesignSystem;\n if (options.designSystem !== undefined) {\n const canonical = canonicalizeRegistryId(\n \"design-system\",\n options.designSystem,\n );\n const entry = findDesignSystem(canonical);\n if (!entry) {\n throw unknownDesignSystemError(options.designSystem);\n }\n resolvedDesignSystem = entry;\n }\n\n let resolvedTemplate;\n if (options.template !== undefined) {\n const canonical = canonicalizeRegistryId(\"template\", options.template);\n const entry =\n findWebsiteTemplateResource(options.template) ??\n findTemplate(canonical);\n if (!entry || !entry.targets?.includes(WEBSITE_TARGET)) {\n throw unknownTemplateError(options.template);\n }\n resolvedTemplate = entry;\n }\n\n const packet = createHtmlArtifactAuthoringPacket({\n kind: \"website\",\n prompt,\n slugSource: options.title,\n siteSlug: options.siteSlug,\n details: [\n `Requested title/site name: ${options.title ?? \"not specified\"}`,\n `Selected design system: ${\n resolvedDesignSystem\n ? `${resolvedDesignSystem.id} (${resolvedDesignSystem.name})`\n : \"agent decides\"\n }`,\n ...selectedTemplateDetails(resolvedTemplate),\n ],\n artifactRules: [\n \"Build the usable website as the first screen; do not output a landing-page plan.\",\n \"If it is a marketing site, make the product or offer visible in the first viewport.\",\n \"For app or tool surfaces, prioritize dense, scannable, task-focused UI over decorative sections.\",\n \"Use responsive HTML/CSS and verify the page works at mobile and desktop widths.\",\n ],\n });\n\n console.log(packet.instructions);\n }),\n );\n","import { createVoiceGenerateCommand } from \"../shared/voice-generate\";\n\nexport const voiceCommand = createVoiceGenerateCommand({\n name: \"voice\",\n generationType: \"voice\",\n usageCommand: \"zero generate voice\",\n examples: ` Generate speech: zero generate voice --prompt \"Hello from vm0\"\n Pipe prompt: cat script.txt | zero generate voice\n Pick a voice: zero generate voice --prompt \"Ship it\" --voice cedar\n List providers: zero generate voice\n Use ElevenLabs: zero generate voice --provider elevenlabs`,\n});\n","import { Command, Option } from \"commander\";\nimport chalk from \"chalk\";\nimport { generateWebVoice } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { dispatchGenerate } from \"../generate/lib/dispatch\";\nimport type { GenerationType } from \"../generate/lib/lister\";\n\ninterface VoiceOptions {\n prompt?: string;\n text?: string;\n provider?: string;\n voice: string;\n instructions?: string;\n all?: boolean;\n}\n\ninterface VoiceGenerateCommandConfig {\n name: string;\n generationType: GenerationType;\n usageCommand: string;\n examples: string;\n}\n\nexport function createVoiceGenerateCommand(\n config: VoiceGenerateCommandConfig,\n): Command {\n return new Command()\n .name(config.name)\n .description(\"Generate a billed speech audio file from text\")\n .option(\"--prompt <text>\", \"Text to speak; can also be piped via stdin\")\n .addOption(new Option(\"--text <text>\", \"Alias for --prompt\").hideHelp())\n .option(\n \"--provider <name>\",\n \"Provider: 'built-in' to run vm0's pipeline, or a connector name (heygen, elevenlabs, ...) to get its skill-invocation guidance\",\n )\n .option(\n \"--all\",\n \"When listing providers (no --prompt given), include unavailable or not-yet-authorized connectors\",\n )\n .option(\"--voice <voice>\", \"OpenAI voice to use\", \"marin\")\n .option(\"--instructions <text>\", \"Voice style instructions\")\n .addHelpText(\n \"after\",\n `\nExamples:\n${config.examples}\n\nOutput:\n Prints the generated /f/ audio file URL and metadata. With no --prompt\n and no piped input, prints the provider menu instead.\n\nNotes:\n - Authenticates via ZERO_TOKEN (requires file:write capability)\n - Charges org credits after successful audio generation\n - Uses gpt-4o-mini-tts with WAV output`,\n )\n .action(\n withErrorHandler(async (options: VoiceOptions) => {\n const dispatch = await dispatchGenerate({\n generationType: config.generationType,\n provider: options.provider,\n prompt: options.prompt ?? options.text,\n all: options.all,\n });\n if (dispatch.outcome === \"handled\") return;\n const text = dispatch.prompt;\n\n const result = await generateWebVoice({\n text,\n voice: options.voice,\n instructions: options.instructions,\n });\n\n console.log(chalk.green(`✓ Voice generated: ${result.url}`));\n console.log(chalk.dim(` File: ${result.filename}`));\n console.log(chalk.dim(` Duration: ${result.durationSeconds}s`));\n console.log(chalk.dim(` Credits charged: ${result.creditsCharged}`));\n console.log(chalk.dim(` Model: ${result.model}`));\n console.log(chalk.dim(` Voice: ${result.voice}`));\n }),\n );\n}\n","import { Command } from \"commander\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { printConnectorGuidance } from \"./lib/connector-guidance\";\nimport { runLister, type GenerationType } from \"./lib/lister\";\n\ninterface ListerOnlyOptions {\n readonly provider?: string;\n readonly all?: boolean;\n}\n\ninterface ListerOnlyConfig {\n readonly name: string;\n readonly generationType: GenerationType;\n readonly description: string;\n}\n\n/**\n * Build a generate subcommand for a type that has no vm0 built-in pipeline.\n * The command lists available connector providers and prints skill-invocation\n * guidance when a --provider is named, but cannot execute on its own.\n */\nexport function createListerOnlyCommand(config: ListerOnlyConfig): Command {\n return new Command()\n .name(config.name)\n .description(config.description)\n .option(\n \"--provider <name>\",\n \"Connector name; prints that connector's skill-invocation guidance\",\n )\n .option(\"--all\", \"Include unavailable or not-yet-authorized connectors\")\n .addHelpText(\n \"after\",\n `\nNotes:\n - vm0 does not provide a built-in ${config.generationType} pipeline.\n - Use --provider <connector-name> to get skill-invocation guidance for a\n specific connector, or run with no flags to see every available provider.`,\n )\n .action(\n withErrorHandler(async (options: ListerOnlyOptions) => {\n const provider = options.provider?.trim();\n if (provider && provider !== \"built-in\") {\n await printConnectorGuidance(config.generationType, provider);\n return;\n }\n if (provider === \"built-in\") {\n console.log(\n `vm0 has no built-in ${config.generationType} generation pipeline.`,\n );\n console.log(\"\");\n console.log(\n `Run \"zero generate ${config.generationType}\" to see every connector-backed provider.`,\n );\n return;\n }\n await runLister(config.generationType, {\n all: options.all,\n });\n }),\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;;;ACAA;;;ACAA;AAqCA,SAAS,kBAAkB,QAAoD;AAC7E,MAAI,UAAU,QAAQ;AACpB,WAAO;AAAA,MACL,mBAAmB,OAAO,IAAI,IAAI,OAAO,GAAG;AAAA,MAC5C,aAAa,OAAO,IAAI;AAAA,IAC1B;AAAA,EACF;AACA,SAAO,CAAC,aAAa,OAAO,IAAI,IAAI;AACtC;AAEA,IAAM,YAAY;AAClB,IAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,SAAS,mCACd,SAC8B;AAC9B,QAAM,WAAW;AAAA,IACf,YAAY;AAAA,IACZ,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,MAAM,GAAG,SAAS;AAAA,IACpB;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,MAAM;AAAA,QACN,MAAM,GAAG,SAAS;AAAA,QAClB,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,aAAa;AAAA,IACb;AAAA,EACF;AACA,QAAM,eAAe;AAAA,IACnB,wCAAwC,QAAQ,MAAM,EAAE;AAAA,IACxD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,OAAO,QAAQ,MAAM,EAAE,aAAQ,QAAQ,MAAM,IAAI;AAAA,IACjD,KAAK,QAAQ,MAAM,WAAW;AAAA,IAC9B;AAAA,IACA;AAAA,IACA,GAAG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AW,WAAW,EACtB,WAAW,eAAe,EAC1B,YAAY,SAAS,qBAAqB;","names":["outputDir","unknownTemplateError","outputDir","slugify","formatCandidateSource","outputDir","artifactRules","parseSeed","unknownTemplateError","unknownDesignSystemError","unknownTemplateError"]}
|
package/slack-PDOPNS5Z.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/zero/slack/index.ts","../src/commands/zero/slack/message/index.ts","../src/commands/zero/slack/message/send.ts","../src/commands/zero/slack/upload-file.ts","../src/commands/zero/slack/download-file.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { zeroSlackMessageCommand } from \"./message\";\nimport { uploadFileCommand } from \"./upload-file\";\nimport { downloadFileCommand } from \"./download-file\";\n\nexport const zeroSlackCommand = new Command()\n .name(\"slack\")\n .description(\n \"Send messages, upload files, and download files from Slack as the bot\",\n )\n .addCommand(zeroSlackMessageCommand)\n .addCommand(uploadFileCommand)\n .addCommand(downloadFileCommand)\n .addHelpText(\n \"after\",\n `\nExamples:\n Send a message: zero slack message send -c <channel-id> -t \"Hello!\"\n Reply in a thread: zero slack message send -c <channel-id> --thread <ts> -t \"reply\"\n Upload a file: zero slack upload-file -f /tmp/report.pdf -c <channel-id>\n Download a file: zero slack download-file <file-id> -o /tmp/out.png`,\n );\n","import { Command } from \"commander\";\nimport { sendCommand } from \"./send\";\n\nexport const zeroSlackMessageCommand = new Command()\n .name(\"message\")\n .description(\"Manage Slack messages\")\n .addCommand(sendCommand)\n .addHelpText(\n \"after\",\n `\nExamples:\n zero slack message send -c <channel-id> -t \"Hello!\"`,\n );\n","import { readFileSync } from \"fs\";\nimport { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { sendSlackMessage } from \"../../../../lib/api\";\nimport { withErrorHandler } from \"../../../../lib/command\";\n\nexport const sendCommand = new Command()\n .name(\"send\")\n .description(\"Send a message to a Slack channel or DM a user\")\n .option(\"-c, --channel <id>\", \"Channel ID\")\n .option(\"-u, --user <id>\", 'Slack user ID for DM (use \"me\" for yourself)')\n .option(\"-t, --text <message>\", \"Message text\")\n .option(\"--thread <ts>\", \"Thread timestamp for replies\")\n .option(\"--blocks <json>\", \"Block Kit JSON string\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Simple message: zero slack message send -c C01234 -t \"Hello!\"\n DM a user: zero slack message send -u U0A8V9X98QJ -t \"Hello!\"\n DM yourself: zero slack message send -u me -t \"Hello!\"\n Reply in thread: zero slack message send -c C01234 --thread 1234567890.123456 -t \"reply\"\n Rich blocks: zero slack message send -c C01234 --blocks '[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Bold*\"}}]'\n\nNotes:\n - Either --channel or --user is required; they are mutually exclusive\n - Either --text or --blocks is required; both can be used together`,\n )\n .action(\n withErrorHandler(\n async (options: {\n channel?: string;\n user?: string;\n text?: string;\n thread?: string;\n blocks?: string;\n }) => {\n let text = options.text;\n const { channel, user, thread, blocks: blocksStr } = options;\n\n // Validate mutual exclusion: exactly one of --channel or --user\n if (!channel && !user) {\n throw new Error(\"Either --channel or --user must be provided\", {\n cause: new Error(\n 'Usage: zero slack message send -c CHANNEL_ID -t \"your message\"\\n zero slack message send -u USER_ID -t \"your message\"',\n ),\n });\n }\n if (channel && user) {\n throw new Error(\"--channel and --user are mutually exclusive\", {\n cause: new Error(\n \"Provide either --channel to send to a channel or --user to DM a user, not both\",\n ),\n });\n }\n\n // Read from stdin if text not provided and stdin is not a TTY\n // (isTTY is true only for an interactive terminal, undefined when piped).\n if (!text && !process.stdin.isTTY) {\n try {\n text = readFileSync(\"/dev/stdin\", \"utf8\").trim();\n } catch {\n // stdin not readable (e.g. test runner with no piped input);\n // fall through to the missing-text validation below.\n }\n }\n\n // Parse blocks JSON if provided\n let blocks: Array<{ type: string; [key: string]: unknown }> | undefined;\n if (blocksStr) {\n try {\n blocks = JSON.parse(blocksStr) as Array<{\n type: string;\n [key: string]: unknown;\n }>;\n } catch {\n throw new Error(\"Invalid JSON for --blocks flag\", {\n cause: new Error(\n \"Provide a valid JSON array of Block Kit blocks\",\n ),\n });\n }\n }\n\n // Validate at least one of text or blocks\n if (!text && !blocks) {\n throw new Error(\"Either --text or --blocks must be provided\", {\n cause: new Error(\n 'Usage: zero slack message send -c CHANNEL_ID -t \"your message\"',\n ),\n });\n }\n\n const result = await sendSlackMessage({\n channel: channel || undefined,\n user: user || undefined,\n text: text || undefined,\n threadTs: thread,\n blocks,\n });\n\n const tsInfo = result.ts ? ` (ts: ${result.ts})` : \"\";\n console.log(chalk.green(`✓ Message sent${tsInfo}`));\n },\n ),\n );\n","import { createHash, randomUUID } from \"node:crypto\";\nimport { statSync, readFileSync } from \"fs\";\nimport { basename } from \"path\";\nimport { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport type {\n SlackUploadInitResponse,\n SlackUploadMaterializeResponse,\n} from \"@vm0/api-contracts/contracts/integrations\";\nimport {\n completeSlackFileUpload,\n inferWebUploadContentType,\n initSlackFileUpload,\n materializeSlackFileUpload,\n} from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\ninterface UploadFileOptions {\n readonly file: string;\n readonly channel: string;\n readonly thread?: string;\n readonly title?: string;\n readonly comment?: string;\n readonly contentType?: string;\n readonly operationId?: string;\n}\n\ntype DirectUploadInitialization = Extract<\n SlackUploadInitResponse,\n { fileId: string }\n>;\ntype CanonicalUploadInitialization = Extract<\n SlackUploadInitResponse,\n { kind: \"canonical\" }\n>;\ntype PendingSlackDelivery = Extract<\n SlackUploadMaterializeResponse[\"delivery\"],\n { status: \"pending\" }\n>;\n\nfunction readUploadFile(path: string): {\n readonly content: Buffer;\n readonly size: number;\n} {\n let size: number;\n try {\n size = statSync(path).size;\n } catch {\n throw new Error(`File not found: ${path}`);\n }\n if (size === 0) {\n throw new Error(\"File is empty\");\n }\n return { content: readFileSync(path), size };\n}\n\nfunction warnDeliveryRetry(operationId: string): void {\n console.warn(chalk.dim(` Retry with --operation-id ${operationId}`));\n}\n\nasync function uploadDirectlyToSlack(\n initialized: DirectUploadInitialization,\n options: UploadFileOptions,\n fileContent: Buffer,\n): Promise<void> {\n const uploadResponse = await fetch(initialized.uploadUrl, {\n method: \"POST\",\n body: fileContent,\n });\n if (!uploadResponse.ok) {\n throw new Error(\n `File upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`,\n );\n }\n const result = await completeSlackFileUpload({\n fileId: initialized.fileId,\n channel: options.channel,\n threadTs: options.thread,\n title: options.title,\n initialComment: options.comment,\n });\n console.log(chalk.green(`✓ File uploaded (file_id: ${result.fileId})`));\n console.log(chalk.dim(` permalink: ${result.permalink}`));\n}\n\nasync function uploadCanonicalBody(\n initialized: CanonicalUploadInitialization,\n contentType: string,\n fileContent: Buffer,\n): Promise<void> {\n if (!initialized.uploadUrl) {\n return;\n }\n const uploadResponse = await fetch(initialized.uploadUrl, {\n method: \"PUT\",\n headers: { \"Content-Type\": contentType },\n body: fileContent,\n });\n if (!uploadResponse.ok) {\n throw new Error(\n `Canonical file upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`,\n );\n }\n}\n\nasync function uploadPendingSlackBody(\n delivery: PendingSlackDelivery,\n fileContent: Buffer,\n): Promise<string | undefined> {\n try {\n const uploadResponse = await fetch(delivery.uploadUrl, {\n method: \"POST\",\n body: fileContent,\n });\n if (!uploadResponse.ok) {\n return `Slack upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`;\n }\n return undefined;\n } catch (error) {\n return error instanceof Error ? error.message : \"Slack upload failed\";\n }\n}\n\nasync function completeCanonicalSlackDelivery(args: {\n readonly initialized: CanonicalUploadInitialization;\n readonly delivery: PendingSlackDelivery;\n readonly options: UploadFileOptions;\n readonly fileContent: Buffer;\n}): Promise<void> {\n const uploadError = await uploadPendingSlackBody(\n args.delivery,\n args.fileContent,\n );\n let result: Awaited<ReturnType<typeof completeSlackFileUpload>>;\n try {\n result = await completeSlackFileUpload({\n fileId: args.delivery.fileId,\n channel: args.options.channel,\n ...(args.options.thread ? { threadTs: args.options.thread } : {}),\n ...(args.options.title ? { title: args.options.title } : {}),\n ...(args.options.comment ? { initialComment: args.options.comment } : {}),\n canonicalAssetId: args.initialized.assetId,\n operationId: args.initialized.operationId,\n ...(uploadError ? { uploadError } : {}),\n });\n } catch (error) {\n console.warn(\n chalk.yellow(\n `⚠ Slack delivery status could not be recorded: ${\n error instanceof Error ? error.message : \"Unknown error\"\n }`,\n ),\n );\n warnDeliveryRetry(args.initialized.operationId);\n return;\n }\n if (result.deliveryStatus === \"failed\") {\n console.warn(\n chalk.yellow(\n `⚠ Slack delivery failed: ${result.deliveryError ?? \"Unknown error\"}`,\n ),\n );\n warnDeliveryRetry(args.initialized.operationId);\n return;\n }\n console.log(chalk.green(`✓ Delivered to Slack (file_id: ${result.fileId})`));\n console.log(chalk.dim(` permalink: ${result.permalink}`));\n}\n\nasync function publishCanonicalFile(\n initialized: CanonicalUploadInitialization,\n options: UploadFileOptions,\n contentType: string,\n fileContent: Buffer,\n): Promise<void> {\n await uploadCanonicalBody(initialized, contentType, fileContent);\n const materialized = await materializeSlackFileUpload({\n assetId: initialized.assetId,\n operationId: initialized.operationId,\n });\n console.log(\n chalk.green(`✓ File published (asset_id: ${materialized.assetId})`),\n );\n console.log(chalk.dim(` url: ${materialized.url}`));\n\n if (materialized.delivery.status === \"delivered\") {\n console.log(\n chalk.green(\n `✓ Delivered to Slack (file_id: ${materialized.delivery.fileId})`,\n ),\n );\n console.log(chalk.dim(` permalink: ${materialized.delivery.permalink}`));\n return;\n }\n if (materialized.delivery.status === \"failed\") {\n console.warn(\n chalk.yellow(`⚠ Slack delivery failed: ${materialized.delivery.message}`),\n );\n warnDeliveryRetry(initialized.operationId);\n return;\n }\n await completeCanonicalSlackDelivery({\n initialized,\n delivery: materialized.delivery,\n options,\n fileContent,\n });\n}\n\nasync function uploadFile(options: UploadFileOptions): Promise<void> {\n const file = readUploadFile(options.file);\n const filename = basename(options.file);\n const rawContentType =\n options.contentType ?? inferWebUploadContentType(options.file);\n const contentType =\n rawContentType.split(\";\")[0]?.trim().toLowerCase() ?? rawContentType;\n const operationId = options.operationId ?? randomUUID();\n const checksumSha256 = createHash(\"sha256\")\n .update(file.content)\n .digest(\"hex\");\n const initialized = await initSlackFileUpload({\n filename,\n length: file.size,\n canonical: {\n operationId,\n contentType,\n checksumSha256,\n channel: options.channel,\n threadTs: options.thread,\n title: options.title,\n initialComment: options.comment,\n },\n });\n\n if (\"fileId\" in initialized) {\n await uploadDirectlyToSlack(initialized, options, file.content);\n return;\n }\n await publishCanonicalFile(initialized, options, contentType, file.content);\n}\n\nexport const uploadFileCommand = new Command()\n .name(\"upload-file\")\n .description(\"Upload a file to a Slack channel as the bot\")\n .requiredOption(\"-f, --file <path>\", \"Local file path to upload\")\n .requiredOption(\"-c, --channel <id>\", \"Slack channel ID\")\n .option(\"--thread <ts>\", \"Thread timestamp to post as a reply\")\n .option(\"--title <title>\", \"Display title for the file\")\n .option(\"--comment <text>\", \"Initial comment to accompany the file\")\n .option(\"--content-type <mime>\", \"Override inferred content type\")\n .option(\"--operation-id <uuid>\", \"Reuse a failed upload operation\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Upload a file: zero slack upload-file -f /tmp/report.pdf -c C01234\n Upload to thread: zero slack upload-file -f /tmp/log.txt -c C01234 --thread 1234567890.123456\n With title and comment: zero slack upload-file -f /tmp/data.csv -c C01234 --title \"Daily Report\" --comment \"Here's the report\"\n\nNotes:\n - Uses the bot token (not user SLACK_TOKEN), so no files:write permission is needed\n - Run-scoped calls publish to VM0 storage before Slack delivery\n - Returns canonical asset details and Slack delivery status`,\n )\n .action(withErrorHandler(uploadFile));\n","import { basename, join } from \"path\";\nimport { tmpdir } from \"os\";\nimport { Command } from \"commander\";\nimport { downloadSlackFile } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\n/**\n * Derive a local output path for a Slack file id.\n * Uses the system temp directory; extension is appended later once the\n * mimetype is known.\n *\n * `basename` strips any path separators from `fileId` so a hostile id like\n * `../etc/passwd` cannot escape `tmpdir()`.\n */\nfunction defaultOutPath(fileId: string): string {\n return join(tmpdir(), `slack-${basename(fileId)}`);\n}\n\nexport const downloadFileCommand = new Command()\n .name(\"download-file\")\n .description(\"Download a Slack file by id using the bot token\")\n .argument(\"<file-id>\", \"Slack file id (e.g. F01234ABCD)\")\n .option(\n \"-o, --out <path>\",\n \"Output path for the downloaded file (default: /tmp/slack-<file-id>)\",\n )\n .addHelpText(\n \"after\",\n `\nExamples:\n Download to default temp path: zero slack download-file F01234ABCD\n Download to explicit path: zero slack download-file F01234ABCD -o /tmp/image.png\n\nOutput:\n Prints a JSON object to stdout on success:\n {\"path\":\"/tmp/slack-F01234ABCD\",\"mimetype\":\"image/png\",\"size\":12345}\n\nHow to read the downloaded file:\n - Images (png/jpg/gif/webp/svg): open the file path with your image viewing tool\n - Videos (mp4/mov/webm): transcribe audio first with\n zero video transcribe --url <download-url>\n or extract frames with\n ffmpeg -i <path> -vf \"fps=1\" -q:v 2 /tmp/<file-id>_frame_%03d.jpg\n - PDF/text/csv/json/markdown: read the file directly\n\nNotes:\n - Uses the bot token on the server side; no user Slack token is needed\n - Streams the file bytes directly to disk`,\n )\n .action(\n withErrorHandler(async (fileId: string, options: { out?: string }) => {\n const outPath = options.out ?? defaultOutPath(fileId);\n const result = await downloadSlackFile(fileId, outPath);\n console.log(JSON.stringify(result));\n }),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;;;ACAA;AAAA,SAAS,oBAAoB;AAMtB,IAAM,cAAc,IAAI,QAAQ,EACpC,KAAK,MAAM,EACX,YAAY,gDAAgD,EAC5D,OAAO,sBAAsB,YAAY,EACzC,OAAO,mBAAmB,8CAA8C,EACxE,OAAO,wBAAwB,cAAc,EAC7C,OAAO,iBAAiB,8BAA8B,EACtD,OAAO,mBAAmB,uBAAuB,EACjD;AAAA,EACC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AAsB,IAAI,QAAQ,EAC5C,KAAK,eAAe,EACpB,YAAY,iDAAiD,EAC7D,SAAS,aAAa,iCAAiC,EACvD;AAAA,EACC;AAAA,EACA;AACF,EACC;AAAA,EACC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBF,EACC;AAAA,EACC,iBAAiB,OAAO,QAAgB,YAA8B;AACpE,UAAM,UAAU,QAAQ,OAAO,eAAe,MAAM;AACpD,UAAM,SAAS,MAAM,kBAAkB,QAAQ,OAAO;AACtD,YAAQ,IAAI,KAAK,UAAU,MAAM,CAAC;AAAA,EACpC,CAAC;AACH;;;AJlDK,IAAM,mBAAmB,IAAI,QAAQ,EACzC,KAAK,OAAO,EACZ;AAAA,EACC;AACF,EACC,WAAW,uBAAuB,EAClC,WAAW,iBAAiB,EAC5B,WAAW,mBAAmB,EAC9B;AAAA,EACC;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMF;","names":["readFileSync","readFileSync","basename","basename"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{getMachineId-unsupported-DPRVLH4Y.js.map → getMachineId-unsupported-FPGM635L.js.map}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|