@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,262 @@
|
|
|
1
|
+
import { ProviderError } from "../errors.js";
|
|
2
|
+
import { createRaster, encodePng } from "../image/raster.js";
|
|
3
|
+
import { sha256 } from "../request.js";
|
|
4
|
+
import { forDecision } from "../identity.js";
|
|
5
|
+
/** The backdrop the frame is shown over, and the colour that marks each enclosed area. */
|
|
6
|
+
const BACKDROP = [46, 120, 52];
|
|
7
|
+
const MARK = [255, 0, 255];
|
|
8
|
+
/** The judged image's longer side is at least this many px. */
|
|
9
|
+
const VIEW_PX = 384;
|
|
10
|
+
/**
|
|
11
|
+
* The see-through areas the figure's outline encloses: runs of pixels below the alpha cut
|
|
12
|
+
* (8-connected) that do not reach the frame's edge, each at least `minPx` big. `marked` is 1 on
|
|
13
|
+
* every pixel of those areas.
|
|
14
|
+
*/
|
|
15
|
+
export function enclosedAreas(frame, options) {
|
|
16
|
+
const { width, height, data } = frame;
|
|
17
|
+
const n = width * height;
|
|
18
|
+
const open = (p) => (data[p * 4 + 3] ?? 0) < options.threshold;
|
|
19
|
+
const label = new Int32Array(n).fill(-1);
|
|
20
|
+
const marked = new Uint8Array(n);
|
|
21
|
+
const flood = (start, id) => {
|
|
22
|
+
const members = [];
|
|
23
|
+
const stack = [start];
|
|
24
|
+
label[start] = id;
|
|
25
|
+
while (stack.length > 0) {
|
|
26
|
+
const p = stack.pop();
|
|
27
|
+
members.push(p);
|
|
28
|
+
const x = p % width;
|
|
29
|
+
const y = (p - x) / width;
|
|
30
|
+
for (let dy = -1; dy <= 1; dy++) {
|
|
31
|
+
for (let dx = -1; dx <= 1; dx++) {
|
|
32
|
+
const xx = x + dx;
|
|
33
|
+
const yy = y + dy;
|
|
34
|
+
if (xx < 0 || yy < 0 || xx >= width || yy >= height)
|
|
35
|
+
continue;
|
|
36
|
+
const q = yy * width + xx;
|
|
37
|
+
if (label[q] !== -1 || !open(q))
|
|
38
|
+
continue;
|
|
39
|
+
label[q] = id;
|
|
40
|
+
stack.push(q);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return members;
|
|
45
|
+
};
|
|
46
|
+
for (let x = 0; x < width; x++) {
|
|
47
|
+
for (const p of [x, (height - 1) * width + x])
|
|
48
|
+
if (open(p) && label[p] === -1)
|
|
49
|
+
flood(p, 0);
|
|
50
|
+
}
|
|
51
|
+
for (let y = 0; y < height; y++) {
|
|
52
|
+
for (const p of [y * width, y * width + width - 1])
|
|
53
|
+
if (open(p) && label[p] === -1)
|
|
54
|
+
flood(p, 0);
|
|
55
|
+
}
|
|
56
|
+
const areas = [];
|
|
57
|
+
let next = 1;
|
|
58
|
+
for (let start = 0; start < n; start++) {
|
|
59
|
+
if (label[start] !== -1 || !open(start))
|
|
60
|
+
continue;
|
|
61
|
+
const members = flood(start, next++);
|
|
62
|
+
if (members.length < options.minPx)
|
|
63
|
+
continue;
|
|
64
|
+
let minX = width;
|
|
65
|
+
let minY = height;
|
|
66
|
+
let maxX = -1;
|
|
67
|
+
let maxY = -1;
|
|
68
|
+
for (const p of members) {
|
|
69
|
+
marked[p] = 1;
|
|
70
|
+
const x = p % width;
|
|
71
|
+
const y = (p - x) / width;
|
|
72
|
+
minX = Math.min(minX, x);
|
|
73
|
+
minY = Math.min(minY, y);
|
|
74
|
+
maxX = Math.max(maxX, x);
|
|
75
|
+
maxY = Math.max(maxY, y);
|
|
76
|
+
}
|
|
77
|
+
areas.push({
|
|
78
|
+
area: members.length,
|
|
79
|
+
x: minX,
|
|
80
|
+
y: minY,
|
|
81
|
+
width: maxX - minX + 1,
|
|
82
|
+
height: maxY - minY + 1,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return { areas, marked };
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The frame as the model sees it: enlarged over a green backdrop, the marked pixels (enclosed areas)
|
|
89
|
+
* over magenta. `under` sets the backdrop of every pixel instead (magenta, for the frame after removal).
|
|
90
|
+
*/
|
|
91
|
+
export function holeView(frame, marked, under = BACKDROP) {
|
|
92
|
+
const zoom = Math.max(1, Math.ceil(VIEW_PX / Math.max(frame.width, frame.height)));
|
|
93
|
+
const out = createRaster(frame.width * zoom, frame.height * zoom);
|
|
94
|
+
for (let y = 0; y < out.height; y++) {
|
|
95
|
+
for (let x = 0; x < out.width; x++) {
|
|
96
|
+
const p = Math.floor(y / zoom) * frame.width + Math.floor(x / zoom);
|
|
97
|
+
const a = (frame.data[p * 4 + 3] ?? 0) / 255;
|
|
98
|
+
const back = marked[p] ? MARK : under;
|
|
99
|
+
const o = (y * out.width + x) * 4;
|
|
100
|
+
for (let k = 0; k < 3; k++) {
|
|
101
|
+
out.data[o + k] = Math.round((frame.data[p * 4 + k] ?? 0) * a + (back[k] ?? 0) * (1 - a));
|
|
102
|
+
}
|
|
103
|
+
out.data[o + 3] = 255;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return out;
|
|
107
|
+
}
|
|
108
|
+
export function buildHolesPrompt(input) {
|
|
109
|
+
return [
|
|
110
|
+
`This is frame ${input.frame} of a "${input.family}" animation of ${input.subject}, enlarged, over a plain green backdrop. A program removed the character's original background.`,
|
|
111
|
+
`Magenta marks the ${input.areas === 1 ? "place" : `${input.areas} places`} where the picture is see-through although the character's outline surrounds it.`,
|
|
112
|
+
"A magenta area is either a natural opening between separate parts (between two legs, between a leg or an arm and the body, between the tail and the body), where the backdrop really shows through; or a hole in the middle of one part (the face, a marking, an eye, the torso, the tail, a stripe), where the removal wrongly cut the character away.",
|
|
113
|
+
].join("\n");
|
|
114
|
+
}
|
|
115
|
+
/** The enclosed-area view's question. */
|
|
116
|
+
export const ENCLOSED_QUESTION = {
|
|
117
|
+
type: "boolean",
|
|
118
|
+
instructions: "Is any magenta area a hole cut into one part of the character, rather than a natural opening between separate parts?",
|
|
119
|
+
whenTrue: "at least one magenta area is a hole in the middle of one part",
|
|
120
|
+
whenFalse: "every magenta area is a natural opening between separate parts",
|
|
121
|
+
};
|
|
122
|
+
/** The prompt of the before-and-after view. */
|
|
123
|
+
export function buildBeforeAfterPrompt(input) {
|
|
124
|
+
return [
|
|
125
|
+
`Image 1 is frame ${input.frame} of a "${input.family}" animation of ${input.subject}, enlarged, as it was drawn, before a program removed its background.`,
|
|
126
|
+
"Image 2 is the same frame after the removal, enlarged the same way, over a plain magenta backdrop: everything the program took for background shows magenta.",
|
|
127
|
+
"The original background and the natural gaps between separate parts (between two legs, between a leg or an arm and the body, between the tail and the body) should be gone. The character itself should be whole: a pale belly, muzzle, blaze, marking, eye, ear, whisker, tail tip or held prop that image 1 shows must still be there in image 2.",
|
|
128
|
+
].join("\n");
|
|
129
|
+
}
|
|
130
|
+
/** The before-and-after view's question (#376). */
|
|
131
|
+
export const BEFORE_AFTER_QUESTION = {
|
|
132
|
+
type: "boolean",
|
|
133
|
+
instructions: "Is any part of the character missing after background removal?",
|
|
134
|
+
whenTrue: "a part of the character that image 1 shows is magenta in image 2, wholly or in part (a bite out of the outline counts)",
|
|
135
|
+
whenFalse: "only the background and the natural gaps between separate parts were removed",
|
|
136
|
+
};
|
|
137
|
+
/** The pixels at or above the alpha cut: the frame's figure area. */
|
|
138
|
+
export function figureArea(frame, threshold) {
|
|
139
|
+
let area = 0;
|
|
140
|
+
for (let i = 3; i < frame.data.length; i += 4)
|
|
141
|
+
if ((frame.data[i] ?? 0) >= threshold)
|
|
142
|
+
area++;
|
|
143
|
+
return area;
|
|
144
|
+
}
|
|
145
|
+
/** The smallest enclosed area judged on a frame: `minShare` of its figure area, at least 1 px. */
|
|
146
|
+
export function holeMinPx(frame, options) {
|
|
147
|
+
return Math.max(1, Math.ceil(options.minShare * figureArea(frame, options.threshold)));
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* The frames (1-based) a holes check would send to the model. A frame with its image before
|
|
151
|
+
* removal is always sent; any other only with an enclosed see-through area of at least its
|
|
152
|
+
* share of the figure's area.
|
|
153
|
+
*/
|
|
154
|
+
export function holeCandidates(frames, options) {
|
|
155
|
+
return frames.flatMap((f, i) => {
|
|
156
|
+
const source = options.sources?.[i];
|
|
157
|
+
if (source)
|
|
158
|
+
return [{ frame: i + 1, view: "before-after", source }];
|
|
159
|
+
const minPx = holeMinPx(f, options);
|
|
160
|
+
const found = enclosedAreas(f, { threshold: options.threshold, minPx });
|
|
161
|
+
return found.areas.length === 0
|
|
162
|
+
? []
|
|
163
|
+
: [{ frame: i + 1, view: "enclosed", ...found, minPx }];
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
export function planHoles(frames, options, routes) {
|
|
167
|
+
const calls = holeCandidates(frames, options).length;
|
|
168
|
+
return {
|
|
169
|
+
calls,
|
|
170
|
+
model: routes.holes.model,
|
|
171
|
+
estimatedCostUsd: calls * routes.holes.estimatedCostUsd,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* A view as the model receives it: `holeView` enlarges by the longer side, so a tall narrow crop
|
|
176
|
+
* is still enlarged (crisp edges) until its shorter side reaches `MIN_DECISION_EDGE`, as the
|
|
177
|
+
* identity call does: some decision models reject small images (#27).
|
|
178
|
+
*/
|
|
179
|
+
export function viewReference(view, role, path) {
|
|
180
|
+
const bytes = encodePng(view);
|
|
181
|
+
return forDecision({ role, path, mediaType: "image/png", bytes, sha256: sha256(bytes) }, "crisp");
|
|
182
|
+
}
|
|
183
|
+
export async function checkHoles(options) {
|
|
184
|
+
const now = options.now ?? (() => new Date());
|
|
185
|
+
const reasons = [];
|
|
186
|
+
const decisions = [];
|
|
187
|
+
const candidates = holeCandidates(options.frames, options);
|
|
188
|
+
for (const c of candidates) {
|
|
189
|
+
const asked = c.view === "before-after"
|
|
190
|
+
? {
|
|
191
|
+
prompt: buildBeforeAfterPrompt({
|
|
192
|
+
subject: options.subject,
|
|
193
|
+
family: options.family,
|
|
194
|
+
frame: c.frame,
|
|
195
|
+
}),
|
|
196
|
+
images: [
|
|
197
|
+
viewReference(holeView(c.source.before, new Uint8Array(0)), `frame ${c.frame} before background removal`, `holes-frame-${c.frame}-before.png`),
|
|
198
|
+
viewReference(holeView(c.source.after, new Uint8Array(0), MARK), `frame ${c.frame} after background removal, over magenta`, `holes-frame-${c.frame}-after.png`),
|
|
199
|
+
],
|
|
200
|
+
question: BEFORE_AFTER_QUESTION,
|
|
201
|
+
}
|
|
202
|
+
: {
|
|
203
|
+
prompt: buildHolesPrompt({
|
|
204
|
+
subject: options.subject,
|
|
205
|
+
family: options.family,
|
|
206
|
+
frame: c.frame,
|
|
207
|
+
areas: c.areas.length,
|
|
208
|
+
}),
|
|
209
|
+
images: [
|
|
210
|
+
viewReference(holeView(options.frames[c.frame - 1], c.marked), `frame ${c.frame}, enclosed see-through areas in magenta`, `holes-frame-${c.frame}.png`),
|
|
211
|
+
],
|
|
212
|
+
question: ENCLOSED_QUESTION,
|
|
213
|
+
};
|
|
214
|
+
const { result, record } = await options.call.decide("holes", asked.prompt, asked.images, asked.question);
|
|
215
|
+
if (result.answer.type !== "boolean") {
|
|
216
|
+
throw new ProviderError("the holes decision gave no true or false");
|
|
217
|
+
}
|
|
218
|
+
const probability = Math.min(1, Math.max(0, result.answer.probability));
|
|
219
|
+
const label = probability >= 0.5 ? "holes" : "none";
|
|
220
|
+
const flagged = probability >= options.cutoff;
|
|
221
|
+
const said = c.view === "before-after"
|
|
222
|
+
? label === "holes"
|
|
223
|
+
? "part of the character is missing after background removal"
|
|
224
|
+
: "nothing of the character is missing after background removal"
|
|
225
|
+
: label === "holes"
|
|
226
|
+
? "a see-through area inside the outline is a hole cut into the character"
|
|
227
|
+
: "every see-through area inside the outline is an opening between parts";
|
|
228
|
+
decisions.push({
|
|
229
|
+
frame: c.frame,
|
|
230
|
+
view: c.view,
|
|
231
|
+
areas: c.view === "enclosed" ? c.areas : [],
|
|
232
|
+
model: record.model,
|
|
233
|
+
requestId: record.requestId,
|
|
234
|
+
label,
|
|
235
|
+
probability,
|
|
236
|
+
cutoff: options.cutoff,
|
|
237
|
+
flagged,
|
|
238
|
+
reason: said,
|
|
239
|
+
costUsd: record.costUsd,
|
|
240
|
+
at: now().toISOString(),
|
|
241
|
+
});
|
|
242
|
+
const head = c.view === "before-after"
|
|
243
|
+
? `frame ${c.frame}, before and after background removal`
|
|
244
|
+
: `frame ${c.frame}: ${c.areas.length} see-through area(s) inside the outline, ${c.areas.reduce((s, a) => s + a.area, 0)} px`;
|
|
245
|
+
reasons.push({
|
|
246
|
+
check: "holes",
|
|
247
|
+
passed: !flagged,
|
|
248
|
+
source: "decision",
|
|
249
|
+
frames: [c.frame],
|
|
250
|
+
reason: `${head}; ${said} (probability ${probability.toFixed(2)} ${flagged ? "≥" : "<"} cutoff ${options.cutoff})`,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
if (candidates.length === 0) {
|
|
254
|
+
reasons.push({
|
|
255
|
+
check: "holes",
|
|
256
|
+
passed: true,
|
|
257
|
+
source: "deterministic",
|
|
258
|
+
reason: `no frame has a see-through area inside the figure's outline of ${options.minShare} of its figure area or more; with no image before background removal, a cut that reaches the outline is not judged`,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
return { reasons, decisions };
|
|
262
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Raster } from "../image/raster.ts";
|
|
2
|
+
import type { Point, Size } from "../types.ts";
|
|
3
|
+
/** Media types of the two preview files, for callers that declare each output's type. */
|
|
4
|
+
export declare const PREVIEW_MEDIA_TYPES: {
|
|
5
|
+
readonly onion: "image/png";
|
|
6
|
+
readonly preview: "image/webp";
|
|
7
|
+
};
|
|
8
|
+
/** Whole-number zoom that brings a frame's longer side near 192 px. */
|
|
9
|
+
export declare function previewZoom(frame: Size): number;
|
|
10
|
+
/**
|
|
11
|
+
* One onion cell: `frame` at full opacity over the faint previous (red) and next (blue) frames,
|
|
12
|
+
* with the ground line and anchor, drawn as `onionSkinSheet` draws each of its cells.
|
|
13
|
+
*/
|
|
14
|
+
export declare function onionCell(frame: Raster, options: {
|
|
15
|
+
previous?: Raster;
|
|
16
|
+
next?: Raster;
|
|
17
|
+
anchor: Point;
|
|
18
|
+
}): Raster;
|
|
19
|
+
/**
|
|
20
|
+
* A grid of cells, one per frame, each showing the frame over its neighbours: the previous frame
|
|
21
|
+
* tinted red and the next tinted blue, both faint. A loop wraps the neighbours, so frame 1 shows
|
|
22
|
+
* the last and the last shows frame 1. A final row holds every frame overlaid, so drift shows at a
|
|
23
|
+
* glance. The ground line and anchor cross are drawn in each cell; flagged frames get a red border.
|
|
24
|
+
*/
|
|
25
|
+
export declare function onionSkinSheet(frames: Raster[], options: {
|
|
26
|
+
anchor: Point;
|
|
27
|
+
loop: boolean;
|
|
28
|
+
flagged?: number[];
|
|
29
|
+
}): Raster;
|
|
30
|
+
/**
|
|
31
|
+
* One frame flattened over the neutral opaque backdrop the loop preview uses, at its own size:
|
|
32
|
+
* the frame as a viewer sees it, whatever a model does with transparent pixels.
|
|
33
|
+
*/
|
|
34
|
+
export declare function flattenFrame(frame: Raster): Raster;
|
|
35
|
+
/** A looping animated WebP of the frames, zoomed and flattened over a neutral opaque backdrop. */
|
|
36
|
+
export declare function loopPreview(frames: Raster[], options: {
|
|
37
|
+
durationMs: number;
|
|
38
|
+
}): Uint8Array;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { drawDigits, textWidth } from "../image/digits.js";
|
|
2
|
+
import { createRaster, getPixel, setPixel } from "../image/raster.js";
|
|
3
|
+
import { encodeAnimatedWebp } from "../image/webp.js";
|
|
4
|
+
/** Media types of the two preview files, for callers that declare each output's type. */
|
|
5
|
+
export const PREVIEW_MEDIA_TYPES = { onion: "image/png", preview: "image/webp" };
|
|
6
|
+
const BACKDROP = 236;
|
|
7
|
+
const MAX_COLUMNS = 8;
|
|
8
|
+
const PAD = 4;
|
|
9
|
+
const LABEL_HEIGHT = 20;
|
|
10
|
+
const NEIGHBOUR_OPACITY = 0.35;
|
|
11
|
+
const OVERLAY_OPACITY = 0.3;
|
|
12
|
+
const PREVIOUS_TINT = [255, 0, 0];
|
|
13
|
+
const NEXT_TINT = [0, 80, 255];
|
|
14
|
+
const GROUND_COLOUR = [0, 150, 90, 255];
|
|
15
|
+
const FLAG_COLOUR = [220, 0, 0, 255];
|
|
16
|
+
const LABEL_COLOUR = [30, 30, 36, 255];
|
|
17
|
+
/** Whole-number zoom that brings a frame's longer side near 192 px. */
|
|
18
|
+
export function previewZoom(frame) {
|
|
19
|
+
return Math.max(1, Math.floor(192 / Math.max(frame.width, frame.height)));
|
|
20
|
+
}
|
|
21
|
+
/** Source-over of one pixel onto the raster, `opacity` scaling the pixel's own alpha. */
|
|
22
|
+
function over(out, x, y, [r, g, b, a], opacity) {
|
|
23
|
+
if (x < 0 || y < 0 || x >= out.width || y >= out.height)
|
|
24
|
+
return;
|
|
25
|
+
const alpha = ((a ?? 0) / 255) * opacity;
|
|
26
|
+
if (alpha <= 0)
|
|
27
|
+
return;
|
|
28
|
+
const [dr, dg, db, da] = getPixel(out, x, y);
|
|
29
|
+
const outAlpha = alpha + (da / 255) * (1 - alpha);
|
|
30
|
+
const mix = (s, d) => Math.round((s * alpha + d * (da / 255) * (1 - alpha)) / outAlpha);
|
|
31
|
+
setPixel(out, x, y, [
|
|
32
|
+
mix(r ?? 0, dr),
|
|
33
|
+
mix(g ?? 0, dg),
|
|
34
|
+
mix(b ?? 0, db),
|
|
35
|
+
Math.round(outAlpha * 255),
|
|
36
|
+
]);
|
|
37
|
+
}
|
|
38
|
+
/** Draws `frame` zoomed with its top-left at (ox, oy), optionally pulled halfway toward a tint. */
|
|
39
|
+
function drawFrame(out, frame, ox, oy, zoom, opacity, tint) {
|
|
40
|
+
for (let y = 0; y < frame.height; y++) {
|
|
41
|
+
for (let x = 0; x < frame.width; x++) {
|
|
42
|
+
const [r, g, b, a] = getPixel(frame, x, y);
|
|
43
|
+
if (a === 0)
|
|
44
|
+
continue;
|
|
45
|
+
const px = tint
|
|
46
|
+
? [(r + (tint[0] ?? 0)) >> 1, (g + (tint[1] ?? 0)) >> 1, (b + (tint[2] ?? 0)) >> 1, a]
|
|
47
|
+
: [r, g, b, a];
|
|
48
|
+
for (let sy = 0; sy < zoom; sy++) {
|
|
49
|
+
for (let sx = 0; sx < zoom; sx++)
|
|
50
|
+
over(out, ox + x * zoom + sx, oy + y * zoom + sy, px, opacity);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function fill(out, x, y, w, h, rgba) {
|
|
56
|
+
for (let yy = y; yy < y + h; yy++)
|
|
57
|
+
for (let xx = x; xx < x + w; xx++)
|
|
58
|
+
over(out, xx, yy, rgba, 1);
|
|
59
|
+
}
|
|
60
|
+
function drawGuides(out, ox, oy, size, anchor, zoom) {
|
|
61
|
+
const gy = Math.min(size.height * zoom - 1, (anchor.y + 1) * zoom - 1);
|
|
62
|
+
fill(out, ox, oy + gy, size.width * zoom, 1, GROUND_COLOUR);
|
|
63
|
+
const cx = anchor.x * zoom + Math.floor(zoom / 2);
|
|
64
|
+
fill(out, ox + cx - 3, oy + gy, 7, 1, GROUND_COLOUR);
|
|
65
|
+
fill(out, ox + cx, oy + gy - 3, 1, 7, GROUND_COLOUR);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* One onion cell: `frame` at full opacity over the faint previous (red) and next (blue) frames,
|
|
69
|
+
* with the ground line and anchor, drawn as `onionSkinSheet` draws each of its cells.
|
|
70
|
+
*/
|
|
71
|
+
export function onionCell(frame, options) {
|
|
72
|
+
const size = { width: frame.width, height: frame.height };
|
|
73
|
+
const zoom = previewZoom(size);
|
|
74
|
+
const out = createRaster(size.width * zoom + 2 * PAD, size.height * zoom + 2 * PAD);
|
|
75
|
+
for (let i = 0; i < out.data.length; i += 4)
|
|
76
|
+
out.data.set([BACKDROP, BACKDROP, BACKDROP, 255], i);
|
|
77
|
+
if (options.previous)
|
|
78
|
+
drawFrame(out, options.previous, PAD, PAD, zoom, NEIGHBOUR_OPACITY, PREVIOUS_TINT);
|
|
79
|
+
if (options.next)
|
|
80
|
+
drawFrame(out, options.next, PAD, PAD, zoom, NEIGHBOUR_OPACITY, NEXT_TINT);
|
|
81
|
+
drawFrame(out, frame, PAD, PAD, zoom, 1);
|
|
82
|
+
drawGuides(out, PAD, PAD, size, options.anchor, zoom);
|
|
83
|
+
return out;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A grid of cells, one per frame, each showing the frame over its neighbours: the previous frame
|
|
87
|
+
* tinted red and the next tinted blue, both faint. A loop wraps the neighbours, so frame 1 shows
|
|
88
|
+
* the last and the last shows frame 1. A final row holds every frame overlaid, so drift shows at a
|
|
89
|
+
* glance. The ground line and anchor cross are drawn in each cell; flagged frames get a red border.
|
|
90
|
+
*/
|
|
91
|
+
export function onionSkinSheet(frames, options) {
|
|
92
|
+
const first = frames[0];
|
|
93
|
+
if (!first)
|
|
94
|
+
throw new Error("An onion-skin sheet needs at least one frame");
|
|
95
|
+
const size = { width: first.width, height: first.height };
|
|
96
|
+
const zoom = previewZoom(size);
|
|
97
|
+
const cellW = size.width * zoom + 2 * PAD;
|
|
98
|
+
const cellH = size.height * zoom + PAD + LABEL_HEIGHT;
|
|
99
|
+
const columns = Math.min(MAX_COLUMNS, frames.length);
|
|
100
|
+
const gridRows = Math.ceil(frames.length / columns);
|
|
101
|
+
const out = createRaster(columns * cellW, (gridRows + 1) * cellH);
|
|
102
|
+
for (let i = 0; i < out.data.length; i += 4)
|
|
103
|
+
out.data.set([BACKDROP, BACKDROP, BACKDROP, 255], i);
|
|
104
|
+
const flagged = new Set(options.flagged ?? []);
|
|
105
|
+
const count = frames.length;
|
|
106
|
+
frames.forEach((frame, i) => {
|
|
107
|
+
const cx = (i % columns) * cellW;
|
|
108
|
+
const cy = Math.floor(i / columns) * cellH;
|
|
109
|
+
const previous = frames[options.loop ? (i + count - 1) % count : i - 1];
|
|
110
|
+
const next = frames[options.loop ? (i + 1) % count : i + 1];
|
|
111
|
+
if (previous)
|
|
112
|
+
drawFrame(out, previous, cx + PAD, cy + PAD, zoom, NEIGHBOUR_OPACITY, PREVIOUS_TINT);
|
|
113
|
+
if (next)
|
|
114
|
+
drawFrame(out, next, cx + PAD, cy + PAD, zoom, NEIGHBOUR_OPACITY, NEXT_TINT);
|
|
115
|
+
drawFrame(out, frame, cx + PAD, cy + PAD, zoom, 1);
|
|
116
|
+
drawGuides(out, cx + PAD, cy + PAD, size, options.anchor, zoom);
|
|
117
|
+
const label = String(i + 1);
|
|
118
|
+
drawDigits(out, label, cx + Math.floor((cellW - textWidth(label, 2)) / 2), cy + cellH - 14, 2, LABEL_COLOUR);
|
|
119
|
+
if (flagged.has(i + 1)) {
|
|
120
|
+
fill(out, cx, cy, cellW, 2, FLAG_COLOUR);
|
|
121
|
+
fill(out, cx, cy + cellH - 2, cellW, 2, FLAG_COLOUR);
|
|
122
|
+
fill(out, cx, cy, 2, cellH, FLAG_COLOUR);
|
|
123
|
+
fill(out, cx + cellW - 2, cy, 2, cellH, FLAG_COLOUR);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
const oy = gridRows * cellH;
|
|
127
|
+
for (const frame of frames)
|
|
128
|
+
drawFrame(out, frame, PAD, oy + PAD, zoom, OVERLAY_OPACITY);
|
|
129
|
+
drawGuides(out, PAD, oy + PAD, size, options.anchor, zoom);
|
|
130
|
+
return out;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* One frame flattened over the neutral opaque backdrop the loop preview uses, at its own size:
|
|
134
|
+
* the frame as a viewer sees it, whatever a model does with transparent pixels.
|
|
135
|
+
*/
|
|
136
|
+
export function flattenFrame(frame) {
|
|
137
|
+
const out = createRaster(frame.width, frame.height);
|
|
138
|
+
for (let i = 0; i < out.data.length; i += 4)
|
|
139
|
+
out.data.set([BACKDROP, BACKDROP, BACKDROP, 255], i);
|
|
140
|
+
drawFrame(out, frame, 0, 0, 1, 1);
|
|
141
|
+
return out;
|
|
142
|
+
}
|
|
143
|
+
/** A looping animated WebP of the frames, zoomed and flattened over a neutral opaque backdrop. */
|
|
144
|
+
export function loopPreview(frames, options) {
|
|
145
|
+
const first = frames[0];
|
|
146
|
+
if (!first)
|
|
147
|
+
throw new Error("A loop preview needs at least one frame");
|
|
148
|
+
const zoom = previewZoom(first);
|
|
149
|
+
const flat = frames.map((frame) => {
|
|
150
|
+
const out = createRaster(frame.width * zoom, frame.height * zoom);
|
|
151
|
+
for (let i = 0; i < out.data.length; i += 4)
|
|
152
|
+
out.data.set([BACKDROP, BACKDROP, BACKDROP, 255], i);
|
|
153
|
+
drawFrame(out, frame, 0, 0, zoom, 1);
|
|
154
|
+
return out;
|
|
155
|
+
});
|
|
156
|
+
return encodeAnimatedWebp(flat, {
|
|
157
|
+
durationMs: options.durationMs,
|
|
158
|
+
loopCount: 0,
|
|
159
|
+
background: [BACKDROP, BACKDROP, BACKDROP, 255],
|
|
160
|
+
});
|
|
161
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic pixel animation QA of one strip: frame count, timing and beats against the
|
|
3
|
+
* family's motion template, ground contact, footprint drift, silhouette change
|
|
4
|
+
* between frames, the loop seam and a colour halo at the figure's edge. Every check adds a reason whether it passes or not, and each
|
|
5
|
+
* failing reason names the frame(s) in 1-based numbers.
|
|
6
|
+
*/
|
|
7
|
+
import type { Raster } from "../image/raster.ts";
|
|
8
|
+
import type { ResolvedStyle } from "../style.ts";
|
|
9
|
+
import type { Point, TargetProfile } from "../types.ts";
|
|
10
|
+
import type { TemplateChoice } from "./template-choice.ts";
|
|
11
|
+
import type { AnimationFrameMeasure, AnimationReport, AnimationThresholds, MotionTemplate, StripInput } from "./types.ts";
|
|
12
|
+
/**
|
|
13
|
+
* Animation QA's model-backed checks, identity flicker and holes (src/qa/stability.ts): they
|
|
14
|
+
* filter only where measured stable on the run's model, otherwise their reasons are advisory.
|
|
15
|
+
*/
|
|
16
|
+
export { ANIMATION_VISION_CHECKS } from "../qa/stability.ts";
|
|
17
|
+
/** Baseline, top row, alpha-weighted centre of mass, area and footprint of every frame. */
|
|
18
|
+
export declare function measureStrip(frames: Raster[], anchor: Point, threshold: number): AnimationFrameMeasure[];
|
|
19
|
+
/**
|
|
20
|
+
* The centre x of the pixels at or above the threshold in the bottom `band` (0..1) of the figure's
|
|
21
|
+
* height, up from its baseline: where the feet near the ground are, taken together.
|
|
22
|
+
*/
|
|
23
|
+
export declare function bandCentre(r: Raster, baseline: number, band: number, threshold: number): number;
|
|
24
|
+
/** 1 − IoU of the two alpha masks; 0 when both are empty. */
|
|
25
|
+
export declare function silhouetteChange(a: Raster, b: Raster, threshold: number): number;
|
|
26
|
+
/** Mean of the silhouette change and the mean RGB difference over the union of the masks. */
|
|
27
|
+
export declare function frameDistance(a: Raster, b: Raster, threshold: number): number;
|
|
28
|
+
/** A looping strip's seam: the last → first frame distance and the bound it is held to. */
|
|
29
|
+
export interface LoopSeam {
|
|
30
|
+
seam: number;
|
|
31
|
+
/** `loopSeamRatio` × the largest consecutive step, never below `loopSeamRatio` × `loopSeamFloor`. */
|
|
32
|
+
bound: number;
|
|
33
|
+
/** Whether the loop closes without a visible jump: the seam is within the bound. */
|
|
34
|
+
closes: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** The loop seam of two or more frames, as the `loop-seam` check measures it. */
|
|
37
|
+
export declare function loopSeam(frames: Raster[], threshold: number, thresholds: Pick<AnimationThresholds, "loopSeamRatio" | "loopSeamFloor">): LoopSeam;
|
|
38
|
+
export declare function checkAnimation(input: StripInput, options: {
|
|
39
|
+
/** The template to judge by; shorthand for a `choice` of a template named like the family. */
|
|
40
|
+
template?: MotionTemplate;
|
|
41
|
+
/**
|
|
42
|
+
* How the family's template was chosen (src/animation/template-choice.ts). With no template,
|
|
43
|
+
* the contact, footprint and loop-seam checks are not applicable.
|
|
44
|
+
*/
|
|
45
|
+
choice?: TemplateChoice;
|
|
46
|
+
thresholds: AnimationThresholds;
|
|
47
|
+
threshold: number;
|
|
48
|
+
/** The declared gait; picks the template's rule under `gaits`. */
|
|
49
|
+
gait?: string;
|
|
50
|
+
}): AnimationReport;
|
|
51
|
+
/**
|
|
52
|
+
* The strip checked against the profile's templates and thresholds and the style's alpha cut,
|
|
53
|
+
* under the input's gait (from the asset spec), else the profile's `animation.gait`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function animationQa(input: StripInput, profile: Pick<TargetProfile, "animation">, style: ResolvedStyle,
|
|
56
|
+
/** The family's template as chosen for this run; without it, the declared or named one only. */
|
|
57
|
+
choice?: TemplateChoice): AnimationReport;
|