@clockgrove/assetgrove 0.0.0-stage → 0.3.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/LICENSE +21 -0
- package/README.md +277 -2
- package/dist/animation/commands.d.ts +180 -0
- package/dist/animation/commands.js +515 -0
- package/dist/animation/facing.d.ts +44 -0
- package/dist/animation/facing.js +100 -0
- package/dist/animation/fix.d.ts +136 -0
- package/dist/animation/fix.js +529 -0
- package/dist/animation/flicker.d.ts +44 -0
- package/dist/animation/flicker.js +117 -0
- package/dist/animation/halo.d.ts +72 -0
- package/dist/animation/halo.js +253 -0
- package/dist/animation/holes.d.ts +122 -0
- package/dist/animation/holes.js +262 -0
- package/dist/animation/preview.d.ts +38 -0
- package/dist/animation/preview.js +161 -0
- package/dist/animation/qa.d.ts +57 -0
- package/dist/animation/qa.js +418 -0
- package/dist/animation/run.d.ts +109 -0
- package/dist/animation/run.js +182 -0
- package/dist/animation/strip.d.ts +13 -0
- package/dist/animation/strip.js +41 -0
- package/dist/animation/template-choice.d.ts +75 -0
- package/dist/animation/template-choice.js +153 -0
- package/dist/animation/templates.d.ts +39 -0
- package/dist/animation/templates.js +333 -0
- package/dist/animation/types.d.ts +257 -0
- package/dist/animation/types.js +1 -0
- package/dist/approvals.d.ts +156 -0
- package/dist/approvals.js +369 -0
- package/dist/audio/aac.d.ts +61 -0
- package/dist/audio/aac.js +152 -0
- package/dist/audio/checks.d.ts +38 -0
- package/dist/audio/checks.js +254 -0
- package/dist/audio/delivery.d.ts +52 -0
- package/dist/audio/delivery.js +105 -0
- package/dist/audio/engine.d.ts +65 -0
- package/dist/audio/engine.js +164 -0
- package/dist/audio/handoff.d.ts +75 -0
- package/dist/audio/handoff.js +185 -0
- package/dist/audio/kinds.d.ts +6 -0
- package/dist/audio/kinds.js +315 -0
- package/dist/audio/loudness.d.ts +22 -0
- package/dist/audio/loudness.js +72 -0
- package/dist/audio/ogg.d.ts +27 -0
- package/dist/audio/ogg.js +65 -0
- package/dist/audio/operations.d.ts +20 -0
- package/dist/audio/operations.js +335 -0
- package/dist/audio/opus.d.ts +40 -0
- package/dist/audio/opus.js +108 -0
- package/dist/audio/profile.d.ts +200 -0
- package/dist/audio/profile.js +126 -0
- package/dist/audio/run.d.ts +83 -0
- package/dist/audio/run.js +192 -0
- package/dist/audio/vorbis-comments.d.ts +25 -0
- package/dist/audio/vorbis-comments.js +243 -0
- package/dist/audio/waveform.d.ts +13 -0
- package/dist/audio/waveform.js +52 -0
- package/dist/audio-parameters.d.ts +17 -0
- package/dist/audio-parameters.js +45 -0
- package/dist/audit/bar.d.ts +65 -0
- package/dist/audit/bar.js +97 -0
- package/dist/audit/members.d.ts +40 -0
- package/dist/audit/members.js +119 -0
- package/dist/bible-view.d.ts +10 -0
- package/dist/bible-view.js +122 -0
- package/dist/bible.d.ts +272 -0
- package/dist/bible.js +641 -0
- package/dist/budget.d.ts +119 -0
- package/dist/budget.js +227 -0
- package/dist/call-parameters.d.ts +71 -0
- package/dist/call-parameters.js +90 -0
- package/dist/calls.d.ts +145 -0
- package/dist/calls.js +788 -0
- package/dist/cli/main.d.ts +22 -0
- package/dist/cli/main.js +137 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +5 -0
- package/dist/commands/animation-qa.d.ts +1 -0
- package/dist/commands/animation-qa.js +240 -0
- package/dist/commands/apply.d.ts +12 -0
- package/dist/commands/apply.js +181 -0
- package/dist/commands/audit.d.ts +92 -0
- package/dist/commands/audit.js +555 -0
- package/dist/commands/bible.d.ts +1 -0
- package/dist/commands/bible.js +39 -0
- package/dist/commands/browse.d.ts +12 -0
- package/dist/commands/browse.js +113 -0
- package/dist/commands/card.d.ts +3 -0
- package/dist/commands/card.js +445 -0
- package/dist/commands/compare.d.ts +1 -0
- package/dist/commands/compare.js +90 -0
- package/dist/commands/confirm.d.ts +1 -0
- package/dist/commands/confirm.js +267 -0
- package/dist/commands/context.d.ts +43 -0
- package/dist/commands/context.js +115 -0
- package/dist/commands/deliver.d.ts +1 -0
- package/dist/commands/deliver.js +99 -0
- package/dist/commands/disclosure.d.ts +1 -0
- package/dist/commands/disclosure.js +80 -0
- package/dist/commands/doctor.d.ts +1 -0
- package/dist/commands/doctor.js +112 -0
- package/dist/commands/estimate.d.ts +2 -0
- package/dist/commands/estimate.js +80 -0
- package/dist/commands/extensions.d.ts +2 -0
- package/dist/commands/extensions.js +70 -0
- package/dist/commands/fix-frame.d.ts +1 -0
- package/dist/commands/fix-frame.js +206 -0
- package/dist/commands/generate-sheet.d.ts +1 -0
- package/dist/commands/generate-sheet.js +245 -0
- package/dist/commands/identity-check.d.ts +1 -0
- package/dist/commands/identity-check.js +110 -0
- package/dist/commands/identity-eval.d.ts +1 -0
- package/dist/commands/identity-eval.js +197 -0
- package/dist/commands/import.d.ts +7 -0
- package/dist/commands/import.js +472 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +117 -0
- package/dist/commands/intake.d.ts +1 -0
- package/dist/commands/intake.js +56 -0
- package/dist/commands/labels.d.ts +1 -0
- package/dist/commands/labels.js +101 -0
- package/dist/commands/library.d.ts +9 -0
- package/dist/commands/library.js +711 -0
- package/dist/commands/lod.d.ts +1 -0
- package/dist/commands/lod.js +93 -0
- package/dist/commands/look-dev.d.ts +1 -0
- package/dist/commands/look-dev.js +148 -0
- package/dist/commands/materials.d.ts +1 -0
- package/dist/commands/materials.js +223 -0
- package/dist/commands/mcp.d.ts +1 -0
- package/dist/commands/mcp.js +53 -0
- package/dist/commands/migrate.d.ts +1 -0
- package/dist/commands/migrate.js +123 -0
- package/dist/commands/op.d.ts +5 -0
- package/dist/commands/op.js +114 -0
- package/dist/commands/ops.d.ts +1 -0
- package/dist/commands/ops.js +17 -0
- package/dist/commands/pick-batch.d.ts +24 -0
- package/dist/commands/pick-batch.js +343 -0
- package/dist/commands/pick.d.ts +48 -0
- package/dist/commands/pick.js +469 -0
- package/dist/commands/plan.d.ts +3 -0
- package/dist/commands/plan.js +156 -0
- package/dist/commands/recipe.d.ts +1 -0
- package/dist/commands/recipe.js +52 -0
- package/dist/commands/registry.d.ts +5 -0
- package/dist/commands/registry.js +121 -0
- package/dist/commands/render-sprite.d.ts +1 -0
- package/dist/commands/render-sprite.js +67 -0
- package/dist/commands/rendition.d.ts +1 -0
- package/dist/commands/rendition.js +56 -0
- package/dist/commands/request-change.d.ts +2 -0
- package/dist/commands/request-change.js +950 -0
- package/dist/commands/result.d.ts +34 -0
- package/dist/commands/result.js +237 -0
- package/dist/commands/review.d.ts +28 -0
- package/dist/commands/review.js +444 -0
- package/dist/commands/rig.d.ts +1 -0
- package/dist/commands/rig.js +74 -0
- package/dist/commands/runner.d.ts +45 -0
- package/dist/commands/runner.js +297 -0
- package/dist/commands/runs.d.ts +22 -0
- package/dist/commands/runs.js +159 -0
- package/dist/commands/search.d.ts +69 -0
- package/dist/commands/search.js +638 -0
- package/dist/commands/settings.d.ts +2 -0
- package/dist/commands/settings.js +284 -0
- package/dist/commands/spend.d.ts +2 -0
- package/dist/commands/spend.js +159 -0
- package/dist/commands/stage-source.d.ts +1 -0
- package/dist/commands/stage-source.js +58 -0
- package/dist/commands/stage.d.ts +9 -0
- package/dist/commands/stage.js +229 -0
- package/dist/commands/storage.d.ts +3 -0
- package/dist/commands/storage.js +200 -0
- package/dist/commands/turnaround.d.ts +1 -0
- package/dist/commands/turnaround.js +171 -0
- package/dist/commands/types.d.ts +195 -0
- package/dist/commands/types.js +7 -0
- package/dist/commands/vary.d.ts +2 -0
- package/dist/commands/vary.js +222 -0
- package/dist/commands/write-families.d.ts +14 -0
- package/dist/commands/write-families.js +158 -0
- package/dist/compare.d.ts +87 -0
- package/dist/compare.js +306 -0
- package/dist/confirm/delegation.d.ts +30 -0
- package/dist/confirm/delegation.js +31 -0
- package/dist/confirm/index.d.ts +84 -0
- package/dist/confirm/index.js +176 -0
- package/dist/confirm/mcp.d.ts +60 -0
- package/dist/confirm/mcp.js +253 -0
- package/dist/confirm/pending.d.ts +11 -0
- package/dist/confirm/pending.js +40 -0
- package/dist/confirm/prompt.d.ts +65 -0
- package/dist/confirm/prompt.js +68 -0
- package/dist/confirm/records.d.ts +17 -0
- package/dist/confirm/records.js +63 -0
- package/dist/contact.d.ts +80 -0
- package/dist/contact.js +224 -0
- package/dist/credentials.d.ts +170 -0
- package/dist/credentials.js +598 -0
- package/dist/dataflows.d.ts +32 -0
- package/dist/dataflows.js +42 -0
- package/dist/delivery.d.ts +89 -0
- package/dist/delivery.js +355 -0
- package/dist/disclosure.d.ts +84 -0
- package/dist/disclosure.js +397 -0
- package/dist/env.d.ts +90 -0
- package/dist/env.js +236 -0
- package/dist/errors.d.ts +90 -0
- package/dist/errors.js +105 -0
- package/dist/extension/api.d.ts +389 -0
- package/dist/extension/api.js +20 -0
- package/dist/extension/context.d.ts +9 -0
- package/dist/extension/context.js +60 -0
- package/dist/extension/helpers.d.ts +75 -0
- package/dist/extension/helpers.js +107 -0
- package/dist/extension/http.d.ts +32 -0
- package/dist/extension/http.js +104 -0
- package/dist/extension/setup.d.ts +53 -0
- package/dist/extension/setup.js +162 -0
- package/dist/extension/tools.d.ts +97 -0
- package/dist/extension/tools.js +235 -0
- package/dist/extensions/core.d.ts +7 -0
- package/dist/extensions/core.js +18 -0
- package/dist/extensions/errors.d.ts +22 -0
- package/dist/extensions/errors.js +34 -0
- package/dist/extensions/registry.d.ts +119 -0
- package/dist/extensions/registry.js +535 -0
- package/dist/extensions/version.d.ts +9 -0
- package/dist/extensions/version.js +57 -0
- package/dist/formats.d.ts +46 -0
- package/dist/formats.js +81 -0
- package/dist/frames.d.ts +58 -0
- package/dist/frames.js +80 -0
- package/dist/gateway/anthropic.d.ts +22 -0
- package/dist/gateway/anthropic.js +65 -0
- package/dist/gateway/elevenlabs.d.ts +36 -0
- package/dist/gateway/elevenlabs.js +192 -0
- package/dist/gateway/failure.d.ts +29 -0
- package/dist/gateway/failure.js +70 -0
- package/dist/gateway/openai-compatible.d.ts +20 -0
- package/dist/gateway/openai-compatible.js +76 -0
- package/dist/gateway/openai.d.ts +28 -0
- package/dist/gateway/openai.js +101 -0
- package/dist/gateway/provider.d.ts +380 -0
- package/dist/gateway/provider.js +5 -0
- package/dist/gateway/scripted.d.ts +252 -0
- package/dist/gateway/scripted.js +244 -0
- package/dist/gateway/stability.d.ts +38 -0
- package/dist/gateway/stability.js +232 -0
- package/dist/gateway/structured.d.ts +31 -0
- package/dist/gateway/structured.js +83 -0
- package/dist/gateway/tripo.d.ts +48 -0
- package/dist/gateway/tripo.js +374 -0
- package/dist/gateway/vercel.d.ts +52 -0
- package/dist/gateway/vercel.js +298 -0
- package/dist/generators/generator.d.ts +236 -0
- package/dist/generators/generator.js +12 -0
- package/dist/generators/image.d.ts +21 -0
- package/dist/generators/image.js +286 -0
- package/dist/generators/spec-schema.d.ts +29 -0
- package/dist/generators/spec-schema.js +21 -0
- package/dist/git-marker.d.ts +3 -0
- package/dist/git-marker.js +13 -0
- package/dist/gitlfs.d.ts +38 -0
- package/dist/gitlfs.js +171 -0
- package/dist/guard.d.ts +55 -0
- package/dist/guard.js +323 -0
- package/dist/handoff/current-profile.d.ts +48 -0
- package/dist/handoff/current-profile.js +127 -0
- package/dist/handoff/doctor.d.ts +26 -0
- package/dist/handoff/doctor.js +249 -0
- package/dist/handoff/mark-check.d.ts +17 -0
- package/dist/handoff/mark-check.js +66 -0
- package/dist/handoff/presets/aseprite-json.d.ts +5 -0
- package/dist/handoff/presets/aseprite-json.js +45 -0
- package/dist/handoff/presets/atlas-json.d.ts +44 -0
- package/dist/handoff/presets/atlas-json.js +195 -0
- package/dist/handoff/presets/atlas-pack.d.ts +14 -0
- package/dist/handoff/presets/atlas-pack.js +431 -0
- package/dist/handoff/presets/index.d.ts +273 -0
- package/dist/handoff/presets/index.js +58 -0
- package/dist/handoff/presets/manifest.d.ts +2 -0
- package/dist/handoff/presets/manifest.js +49 -0
- package/dist/handoff/usage.d.ts +27 -0
- package/dist/handoff/usage.js +159 -0
- package/dist/handoff.d.ts +345 -0
- package/dist/handoff.js +1221 -0
- package/dist/identity-eval.d.ts +156 -0
- package/dist/identity-eval.js +321 -0
- package/dist/identity.d.ts +293 -0
- package/dist/identity.js +675 -0
- package/dist/image/apply-style.d.ts +4 -0
- package/dist/image/apply-style.js +37 -0
- package/dist/image/digits.d.ts +5 -0
- package/dist/image/digits.js +40 -0
- package/dist/image/ktx2.d.ts +83 -0
- package/dist/image/ktx2.js +196 -0
- package/dist/image/raster.d.ts +23 -0
- package/dist/image/raster.js +77 -0
- package/dist/image/resample.d.ts +10 -0
- package/dist/image/resample.js +82 -0
- package/dist/image/webp.d.ts +17 -0
- package/dist/image/webp.js +323 -0
- package/dist/init.d.ts +132 -0
- package/dist/init.js +425 -0
- package/dist/inputs.d.ts +67 -0
- package/dist/inputs.js +151 -0
- package/dist/json.d.ts +7 -0
- package/dist/json.js +27 -0
- package/dist/keys.d.ts +34 -0
- package/dist/keys.js +198 -0
- package/dist/kind-schemas.d.ts +17 -0
- package/dist/kind-schemas.js +205 -0
- package/dist/library/actions.d.ts +76 -0
- package/dist/library/actions.js +212 -0
- package/dist/library/adopt.d.ts +177 -0
- package/dist/library/adopt.js +624 -0
- package/dist/library/canonical.d.ts +7 -0
- package/dist/library/canonical.js +29 -0
- package/dist/library/card.d.ts +138 -0
- package/dist/library/card.js +532 -0
- package/dist/library/credits.d.ts +70 -0
- package/dist/library/credits.js +222 -0
- package/dist/library/describe.d.ts +48 -0
- package/dist/library/describe.js +199 -0
- package/dist/library/diff.d.ts +26 -0
- package/dist/library/diff.js +208 -0
- package/dist/library/exact.d.ts +15 -0
- package/dist/library/exact.js +47 -0
- package/dist/library/extent.d.ts +56 -0
- package/dist/library/extent.js +205 -0
- package/dist/library/folder.d.ts +85 -0
- package/dist/library/folder.js +291 -0
- package/dist/library/labels.d.ts +29 -0
- package/dist/library/labels.js +112 -0
- package/dist/library/lfs.d.ts +42 -0
- package/dist/library/lfs.js +140 -0
- package/dist/library/maintain.d.ts +100 -0
- package/dist/library/maintain.js +750 -0
- package/dist/library/media-metadata.d.ts +19 -0
- package/dist/library/media-metadata.js +92 -0
- package/dist/library/paths.d.ts +7 -0
- package/dist/library/paths.js +65 -0
- package/dist/library/relations.d.ts +59 -0
- package/dist/library/relations.js +176 -0
- package/dist/library/review.d.ts +204 -0
- package/dist/library/review.js +545 -0
- package/dist/library/stale.d.ts +88 -0
- package/dist/library/stale.js +229 -0
- package/dist/library/suggestions.d.ts +37 -0
- package/dist/library/suggestions.js +146 -0
- package/dist/library/summary.d.ts +65 -0
- package/dist/library/summary.js +138 -0
- package/dist/library/undo.d.ts +18 -0
- package/dist/library/undo.js +141 -0
- package/dist/library/worklist.d.ts +42 -0
- package/dist/library/worklist.js +91 -0
- package/dist/library/write.d.ts +282 -0
- package/dist/library/write.js +790 -0
- package/dist/license.d.ts +67 -0
- package/dist/license.js +205 -0
- package/dist/limits.d.ts +51 -0
- package/dist/limits.js +100 -0
- package/dist/loop.d.ts +244 -0
- package/dist/loop.js +377 -0
- package/dist/material/core.d.ts +70 -0
- package/dist/material/core.js +238 -0
- package/dist/material/engine.d.ts +15 -0
- package/dist/material/engine.js +141 -0
- package/dist/material/flicker.d.ts +26 -0
- package/dist/material/flicker.js +71 -0
- package/dist/material/operations.d.ts +2 -0
- package/dist/material/operations.js +48 -0
- package/dist/material/pipeline.d.ts +51 -0
- package/dist/material/pipeline.js +431 -0
- package/dist/material/profile.d.ts +29 -0
- package/dist/material/profile.js +97 -0
- package/dist/material/rendition.d.ts +5 -0
- package/dist/material/rendition.js +76 -0
- package/dist/mcp.d.ts +72 -0
- package/dist/mcp.js +514 -0
- package/dist/media.d.ts +36 -0
- package/dist/media.js +46 -0
- package/dist/metadata.d.ts +61 -0
- package/dist/metadata.js +748 -0
- package/dist/model-declarations.d.ts +28 -0
- package/dist/model-declarations.js +14 -0
- package/dist/model3d/clip-map.d.ts +49 -0
- package/dist/model3d/clip-map.js +129 -0
- package/dist/model3d/core-checks.d.ts +61 -0
- package/dist/model3d/core-checks.js +278 -0
- package/dist/model3d/facing.d.ts +49 -0
- package/dist/model3d/facing.js +125 -0
- package/dist/model3d/generator.d.ts +19 -0
- package/dist/model3d/generator.js +482 -0
- package/dist/model3d/glb.d.ts +120 -0
- package/dist/model3d/glb.js +155 -0
- package/dist/model3d/handoff.d.ts +37 -0
- package/dist/model3d/handoff.js +131 -0
- package/dist/model3d/lod/chain.d.ts +50 -0
- package/dist/model3d/lod/chain.js +447 -0
- package/dist/model3d/lod/command.d.ts +38 -0
- package/dist/model3d/lod/command.js +377 -0
- package/dist/model3d/lod/qa.d.ts +36 -0
- package/dist/model3d/lod/qa.js +189 -0
- package/dist/model3d/lod/settings.d.ts +36 -0
- package/dist/model3d/lod/settings.js +137 -0
- package/dist/model3d/lod/simplify.d.ts +35 -0
- package/dist/model3d/lod/simplify.js +337 -0
- package/dist/model3d/lod/textures.d.ts +46 -0
- package/dist/model3d/lod/textures.js +190 -0
- package/dist/model3d/lookdev/command.d.ts +219 -0
- package/dist/model3d/lookdev/command.js +1795 -0
- package/dist/model3d/lookdev/edit.d.ts +44 -0
- package/dist/model3d/lookdev/edit.js +241 -0
- package/dist/model3d/lookdev/groom.d.ts +86 -0
- package/dist/model3d/lookdev/groom.js +462 -0
- package/dist/model3d/lookdev/markings.d.ts +98 -0
- package/dist/model3d/lookdev/markings.js +319 -0
- package/dist/model3d/lookdev/project.d.ts +100 -0
- package/dist/model3d/lookdev/project.js +721 -0
- package/dist/model3d/lookdev/settings.d.ts +65 -0
- package/dist/model3d/lookdev/settings.js +103 -0
- package/dist/model3d/lookdev/texels.d.ts +32 -0
- package/dist/model3d/lookdev/texels.js +192 -0
- package/dist/model3d/profile.d.ts +101 -0
- package/dist/model3d/profile.js +132 -0
- package/dist/model3d/prop.d.ts +29 -0
- package/dist/model3d/prop.js +317 -0
- package/dist/model3d/qa.d.ts +27 -0
- package/dist/model3d/qa.js +105 -0
- package/dist/model3d/render.d.ts +172 -0
- package/dist/model3d/render.js +791 -0
- package/dist/model3d/rig/build.d.ts +14 -0
- package/dist/model3d/rig/build.js +210 -0
- package/dist/model3d/rig/candidate.d.ts +50 -0
- package/dist/model3d/rig/candidate.js +132 -0
- package/dist/model3d/rig/command.d.ts +50 -0
- package/dist/model3d/rig/command.js +229 -0
- package/dist/model3d/rig/fit.d.ts +88 -0
- package/dist/model3d/rig/fit.js +568 -0
- package/dist/model3d/rig/gait.d.ts +105 -0
- package/dist/model3d/rig/gait.js +334 -0
- package/dist/model3d/rig/math.d.ts +27 -0
- package/dist/model3d/rig/math.js +92 -0
- package/dist/model3d/rig/motion.d.ts +26 -0
- package/dist/model3d/rig/motion.js +223 -0
- package/dist/model3d/rig/qa.d.ts +76 -0
- package/dist/model3d/rig/qa.js +357 -0
- package/dist/model3d/rig/rig.d.ts +55 -0
- package/dist/model3d/rig/rig.js +213 -0
- package/dist/model3d/rig/template.d.ts +195 -0
- package/dist/model3d/rig/template.js +456 -0
- package/dist/model3d/scene.d.ts +115 -0
- package/dist/model3d/scene.js +684 -0
- package/dist/model3d/views.d.ts +77 -0
- package/dist/model3d/views.js +190 -0
- package/dist/origin.d.ts +162 -0
- package/dist/origin.js +134 -0
- package/dist/paths.d.ts +53 -0
- package/dist/paths.js +240 -0
- package/dist/planning.d.ts +261 -0
- package/dist/planning.js +1470 -0
- package/dist/policy/blocklist.d.ts +28 -0
- package/dist/policy/blocklist.js +58 -0
- package/dist/policy/brief.d.ts +67 -0
- package/dist/policy/brief.js +110 -0
- package/dist/policy/cuts.d.ts +26 -0
- package/dist/policy/cuts.js +80 -0
- package/dist/policy/model.d.ts +69 -0
- package/dist/policy/model.js +202 -0
- package/dist/policy/text.d.ts +183 -0
- package/dist/policy/text.js +285 -0
- package/dist/postprocess.d.ts +68 -0
- package/dist/postprocess.js +302 -0
- package/dist/profile.d.ts +5 -0
- package/dist/profile.js +98 -0
- package/dist/project-rules.d.ts +54 -0
- package/dist/project-rules.js +105 -0
- package/dist/provenance-binding.d.ts +55 -0
- package/dist/provenance-binding.js +352 -0
- package/dist/providers/adapter.d.ts +176 -0
- package/dist/providers/adapter.js +418 -0
- package/dist/providers/index.d.ts +33 -0
- package/dist/providers/index.js +49 -0
- package/dist/providers/script.d.ts +13 -0
- package/dist/providers/script.js +65 -0
- package/dist/providers/set.d.ts +76 -0
- package/dist/providers/set.js +134 -0
- package/dist/pure-cbor.d.ts +1 -0
- package/dist/pure-cbor.js +8 -0
- package/dist/qa/stability.d.ts +215 -0
- package/dist/qa/stability.js +393 -0
- package/dist/qa/stability.json +32 -0
- package/dist/qa.d.ts +36 -0
- package/dist/qa.js +148 -0
- package/dist/reconcile.d.ts +111 -0
- package/dist/reconcile.js +416 -0
- package/dist/redact.d.ts +29 -0
- package/dist/redact.js +74 -0
- package/dist/regions.d.ts +49 -0
- package/dist/regions.js +113 -0
- package/dist/release-policy.d.ts +99 -0
- package/dist/release-policy.js +266 -0
- package/dist/request.d.ts +74 -0
- package/dist/request.js +249 -0
- package/dist/routes.d.ts +327 -0
- package/dist/routes.js +1166 -0
- package/dist/runs/dir.d.ts +33 -0
- package/dist/runs/dir.js +30 -0
- package/dist/runs/execute.d.ts +86 -0
- package/dist/runs/execute.js +422 -0
- package/dist/runs/journal.d.ts +150 -0
- package/dist/runs/journal.js +216 -0
- package/dist/runs/lock.d.ts +57 -0
- package/dist/runs/lock.js +322 -0
- package/dist/runs/plan.d.ts +261 -0
- package/dist/runs/plan.js +404 -0
- package/dist/search/near-match.d.ts +32 -0
- package/dist/search/near-match.js +86 -0
- package/dist/search/reader.d.ts +17 -0
- package/dist/search/reader.js +334 -0
- package/dist/search/sheet.d.ts +4 -0
- package/dist/search/sheet.js +28 -0
- package/dist/search/style-outliers.d.ts +77 -0
- package/dist/search/style-outliers.js +166 -0
- package/dist/settings-write.d.ts +78 -0
- package/dist/settings-write.js +374 -0
- package/dist/settings.d.ts +436 -0
- package/dist/settings.js +622 -0
- package/dist/shared-settings.d.ts +4 -0
- package/dist/shared-settings.js +24 -0
- package/dist/sheet/blobs.d.ts +33 -0
- package/dist/sheet/blobs.js +145 -0
- package/dist/sheet/generate.d.ts +71 -0
- package/dist/sheet/generate.js +278 -0
- package/dist/sheet/group.d.ts +20 -0
- package/dist/sheet/group.js +191 -0
- package/dist/sheet/import.d.ts +315 -0
- package/dist/sheet/import.js +832 -0
- package/dist/sheet/matte.d.ts +25 -0
- package/dist/sheet/matte.js +508 -0
- package/dist/sheet/media-import.d.ts +41 -0
- package/dist/sheet/media-import.js +118 -0
- package/dist/sheet/register.d.ts +17 -0
- package/dist/sheet/register.js +176 -0
- package/dist/sheet/slice.d.ts +73 -0
- package/dist/sheet/slice.js +912 -0
- package/dist/sheet/types.d.ts +225 -0
- package/dist/sheet/types.js +1 -0
- package/dist/source/aseprite.d.ts +14 -0
- package/dist/source/aseprite.js +124 -0
- package/dist/source/stage.d.ts +24 -0
- package/dist/source/stage.js +172 -0
- package/dist/spend.d.ts +220 -0
- package/dist/spend.js +436 -0
- package/dist/sprite/render.d.ts +22 -0
- package/dist/sprite/render.js +272 -0
- package/dist/storage.d.ts +135 -0
- package/dist/storage.js +405 -0
- package/dist/style.d.ts +19 -0
- package/dist/style.js +26 -0
- package/dist/template.d.ts +29 -0
- package/dist/template.js +98 -0
- package/dist/testing/aseprite.d.ts +54 -0
- package/dist/testing/aseprite.js +191 -0
- package/dist/testing/cli.d.ts +24 -0
- package/dist/testing/cli.js +91 -0
- package/dist/testing/conformance.d.ts +61 -0
- package/dist/testing/conformance.js +455 -0
- package/dist/testing/index.d.ts +23 -0
- package/dist/testing/index.js +15 -0
- package/dist/testing/mcp.d.ts +25 -0
- package/dist/testing/mcp.js +80 -0
- package/dist/testing/project.d.ts +81 -0
- package/dist/testing/project.js +215 -0
- package/dist/testing/samples.d.ts +42 -0
- package/dist/testing/samples.js +122 -0
- package/dist/transform/operations.d.ts +5 -0
- package/dist/transform/operations.js +320 -0
- package/dist/transform/raster-engine.d.ts +9 -0
- package/dist/transform/raster-engine.js +329 -0
- package/dist/transform/rendition.d.ts +65 -0
- package/dist/transform/rendition.js +317 -0
- package/dist/transform/run.d.ts +138 -0
- package/dist/transform/run.js +442 -0
- package/dist/transform/schema.d.ts +33 -0
- package/dist/transform/schema.js +73 -0
- package/dist/transform/types.d.ts +101 -0
- package/dist/transform/types.js +1 -0
- package/dist/tree/address.d.ts +18 -0
- package/dist/tree/address.js +59 -0
- package/dist/tree/list.d.ts +18 -0
- package/dist/tree/list.js +101 -0
- package/dist/tree/project.d.ts +61 -0
- package/dist/tree/project.js +145 -0
- package/dist/tree/read.d.ts +43 -0
- package/dist/tree/read.js +715 -0
- package/dist/tree/search.d.ts +20 -0
- package/dist/tree/search.js +44 -0
- package/dist/tree/serve.d.ts +79 -0
- package/dist/tree/serve.js +415 -0
- package/dist/tree/thumbs.d.ts +26 -0
- package/dist/tree/thumbs.js +134 -0
- package/dist/turnaround.d.ts +195 -0
- package/dist/turnaround.js +622 -0
- package/dist/types.d.ts +595 -0
- package/dist/types.js +1 -0
- package/package.json +112 -3
- package/policy/blocklist.json +47 -0
- package/policy/prompt-policy-cuts.json +15 -0
- package/skills/art-direction/SKILL.md +16 -0
- package/skills/art-direction/default.md +14 -0
- package/skills/art-direction/presets/cozy-storybook.md +121 -0
- package/skills/art-direction/presets/dark-gritty-isometric.md +121 -0
- package/skills/art-direction/presets/flat-cartoon-kids.md +121 -0
- package/skills/art-direction/references/bible-format.md +47 -0
- package/skills/assetgrove/SKILL.md +109 -0
- package/skills/assetgrove/references/commands.md +723 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import type { Env } from "../env.ts";
|
|
2
|
+
import type { ErrorCode } from "../errors.ts";
|
|
3
|
+
import type { Confirmation } from "../approvals.ts";
|
|
4
|
+
import type { ConfirmPort } from "../confirm/prompt.ts";
|
|
5
|
+
import type { ExtensionRegistry } from "../extensions/registry.ts";
|
|
6
|
+
import type { Settings } from "../settings.ts";
|
|
7
|
+
import type { PromptPolicyRecord } from "../policy/text.ts";
|
|
8
|
+
import type { TermsProblem } from "../origin.ts";
|
|
9
|
+
import type { WorkPlan } from "../runs/plan.ts";
|
|
10
|
+
export type { PlanJob, WorkPlan } from "../runs/plan.ts";
|
|
11
|
+
/** What running a command can do: whether it only reads, whether it spends, and where it writes. */
|
|
12
|
+
export interface Effect {
|
|
13
|
+
readOnly: boolean;
|
|
14
|
+
spends: "never" | "always" | "conditional";
|
|
15
|
+
writes: "none" | "runs" | "out" | "target" | "settings" | "state";
|
|
16
|
+
}
|
|
17
|
+
/** A JSON Schema for one property of a command's input. */
|
|
18
|
+
export interface JsonSchemaProperty {
|
|
19
|
+
type: "string" | "number" | "integer" | "boolean" | "array" | "object";
|
|
20
|
+
description: string;
|
|
21
|
+
/** A list's items: strings, or (for a tool-only list) objects of their own schema. */
|
|
22
|
+
items?: {
|
|
23
|
+
type: "string";
|
|
24
|
+
} | {
|
|
25
|
+
type: "object";
|
|
26
|
+
properties: Record<string, {
|
|
27
|
+
type: "string";
|
|
28
|
+
description: string;
|
|
29
|
+
}>;
|
|
30
|
+
required?: string[];
|
|
31
|
+
additionalProperties: false;
|
|
32
|
+
};
|
|
33
|
+
/** The value the command uses when the option is absent; shown in help, applied by the command. */
|
|
34
|
+
default?: string | number | boolean;
|
|
35
|
+
minimum?: number;
|
|
36
|
+
/** How help shows the value, for example `<spec.json>`; defaults to `<name>`. */
|
|
37
|
+
placeholder?: string;
|
|
38
|
+
/** True when only the CLI takes the option: the command's tool leaves it out of its schema. */
|
|
39
|
+
cliOnly?: true;
|
|
40
|
+
/** True when only the tool takes the option: the command line has no flag for it. */
|
|
41
|
+
toolOnly?: true;
|
|
42
|
+
}
|
|
43
|
+
/** A command's input: an object schema whose properties are its options and positionals. */
|
|
44
|
+
export interface JsonSchemaObject {
|
|
45
|
+
type: "object";
|
|
46
|
+
properties: Record<string, JsonSchemaProperty>;
|
|
47
|
+
required?: string[];
|
|
48
|
+
additionalProperties: false;
|
|
49
|
+
}
|
|
50
|
+
/** What a run of a command is given besides its arguments. */
|
|
51
|
+
export interface RunContext {
|
|
52
|
+
/** The developer settings, loaded for each CLI command and MCP tool call (src/commands/context.ts). */
|
|
53
|
+
settings: Settings;
|
|
54
|
+
/**
|
|
55
|
+
* Core and the extensions the settings list, loaded with the settings (src/extensions/registry.ts);
|
|
56
|
+
* core alone when absent.
|
|
57
|
+
*/
|
|
58
|
+
extensions?: ExtensionRegistry;
|
|
59
|
+
/** Receives log lines; the CLI sends them to stderr. */
|
|
60
|
+
log: (message: string) => void;
|
|
61
|
+
/** The environment the refusal rule reads; the process environment when absent. */
|
|
62
|
+
env?: Env;
|
|
63
|
+
/** The MCP server's --provider-script, given to each tool call of a command that takes one. */
|
|
64
|
+
providerScript?: string;
|
|
65
|
+
/** The MCP server's --work-item, given to each tool call that names no work item. */
|
|
66
|
+
workItem?: string;
|
|
67
|
+
/** A channel to ask a person (the CLI's inline TTY prompt); absent when no one can be asked. */
|
|
68
|
+
prompt?: ConfirmPort;
|
|
69
|
+
/** The MCP client's name on a tool call, which a delegated confirmation names; absent on the CLI. */
|
|
70
|
+
client?: string;
|
|
71
|
+
/**
|
|
72
|
+
* The run of a paid command's real run: its directory `<runs>/r-<16 hex>/`, where the runner has
|
|
73
|
+
* written `request.json`, and the WorkPlan its plan step returned. `promptPolicy` is the record
|
|
74
|
+
* after the run's prompt-policy check (with `fallback` when the command must use its template's
|
|
75
|
+
* prompt in place of the compiler's).
|
|
76
|
+
*/
|
|
77
|
+
run?: {
|
|
78
|
+
dir: string;
|
|
79
|
+
plan: WorkPlan;
|
|
80
|
+
promptPolicy?: PromptPolicyRecord;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Where a paid run reports its progress while a client is connected (the MCP server's
|
|
84
|
+
* `notifications/progress` for a request that carries a progressToken).
|
|
85
|
+
*/
|
|
86
|
+
progress?: (update: {
|
|
87
|
+
progress: number;
|
|
88
|
+
total: number;
|
|
89
|
+
message: string;
|
|
90
|
+
}) => void;
|
|
91
|
+
}
|
|
92
|
+
/** A refusal's code and message; a spend-limit refusal also names the limit and its numbers. */
|
|
93
|
+
export interface Failure {
|
|
94
|
+
code: ErrorCode;
|
|
95
|
+
message: string;
|
|
96
|
+
/** For `format_unsupported`: why the format line was refused (`missing`, `too_new`, `unknown`). */
|
|
97
|
+
reason?: string;
|
|
98
|
+
/** For exit 8: what a person must confirm, and how (design section 7). */
|
|
99
|
+
confirmation?: Confirmation;
|
|
100
|
+
/** For `handoff_check_failed` (preset, problem) and `library_check_failed` (file, code): each problem a hand-off preset's check found (design section 14). */
|
|
101
|
+
problems?: Array<{
|
|
102
|
+
preset?: string;
|
|
103
|
+
problem?: string;
|
|
104
|
+
file?: string;
|
|
105
|
+
code?: string;
|
|
106
|
+
}>;
|
|
107
|
+
/**
|
|
108
|
+
* For `invalid_input` from a template value that is undefined and not optional: the template
|
|
109
|
+
* (for example `manifest` or `layout.media`), the field and, for a whole value, its `?` form.
|
|
110
|
+
*/
|
|
111
|
+
template?: {
|
|
112
|
+
name: string;
|
|
113
|
+
field: string;
|
|
114
|
+
optional?: string;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* For `license_refused` by a third-party origin's terms: each permission they do not give, its
|
|
118
|
+
* answer and its outcome (`forbidden`, `unstated-no`, or `question`: the developer must record
|
|
119
|
+
* yes or no).
|
|
120
|
+
*/
|
|
121
|
+
terms?: Array<Omit<TermsProblem, "reason">>;
|
|
122
|
+
/** For `prompt_refused`: the policy check that refused the prompt. */
|
|
123
|
+
policy?: PromptPolicyRecord;
|
|
124
|
+
limit?: {
|
|
125
|
+
name: string;
|
|
126
|
+
workItem?: string;
|
|
127
|
+
limitUsd: number;
|
|
128
|
+
spentUsd: number;
|
|
129
|
+
requestedUsd: number;
|
|
130
|
+
ledger: string;
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
/** What a command produced: the JSON fields, the human summary and an optional refusal. */
|
|
134
|
+
export interface Outcome {
|
|
135
|
+
exitCode: number;
|
|
136
|
+
fields: Record<string, unknown>;
|
|
137
|
+
human: string;
|
|
138
|
+
error?: Failure;
|
|
139
|
+
/** The command that answered, when not the one that ran: estimate answers as the paid command. */
|
|
140
|
+
command?: string;
|
|
141
|
+
}
|
|
142
|
+
/** One command, declared once: its input schema and effect, and how it runs. */
|
|
143
|
+
export interface CommandSpec<A = Record<string, unknown>> {
|
|
144
|
+
name: string;
|
|
145
|
+
/** The MCP tool that serves this command, or null when no tool does. */
|
|
146
|
+
tool: string | null;
|
|
147
|
+
summary: string;
|
|
148
|
+
details: string;
|
|
149
|
+
input: JsonSchemaObject;
|
|
150
|
+
positionals?: {
|
|
151
|
+
name: string;
|
|
152
|
+
variadic?: boolean;
|
|
153
|
+
}[];
|
|
154
|
+
effect: Effect;
|
|
155
|
+
confirm?: "spend" | "pick" | "write" | "settings";
|
|
156
|
+
/**
|
|
157
|
+
* The extension slot the command needs (design section 7.1): while it is empty, help and the
|
|
158
|
+
* tool list leave the command out and a call exits 2 `extension_unavailable`.
|
|
159
|
+
*/
|
|
160
|
+
requires?: "search";
|
|
161
|
+
/** False when the command prints no JSON document (it takes no --json). Defaults to true. */
|
|
162
|
+
json?: false;
|
|
163
|
+
/** The free plan step of a paid command: no provider call, no ledger entry (design section 6). */
|
|
164
|
+
plan?(args: A, ctx: RunContext): Promise<WorkPlan>;
|
|
165
|
+
/**
|
|
166
|
+
* Whether this call takes the plan step and runs through the executor; always when absent. A
|
|
167
|
+
* command that pays only in some calls (find and search index with a hosted embedder) runs the
|
|
168
|
+
* others directly, with no run directory.
|
|
169
|
+
*/
|
|
170
|
+
planned?(args: A, ctx: RunContext): boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Whether the command can spend under these settings; always when absent. Find and search index
|
|
173
|
+
* spend only with a hosted embedder: with the local model they take neither the tracked-key
|
|
174
|
+
* guard nor the paid tool annotations.
|
|
175
|
+
*/
|
|
176
|
+
spendsWith?(ctx: RunContext): boolean;
|
|
177
|
+
/**
|
|
178
|
+
* False when a finished run of the same digest runs again (in its run directory, the journal
|
|
179
|
+
* answering every call it holds) instead of being returned as it ended. Search's index is a
|
|
180
|
+
* projection that can be deleted or changed, so its finished runs are not replayed.
|
|
181
|
+
*/
|
|
182
|
+
replayFinished?: false;
|
|
183
|
+
/**
|
|
184
|
+
* An earlier request's confirmation that covers this one (design section 7: apply uses its
|
|
185
|
+
* plan's record while every input hash matches and its forecast is at or under the confirmed
|
|
186
|
+
* one); undefined when none does, and this request asks under its own digest.
|
|
187
|
+
*/
|
|
188
|
+
priorConfirmation?(args: A, ctx: RunContext, plan: WorkPlan): Promise<import("../types.ts").ConfirmationRecord | undefined>;
|
|
189
|
+
run(args: A, ctx: RunContext): Promise<Outcome>;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Declares a command with its typed arguments; the registry holds every command at one type. The
|
|
193
|
+
* runner validates the arguments against `input` before `run` sees them.
|
|
194
|
+
*/
|
|
195
|
+
export declare function defineCommand<A>(spec: CommandSpec<A>): CommandSpec;
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { bindProvenance } from "../provenance-binding.js";
|
|
3
|
+
import { writeFile } from "node:fs/promises";
|
|
4
|
+
import { basename, join, resolve } from "node:path";
|
|
5
|
+
import { Budget, runCapParts } from "../budget.js";
|
|
6
|
+
import { Caller } from "../calls.js";
|
|
7
|
+
import { compareRasters, comparisonFields, writeCompareSheet } from "../compare.js";
|
|
8
|
+
import { writeContactRows } from "../contact.js";
|
|
9
|
+
import { InputError } from "../errors.js";
|
|
10
|
+
import { decodeImage } from "../image/raster.js";
|
|
11
|
+
import { CORE_REGISTRY } from "../extensions/registry.js";
|
|
12
|
+
import { framesOf } from "../frames.js";
|
|
13
|
+
import { mediaOf } from "../media.js";
|
|
14
|
+
import { DIGITAL_SOURCE_TYPES, embedDigitalSourceType } from "../metadata.js";
|
|
15
|
+
import { readRun } from "../loop.js";
|
|
16
|
+
import { providerSet, spendLedger } from "../providers/index.js";
|
|
17
|
+
import { loadReference, sha256 } from "../request.js";
|
|
18
|
+
import { ledgerFor } from "../spend.js";
|
|
19
|
+
import { DRY_RUN_PROPERTY, ROUND_PROPERTY, RUNS_PROPERTY, buildWorkPlan, jobOf, paidBy, } from "../runs/plan.js";
|
|
20
|
+
import { dryRunOutcome, formatWork, refusal } from "./result.js";
|
|
21
|
+
import { defineCommand } from "./types.js";
|
|
22
|
+
export const DEFAULT_VARIATIONS = 4;
|
|
23
|
+
/** The file extension a media type names: its subtype, so no format list lives here. */
|
|
24
|
+
function extensionOf(mediaType) {
|
|
25
|
+
const subtype = (mediaType.split("/")[1] ?? "").split(/[+;]/)[0] ?? "";
|
|
26
|
+
const clean = subtype.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
27
|
+
return clean === "jpeg" ? "jpg" : clean || "bin";
|
|
28
|
+
}
|
|
29
|
+
/** The source run's record and the candidate to vary; refused unless it is an image. */
|
|
30
|
+
async function source(args, ctx) {
|
|
31
|
+
const run = await readRun(resolve(args.run)).catch((error) => {
|
|
32
|
+
throw new InputError(`cannot read the run ${args.run}: it needs a run.json from stage`, {
|
|
33
|
+
cause: error,
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
const candidate = (run.candidates ?? []).find((c) => c.id === args.candidate);
|
|
37
|
+
if (candidate === undefined)
|
|
38
|
+
throw new InputError(`run ${args.run} has no candidate "${args.candidate}"`);
|
|
39
|
+
const kinds = ctx.extensions ?? CORE_REGISTRY;
|
|
40
|
+
const media = mediaOf(run.spec.kind, kinds);
|
|
41
|
+
if (media !== undefined && media !== "image")
|
|
42
|
+
throw new InputError(`candidate ${candidate.id} is a ${run.spec.kind} candidate, ${media === "audio" ? "an" : "a"} ${media} kind; vary edits images`);
|
|
43
|
+
if (!candidate.mediaType.startsWith("image/"))
|
|
44
|
+
throw new InputError(`candidate ${candidate.id} is ${candidate.mediaType}; vary edits images`);
|
|
45
|
+
if (framesOf(run.spec.kind, kinds) !== "single")
|
|
46
|
+
throw new InputError(`candidate ${candidate.id} is a ${run.spec.kind} candidate; vary edits still candidates`);
|
|
47
|
+
return { run, candidate };
|
|
48
|
+
}
|
|
49
|
+
/** The plan step: the source candidate, the edit calls and the WorkPlan, with no call made. */
|
|
50
|
+
async function prepare(args, ctx) {
|
|
51
|
+
const count = args.count ?? DEFAULT_VARIATIONS;
|
|
52
|
+
if (!Number.isInteger(count) || count < 1)
|
|
53
|
+
throw new InputError(`invalid count: ${count}`);
|
|
54
|
+
const { run, candidate } = await source(args, ctx);
|
|
55
|
+
const providers = await providerSet(args.providerScript, ctx);
|
|
56
|
+
const route = providers.routes["edit"];
|
|
57
|
+
if (!route)
|
|
58
|
+
throw new InputError('no model route for operation "edit"');
|
|
59
|
+
const { capUsd, capSource } = runCapParts(args.cap, ctx.settings);
|
|
60
|
+
const jobs = [jobOf("edit", route, count)];
|
|
61
|
+
const file = join(resolve(args.run), candidate.file);
|
|
62
|
+
const work = await buildWorkPlan(varyCommand, args, {
|
|
63
|
+
promptAllow: ctx.settings.promptPolicy.allow,
|
|
64
|
+
inputs: [],
|
|
65
|
+
reads: { candidate: file },
|
|
66
|
+
jobs,
|
|
67
|
+
capUsd,
|
|
68
|
+
capSource,
|
|
69
|
+
paid: paidBy(providers, jobs),
|
|
70
|
+
providers,
|
|
71
|
+
candidates: count,
|
|
72
|
+
});
|
|
73
|
+
return { count, run, candidate, file, providers, capUsd, jobs, work };
|
|
74
|
+
}
|
|
75
|
+
export const varyCommand = defineCommand({
|
|
76
|
+
name: "vary",
|
|
77
|
+
tool: "vary",
|
|
78
|
+
summary: "make variations of one staged candidate through the edit route",
|
|
79
|
+
details: `Makes --count (default ${DEFAULT_VARIATIONS}) variations of one still candidate of a staged run, each one
|
|
80
|
+
reference-guided edit of the candidate with a fresh seed, within the cost cap in USD. Writes
|
|
81
|
+
v<n>.<ext> and its provenance, contact.png and compare.png (each variation against the candidate,
|
|
82
|
+
numbers only) to the run directory, and reports each variation's outsideChange. The request
|
|
83
|
+
asks for spend once; the same request again returns the finished run (reused true) with no
|
|
84
|
+
provider call. Variations are not QA-filtered and are never marked approved.
|
|
85
|
+
--dry-run prints the planned calls and the forecast, and needs no key.`,
|
|
86
|
+
input: {
|
|
87
|
+
type: "object",
|
|
88
|
+
properties: {
|
|
89
|
+
run: { type: "string", description: "the staged run directory", placeholder: "<run>" },
|
|
90
|
+
candidate: { type: "string", description: "the candidate id to vary", placeholder: "<id>" },
|
|
91
|
+
count: {
|
|
92
|
+
type: "integer",
|
|
93
|
+
minimum: 1,
|
|
94
|
+
description: "how many variations to make",
|
|
95
|
+
default: DEFAULT_VARIATIONS,
|
|
96
|
+
},
|
|
97
|
+
cap: {
|
|
98
|
+
type: "number",
|
|
99
|
+
description: "the run's cost cap in USD; at most, and by default, the settings' caps.runUsd",
|
|
100
|
+
placeholder: "<usd>",
|
|
101
|
+
},
|
|
102
|
+
workItem: {
|
|
103
|
+
type: "string",
|
|
104
|
+
description: "the work item the spend ledger counts against",
|
|
105
|
+
placeholder: "<label>",
|
|
106
|
+
},
|
|
107
|
+
providerScript: {
|
|
108
|
+
type: "string",
|
|
109
|
+
description: "answer every model call from this module instead of a provider",
|
|
110
|
+
placeholder: "<module>",
|
|
111
|
+
},
|
|
112
|
+
runs: RUNS_PROPERTY,
|
|
113
|
+
round: ROUND_PROPERTY,
|
|
114
|
+
dryRun: DRY_RUN_PROPERTY,
|
|
115
|
+
},
|
|
116
|
+
required: ["run", "candidate"],
|
|
117
|
+
additionalProperties: false,
|
|
118
|
+
},
|
|
119
|
+
effect: { readOnly: false, spends: "always", writes: "runs" },
|
|
120
|
+
confirm: "spend",
|
|
121
|
+
plan: async (args, ctx) => (await prepare(args, ctx)).work,
|
|
122
|
+
async run(args, ctx) {
|
|
123
|
+
const { count, run, candidate, file, providers, capUsd, work } = await prepare(args, ctx);
|
|
124
|
+
const ledger = spendLedger(ctx, args.workItem);
|
|
125
|
+
if (args.dryRun)
|
|
126
|
+
return dryRunOutcome(work, formatWork("vary", work), ledger);
|
|
127
|
+
const dir = ctx.run?.dir ?? work.runDir;
|
|
128
|
+
const reference = await loadReference(file, `candidate ${candidate.id}`, ".");
|
|
129
|
+
const before = decodeImage(reference.bytes);
|
|
130
|
+
const budget = new Budget(capUsd, ledgerFor(ledger, providers, run.profile));
|
|
131
|
+
const prompt = [
|
|
132
|
+
"Reference image 1 is the approved candidate.",
|
|
133
|
+
"Draw a variation of it: keep the subject, identity, design, palette, style, framing and scale; change only incidental detail.",
|
|
134
|
+
"No text.",
|
|
135
|
+
].join("\n");
|
|
136
|
+
const sourceType = (candidate.provenance.digitalSourceType ??
|
|
137
|
+
DIGITAL_SOURCE_TYPES.generated);
|
|
138
|
+
const rows = [];
|
|
139
|
+
const variations = [];
|
|
140
|
+
const shown = [];
|
|
141
|
+
const errors = [];
|
|
142
|
+
for (let index = 0; index < count; index++) {
|
|
143
|
+
const caller = new Caller({
|
|
144
|
+
provider: providers,
|
|
145
|
+
budget,
|
|
146
|
+
routes: providers.routes,
|
|
147
|
+
index,
|
|
148
|
+
log: ctx.log,
|
|
149
|
+
});
|
|
150
|
+
const seed = Number.parseInt(createHash("sha256")
|
|
151
|
+
.update(`${basename(dir)}:${candidate.id}:${index}`)
|
|
152
|
+
.digest("hex")
|
|
153
|
+
.slice(0, 8), 16);
|
|
154
|
+
try {
|
|
155
|
+
const image = await caller.image("edit", prompt, [reference], seed);
|
|
156
|
+
const decoded = decodeImage(image.bytes);
|
|
157
|
+
const extension = extensionOf(image.mediaType);
|
|
158
|
+
const name = `v${index + 1}`;
|
|
159
|
+
const bytes = embedDigitalSourceType(image.bytes, image.mediaType, sourceType);
|
|
160
|
+
await writeFile(join(dir, `${name}.${extension}`), bytes);
|
|
161
|
+
const calls = caller.records;
|
|
162
|
+
const provenance = {
|
|
163
|
+
...candidate.provenance,
|
|
164
|
+
route: calls.map((c) => c.route).join(" + "),
|
|
165
|
+
models: [...new Set(calls.map((c) => c.model))],
|
|
166
|
+
prompt,
|
|
167
|
+
parameters: {
|
|
168
|
+
variationOf: {
|
|
169
|
+
run: basename(resolve(args.run)),
|
|
170
|
+
candidate: candidate.id,
|
|
171
|
+
sha256: candidate.sha256,
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
seed,
|
|
175
|
+
requestIds: calls.map((c) => c.requestId),
|
|
176
|
+
referenceHashes: [reference.sha256],
|
|
177
|
+
startedAt: calls[0]?.startedAt ?? "",
|
|
178
|
+
finishedAt: calls[calls.length - 1]?.finishedAt ?? "",
|
|
179
|
+
costUsd: calls.reduce((sum, c) => sum + c.costUsd, 0),
|
|
180
|
+
calls,
|
|
181
|
+
digitalSourceType: sourceType,
|
|
182
|
+
};
|
|
183
|
+
delete provenance.steps;
|
|
184
|
+
await writeFile(join(dir, `${name}.provenance.json`), `${JSON.stringify(bindProvenance(provenance, bytes), null, 2)}\n`);
|
|
185
|
+
const comparison = await compareRasters(before, decoded);
|
|
186
|
+
rows.push({ number: index + 1, comparison });
|
|
187
|
+
shown.push({ number: index + 1, image: decoded });
|
|
188
|
+
variations.push({
|
|
189
|
+
id: name,
|
|
190
|
+
file: `${name}.${extension}`,
|
|
191
|
+
sha256: sha256(bytes),
|
|
192
|
+
...comparisonFields(comparison),
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
catch (error) {
|
|
196
|
+
errors.push(`variation ${index + 1}: ${error instanceof Error ? error.message : String(error)}`);
|
|
197
|
+
if (budget.spentUsd >= capUsd)
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const spentUsd = budget.spentUsd;
|
|
202
|
+
const contact = await writeContactRows(dir, shown.map(({ number, image }) => ({ number, images: [image] })), [before]);
|
|
203
|
+
const compareSheet = rows.length > 0 ? await writeCompareSheet(dir, rows) : undefined;
|
|
204
|
+
const fields = {
|
|
205
|
+
runDir: dir,
|
|
206
|
+
source: { run: resolve(args.run), candidate: candidate.id },
|
|
207
|
+
spentUsd,
|
|
208
|
+
variations,
|
|
209
|
+
errors,
|
|
210
|
+
...(contact && { contactSheet: contact.file }),
|
|
211
|
+
...(compareSheet && { compareSheet: "compare.png" }),
|
|
212
|
+
};
|
|
213
|
+
const human = [
|
|
214
|
+
`${variations.length} of ${count} variation(s) of ${candidate.id}, $${spentUsd.toFixed(4)} spent`,
|
|
215
|
+
...variations.map((v) => ` ${v["file"]} outsideChange ${v["outsideChange"]}`),
|
|
216
|
+
...errors,
|
|
217
|
+
].join("\n");
|
|
218
|
+
if (variations.length === 0)
|
|
219
|
+
return refusal("provider_error", errors[0] ?? "no variation was made", fields, human);
|
|
220
|
+
return { exitCode: 0, fields, human };
|
|
221
|
+
},
|
|
222
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { KindRequest } from "../confirm/index.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The write request (design section 7): its digest covers the import, its frame files' bytes, the
|
|
4
|
+
* grouping's digest, the target, the jitter bound and a third-party origin's terms, and it shows
|
|
5
|
+
* the families, the grouping digest and those terms, so the person who confirms the write confirms
|
|
6
|
+
* the terms (issue #683).
|
|
7
|
+
*/
|
|
8
|
+
export declare function writeRequest(options: {
|
|
9
|
+
importDir: string;
|
|
10
|
+
grouping: unknown;
|
|
11
|
+
targetDir: string;
|
|
12
|
+
jitterBoundPx: number;
|
|
13
|
+
}): Promise<KindRequest>;
|
|
14
|
+
export declare const writeFamiliesCommand: import("./types.ts").CommandSpec<Record<string, unknown>>;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
import { formatReport } from "../animation/run.js";
|
|
5
|
+
import { digestOf, gateOf, requireConfirmation } from "../confirm/index.js";
|
|
6
|
+
import { readJson } from "../inputs.js";
|
|
7
|
+
import { parseOrigin, shownTerms, shownTermsText } from "../origin.js";
|
|
8
|
+
import { DEFAULT_JITTER_BOUND_PX, GROUPING_FILE, readImport, writeFamilies, } from "../sheet/import.js";
|
|
9
|
+
import { refusal } from "./result.js";
|
|
10
|
+
import { defineCommand } from "./types.js";
|
|
11
|
+
/** The sha256 of each frame file an import lists, by file; one that cannot be read is left out. */
|
|
12
|
+
async function frameHashes(importDir, files) {
|
|
13
|
+
const hashes = {};
|
|
14
|
+
for (const file of files) {
|
|
15
|
+
try {
|
|
16
|
+
hashes[file] = createHash("sha256")
|
|
17
|
+
.update(await readFile(join(importDir, file)))
|
|
18
|
+
.digest("hex");
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// writeFamilies reports a frame it cannot read.
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return hashes;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The write request (design section 7): its digest covers the import, its frame files' bytes, the
|
|
28
|
+
* grouping's digest, the target, the jitter bound and a third-party origin's terms, and it shows
|
|
29
|
+
* the families, the grouping digest and those terms, so the person who confirms the write confirms
|
|
30
|
+
* the terms (issue #683).
|
|
31
|
+
*/
|
|
32
|
+
export async function writeRequest(options) {
|
|
33
|
+
const groupingDigest = digestOf(options.grouping);
|
|
34
|
+
const record = await readImport(options.importDir);
|
|
35
|
+
const files = Array.isArray(record.frames) ? record.frames.map((f) => f.file) : [];
|
|
36
|
+
const terms = shownTerms(record.origin === undefined ? undefined : parseOrigin(record.origin, "import origin"));
|
|
37
|
+
const body = {
|
|
38
|
+
command: "write-families",
|
|
39
|
+
import: resolve(options.importDir),
|
|
40
|
+
inputs: {
|
|
41
|
+
import: digestOf(record),
|
|
42
|
+
frames: digestOf(await frameHashes(options.importDir, files)),
|
|
43
|
+
grouping: groupingDigest,
|
|
44
|
+
},
|
|
45
|
+
target: resolve(options.targetDir),
|
|
46
|
+
jitterBound: options.jitterBoundPx,
|
|
47
|
+
...(terms !== undefined && { terms }),
|
|
48
|
+
};
|
|
49
|
+
const g = options.grouping;
|
|
50
|
+
const families = Array.isArray(g?.families)
|
|
51
|
+
? g.families
|
|
52
|
+
.map((f) => f?.name)
|
|
53
|
+
.filter((n) => typeof n === "string")
|
|
54
|
+
: [];
|
|
55
|
+
const id = digestOf(body);
|
|
56
|
+
return {
|
|
57
|
+
kind: "write",
|
|
58
|
+
id,
|
|
59
|
+
summary: `write ${families.length} famil${families.length === 1 ? "y" : "ies"} into ${body.target}` +
|
|
60
|
+
(terms === undefined ? "" : `; ${shownTermsText(terms)}`),
|
|
61
|
+
details: {
|
|
62
|
+
families,
|
|
63
|
+
groupingDigest,
|
|
64
|
+
import: body.import,
|
|
65
|
+
target: body.target,
|
|
66
|
+
...(terms !== undefined && { terms }),
|
|
67
|
+
digest: id,
|
|
68
|
+
},
|
|
69
|
+
body,
|
|
70
|
+
grouping: options.grouping,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export const writeFamiliesCommand = defineCommand({
|
|
74
|
+
name: "write-families",
|
|
75
|
+
tool: "write_families",
|
|
76
|
+
summary: "write the strips of a human-confirmed grouping into the target, review pending",
|
|
77
|
+
details: `Writes one strip and manifest per family of a grouping (status "confirmed") into the
|
|
78
|
+
target with review pending, registered within the jitter bound in pixels. The grouping's status
|
|
79
|
+
grants nothing: a person confirms the write of these families and this grouping digest, and a
|
|
80
|
+
third-party origin's terms, which the request shows and its digest covers (design section 7) through headless settings, a record at <configDir>/confirmations/<hex>.json, an MCP client's form, the TTY,
|
|
81
|
+
or exit 8 confirmation_required and \`assetgrove confirm <hex>\`. Agents never confirm a write.
|
|
82
|
+
It spends nothing, so it asks no motion-template question: a family no grouping or spec declares a
|
|
83
|
+
template for, that no template is named for and no recorded decision chose one for, is written as
|
|
84
|
+
undecided, its ground-contact, footprint-drift and loop-seam checks pending ("not run: template
|
|
85
|
+
undecided") until \`animation-qa --import\` decides the template and runs them.`,
|
|
86
|
+
input: {
|
|
87
|
+
type: "object",
|
|
88
|
+
properties: {
|
|
89
|
+
import: {
|
|
90
|
+
type: "string",
|
|
91
|
+
description: "the import directory",
|
|
92
|
+
placeholder: "<import directory>",
|
|
93
|
+
},
|
|
94
|
+
target: {
|
|
95
|
+
type: "string",
|
|
96
|
+
description: "the directory to write into",
|
|
97
|
+
placeholder: "<target directory>",
|
|
98
|
+
},
|
|
99
|
+
grouping: {
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "the confirmed grouping",
|
|
102
|
+
placeholder: "<import>/grouping.json",
|
|
103
|
+
},
|
|
104
|
+
jitterBound: {
|
|
105
|
+
type: "number",
|
|
106
|
+
description: "the registration jitter bound in pixels",
|
|
107
|
+
default: DEFAULT_JITTER_BOUND_PX,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
required: ["import", "target"],
|
|
111
|
+
additionalProperties: false,
|
|
112
|
+
},
|
|
113
|
+
effect: { readOnly: false, spends: "never", writes: "target" },
|
|
114
|
+
confirm: "write",
|
|
115
|
+
async run(args, ctx) {
|
|
116
|
+
const importDir = args.import;
|
|
117
|
+
const groupingPath = args.grouping ?? join(importDir, GROUPING_FILE);
|
|
118
|
+
const grouping = (await readJson(groupingPath)).value;
|
|
119
|
+
const jitterBoundPx = args.jitterBound ?? DEFAULT_JITTER_BOUND_PX;
|
|
120
|
+
const confirmation = await requireConfirmation(await writeRequest({ importDir, grouping, targetDir: args.target, jitterBoundPx }), gateOf(ctx));
|
|
121
|
+
const result = await writeFamilies({
|
|
122
|
+
importDir,
|
|
123
|
+
grouping,
|
|
124
|
+
targetDir: args.target,
|
|
125
|
+
jitterBoundPx,
|
|
126
|
+
gate: gateOf(ctx),
|
|
127
|
+
...(ctx.extensions && { registry: ctx.extensions }),
|
|
128
|
+
confirmation,
|
|
129
|
+
});
|
|
130
|
+
const lines = [];
|
|
131
|
+
for (const f of result.families) {
|
|
132
|
+
lines.push(`${f.name}: ${f.frames.length} frames${f.mirrored ? " (mirrored)" : ""}, jitter ${f.jitterPx.toFixed(2)} px`, ` wrote ${f.result.mediaPath}`, ` wrote ${f.result.manifestPath}`);
|
|
133
|
+
for (const finding of f.result.ruleFindings ?? [])
|
|
134
|
+
if (finding.status === "failed" && finding.severity === "warning")
|
|
135
|
+
lines.push(`warning: project rule ${finding.rule}: ${finding.asset} (${finding.evidence})`);
|
|
136
|
+
if (f.fieldsNote !== undefined)
|
|
137
|
+
lines.push(` note: ${f.fieldsNote}`);
|
|
138
|
+
if (f.result.provenancePath)
|
|
139
|
+
lines.push(` wrote ${f.result.provenancePath}`);
|
|
140
|
+
lines.push(...formatReport({ ...f.animation, identityFlicker: "skipped", holes: "skipped" }).map((l) => ` ${l}`));
|
|
141
|
+
lines.push(` onion skin ${f.onionPath}`, ` loop preview ${f.loopPreviewPath}`);
|
|
142
|
+
for (const { preset, warnings } of f.result.handoff)
|
|
143
|
+
for (const warning of warnings ?? [])
|
|
144
|
+
lines.push(`warning: ${preset}: ${warning}`);
|
|
145
|
+
if (f.result.validator) {
|
|
146
|
+
lines.push(` target validator ${f.result.validator.accepted ? "accepted" : "REJECTED"} it` +
|
|
147
|
+
(f.result.validator.output ? `: ${f.result.validator.output}` : ""));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
lines.push(`preview loop: ${result.previewPath}`);
|
|
151
|
+
const fields = { ...result, confirmation };
|
|
152
|
+
const human = lines.join("\n");
|
|
153
|
+
if (result.families.some((f) => f.result.validator?.accepted === false)) {
|
|
154
|
+
return refusal("validator_rejected", "the target's validator rejected a written family", fields, human);
|
|
155
|
+
}
|
|
156
|
+
return { exitCode: 0, fields, human };
|
|
157
|
+
},
|
|
158
|
+
});
|